From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 01:25:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2013D6EF; Sun, 22 Mar 2015 01: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 0A73A696; Sun, 22 Mar 2015 01:25:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2M1PwI9061292; Sun, 22 Mar 2015 01:25:58 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2M1Pwvr061291; Sun, 22 Mar 2015 01:25:58 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201503220125.t2M1Pwvr061291@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Sun, 22 Mar 2015 01:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280336 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 01:25:59 -0000 Author: wblock (doc committer) Date: Sun Mar 22 01:25:57 2015 New Revision: 280336 URL: https://svnweb.freebsd.org/changeset/base/280336 Log: Describe the behavior when both -f and a message are given. Pointed out by Raphael Abreu on freebsd-doc. MFC after: 1 week Modified: head/usr.bin/logger/logger.1 Modified: head/usr.bin/logger/logger.1 ============================================================================== --- head/usr.bin/logger/logger.1 Sat Mar 21 23:39:34 2015 (r280335) +++ head/usr.bin/logger/logger.1 Sun Mar 22 01:25:57 2015 (r280336) @@ -28,7 +28,7 @@ .\" @(#)logger.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 4, 2014 +.Dd March 21, 2015 .Dt LOGGER 1 .Os .Sh NAME @@ -75,6 +75,7 @@ with each line. Log the message to standard error, as well as the system log. .It Fl f Ar file Read the contents of the specified file into syslog. +This option is ignored when a message is also specified. .It Fl h Ar host Send the message to the remote system .Ar host From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 02:15:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E5E8DAD; Sun, 22 Mar 2015 02: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 580F7AE2; Sun, 22 Mar 2015 02:15:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2M2FB72084918; Sun, 22 Mar 2015 02:15:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2M2FAD9084914; Sun, 22 Mar 2015 02:15:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503220215.t2M2FAD9084914@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 22 Mar 2015 02:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280337 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:15:11 -0000 Author: adrian Date: Sun Mar 22 02:15:09 2015 New Revision: 280337 URL: https://svnweb.freebsd.org/changeset/base/280337 Log: Add initial D-Link DIR-655 (A1) support. This is based on the AP135 design - QCA9558 SoC, 3x3 2GHz wifi, but no 5GHz (11n or 11ac) chip is available. It however still has 128MiB of RAM, 16MiB of NOR flash and the AR8327N gigabit switch - so it's quite a beefy router device. Tested: * Well, a unit, naturally Obtained from: Completely messing up an amazon.com order and getting this instead, and asking "hey, wonder if I could.." Added: head/sys/mips/conf/DIR-655A1 (contents, props changed) head/sys/mips/conf/DIR-655A1.hints (contents, props changed) Added: head/sys/mips/conf/DIR-655A1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DIR-655A1 Sun Mar 22 02:15:09 2015 (r280337) @@ -0,0 +1,56 @@ +# +# DIR-655A1 - 3x3 2GHz D-Link AP +# +# This contains a QCA9558 MIPS74k SoC with on-board 3x3 2GHz wifi, +# 128MiB RAM, an AR8327 5-port gigabit ethernet switch. +# +# $FreeBSD$ +# + +# Include the default QCA955x parameters +include "QCA955X_BASE" + +ident DIR-655A1 + +# Override hints with board values +hints "DIR-655A1.hints" + +# Force the board memory - the base AP135 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 + +# uzip - to boot natively from flash +device geom_uncompress +options GEOM_UNCOMPRESS + +# Used for the static uboot partition map +device geom_map + +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\" + +# Default to accept +options IPFIREWALL_DEFAULT_TO_ACCEPT Added: head/sys/mips/conf/DIR-655A1.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DIR-655A1.hints Sun Mar 22 02:15:09 2015 (r280337) @@ -0,0 +1,153 @@ + +# I'm assuming this is an AP135-020. The AP136-010 in openwrt has +# the ethernet ports wired up to the switch in the reverse way. + +# $FreeBSD$ + +# QCA955X_ETH_CFG_RGMII_EN (1 << 0) +hint.qca955x_gmac.0.gmac_cfg=0x1 + +# mdiobus0 on arge0 +hint.argemdio.0.at="nexus0" +hint.argemdio.0.maddr=0x19000000 +hint.argemdio.0.msize=0x1000 +hint.argemdio.0.order=0 + +# mdiobus1 on arge1 - required to bring up arge1? +hint.argemdio.1.at="nexus0" +hint.argemdio.1.maddr=0x1a000000 +hint.argemdio.1.msize=0x1000 +hint.argemdio.1.order=0 + +# AR8327 - connected via mdiobus0 on arge0 +hint.arswitch.0.at="mdio0" +hint.arswitch.0.is_7240=0 # definitely not the internal switch! +hint.arswitch.0.is_9340=0 # not the internal switch! +hint.arswitch.0.numphys=5 # all ports are PHYs +hint.arswitch.0.phy4cpu=0 +hint.arswitch.0.is_rgmii=0 # not needed +hint.arswitch.0.is_gmii=0 # not needed + +# This is where it gets a bit odd. port 0 and port 6 are CPU ports. +# The current code only supports one CPU port. So hm, what should +# we do to hook PAD6 up to be RGMII but a PHY, not a MAC? + +# The other trick - how do we get arge1 (hooked up to GMAC0) to work? +# That's currently supposed to be hooked up to CPU port 0. + +# Other AR8327 configuration parameters + +# AP136-020 parameters + +# GMAC0 AR8327 -> GMAC1 (arge1) SoC, SGMII + +# AR8327_PAD_MAC_SGMII +hint.arswitch.0.pad.0.mode=3 +#hint.arswitch.0.pad.0.rxclk_delay_sel=0 +hint.arswitch.0.pad.0.sgmii_delay_en=1 + +# GMAC6 AR8327 -> GMAC0 (arge0) SoC, RGMII + +# AR8327_PAD_MAC_RGMII +# XXX I think this hooks it up to the internal MAC6 +hint.arswitch.0.pad.6.mode=6 +hint.arswitch.0.pad.6.txclk_delay_en=1 +hint.arswitch.0.pad.6.rxclk_delay_en=1 +# AR8327_CLK_DELAY_SEL1 +hint.arswitch.0.pad.6.txclk_delay_sel=1 +# AR8327_CLK_DELAY_SEL2 +hint.arswitch.0.pad.6.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 + +# force_link=1 is required for the rest of the parameters +# to be configured. +hint.arswitch.0.port.6.force_link=1 +hint.arswitch.0.port.6.speed=1000 +hint.arswitch.0.port.6.duplex=1 +hint.arswitch.0.port.6.txpause=1 +hint.arswitch.0.port.6.rxpause=1 + +# arge0 - hooked up to AR8327 GMAC6, RGMII +# set at 1000/full to the switch. +# so, lock both sides of this connect up to 1000/full; +# if_arge thus wont change the PLL configuration +# upon a link status change. +hint.arge.0.phymask=0x0 +hint.arge.0.miimode=3 # RGMII +hint.arge.0.media=1000 +hint.arge.0.fduplex=1 +hint.arge.0.pll_1000=0x56000000 + +# MAC for arge0 is the first 6 bytes of the ART +hint.arge.0.eeprommac=0x1fff0000 + +# arge1 - lock up to 1000/full +hint.arge.1.phymask=0x0 +hint.arge.1.media=1000 +hint.arge.1.fduplex=1 +hint.arge.1.miimode=5 # SGMII +hint.arge.1.pll_1000=0x03000101 + +# MAC for arge1 is the second 6 bytes of the ART +hint.arge.1.eeprommac=0x1fff0006 + +# ath0: Where the ART is - last 64k in the flash +hint.ath.0.eepromaddr=0x1fff0000 +hint.ath.0.eepromsize=16384 + +# 256KiB u-boot +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00040000 # 256k u-boot +hint.map.0.name="u-boot" +hint.map.0.readonly=1 + +# kernel +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00040000 +hint.map.1.end="search:0x00040000:0x10000:.!/bin/sh" +hint.map.1.name="kernel" +hint.map.1.readonly=1 + +# rootfs +hint.map.2.at="flash/spi0" +hint.map.2.start="search:0x00040000:0x10000:.!/bin/sh" +hint.map.2.end=0x007d0000 +hint.map.2.name="rootfs" +hint.map.2.readonly=1 + +# 64KiB cfg +hint.map.3.at="flash/spi0" +hint.map.3.start=0x007d0000 +hint.map.3.end=0x007e0000 +hint.map.3.name="cfg" +hint.map.3.readonly=0 + +# 8256 KiB mib0 +hint.map.4.at="flash/spi0" +hint.map.4.start=0x007e0000 +hint.map.4.end=0x00ff0000 # 64k mib0 +hint.map.4.name="mib0" +hint.map.4.readonly=1 + +# 64KiB ART +# XXX TODO: is this really here? +hint.map.5.at="flash/spi0" +hint.map.5.start=0x00ff0000 +hint.map.5.end=0x01000000 # 64k ART +hint.map.5.name="ART" +hint.map.5.readonly=1 From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 09:09:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83C9ABC4; Sun, 22 Mar 2015 09:09: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 6E8AF5FE; Sun, 22 Mar 2015 09:09:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2M99RYg073624; Sun, 22 Mar 2015 09:09:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2M99RXU073623; Sun, 22 Mar 2015 09:09:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503220909.t2M99RXU073623@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 22 Mar 2015 09:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280342 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 09:09:28 -0000 Author: kib Date: Sun Mar 22 09:09:26 2015 New Revision: 280342 URL: https://svnweb.freebsd.org/changeset/base/280342 Log: msdosfs: mark unused compat-mount fields The magic number MSDOSFS_ARGSMAGIC, which used to distinguish "old" vs "new" msdosfs mount arguments, has not been used since 2005; it should just go away now. Likewise, the local-to-Unicode table that changed at the same time is unused. Leave the space reserved in the old style mount arguments, though, since we still support the old mount call (via the cmount entry point). Submitted by: Chris Torek MFC after: 2 weeks Modified: head/sys/fs/msdosfs/msdosfsmount.h Modified: head/sys/fs/msdosfs/msdosfsmount.h ============================================================================== --- head/sys/fs/msdosfs/msdosfsmount.h Sun Mar 22 08:47:35 2015 (r280341) +++ head/sys/fs/msdosfs/msdosfsmount.h Sun Mar 22 09:09:26 2015 (r280342) @@ -239,8 +239,8 @@ struct msdosfs_args { gid_t gid; /* gid that owns msdosfs files */ mode_t mask; /* file mask to be applied for msdosfs perms */ int flags; /* see below */ - int magic; /* version number */ - u_int16_t u2w[128]; /* Local->Unicode table */ + int unused1; /* unused, was version number */ + u_int16_t unused2[128]; /* no longer used, was Local->Unicode table */ char *cs_win; /* Windows(Unicode) Charset */ char *cs_dos; /* DOS Charset */ char *cs_local; /* Local Charset */ @@ -264,6 +264,4 @@ struct msdosfs_args { #define MSDOSFS_LARGEFS 0x10000000 /* perform fileno mapping */ #define MSDOSFS_FSIMOD 0x01000000 -#define MSDOSFS_ARGSMAGIC 0xe4eff300 - #endif /* !_MSDOSFS_MSDOSFSMOUNT_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 09:33:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19C6739A; Sun, 22 Mar 2015 09:33: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 80B178A2; Sun, 22 Mar 2015 09:33:02 +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 t2M9WrU0002285 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 22 Mar 2015 11:32:53 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2M9WrU0002285 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2M9Wpne002284; Sun, 22 Mar 2015 11:32:51 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 22 Mar 2015 11:32:51 +0200 From: Konstantin Belousov To: Bruce Evans Subject: Re: svn commit: r280279 - head/sys/sys Message-ID: <20150322093251.GY2379@kib.kiev.ua> References: <201503201027.t2KAR6Ze053047@svn.freebsd.org> <20150320130216.GS2379@kib.kiev.ua> <550D9699.7070703@FreeBSD.org> <20150321163536.GK2379@kib.kiev.ua> <550DA656.5060004@FreeBSD.org> <20150322080015.O955@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150322080015.O955@besplex.bde.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, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 09:33:03 -0000 On Sun, Mar 22, 2015 at 09:41:53AM +1100, Bruce Evans wrote: > On Sat, 21 Mar 2015, John Baldwin wrote: > > > On 3/21/15 12:35 PM, Konstantin Belousov wrote: > X static int > X popcnt_pc_map_elem(uint64_t elem) > X { > X int count; > X > X /* > X * This simple method of counting the one bits performs well because > X * the given element typically contains more zero bits than one bits. > X */ > X count = 0; > X for (; elem != 0; elem &= elem - 1) > X count++; > X return (count); > X } > ... > > Perhaps this appeared to perform well not for the reason stated in its > comment, but because it was tested with excessive CFLAGS, and the compiler > actually reduced it to popcntq, and the test machine didn't have the > bug. No, it probably did not, since popcntq does not exist on the generic amd64 machine. > > In a game program that I wrote, efficiency of popcount() was actually > important since it was used in inner loops. I used lookup tables for > popcount() and a couple of application-specific functions and even for > fls(). This seemed to be better than the the existing bsf instruction, > so it can't be bad for popcount(). The lookup was limited to bitsets > of length 13 in the low bits of an int, so the table sizes were only > 2**13 = 4096. bitsets of length 64 would need multiple steps. However, > if the above performs well without compiler optimizations, then it must > be because usually only the lowest few bits are set. Then it would > perform even better with even smaller (8-bit) tables combined with an > early exit: > > count = 0; > for (; elem != 0; elem >>= 8) > count += lookup[elem &0xff]; > return (count); > > Many variations on this are possible. E.g., use fls() to decide where to > start; or avoid all branches, and add up the results in parallel. For > bitcount32, the latter is: > > bitcount64(x) := bitcount32(x & 0xffffffff) + bitcount32(x >> 32); > bitcount32(x) := bitcount16(x & 0xffff) + bitcount16(x >> 16); > bitcount16(x) := bitcount8(x & 0xff) + bitcount8(x >> 8); > bitcount8(x) := lookup[x]; > > Compilers won't be able to optimize the lookup methods. They might be > able to convert the current bitcount*() to popcnt*. Last time I looked, > clang but not gcc converted very complicated expressions for bswap*() > to bswap* instructions. > > >>> There's no way we can preemptively locate every bit of C that clang might > >>> decide to replace with popcount and fix them to employ a workaround. I think > >>> the only viable solution is to use "-mno-popcount" on all compilers that aren't > >>> known to be fixed. > > Why bother? It is only a short-lived and small(?) efficiency bug. > > >> Both you and Bruce and Jilles state this, but I am unable to understand the > >> argument about the compiler. Can somebody explain this to me, please ? > > It is also to avoid complications for short-lived optimizations. The > 3 uses of popcntq() in amd64 pmap cost: > - 9 lines of inline asm. > - 19 lines for the C version > - 9 lines instead of 3 for the 3 uses > When popcntq is not available, the result is a pessimization since the > optimizations are not complicated enough to be useful in that case. popcnt is not available for machines older than Nehalems. Nobody cares about the last bits of the speed for such CPUs. > They give the runtime overhead of a branch to call the C version that > is presumably worse than using the existing bitcount32() (possibly > twice) or the compiler builtin. > (jhb's cleanups didn't bother to optimize to use the builtin in > all cases, since it is hard to tell if the builtin is any good if > it is in software. If you remove the 19 lines for > popcnt_pc_map_elem() and and replace calls to it by __builtin_popcountl(), > then the results would be: > - compile-time failure for old unsupported compilers that don't have this > builtin > - usually, a link-time failure for gcc-4.2 through gcc-4.8. gcc > generates a call to __popcountdi2 unless CFLAGS enables the hardware > instruction. __popcountdi2 is in libgcc but not in libkern. > - usually, 3 inline copies of the same code that would be produced if > FreeBSD's bitcount64() were used for clang. clang unrolls things > excessively, giving enormous code. Unrolling allows it to load the > large constants in __bitcount64() only once, but large code is still > needed to use these constants. > - runtime failures in misconfigured cases where CFLAGS doesn't match > the hardware. Both gcc-4.8 and clang produce popcntq. The runtime > check doesn't help since the compilers produce popcntq for the C > case. Using __builtin_popcountl() asks for this directly. Using > __bitcount64() asks for it indirectly, and gets it for clang. > Using popcnt_pc_map_elem() may avoid getting it for clang, but > apparentely still gets it.) > When popcntq is available, the test to decide whether to use it is a > small pessimization. It might take longer than a branch-free software > method. This is unlikely since there are 3 popcounts per test. Yes, modulo the excessive dependency CPU bug. > > > If you compile with -mpopcount (or a march that includes it like -march=corei7) > > then the compiler will assume that popcount is available and will use it without > > doing any runtime checks. In the case of my sandybridge desktop, I have > > CPUTYPE set to "corei7-avx" in /etc/make.conf which adds "-march=corei7-avx" > > to CFLAGS, so the compiler assumes it can use POPCOUNT (as well as newer > > SSE and AVX). In this case the compiler recognized the pattern in the C > > function above as doing a population count and replaced the entire function with > > a POPCOUNT instruction even though the C code doesn't explicitly try to use it. > > The runtime error for the unsupported instruction is probably not important, > since using misconfigured CFLAGS asks for problems. In general, any new > instruction may trap, and the mismatch must be small for only popcntq to > trap. Most new instructions are in AVX or similar extensions, which are disabled for kernel. popcnt is one of the few useful instruction set addition for the general purpose algorithms, probably the only other exception is rdrand. > I think the runtime slowness from a buggy instruction is also unimportant. > ^^^^^ This and this: > > Always using new API would lose the micro-optimizations given by the runtime > decision for default CFLAGS (used by distributions for portability). To > keep them, it seems best to keep the inline asm but replace > popcnt_pc_map_elem(elem) by __bitcount64(elem). -mno-popcount can then > be used to work around slowness in the software (that is actually > hardware) case. So anybody has to compile his own kernel to get popcnt optimization ? We do care about trivial things that improve time. BTW, I have the following WIP change, which popcnt xorl is a piece of. It emulates the ifuncs with some preprocessing mess. It is much better than runtime patching, and is a prerequisite to properly support more things, like SMAP. I did not published it earlier, since I wanted to convert TLB flush code to this. This can be converted even more to emulate the real ifuncs, by grouping the real function' selection code into the method which is initially stored in the _selector. I tried this, but IMO without linker support, it results in more clutter without a gain. diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index f30c073..135cb85 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* * Floating point support. @@ -149,24 +150,35 @@ struct xsave_area_elm_descr { u_int size; } *xsave_area_desc; -void -fpusave(void *addr) +DEFINE_STATIC_IFUNC(void, fpusave, (void *)); +DEFINE_STATIC_IFUNC(void, fpurestore, (void *)); + +static void +fpusave_xsave(void *addr) { - if (use_xsave) - xsave((char *)addr, xsave_mask); - else - fxsave((char *)addr); + xsave((char *)addr, xsave_mask); } -void -fpurestore(void *addr) +static void +fpurestore_xrstor(void *addr) { - if (use_xsave) - xrstor((char *)addr, xsave_mask); - else - fxrstor((char *)addr); + xrstor((char *)addr, xsave_mask); +} + +static void +fpusave_fxsave(void *addr) +{ + + fxsave((char *)addr); +} + +static void +fpurestore_fxrstor(void *addr) +{ + + fxrstor((char *)addr); } void @@ -208,8 +220,14 @@ fpuinit_bsp1(void) use_xsave = 1; TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); } - if (!use_xsave) + if (!use_xsave) { + fpusave_selector = fpusave_fxsave; + fpurestore_selector = fpurestore_fxrstor; return; + } + + fpusave_selector = fpusave_xsave; + fpurestore_selector = fpurestore_xrstor; cpuid_count(0xd, 0x0, cp); xsave_mask = XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 6a4077c..f6fbc33 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -138,6 +138,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -404,6 +405,9 @@ SYSCTL_PROC(_vm_pmap, OID_AUTO, pcid_save_cnt, CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, pmap_pcid_save_cnt_proc, "QU", "Count of saved TLB context on switch"); +DEFINE_GLOBAL_IFUNC(void, pmap_invalidate_cache_range, + (vm_offset_t sva, vm_offset_t eva)); + /* * Crashdump maps. */ @@ -413,6 +417,7 @@ static void free_pv_chunk(struct pv_chunk *pc); static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t pmap, struct rwlock **lockp); static int popcnt_pc_map_elem(uint64_t elem); +static int popcnt_pc_map_elem_pq(uint64_t elem); static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp); static void reserve_pv_entries(pmap_t pmap, int needed, struct rwlock **lockp); @@ -438,6 +443,10 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp); static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte); static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); +static void pmap_invalidate_cache_range_selfsnoop(vm_offset_t sva, + vm_offset_t eva); +static void pmap_invalidate_cache_range_all(vm_offset_t sva, + vm_offset_t eva); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); static vm_page_t pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va); static void pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mask); @@ -854,6 +863,16 @@ pmap_bootstrap(vm_paddr_t *firstaddr) if (cpu_stdext_feature & CPUID_STDEXT_SMEP) load_cr4(rcr4() | CR4_SMEP); + if ((cpu_feature & CPUID_SS) != 0) + pmap_invalidate_cache_range_selector = + pmap_invalidate_cache_range_selfsnoop; + else if ((cpu_feature & CPUID_CLFSH) != 0) + pmap_invalidate_cache_range_selector = + pmap_force_invalidate_cache_range; + else + pmap_invalidate_cache_range_selector = + pmap_invalidate_cache_range_all; + /* * Initialize the kernel pmap (which is statically allocated). */ @@ -1729,24 +1748,22 @@ pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde) #define PMAP_CLFLUSH_THRESHOLD (2 * 1024 * 1024) -void -pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, boolean_t force) +static void +pmap_invalidate_cache_range_selfsnoop(vm_offset_t sva, vm_offset_t eva) { - if (force) { - sva &= ~(vm_offset_t)cpu_clflush_line_size; - } else { - KASSERT((sva & PAGE_MASK) == 0, - ("pmap_invalidate_cache_range: sva not page-aligned")); - KASSERT((eva & PAGE_MASK) == 0, - ("pmap_invalidate_cache_range: eva not page-aligned")); - } + KASSERT((sva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: sva not page-aligned")); + KASSERT((eva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: eva not page-aligned")); +} - if ((cpu_feature & CPUID_SS) != 0 && !force) - ; /* If "Self Snoop" is supported and allowed, do nothing. */ - else if ((cpu_feature & CPUID_CLFSH) != 0 && - eva - sva < PMAP_CLFLUSH_THRESHOLD) { +void +pmap_force_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva) +{ + sva &= ~(vm_offset_t)cpu_clflush_line_size; + if (eva - sva < PMAP_CLFLUSH_THRESHOLD) { /* * XXX: Some CPUs fault, hang, or trash the local APIC * registers if we use CLFLUSH on the local APIC @@ -1768,16 +1785,22 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, boolean_t force) clflush(sva); mfence(); } else { - /* - * No targeted cache flush methods are supported by CPU, - * or the supplied range is bigger than 2MB. + * The supplied range is bigger than 2MB. * Globally invalidate cache. */ pmap_invalidate_cache(); } } +static void +pmap_invalidate_cache_range_all(vm_offset_t sva, vm_offset_t eva) +{ + + pmap_invalidate_cache_range_selfsnoop(sva, eva); + pmap_invalidate_cache(); +} + /* * Remove the specified set of pages from the data and instruction caches. * @@ -2997,6 +3020,29 @@ popcnt_pc_map_elem(uint64_t elem) } /* + * The erratas for Intel processors state that "POPCNT Instruction May + * Take Longer to Execute Than Expected". It is believed that the + * issue is the spurious dependency on the destination register. + * Provide a hint to the register rename logic that the destination + * value is overwritten, by clearing it, as suggested in the + * optimization manual. It should be cheap for unaffected processors + * as well. + * + * Reference numbers for erratas are + * 4th Gen Core: HSD146 + * 5th Gen Core: BDM85 + */ +static int +popcnt_pc_map_elem_pq(uint64_t elem) +{ + u_long result; + + __asm __volatile("xorl %k0,%k0;popcntq %1,%0" + : "=&r" (result) : "rm" (elem)); + return (result); +} + +/* * Ensure that the number of spare PV entries in the specified pmap meets or * exceeds the given count, "needed". * @@ -3029,9 +3075,9 @@ retry: free += popcnt_pc_map_elem(pc->pc_map[1]); free += popcnt_pc_map_elem(pc->pc_map[2]); } else { - free = popcntq(pc->pc_map[0]); - free += popcntq(pc->pc_map[1]); - free += popcntq(pc->pc_map[2]); + free = popcnt_pc_map_elem_pq(pc->pc_map[0]); + free += popcnt_pc_map_elem_pq(pc->pc_map[1]); + free += popcnt_pc_map_elem_pq(pc->pc_map[2]); } if (free == 0) break; @@ -6204,7 +6250,7 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mode) for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) pmap_kenter_attr(va + tmpsize, pa + tmpsize, mode); pmap_invalidate_range(kernel_pmap, va, va + tmpsize); - pmap_invalidate_cache_range(va, va + tmpsize, FALSE); + pmap_invalidate_cache_range(va, va + tmpsize); return ((void *)(va + offset)); } @@ -6540,7 +6586,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) */ if (changed) { pmap_invalidate_range(kernel_pmap, base, tmpva); - pmap_invalidate_cache_range(base, tmpva, FALSE); + pmap_invalidate_cache_range(base, tmpva); } return (error); } diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 868db7d..79a0b32 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -394,8 +394,8 @@ void pmap_invalidate_range(pmap_t, vm_offset_t, vm_offset_t); void pmap_invalidate_all(pmap_t); void pmap_invalidate_cache(void); void pmap_invalidate_cache_pages(vm_page_t *pages, int count); -void pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, - boolean_t force); +void pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva); +void pmap_force_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva); void pmap_get_mapping(pmap_t pmap, vm_offset_t va, uint64_t *ptr, int *num); boolean_t pmap_map_io_transient(vm_page_t *, vm_offset_t *, int, boolean_t); void pmap_unmap_io_transient(vm_page_t *, vm_offset_t *, int, boolean_t); diff --git a/sys/dev/drm2/i915/intel_ringbuffer.c b/sys/dev/drm2/i915/intel_ringbuffer.c index 2251220..6eb1d85 100644 --- a/sys/dev/drm2/i915/intel_ringbuffer.c +++ b/sys/dev/drm2/i915/intel_ringbuffer.c @@ -384,8 +384,8 @@ init_pipe_control(struct intel_ring_buffer *ring) if (pc->cpu_page == NULL) goto err_unpin; pmap_qenter((uintptr_t)pc->cpu_page, &obj->pages[0], 1); - pmap_invalidate_cache_range((vm_offset_t)pc->cpu_page, - (vm_offset_t)pc->cpu_page + PAGE_SIZE, FALSE); + pmap_force_invalidate_cache_range((vm_offset_t)pc->cpu_page, + (vm_offset_t)pc->cpu_page + PAGE_SIZE); pc->obj = obj; ring->private = pc; @@ -968,8 +968,9 @@ static int init_status_page(struct intel_ring_buffer *ring) } pmap_qenter((vm_offset_t)ring->status_page.page_addr, &obj->pages[0], 1); - pmap_invalidate_cache_range((vm_offset_t)ring->status_page.page_addr, - (vm_offset_t)ring->status_page.page_addr + PAGE_SIZE, FALSE); + pmap_force_invalidate_cache_range( + (vm_offset_t)ring->status_page.page_addr, + (vm_offset_t)ring->status_page.page_addr + PAGE_SIZE); ring->status_page.obj = obj; memset(ring->status_page.page_addr, 0, PAGE_SIZE); diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 68b44e9..58db621 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -143,6 +143,7 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#include #include #include #include @@ -263,6 +264,9 @@ caddr_t ptvmmap = 0; caddr_t CADDR3; struct msgbuf *msgbufp = 0; +DEFINE_GLOBAL_IFUNC(void, pmap_invalidate_cache_range, + (vm_offset_t sva, vm_offset_t eva)); + /* * Crashdump maps. */ @@ -305,6 +309,10 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte); static void pmap_flush_page(vm_page_t m); static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); +static void pmap_invalidate_cache_range_selfsnoop(vm_offset_t sva, + vm_offset_t eva); +static void pmap_invalidate_cache_range_all(vm_offset_t sva, + vm_offset_t eva); static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte); static boolean_t pmap_is_modified_pvh(struct md_page *pvh); static boolean_t pmap_is_referenced_pvh(struct md_page *pvh); @@ -509,6 +517,16 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* Turn on PG_G on kernel page(s) */ pmap_set_pg(); + + if ((cpu_feature & CPUID_SS) != 0) + pmap_invalidate_cache_range_selector = + pmap_invalidate_cache_range_selfsnoop; + else if ((cpu_feature & CPUID_CLFSH) != 0) + pmap_invalidate_cache_range_selector = + pmap_force_invalidate_cache_range; + else + pmap_invalidate_cache_range_selector = + pmap_invalidate_cache_range_all; } /* @@ -1182,25 +1200,22 @@ pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde) #define PMAP_CLFLUSH_THRESHOLD (2 * 1024 * 1024) -void -pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, boolean_t force) +static void +pmap_invalidate_cache_range_selfsnoop(vm_offset_t sva, vm_offset_t eva) { - if (force) { - sva &= ~(vm_offset_t)cpu_clflush_line_size; - } else { - KASSERT((sva & PAGE_MASK) == 0, - ("pmap_invalidate_cache_range: sva not page-aligned")); - KASSERT((eva & PAGE_MASK) == 0, - ("pmap_invalidate_cache_range: eva not page-aligned")); - } + KASSERT((sva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: sva not page-aligned")); + KASSERT((eva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: eva not page-aligned")); +} - if ((cpu_feature & CPUID_SS) != 0 && !force) - ; /* If "Self Snoop" is supported and allowed, do nothing. */ - else if ((cpu_feature & CPUID_CLFSH) != 0 && - eva - sva < PMAP_CLFLUSH_THRESHOLD) { +void +pmap_force_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva) +{ -#ifdef DEV_APIC + sva &= ~(vm_offset_t)cpu_clflush_line_size; + if (eva - sva < PMAP_CLFLUSH_THRESHOLD) { /* * XXX: Some CPUs fault, hang, or trash the local APIC * registers if we use CLFLUSH on the local APIC @@ -1209,7 +1224,7 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, boolean_t force) */ if (pmap_kextract(sva) == lapic_paddr) return; -#endif + /* * Otherwise, do per-cache line flush. Use the mfence * instruction to insure that previous stores are @@ -1222,16 +1237,22 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, boolean_t force) clflush(sva); mfence(); } else { - /* - * No targeted cache flush methods are supported by CPU, - * or the supplied range is bigger than 2MB. + * The supplied range is bigger than 2MB. * Globally invalidate cache. */ pmap_invalidate_cache(); } } +static void +pmap_invalidate_cache_range_all(vm_offset_t sva, vm_offset_t eva) +{ + + pmap_invalidate_cache_range_selfsnoop(sva, eva); + pmap_invalidate_cache(); +} + void pmap_invalidate_cache_pages(vm_page_t *pages, int count) { @@ -5179,7 +5200,7 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mode) for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) pmap_kenter_attr(va + tmpsize, pa + tmpsize, mode); pmap_invalidate_range(kernel_pmap, va, va + tmpsize); - pmap_invalidate_cache_range(va, va + size, FALSE); + pmap_invalidate_cache_range(va, va + size); return ((void *)(va + offset)); } @@ -5385,7 +5406,7 @@ pmap_change_attr(vm_offset_t va, vm_size_t size, int mode) */ if (changed) { pmap_invalidate_range(kernel_pmap, base, tmpva); - pmap_invalidate_cache_range(base, tmpva, FALSE); + pmap_invalidate_cache_range(base, tmpva); } return (0); } diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index ebd177a..a9e1bfe 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -876,7 +876,7 @@ sf_buf_invalidate(struct sf_buf *sf) * settings are recalculated. */ pmap_qenter(sf->kva, &m, 1); - pmap_invalidate_cache_range(sf->kva, sf->kva + PAGE_SIZE, FALSE); + pmap_invalidate_cache_range(sf->kva, sf->kva + PAGE_SIZE); } /* diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h index 05656cd..936c930 100644 --- a/sys/i386/include/pmap.h +++ b/sys/i386/include/pmap.h @@ -458,8 +458,8 @@ void pmap_invalidate_range(pmap_t, vm_offset_t, vm_offset_t); void pmap_invalidate_all(pmap_t); void pmap_invalidate_cache(void); void pmap_invalidate_cache_pages(vm_page_t *pages, int count); -void pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, - boolean_t force); +void pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva); +void pmap_force_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva); #endif /* _KERNEL */ diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index b0ea4e7..1dc9c3d 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef XEN @@ -211,7 +212,6 @@ CTASSERT(X86_XSTATE_XCR0_OFFSET >= offsetof(struct savexmm, sv_pad) && static void fpu_clean_state(void); #endif -static void fpusave(union savefpu *); static void fpurstor(union savefpu *); int hw_float; @@ -231,8 +231,6 @@ struct xsave_area_elm_descr { u_int offset; u_int size; } *xsave_area_desc; - -static int use_xsaveopt; #endif static volatile u_int npx_traps_while_probing; @@ -349,7 +347,37 @@ cleanup: return (hw_float); } -#ifdef CPU_ENABLE_SSE +DEFINE_STATIC_IFUNC(void, npxsave_core, (union savefpu *)); +DEFINE_STATIC_IFUNC(void, fpusave, (union savefpu *)); + +static void +npxsave_xsaveopt(union savefpu *addr) +{ + + xsaveopt((char *)addr, xsave_mask); +} + +static void +fpusave_xsave(union savefpu *addr) +{ + + xsave((char *)addr, xsave_mask); +} + +static void +fpusave_fxsave(union savefpu *addr) +{ + + fxsave((char *)addr); +} + +static void +fpusave_fnsave(union savefpu *addr) +{ + + fnsave((char *)addr); +} + /* * Enable XSAVE if supported and allowed by user. * Calculate the xsave_mask. @@ -357,6 +385,7 @@ cleanup: static void npxinit_bsp1(void) { +#ifdef CPU_ENABLE_SSE u_int cp[4]; uint64_t xsave_mask_user; @@ -364,8 +393,18 @@ npxinit_bsp1(void) use_xsave = 1; TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); } - if (!use_xsave) + if (!use_xsave) { + if (cpu_fxsr) { + npxsave_core_selector = fpusave_fxsave; + fpusave_selector = fpusave_fxsave; + } else { +#endif + npxsave_core_selector = fpusave_fnsave; + fpusave_selector = fpusave_fnsave; +#ifdef CPU_ENABLE_SSE + } return; + } cpuid_count(0xd, 0x0, cp); xsave_mask = XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; @@ -382,12 +421,13 @@ npxinit_bsp1(void) xsave_mask &= ~XFEATURE_MPX; cpuid_count(0xd, 0x1, cp); - if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) - use_xsaveopt = 1; -} + npxsave_core_selector = (cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0 ? + npxsave_xsaveopt : fpusave_xsave; + fpusave_selector = fpusave_xsave; #endif -/* +} +/* * Calculate the fpu save area size. */ static void @@ -426,9 +466,7 @@ npxinit(bool bsp) if (bsp) { if (!npx_probe()) return; -#ifdef CPU_ENABLE_SSE npxinit_bsp1(); -#endif } #ifdef CPU_ENABLE_SSE @@ -917,17 +955,11 @@ npxdna(void) * npxsave() atomically with checking fpcurthread. */ void -npxsave(addr) - union savefpu *addr; +npxsave(union savefpu *addr) { stop_emulating(); -#ifdef CPU_ENABLE_SSE - if (use_xsaveopt) - xsaveopt((char *)addr, xsave_mask); - else -#endif - fpusave(addr); + npxsave_core(addr); start_emulating(); PCPU_SET(fpcurthread, NULL); } @@ -1153,21 +1185,6 @@ npxsetregs(struct thread *td, union savefpu *addr, char *xfpustate, return (0); } -static void -fpusave(addr) - union savefpu *addr; -{ - -#ifdef CPU_ENABLE_SSE - if (use_xsave) - xsave((char *)addr, xsave_mask); - else if (cpu_fxsr) - fxsave(addr); - else -#endif - fnsave(addr); -} - #ifdef CPU_ENABLE_SSE /* * On AuthenticAMD processors, the fxrstor instruction does not restore diff --git a/sys/x86/include/ifunc.h b/sys/x86/include/ifunc.h new file mode 100644 index 0000000..a708104 --- /dev/null +++ b/sys/x86/include/ifunc.h @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2015 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * 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 __X86_IFUNC_H +#define __X86_IFUNC_H + +#define DECLARE_IFUNC(ret_type, name, args) \ +ret_type name args + +#define DEFINE_IFUNC(scope, selector_qual, ret_type, name, args) \ +__asm__ (scope "\t" #name "\n" \ + "\t.type\t" #name ",@function\n" \ + #name ":\n" \ + "\tjmp *" #name "_selector\n" \ + "\t.size\t" #name ",\t. - "#name); \ +selector_qual ret_type (*name##_selector)args __used; \ +DECLARE_IFUNC(ret_type, name, args) + +#define DEFINE_STATIC_IFUNC(ret_type, name, args) \ + DEFINE_IFUNC(".local", static, ret_type, name, args) + +#define DEFINE_GLOBAL_IFUNC(ret_type, name, args) \ + DEFINE_IFUNC(".globl", , ret_type, name, args) + +#endif diff --git a/sys/x86/iommu/intel_utils.c b/sys/x86/iommu/intel_utils.c index f696f9d..1c96191 100644 --- a/sys/x86/iommu/intel_utils.c +++ b/sys/x86/iommu/intel_utils.c @@ -374,8 +374,7 @@ dmar_flush_transl_to_ram(struct dmar_unit *unit, void *dst, size_t sz) * If DMAR does not snoop paging structures accesses, flush * CPU cache to memory. */ - pmap_invalidate_cache_range((uintptr_t)dst, (uintptr_t)dst + sz, - TRUE); + pmap_force_invalidate_cache_range((uintptr_t)dst, (uintptr_t)dst + sz); } void From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 10:08:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id AF905C8B; Sun, 22 Mar 2015 10:08:34 +0000 (UTC) Date: Sun, 22 Mar 2015 10:08:34 +0000 From: Alexey Dokuchaev To: Adrian Chadd Subject: Re: svn commit: r280337 - head/sys/mips/conf Message-ID: <20150322100834.GA88392@FreeBSD.org> References: <201503220215.t2M2FAD9084914@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503220215.t2M2FAD9084914@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-1 Precedence: list List-Id: SVN 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 Mar 2015 10:08:34 -0000 On Sun, Mar 22, 2015 at 02:15:10AM +0000, Adrian Chadd wrote: > New Revision: 280337 > URL: https://svnweb.freebsd.org/changeset/base/280337 > > Log: > Add initial D-Link DIR-655 (A1) support. > > This is based on the AP135 design - QCA9558 SoC, 3x3 2GHz wifi, but no > 5GHz (11n or 11ac) chip is available. > > It however still has 128MiB of RAM, 16MiB of NOR flash and the AR8327N > gigabit switch - so it's quite a beefy router device. Thanks for working on those guys Adrian! I've always avoided these type of "small box" routers: few years ago their CPU would typically not being able to saturate even 100Mbit/s; recently they became powerful enough, but having to run OpenWRT made me always prefer to fetch some Mendocino-based board from the back-yard junk and install FreeBSD to get a decent router. Good to know that soon I could simply get one of those small, fanless Gbit Chinese switches instead (and I'd probably run out of Mendocinos anyways by that time :-). ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 12:11:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4166D65; Sun, 22 Mar 2015 12:11:42 +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 3FC47930; Sun, 22 Mar 2015 12:11:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id t2MCBK4M072994; Sun, 22 Mar 2015 15:11:20 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Sun, 22 Mar 2015 15:11:20 +0300 (MSK) From: Dmitry Morozovsky To: Konstantin Belousov Subject: Re: svn commit: r280323 - head/sys/kern In-Reply-To: <20150321212416.GU2379@kib.kiev.ua> Message-ID: References: <201503211501.t2LF1Kj8052521@svn.freebsd.org> <20150321210341.GC15857@lonesome.com> <20150321210810.GT2379@kib.kiev.ua> <20150321212416.GU2379@kib.kiev.ua> 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]); Sun, 22 Mar 2015 15:11:20 +0300 (MSK) Cc: svn-src-head@freebsd.org, Mark Linimon , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 12:11:42 -0000 On Sat, 21 Mar 2015, Konstantin Belousov wrote: > > > > > Somewhat modernize the SysV shm code: > > > > > > > > Is my understanding correct that postgres still uses shm? If so, > > > > has someone benchmarked the speedup? > > > > > > Yes, some versions of Postgres still use SysV shm. > > > > To be clarified: IIUC, *all* contemporary versions of PostgreSQL do > > use SHM for shatrd buffers (as PgSQL use process-per-connection model) > > No. Recent versions use mmaped shared region for buffers. Yes, starting from 9.3 main buffers are memory-mapped. SysV SHM and Semaphores *are* still in use though. (mainly for search engines) Thanks for the clarification. -- 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 Sun Mar 22 13:11:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A9D7894; Sun, 22 Mar 2015 13: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEC6CE98; Sun, 22 Mar 2015 13:11:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MDBvrA089289; Sun, 22 Mar 2015 13:11:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MDBvpA089288; Sun, 22 Mar 2015 13:11:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503221311.t2MDBvpA089288@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 22 Mar 2015 13:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280345 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 13:11:58 -0000 Author: hselasky Date: Sun Mar 22 13:11:56 2015 New Revision: 280345 URL: https://svnweb.freebsd.org/changeset/base/280345 Log: Fix for out of order device destruction notifications when using the delist_dev() function. In addition to this change: - add a proper description of this function - add a proper witness assert inside this function - switch a nearby line to use the "cdp" pointer instead of cdev2priv() MFC after: 3 days Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sun Mar 22 12:49:57 2015 (r280344) +++ head/sys/kern/kern_conf.c Sun Mar 22 13:11:56 2015 (r280345) @@ -1093,9 +1093,12 @@ destroy_devl(struct cdev *dev) } dev_unlock(); - notify_destroy(dev); + if ((cdp->cdp_flags & CDP_UNREF_DTR) == 0) { + /* avoid out of order notify events */ + notify_destroy(dev); + } mtx_lock(&cdevpriv_mtx); - while ((p = LIST_FIRST(&cdev2priv(dev)->cdp_fdpriv)) != NULL) { + while ((p = LIST_FIRST(&cdp->cdp_fdpriv)) != NULL) { devfs_destroy_cdevpriv(p); mtx_lock(&cdevpriv_mtx); } @@ -1141,12 +1144,25 @@ delist_dev_locked(struct cdev *dev) devfs_destroy(dev); LIST_FOREACH(child, &dev->si_children, si_siblings) delist_dev_locked(child); + dev_unlock(); + /* ensure the destroy event is queued in order */ + notify_destroy(dev); + dev_lock(); } +/* + * This function will delist a character device and its children from + * the directory listing and create a destroy event without waiting + * for all character device references to go away. At some later point + * destroy_dev() must be called to complete the character device + * destruction. After calling this function the character device name + * can instantly be re-used. + */ void delist_dev(struct cdev *dev) { + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "delist_dev"); dev_lock(); delist_dev_locked(dev); dev_unlock(); From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 13:37:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16288E20; Sun, 22 Mar 2015 13:37:15 +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 CB468BE; Sun, 22 Mar 2015 13:37: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 DBC83B8057; Sun, 22 Mar 2015 14:37:09 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id C7D5628494; Sun, 22 Mar 2015 14:37:09 +0100 (CET) Date: Sun, 22 Mar 2015 14:37:09 +0100 From: Jilles Tjoelker To: Bruce Evans Subject: Re: svn commit: r280308 - head/sys/fs/devfs Message-ID: <20150322133709.GA39238@stack.nl> References: <201503210114.t2L1ECcB075556@svn.freebsd.org> <20150321200221.K1846@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150321200221.K1846@besplex.bde.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, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 13:37:15 -0000 On Sat, Mar 21, 2015 at 08:49:00PM +1100, Bruce Evans wrote: > On Sat, 21 Mar 2015, Xin LI wrote: > > Log: > > Disable timestamping on devfs read/write operations by default. > > Currently we update timestamps unconditionally when doing read or > > write operations. This may slow things down on hardware where > > reading timestamps is expensive (e.g. HPET, because of the default > > vfs.timestamp_precision setting is nanosecond now) with limited > > benefit. > > A new sysctl variable, vfs.devfs.dotimes is added, which can be > > set to non-zero value when the old behavior is desirable. > I don't like this. It defaults to non-POSIX-conformant behaviour... > The slowness is mostly from no delayed update of times in devfs. > Switching vfs.timestamp_precision to a hardware timecounter would > have been even more expensive for regular files if file systems > didn't have delayed updates. The assumption that vfs_timestamp() > doesn't use a slow timecounter was so often satisfied that no one > missed devfs also not supporting mounting with -noatime. > Delayed updates are even easier to implement for devfs than for disk > file systems the times never need to be written to disk. A slow update > is still wasteful for atimes, but not as bad as for disk file systems > since it doesn't trigger a slower sync to disk. Yes, I think implementing delayed updates is the right solution to this problem. This way, only stat and last close will need to read the clock. No configuration option will be needed. A subtle difference with most other file systems is that devfs nodes often stay open for very long, so the timestamps will usually come from stat() calls, which may be much later than the actual read or write. Still that is better than not updating timestamps at all. > > ... > > Modified: head/sys/fs/devfs/devfs_vnops.c > > ============================================================================== > > --- head/sys/fs/devfs/devfs_vnops.c Sat Mar 21 00:21:30 2015 (r280307) > > +++ head/sys/fs/devfs/devfs_vnops.c Sat Mar 21 01:14:11 2015 (r280308) > > ... > > @@ -1700,7 +1708,8 @@ devfs_write_f(struct file *fp, struct ui > > resid = uio->uio_resid; > > > > error = dsw->d_write(dev, uio, ioflag); > > - if (uio->uio_resid != resid || (error == 0 && resid != 0)) { > > + if (devfs_dotimes && > > + (uio->uio_resid != resid || (error == 0 && resid != 0))) { > > vfs_timestamp(&dev->si_ctime); > > dev->si_mtime = dev->si_ctime; > > } > An old bug is evident in the diff. Writing shouldn't change the ctime. That is not a bug. POSIX unambiguously requires write() to update both mtime and ctime. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 14:38:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8CD8A3E; Sun, 22 Mar 2015 14:38:52 +0000 (UTC) Received: from mail-pa0-x22e.google.com (mail-pa0-x22e.google.com [IPv6:2607:f8b0:400e:c03::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 961267F7; Sun, 22 Mar 2015 14:38:52 +0000 (UTC) Received: by pabxg6 with SMTP id xg6so150416514pab.0; Sun, 22 Mar 2015 07:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=9aEZRuf5xNtm23cU9oZU+Qrtv7CnQMdgYSDc7bTX6vw=; b=jFz+V+sRSPQwxmqAzKnQggDrnUCG5qreL7W5ZBX04urROTRr0IAGa80stNkbzj3uMG BWc5qAIuxE3jH6WYX1PybOlhvcTgnI7xeHWibv93GTprHi5cPcmusQpP+r5bgCd1pJim BcixyOvS4CTdsNqZbfIpvD/1+I1c0m8GzckMngTcJJTrb3fdRXFXrcMyNKTsg9vrVumK 3mOyr9lYRXMO1aV17GNxaFhtzXUOaVGVsX4PyrU7C5eCv8BABxsrI+Q0hVvfJrRi5Oi+ zYI6DCA1ZhNp3AZoD1UUtDnTiDIyT5TmHSNGiHYE4m4bBCwO/PIB5BcGq8OYXDAUE7XF 393Q== X-Received: by 10.66.102.34 with SMTP id fl2mr203192223pab.40.1427035132096; Sun, 22 Mar 2015 07:38:52 -0700 (PDT) Received: from [192.168.1.104] (ppp59-167-128-11.static.internode.on.net. [59.167.128.11]) by mx.google.com with ESMTPSA id j2sm14170097pdn.44.2015.03.22.07.38.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Mar 2015 07:38:51 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r280308 - head/sys/fs/devfs references: <201503210114.t2L1ECcB075556@svn.freebsd.org> <550D5D49.6020503@FreeBSD.org> <20150321142737.GJ2379@kib.kiev.ua> To: Konstantin Belousov From: Kubilay Kocak message-id: <550ED3F5.6040402@FreeBSD.org> Date: Mon, 23 Mar 2015 01:38:45 +1100 user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Thunderbird/37.0 mime-version: 1.0 in-reply-to: <20150321142737.GJ2379@kib.kiev.ua> 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, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 14:38:52 -0000 On 22/03/2015 1:27 AM, Konstantin Belousov wrote: > On Sat, Mar 21, 2015 at 11:00:09PM +1100, Kubilay Kocak wrote: >> On 21/03/2015 12:14 PM, Xin LI wrote: >>> Author: delphij >>> Date: Sat Mar 21 01:14:11 2015 >>> New Revision: 280308 >>> URL: https://svnweb.freebsd.org/changeset/base/280308 >>> >>> Log: >>> Disable timestamping on devfs read/write operations by default. >>> >>> Currently we update timestamps unconditionally when doing read or >>> write operations. This may slow things down on hardware where >>> reading timestamps is expensive (e.g. HPET, because of the default >>> vfs.timestamp_precision setting is nanosecond now) with limited >>> benefit. >>> >>> A new sysctl variable, vfs.devfs.dotimes is added, which can be >>> set to non-zero value when the old behavior is desirable. >> >> Perhaps *devfs_timestamp_update* is a better name. thoughts? >> >> If something shorter is desired: devfs_ts_update might be ok, though I >> prefer the former. >> >> Let's not forget these are user visible system control knobs, not just >> code variables, though I do understand the desire to shorten them, and >> that we do have descriptions for them ... mostly :) > > should it be > vfs.devfs.devfs_ts_devfs_ts_devfs_update_devfs > so that user is _absolutely_ sure that it is devfs related, if 'devfs' > used only one time in the MIB prevents him from realizing this ? > s/_/. devfs.timestamp_update sorry. :) From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 15:37:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86CFDF81; Sun, 22 Mar 2015 15:37: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 6856DDA9; Sun, 22 Mar 2015 15:37:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MFb6BM057972; Sun, 22 Mar 2015 15:37:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MFb6Kf057971; Sun, 22 Mar 2015 15:37:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503221537.t2MFb6Kf057971@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 22 Mar 2015 15:37:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280346 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:37:06 -0000 Author: pfg Date: Sun Mar 22 15:37:05 2015 New Revision: 280346 URL: https://svnweb.freebsd.org/changeset/base/280346 Log: Small style(9) cleanup. #define should always be followed by a tab not space. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Mar 22 13:11:56 2015 (r280345) +++ head/sys/sys/cdefs.h Sun Mar 22 15:37:05 2015 (r280346) @@ -70,20 +70,20 @@ #if defined(__GNUC__) || defined(__INTEL_COMPILER) #if __GNUC__ >= 3 || defined(__INTEL_COMPILER) -#define __GNUCLIKE_ASM 3 -#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS +#define __GNUCLIKE_ASM 3 +#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS #else -#define __GNUCLIKE_ASM 2 +#define __GNUCLIKE_ASM 2 #endif -#define __GNUCLIKE___TYPEOF 1 -#define __GNUCLIKE___OFFSETOF 1 -#define __GNUCLIKE___SECTION 1 +#define __GNUCLIKE___TYPEOF 1 +#define __GNUCLIKE___OFFSETOF 1 +#define __GNUCLIKE___SECTION 1 #ifndef __INTEL_COMPILER # define __GNUCLIKE_CTOR_SECTION_HANDLING 1 #endif -#define __GNUCLIKE_BUILTIN_CONSTANT_P 1 +#define __GNUCLIKE_BUILTIN_CONSTANT_P 1 # if defined(__INTEL_COMPILER) && defined(__cplusplus) \ && __INTEL_COMPILER < 800 # undef __GNUCLIKE_BUILTIN_CONSTANT_P @@ -111,19 +111,19 @@ # define __GNUCLIKE_MATH_BUILTIN_RELOPS #endif -#define __GNUCLIKE_BUILTIN_MEMCPY 1 +#define __GNUCLIKE_BUILTIN_MEMCPY 1 /* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */ -#define __CC_SUPPORTS_INLINE 1 -#define __CC_SUPPORTS___INLINE 1 -#define __CC_SUPPORTS___INLINE__ 1 +#define __CC_SUPPORTS_INLINE 1 +#define __CC_SUPPORTS___INLINE 1 +#define __CC_SUPPORTS___INLINE__ 1 -#define __CC_SUPPORTS___FUNC__ 1 -#define __CC_SUPPORTS_WARNING 1 +#define __CC_SUPPORTS___FUNC__ 1 +#define __CC_SUPPORTS_WARNING 1 -#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */ +#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */ -#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 +#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 #endif /* __GNUC__ || __INTEL_COMPILER */ @@ -139,7 +139,7 @@ /* * The __CONCAT macro is used to concatenate parts of symbol names, e.g. - * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. + * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI * mode -- there must be no spaces between its arguments, and for nested * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also @@ -234,13 +234,13 @@ #define __section(x) __attribute__((__section__(x))) #endif #if defined(__INTEL_COMPILER) -#define __dead2 __attribute__((__noreturn__)) -#define __pure2 __attribute__((__const__)) -#define __unused __attribute__((__unused__)) -#define __used __attribute__((__used__)) -#define __packed __attribute__((__packed__)) -#define __aligned(x) __attribute__((__aligned__(x))) -#define __section(x) __attribute__((__section__(x))) +#define __dead2 __attribute__((__noreturn__)) +#define __pure2 __attribute__((__const__)) +#define __unused __attribute__((__unused__)) +#define __used __attribute__((__used__)) +#define __packed __attribute__((__packed__)) +#define __aligned(x) __attribute__((__aligned__(x))) +#define __section(x) __attribute__((__section__(x))) #endif #endif @@ -356,9 +356,9 @@ #endif #if __GNUC_PREREQ__(3, 3) -#define __nonnull(...) __attribute__((__nonnull__(__VA_ARGS__))) +#define __nonnull(...) __attribute__((__nonnull__(__VA_ARGS__))) #else -#define __nonnull(...) +#define __nonnull(...) #endif #if __GNUC_PREREQ__(3, 4) @@ -436,11 +436,11 @@ * larger code. */ #if __GNUC_PREREQ__(2, 96) -#define __predict_true(exp) __builtin_expect((exp), 1) -#define __predict_false(exp) __builtin_expect((exp), 0) +#define __predict_true(exp) __builtin_expect((exp), 1) +#define __predict_false(exp) __builtin_expect((exp), 0) #else -#define __predict_true(exp) (exp) -#define __predict_false(exp) (exp) +#define __predict_true(exp) (exp) +#define __predict_false(exp) (exp) #endif #if __GNUC_PREREQ__(4, 2) @@ -456,13 +456,13 @@ * require it. */ #if __GNUC_PREREQ__(4, 1) -#define __offsetof(type, field) __builtin_offsetof(type, field) +#define __offsetof(type, field) __builtin_offsetof(type, field) #else #ifndef __cplusplus #define __offsetof(type, field) \ ((__size_t)(__uintptr_t)((const volatile void *)&((type *)0)->field)) #else -#define __offsetof(type, field) \ +#define __offsetof(type, field) \ (__offsetof__ (reinterpret_cast <__size_t> \ (&reinterpret_cast \ (static_cast (0)->field)))) @@ -562,7 +562,7 @@ * The following definition might not work well if used in header files, * but it should be better than nothing. If you want a "do nothing" * version, then it should generate some harmless declaration, such as: - * #define __IDSTRING(name,string) struct __hack + * #define __IDSTRING(name,string) struct __hack */ #define __IDSTRING(name,string) static const char name[] __unused = string #endif @@ -744,7 +744,7 @@ #endif #if defined(__mips) || defined(__powerpc64__) -#define __NO_TLS 1 +#define __NO_TLS 1 #endif /* From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 16:10:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02FB9ADF; Sun, 22 Mar 2015 16:10: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 E0926177; Sun, 22 Mar 2015 16:10:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MGAcdO075130; Sun, 22 Mar 2015 16:10:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MGATu0075100; Sun, 22 Mar 2015 16:10:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503221610.t2MGATu0075100@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 22 Mar 2015 16:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280347 - in head/sys/dev: aac aacraid advansys aha ahb amr buslogic bwi bwn ciss ct dpt ida if_ndis iir mlx mly trm twe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 16:10:39 -0000 Author: mav Date: Sun Mar 22 16:10:28 2015 New Revision: 280347 URL: https://svnweb.freebsd.org/changeset/base/280347 Log: Remove MAXBSIZE use from drivers where it has nothing to do. In some cases limits are just not needed, in others -- DFLTPHYS is the right constant to use instead. MFC after: 1 month Modified: head/sys/dev/aac/aac.c head/sys/dev/aacraid/aacraid.c head/sys/dev/advansys/adwcam.c head/sys/dev/aha/aha.c head/sys/dev/ahb/ahb.c head/sys/dev/amr/amr_pci.c head/sys/dev/buslogic/bt.c head/sys/dev/bwi/if_bwi.c head/sys/dev/bwn/if_bwn.c head/sys/dev/ciss/ciss.c head/sys/dev/ct/ct_isa.c head/sys/dev/dpt/dpt_scsi.c head/sys/dev/ida/ida.c head/sys/dev/ida/ida_eisa.c head/sys/dev/ida/ida_pci.c head/sys/dev/if_ndis/if_ndis_pci.c head/sys/dev/iir/iir.c head/sys/dev/iir/iir_pci.c head/sys/dev/mlx/mlx.c head/sys/dev/mlx/mlx_pci.c head/sys/dev/mly/mly.c head/sys/dev/trm/trm.c head/sys/dev/twe/twe.c head/sys/dev/twe/twe_freebsd.c Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/aac/aac.c Sun Mar 22 16:10:28 2015 (r280347) @@ -507,9 +507,9 @@ aac_alloc(struct aac_softc *sc) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, /* maxsize */ + sc->aac_max_sectors << 9, /* maxsize */ sc->aac_sg_tablesize, /* nsegments */ - MAXBSIZE, /* maxsegsize */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ busdma_lock_mutex, /* lockfunc */ &sc->aac_io_lock, /* lockfuncarg */ Modified: head/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/aacraid/aacraid.c Sun Mar 22 16:10:28 2015 (r280347) @@ -597,9 +597,9 @@ aac_alloc(struct aac_softc *sc) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, /* maxsize */ + sc->aac_max_sectors << 9, /* maxsize */ sc->aac_sg_tablesize, /* nsegments */ - MAXBSIZE, /* maxsegsize */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ busdma_lock_mutex, /* lockfunc */ &sc->aac_io_lock, /* lockfuncarg */ Modified: head/sys/dev/advansys/adwcam.c ============================================================================== --- head/sys/dev/advansys/adwcam.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/advansys/adwcam.c Sun Mar 22 16:10:28 2015 (r280347) @@ -961,7 +961,7 @@ adw_init(struct adw_softc *adw) /* highaddr */ BUS_SPACE_MAXADDR, /* filter */ NULL, /* filterarg */ NULL, - /* maxsize */ MAXBSIZE, + /* maxsize */ DFLTPHYS, /* nsegments */ ADW_SGSIZE, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ BUS_DMA_ALLOCNOW, Modified: head/sys/dev/aha/aha.c ============================================================================== --- head/sys/dev/aha/aha.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/aha/aha.c Sun Mar 22 16:10:28 2015 (r280347) @@ -458,7 +458,7 @@ aha_init(struct aha_softc* aha) /* highaddr */ BUS_SPACE_MAXADDR, /* filter */ NULL, /* filterarg */ NULL, - /* maxsize */ MAXBSIZE, + /* maxsize */ DFLTPHYS, /* nsegments */ AHA_NSEG, /* maxsegsz */ BUS_SPACE_MAXSIZE_24BIT, /* flags */ BUS_DMA_ALLOCNOW, Modified: head/sys/dev/ahb/ahb.c ============================================================================== --- head/sys/dev/ahb/ahb.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/ahb/ahb.c Sun Mar 22 16:10:28 2015 (r280347) @@ -298,7 +298,7 @@ ahbattach(device_t dev) /* highaddr */ BUS_SPACE_MAXADDR, /* filter */ NULL, /* filterarg */ NULL, - /* maxsize */ MAXBSIZE, + /* maxsize */ DFLTPHYS, /* nsegments */ AHB_NSEG, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ BUS_DMA_ALLOCNOW, Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/amr/amr_pci.c Sun Mar 22 16:10:28 2015 (r280347) @@ -260,7 +260,8 @@ amr_pci_attach(device_t dev) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, AMR_NSEG, /* maxsize, nsegments */ + BUS_SPACE_MAXSIZE, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ @@ -277,8 +278,9 @@ amr_pci_attach(device_t dev) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, AMR_NSEG, /* maxsize, nsegments */ - MAXBSIZE, /* maxsegsize */ + DFLTPHYS, /* maxsize */ + AMR_NSEG, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ busdma_lock_mutex, /* lockfunc */ &sc->amr_list_lock, /* lockarg */ @@ -292,8 +294,9 @@ amr_pci_attach(device_t dev) BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, AMR_NSEG, /* maxsize, nsegments */ - MAXBSIZE, /* maxsegsize */ + DFLTPHYS, /* maxsize */ + AMR_NSEG, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ busdma_lock_mutex, /* lockfunc */ &sc->amr_list_lock, /* lockarg */ Modified: head/sys/dev/buslogic/bt.c ============================================================================== --- head/sys/dev/buslogic/bt.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/buslogic/bt.c Sun Mar 22 16:10:28 2015 (r280347) @@ -726,7 +726,7 @@ bt_init(device_t dev) /* highaddr */ BUS_SPACE_MAXADDR, /* filter */ NULL, /* filterarg */ NULL, - /* maxsize */ MAXBSIZE, + /* maxsize */ DFLTPHYS, /* nsegments */ BT_NSEG, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ BUS_DMA_ALLOCNOW, Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/bwi/if_bwi.c Sun Mar 22 16:10:28 2015 (r280347) @@ -1916,7 +1916,7 @@ bwi_dma_alloc(struct bwi_softc *sc) lowaddr, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, /* maxsize */ + BUS_SPACE_MAXSIZE, /* maxsize */ BUS_SPACE_UNRESTRICTED, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/bwn/if_bwn.c Sun Mar 22 16:10:28 2015 (r280347) @@ -10381,7 +10381,7 @@ bwn_dma_attach(struct bwn_mac *mac) lowaddr, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, /* maxsize */ + BUS_SPACE_MAXSIZE, /* maxsize */ BUS_SPACE_UNRESTRICTED, /* nsegments */ BUS_SPACE_MAXSIZE, /* maxsegsize */ 0, /* flags */ Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/ciss/ciss.c Sun Mar 22 16:10:28 2015 (r280347) @@ -833,7 +833,7 @@ setup: BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ - CISS_MAX_SG_ELEMENTS, /* nsegments */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ @@ -851,7 +851,8 @@ setup: BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, CISS_MAX_SG_ELEMENTS, /* maxsize, nsegments */ + (CISS_MAX_SG_ELEMENTS - 1) * PAGE_SIZE, /* maxsize */ + CISS_MAX_SG_ELEMENTS, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ busdma_lock_mutex, &sc->ciss_mtx, /* lockfunc, lockarg */ Modified: head/sys/dev/ct/ct_isa.c ============================================================================== --- head/sys/dev/ct/ct_isa.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/ct/ct_isa.c Sun Mar 22 16:10:28 2015 (r280347) @@ -207,7 +207,7 @@ ct_isa_attach(device_t dev) /* setup DMA map */ if (bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_24BIT, BUS_SPACE_MAXADDR, - NULL, NULL, MAXBSIZE, 1, + NULL, NULL, DFLTPHYS, 1, BUS_SPACE_MAXSIZE_32BIT, BUS_DMA_ALLOCNOW, NULL, NULL, &ct->sc_dmat) != 0) { @@ -223,7 +223,7 @@ ct_isa_attach(device_t dev) return ENXIO; } - bus_dmamap_load(ct->sc_dmat, ct->sc_dmamapt, vaddr, MAXBSIZE, + bus_dmamap_load(ct->sc_dmat, ct->sc_dmamapt, vaddr, DFLTPHYS, ct_dmamap, &addr, BUS_DMA_NOWAIT); /* setup machdep softc */ @@ -231,7 +231,7 @@ ct_isa_attach(device_t dev) bs->sc_io_control = 0; bs->sc_bounce_phys = (u_int8_t *)addr; bs->sc_bounce_addr = vaddr; - bs->sc_bounce_size = MAXBSIZE; + bs->sc_bounce_size = DFLTPHYS; bs->sc_minphys = (1 << 24); bs->sc_dmasync_before = ct_isa_dmasync_before; bs->sc_dmasync_after = ct_isa_dmasync_after; Modified: head/sys/dev/dpt/dpt_scsi.c ============================================================================== --- head/sys/dev/dpt/dpt_scsi.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/dpt/dpt_scsi.c Sun Mar 22 16:10:28 2015 (r280347) @@ -1388,7 +1388,7 @@ dpt_init(struct dpt_softc *dpt) /* highaddr */ BUS_SPACE_MAXADDR, /* filter */ NULL, /* filterarg */ NULL, - /* maxsize */ MAXBSIZE, + /* maxsize */ DFLTPHYS, /* nsegments */ dpt->sgsize, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ BUS_DMA_ALLOCNOW, Modified: head/sys/dev/ida/ida.c ============================================================================== --- head/sys/dev/ida/ida.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/ida/ida.c Sun Mar 22 16:10:28 2015 (r280347) @@ -241,7 +241,7 @@ ida_init(struct ida_softc *ida) /* highaddr */ BUS_SPACE_MAXADDR, /* filter */ NULL, /* filterarg */ NULL, - /* maxsize */ MAXBSIZE, + /* maxsize */ DFLTPHYS, /* nsegments */ IDA_NSEG, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, Modified: head/sys/dev/ida/ida_eisa.c ============================================================================== --- head/sys/dev/ida/ida_eisa.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/ida/ida_eisa.c Sun Mar 22 16:10:28 2015 (r280347) @@ -302,8 +302,8 @@ ida_eisa_attach(device_t dev) /* highaddr */ BUS_SPACE_MAXADDR, /* filter */ NULL, /* filterarg */ NULL, - /* maxsize */ MAXBSIZE, - /* nsegments */ IDA_NSEG, + /* maxsize */ BUS_SPACE_MAXSIZE_32BIT, + /* nsegments */ BUS_SPACE_UNRESTRICTED, /* maxsegsize */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ BUS_DMA_ALLOCNOW, /* lockfunc */ NULL, Modified: head/sys/dev/ida/ida_pci.c ============================================================================== --- head/sys/dev/ida/ida_pci.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/ida/ida_pci.c Sun Mar 22 16:10:28 2015 (r280347) @@ -265,8 +265,8 @@ ida_pci_attach(device_t dev) /* highaddr */ BUS_SPACE_MAXADDR, /* filter */ NULL, /* filterarg */ NULL, - /* maxsize */ MAXBSIZE, - /* nsegments */ IDA_NSEG, + /* maxsize */ BUS_SPACE_MAXSIZE_32BIT, + /* nsegments */ BUS_SPACE_UNRESTRICTED, /* maxsegsize */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ BUS_DMA_ALLOCNOW, /* lockfunc */ NULL, Modified: head/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pci.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/if_ndis/if_ndis_pci.c Sun Mar 22 16:10:28 2015 (r280347) @@ -298,7 +298,8 @@ ndis_attach_pci(dev) BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, NDIS_NSEG_NEW,/* maxsize, nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + NDIS_NSEG_NEW, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ NULL, NULL, /* lockfunc, lockarg */ Modified: head/sys/dev/iir/iir.c ============================================================================== --- head/sys/dev/iir/iir.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/iir/iir.c Sun Mar 22 16:10:28 2015 (r280347) @@ -201,7 +201,8 @@ iir_init(struct gdt_softc *gdt) /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, - /*maxsize*/MAXBSIZE, /*nsegments*/GDT_MAXSG, + /*maxsize*/DFLTPHYS, + /*nsegments*/GDT_MAXSG, /*maxsegsz*/BUS_SPACE_MAXSIZE_32BIT, /*flags*/BUS_DMA_ALLOCNOW, /*lockfunc*/busdma_lock_mutex, Modified: head/sys/dev/iir/iir_pci.c ============================================================================== --- head/sys/dev/iir/iir_pci.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/iir/iir_pci.c Sun Mar 22 16:10:28 2015 (r280347) @@ -307,7 +307,7 @@ iir_pci_attach(device_t dev) /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, /*maxsize*/BUS_SPACE_MAXSIZE_32BIT, - /*nsegments*/GDT_MAXSG, + /*nsegments*/BUS_SPACE_UNRESTRICTED, /*maxsegsz*/BUS_SPACE_MAXSIZE_32BIT, /*flags*/0, /*lockfunc*/busdma_lock_mutex, /*lockarg*/&gdt->sc_lock, &gdt->sc_parent_dmat) != 0) { Modified: head/sys/dev/mlx/mlx.c ============================================================================== --- head/sys/dev/mlx/mlx.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/mlx/mlx.c Sun Mar 22 16:10:28 2015 (r280347) @@ -399,7 +399,8 @@ mlx_attach(struct mlx_softc *sc) BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, MLX_NSEG, /* maxsize, nsegments */ + MLX_MAXPHYS, /* maxsize */ + MLX_NSEG, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ busdma_lock_mutex, /* lockfunc */ Modified: head/sys/dev/mlx/mlx_pci.c ============================================================================== --- head/sys/dev/mlx/mlx_pci.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/mlx/mlx_pci.c Sun Mar 22 16:10:28 2015 (r280347) @@ -189,7 +189,8 @@ mlx_pci_attach(device_t dev) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, MLX_NSEG, /* maxsize, nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ NULL, /* lockfunc */ Modified: head/sys/dev/mly/mly.c ============================================================================== --- head/sys/dev/mly/mly.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/mly/mly.c Sun Mar 22 16:10:28 2015 (r280347) @@ -392,7 +392,8 @@ mly_pci_attach(struct mly_softc *sc) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, MLY_MAX_SGENTRIES, /* maxsize, nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ NULL, /* lockfunc */ @@ -410,7 +411,8 @@ mly_pci_attach(struct mly_softc *sc) BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, MLY_MAX_SGENTRIES, /* maxsize, nsegments */ + DFLTPHYS, /* maxsize */ + MLY_MAX_SGENTRIES, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ busdma_lock_mutex, /* lockfunc */ Modified: head/sys/dev/trm/trm.c ============================================================================== --- head/sys/dev/trm/trm.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/trm/trm.c Sun Mar 22 16:10:28 2015 (r280347) @@ -3381,7 +3381,7 @@ trm_init(u_int16_t unit, device_t dev) /*highaddr*/ BUS_SPACE_MAXADDR, /*filter*/ NULL, /*filterarg*/ NULL, - /*maxsize*/ MAXBSIZE, + /*maxsize*/ TRM_MAXPHYS, /*nsegments*/ TRM_NSEG, /*maxsegsz*/ TRM_MAXTRANSFER_SIZE, /*flags*/ BUS_DMA_ALLOCNOW, Modified: head/sys/dev/twe/twe.c ============================================================================== --- head/sys/dev/twe/twe.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/twe/twe.c Sun Mar 22 16:10:28 2015 (r280347) @@ -985,7 +985,7 @@ twe_immediate_request(struct twe_request if (usetmp && (tr->tr_data != NULL)) { tr->tr_flags |= TWE_CMD_IMMEDIATE; - if (tr->tr_length > MAXBSIZE) + if (tr->tr_length > DFLTPHYS) return (EINVAL); bcopy(tr->tr_data, sc->twe_immediate, tr->tr_length); } Modified: head/sys/dev/twe/twe_freebsd.c ============================================================================== --- head/sys/dev/twe/twe_freebsd.c Sun Mar 22 15:37:05 2015 (r280346) +++ head/sys/dev/twe/twe_freebsd.c Sun Mar 22 16:10:28 2015 (r280347) @@ -233,7 +233,8 @@ twe_attach(device_t dev) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, TWE_MAX_SGL_LENGTH, /* maxsize, nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ @@ -301,7 +302,8 @@ twe_attach(device_t dev) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, TWE_MAX_SGL_LENGTH,/* maxsize, nsegments */ + (TWE_MAX_SGL_LENGTH - 1) * PAGE_SIZE,/* maxsize */ + TWE_MAX_SGL_LENGTH, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ busdma_lock_mutex, /* lockfunc */ @@ -320,7 +322,7 @@ twe_attach(device_t dev) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXBSIZE, 1, /* maxsize, nsegments */ + DFLTPHYS, 1, /* maxsize, nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 16:12:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAF44DD7; Sun, 22 Mar 2015 16:12:23 +0000 (UTC) Received: from mailrelay105.isp.belgacom.be (mailrelay105.isp.belgacom.be [195.238.20.132]) by mx1.freebsd.org (Postfix) with ESMTP id F0AC5196; Sun, 22 Mar 2015 16:12:22 +0000 (UTC) X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=KjSUzZxnmGSQ+6+vr4Kd0OSSUs/Ia9ciENKrYVIfwLU= c=1 sm=2 a=6I5d2MoRAAAA:8 a=CLOSWh0hz5zq3mD8lasA:9 a=CjuIK1q_8ugA:10 a=6R8KEigaNUhcvUBM:21 a=2PLbIismDCuwnmFb:21 a=9C5w671CO25bZjS6ipoA:9 a=OTFKxNmSR6MA:10 a=LSW1mi3CKqAA:10 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BhBgAZ6Q5V/y+M8VFcgwZSTgzGboV1AoEbTQEBAQEBAX2EFQEFViMQCxQECSUPKh4GE4gzAQjIegEBAQEBAQEDAQEBAQEBARcEiyGEZBEHhC0FkjiCBoV+lCsig289MYJDAQEB Received: from 47.140-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.140.47]) by relay.skynet.be with ESMTP; 22 Mar 2015 17:11:11 +0100 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 t2MGBAMZ000895; Sun, 22 Mar 2015 17:11:10 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sun, 22 Mar 2015 17:11:10 +0100 From: Tijl Coosemans To: Ian Lepore Subject: Re: svn commit: r279993 - in head/sys: dev/cxgb dev/cxgbe kern vm Message-ID: <20150322171110.2af31564@kalimero.tijl.coosemans.org> In-Reply-To: <201503141708.t2EH8TdR074383@svn.freebsd.org> References: <201503141708.t2EH8TdR074383@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/ycIkp_kwvfn.i6.Tw.o7FzR" Cc: svn-src-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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:12:23 -0000 --MP_/ycIkp_kwvfn.i6.Tw.o7FzR Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sat, 14 Mar 2015 17:08:29 +0000 (UTC) Ian Lepore wrote: > Author: ian > Date: Sat Mar 14 17:08:28 2015 > New Revision: 279993 > URL: https://svnweb.freebsd.org/changeset/base/279993 > > Log: > Set the SBUF_INCLUDENUL flag in sbuf_new_for_sysctl() so that sysctl > strings returned to userland include the nulterm byte. > > Some uses of sbuf_new_for_sysctl() write binary data rather than strings; > clear the SBUF_INCLUDENUL flag after calling sbuf_new_for_sysctl() in > those cases. (Note that the sbuf code still automatically adds a nulterm > byte in sbuf_finish(), but since it's not included in the length it won't > get copied to userland along with the binary data.) Can you review the attached patch? The KERN_PROC_ENV sysctl is also binary (zero-terminated strings). Adding an extra \0 at the end makes some programs think there's an extra empty environment variable. It causes console-kit-daemon to crash for instance. I suspect a similar patch may be needed for KERN_PROC_ARGS. --MP_/ycIkp_kwvfn.i6.Tw.o7FzR Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=kern_proc_env.patch Index: sys/kern/kern_proc.c =================================================================== --- sys/kern/kern_proc.c (revision 280322) +++ sys/kern/kern_proc.c (working copy) @@ -1904,6 +1904,7 @@ sysctl_kern_proc_env(SYSCTL_HANDLER_ARGS } sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); + sbuf_clear_flags(&sb, SBUF_INCLUDENUL); error = proc_getenvv(curthread, p, &sb); error2 = sbuf_finish(&sb); PRELE(p); --MP_/ycIkp_kwvfn.i6.Tw.o7FzR-- From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 16:25:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A447206; Sun, 22 Mar 2015 16:25:14 +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 E5807276; Sun, 22 Mar 2015 16:25:13 +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 t2MGP7po019258 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 22 Mar 2015 18:25:07 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2MGP7po019258 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2MGP7Ik019256; Sun, 22 Mar 2015 18:25:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 22 Mar 2015 18:25:07 +0200 From: Konstantin Belousov To: Jilles Tjoelker Subject: Re: svn commit: r280308 - head/sys/fs/devfs Message-ID: <20150322162507.GD2379@kib.kiev.ua> References: <201503210114.t2L1ECcB075556@svn.freebsd.org> <20150321200221.K1846@besplex.bde.org> <20150322133709.GA39238@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150322133709.GA39238@stack.nl> 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, Xin LI , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 16:25:14 -0000 On Sun, Mar 22, 2015 at 02:37:09PM +0100, Jilles Tjoelker wrote: > On Sat, Mar 21, 2015 at 08:49:00PM +1100, Bruce Evans wrote: > > On Sat, 21 Mar 2015, Xin LI wrote: > > > > Log: > > > Disable timestamping on devfs read/write operations by default. > > > > Currently we update timestamps unconditionally when doing read or > > > write operations. This may slow things down on hardware where > > > reading timestamps is expensive (e.g. HPET, because of the default > > > vfs.timestamp_precision setting is nanosecond now) with limited > > > benefit. > > > > A new sysctl variable, vfs.devfs.dotimes is added, which can be > > > set to non-zero value when the old behavior is desirable. > > > I don't like this. It defaults to non-POSIX-conformant behaviour... > > > The slowness is mostly from no delayed update of times in devfs. > > Switching vfs.timestamp_precision to a hardware timecounter would > > have been even more expensive for regular files if file systems > > didn't have delayed updates. The assumption that vfs_timestamp() > > doesn't use a slow timecounter was so often satisfied that no one > > missed devfs also not supporting mounting with -noatime. > > > Delayed updates are even easier to implement for devfs than for disk > > file systems the times never need to be written to disk. A slow update > > is still wasteful for atimes, but not as bad as for disk file systems > > since it doesn't trigger a slower sync to disk. > > Yes, I think implementing delayed updates is the right solution to this > problem. This way, only stat and last close will need to read the clock. > No configuration option will be needed. > > A subtle difference with most other file systems is that devfs nodes > often stay open for very long, so the timestamps will usually come from > stat() calls, which may be much later than the actual read or write. > Still that is better than not updating timestamps at all. > > > > ... > > > Modified: head/sys/fs/devfs/devfs_vnops.c > > > ============================================================================== > > > --- head/sys/fs/devfs/devfs_vnops.c Sat Mar 21 00:21:30 2015 (r280307) > > > +++ head/sys/fs/devfs/devfs_vnops.c Sat Mar 21 01:14:11 2015 (r280308) > > > ... > > > @@ -1700,7 +1708,8 @@ devfs_write_f(struct file *fp, struct ui > > > resid = uio->uio_resid; > > > > > > error = dsw->d_write(dev, uio, ioflag); > > > - if (uio->uio_resid != resid || (error == 0 && resid != 0)) { > > > + if (devfs_dotimes && > > > + (uio->uio_resid != resid || (error == 0 && resid != 0))) { > > > vfs_timestamp(&dev->si_ctime); > > > dev->si_mtime = dev->si_ctime; > > > } > > > An old bug is evident in the diff. Writing shouldn't change the ctime. > > That is not a bug. POSIX unambiguously requires write() to update both > mtime and ctime. Does POSIX ever say anything about special files ? Devfs already has non-POSIX behaviour, e.g. write on one mount is reflected as mtime/ctime update on all mounts. On reboot, the time stamps are re-created, i.e. changes are not persistent. I think the deviations may be summarrized as 'devfs mtime is useless for the usual mtime purposes'. From this PoV, I have no objections to the patch. Doing extra work with delayed updates of times, which might be somewhat non-trivial, is a feature with non-obvious gain. From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 17:29:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 905F9294; Sun, 22 Mar 2015 17: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 7B93DA69; Sun, 22 Mar 2015 17:29:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MHTFW3010252; Sun, 22 Mar 2015 17:29:15 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MHTEPZ010250; Sun, 22 Mar 2015 17:29:14 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201503221729.t2MHTEPZ010250@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sun, 22 Mar 2015 17:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280348 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 17:29:15 -0000 Author: scottl Date: Sun Mar 22 17:29:14 2015 New Revision: 280348 URL: https://svnweb.freebsd.org/changeset/base/280348 Log: Convert savecore to libxo. The 'verbose' paths still use printf since they're meant for interactivity on the command line and contain a lot of redundant information. Obtained from: Netflix, Inc. Modified: head/sbin/savecore/Makefile head/sbin/savecore/savecore.c Modified: head/sbin/savecore/Makefile ============================================================================== --- head/sbin/savecore/Makefile Sun Mar 22 16:10:28 2015 (r280347) +++ head/sbin/savecore/Makefile Sun Mar 22 17:29:14 2015 (r280348) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= savecore -LIBADD= z +LIBADD= z xo MAN= savecore.8 .include Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Sun Mar 22 16:10:28 2015 (r280347) +++ head/sbin/savecore/savecore.c Sun Mar 22 17:29:14 2015 (r280348) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* The size of the buffer used for I/O. */ #define BUFFERSIZE (1024*1024) @@ -98,29 +99,28 @@ static sig_atomic_t got_siginfo; static void infohandler(int); static void -printheader(FILE *f, const struct kerneldumpheader *h, const char *device, +printheader(xo_handle_t *xo, const struct kerneldumpheader *h, const char *device, int bounds, const int status) { uint64_t dumplen; time_t t; const char *stat_str; - fprintf(f, "Dump header from device %s\n", device); - fprintf(f, " Architecture: %s\n", h->architecture); - fprintf(f, " Architecture Version: %u\n", - dtoh32(h->architectureversion)); + xo_flush_h(xo); + xo_emit_h(xo, "{Lwc:Dump header from device}{:dump_device/%s}\n", device); + xo_emit_h(xo, "{P: }{Lwc:Architecture}{:architecture/%s}\n", h->architecture); + xo_emit_h(xo, "{P: }{Lwc:Architecture Version}{:architecture_version/%u}\n", dtoh32(h->architectureversion)); dumplen = dtoh64(h->dumplength); - fprintf(f, " Dump Length: %lldB (%lld MB)\n", (long long)dumplen, - (long long)(dumplen >> 20)); - fprintf(f, " Blocksize: %d\n", dtoh32(h->blocksize)); + xo_emit_h(xo, "{P: }{Lwc:Dump Length}{:dump_length_bytes/%lld}\n", (long long)dumplen); + xo_emit_h(xo, "{P: }{Lwc:Blocksize}{:blocksize/%d}\n", dtoh32(h->blocksize)); t = dtoh64(h->dumptime); - fprintf(f, " Dumptime: %s", ctime(&t)); - fprintf(f, " Hostname: %s\n", h->hostname); - fprintf(f, " Magic: %s\n", h->magic); - fprintf(f, " Version String: %s", h->versionstring); - fprintf(f, " Panic String: %s\n", h->panicstring); - fprintf(f, " Dump Parity: %u\n", h->parity); - fprintf(f, " Bounds: %d\n", bounds); + xo_emit_h(xo, "{P: }{Lwc:Dumptime}{:dumptime/%s}", ctime(&t)); + xo_emit_h(xo, "{P: }{Lwc:Hostname}{:hostname/%s}\n", h->hostname); + xo_emit_h(xo, "{P: }{Lwc:Magic}{:magic/%s}\n", h->magic); + xo_emit_h(xo, "{P: }{Lwc:Version String}{:version_string/%s}", h->versionstring); + xo_emit_h(xo, "{P: }{Lwc:Panic String}{:panic_string/%s}\n", h->panicstring); + xo_emit_h(xo, "{P: }{Lwc:Dump Parity}{:dump_parity/%u}\n", h->parity); + xo_emit_h(xo, "{P: }{Lwc:Bounds}{:bounds/%d}\n", bounds); switch(status) { case STATUS_BAD: @@ -132,8 +132,8 @@ printheader(FILE *f, const struct kernel default: stat_str = "unknown"; } - fprintf(f, " Dump Status: %s\n", stat_str); - fflush(f); + xo_emit_h(xo, "{P: }{Lwc:Dump Status}{:dump_status/%s}\n", stat_str); + xo_flush_h(xo); } static int @@ -434,6 +434,7 @@ DoTextdumpFile(int fd, off_t dumpsize, o static void DoFile(const char *savedir, const char *device) { + xo_handle_t *xostdout, *xoinfo; static char infoname[PATH_MAX], corename[PATH_MAX], linkname[PATH_MAX]; static char *buf = NULL; struct kerneldumpheader kdhf, kdhl; @@ -442,13 +443,19 @@ DoFile(const char *savedir, const char * mode_t oumask; int fd, fdinfo, error; int bounds, status; - u_int sectorsize; + u_int sectorsize, xostyle; int istextdump; bounds = getbounds(); mediasize = 0; status = STATUS_UNKNOWN; + xostdout = xo_create_to_file(stdout, XO_STYLE_TEXT, 0); + if (xostdout == NULL) { + syslog(LOG_ERR, "%s: %m", infoname); + return; + } + if (maxdumps > 0 && bounds == maxdumps) bounds = 0; @@ -574,10 +581,10 @@ DoFile(const char *savedir, const char * if (verbose >= 2) { printf("First dump headers:\n"); - printheader(stdout, &kdhf, device, bounds, -1); + printheader(xostdout, &kdhf, device, bounds, -1); printf("\nLast dump headers:\n"); - printheader(stdout, &kdhl, device, bounds, -1); + printheader(xostdout, &kdhl, device, bounds, -1); printf("\n"); } @@ -626,6 +633,7 @@ DoFile(const char *savedir, const char * nerr++; goto closefd; } + oumask = umask(S_IRWXG|S_IRWXO); /* Restrict access to the core file.*/ if (compress) { snprintf(corename, sizeof(corename), "%s.%d.gz", @@ -652,10 +660,22 @@ DoFile(const char *savedir, const char * goto closefd; } + xostyle = xo_get_style(NULL); + xoinfo = xo_create_to_file(info, xostyle, 0); + if (xoinfo == NULL) { + syslog(LOG_ERR, "%s: %m", infoname); + nerr++; + goto closefd; + } + xo_open_container_h(xoinfo, "crashdump"); + if (verbose) - printheader(stdout, &kdhl, device, bounds, status); + printheader(xostdout, &kdhl, device, bounds, status); - printheader(info, &kdhl, device, bounds, status); + printheader(xoinfo, &kdhl, device, bounds, status); + xo_close_container_h(xoinfo, "crashdump"); + xo_flush_h(xoinfo); + xo_finish_h(xoinfo); fclose(info); syslog(LOG_NOTICE, "writing %score to %s/%s", @@ -712,6 +732,8 @@ nuke: syslog(LOG_ERR, "error while clearing the dump header: %m"); } + xo_close_container_h(xostdout, "crashdump"); + xo_finish_h(xostdout); close(fd); return; @@ -725,7 +747,7 @@ closefd: static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n", + xo_error("%s\n%s\n%s\n", "usage: savecore -c [-v] [device ...]", " savecore -C [-v] [device ...]", " savecore [-fkvz] [-m maxdumps] [directory [device ...]]"); @@ -745,6 +767,10 @@ main(int argc, char **argv) openlog("savecore", LOG_PERROR, LOG_DAEMON); signal(SIGINFO, infohandler); + argc = xo_parse_args(argc, argv); + if (argc < 0) + exit(1); + while ((ch = getopt(argc, argv, "Ccfkm:vz")) != -1) switch(ch) { case 'C': From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 17:54:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0681998; Sun, 22 Mar 2015 17: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 83BA4D57; Sun, 22 Mar 2015 17:54:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MHs1Kd023540; Sun, 22 Mar 2015 17:54:01 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MHs1Uj023539; Sun, 22 Mar 2015 17:54:01 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503221754.t2MHs1Uj023539@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 22 Mar 2015 17:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280349 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 17:54:01 -0000 Author: adrian Date: Sun Mar 22 17:54:00 2015 New Revision: 280349 URL: https://svnweb.freebsd.org/changeset/base/280349 Log: Initialise the pps / packet tracking timestamp so 11n aggregation works again. There's a bug in the ticks handling where when initialised at '0', once the ticks counter wrapped the comparison math would never trigger. The pps calculation would never happen, and thus aggregation was never enabled. It manifests itself as "oh you only get 11n transmit aggregation for the first 10 minutes of uptime." I'm sure there are other ticks related issues lurking in net80211. Tested: * ath / iwn, both with 'wlandebug +11n' and a little bit of iperf to kick off the transmit A-MPDU negotiation once the pps gets high enough. Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun Mar 22 17:29:14 2015 (r280348) +++ head/sys/net80211/ieee80211_ht.c Sun Mar 22 17:54:00 2015 (r280349) @@ -1047,6 +1047,7 @@ ieee80211_ht_node_init(struct ieee80211_ tap = &ni->ni_tx_ampdu[tid]; tap->txa_tid = tid; tap->txa_ni = ni; + tap->txa_lastsample = ticks; /* NB: further initialization deferred */ } ni->ni_flags |= IEEE80211_NODE_HT | IEEE80211_NODE_AMPDU; @@ -1216,6 +1217,7 @@ ieee80211_ht_wds_init(struct ieee80211_n for (tid = 0; tid < WME_NUM_TID; tid++) { tap = &ni->ni_tx_ampdu[tid]; tap->txa_tid = tid; + tap->txa_lastsample = ticks; } /* NB: AMPDU tx/rx governed by IEEE80211_FHT_AMPDU_{TX,RX} */ ni->ni_flags |= IEEE80211_NODE_HT | IEEE80211_NODE_AMPDU; @@ -1691,6 +1693,7 @@ ampdu_tx_setup(struct ieee80211_tx_ampdu { callout_init(&tap->txa_timer, CALLOUT_MPSAFE); tap->txa_flags |= IEEE80211_AGGR_SETUP; + tap->txa_lastsample = ticks; } static void @@ -1718,8 +1721,12 @@ ampdu_tx_stop(struct ieee80211_tx_ampdu */ bar_stop_timer(tap); - tap->txa_lastsample = 0; + /* + * Reset packet estimate. + */ + tap->txa_lastsample = ticks; tap->txa_avgpps = 0; + /* NB: clearing NAK means we may re-send ADDBA */ tap->txa_flags &= ~(IEEE80211_AGGR_SETUP | IEEE80211_AGGR_NAK); } From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 17:56:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4334FAFD; Sun, 22 Mar 2015 17:56: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 2D8BBD76; Sun, 22 Mar 2015 17:56:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MHupZh023968; Sun, 22 Mar 2015 17:56:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MHuoek023965; Sun, 22 Mar 2015 17:56:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503221756.t2MHuoek023965@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 22 Mar 2015 17:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280350 - in head/contrib/llvm: . tools/clang tools/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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 17:56:51 -0000 Author: dim Date: Sun Mar 22 17:56:49 2015 New Revision: 280350 URL: https://svnweb.freebsd.org/changeset/base/280350 Log: Add FREEBSD-Xlist files for llvm, clang and lldb. These are generated, and not "optimized" in any way, since I am not entirely sure of the syntax or format of this type of file. Feel free to suggest ways of shortening these lists. The general idea is the same for all three files, though: * Get rid of upstream build infrastructure (CMakeLists, Makefiles, etc) * Delete tests, tools and utilities we don't want or use (including samples) * Remove various bits of upstream metadata files that we don't want or use (.arcconfig, .gitignore, etc) Added: head/contrib/llvm/FREEBSD-Xlist (contents, props changed) head/contrib/llvm/tools/clang/FREEBSD-Xlist (contents, props changed) head/contrib/llvm/tools/lldb/FREEBSD-Xlist (contents, props changed) Added: head/contrib/llvm/FREEBSD-Xlist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/FREEBSD-Xlist Sun Mar 22 17:56:49 2015 (r280350) @@ -0,0 +1,514 @@ +# $FreeBSD$ +.arcconfig +.clang-format +.clang-tidy +.gitignore +CMakeLists.txt +CODE_OWNERS.TXT +CREDITS.TXT +LLVMBuild.txt +Makefile +Makefile.common +Makefile.config.in +Makefile.rules +README.txt +autoconf/ +bindings/ +cmake/ +configure +docs/ +examples/ +include/llvm/CMakeLists.txt +include/llvm/Config/ +include/llvm/IR/CMakeLists.txt +include/llvm/Support/DataTypes.h.cmake +include/llvm/Support/LICENSE.TXT +lib/Analysis/CMakeLists.txt +lib/Analysis/IPA/CMakeLists.txt +lib/Analysis/IPA/LLVMBuild.txt +lib/Analysis/IPA/Makefile +lib/Analysis/LLVMBuild.txt +lib/Analysis/Makefile +lib/Analysis/README.txt +lib/AsmParser/CMakeLists.txt +lib/AsmParser/LLVMBuild.txt +lib/AsmParser/Makefile +lib/Bitcode/CMakeLists.txt +lib/Bitcode/LLVMBuild.txt +lib/Bitcode/Makefile +lib/Bitcode/Reader/CMakeLists.txt +lib/Bitcode/Reader/LLVMBuild.txt +lib/Bitcode/Reader/Makefile +lib/Bitcode/Writer/CMakeLists.txt +lib/Bitcode/Writer/LLVMBuild.txt +lib/Bitcode/Writer/Makefile +lib/CMakeLists.txt +lib/CodeGen/AsmPrinter/CMakeLists.txt +lib/CodeGen/AsmPrinter/LLVMBuild.txt +lib/CodeGen/AsmPrinter/Makefile +lib/CodeGen/CMakeLists.txt +lib/CodeGen/LLVMBuild.txt +lib/CodeGen/Makefile +lib/CodeGen/README.txt +lib/CodeGen/SelectionDAG/CMakeLists.txt +lib/CodeGen/SelectionDAG/LLVMBuild.txt +lib/CodeGen/SelectionDAG/Makefile +lib/DebugInfo/CMakeLists.txt +lib/DebugInfo/LLVMBuild.txt +lib/DebugInfo/Makefile +lib/ExecutionEngine/CMakeLists.txt +lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt +lib/ExecutionEngine/IntelJITEvents/LLVMBuild.txt +lib/ExecutionEngine/IntelJITEvents/Makefile +lib/ExecutionEngine/Interpreter/CMakeLists.txt +lib/ExecutionEngine/Interpreter/LLVMBuild.txt +lib/ExecutionEngine/Interpreter/Makefile +lib/ExecutionEngine/LLVMBuild.txt +lib/ExecutionEngine/MCJIT/CMakeLists.txt +lib/ExecutionEngine/MCJIT/LLVMBuild.txt +lib/ExecutionEngine/MCJIT/Makefile +lib/ExecutionEngine/Makefile +lib/ExecutionEngine/OProfileJIT/CMakeLists.txt +lib/ExecutionEngine/OProfileJIT/LLVMBuild.txt +lib/ExecutionEngine/OProfileJIT/Makefile +lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt +lib/ExecutionEngine/RuntimeDyld/LLVMBuild.txt +lib/ExecutionEngine/RuntimeDyld/Makefile +lib/IR/CMakeLists.txt +lib/IR/LLVMBuild.txt +lib/IR/Makefile +lib/IRReader/CMakeLists.txt +lib/IRReader/LLVMBuild.txt +lib/IRReader/Makefile +lib/LLVMBuild.txt +lib/LTO/CMakeLists.txt +lib/LTO/LLVMBuild.txt +lib/LTO/Makefile +lib/LineEditor/CMakeLists.txt +lib/LineEditor/LLVMBuild.txt +lib/LineEditor/Makefile +lib/Linker/CMakeLists.txt +lib/Linker/LLVMBuild.txt +lib/Linker/Makefile +lib/MC/CMakeLists.txt +lib/MC/LLVMBuild.txt +lib/MC/MCDisassembler/CMakeLists.txt +lib/MC/MCDisassembler/LLVMBuild.txt +lib/MC/MCDisassembler/Makefile +lib/MC/MCParser/CMakeLists.txt +lib/MC/MCParser/LLVMBuild.txt +lib/MC/MCParser/Makefile +lib/MC/Makefile +lib/Makefile +lib/Object/CMakeLists.txt +lib/Object/LLVMBuild.txt +lib/Object/Makefile +lib/Option/CMakeLists.txt +lib/Option/LLVMBuild.txt +lib/Option/Makefile +lib/ProfileData/CMakeLists.txt +lib/ProfileData/LLVMBuild.txt +lib/ProfileData/Makefile +lib/Support/CMakeLists.txt +lib/Support/LLVMBuild.txt +lib/Support/Makefile +lib/Support/README.txt.system +lib/TableGen/CMakeLists.txt +lib/TableGen/LLVMBuild.txt +lib/TableGen/Makefile +lib/Target/AArch64/AsmParser/CMakeLists.txt +lib/Target/AArch64/AsmParser/LLVMBuild.txt +lib/Target/AArch64/AsmParser/Makefile +lib/Target/AArch64/CMakeLists.txt +lib/Target/AArch64/Disassembler/CMakeLists.txt +lib/Target/AArch64/Disassembler/LLVMBuild.txt +lib/Target/AArch64/Disassembler/Makefile +lib/Target/AArch64/InstPrinter/CMakeLists.txt +lib/Target/AArch64/InstPrinter/LLVMBuild.txt +lib/Target/AArch64/InstPrinter/Makefile +lib/Target/AArch64/LLVMBuild.txt +lib/Target/AArch64/MCTargetDesc/CMakeLists.txt +lib/Target/AArch64/MCTargetDesc/LLVMBuild.txt +lib/Target/AArch64/MCTargetDesc/Makefile +lib/Target/AArch64/Makefile +lib/Target/AArch64/TargetInfo/CMakeLists.txt +lib/Target/AArch64/TargetInfo/LLVMBuild.txt +lib/Target/AArch64/TargetInfo/Makefile +lib/Target/AArch64/Utils/CMakeLists.txt +lib/Target/AArch64/Utils/LLVMBuild.txt +lib/Target/AArch64/Utils/Makefile +lib/Target/ARM/AsmParser/CMakeLists.txt +lib/Target/ARM/AsmParser/LLVMBuild.txt +lib/Target/ARM/AsmParser/Makefile +lib/Target/ARM/CMakeLists.txt +lib/Target/ARM/Disassembler/CMakeLists.txt +lib/Target/ARM/Disassembler/LLVMBuild.txt +lib/Target/ARM/Disassembler/Makefile +lib/Target/ARM/InstPrinter/CMakeLists.txt +lib/Target/ARM/InstPrinter/LLVMBuild.txt +lib/Target/ARM/InstPrinter/Makefile +lib/Target/ARM/LLVMBuild.txt +lib/Target/ARM/MCTargetDesc/CMakeLists.txt +lib/Target/ARM/MCTargetDesc/LLVMBuild.txt +lib/Target/ARM/MCTargetDesc/Makefile +lib/Target/ARM/Makefile +lib/Target/ARM/README-Thumb.txt +lib/Target/ARM/README-Thumb2.txt +lib/Target/ARM/README.txt +lib/Target/ARM/TargetInfo/CMakeLists.txt +lib/Target/ARM/TargetInfo/LLVMBuild.txt +lib/Target/ARM/TargetInfo/Makefile +lib/Target/CMakeLists.txt +lib/Target/CppBackend/CMakeLists.txt +lib/Target/CppBackend/LLVMBuild.txt +lib/Target/CppBackend/Makefile +lib/Target/CppBackend/TargetInfo/CMakeLists.txt +lib/Target/CppBackend/TargetInfo/LLVMBuild.txt +lib/Target/CppBackend/TargetInfo/Makefile +lib/Target/Hexagon/CMakeLists.txt +lib/Target/Hexagon/Disassembler/CMakeLists.txt +lib/Target/Hexagon/Disassembler/LLVMBuild.txt +lib/Target/Hexagon/Disassembler/Makefile +lib/Target/Hexagon/LLVMBuild.txt +lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt +lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt +lib/Target/Hexagon/MCTargetDesc/Makefile +lib/Target/Hexagon/Makefile +lib/Target/Hexagon/TargetInfo/CMakeLists.txt +lib/Target/Hexagon/TargetInfo/LLVMBuild.txt +lib/Target/Hexagon/TargetInfo/Makefile +lib/Target/LLVMBuild.txt +lib/Target/MSP430/CMakeLists.txt +lib/Target/MSP430/InstPrinter/CMakeLists.txt +lib/Target/MSP430/InstPrinter/LLVMBuild.txt +lib/Target/MSP430/InstPrinter/Makefile +lib/Target/MSP430/LLVMBuild.txt +lib/Target/MSP430/MCTargetDesc/CMakeLists.txt +lib/Target/MSP430/MCTargetDesc/LLVMBuild.txt +lib/Target/MSP430/MCTargetDesc/Makefile +lib/Target/MSP430/Makefile +lib/Target/MSP430/README.txt +lib/Target/MSP430/TargetInfo/CMakeLists.txt +lib/Target/MSP430/TargetInfo/LLVMBuild.txt +lib/Target/MSP430/TargetInfo/Makefile +lib/Target/Makefile +lib/Target/Mips/AsmParser/CMakeLists.txt +lib/Target/Mips/AsmParser/LLVMBuild.txt +lib/Target/Mips/AsmParser/Makefile +lib/Target/Mips/CMakeLists.txt +lib/Target/Mips/Disassembler/CMakeLists.txt +lib/Target/Mips/Disassembler/LLVMBuild.txt +lib/Target/Mips/Disassembler/Makefile +lib/Target/Mips/InstPrinter/CMakeLists.txt +lib/Target/Mips/InstPrinter/LLVMBuild.txt +lib/Target/Mips/InstPrinter/Makefile +lib/Target/Mips/LLVMBuild.txt +lib/Target/Mips/MCTargetDesc/CMakeLists.txt +lib/Target/Mips/MCTargetDesc/LLVMBuild.txt +lib/Target/Mips/MCTargetDesc/Makefile +lib/Target/Mips/Makefile +lib/Target/Mips/TargetInfo/CMakeLists.txt +lib/Target/Mips/TargetInfo/LLVMBuild.txt +lib/Target/Mips/TargetInfo/Makefile +lib/Target/NVPTX/CMakeLists.txt +lib/Target/NVPTX/InstPrinter/CMakeLists.txt +lib/Target/NVPTX/InstPrinter/LLVMBuild.txt +lib/Target/NVPTX/InstPrinter/Makefile +lib/Target/NVPTX/LLVMBuild.txt +lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt +lib/Target/NVPTX/MCTargetDesc/LLVMBuild.txt +lib/Target/NVPTX/MCTargetDesc/Makefile +lib/Target/NVPTX/Makefile +lib/Target/NVPTX/TargetInfo/CMakeLists.txt +lib/Target/NVPTX/TargetInfo/LLVMBuild.txt +lib/Target/NVPTX/TargetInfo/Makefile +lib/Target/PowerPC/AsmParser/CMakeLists.txt +lib/Target/PowerPC/AsmParser/LLVMBuild.txt +lib/Target/PowerPC/AsmParser/Makefile +lib/Target/PowerPC/CMakeLists.txt +lib/Target/PowerPC/Disassembler/CMakeLists.txt +lib/Target/PowerPC/Disassembler/LLVMBuild.txt +lib/Target/PowerPC/Disassembler/Makefile +lib/Target/PowerPC/InstPrinter/CMakeLists.txt +lib/Target/PowerPC/InstPrinter/LLVMBuild.txt +lib/Target/PowerPC/InstPrinter/Makefile +lib/Target/PowerPC/LLVMBuild.txt +lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt +lib/Target/PowerPC/MCTargetDesc/LLVMBuild.txt +lib/Target/PowerPC/MCTargetDesc/Makefile +lib/Target/PowerPC/Makefile +lib/Target/PowerPC/README.txt +lib/Target/PowerPC/README_ALTIVEC.txt +lib/Target/PowerPC/TargetInfo/CMakeLists.txt +lib/Target/PowerPC/TargetInfo/LLVMBuild.txt +lib/Target/PowerPC/TargetInfo/Makefile +lib/Target/R600/AsmParser/CMakeLists.txt +lib/Target/R600/AsmParser/LLVMBuild.txt +lib/Target/R600/AsmParser/Makefile +lib/Target/R600/CMakeLists.txt +lib/Target/R600/InstPrinter/CMakeLists.txt +lib/Target/R600/InstPrinter/LLVMBuild.txt +lib/Target/R600/InstPrinter/Makefile +lib/Target/R600/LLVMBuild.txt +lib/Target/R600/MCTargetDesc/CMakeLists.txt +lib/Target/R600/MCTargetDesc/LLVMBuild.txt +lib/Target/R600/MCTargetDesc/Makefile +lib/Target/R600/Makefile +lib/Target/R600/TargetInfo/CMakeLists.txt +lib/Target/R600/TargetInfo/LLVMBuild.txt +lib/Target/R600/TargetInfo/Makefile +lib/Target/README.txt +lib/Target/Sparc/AsmParser/CMakeLists.txt +lib/Target/Sparc/AsmParser/LLVMBuild.txt +lib/Target/Sparc/AsmParser/Makefile +lib/Target/Sparc/CMakeLists.txt +lib/Target/Sparc/Disassembler/CMakeLists.txt +lib/Target/Sparc/Disassembler/LLVMBuild.txt +lib/Target/Sparc/Disassembler/Makefile +lib/Target/Sparc/InstPrinter/CMakeLists.txt +lib/Target/Sparc/InstPrinter/LLVMBuild.txt +lib/Target/Sparc/InstPrinter/Makefile +lib/Target/Sparc/LLVMBuild.txt +lib/Target/Sparc/MCTargetDesc/CMakeLists.txt +lib/Target/Sparc/MCTargetDesc/LLVMBuild.txt +lib/Target/Sparc/MCTargetDesc/Makefile +lib/Target/Sparc/Makefile +lib/Target/Sparc/README.txt +lib/Target/Sparc/TargetInfo/CMakeLists.txt +lib/Target/Sparc/TargetInfo/LLVMBuild.txt +lib/Target/Sparc/TargetInfo/Makefile +lib/Target/SystemZ/AsmParser/CMakeLists.txt +lib/Target/SystemZ/AsmParser/LLVMBuild.txt +lib/Target/SystemZ/AsmParser/Makefile +lib/Target/SystemZ/CMakeLists.txt +lib/Target/SystemZ/Disassembler/CMakeLists.txt +lib/Target/SystemZ/Disassembler/LLVMBuild.txt +lib/Target/SystemZ/Disassembler/Makefile +lib/Target/SystemZ/InstPrinter/CMakeLists.txt +lib/Target/SystemZ/InstPrinter/LLVMBuild.txt +lib/Target/SystemZ/InstPrinter/Makefile +lib/Target/SystemZ/LLVMBuild.txt +lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt +lib/Target/SystemZ/MCTargetDesc/LLVMBuild.txt +lib/Target/SystemZ/MCTargetDesc/Makefile +lib/Target/SystemZ/Makefile +lib/Target/SystemZ/TargetInfo/CMakeLists.txt +lib/Target/SystemZ/TargetInfo/LLVMBuild.txt +lib/Target/SystemZ/TargetInfo/Makefile +lib/Target/X86/AsmParser/CMakeLists.txt +lib/Target/X86/AsmParser/LLVMBuild.txt +lib/Target/X86/AsmParser/Makefile +lib/Target/X86/CMakeLists.txt +lib/Target/X86/Disassembler/CMakeLists.txt +lib/Target/X86/Disassembler/LLVMBuild.txt +lib/Target/X86/Disassembler/Makefile +lib/Target/X86/InstPrinter/CMakeLists.txt +lib/Target/X86/InstPrinter/LLVMBuild.txt +lib/Target/X86/InstPrinter/Makefile +lib/Target/X86/LLVMBuild.txt +lib/Target/X86/MCTargetDesc/CMakeLists.txt +lib/Target/X86/MCTargetDesc/LLVMBuild.txt +lib/Target/X86/MCTargetDesc/Makefile +lib/Target/X86/Makefile +lib/Target/X86/README-FPStack.txt +lib/Target/X86/README-MMX.txt +lib/Target/X86/README-SSE.txt +lib/Target/X86/README-UNIMPLEMENTED.txt +lib/Target/X86/README-X86-64.txt +lib/Target/X86/README.txt +lib/Target/X86/TargetInfo/CMakeLists.txt +lib/Target/X86/TargetInfo/LLVMBuild.txt +lib/Target/X86/TargetInfo/Makefile +lib/Target/X86/Utils/CMakeLists.txt +lib/Target/X86/Utils/LLVMBuild.txt +lib/Target/X86/Utils/Makefile +lib/Target/X86/X86CompilationCallback_Win64.asm +lib/Target/XCore/CMakeLists.txt +lib/Target/XCore/Disassembler/CMakeLists.txt +lib/Target/XCore/Disassembler/LLVMBuild.txt +lib/Target/XCore/Disassembler/Makefile +lib/Target/XCore/InstPrinter/CMakeLists.txt +lib/Target/XCore/InstPrinter/LLVMBuild.txt +lib/Target/XCore/InstPrinter/Makefile +lib/Target/XCore/LLVMBuild.txt +lib/Target/XCore/MCTargetDesc/CMakeLists.txt +lib/Target/XCore/MCTargetDesc/LLVMBuild.txt +lib/Target/XCore/MCTargetDesc/Makefile +lib/Target/XCore/Makefile +lib/Target/XCore/README.txt +lib/Target/XCore/TargetInfo/CMakeLists.txt +lib/Target/XCore/TargetInfo/LLVMBuild.txt +lib/Target/XCore/TargetInfo/Makefile +lib/Transforms/CMakeLists.txt +lib/Transforms/Hello/ +lib/Transforms/IPO/CMakeLists.txt +lib/Transforms/IPO/LLVMBuild.txt +lib/Transforms/IPO/Makefile +lib/Transforms/InstCombine/CMakeLists.txt +lib/Transforms/InstCombine/LLVMBuild.txt +lib/Transforms/InstCombine/Makefile +lib/Transforms/Instrumentation/CMakeLists.txt +lib/Transforms/Instrumentation/LLVMBuild.txt +lib/Transforms/Instrumentation/Makefile +lib/Transforms/LLVMBuild.txt +lib/Transforms/Makefile +lib/Transforms/ObjCARC/CMakeLists.txt +lib/Transforms/ObjCARC/LLVMBuild.txt +lib/Transforms/ObjCARC/Makefile +lib/Transforms/Scalar/CMakeLists.txt +lib/Transforms/Scalar/LLVMBuild.txt +lib/Transforms/Scalar/Makefile +lib/Transforms/Utils/CMakeLists.txt +lib/Transforms/Utils/LLVMBuild.txt +lib/Transforms/Utils/Makefile +lib/Transforms/Vectorize/CMakeLists.txt +lib/Transforms/Vectorize/LLVMBuild.txt +lib/Transforms/Vectorize/Makefile +llvm.spec.in +projects/ +test/ +tools/CMakeLists.txt +tools/LLVMBuild.txt +tools/Makefile +tools/bugpoint/CMakeLists.txt +tools/bugpoint/LLVMBuild.txt +tools/bugpoint/Makefile +tools/bugpoint-passes/ +tools/dsymutil/ +tools/gold/ +tools/llc/CMakeLists.txt +tools/llc/LLVMBuild.txt +tools/llc/Makefile +tools/lli/CMakeLists.txt +tools/lli/ChildTarget/CMakeLists.txt +tools/lli/ChildTarget/LLVMBuild.txt +tools/lli/ChildTarget/Makefile +tools/lli/LLVMBuild.txt +tools/lli/Makefile +tools/llvm-ar/CMakeLists.txt +tools/llvm-ar/LLVMBuild.txt +tools/llvm-ar/Makefile +tools/llvm-ar/install_symlink.cmake +tools/llvm-as/CMakeLists.txt +tools/llvm-as/LLVMBuild.txt +tools/llvm-as/Makefile +tools/llvm-bcanalyzer/CMakeLists.txt +tools/llvm-bcanalyzer/LLVMBuild.txt +tools/llvm-bcanalyzer/Makefile +tools/llvm-c-test/ +tools/llvm-config/ +tools/llvm-cov/ +tools/llvm-diff/CMakeLists.txt +tools/llvm-diff/LLVMBuild.txt +tools/llvm-diff/Makefile +tools/llvm-dis/CMakeLists.txt +tools/llvm-dis/LLVMBuild.txt +tools/llvm-dis/Makefile +tools/llvm-dwarfdump/ +tools/llvm-extract/CMakeLists.txt +tools/llvm-extract/LLVMBuild.txt +tools/llvm-extract/Makefile +tools/llvm-go/ +tools/llvm-jitlistener/ +tools/llvm-link/CMakeLists.txt +tools/llvm-link/LLVMBuild.txt +tools/llvm-link/Makefile +tools/llvm-lto/ +tools/llvm-mc/CMakeLists.txt +tools/llvm-mc/LLVMBuild.txt +tools/llvm-mc/Makefile +tools/llvm-mcmarkup/ +tools/llvm-nm/CMakeLists.txt +tools/llvm-nm/LLVMBuild.txt +tools/llvm-nm/Makefile +tools/llvm-objdump/CMakeLists.txt +tools/llvm-objdump/LLVMBuild.txt +tools/llvm-objdump/Makefile +tools/llvm-profdata/ +tools/llvm-readobj/CMakeLists.txt +tools/llvm-readobj/LLVMBuild.txt +tools/llvm-readobj/Makefile +tools/llvm-rtdyld/CMakeLists.txt +tools/llvm-rtdyld/LLVMBuild.txt +tools/llvm-rtdyld/Makefile +tools/llvm-shlib/ +tools/llvm-size/ +tools/llvm-stress/CMakeLists.txt +tools/llvm-stress/LLVMBuild.txt +tools/llvm-stress/Makefile +tools/llvm-symbolizer/CMakeLists.txt +tools/llvm-symbolizer/Makefile +tools/llvm-vtabledump/ +tools/lto/ +tools/macho-dump/CMakeLists.txt +tools/macho-dump/LLVMBuild.txt +tools/macho-dump/Makefile +tools/msbuild/ +tools/obj2yaml/ +tools/opt/CMakeLists.txt +tools/opt/LLVMBuild.txt +tools/opt/Makefile +tools/verify-uselistorder/ +tools/yaml2obj/ +unittests/ +utils/DSAclean.py +utils/DSAextract.py +utils/FileCheck/ +utils/GenLibDeps.pl +utils/GetRepositoryPath +utils/GetSourceVersion +utils/KillTheDoctor/ +utils/LLVMBuild.txt +utils/Makefile +utils/Misc/ +utils/PerfectShuffle/ +utils/TableGen/CMakeLists.txt +utils/TableGen/LLVMBuild.txt +utils/TableGen/Makefile +utils/TableGen/tdtags +utils/Target/ +utils/UpdateCMakeLists.pl +utils/bisect +utils/bugpoint/ +utils/buildit/ +utils/check-each-file +utils/clang-parse-diagnostics-file +utils/codegen-diff +utils/count/ +utils/countloc.sh +utils/crosstool/ +utils/emacs/ +utils/findmisopt +utils/findoptdiff +utils/findsym.pl +utils/fpcmp/ +utils/getsrcs.sh +utils/git/ +utils/git-svn/ +utils/jedit/ +utils/kate/ +utils/lint/ +utils/lit/ +utils/lldbDataFormatters.py +utils/llvm-build/ +utils/llvm-compilers-check +utils/llvm-lit/ +utils/llvm-native-gxx +utils/llvm.grm +utils/llvm.natvis +utils/llvmdo +utils/llvmgrep +utils/makellvm +utils/not/ +utils/release/ +utils/shuffle_fuzz.py +utils/sort_includes.py +utils/test_debuginfo.pl +utils/testgen/ +utils/textmate/ +utils/unittest/ +utils/update_llc_test_checks.py +utils/valgrind/ +utils/vim/ +utils/wciia.py +utils/yaml-bench/ Added: head/contrib/llvm/tools/clang/FREEBSD-Xlist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/tools/clang/FREEBSD-Xlist Sun Mar 22 17:56:49 2015 (r280350) @@ -0,0 +1,131 @@ +# $FreeBSD$ +.arcconfig +.clang-format +.clang-tidy +.gitignore +CMakeLists.txt +CODE_OWNERS.TXT +INPUTS/ +INSTALL.txt +Makefile +ModuleInfo.txt +NOTES.txt +README.txt +bindings/ +cmake/ +docs/ +examples/ +include/CMakeLists.txt +include/Makefile +include/clang/AST/CMakeLists.txt +include/clang/AST/Makefile +include/clang/Basic/CMakeLists.txt +include/clang/Basic/Makefile +include/clang/Basic/Version.inc.in +include/clang/CMakeLists.txt +include/clang/Config/ +include/clang/Driver/CMakeLists.txt +include/clang/Driver/Makefile +include/clang/Makefile +include/clang/Parse/CMakeLists.txt +include/clang/Parse/Makefile +include/clang/Sema/CMakeLists.txt +include/clang/Sema/Makefile +include/clang/Serialization/CMakeLists.txt +include/clang/Serialization/Makefile +include/clang-c/Makefile +lib/ARCMigrate/CMakeLists.txt +lib/ARCMigrate/Makefile +lib/AST/CMakeLists.txt +lib/AST/Makefile +lib/ASTMatchers/CMakeLists.txt +lib/ASTMatchers/Dynamic/CMakeLists.txt +lib/ASTMatchers/Dynamic/Makefile +lib/ASTMatchers/Makefile +lib/Analysis/CMakeLists.txt +lib/Analysis/Makefile +lib/Basic/CMakeLists.txt +lib/Basic/Makefile +lib/CMakeLists.txt +lib/CodeGen/CMakeLists.txt +lib/CodeGen/Makefile +lib/CodeGen/README.txt +lib/Driver/CMakeLists.txt +lib/Driver/Makefile +lib/Edit/CMakeLists.txt +lib/Edit/Makefile +lib/Format/CMakeLists.txt +lib/Format/Makefile +lib/Frontend/CMakeLists.txt +lib/Frontend/Makefile +lib/Frontend/Rewrite/CMakeLists.txt +lib/Frontend/Rewrite/Makefile +lib/FrontendTool/CMakeLists.txt +lib/FrontendTool/Makefile +lib/Headers/CMakeLists.txt +lib/Headers/Makefile +lib/Index/CMakeLists.txt +lib/Index/Makefile +lib/Lex/CMakeLists.txt +lib/Lex/Makefile +lib/Makefile +lib/Parse/CMakeLists.txt +lib/Parse/Makefile +lib/Rewrite/CMakeLists.txt +lib/Rewrite/Makefile +lib/Sema/CMakeLists.txt +lib/Sema/Makefile +lib/Serialization/CMakeLists.txt +lib/Serialization/Makefile +lib/StaticAnalyzer/CMakeLists.txt +lib/StaticAnalyzer/Checkers/CMakeLists.txt +lib/StaticAnalyzer/Checkers/Makefile +lib/StaticAnalyzer/Core/CMakeLists.txt +lib/StaticAnalyzer/Core/Makefile +lib/StaticAnalyzer/Frontend/CMakeLists.txt +lib/StaticAnalyzer/Frontend/Makefile +lib/StaticAnalyzer/Makefile +lib/StaticAnalyzer/README.txt +lib/Tooling/CMakeLists.txt +lib/Tooling/Core/CMakeLists.txt +lib/Tooling/Core/Makefile +lib/Tooling/Makefile +runtime/ +test/ +tools/CMakeLists.txt +tools/Makefile +tools/arcmt-test/ +tools/c-arcmt-test/ +tools/c-index-test/ +tools/clang-check/ +tools/clang-format/ +tools/clang-format-vs/ +tools/diag-build/ +tools/diagtool/ +tools/driver/CMakeLists.txt +tools/driver/Info.plist.in +tools/driver/Makefile +tools/driver/clang_symlink.cmake +tools/libclang/ +tools/scan-build/ +tools/scan-view/ +unittests/ +utils/ABITest/ +utils/CIndex/ +utils/CaptureCmd +utils/ClangDataFormat.py +utils/CmpDriver +utils/FindSpecRefs +utils/FuzzTest +utils/TableGen/CMakeLists.txt +utils/TableGen/Makefile +utils/TestUtils/ +utils/VtableTest/ +utils/analyzer/ +utils/builtin-defines.c +utils/clang-completion-mode.el +utils/clang.natvis +utils/find-unused-diagnostics.sh +utils/token-delta.py +utils/valgrind/ +www/ Added: head/contrib/llvm/tools/lldb/FREEBSD-Xlist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/tools/lldb/FREEBSD-Xlist Sun Mar 22 17:56:49 2015 (r280350) @@ -0,0 +1,186 @@ +# $FreeBSD$ +.arcconfig +.clang-format +.gitignore +CMakeLists.txt +INSTALL.txt +Makefile +cmake/ +docs/CMakeLists.txt +docs/building-with-debug-llvm.txt +docs/code-signing.txt +docs/doxygen.cfg.in +docs/doxygen.footer +docs/doxygen.header +docs/doxygen.intro +docs/lldb-for-gdb-users.txt +docs/lldb-gdb-remote.txt +docs/testsuite/ +examples/ +gtest/ +include/Makefile +include/lldb/Host/android/ +include/lldb/Host/linux/ +include/lldb/Host/macosx/ +include/lldb/Host/mingw/ +include/lldb/Host/msvc/ +include/lldb/Host/windows/ +include/lldb/Makefile +lib/ +lldb.xcodeproj/ +lldb.xcworkspace/ +resources/ +scripts/ +source/API/CMakeLists.txt +source/API/Makefile +source/Breakpoint/CMakeLists.txt +source/Breakpoint/Makefile +source/CMakeLists.txt +source/Commands/CMakeLists.txt +source/Commands/Makefile +source/Core/CMakeLists.txt +source/Core/Makefile +source/DataFormatters/CMakeLists.txt +source/DataFormatters/Makefile +source/Expression/CMakeLists.txt +source/Expression/Makefile +source/Host/CMakeLists.txt +source/Host/Makefile +source/Host/common/Makefile +source/Host/freebsd/Makefile +source/Host/linux/ +source/Host/macosx/ +source/Host/posix/Makefile +source/Host/windows/ +source/Interpreter/CMakeLists.txt +source/Interpreter/Makefile +source/Makefile +source/Plugins/ABI/CMakeLists.txt +source/Plugins/ABI/MacOSX-arm/CMakeLists.txt +source/Plugins/ABI/MacOSX-arm/Makefile +source/Plugins/ABI/MacOSX-arm64/CMakeLists.txt +source/Plugins/ABI/MacOSX-arm64/Makefile +source/Plugins/ABI/MacOSX-i386/CMakeLists.txt +source/Plugins/ABI/MacOSX-i386/Makefile +source/Plugins/ABI/SysV-hexagon/CMakeLists.txt +source/Plugins/ABI/SysV-hexagon/Makefile +source/Plugins/ABI/SysV-ppc/CMakeLists.txt +source/Plugins/ABI/SysV-ppc/Makefile +source/Plugins/ABI/SysV-ppc64/CMakeLists.txt +source/Plugins/ABI/SysV-ppc64/Makefile +source/Plugins/ABI/SysV-x86_64/CMakeLists.txt +source/Plugins/ABI/SysV-x86_64/Makefile +source/Plugins/CMakeLists.txt +source/Plugins/Disassembler/CMakeLists.txt +source/Plugins/Disassembler/llvm/CMakeLists.txt +source/Plugins/Disassembler/llvm/Makefile +source/Plugins/DynamicLoader/CMakeLists.txt +source/Plugins/DynamicLoader/Darwin-Kernel/ +source/Plugins/DynamicLoader/Hexagon-DYLD/CMakeLists.txt +source/Plugins/DynamicLoader/Hexagon-DYLD/Makefile +source/Plugins/DynamicLoader/MacOSX-DYLD/ +source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt +source/Plugins/DynamicLoader/POSIX-DYLD/Makefile +source/Plugins/DynamicLoader/Static/CMakeLists.txt +source/Plugins/DynamicLoader/Static/Makefile +source/Plugins/Instruction/ARM/CMakeLists.txt +source/Plugins/Instruction/ARM/Makefile +source/Plugins/Instruction/ARM64/CMakeLists.txt +source/Plugins/Instruction/ARM64/Makefile +source/Plugins/Instruction/CMakeLists.txt +source/Plugins/InstrumentationRuntime/AddressSanitizer/CMakeLists.txt +source/Plugins/InstrumentationRuntime/AddressSanitizer/Makefile +source/Plugins/InstrumentationRuntime/CMakeLists.txt +source/Plugins/JITLoader/CMakeLists.txt +source/Plugins/JITLoader/GDB/CMakeLists.txt +source/Plugins/JITLoader/GDB/Makefile +source/Plugins/LanguageRuntime/CMakeLists.txt +source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt +source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt +source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/Makefile +source/Plugins/LanguageRuntime/ObjC/ +source/Plugins/Makefile +source/Plugins/MemoryHistory/CMakeLists.txt +source/Plugins/MemoryHistory/asan/CMakeLists.txt +source/Plugins/MemoryHistory/asan/Makefile +source/Plugins/ObjectContainer/BSD-Archive/CMakeLists.txt +source/Plugins/ObjectContainer/BSD-Archive/Makefile +source/Plugins/ObjectContainer/CMakeLists.txt +source/Plugins/ObjectContainer/Universal-Mach-O/ +source/Plugins/ObjectFile/CMakeLists.txt +source/Plugins/ObjectFile/ELF/CMakeLists.txt +source/Plugins/ObjectFile/ELF/Makefile +source/Plugins/ObjectFile/JIT/CMakeLists.txt +source/Plugins/ObjectFile/JIT/Makefile +source/Plugins/ObjectFile/Mach-O/ +source/Plugins/ObjectFile/PECOFF/ +source/Plugins/OperatingSystem/CMakeLists.txt +source/Plugins/OperatingSystem/Python/CMakeLists.txt +source/Plugins/OperatingSystem/Python/Makefile +source/Plugins/Platform/CMakeLists.txt +source/Plugins/Platform/FreeBSD/CMakeLists.txt +source/Plugins/Platform/FreeBSD/Makefile +source/Plugins/Platform/Kalimba/ +source/Plugins/Platform/Linux/ +source/Plugins/Platform/MacOSX/ +source/Plugins/Platform/Makefile +source/Plugins/Platform/POSIX/CMakeLists.txt +source/Plugins/Platform/POSIX/Makefile +source/Plugins/Platform/Windows/ +source/Plugins/Platform/gdb-server/CMakeLists.txt +source/Plugins/Platform/gdb-server/Makefile +source/Plugins/Process/CMakeLists.txt +source/Plugins/Process/FreeBSD/CMakeLists.txt +source/Plugins/Process/FreeBSD/Makefile +source/Plugins/Process/Linux/ +source/Plugins/Process/MacOSX-Kernel/ +source/Plugins/Process/POSIX/CMakeLists.txt +source/Plugins/Process/POSIX/Makefile +source/Plugins/Process/Utility/CMakeLists.txt +source/Plugins/Process/Utility/Makefile +source/Plugins/Process/Windows/ +source/Plugins/Process/elf-core/CMakeLists.txt +source/Plugins/Process/elf-core/Makefile +source/Plugins/Process/gdb-remote/CMakeLists.txt +source/Plugins/Process/gdb-remote/Makefile +source/Plugins/Process/mach-core/ +source/Plugins/SymbolFile/CMakeLists.txt +source/Plugins/SymbolFile/DWARF/CMakeLists.txt +source/Plugins/SymbolFile/DWARF/Makefile +source/Plugins/SymbolFile/Symtab/CMakeLists.txt +source/Plugins/SymbolFile/Symtab/Makefile +source/Plugins/SymbolVendor/CMakeLists.txt +source/Plugins/SymbolVendor/ELF/CMakeLists.txt +source/Plugins/SymbolVendor/ELF/Makefile +source/Plugins/SymbolVendor/MacOSX/ +source/Plugins/SystemRuntime/ +source/Plugins/UnwindAssembly/CMakeLists.txt +source/Plugins/UnwindAssembly/InstEmulation/CMakeLists.txt +source/Plugins/UnwindAssembly/InstEmulation/Makefile +source/Plugins/UnwindAssembly/x86/CMakeLists.txt +source/Plugins/UnwindAssembly/x86/Makefile +source/Symbol/CMakeLists.txt +source/Symbol/Makefile +source/Target/CMakeLists.txt +source/Target/Makefile +source/Utility/CMakeLists.txt +source/Utility/Makefile +test/ +tools/CMakeLists.txt +tools/Makefile +tools/darwin-debug/ +tools/darwin-threads/ +tools/debugserver/ +tools/driver/CMakeLists.txt +tools/driver/Makefile +tools/driver/lldb-Info.plist +tools/install-headers/ +tools/lldb-gdbserver/ +tools/lldb-mi/CMakeLists.txt +tools/lldb-mi/Makefile +tools/lldb-mi/lldb-Info.plist +tools/lldb-perf/ +tools/lldb-platform/CMakeLists.txt +tools/lldb-platform/Makefile +utils/ +www/ From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 18:12:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE449FBE; Sun, 22 Mar 2015 18:12:05 +0000 (UTC) Received: from mail-ie0-x233.google.com (mail-ie0-x233.google.com [IPv6:2607:f8b0:4001:c03::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73E9BF43; Sun, 22 Mar 2015 18:12:05 +0000 (UTC) Received: by iedfl3 with SMTP id fl3so25315830ied.1; Sun, 22 Mar 2015 11:12:05 -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=hOy59qNCw1ONOaQ40QCOTmV24O4hKExVk/tJaIgZvYY=; b=JM7dneiOl6HAR6PYsR9BJ4V3aXMnqr+3D/V5QkMHKg3ZpUDRiMcm407o0VCAX1DNPj L/QgPtvoWfCisf67LjRyuMi35DeT3UyJAojcFfvqYWGi2nPGy8+uk1TBQQZWugwps8++ TKBU6Z0hcmJBzdhNQ812epKvwrImKbz9ximTAB8sRh//i6DhhCDRL7xn9PgmaLvHh7Ed sjLMayv8YhDjoT/XeaBJd8TNFAwNmDwOzf2g/eVaIBaEyX96l4eQU+4y+7NOwVpwiG4t /hSnxrSaDS1UrrDDws8E87ot9rx17TmvxFYcv/T9Wn1/XSxz11EZELaxcwJp9lySndij cI6g== MIME-Version: 1.0 X-Received: by 10.42.93.83 with SMTP id w19mr15405904icm.37.1427047924944; Sun, 22 Mar 2015 11:12:04 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.194 with HTTP; Sun, 22 Mar 2015 11:12:04 -0700 (PDT) In-Reply-To: <20150322100834.GA88392@FreeBSD.org> References: <201503220215.t2M2FAD9084914@svn.freebsd.org> <20150322100834.GA88392@FreeBSD.org> Date: Sun, 22 Mar 2015 11:12:04 -0700 X-Google-Sender-Auth: USPrpOV-My4PmsvDZ3nyQmqNQuU Message-ID: Subject: Re: svn commit: r280337 - head/sys/mips/conf From: Adrian Chadd To: Alexey Dokuchaev 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-1 Precedence: list List-Id: SVN 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 Mar 2015 18:12:05 -0000 On 22 March 2015 at 03:08, Alexey Dokuchaev wrote: > On Sun, Mar 22, 2015 at 02:15:10AM +0000, Adrian Chadd wrote: >> New Revision: 280337 >> URL: https://svnweb.freebsd.org/changeset/base/280337 >> >> Log: >> Add initial D-Link DIR-655 (A1) support. >> >> This is based on the AP135 design - QCA9558 SoC, 3x3 2GHz wifi, but no >> 5GHz (11n or 11ac) chip is available. >> >> It however still has 128MiB of RAM, 16MiB of NOR flash and the AR8327N >> gigabit switch - so it's quite a beefy router device. > > Thanks for working on those guys Adrian! I've always avoided these type > of "small box" routers: few years ago their CPU would typically not being > able to saturate even 100Mbit/s; recently they became powerful enough, but > having to run OpenWRT made me always prefer to fetch some Mendocino-based > board from the back-yard junk and install FreeBSD to get a decent router. Heh, you're welcome. The AR71xx and later CPUs have been able to do > 100mbit/sec for quite some time. > Good to know that soon I could simply get one of those small, fanless Gbit > Chinese switches instead (and I'd probably run out of Mendocinos anyways > by that time :-). if_arge need some attention to improve throughput. I'm totally all for someone owning that. :) -a From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 18:17:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D506E4AA; Sun, 22 Mar 2015 18:17: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 C0F27FA4; Sun, 22 Mar 2015 18:17:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MIHuWx034306; Sun, 22 Mar 2015 18:17:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MIHu8v034305; Sun, 22 Mar 2015 18:17:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503221817.t2MIHu8v034305@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 22 Mar 2015 18:17:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280351 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 18:17:57 -0000 Author: andrew Date: Sun Mar 22 18:17:55 2015 New Revision: 280351 URL: https://svnweb.freebsd.org/changeset/base/280351 Log: Stop calling x86_efi_copyin and x86_efi_getdev directly. This is to help port loader.efi to both 32 and 64-bit ARM where we can use this file with minimal changes. Differential Revision: https://reviews.freebsd.org/D2031 Reviewed by: imp Modified: head/sys/boot/amd64/efi/bootinfo.c Modified: head/sys/boot/amd64/efi/bootinfo.c ============================================================================== --- head/sys/boot/amd64/efi/bootinfo.c Sun Mar 22 17:56:49 2015 (r280350) +++ head/sys/boot/amd64/efi/bootinfo.c Sun Mar 22 18:17:55 2015 (r280351) @@ -114,24 +114,24 @@ bi_copyenv(vm_offset_t 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) + if (archsw.arch_copyin(ep->ev_name, addr, len) != len) break; addr += len; - if (x86_efi_copyin("=", addr, 1) != 1) + if (archsw.arch_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) + if (archsw.arch_copyin(ep->ev_value, addr, len) != len) break; addr += len; } - if (x86_efi_copyin("", addr, 1) != 1) + if (archsw.arch_copyin("", addr, 1) != 1) break; last = ++addr; } - if (x86_efi_copyin("", last++, 1) != 1) + if (archsw.arch_copyin("", last++, 1) != 1) last = start; return(last); } @@ -155,7 +155,7 @@ bi_copyenv(vm_offset_t start) #define COPY32(v, a, c) { \ uint32_t x = (v); \ if (c) \ - x86_efi_copyin(&x, a, sizeof(x)); \ + archsw.arch_copyin(&x, a, sizeof(x)); \ a += sizeof(x); \ } @@ -163,8 +163,8 @@ bi_copyenv(vm_offset_t start) 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)); \ + archsw.arch_copyin(s, a, strlen(s) + 1); \ + a += roundup(strlen(s) + 1, sizeof(u_long)); \ } #define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) @@ -175,8 +175,8 @@ bi_copyenv(vm_offset_t start) 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)); \ + archsw.arch_copyin(&s, a, sizeof(s)); \ + a += roundup(sizeof(s), sizeof(u_long)); \ } #define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) @@ -186,8 +186,8 @@ bi_copyenv(vm_offset_t start) 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)); \ + archsw.arch_copyin(mm->md_data, a, mm->md_size); \ + a += roundup(mm->md_size, sizeof(u_long)); \ } #define MOD_END(a, c) { \ @@ -326,7 +326,7 @@ bi_load(char *args, vm_offset_t *modulep * tested/set by MI code before launching the kernel. */ rootdevname = getenv("rootdev"); - x86_efi_getdev((void**)(&rootdev), rootdevname, NULL); + archsw.arch_getdev((void**)(&rootdev), rootdevname, NULL); if (rootdev == NULL) { printf("Can't determine root device.\n"); return(EINVAL); From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 18:25:23 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CB6282D; Sun, 22 Mar 2015 18:25:23 +0000 (UTC) Received: from gw.catspoiler.org (cl-1657.chi-02.us.sixxs.net [IPv6:2001:4978:f:678::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 B94B2F2; Sun, 22 Mar 2015 18:25:22 +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 t2MIP7jv096531; Sun, 22 Mar 2015 10:25:11 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201503221825.t2MIP7jv096531@gw.catspoiler.org> Date: Sun, 22 Mar 2015 11:25:07 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r280308 - head/sys/fs/devfs To: kostikbel@gmail.com In-Reply-To: <20150322162507.GD2379@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: src-committers@FreeBSD.org, jilles@stack.nl, svn-src-all@FreeBSD.org, delphij@FreeBSD.org, brde@optusnet.com.au, svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 18:25:23 -0000 On 22 Mar, Konstantin Belousov wrote: > On Sun, Mar 22, 2015 at 02:37:09PM +0100, Jilles Tjoelker wrote: >> On Sat, Mar 21, 2015 at 08:49:00PM +1100, Bruce Evans wrote: >> > On Sat, 21 Mar 2015, Xin LI wrote: >> >> > > Log: >> > > Disable timestamping on devfs read/write operations by default. >> >> > > Currently we update timestamps unconditionally when doing read or >> > > write operations. This may slow things down on hardware where >> > > reading timestamps is expensive (e.g. HPET, because of the default >> > > vfs.timestamp_precision setting is nanosecond now) with limited >> > > benefit. >> >> > > A new sysctl variable, vfs.devfs.dotimes is added, which can be >> > > set to non-zero value when the old behavior is desirable. >> >> > I don't like this. It defaults to non-POSIX-conformant behaviour... >> >> > The slowness is mostly from no delayed update of times in devfs. >> > Switching vfs.timestamp_precision to a hardware timecounter would >> > have been even more expensive for regular files if file systems >> > didn't have delayed updates. The assumption that vfs_timestamp() >> > doesn't use a slow timecounter was so often satisfied that no one >> > missed devfs also not supporting mounting with -noatime. >> >> > Delayed updates are even easier to implement for devfs than for disk >> > file systems the times never need to be written to disk. A slow update >> > is still wasteful for atimes, but not as bad as for disk file systems >> > since it doesn't trigger a slower sync to disk. >> >> Yes, I think implementing delayed updates is the right solution to this >> problem. This way, only stat and last close will need to read the clock. >> No configuration option will be needed. >> >> A subtle difference with most other file systems is that devfs nodes >> often stay open for very long, so the timestamps will usually come from >> stat() calls, which may be much later than the actual read or write. >> Still that is better than not updating timestamps at all. >> >> > > ... >> > > Modified: head/sys/fs/devfs/devfs_vnops.c >> > > ============================================================================== >> > > --- head/sys/fs/devfs/devfs_vnops.c Sat Mar 21 00:21:30 2015 (r280307) >> > > +++ head/sys/fs/devfs/devfs_vnops.c Sat Mar 21 01:14:11 2015 (r280308) >> > > ... >> > > @@ -1700,7 +1708,8 @@ devfs_write_f(struct file *fp, struct ui >> > > resid = uio->uio_resid; >> > > >> > > error = dsw->d_write(dev, uio, ioflag); >> > > - if (uio->uio_resid != resid || (error == 0 && resid != 0)) { >> > > + if (devfs_dotimes && >> > > + (uio->uio_resid != resid || (error == 0 && resid != 0))) { >> > > vfs_timestamp(&dev->si_ctime); >> > > dev->si_mtime = dev->si_ctime; >> > > } >> >> > An old bug is evident in the diff. Writing shouldn't change the ctime. >> >> That is not a bug. POSIX unambiguously requires write() to update both >> mtime and ctime. > Does POSIX ever say anything about special files ? > > Devfs already has non-POSIX behaviour, e.g. write on one mount is > reflected as mtime/ctime update on all mounts. On reboot, the time > stamps are re-created, i.e. changes are not persistent. > > I think the deviations may be summarrized as 'devfs mtime is useless for > the usual mtime purposes'. From this PoV, I have no objections to the > patch. Doing extra work with delayed updates of times, which might > be somewhat non-trivial, is a feature with non-obvious gain. It's not totally worthless. I think the mtime on tty devices is used to calculate the idle time that is printed by the w command. We just don't need nanosecond accuracy for that. From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 19:35:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E782AFC1 for ; Sun, 22 Mar 2015 19:35:55 +0000 (UTC) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B820DAD4 for ; Sun, 22 Mar 2015 19:35:55 +0000 (UTC) Received: by pdnc3 with SMTP id c3so164907913pdn.0 for ; Sun, 22 Mar 2015 12:35: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:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=sPLiwqU8fiE6a8EeQUCVGrzrIsRaCMUDMOTvav0Vb3o=; b=VtGoVaJeENPH4Esr5bXzJQjOrwEYFG57WI+re5kyto6NI1mKhCo2ILklbuZaHCLo9/ Du0w46r+nMfdYj+9P9BkgNpPP6EvJ3YgStBz8zpBuR3sTyJ18UFHsDZ2FXXoQRUaYXkd twk6k4HWAPWAjZ7jKsWjGP0JxDkvE1wmlHvbCEelqOGgV9RUOJVntQUNaaGBgQgRjbX5 fx2qlxFRQOWjxKenfnNNz/M1oWf0WHmoeCppbH0Z2gljPvsbm7AKQU9pTMFzETYPBPa/ n65ewvx7DO+CfMM7IncZ2m7azqtGrQSK7SLQHhhpp2qlm2yrqKrX00IB3gkQf7bQudAv +62g== X-Gm-Message-State: ALoCoQkxyN4PG7/wybNh8FQ1q49Yd24qy/MPeNhKJY+qgOR+g7pCvR2Lt4fZrtN1ISLlhusK6kcO MIME-Version: 1.0 X-Received: by 10.70.89.195 with SMTP id bq3mr164835705pdb.138.1427052505838; Sun, 22 Mar 2015 12:28:25 -0700 (PDT) Received: by 10.70.65.105 with HTTP; Sun, 22 Mar 2015 12:28:25 -0700 (PDT) Received: by 10.70.65.105 with HTTP; Sun, 22 Mar 2015 12:28:25 -0700 (PDT) In-Reply-To: References: <201503211501.t2LF1Kj8052521@svn.freebsd.org> <20150321210341.GC15857@lonesome.com> <20150321210810.GT2379@kib.kiev.ua> <20150321212416.GU2379@kib.kiev.ua> Date: Sun, 22 Mar 2015 12:28:25 -0700 Message-ID: Subject: Re: svn commit: r280323 - head/sys/kern From: Jos Backus To: svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: Konstantin Belousov , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 19:35:56 -0000 On Mar 22, 2015 5:11 AM, "Dmitry Morozovsky" wrote: > > On Sat, 21 Mar 2015, Konstantin Belousov wrote: > > > > > > > Somewhat modernize the SysV shm code: > > > > > > > > > > Is my understanding correct that postgres still uses shm? If so, > > > > > has someone benchmarked the speedup? > > > > > > > > Yes, some versions of Postgres still use SysV shm. > > > > > > To be clarified: IIUC, *all* contemporary versions of PostgreSQL do > > > use SHM for shatrd buffers (as PgSQL use process-per-connection model) > > > > No. Recent versions use mmaped shared region for buffers. > > Yes, starting from 9.3 main buffers are memory-mapped. SysV SHM and Semaphores > *are* still in use though. To expand on this a little bit: A small amount of SysV shared memory and semaphores are still used to manage safe and crash-proof access to the shared buffers between the postmaster and the client instances and other worker processes that need access to said buffers. My understanding from discussions on the PostgreSQL hackers list is that POSIX shared memory doesn't have the behavior needed to provide the same guarantees required. The change to use mmap()-ed memory was done to help people avoid having to change their SysV IPC resource limits, since these tend to have to be statically allocated, and are often too low to run PostgreSQL well or at all. This is to the best of my understanding. I'm not a PostgreSQL developer, so I could be wrong, in which case, please correct me. Jos > (mainly for search engines) > > Thanks for the clarification. > > -- > Sincerely, > D.Marck [DM5020, MCK-RIPE, DM3-RIPN] > [ FreeBSD committer: marck@FreeBSD.org ] > ------------------------------------------------------------------------ > *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** > ------------------------------------------------------------------------ > _______________________________________________ > 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 Sun Mar 22 20:38:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EBDC40E; Sun, 22 Mar 2015 20: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 EDD651A0; Sun, 22 Mar 2015 20:38:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MKcTYj002038; Sun, 22 Mar 2015 20:38:29 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MKcT4p002037; Sun, 22 Mar 2015 20:38:29 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201503222038.t2MKcT4p002037@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 22 Mar 2015 20:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280354 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 20:38:30 -0000 Author: allanjude (doc committer) Date: Sun Mar 22 20:38:28 2015 New Revision: 280354 URL: https://svnweb.freebsd.org/changeset/base/280354 Log: Fix typo in jail(8) man page PR: 198790 Differential Revision: https://reviews.freebsd.org/D2111 Submitted by: Jimmy Olgeni Approved by: wblock (mentor) Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun Mar 22 18:32:37 2015 (r280353) +++ head/usr.sbin/jail/jail.8 Sun Mar 22 20:38:28 2015 (r280354) @@ -703,7 +703,7 @@ jail is created, and will be removed fro jail is removed. .It Va ip4.addr In addition to the IP addresses that are passed to the kernel, an -interface, netmask and additional paramters (as supported by +interface, netmask and additional parameters (as supported by .Xr ifconfig 8 Ns ) may also be specified, in the form .Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar netmask param ... . From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 21:18:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADC058CC; Sun, 22 Mar 2015 21: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 98CD28C4; Sun, 22 Mar 2015 21:18:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MLIjcu021397; Sun, 22 Mar 2015 21:18:45 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MLIjWv021396; Sun, 22 Mar 2015 21:18:45 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503222118.t2MLIjWv021396@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 22 Mar 2015 21:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280355 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:18:45 -0000 Author: ian Date: Sun Mar 22 21:18:44 2015 New Revision: 280355 URL: https://svnweb.freebsd.org/changeset/base/280355 Log: The sysctls that return process argv and envv return binary data, so clear the SBUF_INCLUDENUL flag. Pointed out by: tijl@ Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Mar 22 20:38:28 2015 (r280354) +++ head/sys/kern/kern_proc.c Sun Mar 22 21:18:44 2015 (r280355) @@ -1851,6 +1851,7 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARG _PHOLD(p); PROC_UNLOCK(p); sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); + sbuf_clear_flags(&sb, SBUF_INCLUDENUL); error = proc_getargv(curthread, p, &sb); error2 = sbuf_finish(&sb); PRELE(p); @@ -1903,6 +1904,7 @@ sysctl_kern_proc_env(SYSCTL_HANDLER_ARGS } sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); + sbuf_clear_flags(&sb, SBUF_INCLUDENUL); error = proc_getenvv(curthread, p, &sb); error2 = sbuf_finish(&sb); PRELE(p); From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 21:20:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9676DAF3; Sun, 22 Mar 2015 21:20:31 +0000 (UTC) Received: from relay.mailchannels.net (aso-006-i440.relay.mailchannels.net [23.91.64.121]) by mx1.freebsd.org (Postfix) with ESMTP id 4B3388D1; Sun, 22 Mar 2015 21:20:29 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp2.ore.mailhop.org (ip-10-33-12-218.us-west-2.compute.internal [10.33.12.218]) by relay.mailchannels.net (Postfix) with ESMTPA id 94914A047F; Sun, 22 Mar 2015 21:20:27 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp2.ore.mailhop.org (smtp2.ore.mailhop.org [10.45.8.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Sun, 22 Mar 2015 21:20:27 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1427059227710:1465418749 X-MC-Ingress-Time: 1427059227710 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp2.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YZnIJ-0001Hq-5E; Sun, 22 Mar 2015 21:20:27 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2MLKPpF037879; Sun, 22 Mar 2015 15:20:25 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1+VOhez/SxHfnWm+0QOFkYA Message-ID: <1427059225.49126.5.camel@freebsd.org> Subject: Re: svn commit: r279993 - in head/sys: dev/cxgb dev/cxgbe kern vm From: Ian Lepore To: Tijl Coosemans Date: Sun, 22 Mar 2015 15:20:25 -0600 In-Reply-To: <20150322171110.2af31564@kalimero.tijl.coosemans.org> References: <201503141708.t2EH8TdR074383@svn.freebsd.org> <20150322171110.2af31564@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie Cc: svn-src-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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:20:31 -0000 On Sun, 2015-03-22 at 17:11 +0100, Tijl Coosemans wrote: > On Sat, 14 Mar 2015 17:08:29 +0000 (UTC) Ian Lepore wrote: > > Author: ian > > Date: Sat Mar 14 17:08:28 2015 > > New Revision: 279993 > > URL: https://svnweb.freebsd.org/changeset/base/279993 > > > > Log: > > Set the SBUF_INCLUDENUL flag in sbuf_new_for_sysctl() so that sysctl > > strings returned to userland include the nulterm byte. > > > > Some uses of sbuf_new_for_sysctl() write binary data rather than strings; > > clear the SBUF_INCLUDENUL flag after calling sbuf_new_for_sysctl() in > > those cases. (Note that the sbuf code still automatically adds a nulterm > > byte in sbuf_finish(), but since it's not included in the length it won't > > get copied to userland along with the binary data.) > > Can you review the attached patch? The KERN_PROC_ENV sysctl is also > binary (zero-terminated strings). Adding an extra \0 at the end makes > some programs think there's an extra empty environment variable. It > causes console-kit-daemon to crash for instance. > > I suspect a similar patch may be needed for KERN_PROC_ARGS. I think you're right. The OID format isn't "A" so it shouldn't be formatted as a normal C string, for both argv and envv. I commited the fix as r280355, thanks. -- Ian From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 21:37:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F04CB5B7; Sun, 22 Mar 2015 21:37:14 +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 99824AC0; Sun, 22 Mar 2015 21:37:14 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id D12BD4217FA; Mon, 23 Mar 2015 08:15:21 +1100 (AEDT) Date: Mon, 23 Mar 2015 08:15:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker Subject: Re: svn commit: r280308 - head/sys/fs/devfs In-Reply-To: <20150322133709.GA39238@stack.nl> Message-ID: <20150323072243.I932@besplex.bde.org> References: <201503210114.t2L1ECcB075556@svn.freebsd.org> <20150321200221.K1846@besplex.bde.org> <20150322133709.GA39238@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=ZuzUdbLG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=IBQAFhTqP557DsAIRIsA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 21:37:15 -0000 On Sun, 22 Mar 2015, Jilles Tjoelker wrote: > On Sat, Mar 21, 2015 at 08:49:00PM +1100, Bruce Evans wrote: >> On Sat, 21 Mar 2015, Xin LI wrote: > >>> Log: >>> Disable timestamping on devfs read/write operations by default. > >> I don't like this. It defaults to non-POSIX-conformant behaviour... > >> The slowness is mostly from no delayed update of times in devfs. > ... > Yes, I think implementing delayed updates is the right solution to this > problem. This way, only stat and last close will need to read the clock. > No configuration option will be needed. > > A subtle difference with most other file systems is that devfs nodes > often stay open for very long, so the timestamps will usually come from > stat() calls, which may be much later than the actual read or write. > Still that is better than not updating timestamps at all. It is probably the large important files that stay open a lot. Another not so subtle difference is that atimes are actually useful for some device files. They are used by w(1). My IN_LAZYMOD optimizations for ffs are relevant. They should be used for atimes for all file types, but the committed version only used for device files, and this code is now dead since device files moved to devfs. This code was also dead (bypassed due to missing details) before devfs in the soft updates case. My version sets IN_LAZMOD for regular files, but then kills it in another way: X Index: ufs_vnops.c X =================================================================== X RCS file: /home/ncvs/src/sys/ufs/ufs/ufs_vnops.c,v X retrieving revision 1.239 X diff -u -2 -r1.239 ufs_vnops.c X --- ufs_vnops.c 7 Apr 2004 03:47:20 -0000 1.239 X +++ ufs_vnops.c 4 Dec 2007 15:41:26 -0000 X @@ -157,8 +157,22 @@ X if ((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE)) == 0) X return; X + /* X + * XXX IN_LAZYMOD has still not been verified to work for the X + * DOINGSOFTDEP() case. X + * XXX devfs makes IN_LAZYMOD almost moot for the device case ... X + */ X if ((vp->v_type == VBLK || vp->v_type == VCHR) && !DOINGSOFTDEP(vp)) X ip->i_flag |= IN_LAZYMOD; X - else X - ip->i_flag |= IN_MODIFIED; X + else { X + /* X + * ... but IN_LAZYMOD should be used in more cases. Start X + * using it for atime-only updates. X + */ X + if (ip->i_flag & (IN_CHANGE | IN_UPDATE)) X + ip->i_flag |= IN_MODIFIED; X + else X + ip->i_flag |= IN_LAZYMOD; The previous line is executed for the IN_ATIME case. X + ip->i_flag |= IN_MODIFIED; /* XXX change/mod confusion */ But then override the change. Motivation for completing this is small since I mount most file systems with -noatime, so the code is unreachable for another reason. X + } X if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { X vfs_timestamp(&ts); Before checking the above, I thought it would be a reasonable fix to implement only mounting with noatime for devfs, and require users to mount with noatime if they notice the slowness. Most device accesses are probably for reads. Checking the MNT_NOATIME flag takes about 1 line. >>> ... >>> Modified: head/sys/fs/devfs/devfs_vnops.c >>> ============================================================================== >>> --- head/sys/fs/devfs/devfs_vnops.c Sat Mar 21 00:21:30 2015 (r280307) >>> +++ head/sys/fs/devfs/devfs_vnops.c Sat Mar 21 01:14:11 2015 (r280308) >>> ... >>> @@ -1700,7 +1708,8 @@ devfs_write_f(struct file *fp, struct ui >>> resid = uio->uio_resid; >>> >>> error = dsw->d_write(dev, uio, ioflag); >>> - if (uio->uio_resid != resid || (error == 0 && resid != 0)) { >>> + if (devfs_dotimes && >>> + (uio->uio_resid != resid || (error == 0 && resid != 0))) { >>> vfs_timestamp(&dev->si_ctime); >>> dev->si_mtime = dev->si_ctime; >>> } > >> An old bug is evident in the diff. Writing shouldn't change the ctime. > > That is not a bug. POSIX unambiguously requires write() to update both > mtime and ctime. Oops. I don't know how I forgot that. ffs's IN_* flag names are mixed up, but in ffs_write() IN_CHANGE is the one flag that is not affected there by the confusion -- it actually used for exactly what it means (that the file change time is marked for update, but the inode has not been modified for this since the update has not occured yet). Bruce From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 22:12:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E3845DA; Sun, 22 Mar 2015 22:12:03 +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 D7865E9F; Sun, 22 Mar 2015 22:12:02 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 7DB491A2636; Mon, 23 Mar 2015 08:40:58 +1100 (AEDT) Date: Mon, 23 Mar 2015 08:40:53 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r280308 - head/sys/fs/devfs In-Reply-To: <20150322162507.GD2379@kib.kiev.ua> Message-ID: <20150323081537.U932@besplex.bde.org> References: <201503210114.t2L1ECcB075556@svn.freebsd.org> <20150321200221.K1846@besplex.bde.org> <20150322133709.GA39238@stack.nl> <20150322162507.GD2379@kib.kiev.ua> 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=ZuzUdbLG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=gT3I8tYcGHsMu_VBJUQA:9 a=CjuIK1q_8ugA:10 Cc: src-committers@freebsd.org, Jilles Tjoelker , svn-src-all@freebsd.org, Xin LI , Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 22:12:03 -0000 On Sun, 22 Mar 2015, Konstantin Belousov wrote: > On Sun, Mar 22, 2015 at 02:37:09PM +0100, Jilles Tjoelker wrote: >> On Sat, Mar 21, 2015 at 08:49:00PM +1100, Bruce Evans wrote: >>> On Sat, 21 Mar 2015, Xin LI wrote: >> >>>> Log: >>>> Disable timestamping on devfs read/write operations by default. >> ... >>> I don't like this. It defaults to non-POSIX-conformant behaviour... >>> ... > Does POSIX ever say anything about special files ? It says indirectly that special files have full support for timestamps although they might not support many other attributes. From an old draft: X 51276 Upon successful completion, where nbyte is greater than 0, write( ) shall mark for update the X 51277 st_ctime and st_mtime fields of the file, and if the file is a regular file, the S_ISUID and S_ISGID X 51278 bits of the file mode may be cleared. Note that it makes a special case for regular files, but not for the file times. > Devfs already has non-POSIX behaviour, e.g. write on one mount is > reflected as mtime/ctime update on all mounts. On reboot, the time > stamps are re-created, i.e. changes are not persistent. POSIX doesn't cover reboots :-). Perhaps it should say something. I don't remember it even saying saying anything about the persistence of file data. Specifying this would be difficult. Obviously, it cannot reasonably specify persistence of file data for longer than is physically possible, and no implementation can guarantee its future behaviour. > I think the deviations may be summarrized as 'devfs mtime is useless for > the usual mtime purposes'. From this PoV, I have no objections to the > patch. Doing extra work with delayed updates of times, which might > be somewhat non-trivial, is a feature with non-obvious gain. I thought that atimes were even more useless, but it is the atime that is used by w(1). I mostly notice devfs times when find(1) finds garbage devfs times -- ones in the future caused by devfs creating files before userland has fixed up the time. Devfs has incomplete code to avoid this problem. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 22:40:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF1B4B34; Sun, 22 Mar 2015 22:40: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 D9851CF; Sun, 22 Mar 2015 22:40:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MMeWcc061849; Sun, 22 Mar 2015 22:40:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MMeWJs061829; Sun, 22 Mar 2015 22:40:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503222240.t2MMeWJs061829@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 22 Mar 2015 22:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280357 - head/bin/expr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 22:40:33 -0000 Author: dim Date: Sun Mar 22 22:40:32 2015 New Revision: 280357 URL: https://svnweb.freebsd.org/changeset/base/280357 Log: Build expr with -fwrapv, since it relies on signed integer wrapping having defined behavior. Reported by: rodrigc MFC after: 3 days Modified: head/bin/expr/Makefile Modified: head/bin/expr/Makefile ============================================================================== --- head/bin/expr/Makefile Sun Mar 22 22:00:29 2015 (r280356) +++ head/bin/expr/Makefile Sun Mar 22 22:40:32 2015 (r280357) @@ -6,6 +6,9 @@ PROG= expr SRCS= expr.y YFLAGS= +# expr relies on signed integer wrapping +CFLAGS+= -fwrapv + NO_WMISSING_VARIABLE_DECLARATIONS= .if ${MK_TESTS} != "no" From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 22:53:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1CCFD8C; Sun, 22 Mar 2015 22:53:40 +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 9B1B4260; Sun, 22 Mar 2015 22:53:40 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 7B70F78119C; Mon, 23 Mar 2015 09:53:31 +1100 (AEDT) Date: Mon, 23 Mar 2015 09:53:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" Subject: Re: svn commit: r280346 - head/sys/sys In-Reply-To: <201503221537.t2MFb6Kf057971@svn.freebsd.org> Message-ID: <20150323084500.C1130@besplex.bde.org> References: <201503221537.t2MFb6Kf057971@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=ZuzUdbLG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=tY7LaoIE7Bbx0eQ_6PYA: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-1 Precedence: list List-Id: SVN 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 Mar 2015 22:53:41 -0000 On Sun, 22 Mar 2015, Pedro F. Giffuni wrote: > Log: > Small style(9) cleanup. > > #define should always be followed by a tab not space. Thanks, but not in comments. > Modified: head/sys/sys/cdefs.h > ============================================================================== > --- head/sys/sys/cdefs.h Sun Mar 22 13:11:56 2015 (r280345) > +++ head/sys/sys/cdefs.h Sun Mar 22 15:37:05 2015 (r280346) > @@ -70,20 +70,20 @@ > #if defined(__GNUC__) || defined(__INTEL_COMPILER) > > #if __GNUC__ >= 3 || defined(__INTEL_COMPILER) > -#define __GNUCLIKE_ASM 3 > -#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS > +#define __GNUCLIKE_ASM 3 > +#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS The commit that added the __INTEL_COMPILER stuff was well-intentioned but not ready for commit. The lines changed by it still have mounds of style bugs. They mostly still don't use tabs where they are more needed -- to line up the #defined values. The __INTEL_COMPILER stuff was only used in a few places for i386 originally (not even in the corresponding places for amd64), and has rotted. It is well intentioned, but mostly just makes the code uglier where it is actually used. > ... > #ifndef __INTEL_COMPILER > # define __GNUCLIKE_CTOR_SECTION_HANDLING 1 > #endif Indenting 'define' after '#' is another style bug. Apparently this defeated your pattern matcher, so the space after 'define' is not fixed here. > > -#define __GNUCLIKE_BUILTIN_CONSTANT_P 1 > +#define __GNUCLIKE_BUILTIN_CONSTANT_P 1 > # if defined(__INTEL_COMPILER) && defined(__cplusplus) \ > && __INTEL_COMPILER < 800 '&&' on a new line is another style bug. It is gnu-style. > @@ -111,19 +111,19 @@ > # define __GNUCLIKE_MATH_BUILTIN_RELOPS > #endif > > -#define __GNUCLIKE_BUILTIN_MEMCPY 1 > +#define __GNUCLIKE_BUILTIN_MEMCPY 1 > > /* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */ > -#define __CC_SUPPORTS_INLINE 1 > -#define __CC_SUPPORTS___INLINE 1 > -#define __CC_SUPPORTS___INLINE__ 1 > +#define __CC_SUPPORTS_INLINE 1 > +#define __CC_SUPPORTS___INLINE 1 > +#define __CC_SUPPORTS___INLINE__ 1 3 different macros to support the different spellings of 'inline' are excessive, and also wrong: - __inline__ is a gnu spelling. Any use of it is a style and portability bug. Using it defeats portability ifdefs in this file, since only the FreeBSD spelling __inline is really supported in this file. The macro __CC_SUPPORTS___INLINE__ to support it shouldn't exist. Currently, there are 256 lines in /sys with this style bug (mostly in mips, fuse, xen, drm and contrib) :-(. There are just 3 lines which reference the macro: - 1 in cdefs.h to define it - 1 in cx to do home made portability stuff (inline -> __inline__). The FreeBSD spelling of this portability stuff is __inline or just plain inline in sloppier code. Even the sloppier code became portable to new compilers with C99. - 1 in iir. iir uses __inline__ a lot, and just fails when the macro says that it is not supported. - __inline is the FreeBSD spelling. It is used a lot. About 3500 times in /sys. The macro shouldn't exist, since portability ifdefs in cdefs.h are supposed to make __inline usable for most cases, by defining it to nothing if required. These portability ifdefs are mostly for handling the difference between C90 and gcc in 1990, and aren't complicated enough to handle all 1990 model compilers, but most code didn't care about the difference even in 1990. There are just 5 uses of the macro (not counting comments or its definition): - 2 in cpufunc.h (1 each for amd64 and i386) - 3 in in_cksum.h (1 each for amd64, mips, and powerpc. i386 is gratuitously different from amd64 due to different bad fixes for bugs in the inline asm). - inline is the C99 spelling. It is used almost 6000 times (mostly in contrib'ed uglyware). The macro for it made sense before C99 existed, but was committed after 1999 and has never been used. > -#define __CC_SUPPORTS___FUNC__ 1 > -#define __CC_SUPPORTS_WARNING 1 > +#define __CC_SUPPORTS___FUNC__ 1 > +#define __CC_SUPPORTS_WARNING 1 __func__ is like __inline, but has better compatibility support, so the macro for it should not exist. The macro is used just once (in ichsmb, for just 1 of 12 instances of __func__ in this file). > > -#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */ > +#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */ > > -#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 > +#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 The features corresponding to these macros are much more arcane than __inline and __func__. __CC_SUPPORTS_VARADIC_XXX is used just once (in i386 varags.h. Varargs is very compiler-dependent, but only the implementation should know the details, and is a better place to put them than here even if they only depend on the compiler). __CC_SUPPORTS_VARADIC_XXX is not used. (All counts in /sys). > ... > @@ -139,7 +139,7 @@ > > /* > * The __CONCAT macro is used to concatenate parts of symbol names, e.g. > - * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. > + * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. Example of a comment mangled by the substitution. > @@ -234,13 +234,13 @@ > #define __section(x) __attribute__((__section__(x))) > #endif > #if defined(__INTEL_COMPILER) > -#define __dead2 __attribute__((__noreturn__)) > -#define __pure2 __attribute__((__const__)) > -#define __unused __attribute__((__unused__)) > -#define __used __attribute__((__used__)) > -#define __packed __attribute__((__packed__)) > -#define __aligned(x) __attribute__((__aligned__(x))) > -#define __section(x) __attribute__((__section__(x))) > +#define __dead2 __attribute__((__noreturn__)) > +#define __pure2 __attribute__((__const__)) > +#define __unused __attribute__((__unused__)) > +#define __used __attribute__((__used__)) > +#define __packed __attribute__((__packed__)) > +#define __aligned(x) __attribute__((__aligned__(x))) > +#define __section(x) __attribute__((__section__(x))) > #endif > #endif __INTEL_COMPILER causes complications by not being fully gcc-compatible, but here it is fully compatible and the duplication is spam. Previously, the spam wasn't even duplication since it had corrupt tabs. Duplication defeats the point of complicated ifdefs elsewhere, where the complications go in the direction of putting a single definition under a complicated condition. clang would require much messier ifdefs if it were not close to 100% compatible, since it is actually used. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Mar 22 23:42:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3411A12; Sun, 22 Mar 2015 23: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 83DFF94C; Sun, 22 Mar 2015 23:42:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MNgMmC092225; Sun, 22 Mar 2015 23:42:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MNgM3G092224; Sun, 22 Mar 2015 23:42:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503222342.t2MNgM3G092224@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 22 Mar 2015 23:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280359 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:42:22 -0000 Author: pfg Date: Sun Mar 22 23:42:21 2015 New Revision: 280359 URL: https://svnweb.freebsd.org/changeset/base/280359 Log: Small style(9) cleanup. Fix yet more issues, but certainly not all. Pointed out by: bde Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Mar 22 23:20:09 2015 (r280358) +++ head/sys/sys/cdefs.h Sun Mar 22 23:42:21 2015 (r280359) @@ -80,23 +80,23 @@ #define __GNUCLIKE___SECTION 1 #ifndef __INTEL_COMPILER -# define __GNUCLIKE_CTOR_SECTION_HANDLING 1 +#define __GNUCLIKE_CTOR_SECTION_HANDLING 1 #endif #define __GNUCLIKE_BUILTIN_CONSTANT_P 1 -# if defined(__INTEL_COMPILER) && defined(__cplusplus) \ - && __INTEL_COMPILER < 800 -# undef __GNUCLIKE_BUILTIN_CONSTANT_P -# endif +#if defined(__INTEL_COMPILER) && defined(__cplusplus) && \ + __INTEL_COMPILER < 800 +#undef __GNUCLIKE_BUILTIN_CONSTANT_P +#endif #if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) && !defined(__INTEL_COMPILER) -# define __GNUCLIKE_BUILTIN_VARARGS 1 -# define __GNUCLIKE_BUILTIN_STDARG 1 -# define __GNUCLIKE_BUILTIN_VAALIST 1 +#define __GNUCLIKE_BUILTIN_VARARGS 1 +#define __GNUCLIKE_BUILTIN_STDARG 1 +#define __GNUCLIKE_BUILTIN_VAALIST 1 #endif #if defined(__GNUC__) -# define __GNUC_VA_LIST_COMPATIBILITY 1 +#define __GNUC_VA_LIST_COMPATIBILITY 1 #endif /* @@ -107,8 +107,8 @@ #endif #ifndef __INTEL_COMPILER -# define __GNUCLIKE_BUILTIN_NEXT_ARG 1 -# define __GNUCLIKE_MATH_BUILTIN_RELOPS +#define __GNUCLIKE_BUILTIN_NEXT_ARG 1 +#define __GNUCLIKE_MATH_BUILTIN_RELOPS #endif #define __GNUCLIKE_BUILTIN_MEMCPY 1 @@ -139,7 +139,7 @@ /* * The __CONCAT macro is used to concatenate parts of symbol names, e.g. - * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. + * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI * mode -- there must be no spaces between its arguments, and for nested * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 00:07:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DB2C613; Mon, 23 Mar 2015 00:07:11 +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 2FD4FBCD; Mon, 23 Mar 2015 00:07:10 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 4DBFA3C2993; Mon, 23 Mar 2015 10:50:05 +1100 (AEDT) Date: Mon, 23 Mar 2015 10:50:02 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric Subject: Re: svn commit: r280357 - head/bin/expr In-Reply-To: <201503222240.t2MMeWJs061829@svn.freebsd.org> Message-ID: <20150323102927.U1476@besplex.bde.org> References: <201503222240.t2MMeWJs061829@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=A5NVYcmG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=UdIJsax14pPILPEZKswA: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-1 Precedence: list List-Id: SVN 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 Mar 2015 00:07:11 -0000 On Sun, 22 Mar 2015, Dimitry Andric wrote: > Log: > Build expr with -fwrapv, since it relies on signed integer wrapping > having defined behavior. This was supposed to be fixed using a volatile hack, but I see that was only for multiplication. Wrapping is not undefined behaviour. You mean overflow. expr mainly relies on the undefined behaviour giving a result and not causing the tests that the result is correct being optimized away. All compilers on all normal systems give a result. The volatile hack prevents the excessive optimization. But expr uses sloppy tests for addition and subtraction. For multiplication and division, there is no simple correctness test and expr does a complete test. For addition and multiplication, it assumes that the overflow gives (2's complement) wrapping so that simple sign tests work. > Modified: head/bin/expr/Makefile > ============================================================================== > --- head/bin/expr/Makefile Sun Mar 22 22:00:29 2015 (r280356) > +++ head/bin/expr/Makefile Sun Mar 22 22:40:32 2015 (r280357) > @@ -6,6 +6,9 @@ PROG= expr > SRCS= expr.y > YFLAGS= > > +# expr relies on signed integer wrapping > +CFLAGS+= -fwrapv Hard-coded gcc flags make compiling with non-gcc compilers impossible. -fwrapv implies 2's complement, so might not be supported even by gcc. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 01:08:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABE14E78; Mon, 23 Mar 2015 01:08:41 +0000 (UTC) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38ACAE7; Mon, 23 Mar 2015 01:08:41 +0000 (UTC) Received: by wgbcc7 with SMTP id cc7so133817415wgb.0; Sun, 22 Mar 2015 18:08:39 -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=Ii3Yqt6PR/wH0Swe+OskAnr99li+d23PxhDZ4EvvcVc=; b=EQ3+zexPqjqNJdMYB8pQCVjVtZA9yRFZgyJ0Xfko7Of5J4K4n9HeNcAzshCHIZkp+q 53rX6Ro1VH6PvlTZHLjveZsov2NC/ZGGjZVI9fLlwUz02KfccKQLAtGyrmOt8KaYbprn oo7arlf2L5dkKIf53n8vCjORVngNLMPBWptHiihLADtZr4w5nXJwThh27GIIP2Hc2ijh aqM1uNh3cLwdM3H/O34kJiqTca7pZ//yCncjmdPWn3Q2vZ6w8avVo61j8L1tZbXie6e9 Z4ZbfHXjWeO/szWI3YW5UzpvVulnC7Ll2izsC9uZKWN/UF5HK8CUPio27JEzsCVic2Lh AzbA== X-Received: by 10.180.86.201 with SMTP id r9mr15078261wiz.56.1427072919634; Sun, 22 Mar 2015 18:08:39 -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 r14sm8782121wiv.13.2015.03.22.18.08.38 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 22 Mar 2015 18:08:38 -0700 (PDT) Date: Mon, 23 Mar 2015 02:08:36 +0100 From: Mateusz Guzik To: Rui Paulo Subject: Re: svn commit: r278479 - in head: etc sys/kern Message-ID: <20150323010836.GC6798@dft-labs.eu> References: <201502092313.t19NDpoS083043@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201502092313.t19NDpoS083043@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-1 Precedence: list List-Id: SVN 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 Mar 2015 01:08:41 -0000 On Mon, Feb 09, 2015 at 11:13:51PM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Mon Feb 9 23:13:50 2015 > New Revision: 278479 > URL: https://svnweb.freebsd.org/changeset/base/278479 > > Log: > Notify devd(8) when a process crashed. > > This change implements a notification (via devctl) to userland when > the kernel produces coredumps after a process has crashed. > devd can then run a specific command to produce a human readable crash > report. The command is most usually a helper that runs gdb/lldb > commands on the file/coredump pair. It's possible to use this > functionality for implementing automatic generation of crash reports. > > devd(8) will be notified of the full path of the binary that crashed and > the full path of the coredump file. > The more I look at this the more I'm convinced this is quite insecure. At a minimum this should also grow a flag to decide whether notification about jailed process crashes are allowed. Off by default. As it is you pass a path leading to a jail, but that's inherently untrusted and will lead to trouble. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 02:45:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0437C1B; Mon, 23 Mar 2015 02:45: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 A9422BCA; Mon, 23 Mar 2015 02:45:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2N2jD7F076755; Mon, 23 Mar 2015 02:45:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2N2jDRs076751; Mon, 23 Mar 2015 02:45:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201503230245.t2N2jDRs076751@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 23 Mar 2015 02:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280360 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:45:13 -0000 Author: bdrewery Date: Mon Mar 23 02:45:12 2015 New Revision: 280360 URL: https://svnweb.freebsd.org/changeset/base/280360 Log: Document "none" for VersionAddendum. PR: 193127 MFC after: 2 weeks Modified: head/crypto/openssh/ssh_config.5 head/crypto/openssh/sshd_config.5 Modified: head/crypto/openssh/ssh_config.5 ============================================================================== --- head/crypto/openssh/ssh_config.5 Sun Mar 22 23:42:21 2015 (r280359) +++ head/crypto/openssh/ssh_config.5 Mon Mar 23 02:45:12 2015 (r280360) @@ -35,7 +35,7 @@ .\" .\" $OpenBSD: ssh_config.5,v 1.185 2014/02/23 20:11:36 djm Exp $ .\" $FreeBSD$ -.Dd February 23, 2014 +.Dd March 22, 2015 .Dt SSH_CONFIG 5 .Os .Sh NAME @@ -1424,6 +1424,9 @@ Specifies a string to append to the regu OS- or site-specific modifications. The default is .Dq FreeBSD-20140420 . +The value +.Dq none +may be used to disable this. .It Cm VisualHostKey If this flag is set to .Dq yes , Modified: head/crypto/openssh/sshd_config.5 ============================================================================== --- head/crypto/openssh/sshd_config.5 Sun Mar 22 23:42:21 2015 (r280359) +++ head/crypto/openssh/sshd_config.5 Mon Mar 23 02:45:12 2015 (r280360) @@ -35,7 +35,7 @@ .\" .\" $OpenBSD: sshd_config.5,v 1.172 2014/02/27 22:47:07 djm Exp $ .\" $FreeBSD$ -.Dd February 27, 2014 +.Dd March 22, 2015 .Dt SSHD_CONFIG 5 .Os .Sh NAME @@ -1254,6 +1254,9 @@ Optionally specifies additional text to sent by the server upon connection. The default is .Dq FreeBSD-20140420 . +The value +.Dq none +may be used to disable this. .It Cm X11DisplayOffset Specifies the first display number available for .Xr sshd 8 Ns 's From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 03:44:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9287063F; Mon, 23 Mar 2015 03: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 7DA8625A; Mon, 23 Mar 2015 03:44:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2N3i0U7005122; Mon, 23 Mar 2015 03:44:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2N3i0U1005121; Mon, 23 Mar 2015 03:44:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503230344.t2N3i0U1005121@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 23 Mar 2015 03:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280361 - head/tools/tools/ath/athratestats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 03:44:01 -0000 Author: adrian Date: Mon Mar 23 03:43:59 2015 New Revision: 280361 URL: https://svnweb.freebsd.org/changeset/base/280361 Log: Bump mask to be 64 bits - this fixes seeing MCS rates > 19. Tested: * AR9380, STA mode, associated to a 3x3 AP (also FreeBSD) Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Mon Mar 23 02:45:12 2015 (r280360) +++ head/tools/tools/ath/athratestats/main.c Mon Mar 23 03:43:59 2015 (r280361) @@ -115,7 +115,7 @@ static void ath_sample_stats(struct ath_ratestats *r, struct ath_rateioctl_rt *rt, struct sample_node *sn) { - uint32_t mask; + uint64_t mask; int rix, y; PRINTMSG("static_rix (%d) ratemask 0x%llx\n", From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 11:02:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98632C5E; Mon, 23 Mar 2015 11:02:08 +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 56A3081B; Mon, 23 Mar 2015 11:02:08 +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 1Ya07N-0006oF-2P; Mon, 23 Mar 2015 12:02:06 +0100 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Alexander Motin" Subject: Re: svn commit: r280040 - head/usr.sbin/bhyve References: <201503151529.t2FFT4lN012903@svn.freebsd.org> Date: Mon, 23 Mar 2015 12:01:59 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201503151529.t2FFT4lN012903@svn.freebsd.org> User-Agent: Opera Mail/1.0 (Win32) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: - X-Spam-Score: -1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED, BAYES_40 autolearn=disabled version=3.3.2 X-Scan-Signature: 67ca9281b58cf5c8a5b2b1d981559170 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 11:02:08 -0000 On Sun, 15 Mar 2015 16:29:04 +0100, Alexander Motin wrote: > Author: mav > Date: Sun Mar 15 15:29:03 2015 > New Revision: 280040 > URL: https://svnweb.freebsd.org/changeset/base/280040 > > Log: > Give AHCI disk serial based on backing file path same as for virtio > block. > It is still not good that they may intersect on different hosts, but > that > is better then intersecting on the same host. Hi, Maybe you can mix sysctl 'kern.hostid: 3674800361' into it. Regards, Ronald. > MFC after: 2 weeks > > 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 15 15:19:02 2015 (r280039) > +++ head/usr.sbin/bhyve/pci_ahci.c Sun Mar 15 15:29:03 2015 (r280040) > @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include "bhyverun.h" > #include "pci_emul.h" > @@ -131,6 +132,7 @@ struct ahci_port { > struct pci_ahci_softc *pr_sc; > uint8_t *cmd_lst; > uint8_t *rfis; > + char ident[20 + 1]; > int atapi; > int reset; > int mult_sectors; > @@ -855,8 +857,7 @@ handle_identify(struct ahci_port *p, int > buf[1] = cyl; > buf[3] = heads; > buf[6] = sech; > - /* TODO emulate different serial? */ > - ata_string((uint8_t *)(buf+10), "123456", 20); > + ata_string((uint8_t *)(buf+10), p->ident, 20); > ata_string((uint8_t *)(buf+23), "001", 8); > ata_string((uint8_t *)(buf+27), "BHYVE SATA DISK", 40); > buf[47] = (0x8000 | 128); > @@ -946,8 +947,7 @@ handle_atapi_identify(struct ahci_port * > memset(buf, 0, sizeof(buf)); > buf[0] = (2 << 14 | 5 << 8 | 1 << 7 | 2 << 5); > - /* TODO emulate different serial? */ > - ata_string((uint8_t *)(buf+10), "123456", 20); > + ata_string((uint8_t *)(buf+10), p->ident, 20); > ata_string((uint8_t *)(buf+23), "001", 8); > ata_string((uint8_t *)(buf+27), "BHYVE SATA DVD ROM", 40); > buf[49] = (1 << 9 | 1 << 8); > @@ -2167,6 +2167,8 @@ pci_ahci_init(struct vmctx *ctx, struct > struct blockif_ctxt *bctxt; > struct pci_ahci_softc *sc; > int ret, slots; > + MD5_CTX mdctx; > + u_char digest[16]; > ret = 0; > @@ -2204,6 +2206,16 @@ pci_ahci_init(struct vmctx *ctx, struct > sc->port[0].pr_sc = sc; > /* > + * Create an identifier for the backing file. Use parts of the > + * md5 sum of the filename > + */ > + MD5Init(&mdctx); > + MD5Update(&mdctx, opts, strlen(opts)); > + MD5Final(digest, &mdctx); > + sprintf(sc->port[0].ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", > + digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); > + > + /* > * Allocate blockif request structures and add them > * to the free list > */ > _______________________________________________ > 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 Mar 23 11:55:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25278D27; Mon, 23 Mar 2015 11: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E425D71; Mon, 23 Mar 2015 11:55:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NBt0TY029301; Mon, 23 Mar 2015 11:55:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NBsvN8029271; Mon, 23 Mar 2015 11:54:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503231154.t2NBsvN8029271@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 23 Mar 2015 11:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280364 - in head/sys/arm64: . 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-1 Precedence: list List-Id: SVN 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 Mar 2015 11:55:00 -0000 Author: andrew Date: Mon Mar 23 11:54:56 2015 New Revision: 280364 URL: https://svnweb.freebsd.org/changeset/base/280364 Log: Add the start of the arm64 machine headers. This is the subset needed to start getting userland libraries building. Reviewed by: imp Sponsored by: The FreeBSD Foundation Added: head/sys/arm64/ head/sys/arm64/include/ head/sys/arm64/include/_align.h (contents, props changed) head/sys/arm64/include/_inttypes.h (contents, props changed) head/sys/arm64/include/_limits.h (contents, props changed) head/sys/arm64/include/_stdint.h (contents, props changed) head/sys/arm64/include/_types.h (contents, props changed) head/sys/arm64/include/asm.h (contents, props changed) head/sys/arm64/include/atomic.h (contents, props changed) head/sys/arm64/include/cpu.h (contents, props changed) head/sys/arm64/include/cpufunc.h (contents, props changed) head/sys/arm64/include/elf.h (contents, props changed) head/sys/arm64/include/endian.h (contents, props changed) head/sys/arm64/include/exec.h (contents, props changed) head/sys/arm64/include/float.h (contents, props changed) head/sys/arm64/include/ieeefp.h (contents, props changed) head/sys/arm64/include/param.h (contents, props changed) head/sys/arm64/include/pcb.h (contents, props changed) head/sys/arm64/include/pcpu.h (contents, props changed) head/sys/arm64/include/pmap.h (contents, props changed) head/sys/arm64/include/pmc_mdep.h (contents, props changed) head/sys/arm64/include/proc.h (contents, props changed) head/sys/arm64/include/profile.h (contents, props changed) head/sys/arm64/include/pte.h (contents, props changed) head/sys/arm64/include/reloc.h (contents, props changed) head/sys/arm64/include/runq.h (contents, props changed) head/sys/arm64/include/setjmp.h (contents, props changed) head/sys/arm64/include/signal.h (contents, props changed) head/sys/arm64/include/stdarg.h (contents, props changed) head/sys/arm64/include/ucontext.h (contents, props changed) head/sys/arm64/include/vdso.h (contents, props changed) head/sys/arm64/include/vm.h (contents, props changed) head/sys/arm64/include/vmparam.h (contents, props changed) Added: head/sys/arm64/include/_align.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/_align.h Mon Mar 23 11:54:56 2015 (r280364) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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. + * + * from: @(#)param.h 5.8 (Berkeley) 6/28/91 + * $FreeBSD$ + */ + +#ifndef _MACHINE__ALIGN_H_ +#define _MACHINE__ALIGN_H_ + +/* + * Round p (pointer or byte index) up to a correctly-aligned value + * for all data types (int, long, ...). The result is unsigned int + * and must be cast to any desired pointer type. + */ +#define _ALIGNBYTES (sizeof(long long) - 1) +#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) + +#endif /* !_MACHINE__ALIGN_H_ */ Added: head/sys/arm64/include/_inttypes.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/_inttypes.h Mon Mar 23 11:54:56 2015 (r280364) @@ -0,0 +1,213 @@ +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Klaus Klein. + * + * 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. + * + * From: $NetBSD: int_fmtio.h,v 1.4 2008/04/28 20:23:36 martin Exp $ + * $FreeBSD$ + */ + +#ifndef _MACHINE__INTTYPES_H_ +#define _MACHINE__INTTYPES_H_ + +/* + * Macros for format specifiers. + */ + +/* fprintf(3) macros for signed integers. */ + +#define PRId8 "d" /* int8_t */ +#define PRId16 "d" /* int16_t */ +#define PRId32 "d" /* int32_t */ +#define PRId64 "ld" /* int64_t */ +#define PRIdLEAST8 "d" /* int_least8_t */ +#define PRIdLEAST16 "d" /* int_least16_t */ +#define PRIdLEAST32 "d" /* int_least32_t */ +#define PRIdLEAST64 "ld" /* int_least64_t */ +#define PRIdFAST8 "d" /* int_fast8_t */ +#define PRIdFAST16 "d" /* int_fast16_t */ +#define PRIdFAST32 "d" /* int_fast32_t */ +#define PRIdFAST64 "ld" /* int_fast64_t */ +#define PRIdMAX "jd" /* intmax_t */ +#define PRIdPTR "ld" /* intptr_t */ + +#define PRIi8 "i" /* int8_t */ +#define PRIi16 "i" /* int16_t */ +#define PRIi32 "i" /* int32_t */ +#define PRIi64 "li" /* int64_t */ +#define PRIiLEAST8 "i" /* int_least8_t */ +#define PRIiLEAST16 "i" /* int_least16_t */ +#define PRIiLEAST32 "i" /* int_least32_t */ +#define PRIiLEAST64 "li" /* int_least64_t */ +#define PRIiFAST8 "i" /* int_fast8_t */ +#define PRIiFAST16 "i" /* int_fast16_t */ +#define PRIiFAST32 "i" /* int_fast32_t */ +#define PRIiFAST64 "li" /* int_fast64_t */ +#define PRIiMAX "ji" /* intmax_t */ +#define PRIiPTR "li" /* intptr_t */ + +/* fprintf(3) macros for unsigned integers. */ + +#define PRIo8 "o" /* uint8_t */ +#define PRIo16 "o" /* uint16_t */ +#define PRIo32 "o" /* uint32_t */ +#define PRIo64 "lo" /* uint64_t */ +#define PRIoLEAST8 "o" /* uint_least8_t */ +#define PRIoLEAST16 "o" /* uint_least16_t */ +#define PRIoLEAST32 "o" /* uint_least32_t */ +#define PRIoLEAST64 "lo" /* uint_least64_t */ +#define PRIoFAST8 "o" /* uint_fast8_t */ +#define PRIoFAST16 "o" /* uint_fast16_t */ +#define PRIoFAST32 "o" /* uint_fast32_t */ +#define PRIoFAST64 "lo" /* uint_fast64_t */ +#define PRIoMAX "jo" /* uintmax_t */ +#define PRIoPTR "lo" /* uintptr_t */ + +#define PRIu8 "u" /* uint8_t */ +#define PRIu16 "u" /* uint16_t */ +#define PRIu32 "u" /* uint32_t */ +#define PRIu64 "lu" /* uint64_t */ +#define PRIuLEAST8 "u" /* uint_least8_t */ +#define PRIuLEAST16 "u" /* uint_least16_t */ +#define PRIuLEAST32 "u" /* uint_least32_t */ +#define PRIuLEAST64 "lu" /* uint_least64_t */ +#define PRIuFAST8 "u" /* uint_fast8_t */ +#define PRIuFAST16 "u" /* uint_fast16_t */ +#define PRIuFAST32 "u" /* uint_fast32_t */ +#define PRIuFAST64 "lu" /* uint_fast64_t */ +#define PRIuMAX "ju" /* uintmax_t */ +#define PRIuPTR "lu" /* uintptr_t */ + +#define PRIx8 "x" /* uint8_t */ +#define PRIx16 "x" /* uint16_t */ +#define PRIx32 "x" /* uint32_t */ +#define PRIx64 "lx" /* uint64_t */ +#define PRIxLEAST8 "x" /* uint_least8_t */ +#define PRIxLEAST16 "x" /* uint_least16_t */ +#define PRIxLEAST32 "x" /* uint_least32_t */ +#define PRIxLEAST64 "lx" /* uint_least64_t */ +#define PRIxFAST8 "x" /* uint_fast8_t */ +#define PRIxFAST16 "x" /* uint_fast16_t */ +#define PRIxFAST32 "x" /* uint_fast32_t */ +#define PRIxFAST64 "lx" /* uint_fast64_t */ +#define PRIxMAX "jx" /* uintmax_t */ +#define PRIxPTR "lx" /* uintptr_t */ + +#define PRIX8 "X" /* uint8_t */ +#define PRIX16 "X" /* uint16_t */ +#define PRIX32 "X" /* uint32_t */ +#define PRIX64 "lX" /* uint64_t */ +#define PRIXLEAST8 "X" /* uint_least8_t */ +#define PRIXLEAST16 "X" /* uint_least16_t */ +#define PRIXLEAST32 "X" /* uint_least32_t */ +#define PRIXLEAST64 "lX" /* uint_least64_t */ +#define PRIXFAST8 "X" /* uint_fast8_t */ +#define PRIXFAST16 "X" /* uint_fast16_t */ +#define PRIXFAST32 "X" /* uint_fast32_t */ +#define PRIXFAST64 "lX" /* uint_fast64_t */ +#define PRIXMAX "jX" /* uintmax_t */ +#define PRIXPTR "lX" /* uintptr_t */ + +/* fscanf(3) macros for signed integers. */ + +#define SCNd8 "hhd" /* int8_t */ +#define SCNd16 "hd" /* int16_t */ +#define SCNd32 "d" /* int32_t */ +#define SCNd64 "ld" /* int64_t */ +#define SCNdLEAST8 "hhd" /* int_least8_t */ +#define SCNdLEAST16 "hd" /* int_least16_t */ +#define SCNdLEAST32 "d" /* int_least32_t */ +#define SCNdLEAST64 "ld" /* int_least64_t */ +#define SCNdFAST8 "d" /* int_fast8_t */ +#define SCNdFAST16 "d" /* int_fast16_t */ +#define SCNdFAST32 "d" /* int_fast32_t */ +#define SCNdFAST64 "ld" /* int_fast64_t */ +#define SCNdMAX "jd" /* intmax_t */ +#define SCNdPTR "ld" /* intptr_t */ + +#define SCNi8 "hhi" /* int8_t */ +#define SCNi16 "hi" /* int16_t */ +#define SCNi32 "i" /* int32_t */ +#define SCNi64 "li" /* int64_t */ +#define SCNiLEAST8 "hhi" /* int_least8_t */ +#define SCNiLEAST16 "hi" /* int_least16_t */ +#define SCNiLEAST32 "i" /* int_least32_t */ +#define SCNiLEAST64 "li" /* int_least64_t */ +#define SCNiFAST8 "i" /* int_fast8_t */ +#define SCNiFAST16 "i" /* int_fast16_t */ +#define SCNiFAST32 "i" /* int_fast32_t */ +#define SCNiFAST64 "li" /* int_fast64_t */ +#define SCNiMAX "ji" /* intmax_t */ +#define SCNiPTR "li" /* intptr_t */ + +/* fscanf(3) macros for unsigned integers. */ + +#define SCNo8 "hho" /* uint8_t */ +#define SCNo16 "ho" /* uint16_t */ +#define SCNo32 "o" /* uint32_t */ +#define SCNo64 "lo" /* uint64_t */ +#define SCNoLEAST8 "hho" /* uint_least8_t */ +#define SCNoLEAST16 "ho" /* uint_least16_t */ +#define SCNoLEAST32 "o" /* uint_least32_t */ +#define SCNoLEAST64 "lo" /* uint_least64_t */ +#define SCNoFAST8 "o" /* uint_fast8_t */ +#define SCNoFAST16 "o" /* uint_fast16_t */ +#define SCNoFAST32 "o" /* uint_fast32_t */ +#define SCNoFAST64 "lo" /* uint_fast64_t */ +#define SCNoMAX "jo" /* uintmax_t */ +#define SCNoPTR "lo" /* uintptr_t */ + +#define SCNu8 "hhu" /* uint8_t */ +#define SCNu16 "hu" /* uint16_t */ +#define SCNu32 "u" /* uint32_t */ +#define SCNu64 "lu" /* uint64_t */ +#define SCNuLEAST8 "hhu" /* uint_least8_t */ +#define SCNuLEAST16 "hu" /* uint_least16_t */ +#define SCNuLEAST32 "u" /* uint_least32_t */ +#define SCNuLEAST64 "lu" /* uint_least64_t */ +#define SCNuFAST8 "u" /* uint_fast8_t */ +#define SCNuFAST16 "u" /* uint_fast16_t */ +#define SCNuFAST32 "u" /* uint_fast32_t */ +#define SCNuFAST64 "lu" /* uint_fast64_t */ +#define SCNuMAX "ju" /* uintmax_t */ +#define SCNuPTR "lu" /* uintptr_t */ + +#define SCNx8 "hhx" /* uint8_t */ +#define SCNx16 "hx" /* uint16_t */ +#define SCNx32 "x" /* uint32_t */ +#define SCNx64 "lx" /* uint64_t */ +#define SCNxLEAST8 "hhx" /* uint_least8_t */ +#define SCNxLEAST16 "hx" /* uint_least16_t */ +#define SCNxLEAST32 "x" /* uint_least32_t */ +#define SCNxLEAST64 "lx" /* uint_least64_t */ +#define SCNxFAST8 "x" /* uint_fast8_t */ +#define SCNxFAST16 "x" /* uint_fast16_t */ +#define SCNxFAST32 "x" /* uint_fast32_t */ +#define SCNxFAST64 "lx" /* uint_fast64_t */ +#define SCNxMAX "jx" /* uintmax_t */ +#define SCNxPTR "lx" /* uintptr_t */ + +#endif /* !_MACHINE__INTTYPES_H_ */ Added: head/sys/arm64/include/_limits.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/_limits.h Mon Mar 23 11:54:56 2015 (r280364) @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 1988, 1993 + * 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 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. + * + * @(#)limits.h 8.3 (Berkeley) 1/4/94 + * $FreeBSD$ + */ + +#ifndef _MACHINE__LIMITS_H_ +#define _MACHINE__LIMITS_H_ + +/* + * According to ANSI (section 2.2.4.2), the values below must be usable by + * #if preprocessing directives. Additionally, the expression must have the + * same type as would an expression that is an object of the corresponding + * type converted according to the integral promotions. The subtraction for + * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an + * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + */ + +#define __CHAR_BIT 8 /* number of bits in a char */ + +#define __SCHAR_MAX 0x7f /* max value for a signed char */ +#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ + +#define __UCHAR_MAX 0xff /* max value for an unsigned char */ + +#define __USHRT_MAX 0xffff /* max value for an unsigned short */ +#define __SHRT_MAX 0x7fff /* max value for a short */ +#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */ + +#define __UINT_MAX 0xffffffff /* max value for an unsigned int */ +#define __INT_MAX 0x7fffffff /* max value for an int */ +#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */ + +#define __ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */ +#define __LONG_MAX 0x7fffffffffffffffL /* max for a long */ +#define __LONG_MIN (-0x7fffffffffffffffL - 1) /* min for a long */ + +/* Long longs have the same size but not the same type as longs. */ + /* max for an unsigned long long */ +#define __ULLONG_MAX 0xffffffffffffffffULL +#define __LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */ +#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ + +#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */ + +#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */ + +#define __OFF_MAX __LONG_MAX /* max value for an off_t */ +#define __OFF_MIN __LONG_MIN /* min value for an off_t */ + +/* Quads and longs are the same size. Ensure they stay in sync. */ +#define __UQUAD_MAX (__ULONG_MAX) /* max value for a uquad_t */ +#define __QUAD_MAX (__LONG_MAX) /* max value for a quad_t */ +#define __QUAD_MIN (__LONG_MIN) /* min value for a quad_t */ + +#define __LONG_BIT 64 +#define __WORD_BIT 32 + +/* Minimum signal stack size. */ +#define __MINSIGSTKSZ (1024 * 4) + +#endif /* !_MACHINE__LIMITS_H_ */ Added: head/sys/arm64/include/_stdint.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/_stdint.h Mon Mar 23 11:54:56 2015 (r280364) @@ -0,0 +1,158 @@ +/*- + * Copyright (c) 2001, 2002 Mike Barcroft + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Klaus Klein. + * + * 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$ + */ + +#ifndef _MACHINE__STDINT_H_ +#define _MACHINE__STDINT_H_ + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) + +#define INT8_C(c) (c) +#define INT16_C(c) (c) +#define INT32_C(c) (c) +#define INT64_C(c) (c ## L) + +#define UINT8_C(c) (c) +#define UINT16_C(c) (c) +#define UINT32_C(c) (c ## U) +#define UINT64_C(c) (c ## UL) + +#define INTMAX_C(c) INT64_C(c) +#define UINTMAX_C(c) UINT64_C(c) + +#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */ + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) + +/* + * ISO/IEC 9899:1999 + * 7.18.2.1 Limits of exact-width integer types + */ +/* Minimum values of exact-width signed integer types. */ +#define INT8_MIN (-0x7f-1) +#define INT16_MIN (-0x7fff-1) +#define INT32_MIN (-0x7fffffff-1) +#define INT64_MIN (-0x7fffffffffffffffL-1) + +/* Maximum values of exact-width signed integer types. */ +#define INT8_MAX 0x7f +#define INT16_MAX 0x7fff +#define INT32_MAX 0x7fffffff +#define INT64_MAX 0x7fffffffffffffffL + +/* Maximum values of exact-width unsigned integer types. */ +#define UINT8_MAX 0xff +#define UINT16_MAX 0xffff +#define UINT32_MAX 0xffffffffU +#define UINT64_MAX 0xffffffffffffffffUL + +/* + * ISO/IEC 9899:1999 + * 7.18.2.2 Limits of minimum-width integer types + */ +/* Minimum values of minimum-width signed integer types. */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +/* Maximum values of minimum-width signed integer types. */ +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +/* Maximum values of minimum-width unsigned integer types. */ +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.2.3 Limits of fastest minimum-width integer types + */ +/* Minimum values of fastest minimum-width signed integer types. */ +#define INT_FAST8_MIN INT32_MIN +#define INT_FAST16_MIN INT32_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +/* Maximum values of fastest minimum-width signed integer types. */ +#define INT_FAST8_MAX INT32_MAX +#define INT_FAST16_MAX INT32_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +/* Maximum values of fastest minimum-width unsigned integer types. */ +#define UINT_FAST8_MAX UINT32_MAX +#define UINT_FAST16_MAX UINT32_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.2.4 Limits of integer types capable of holding object pointers + */ +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.2.5 Limits of greatest-width integer types + */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.3 Limits of other integer types + */ +/* Limits of ptrdiff_t. */ +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX + +/* Limits of sig_atomic_t. */ +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX + +/* Limit of size_t. */ +#define SIZE_MAX UINT64_MAX + +/* Limits of wint_t. */ +#define WINT_MIN INT32_MIN +#define WINT_MAX INT32_MAX + +#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ + +#endif /* !_MACHINE__STDINT_H_ */ Added: head/sys/arm64/include/_types.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/_types.h Mon Mar 23 11:54:56 2015 (r280364) @@ -0,0 +1,114 @@ +/*- + * Copyright (c) 2002 Mike Barcroft + * Copyright (c) 1990, 1993 + * 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 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: @(#)ansi.h 8.2 (Berkeley) 1/4/94 + * From: @(#)types.h 8.3 (Berkeley) 1/5/94 + * $FreeBSD$ + */ + +#ifndef _MACHINE__TYPES_H_ +#define _MACHINE__TYPES_H_ + +#ifndef _SYS_CDEFS_H_ +#error this file needs sys/cdefs.h as a prerequisite +#endif + +/* + * Basic types upon which most other types are built. + */ +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; +typedef long __int64_t; +typedef unsigned long __uint64_t; + +/* + * Standard type definitions. + */ +typedef __int32_t __clock_t; /* clock()... */ +typedef __int64_t __critical_t; +typedef double __double_t; +typedef float __float_t; +typedef __int64_t __intfptr_t; +typedef __int64_t __intmax_t; +typedef __int64_t __intptr_t; +typedef __int32_t __int_fast8_t; +typedef __int32_t __int_fast16_t; +typedef __int32_t __int_fast32_t; +typedef __int64_t __int_fast64_t; +typedef __int8_t __int_least8_t; +typedef __int16_t __int_least16_t; +typedef __int32_t __int_least32_t; +typedef __int64_t __int_least64_t; +typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ +typedef __int64_t __register_t; +typedef __int64_t __segsz_t; /* segment size (in pages) */ +typedef __uint64_t __size_t; /* sizeof() */ +typedef __int64_t __ssize_t; /* byte count or error */ +typedef __int64_t __time_t; /* time()... */ +typedef __uint64_t __uintfptr_t; +typedef __uint64_t __uintmax_t; +typedef __uint64_t __uintptr_t; +typedef __uint32_t __uint_fast8_t; +typedef __uint32_t __uint_fast16_t; +typedef __uint32_t __uint_fast32_t; +typedef __uint64_t __uint_fast64_t; +typedef __uint8_t __uint_least8_t; +typedef __uint16_t __uint_least16_t; +typedef __uint32_t __uint_least32_t; +typedef __uint64_t __uint_least64_t; +typedef __uint64_t __u_register_t; +typedef __uint64_t __vm_offset_t; +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 unsigned int ___wchar_t; + +#define __WCHAR_MIN __UINT_MIN /* min value for a wchar_t */ +#define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ + +/* + * Unusual type definitions. + */ +#ifdef __GNUCLIKE_BUILTIN_VARARGS +typedef __builtin_va_list __va_list; /* internally known to gcc */ +#else +typedef char * __va_list; +#endif /* __GNUCLIKE_BUILTIN_VARARGS */ +#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \ + && !defined(__NO_GNUC_VA_LIST) +#define __GNUC_VA_LIST +typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ +#endif + +#endif /* !_MACHINE__TYPES_H_ */ Added: head/sys/arm64/include/asm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/asm.h Mon Mar 23 11:54:56 2015 (r280364) @@ -0,0 +1,71 @@ +/*- + * 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_ASM_H_ +#define _MACHINE_ASM_H_ + +#undef __FBSDID +#if !defined(lint) && !defined(STRIP_FBSDID) +#define __FBSDID(s) .ident s +#else +#define __FBSDID(s) /* nothing */ +#endif + +#define _C_LABEL(x) x + +#define ENTRY(sym) \ + .text; .globl sym; .align 2; sym: +#define EENTRY(sym) \ + .globl sym; sym: +#define END(sym) .size sym, . - sym +#define EEND(sym) + +#define WEAK_REFERENCE(sym, alias) \ + .weak alias; \ + .set alias,sym + +#define UINT64_C(x) (x) + +#if defined(PIC) +#define PIC_SYM(x,y) x ## @ ## y +#else +#define PIC_SYM(x,y) x +#endif + +/* + * Sets the trap fault handler. The exception handler will return to the + * address in the handler register on a data abort or the xzr register to + * clear the handler. The tmp parameter should be a register able to hold + * the temporary data. + */ +#define SET_FAULT_HANDLER(handler, tmp) \ + ldr tmp, [x18, #PC_CURTHREAD]; /* Load curthread */ \ + ldr tmp, [tmp, #TD_PCB]; /* Load the pcb */ \ + str handler, [tmp, #PCB_ONFAULT] /* Set the handler */ + +#endif /* _MACHINE_ASM_H_ */ Added: head/sys/arm64/include/atomic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/atomic.h Mon Mar 23 11:54:56 2015 (r280364) @@ -0,0 +1,574 @@ +/*- + * 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 _MACHINE_ATOMIC_H_ +#define _MACHINE_ATOMIC_H_ + +#define isb() __asm __volatile("isb" : : : "memory") +#define dsb() __asm __volatile("dsb sy" : : : "memory") +#define dmb() __asm __volatile("dmb sy" : : : "memory") + +#define mb() dmb() +#define wmb() dmb() +#define rmb() dmb() + +static __inline void +atomic_add_32(volatile uint32_t *p, uint32_t val) +{ + uint32_t tmp; + int res; + + __asm __volatile( + "1: ldxr %w0, [%2] \n" + " add %w0, %w0, %w3 \n" + " stxr %w1, %w0, [%2] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc" + ); +} + +static __inline void +atomic_clear_32(volatile uint32_t *p, uint32_t val) +{ + uint32_t tmp; + int res; + + __asm __volatile( + "1: ldxr %w0, [%2] \n" + " bic %w0, %w0, %w3 \n" + " stxr %w1, %w0, [%2] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc" + ); +} + +static __inline int +atomic_cmpset_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) +{ + uint32_t tmp; + int res; + + __asm __volatile( + "1: mov %w1, #1 \n" + " ldxr %w0, [%2] \n" + " cmp %w0, %w3 \n" + " b.ne 2f \n" + " stxr %w1, %w4, [%2] \n" + " cbnz %w1, 1b \n" + "2:" + : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (cmpval), "+r" (newval) + : : "cc" + ); + + return (!res); +} + +static __inline uint32_t +atomic_fetchadd_32(volatile uint32_t *p, uint32_t val) +{ + uint32_t tmp, ret; + int res; + + __asm __volatile( + "1: ldxr %w4, [%2] \n" + " add %w0, %w4, %w3 \n" + " stxr %w1, %w0, [%2] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val), "=&r"(ret) : : "cc" + ); + + return (ret); +} + +static __inline uint32_t +atomic_readandclear_32(volatile uint32_t *p) +{ + uint32_t tmp, ret; + int res; + + __asm __volatile( + " mov %w0, #0 \n" + "1: ldxr %w3, [%2] \n" + " stxr %w1, %w0, [%2] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "+r" (p), "=&r"(ret) : : "cc" + ); + + return (ret); +} + +static __inline void +atomic_set_32(volatile uint32_t *p, uint32_t val) +{ + uint32_t tmp; + int res; + + __asm __volatile( + "1: ldxr %w0, [%2] \n" + " orr %w0, %w0, %w3 \n" + " stxr %w1, %w0, [%2] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc" + ); +} + +static __inline void +atomic_subtract_32(volatile uint32_t *p, uint32_t val) +{ + uint32_t tmp; + int res; + + __asm __volatile( + "1: ldxr %w0, [%2] \n" + " sub %w0, %w0, %w3 \n" + " stxr %w1, %w0, [%2] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc" + ); +} + +#define atomic_add_int atomic_add_32 +#define atomic_clear_int atomic_clear_32 +#define atomic_cmpset_int atomic_cmpset_32 +#define atomic_fetchadd_int atomic_fetchadd_32 +#define atomic_readandclear_int atomic_readandclear_32 +#define atomic_set_int atomic_set_32 +#define atomic_subtract_int atomic_subtract_32 + + +static __inline void +atomic_add_acq_32(volatile uint32_t *p, uint32_t val) +{ + uint32_t tmp; + int res; + + __asm __volatile( + "1: ldaxr %w0, [%2] \n" + " add %w0, %w0, %w3 \n" + " stlxr %w1, %w0, [%2] \n" + " cbnz %w1, 1b \n" + "2:" + : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory" + ); +} + +static __inline void +atomic_clear_acq_32(volatile uint32_t *p, uint32_t val) +{ + uint32_t tmp; + int res; + + __asm __volatile( + "1: ldaxr %w0, [%2] \n" + " bic %w0, %w0, %w3 \n" + " stlxr %w1, %w0, [%2] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory" + ); +} + +static __inline int +atomic_cmpset_acq_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) +{ + uint32_t tmp; + int res; + + __asm __volatile( + "1: mov %w1, #1 \n" + " ldaxr %w0, [%2] \n" + " cmp %w0, %w3 \n" + " b.ne 2f \n" + " stlxr %w1, %w4, [%2] \n" + " cbnz %w1, 1b \n" + "2:" + : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (cmpval), "+r" (newval) + : : "cc", "memory" + ); + + return (!res); +} + +static __inline uint32_t +atomic_load_acq_32(volatile uint32_t *p) +{ + uint32_t ret; + + ret = *p; + dmb(); + + return (ret); +} + +static __inline void +atomic_set_acq_32(volatile uint32_t *p, uint32_t val) +{ + uint32_t tmp; + int res; + + __asm __volatile( + "1: ldaxr %w0, [%2] \n" + " orr %w0, %w0, %w3 \n" + " stlxr %w1, %w0, [%2] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory" + ); +} + +static __inline void +atomic_subtract_acq_32(volatile uint32_t *p, uint32_t val) +{ + uint32_t tmp; + int res; + + __asm __volatile( + "1: ldaxr %w0, [%2] \n" + " sub %w0, %w0, %w3 \n" + " stlxr %w1, %w0, [%2] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory" + ); +} + +static __inline void +atomic_store_rel_32(volatile uint32_t *p, uint32_t val) +{ + + dmb(); + *p = val; +} + +#define atomic_add_acq_int atomic_add_acq_32 +#define atomic_clear_acq_int atomic_add_acq_32 +#define atomic_cmpset_acq_int atomic_cmpset_acq_32 +#define atomic_load_acq_int atomic_load_acq_32 +#define atomic_set_acq_int atomic_set_acq_32 +#define atomic_subtract_acq_int atomic_subtract_acq_32 + +/* The atomic functions currently are both acq and rel, we should fix this. */ +#define atomic_add_rel_32 atomic_add_acq_32 +#define atomic_clear_rel_32 atomic_add_acq_32 +#define atomic_cmpset_rel_32 atomic_cmpset_acq_32 +#define atomic_set_rel_32 atomic_set_acq_32 +#define atomic_subtract_rel_32 atomic_subtract_acq_32 + +#define atomic_add_rel_int atomic_add_rel_32 +#define atomic_clear_rel_int atomic_add_rel_32 +#define atomic_cmpset_rel_int atomic_cmpset_rel_32 +#define atomic_set_rel_int atomic_set_rel_32 +#define atomic_subtract_rel_int atomic_subtract_rel_32 +#define atomic_store_rel_int atomic_store_rel_32 + + +static __inline void +atomic_add_64(volatile uint64_t *p, uint64_t val) +{ + uint64_t tmp; + int res; + + __asm __volatile( + "1: ldxr %0, [%2] \n" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 13:42:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 175D543E; Mon, 23 Mar 2015 13:42:05 +0000 (UTC) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id D22DBD11; Mon, 23 Mar 2015 13:42:04 +0000 (UTC) Received: from bender (c112.sec.cl.cam.ac.uk [128.232.18.112]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 6FBA4D7A38; Mon, 23 Mar 2015 13:42:02 +0000 (UTC) Date: Mon, 23 Mar 2015 13:42:01 +0000 From: Andrew Turner Subject: Re: svn commit: r280364 - in head/sys/arm64: . include Message-ID: <20150323134201.2af00fae@bender> In-Reply-To: <201503231154.t2NBsvN8029271@svn.freebsd.org> References: <201503231154.t2NBsvN8029271@svn.freebsd.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; amd64-portbld-freebsd10.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-1 Precedence: list List-Id: SVN 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 Mar 2015 13:42:05 -0000 On Mon, 23 Mar 2015 11:54:57 +0000 (UTC) Andrew Turner wrote: > Author: andrew > Date: Mon Mar 23 11:54:56 2015 > New Revision: 280364 > URL: https://svnweb.freebsd.org/changeset/base/280364 > > Log: > Add the start of the arm64 machine headers. This is the subset > needed to start getting userland libraries building. > > Reviewed by: imp > Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2057 From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 15:12:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0AF92C6; Mon, 23 Mar 2015 15: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 DC607BA9; Mon, 23 Mar 2015 15:12:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NFC26u026189; Mon, 23 Mar 2015 15:12:02 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NFC2Xl026188; Mon, 23 Mar 2015 15:12:02 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503231512.t2NFC2Xl026188@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 23 Mar 2015 15:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280371 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:12:03 -0000 Author: tuexen Date: Mon Mar 23 15:12:02 2015 New Revision: 280371 URL: https://svnweb.freebsd.org/changeset/base/280371 Log: Remove a useless assignment. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Mar 23 14:36:53 2015 (r280370) +++ head/sys/netinet/sctp_output.c Mon Mar 23 15:12:02 2015 (r280371) @@ -9286,8 +9286,6 @@ sctp_send_asconf_ack(struct sctp_tcb *st atomic_add_int(&chk->whoTo->ref_count, 1); } chk->data = m_ack; - chk->send_size = 0; - /* Get size */ chk->send_size = ack->len; chk->sent = SCTP_DATAGRAM_UNSENT; chk->snd_count = 0; From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 15:43:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 921E2127 for ; Mon, 23 Mar 2015 15:43:55 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AFE9F51 for ; Mon, 23 Mar 2015 15:43:55 +0000 (UTC) Received: by iedm5 with SMTP id m5so38771506ied.3 for ; Mon, 23 Mar 2015 08:43: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:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=mn2NZhdnUJwiti+GZbOL388/QLmMvcN72qgdmLrjckA=; b=m28L5zp36d2/cCkfMNPIu7W3/aNU43p91heVzVT/guJj84Vo8Roa7S4/G+H6JijHJ2 dYo/n2mTFSjyAa80Fq3WmIADQw026H13LXaYOFafRqFs+2xd+LSgVx5mTY2LyzxgSkeo SGdqNYmlB4sf8ZSj1zQF8Hg1cpt1ZgFU270K5Ac4agas89wEV8ANseMmQvvV+O80n5Ar WYdamHKwLuJ9sAHEAtqBWuYfVbeSrVg39KAI5euC+KqditSTwIkKt+dRWBmPBGacga0p o9KXYycBHqD4mB4HJw/Gsz6q4zhiaIHyOKqWuLMhedGBQ7IHzhreFsuZqHzJbOXw4Bkh vH/Q== X-Gm-Message-State: ALoCoQkurlgQFOomfu4oxe1NUHBHTtAi3pOguJtLhGXSefjjjTafSH7RhGIEoB/BfOPahFiP1x8I X-Received: by 10.42.47.73 with SMTP id n9mr20777011icf.20.1427124986030; Mon, 23 Mar 2015 08:36:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.0.99 with HTTP; Mon, 23 Mar 2015 08:35:45 -0700 (PDT) X-Originating-IP: [68.101.40.130] In-Reply-To: <201503202348.t2KNmCM0033402@svn.freebsd.org> References: <201503202348.t2KNmCM0033402@svn.freebsd.org> From: "Philip M. Gollucci" Date: Mon, 23 Mar 2015 11:35:45 -0400 Message-ID: Subject: Re: svn commit: r280306 - in head: secure/lib/libcrypto secure/lib/libssl sys/sys To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:43:55 -0000 What about SSLv3 due to POODLE ? On Fri, Mar 20, 2015 at 7:48 PM, Jung-uk Kim wrote: > Author: jkim > Date: Fri Mar 20 23:48:11 2015 > New Revision: 280306 > URL: https://svnweb.freebsd.org/changeset/base/280306 > > Log: > Disable insecure SSLv2 support from the base OpenSSL. > > Differential Revision: https://reviews.freebsd.org/D1304 > > Modified: > head/secure/lib/libcrypto/opensslconf-arm.h > head/secure/lib/libcrypto/opensslconf-mips.h > head/secure/lib/libcrypto/opensslconf-powerpc.h > head/secure/lib/libcrypto/opensslconf-sparc64.h > head/secure/lib/libcrypto/opensslconf-x86.h > head/secure/lib/libssl/Makefile > head/sys/sys/param.h > > Modified: head/secure/lib/libcrypto/opensslconf-arm.h > > ============================================================================== > --- head/secure/lib/libcrypto/opensslconf-arm.h Fri Mar 20 21:56:48 2015 > (r280305) > +++ head/secure/lib/libcrypto/opensslconf-arm.h Fri Mar 20 23:48:11 2015 > (r280306) > @@ -27,6 +27,9 @@ extern "C" { > #ifndef OPENSSL_NO_SCTP > # define OPENSSL_NO_SCTP > #endif > +#ifndef OPENSSL_NO_SSL2 > +# define OPENSSL_NO_SSL2 > +#endif > #ifndef OPENSSL_NO_STORE > # define OPENSSL_NO_STORE > #endif > @@ -69,6 +72,9 @@ extern "C" { > # if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) > # define NO_SCTP > # endif > +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) > +# define NO_SSL2 > +# endif > # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) > # define NO_STORE > # endif > > Modified: head/secure/lib/libcrypto/opensslconf-mips.h > > ============================================================================== > --- head/secure/lib/libcrypto/opensslconf-mips.h Fri Mar 20 > 21:56:48 2015 (r280305) > +++ head/secure/lib/libcrypto/opensslconf-mips.h Fri Mar 20 > 23:48:11 2015 (r280306) > @@ -27,6 +27,9 @@ extern "C" { > #ifndef OPENSSL_NO_SCTP > # define OPENSSL_NO_SCTP > #endif > +#ifndef OPENSSL_NO_SSL2 > +# define OPENSSL_NO_SSL2 > +#endif > #ifndef OPENSSL_NO_STORE > # define OPENSSL_NO_STORE > #endif > @@ -69,6 +72,9 @@ extern "C" { > # if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) > # define NO_SCTP > # endif > +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) > +# define NO_SSL2 > +# endif > # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) > # define NO_STORE > # endif > > Modified: head/secure/lib/libcrypto/opensslconf-powerpc.h > > ============================================================================== > --- head/secure/lib/libcrypto/opensslconf-powerpc.h Fri Mar 20 > 21:56:48 2015 (r280305) > +++ head/secure/lib/libcrypto/opensslconf-powerpc.h Fri Mar 20 > 23:48:11 2015 (r280306) > @@ -27,6 +27,9 @@ extern "C" { > #ifndef OPENSSL_NO_SCTP > # define OPENSSL_NO_SCTP > #endif > +#ifndef OPENSSL_NO_SSL2 > +# define OPENSSL_NO_SSL2 > +#endif > #ifndef OPENSSL_NO_STORE > # define OPENSSL_NO_STORE > #endif > @@ -69,6 +72,9 @@ extern "C" { > # if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) > # define NO_SCTP > # endif > +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) > +# define NO_SSL2 > +# endif > # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) > # define NO_STORE > # endif > > Modified: head/secure/lib/libcrypto/opensslconf-sparc64.h > > ============================================================================== > --- head/secure/lib/libcrypto/opensslconf-sparc64.h Fri Mar 20 > 21:56:48 2015 (r280305) > +++ head/secure/lib/libcrypto/opensslconf-sparc64.h Fri Mar 20 > 23:48:11 2015 (r280306) > @@ -27,6 +27,9 @@ extern "C" { > #ifndef OPENSSL_NO_SCTP > # define OPENSSL_NO_SCTP > #endif > +#ifndef OPENSSL_NO_SSL2 > +# define OPENSSL_NO_SSL2 > +#endif > #ifndef OPENSSL_NO_STORE > # define OPENSSL_NO_STORE > #endif > @@ -69,6 +72,9 @@ extern "C" { > # if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) > # define NO_SCTP > # endif > +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) > +# define NO_SSL2 > +# endif > # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) > # define NO_STORE > # endif > > Modified: head/secure/lib/libcrypto/opensslconf-x86.h > > ============================================================================== > --- head/secure/lib/libcrypto/opensslconf-x86.h Fri Mar 20 21:56:48 2015 > (r280305) > +++ head/secure/lib/libcrypto/opensslconf-x86.h Fri Mar 20 23:48:11 2015 > (r280306) > @@ -27,6 +27,9 @@ extern "C" { > #ifndef OPENSSL_NO_SCTP > # define OPENSSL_NO_SCTP > #endif > +#ifndef OPENSSL_NO_SSL2 > +# define OPENSSL_NO_SSL2 > +#endif > #ifndef OPENSSL_NO_STORE > # define OPENSSL_NO_STORE > #endif > @@ -66,6 +69,9 @@ extern "C" { > # if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) > # define NO_SCTP > # endif > +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) > +# define NO_SSL2 > +# endif > # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) > # define NO_STORE > # endif > > Modified: head/secure/lib/libssl/Makefile > > ============================================================================== > --- head/secure/lib/libssl/Makefile Fri Mar 20 21:56:48 2015 > (r280305) > +++ head/secure/lib/libssl/Makefile Fri Mar 20 23:48:11 2015 > (r280306) > @@ -12,11 +12,11 @@ NO_LINT= > > SRCS= bio_ssl.c d1_both.c d1_clnt.c d1_enc.c d1_lib.c d1_meth.c d1_pkt.c > \ > d1_srtp.c d1_srvr.c s23_clnt.c s23_lib.c s23_meth.c s23_pkt.c \ > - s23_srvr.c s2_clnt.c s2_enc.c s2_lib.c s2_meth.c s2_pkt.c > s2_srvr.c \ > - s3_both.c s3_cbc.c s3_clnt.c s3_enc.c s3_lib.c s3_meth.c s3_pkt.c \ > - s3_srvr.c ssl_algs.c ssl_asn1.c ssl_cert.c ssl_ciph.c ssl_err.c \ > - ssl_err2.c ssl_lib.c ssl_rsa.c ssl_sess.c ssl_stat.c ssl_txt.c \ > - t1_clnt.c t1_enc.c t1_lib.c t1_meth.c t1_reneg.c t1_srvr.c > tls_srp.c > + s23_srvr.c s3_both.c s3_cbc.c s3_clnt.c s3_enc.c s3_lib.c > s3_meth.c \ > + s3_pkt.c s3_srvr.c ssl_algs.c ssl_asn1.c ssl_cert.c ssl_ciph.c \ > + ssl_err.c ssl_err2.c ssl_lib.c ssl_rsa.c ssl_sess.c ssl_stat.c \ > + ssl_txt.c t1_clnt.c t1_enc.c t1_lib.c t1_meth.c t1_reneg.c > t1_srvr.c \ > + tls_srp.c > > INCS= dtls1.h kssl.h srtp.h ssl.h ssl2.h ssl23.h ssl3.h tls1.h > INCSDIR=${INCLUDEDIR}/openssl > > Modified: head/sys/sys/param.h > > ============================================================================== > --- head/sys/sys/param.h Fri Mar 20 21:56:48 2015 (r280305) > +++ head/sys/sys/param.h Fri Mar 20 23:48:11 2015 (r280306) > @@ -58,7 +58,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1100065 /* Master, propagated to newvers */ > +#define __FreeBSD_version 1100066 /* Master, propagated to newvers */ > > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of > FreeBSD, > _______________________________________________ > 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" > -- --------------------------------------------------------------------------------- Curb: Your ride is here 4096R/D1EAB94D 2081 E230 3001 6508 8847 1BBF A0A8 DB0F D1EA B94D Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354 Member, Apache Software Foundation Committer, FreeBSD Foundation Consultant, P6M7G8 Inc. Sr. Director IT Operations, Curb What doesn't kill us can only make us stronger; Except it almost kills you. From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 15:44:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AF50144; Mon, 23 Mar 2015 15: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 3616FF53; Mon, 23 Mar 2015 15:44:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NFiIID045848; Mon, 23 Mar 2015 15:44:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NFiI90045847; Mon, 23 Mar 2015 15:44:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503231544.t2NFiI90045847@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 23 Mar 2015 15:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280374 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 15:44:18 -0000 Author: arybchik Date: Mon Mar 23 15:44:17 2015 New Revision: 280374 URL: https://svnweb.freebsd.org/changeset/base/280374 Log: sfxge: assert either kernel or internal copy of interface flags ioctl to put interface down sets ifp->if_flags which holds the intended administratively defined state and calls driver callback to apply it. When everything is done, driver updates internal copy of interface flags sc->if_flags which holds the operational state. So, transmit from Rx path is possible when interface is intended to be administratively down in accordance with ifp->if_flags, but not applied yet and the operational state is up in accordance with sc->if_flags. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D2075 Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Mar 23 15:27:33 2015 (r280373) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Mar 23 15:44:17 2015 (r280374) @@ -676,7 +676,16 @@ sfxge_if_transmit(struct ifnet *ifp, str sc = (struct sfxge_softc *)ifp->if_softc; - KASSERT(ifp->if_flags & IFF_UP, ("interface not up")); + /* + * Transmit may be called when interface is up from the kernel + * point of view, but not yet up (in progress) from the driver + * point of view. I.e. link aggregation bring up. + * Transmit may be called when interface is up from the driver + * point of view, but already down from the kernel point of + * view. I.e. Rx when interface shutdown is in progress. + */ + KASSERT((ifp->if_flags & IFF_UP) || (sc->if_flags & IFF_UP), + ("interface not up")); /* Pick the desired transmit queue. */ if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_TSO)) { From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 15:45:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9BA52B8; Mon, 23 Mar 2015 15: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 C8D30F71; Mon, 23 Mar 2015 15:45:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NFjeaU046113; Mon, 23 Mar 2015 15:45:40 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NFjehZ046112; Mon, 23 Mar 2015 15:45:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503231545.t2NFjehZ046112@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 23 Mar 2015 15:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280375 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 15:45:41 -0000 Author: arybchik Date: Mon Mar 23 15:45:39 2015 New Revision: 280375 URL: https://svnweb.freebsd.org/changeset/base/280375 Log: sfxge: add barriers to BAR write macros In theory the barriers are required to cope with write combining and reordering. Two barriers are added (sometimes merged to one): 1. Before the first write to guarantee that previous writes to the region have been done 2. Before the last write to guarantee that write to the last dword/qword is done after previous writes Barriers are inserted before in the assumption that it is better to postpone barriers as much as it is possible (more chances that the operation has already been already done and barrier does not stall CPU). On x86 and amd64 bus space write barriers are just compiler memory barriers which are definitely required. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D2077 Modified: head/sys/dev/sfxge/common/efsys.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Mon Mar 23 15:44:17 2015 (r280374) +++ head/sys/dev/sfxge/common/efsys.h Mon Mar 23 15:45:39 2015 (r280375) @@ -786,6 +786,14 @@ typedef struct efsys_bar_s { EFSYS_PROBE2(bar_writed, unsigned int, (_offset), \ uint32_t, (_edp)->ed_u32[0]); \ \ + /* \ + * Make sure that previous writes to the dword have \ + * been done. It should be cheaper than barrier just \ + * after the write below. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_dword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset), (_edp)->ed_u32[0]); \ @@ -809,6 +817,14 @@ typedef struct efsys_bar_s { uint32_t, (_eqp)->eq_u32[1], \ uint32_t, (_eqp)->eq_u32[0]); \ \ + /* \ + * Make sure that previous writes to the qword have \ + * been done. It should be cheaper than barrier just \ + * after the write below. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_qword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_8((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset), (_eqp)->eq_u64[0]); \ @@ -829,9 +845,25 @@ typedef struct efsys_bar_s { uint32_t, (_eqp)->eq_u32[1], \ uint32_t, (_eqp)->eq_u32[0]); \ \ + /* \ + * Make sure that previous writes to the qword have \ + * been done. It should be cheaper than barrier just \ + * after the last write below. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_qword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset), (_eqp)->eq_u32[0]); \ + /* \ + * It should be guaranteed that the last dword comes \ + * the last, so barrier entire qword to be sure that \ + * neither above nor below writes are reordered. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_qword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset) + 4, (_eqp)->eq_u32[1]); \ @@ -858,9 +890,25 @@ typedef struct efsys_bar_s { uint32_t, (_eop)->eo_u32[1], \ uint32_t, (_eop)->eo_u32[0]); \ \ + /* \ + * Make sure that previous writes to the oword have \ + * been done. It should be cheaper than barrier just \ + * after the last write below. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_oword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_8((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset), (_eop)->eo_u64[0]); \ + /* \ + * It should be guaranteed that the last qword comes \ + * the last, so barrier entire oword to be sure that \ + * neither above nor below writes are reordered. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_oword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_8((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset) + 8, (_eop)->eo_u64[1]); \ @@ -888,6 +936,14 @@ typedef struct efsys_bar_s { uint32_t, (_eop)->eo_u32[1], \ uint32_t, (_eop)->eo_u32[0]); \ \ + /* \ + * Make sure that previous writes to the oword have \ + * been done. It should be cheaper than barrier just \ + * after the last write below. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_oword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset), (_eop)->eo_u32[0]); \ @@ -897,6 +953,14 @@ typedef struct efsys_bar_s { bus_space_write_stream_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset) + 8, (_eop)->eo_u32[2]); \ + /* \ + * It should be guaranteed that the last dword comes \ + * the last, so barrier entire oword to be sure that \ + * neither above nor below writes are reordered. \ + */ \ + bus_space_barrier((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), sizeof (efx_oword_t), \ + BUS_SPACE_BARRIER_WRITE); \ bus_space_write_stream_4((_esbp)->esb_tag, \ (_esbp)->esb_handle, \ (_offset) + 12, (_eop)->eo_u32[3]); \ From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 15:47:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 829FE50B; Mon, 23 Mar 2015 15:47: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 63BB6F9D; Mon, 23 Mar 2015 15:47:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NFleWK046569; Mon, 23 Mar 2015 15:47:40 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NFlcAE046562; Mon, 23 Mar 2015 15:47:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503231547.t2NFlcAE046562@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 23 Mar 2015 15:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280376 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 15:47:40 -0000 Author: arybchik Date: Mon Mar 23 15:47:37 2015 New Revision: 280376 URL: https://svnweb.freebsd.org/changeset/base/280376 Log: sfxge: remove obsolete Tx non-multi queue support Tx multi queue is added in FreeBSD 8.0. So, the changeset drops earlier versions support. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D2081 Modified: head/sys/dev/sfxge/sfxge.c head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_rx.c head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/sfxge/sfxge_tx.h Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Mon Mar 23 15:45:39 2015 (r280375) +++ head/sys/dev/sfxge/sfxge.c Mon Mar 23 15:47:37 2015 (r280376) @@ -330,19 +330,8 @@ sfxge_ifnet_init(struct ifnet *ifp, stru ether_ifattach(ifp, encp->enc_mac_addr); -#ifdef SFXGE_HAVE_MQ ifp->if_transmit = sfxge_if_transmit; ifp->if_qflush = sfxge_if_qflush; -#else - ifp->if_start = sfxge_if_start; - IFQ_SET_MAXLEN(&ifp->if_snd, sc->txq_entries - 1); - ifp->if_snd.ifq_drv_maxlen = sc->txq_entries - 1; - IFQ_SET_READY(&ifp->if_snd); - - snprintf(sc->tx_lock_name, sizeof(sc->tx_lock_name), - "%s:tx", device_get_nameunit(sc->dev)); - mtx_init(&sc->tx_lock, sc->tx_lock_name, NULL, MTX_DEF); -#endif ifp->if_get_counter = sfxge_get_counter; Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Mon Mar 23 15:45:39 2015 (r280375) +++ head/sys/dev/sfxge/sfxge.h Mon Mar 23 15:47:37 2015 (r280376) @@ -67,12 +67,6 @@ #ifndef IFM_10G_KX4 #define IFM_10G_KX4 IFM_10G_CX4 #endif -#if __FreeBSD_version >= 800054 -/* Networking core is multiqueue aware. We can manage our own TX - * queues and use m_pkthdr.flowid. - */ -#define SFXGE_HAVE_MQ -#endif #if (__FreeBSD_version >= 800501 && __FreeBSD_version < 900000) || \ __FreeBSD_version >= 900003 #define SFXGE_HAVE_DESCRIBE_INTR @@ -243,11 +237,7 @@ struct sfxge_softc { struct sfxge_rxq *rxq[SFXGE_RX_SCALE_MAX]; unsigned int rx_indir_table[SFXGE_RX_SCALE_MAX]; -#ifdef SFXGE_HAVE_MQ struct sfxge_txq *txq[SFXGE_TXQ_NTYPES + SFXGE_RX_SCALE_MAX]; -#else - struct sfxge_txq *txq[SFXGE_TXQ_NTYPES]; -#endif struct ifmedia media; @@ -255,11 +245,6 @@ struct sfxge_softc { size_t rx_buffer_size; uma_zone_t rx_buffer_zone; -#ifndef SFXGE_HAVE_MQ - struct mtx tx_lock __aligned(CACHE_LINE_SIZE); - char tx_lock_name[SFXGE_LOCK_NAME_MAX]; -#endif - unsigned int evq_count; unsigned int rxq_count; unsigned int txq_count; Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Mon Mar 23 15:45:39 2015 (r280375) +++ head/sys/dev/sfxge/sfxge_rx.c Mon Mar 23 15:47:37 2015 (r280376) @@ -330,14 +330,12 @@ sfxge_rx_deliver(struct sfxge_softc *sc, if (rx_desc->flags & EFX_CKSUM_TCPUDP) csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; -#ifdef SFXGE_HAVE_MQ /* The hash covers a 4-tuple for TCP only */ if (rx_desc->flags & EFX_PKT_TCP) { m->m_pkthdr.flowid = EFX_RX_HASH_VALUE(EFX_RX_HASHALG_TOEPLITZ, mtod(m, uint8_t *)); M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); } -#endif m->m_data += sc->rx_prefix_size; m->m_len = rx_desc->size - sc->rx_prefix_size; m->m_pkthdr.len = m->m_len; @@ -386,10 +384,9 @@ sfxge_lro_deliver(struct sfxge_lro_state memcpy(c_th + 1, c->th_last + 1, optlen); } -#ifdef SFXGE_HAVE_MQ m->m_pkthdr.flowid = c->conn_hash; M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); -#endif + m->m_pkthdr.csum_flags = csum_flags; __sfxge_rx_deliver(sc, m); Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Mar 23 15:45:39 2015 (r280375) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Mar 23 15:47:37 2015 (r280376) @@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$"); #define SFXGE_TXQ_BLOCK_LEVEL(_entries) \ (EFX_TXQ_LIMIT(_entries) - SFXGE_TSO_MAX_DESC) -#ifdef SFXGE_HAVE_MQ #define SFXGE_PARAM_TX_DPL_GET_MAX SFXGE_PARAM(tx_dpl_get_max) static int sfxge_tx_dpl_get_max = SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT; @@ -109,8 +108,6 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_p &sfxge_tx_dpl_put_max, 0, "Maximum number of any packets in deferred packet put-list"); -#endif - /* Forward declarations. */ static void sfxge_tx_qdpl_service(struct sfxge_txq *txq); @@ -160,8 +157,6 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq } } -#ifdef SFXGE_HAVE_MQ - static unsigned int sfxge_is_mbuf_non_tcp(struct mbuf *mbuf) { @@ -225,8 +220,6 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq * stdp->std_get_non_tcp_count += non_tcp_count; } -#endif /* SFXGE_HAVE_MQ */ - static void sfxge_tx_qreap(struct sfxge_txq *txq) { @@ -401,8 +394,6 @@ reject: return (rc); } -#ifdef SFXGE_HAVE_MQ - /* * Drain the deferred packet list into the transmit queue. */ @@ -709,88 +700,6 @@ sfxge_if_transmit(struct ifnet *ifp, str return (rc); } -#else /* !SFXGE_HAVE_MQ */ - -static void sfxge_if_start_locked(struct ifnet *ifp) -{ - struct sfxge_softc *sc = ifp->if_softc; - struct sfxge_txq *txq; - struct mbuf *mbuf; - unsigned int pushed[SFXGE_TXQ_NTYPES]; - unsigned int q_index; - - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING) - return; - - if (!sc->port.link_up) - return; - - for (q_index = 0; q_index < SFXGE_TXQ_NTYPES; q_index++) { - txq = sc->txq[q_index]; - pushed[q_index] = txq->added; - } - - while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - IFQ_DRV_DEQUEUE(&ifp->if_snd, mbuf); - if (mbuf == NULL) - break; - - ETHER_BPF_MTAP(ifp, mbuf); /* packet capture */ - - /* Pick the desired transmit queue. */ - if (mbuf->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_TSO)) - q_index = SFXGE_TXQ_IP_TCP_UDP_CKSUM; - else if (mbuf->m_pkthdr.csum_flags & CSUM_DELAY_IP) - q_index = SFXGE_TXQ_IP_CKSUM; - else - q_index = SFXGE_TXQ_NON_CKSUM; - txq = sc->txq[q_index]; - - if (sfxge_tx_queue_mbuf(txq, mbuf) != 0) - continue; - - if (txq->blocked) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; - } - - /* Push the fragments to the hardware in batches. */ - if (txq->added - pushed[q_index] >= SFXGE_TX_BATCH) { - efx_tx_qpush(txq->common, txq->added); - pushed[q_index] = txq->added; - } - } - - for (q_index = 0; q_index < SFXGE_TXQ_NTYPES; q_index++) { - txq = sc->txq[q_index]; - if (txq->added != pushed[q_index]) - efx_tx_qpush(txq->common, txq->added); - } -} - -void sfxge_if_start(struct ifnet *ifp) -{ - struct sfxge_softc *sc = ifp->if_softc; - - SFXGE_TXQ_LOCK(sc->txq[0]); - sfxge_if_start_locked(ifp); - SFXGE_TXQ_UNLOCK(sc->txq[0]); -} - -static void -sfxge_tx_qdpl_service(struct sfxge_txq *txq) -{ - struct ifnet *ifp = txq->sc->ifnet; - - SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - sfxge_if_start_locked(ifp); - SFXGE_TXQ_UNLOCK(txq); -} - -#endif /* SFXGE_HAVE_MQ */ - /* * Software "TSO". Not quite as good as doing it in hardware, but * still faster than segmenting in the stack. @@ -1379,9 +1288,7 @@ sfxge_tx_qfini(struct sfxge_softc *sc, u sc->txq[index] = NULL; -#ifdef SFXGE_HAVE_MQ SFXGE_TXQ_LOCK_DESTROY(txq); -#endif free(txq, M_SFXGE); } @@ -1395,10 +1302,8 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u struct sysctl_oid *txq_node; struct sfxge_txq *txq; struct sfxge_evq *evq; -#ifdef SFXGE_HAVE_MQ struct sfxge_tx_dpl *stdp; struct sysctl_oid *dpl_node; -#endif efsys_mem_t *esmp; unsigned int nmaps; int rc; @@ -1457,7 +1362,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u (rc = tso_init(txq)) != 0) goto fail3; -#ifdef SFXGE_HAVE_MQ if (sfxge_tx_dpl_get_max <= 0) { log(LOG_ERR, "%s=%d must be greater than 0", SFXGE_PARAM_TX_DPL_GET_MAX, sfxge_tx_dpl_get_max); @@ -1507,7 +1411,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(dpl_node), OID_AUTO, "put_hiwat", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_put_hiwat, 0, ""); -#endif txq->type = type; txq->evq_index = evq_index; @@ -1637,11 +1540,7 @@ sfxge_tx_init(struct sfxge_softc *sc) KASSERT(intr->state == SFXGE_INTR_INITIALIZED, ("intr->state != SFXGE_INTR_INITIALIZED")); -#ifdef SFXGE_HAVE_MQ sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc; -#else - sc->txq_count = SFXGE_TXQ_NTYPES; -#endif sc->txqs_node = SYSCTL_ADD_NODE( device_get_sysctl_ctx(sc->dev), Modified: head/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.h Mon Mar 23 15:45:39 2015 (r280375) +++ head/sys/dev/sfxge/sfxge_tx.h Mon Mar 23 15:47:37 2015 (r280376) @@ -128,12 +128,6 @@ enum sfxge_txq_type { #define SFXGE_TX_BATCH 64 -#ifdef SFXGE_HAVE_MQ -#define SFXGE_TX_LOCK(txq) (&(txq)->lock) -#else -#define SFXGE_TX_LOCK(txq) (&(txq)->sc->tx_lock) -#endif - #define SFXGE_TXQ_LOCK_INIT(_txq, _ifname, _txq_index) \ do { \ struct sfxge_txq *__txq = (_txq); \ @@ -147,13 +141,13 @@ enum sfxge_txq_type { #define SFXGE_TXQ_LOCK_DESTROY(_txq) \ mtx_destroy(&(_txq)->lock) #define SFXGE_TXQ_LOCK(_txq) \ - mtx_lock(SFXGE_TX_LOCK(_txq)) + mtx_lock(&(_txq)->lock) #define SFXGE_TXQ_TRYLOCK(_txq) \ - mtx_trylock(SFXGE_TX_LOCK(_txq)) + mtx_trylock(&(_txq)->lock) #define SFXGE_TXQ_UNLOCK(_txq) \ - mtx_unlock(SFXGE_TX_LOCK(_txq)) + mtx_unlock(&(_txq)->lock) #define SFXGE_TXQ_LOCK_ASSERT_OWNED(_txq) \ - mtx_assert(SFXGE_TX_LOCK(_txq), MA_OWNED) + mtx_assert(&(_txq)->lock, MA_OWNED) struct sfxge_txq { @@ -186,13 +180,9 @@ struct sfxge_txq { /* The following fields change more often, and are used mostly * on the initiation path */ -#ifdef SFXGE_HAVE_MQ struct mtx lock __aligned(CACHE_LINE_SIZE); struct sfxge_tx_dpl dpl; /* Deferred packet list. */ unsigned int n_pend_desc; -#else - unsigned int n_pend_desc __aligned(CACHE_LINE_SIZE); -#endif unsigned int added; unsigned int reaped; /* Statistics */ @@ -227,11 +217,7 @@ extern int sfxge_tx_start(struct sfxge_s extern void sfxge_tx_stop(struct sfxge_softc *sc); extern void sfxge_tx_qcomplete(struct sfxge_txq *txq, struct sfxge_evq *evq); extern void sfxge_tx_qflush_done(struct sfxge_txq *txq); -#ifdef SFXGE_HAVE_MQ extern void sfxge_if_qflush(struct ifnet *ifp); extern int sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m); -#else -extern void sfxge_if_start(struct ifnet *ifp); -#endif #endif From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 15:49:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 422BC698; Mon, 23 Mar 2015 15: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D711FC8; Mon, 23 Mar 2015 15:49:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NFnCFb046819; Mon, 23 Mar 2015 15:49:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NFnCj5046818; Mon, 23 Mar 2015 15:49:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503231549.t2NFnCj5046818@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 23 Mar 2015 15:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280377 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 15:49:12 -0000 Author: arybchik Date: Mon Mar 23 15:49:11 2015 New Revision: 280377 URL: https://svnweb.freebsd.org/changeset/base/280377 Log: sfxge: add statistics for each Tx queue Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D2082 Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Mar 23 15:47:37 2015 (r280376) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Mar 23 15:49:11 2015 (r280377) @@ -109,6 +109,26 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_p "Maximum number of any packets in deferred packet put-list"); +static const struct { + const char *name; + size_t offset; +} sfxge_tx_stats[] = { +#define SFXGE_TX_STAT(name, member) \ + { #name, offsetof(struct sfxge_txq, member) } + SFXGE_TX_STAT(tso_bursts, tso_bursts), + SFXGE_TX_STAT(tso_packets, tso_packets), + SFXGE_TX_STAT(tso_long_headers, tso_long_headers), + SFXGE_TX_STAT(tso_pdrop_too_many, tso_pdrop_too_many), + SFXGE_TX_STAT(tso_pdrop_no_rsrc, tso_pdrop_no_rsrc), + SFXGE_TX_STAT(tx_collapses, collapses), + SFXGE_TX_STAT(tx_drops, drops), + SFXGE_TX_STAT(tx_get_overflow, get_overflow), + SFXGE_TX_STAT(tx_get_non_tcp_overflow, get_non_tcp_overflow), + SFXGE_TX_STAT(tx_put_overflow, put_overflow), + SFXGE_TX_STAT(tx_netdown_drops, netdown_drops), +}; + + /* Forward declarations. */ static void sfxge_tx_qdpl_service(struct sfxge_txq *txq); static void sfxge_tx_qlist_post(struct sfxge_txq *txq); @@ -1259,6 +1279,30 @@ fail: return (rc); } +static int +sfxge_txq_stat_init(struct sfxge_txq *txq, struct sysctl_oid *txq_node) +{ + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(txq->sc->dev); + struct sysctl_oid *stat_node; + unsigned int id; + + stat_node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(txq_node), OID_AUTO, + "stats", CTLFLAG_RD, NULL, + "Tx queue statistics"); + if (stat_node == NULL) + return (ENOMEM); + + for (id = 0; id < nitems(sfxge_tx_stats); id++) { + SYSCTL_ADD_ULONG( + ctx, SYSCTL_CHILDREN(stat_node), OID_AUTO, + sfxge_tx_stats[id].name, CTLFLAG_RD | CTLFLAG_STATS, + (unsigned long *)((caddr_t)txq + sfxge_tx_stats[id].offset), + ""); + } + + return (0); +} + /** * Destroy a transmit queue. */ @@ -1412,6 +1456,10 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u "put_hiwat", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_put_hiwat, 0, ""); + rc = sfxge_txq_stat_init(txq, txq_node); + if (rc != 0) + goto fail_txq_stat_init; + txq->type = type; txq->evq_index = evq_index; txq->txq_index = txq_index; @@ -1419,6 +1467,7 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u return (0); +fail_txq_stat_init: fail_dpl_node: fail_tx_dpl_put_max: fail_tx_dpl_get_max: @@ -1437,25 +1486,6 @@ fail: return (rc); } -static const struct { - const char *name; - size_t offset; -} sfxge_tx_stats[] = { -#define SFXGE_TX_STAT(name, member) \ - { #name, offsetof(struct sfxge_txq, member) } - SFXGE_TX_STAT(tso_bursts, tso_bursts), - SFXGE_TX_STAT(tso_packets, tso_packets), - SFXGE_TX_STAT(tso_long_headers, tso_long_headers), - SFXGE_TX_STAT(tso_pdrop_too_many, tso_pdrop_too_many), - SFXGE_TX_STAT(tso_pdrop_no_rsrc, tso_pdrop_no_rsrc), - SFXGE_TX_STAT(tx_collapses, collapses), - SFXGE_TX_STAT(tx_drops, drops), - SFXGE_TX_STAT(tx_get_overflow, get_overflow), - SFXGE_TX_STAT(tx_get_non_tcp_overflow, get_non_tcp_overflow), - SFXGE_TX_STAT(tx_put_overflow, put_overflow), - SFXGE_TX_STAT(tx_netdown_drops, netdown_drops), -}; - static int sfxge_tx_stat_handler(SYSCTL_HANDLER_ARGS) { From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 15:52:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 112DB85E; Mon, 23 Mar 2015 15: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D71C0F8; Mon, 23 Mar 2015 15:52:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NFq6wR050627; Mon, 23 Mar 2015 15:52:06 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NFq6Pf050626; Mon, 23 Mar 2015 15:52:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503231552.t2NFq6Pf050626@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 23 Mar 2015 15:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280378 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 15:52:07 -0000 Author: arybchik Date: Mon Mar 23 15:52:05 2015 New Revision: 280378 URL: https://svnweb.freebsd.org/changeset/base/280378 Log: sfxge: FreeBSD before 10 does not have bus_space_*_8 on amd64 bus_space_*_8() are not always macros, so it is not correct to use #ifndef. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D2083 Modified: head/sys/dev/sfxge/common/efsys.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Mon Mar 23 15:49:11 2015 (r280377) +++ head/sys/dev/sfxge/common/efsys.h Mon Mar 23 15:52:05 2015 (r280378) @@ -94,13 +94,20 @@ extern "C" { #define ISP2(x) (((x) & ((x) - 1)) == 0) #endif -#if defined(__x86_64__) +#if defined(__x86_64__) && __FreeBSD_version >= 1000000 + +#define SFXGE_USE_BUS_SPACE_8 1 + #if !defined(bus_space_read_stream_8) + #define bus_space_read_stream_8(t, h, o) \ bus_space_read_8((t), (h), (o)) + #define bus_space_write_stream_8(t, h, o, v) \ bus_space_write_8((t), (h), (o), (v)) + #endif + #endif #define ENOTACTIVE EINVAL @@ -663,7 +670,7 @@ typedef struct efsys_bar_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) -#if defined(__x86_64__) +#if defined(SFXGE_USE_BUS_SPACE_8) #define EFSYS_BAR_READQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ @@ -804,7 +811,7 @@ typedef struct efsys_bar_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) -#if defined(__x86_64__) +#if defined(SFXGE_USE_BUS_SPACE_8) #define EFSYS_BAR_WRITEQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ @@ -873,7 +880,7 @@ typedef struct efsys_bar_s { } while (B_FALSE) #endif -#if defined(__x86_64__) +#if defined(SFXGE_USE_BUS_SPACE_8) #define EFSYS_BAR_WRITEO(_esbp, _offset, _eop, _lock) \ do { \ _NOTE(CONSTANTCONDITION) \ From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 15:52:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D067F9CB; Mon, 23 Mar 2015 15:52: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 BBDA611E; Mon, 23 Mar 2015 15:52:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NFqwjW050771; Mon, 23 Mar 2015 15:52:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NFqwLE050770; Mon, 23 Mar 2015 15:52:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503231552.t2NFqwLE050770@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 23 Mar 2015 15:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280379 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 15:52:58 -0000 Author: arybchik Date: Mon Mar 23 15:52:57 2015 New Revision: 280379 URL: https://svnweb.freebsd.org/changeset/base/280379 Log: sfxge: do not check MCDI status word This is a temporary workaround until we determine a reliable sequence of operations for detecting MC reboots. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D2084 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Mon Mar 23 15:52:05 2015 (r280378) +++ head/sys/dev/sfxge/common/efx_mcdi.c Mon Mar 23 15:52:57 2015 (r280379) @@ -213,6 +213,14 @@ static int efx_mcdi_poll_reboot( __in efx_nic_t *enp) { +#ifndef EFX_GRACEFUL_MC_REBOOT + /* + * This function is not being used properly. + * Until its callers are fixed, it should always return 0. + */ + _NOTE(ARGUNUSED(enp)) + return (0); +#else efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip); unsigned int rebootr; efx_dword_t dword; @@ -236,6 +244,7 @@ efx_mcdi_poll_reboot( return (EINTR); else return (EIO); +#endif } __checkReturn boolean_t From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 15:53:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22CD4B17; Mon, 23 Mar 2015 15:53: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 0E44C12F; Mon, 23 Mar 2015 15:53:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NFrQom050888; Mon, 23 Mar 2015 15:53:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NFrQ8u050887; Mon, 23 Mar 2015 15:53:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503231553.t2NFrQ8u050887@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 23 Mar 2015 15:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280380 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 15:53:27 -0000 Author: arybchik Date: Mon Mar 23 15:53:26 2015 New Revision: 280380 URL: https://svnweb.freebsd.org/changeset/base/280380 Log: sfxge: remove unnecessary and wrong prediction Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D2085 Modified: head/sys/dev/sfxge/sfxge_port.c Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Mon Mar 23 15:52:57 2015 (r280379) +++ head/sys/dev/sfxge/sfxge_port.c Mon Mar 23 15:53:26 2015 (r280380) @@ -241,7 +241,7 @@ sfxge_port_wanted_fc_handler(SYSCTL_HAND SFXGE_PORT_LOCK(port); if (port->wanted_fc != fcntl) { - if (__predict_false(port->init_state == SFXGE_PORT_STARTED)) + if (port->init_state == SFXGE_PORT_STARTED) error = efx_mac_fcntl_set(sc->enp, port->wanted_fc, B_TRUE); From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 16:04:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1275DF38; Mon, 23 Mar 2015 16:04: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 F11FC253; Mon, 23 Mar 2015 16:04:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NG47LJ055774; Mon, 23 Mar 2015 16:04:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NG455A055762; Mon, 23 Mar 2015 16:04:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503231604.t2NG455A055762@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 23 Mar 2015 16:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280381 - head/sys/arm64/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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:04:08 -0000 Author: emaste Date: Mon Mar 23 16:04:04 2015 New Revision: 280381 URL: https://svnweb.freebsd.org/changeset/base/280381 Log: Renumber clauses to avoid missing 3 Modified: head/sys/arm64/include/_types.h head/sys/arm64/include/cpu.h head/sys/arm64/include/float.h head/sys/arm64/include/pmap.h head/sys/arm64/include/proc.h head/sys/arm64/include/signal.h head/sys/arm64/include/stdarg.h head/sys/arm64/include/vmparam.h Modified: head/sys/arm64/include/_types.h ============================================================================== --- head/sys/arm64/include/_types.h Mon Mar 23 15:53:26 2015 (r280380) +++ head/sys/arm64/include/_types.h Mon Mar 23 16:04:04 2015 (r280381) @@ -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/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Mon Mar 23 15:53:26 2015 (r280380) +++ head/sys/arm64/include/cpu.h Mon Mar 23 16:04:04 2015 (r280381) @@ -17,7 +17,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/arm64/include/float.h ============================================================================== --- head/sys/arm64/include/float.h Mon Mar 23 15:53:26 2015 (r280380) +++ head/sys/arm64/include/float.h Mon Mar 23 16:04:04 2015 (r280381) @@ -14,7 +14,7 @@ * 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/arm64/include/pmap.h ============================================================================== --- head/sys/arm64/include/pmap.h Mon Mar 23 15:53:26 2015 (r280380) +++ head/sys/arm64/include/pmap.h Mon Mar 23 16:04:04 2015 (r280381) @@ -14,7 +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. - * 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/arm64/include/proc.h ============================================================================== --- head/sys/arm64/include/proc.h Mon Mar 23 15:53:26 2015 (r280380) +++ head/sys/arm64/include/proc.h Mon Mar 23 16:04:04 2015 (r280381) @@ -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/arm64/include/signal.h ============================================================================== --- head/sys/arm64/include/signal.h Mon Mar 23 15:53:26 2015 (r280380) +++ head/sys/arm64/include/signal.h Mon Mar 23 16:04:04 2015 (r280381) @@ -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/arm64/include/stdarg.h ============================================================================== --- head/sys/arm64/include/stdarg.h Mon Mar 23 15:53:26 2015 (r280380) +++ head/sys/arm64/include/stdarg.h Mon Mar 23 16:04:04 2015 (r280381) @@ -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/arm64/include/vmparam.h ============================================================================== --- head/sys/arm64/include/vmparam.h Mon Mar 23 15:53:26 2015 (r280380) +++ head/sys/arm64/include/vmparam.h Mon Mar 23 16:04:04 2015 (r280381) @@ -15,7 +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. - * 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 Mon Mar 23 16:22:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A024F7C7; Mon, 23 Mar 2015 16:22: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 725F9662; Mon, 23 Mar 2015 16:22:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NGMvUR065147; Mon, 23 Mar 2015 16:22:57 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NGMvY8065146; Mon, 23 Mar 2015 16:22:57 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503231622.t2NGMvY8065146@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 23 Mar 2015 16:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280382 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:22:57 -0000 Author: dteske Date: Mon Mar 23 16:22:56 2015 New Revision: 280382 URL: https://svnweb.freebsd.org/changeset/base/280382 Log: Fix sgetkey indentation to be consistent with the rest of the file. Remove some blank lines, adjust some comments and update copyright. MFC after: 3 days X-MFC-to: stable/10 stable/9 Modified: head/sys/boot/forth/check-password.4th Modified: head/sys/boot/forth/check-password.4th ============================================================================== --- head/sys/boot/forth/check-password.4th Mon Mar 23 16:04:04 2015 (r280381) +++ head/sys/boot/forth/check-password.4th Mon Mar 23 16:22:56 2015 (r280382) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2012 Devin Teske +\ Copyright (c) 2006-2015 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without @@ -48,33 +48,29 @@ variable readlen \ input length \ : sgetkey ( -- ) - begin \ Loop forever - key? if \ Was a key pressed? (see loader(8)) - - drop \ Remove stack-cruft - key \ Get the key that was pressed - - \ Check key pressed (see loader(8)) and input limit - dup 0<> if ( and ) readlen @ readmax < if - - \ Echo an asterisk (unless Backspace/Enter) - dup bs_key <> if ( and ) dup enter_key <> if - ." *" \ Echo an asterisk - then then - - exit \ Exit from the function - then then - - \ Always allow Backspace and Enter - dup bs_key = if exit then - dup enter_key = if exit then - - then - 50 ms \ Sleep for 50 milliseconds (see loader(8)) - again + begin \ Loop forever + key? if \ Was a key pressed? (see loader(8)) + drop \ Remove stack-cruft + key \ Get the key that was pressed + + \ Check key pressed (see loader(8)) and input limit + dup 0<> if ( and ) readlen @ readmax < if + \ Echo an asterisk (unless Backspace/Enter) + dup bs_key <> if ( and ) dup enter_key <> if + ." *" \ Echo an asterisk + then then + exit + then then + + \ Always allow Backspace and Enter + dup bs_key = if exit then + dup enter_key = if exit then + then + 50 ms \ Sleep for 50 milliseconds (see loader(8)) + again ; -: read ( String prompt -- ) +: read ( c-addr/u -- ) \ Expects string prompt as stack input 0 25 at-xy \ Move the cursor to the bottom-left dup 1+ read-start ! \ Store X offset after the prompt @@ -127,8 +123,7 @@ variable readlen \ input length then then - drop \ drop the last key that was entered - + drop \ last key pressed again \ Enter was not pressed; repeat ; From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 16:31:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBDADB1E; Mon, 23 Mar 2015 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 9E8357CA; Mon, 23 Mar 2015 16:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NGVSJd069930; Mon, 23 Mar 2015 16:31:28 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NGVS3B069929; Mon, 23 Mar 2015 16:31:28 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503231631.t2NGVS3B069929@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 23 Mar 2015 16:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280383 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:31:28 -0000 Author: dteske Date: Mon Mar 23 16:31:27 2015 New Revision: 280383 URL: https://svnweb.freebsd.org/changeset/base/280383 Log: Prevent password/bootlock_password features of loader.conf(5) from locking out everyone in the case of setting a password longer than the maximum (currently 16 characters). Now the required password is truncated to the maximum input that can be read from the user. PR: kern/198760 MFC after: 3 days MFH: stable/10 stable/9 Modified: head/sys/boot/forth/check-password.4th Modified: head/sys/boot/forth/check-password.4th ============================================================================== --- head/sys/boot/forth/check-password.4th Mon Mar 23 16:22:56 2015 (r280382) +++ head/sys/boot/forth/check-password.4th Mon Mar 23 16:31:27 2015 (r280383) @@ -28,15 +28,15 @@ marker task-check-password.4th include /boot/screen.4th -13 constant enter_key \ The decimal ASCII value for Enter key -8 constant bs_key \ The decimal ASCII value for Backspace key -16 constant readmax \ Maximum number of characters for the password +13 constant enter_key \ The decimal ASCII value for Enter key +8 constant bs_key \ The decimal ASCII value for Backspace key +16 constant readmax \ Maximum number of characters for the password -variable readX \ Current X offset (column)(used by read) -variable read-start \ Starting X offset (column)(used by read) +variable readX \ Current X offset (column)(used by read) +variable read-start \ Starting X offset (column)(used by read) -create readval 16 allot \ input obtained (maximum 16 characters) -variable readlen \ input length +create readval readmax allot \ input obtained (up to readmax characters) +variable readlen \ input length \ This function blocks program flow (loops forever) until a key is pressed. \ The key that was pressed is added to the top of the stack in the form of its @@ -132,6 +132,7 @@ variable readlen \ input length \ Do not allow the user to proceed beyond this point if a boot-lock \ password has been set (preventing even boot from proceeding) s" bootlock_password" getenv dup -1 <> if + dup readmax > if drop readmax then begin s" Boot Password: " read ( prompt -- ) 2dup readval readlen @ compare 0<> @@ -154,7 +155,7 @@ variable readlen \ input length \ Only reached if autoboot fails for any reason (including if/when \ the user aborts/escapes the countdown sequence leading to boot). - s" password" getenv + s" password" getenv dup readmax > if drop readmax then begin s" Password: " read ( prompt -- ) 2dup readval readlen @ compare 0= if From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 16:43:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9DAEF9C; Mon, 23 Mar 2015 16: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 BCD458F5; Mon, 23 Mar 2015 16:43:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NGhlcU074912; Mon, 23 Mar 2015 16:43:47 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NGhlNh074911; Mon, 23 Mar 2015 16:43:47 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503231643.t2NGhlNh074911@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 23 Mar 2015 16:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280384 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:43:48 -0000 Author: dteske Date: Mon Mar 23 16:43:46 2015 New Revision: 280384 URL: https://svnweb.freebsd.org/changeset/base/280384 Log: Increase max input for password/bootlock_password from 16 to 255. When taking user input, don't show asterisks as the user types but instead spin a twiddle. Implement Ctrl-U to clear user input. If the buffer is empty, either because the user has yet to type anything, presses Ctrl-U at any time, or presses backspace enough to end in an empty buffer, the twiddle is erased to provide feed- back to the user. MFC after: 3 days X-MFC-to: stable/10 stable/9 Modified: head/sys/boot/forth/check-password.4th Modified: head/sys/boot/forth/check-password.4th ============================================================================== --- head/sys/boot/forth/check-password.4th Mon Mar 23 16:31:27 2015 (r280383) +++ head/sys/boot/forth/check-password.4th Mon Mar 23 16:43:46 2015 (r280384) @@ -28,11 +28,12 @@ marker task-check-password.4th include /boot/screen.4th -13 constant enter_key \ The decimal ASCII value for Enter key -8 constant bs_key \ The decimal ASCII value for Backspace key -16 constant readmax \ Maximum number of characters for the password +13 constant enter_key \ The decimal ASCII value for Enter key +8 constant bs_key \ The decimal ASCII value for Backspace key +21 constant ctrl_u \ The decimal ASCII value for Ctrl-U sequence +255 constant readmax \ Maximum number of characters for the password -variable readX \ Current X offset (column)(used by read) +variable read-tick \ Twiddle position (used by read) variable read-start \ Starting X offset (column)(used by read) create readval readmax allot \ input obtained (up to readmax characters) @@ -55,16 +56,23 @@ variable readlen \ input len \ Check key pressed (see loader(8)) and input limit dup 0<> if ( and ) readlen @ readmax < if - \ Echo an asterisk (unless Backspace/Enter) - dup bs_key <> if ( and ) dup enter_key <> if - ." *" \ Echo an asterisk - then then + \ Spin the twiddle and then exit this function + read-tick @ dup 1+ 4 mod read-tick ! + 2 spaces + dup 0 = if ( 1 ) ." /" else + dup 1 = if ( 2 ) ." -" else + dup 2 = if ( 3 ) ." \" else + dup 3 = if ( 4 ) ." |" else + 1 spaces + then then then then drop + read-start @ 25 at-xy exit then then - \ Always allow Backspace and Enter + \ Always allow Backspace, Enter, and Ctrl-U dup bs_key = if exit then dup enter_key = if exit then + dup ctrl_u = if exit then then 50 ms \ Sleep for 50 milliseconds (see loader(8)) again @@ -74,7 +82,6 @@ variable readlen \ input len 0 25 at-xy \ Move the cursor to the bottom-left dup 1+ read-start ! \ Store X offset after the prompt - read-start @ readX ! \ copy value to the current X offset 0 readlen ! \ Initialize the read length type \ Print the prompt @@ -86,42 +93,23 @@ variable readlen \ input len \ security reasons). If Enter is pressed, we process the \ password, otherwise augment the key to a string. - \ If the key that was entered was not Enter, advance - dup enter_key <> if - readX @ 1+ readX ! \ Advance the column - readlen @ 1+ readlen ! \ Increment input length - then - - \ Handle backspacing - dup bs_key = if - readX @ 2 - readX ! \ Set new cursor position - readlen @ 2 - readlen ! \ Decrement input length - - \ Don't move behind starting position - readX @ read-start @ < if - read-start @ readX ! - then - readlen @ 0< if - 0 readlen ! - then - - \ Reposition cursor and erase character - readX @ 25 at-xy 1 spaces readX @ 25 at-xy - then - dup enter_key = if - drop \ Clean up stack cruft - 10 emit \ Echo new line + drop \ Clean up stack cruft + 3 spaces \ Erase the twiddle + 10 emit \ Echo new line exit - then - - \ If not Backspace or Enter, store the character - dup bs_key <> if ( and ) dup enter_key <> if - - \ store the character in our buffer - dup readval readlen @ 1- + c! - - then then + else dup ctrl_u = if + 3 spaces read-start @ 25 at-xy \ Erase the twiddle + 0 readlen ! \ Reset input to NULL + else dup bs_key = if + readlen @ 1 - dup readlen ! \ Decrement input length + dup 0< if drop 0 dup readlen ! then \ Don't go negative + 0= if 3 spaces read-start @ 25 at-xy then \ Twiddle + else dup \ Store the character + \ NB: sgetkey prevents overflow by way of blocking + \ at readmax except for Backspace or Enter + readlen @ 1+ dup readlen ! 1- readval + c! + then then then drop \ last key pressed again \ Enter was not pressed; repeat From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 17:31:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1845134; Mon, 23 Mar 2015 17: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 8CBC9F34; Mon, 23 Mar 2015 17:31:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NHVNuT095662; Mon, 23 Mar 2015 17:31:23 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NHVNNB095661; Mon, 23 Mar 2015 17:31:23 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503231731.t2NHVNNB095661@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 23 Mar 2015 17:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280385 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 17:31:23 -0000 Author: dteske Date: Mon Mar 23 17:31:22 2015 New Revision: 280385 URL: https://svnweb.freebsd.org/changeset/base/280385 Log: Add missing variables password/bootlock_password. NB: Using NULL for default values in-case someone or something uncomments it and reboots. See check-password.4th(8) for additional details. MFC after: 3 days X-MFC-to: stable/10 stable/9 Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Mon Mar 23 16:43:46 2015 (r280384) +++ head/sys/boot/forth/loader.conf Mon Mar 23 17:31:22 2015 (r280385) @@ -60,6 +60,8 @@ entropy_cache_type="/boot/entropy" # allowed to interrupt autoboot process and # escape to the loader prompt, set to # "NO" to disable autobooting +#password="" # Prevent changes to boot options +#bootlock_password="" # Prevent booting (see check-password.4th(8)) #beastie_disable="NO" # Turn the beastie boot menu on and off #kernels="kernel kernel.old" # Kernels to display in the boot menu #loader_logo="orbbw" # Desired logo: orbbw, orb, fbsdbw, beastiebw, beastie, none From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 17:35:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7295F2EB; Mon, 23 Mar 2015 17: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 5D930F71; Mon, 23 Mar 2015 17:35:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NHZ7T6099119; Mon, 23 Mar 2015 17:35:07 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NHZ6E0099116; Mon, 23 Mar 2015 17:35:06 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201503231735.t2NHZ6E0099116@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 23 Mar 2015 17:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280386 - in head/bin: cp 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-1 Precedence: list List-Id: SVN 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 Mar 2015 17:35:07 -0000 Author: jilles Date: Mon Mar 23 17:35:05 2015 New Revision: 280386 URL: https://svnweb.freebsd.org/changeset/base/280386 Log: cp,mv: Use futimens() instead of utimensat() if possible. Modified: head/bin/cp/utils.c head/bin/mv/mv.c Modified: head/bin/cp/utils.c ============================================================================== --- head/bin/cp/utils.c Mon Mar 23 17:31:22 2015 (r280385) +++ head/bin/cp/utils.c Mon Mar 23 17:35:05 2015 (r280386) @@ -342,7 +342,7 @@ setfile(struct stat *fs, int fd) tspec[0] = fs->st_atim; tspec[1] = fs->st_mtim; - if (utimensat(AT_FDCWD, to.p_path, tspec, + if (fdval ? futimens(fd, tspec) : utimensat(AT_FDCWD, to.p_path, tspec, islink ? AT_SYMLINK_NOFOLLOW : 0)) { warn("utimensat: %s", to.p_path); rval = 1; Modified: head/bin/mv/mv.c ============================================================================== --- head/bin/mv/mv.c Mon Mar 23 17:31:22 2015 (r280385) +++ head/bin/mv/mv.c Mon Mar 23 17:35:05 2015 (r280386) @@ -352,7 +352,7 @@ err: if (unlink(to)) ts[0] = sbp->st_atim; ts[1] = sbp->st_mtim; - if (utimensat(AT_FDCWD, to, ts, 0)) + if (futimens(to_fd, ts)) warn("%s: set times", to); if (close(to_fd)) { From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 18:09:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 109B4E86; Mon, 23 Mar 2015 18:09:17 +0000 (UTC) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 9F31E1A84; Mon, 23 Mar 2015 18:09:16 +0000 (UTC) Message-ID: <551056CC.10903@FreeBSD.org> Date: Mon, 23 Mar 2015 14:09:16 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "Philip M. Gollucci" Subject: Re: svn commit: r280306 - in head: secure/lib/libcrypto secure/lib/libssl sys/sys References: <201503202348.t2KNmCM0033402@svn.freebsd.org> In-Reply-To: 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-1 Precedence: list List-Id: SVN 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 Mar 2015 18:09:17 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 03/23/2015 11:35, Philip M. Gollucci wrote: > What about SSLv3 due to POODLE ? IMHO, it is too early to remove SSLv3 support because it is still widely used although there are known vulnerabilities. Please use OpenSSL from ports, i.e., security/openssl, i.e., turn off both SSL2 and SSL3 options and compile all ports with it. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVEFbGAAoJEHyflib82/FGtH0H/jEr8VI2EIh4T0qmOyaXbwEg Aqz6sIO1AJe/PultpqEMSUWPKofHNH4YstOcaHQ421g22tcGjK3VgwhzSG97IPjH vlSY3451DDw0FzQVD20N3c8B0tjnrM2QD9K+wULvE74W9Yu6woSgQN/kLqhGnuss qPM3MemKNYq5euGnWVzXaY+IuDHFf8CFKanpymVFc378rV/M4tgXJbesNOX9Koiv VC7tvfn7slsr/bHSqC6zdDNk5BkL3iaNGceHweMeIQ8HeTtglESVjjOnBMayxsYS YKapEONNnhVh+Waq2jH0JylDIfotWMylvxFRLlW99oSPnvVHOMhsr+gEh6LxZGQ= =a8q9 -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 18:45:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B384DE5B; Mon, 23 Mar 2015 18: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 9C9E5A37; Mon, 23 Mar 2015 18:45:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NIjW6V032789; Mon, 23 Mar 2015 18:45:32 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NIjUuK032777; Mon, 23 Mar 2015 18:45:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503231845.t2NIjUuK032777@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 23 Mar 2015 18:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280387 - in head/usr.bin/xlint: arch/sparc64 common lint1 lint2 xlint X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 18:45:32 -0000 Author: pfg Date: Mon Mar 23 18:45:29 2015 New Revision: 280387 URL: https://svnweb.freebsd.org/changeset/base/280387 Log: xlint: update. Bring some important updates from NetBSD up to about 2008/04/25. The main feature is initial support for C99. This is a very basic update to make it easier to merge new compiler attirbutes but more updates are likely to follow. Obtained from: NetBSD MFC after: 2 weeks Modified: head/usr.bin/xlint/arch/sparc64/targparam.h head/usr.bin/xlint/common/lint.h head/usr.bin/xlint/common/mem.c head/usr.bin/xlint/lint1/cgram.y head/usr.bin/xlint/lint1/decl.c head/usr.bin/xlint/lint1/emit1.c head/usr.bin/xlint/lint1/err.c head/usr.bin/xlint/lint1/externs1.h head/usr.bin/xlint/lint1/func.c head/usr.bin/xlint/lint1/init.c head/usr.bin/xlint/lint1/lint1.h head/usr.bin/xlint/lint1/main1.c head/usr.bin/xlint/lint1/makeman head/usr.bin/xlint/lint1/scan.l head/usr.bin/xlint/lint1/tree.c head/usr.bin/xlint/lint2/read.c head/usr.bin/xlint/xlint/lint.1 head/usr.bin/xlint/xlint/xlint.c Modified: head/usr.bin/xlint/arch/sparc64/targparam.h ============================================================================== --- head/usr.bin/xlint/arch/sparc64/targparam.h Mon Mar 23 17:35:05 2015 (r280386) +++ head/usr.bin/xlint/arch/sparc64/targparam.h Mon Mar 23 18:45:29 2015 (r280387) @@ -1,4 +1,4 @@ -/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:55:00 thorpej Exp $ */ +/* $NetBSD: targparam.h,v 1.3 2002/01/31 23:31:34 he Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -29,6 +29,8 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (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/usr.bin/xlint/common/lint.h ============================================================================== --- head/usr.bin/xlint/common/lint.h Mon Mar 23 17:35:05 2015 (r280386) +++ head/usr.bin/xlint/common/lint.h Mon Mar 23 18:45:29 2015 (r280387) @@ -1,4 +1,4 @@ -/* $NetBSD: lint.h,v 1.5 2002/03/07 18:29:56 tv Exp $ */ +/* $NetBSD: lint.h,v 1.7 2003/10/27 00:12:44 lukem Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -29,6 +29,8 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (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$ */ #if HAVE_CONFIG_H @@ -90,7 +92,7 @@ typedef struct { u_int tt_isftyp : 1; /* 1 if floating point type */ u_int tt_isatyp : 1; /* 1 if arithmetic type */ u_int tt_issclt : 1; /* 1 if scalar type */ - char *tt_name; /* Bezeichnung des Typs */ + const char *tt_name; /* Bezeichnung des Typs */ } ttab_t; #define size(t) (ttab[t].tt_sz) Modified: head/usr.bin/xlint/common/mem.c ============================================================================== --- head/usr.bin/xlint/common/mem.c Mon Mar 23 17:35:05 2015 (r280386) +++ head/usr.bin/xlint/common/mem.c Mon Mar 23 18:45:29 2015 (r280387) @@ -1,4 +1,4 @@ -/* $NetBSD: mem.c,v 1.2 2002/01/21 19:49:51 tv Exp $ */ +/* $NetBSD: mem.c,v 1.4 2003/10/16 06:35:26 itojun Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -33,8 +33,9 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: mem.c,v 1.2 2002/01/21 19:49:51 tv Exp $"); +__RCSID("$NetBSD: mem.c,v 1.4 2003/10/16 06:35:26 itojun Exp $"); #endif +__FBSDID("$FreeBSD$"); #include #include @@ -64,9 +65,13 @@ xcalloc(size_t n, size_t s) void * xrealloc(void *p, size_t s) { + void *n; - if ((p = realloc(p, s)) == NULL) + if ((n = realloc(p, s)) == NULL) { + free(p); nomem(); + } + p = n; return (p); } Modified: head/usr.bin/xlint/lint1/cgram.y ============================================================================== --- head/usr.bin/xlint/lint1/cgram.y Mon Mar 23 17:35:05 2015 (r280386) +++ head/usr.bin/xlint/lint1/cgram.y Mon Mar 23 18:45:29 2015 (r280387) @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.23 2002/01/31 19:36:53 tv Exp $ */ +/* $NetBSD: cgram.y,v 1.40 2008/04/25 17:18:24 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.23 2002/01/31 19:36:53 tv Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.40 2008/04/25 17:18:24 christos Exp $"); #endif __FBSDID("$FreeBSD$"); @@ -65,13 +65,13 @@ int mblklev; */ static int onowarn = -1; -static int toicon(tnode_t *); +static int toicon(tnode_t *, int); static void idecl(sym_t *, int, sbuf_t *); static void ignuptorp(void); #ifdef DEBUG -static __inline void CLRWFLGS(void); -static __inline void CLRWFLGS(void) +static inline void CLRWFLGS(void); +static inline void CLRWFLGS(void) { printf("%s, %d: clear flags %s %d\n", curr_pos.p_file, curr_pos.p_line, __FILE__, __LINE__); @@ -79,8 +79,8 @@ static __inline void CLRWFLGS(void) onowarn = -1; } -static __inline void SAVE(void); -static __inline void SAVE(void) +static inline void SAVE(void); +static inline void SAVE(void) { if (onowarn != -1) abort(); @@ -89,8 +89,8 @@ static __inline void SAVE(void) onowarn = nowarn; } -static __inline void RESTORE(void); -static __inline void RESTORE(void) +static inline void RESTORE(void); +static inline void RESTORE(void) { if (onowarn != -1) { nowarn = onowarn; @@ -107,6 +107,8 @@ static __inline void RESTORE(void) #endif %} +%expect 1 + %union { int y_int; val_t *y_val; @@ -118,6 +120,7 @@ static __inline void RESTORE(void) tqual_t y_tqual; type_t *y_type; tnode_t *y_tnode; + range_t y_range; strg_t *y_strg; pqinf_t *y_pqinf; }; @@ -243,6 +246,8 @@ static __inline void RESTORE(void) %type parameter_type_list %type parameter_declaration %type expr +%type expr_stmnt_val +%type expr_stmnt_list %type term %type func_arg_list %type point_or_arrow @@ -253,6 +258,8 @@ static __inline void RESTORE(void) %type string %type string2 %type opt_asm_or_symbolrename +%type range +%type lorange %% @@ -682,12 +689,12 @@ notype_member_decl: $$ = $1; } | notype_decl T_COLON constant { - $$ = bitfield($1, toicon($3)); + $$ = bitfield($1, toicon($3, 1)); } | { symtyp = FVFT; } T_COLON constant { - $$ = bitfield(NULL, toicon($3)); + $$ = bitfield(NULL, toicon($3, 1)); } ; @@ -696,12 +703,12 @@ type_member_decl: $$ = $1; } | type_decl T_COLON constant { - $$ = bitfield($1, toicon($3)); + $$ = bitfield($1, toicon($3, 1)); } | { symtyp = FVFT; } T_COLON constant { - $$ = bitfield(NULL, toicon($3)); + $$ = bitfield(NULL, toicon($3, 1)); } ; @@ -784,7 +791,7 @@ enumerator: $$ = ename($1, enumval, 1); } | ename T_ASSIGN constant { - $$ = ename($1, toicon($3), 0); + $$ = ename($1, toicon($3, 1), 0); } ; @@ -849,7 +856,7 @@ notype_direct_decl: $$ = addarray($1, 0, 0); } | notype_direct_decl T_LBRACK constant T_RBRACK { - $$ = addarray($1, 1, toicon($3)); + $$ = addarray($1, 1, toicon($3, 0)); } | notype_direct_decl param_list { $$ = addfunc($1, $2); @@ -878,7 +885,7 @@ type_direct_decl: $$ = addarray($1, 0, 0); } | type_direct_decl T_LBRACK constant T_RBRACK { - $$ = addarray($1, 1, toicon($3)); + $$ = addarray($1, 1, toicon($3, 0)); } | type_direct_decl param_list { $$ = addfunc($1, $2); @@ -914,7 +921,7 @@ direct_param_decl: $$ = addarray($1, 0, 0); } | direct_param_decl T_LBRACK constant T_RBRACK { - $$ = addarray($1, 1, toicon($3)); + $$ = addarray($1, 1, toicon($3, 0)); } | direct_param_decl param_list { $$ = addfunc($1, $2); @@ -943,7 +950,7 @@ direct_notype_param_decl: $$ = addarray($1, 0, 0); } | direct_notype_param_decl T_LBRACK constant T_RBRACK { - $$ = addarray($1, 1, toicon($3)); + $$ = addarray($1, 1, toicon($3, 0)); } | direct_notype_param_decl param_list { $$ = addfunc($1, $2); @@ -1121,6 +1128,7 @@ init_expr: expr %prec T_COMMA { mkinit($1); } + | init_by_name init_expr %prec T_COMMA | init_lbrace init_expr_list init_rbrace | init_lbrace init_expr_list T_COMMA init_rbrace | error @@ -1131,6 +1139,38 @@ init_expr_list: | init_expr_list T_COMMA init_expr ; +lorange: + constant T_ELLIPSE { + $$.lo = toicon($1, 1); + } + ; +range: + constant { + $$.lo = toicon($1, 1); + $$.hi = $$.lo + 1; + } + | lorange constant { + $$.lo = $1.lo; + $$.hi = toicon($2, 1); + } + ; + +init_by_name: + T_LBRACK range T_RBRACK T_ASSIGN { + if (!Sflag) + warning(321); + } + | point identifier T_ASSIGN { + if (!Sflag) + warning(313); + memberpush($2); + } + | identifier T_COLON { + gnuism(315); + memberpush($1); + } + ; + init_lbrace: T_LBRACE { initlbr(); @@ -1187,13 +1227,13 @@ direct_abs_decl: $$ = addarray(aname(), 0, 0); } | T_LBRACK constant T_RBRACK { - $$ = addarray(aname(), 1, toicon($2)); + $$ = addarray(aname(), 1, toicon($2, 0)); } | direct_abs_decl T_LBRACK T_RBRACK { $$ = addarray($1, 0, 0); } | direct_abs_decl T_LBRACK constant T_RBRACK { - $$ = addarray($1, 1, toicon($3)); + $$ = addarray($1, 1, toicon($3, 0)); } | abs_decl_param_list { $$ = addfunc(aname(), $1); @@ -1207,9 +1247,8 @@ direct_abs_decl: } ; -stmnt: +non_expr_stmnt: labeled_stmnt - | expr_stmnt | comp_stmnt | selection_stmnt | iteration_stmnt @@ -1217,6 +1256,10 @@ stmnt: ftflg = 0; } | asm_stmnt + +stmnt: + expr_stmnt + | non_expr_stmnt ; labeled_stmnt: @@ -1231,7 +1274,12 @@ label: | T_CASE constant T_COLON { label(T_CASE, NULL, $2); ftflg = 1; - } + } + | T_CASE constant T_ELLIPSE constant T_COLON { + /* XXX: We don't fill all cases */ + label(T_CASE, NULL, $2); + ftflg = 1; + } | T_DEFAULT T_COLON { label(T_DEFAULT, NULL, NULL); ftflg = 1; @@ -1239,11 +1287,11 @@ label: ; comp_stmnt: - compstmnt_lbrace declaration_list opt_stmnt_list compstmnt_rbrace - | compstmnt_lbrace opt_stmnt_list compstmnt_rbrace + comp_stmnt_lbrace declaration_list opt_stmnt_list comp_stmnt_rbrace + | comp_stmnt_lbrace opt_stmnt_list comp_stmnt_rbrace ; -compstmnt_lbrace: +comp_stmnt_lbrace: T_LBRACE { blklev++; mblklev++; @@ -1251,7 +1299,7 @@ compstmnt_lbrace: } ; -compstmnt_rbrace: +comp_stmnt_rbrace: T_RBRACE { popdecl(); freeblk(); @@ -1276,7 +1324,7 @@ stmnt_list: expr_stmnt: expr T_SEMI { - expr($1, 0, 0); + expr($1, 0, 0, 1); ftflg = 0; } | T_SEMI { @@ -1284,6 +1332,34 @@ expr_stmnt: } ; +/* + * The following two productions are used to implement + * ({ [[decl-list] stmt-list] }). + * XXX: This is not well tested. + */ +expr_stmnt_val: + expr T_SEMI { + /* XXX: We should really do that only on the last name */ + if ($1->tn_op == NAME) + $1->tn_sym->s_used = 1; + $$ = $1; + expr($1, 0, 0, 0); + ftflg = 0; + } + | non_expr_stmnt { + $$ = getnode(); + $$->tn_type = gettyp(VOID); + } + ; + +expr_stmnt_list: + expr_stmnt_val + | expr_stmnt_list expr_stmnt_val { + $$ = $2; + } + | expr_stmnt_list expr_stmnt_val + ; + selection_stmnt: if_without_else { SAVE(); @@ -1525,6 +1601,26 @@ term: $2->tn_parn = 1; $$ = $2; } + | T_LPARN comp_stmnt_lbrace declaration_list expr_stmnt_list { + blklev--; + mblklev--; + initsym = mktempsym(duptyp($4->tn_type)); + mblklev++; + blklev++; + gnuism(320); + } comp_stmnt_rbrace T_RPARN { + $$ = getnnode(initsym, 0); + } + | T_LPARN comp_stmnt_lbrace expr_stmnt_list { + blklev--; + mblklev--; + initsym = mktempsym($3->tn_type); + mblklev++; + blklev++; + gnuism(320); + } comp_stmnt_rbrace T_RPARN { + $$ = getnnode(initsym, 0); + } | term T_INCDEC { $$ = build($2 == INC ? INCAFT : DECAFT, $1, NULL); } @@ -1580,6 +1676,14 @@ term: | T_LPARN type_name T_RPARN term %prec T_UNOP { $$ = cast($4, $2); } + | T_LPARN type_name T_RPARN %prec T_UNOP { + sym_t *tmp = mktempsym($2); + idecl(tmp, 1, NULL); + } init_lbrace init_expr_list init_rbrace { + if (!Sflag) + gnuism(319); + $$ = getnnode(initsym, 0); + } ; string: @@ -1620,6 +1724,13 @@ point_or_arrow: } ; +point: + T_STROP { + if ($1 != POINT) + error(249); + } + ; + identifier: T_NAME { $$ = $1; @@ -1635,7 +1746,6 @@ identifier: int yyerror(char *msg) { - error(249); if (++sytxerr >= 5) norecover(); @@ -1670,13 +1780,13 @@ q_gt(int64_t a, int64_t b) * expressions, it frees the memory used for the expression. */ static int -toicon(tnode_t *tn) +toicon(tnode_t *tn, int required) { int i; tspec_t t; val_t *v; - v = constant(tn); + v = constant(tn, required); /* * Abstract declarations are used inside expression. To free @@ -1721,7 +1831,7 @@ idecl(sym_t *decl, int initflg, sbuf_t * case EXTERN: if (rename != NULL) { if (decl->s_rename != NULL) - lerror("idecl() 1"); + LERROR("idecl()"); s = getlblk(1, rename->sb_len + 1); (void)memcpy(s, rename->sb_name, rename->sb_len + 1); @@ -1749,7 +1859,7 @@ idecl(sym_t *decl, int initflg, sbuf_t * decl1loc(decl, initflg); break; default: - lerror("idecl() 2"); + LERROR("idecl()"); } if (initflg && !initerr) Modified: head/usr.bin/xlint/lint1/decl.c ============================================================================== --- head/usr.bin/xlint/lint1/decl.c Mon Mar 23 17:35:05 2015 (r280386) +++ head/usr.bin/xlint/lint1/decl.c Mon Mar 23 18:45:29 2015 (r280387) @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.29 2002/01/18 21:01:39 thorpej Exp $ */ +/* $NetBSD: decl.c,v 1.33 2004/06/20 22:20:16 jmc Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -34,7 +34,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.29 2002/01/18 21:01:39 thorpej Exp $"); +__RCSID("$NetBSD: decl.c,v 1.33 2004/06/20 22:20:16 jmc Exp $"); #endif __FBSDID("$FreeBSD$"); @@ -197,7 +197,7 @@ setcompl(type_t *tp, int ic) tp->t_str->sincompl = ic; } else { if (t != ENUM) - lerror("setcompl() 1"); + LERROR("setcompl()"); tp->t_enum->eincompl = ic; } } @@ -256,7 +256,7 @@ addtype(type_t *tp) * something like "typedef int a; int a b;" * This should not happen with current grammar. */ - lerror("addtype()"); + LERROR("addtype()"); } dcs->d_type = tp; return; @@ -297,7 +297,7 @@ addtype(type_t *tp) dcs->d_lmod = NOTSPEC; if (!quadflg) /* %s C does not support 'long long' */ - (void)gnuism(265, tflag ? "traditional" : "ANSI"); + (void)c99ism(265, tflag ? "traditional" : "c89"); } if (dcs->d_type != NULL && dcs->d_type->t_typedef) { @@ -466,7 +466,7 @@ addqual(tqual_t q) dcs->d_const = 1; } else { if (q != VOLATILE) - lerror("addqual() 1"); + LERROR("addqual()"); if (dcs->d_volatile) { /* duplicate "%s" */ warning(10, "volatile"); @@ -508,13 +508,13 @@ popdecl(void) (void)printf("popdecl(%d)\n", (int)dcs->d_ctx); if (dcs->d_nxt == NULL) - lerror("popdecl() 1"); + LERROR("popdecl()"); di = dcs; dcs = di->d_nxt; switch (di->d_ctx) { case EXTERN: /* there is nothing after external declarations */ - lerror("popdecl() 2"); + LERROR("popdecl()"); /* NOTREACHED */ case MOS: case MOU: @@ -562,7 +562,7 @@ popdecl(void) rmsyms(di->d_dlsyms); break; default: - lerror("popdecl() 3"); + LERROR("popdecl()"); } free(di); } @@ -635,7 +635,7 @@ deftyp(void) if (tp != NULL && (t != NOTSPEC || s != NOTSPEC || l != NOTSPEC)) { /* should never happen */ - lerror("deftyp() 1"); + LERROR("deftyp()"); } if (tp == NULL) { @@ -674,7 +674,7 @@ deftyp(void) case VOID: break; default: - lerror("deftyp() 2"); + LERROR("deftyp()"); } if (t != INT && t != CHAR && (s != NOTSPEC || l != NOTSPEC)) { dcs->d_terr = 1; @@ -712,13 +712,13 @@ deftyp(void) if (dcs->d_const && dcs->d_type->t_const) { if (!dcs->d_type->t_typedef) - lerror("deftyp() 3"); + LERROR("deftyp()"); /* typedef already qualified with "%s" */ warning(68, "const"); } if (dcs->d_volatile && dcs->d_type->t_volatile) { if (!dcs->d_type->t_typedef) - lerror("deftyp() 4"); + LERROR("deftyp()"); /* typedef already qualified with "%s" */ warning(68, "volatile"); } @@ -777,7 +777,7 @@ length(type_t *tp, const char *name) switch (tp->t_tspec) { case FUNC: /* compiler takes size of function */ - lerror("%s", msgs[12]); + LERROR("%s", msgs[12]); /* NOTREACHED */ case STRUCT: case UNION: @@ -796,7 +796,7 @@ length(type_t *tp, const char *name) default: elsz = size(tp->t_tspec); if (elsz <= 0) - lerror("length()"); + LERROR("length()"); break; } return (elem * elsz); @@ -831,7 +831,7 @@ getbound(type_t *tp) } } if (a < CHAR_BIT || a > LINT_ALIGN(1) * CHAR_BIT) - lerror("getbound() 1"); + LERROR("getbound()"); return (a); } @@ -925,7 +925,7 @@ chktyp(sym_t *sym) if (dcs->d_ctx == PARG) { if (sym->s_scl != ABSTRACT) { if (sym->s_name == unnamed) - lerror("chktyp()"); + LERROR("chktyp()"); /* void param cannot have name: %s */ error(61, sym->s_name); *tpp = gettyp(INT); @@ -963,12 +963,12 @@ decl1str(sym_t *dsym) scl_t sc; if ((sc = dsym->s_scl) != MOS && sc != MOU) - lerror("decl1str() 1"); + LERROR("decl1str()"); if (dcs->d_rdcsym != NULL) { if ((sc = dcs->d_rdcsym->s_scl) != MOS && sc != MOU) /* should be ensured by storesym() */ - lerror("decl1str() 2"); + LERROR("decl1str()"); if (dsym->s_styp == dcs->d_rdcsym->s_styp) { /* duplicate member name: %s */ error(33, dsym->s_name); @@ -991,11 +991,13 @@ decl1str(sym_t *dsym) t == SHORT || t == USHORT || t == ENUM) { if (bitfieldtype_ok == 0) { if (sflag) { + char buf[64]; /* * bit-field type '%s' invalid in * ANSI C */ - warning(273, tyname(tp)); + warning(273, + tyname(buf, sizeof(buf), tp)); } else if (pflag) { /* nonportable bit-field type */ warning(34); @@ -1051,7 +1053,7 @@ decl1str(sym_t *dsym) if ((sz = length(dsym->s_type, dsym->s_name)) == 0) { if (t == ARRAY && dsym->s_type->t_dim == 0) { /* illegal zero sized structure member: %s */ - warning(39, dsym->s_name); + c99ism(39, dsym->s_name); } } @@ -1221,12 +1223,12 @@ addarray(sym_t *decl, int dim, int n) tp->t_dim = n; if (n < 0) { - /* zero or negative array dimension */ - error(20); + /* negative array dimension */ + error(20, n); n = 0; } else if (n == 0 && dim) { - /* zero or negative array dimension */ - warning(20); + /* zero array dimension */ + c99ism(322, dim); } else if (n == 0 && !dim) { /* is incomplete type */ setcompl(tp, 1); @@ -1417,7 +1419,7 @@ dname(sym_t *sym) } else if (sc == EXTERN) { sym->s_def = DECL; } else { - lerror("dname() 1"); + LERROR("dname()"); } break; case PARG: @@ -1430,7 +1432,7 @@ dname(sym_t *sym) sym->s_reg = 1; sc = AUTO; } else { - lerror("dname() 2"); + LERROR("dname()"); } sym->s_def = DEF; break; @@ -1453,11 +1455,11 @@ dname(sym_t *sym) } else if (sc == EXTERN) { sym->s_def = DECL; } else { - lerror("dname() 3"); + LERROR("dname()"); } break; default: - lerror("dname() 4"); + LERROR("dname()"); } sym->s_scl = sc; @@ -1481,7 +1483,7 @@ iname(sym_t *sym) /* redeclaration of formal parameter %s */ error(21, sym->s_name); if (!sym->s_defarg) - lerror("iname()"); + LERROR("iname()"); } sym = pushdown(sym); } @@ -1514,7 +1516,7 @@ mktag(sym_t *tag, tspec_t kind, int decl } else if (kind == ENUM) { scl = ENUMTAG; } else { - lerror("mktag()"); + LERROR("mktag()"); } if (tag != NULL) { @@ -1636,7 +1638,7 @@ scltoa(scl_t sc) case STRTAG: s = "struct"; break; case UNIONTAG: s = "union"; break; case ENUMTAG: s = "enum"; break; - default: lerror("tagttoa()"); + default: LERROR("tagttoa()"); } return (s); } @@ -1664,7 +1666,7 @@ compltag(type_t *tp, sym_t *fmem) sp->memb = fmem; if (sp->size == 0) { /* zero sized %s */ - (void)gnuism(47, ttab[t].tt_name); + (void)c99ism(47, ttab[t].tt_name); } else { n = 0; for (mem = fmem; mem != NULL; mem = mem->s_nxt) { @@ -2143,7 +2145,7 @@ compltyp(sym_t *dsym, sym_t *ssym) while ((dst = *dstp) != NULL) { if (src == NULL || dst->t_tspec != src->t_tspec) - lerror("compltyp() 1"); + LERROR("compltyp()"); if (dst->t_tspec == ARRAY) { if (dst->t_dim == 0 && src->t_dim != 0) { *dstp = dst = duptyp(dst); @@ -2472,7 +2474,7 @@ decl1loc(sym_t *dsym, int initflg) */ break; default: - lerror("decl1loc() 1"); + LERROR("decl1loc()"); } } else if (dcs->d_rdcsym->s_blklev == blklev) { @@ -2621,7 +2623,7 @@ aname(void) sym_t *sym; if (dcs->d_ctx != ABSTRACT && dcs->d_ctx != PARG) - lerror("aname()"); + LERROR("aname()"); sym = getblk(sizeof (sym_t)); @@ -2791,7 +2793,7 @@ chkausg(int novar, sym_t *arg) { if (!arg->s_set) - lerror("chkausg() 1"); + LERROR("chkausg()"); if (novar) return; @@ -2810,7 +2812,7 @@ chkvusg(int novar, sym_t *sym) sym_t *xsym; if (blklev == 0 || sym->s_blklev == 0) - lerror("chkvusg() 1"); + LERROR("chkvusg()"); /* errors in expressions easily cause lots of these warnings */ if (nerr != 0) @@ -2875,7 +2877,7 @@ chklusg(sym_t *lab) { if (blklev != 1 || lab->s_blklev != 1) - lerror("chklusg() 1"); + LERROR("chklusg()"); if (lab->s_set && !lab->s_used) { STRUCT_ASSIGN(curr_pos, lab->s_spos); @@ -2914,7 +2916,7 @@ chktusg(sym_t *sym) warning(235, sym->s_name); break; default: - lerror("chktusg() 1"); + LERROR("chktusg()"); } } @@ -2946,7 +2948,7 @@ chkglsyms(void) chktusg(sym); } else { if (sym->s_kind != FMOS) - lerror("chkglsyms() 1"); + LERROR("chkglsyms()"); } } @@ -2961,7 +2963,7 @@ chkglvar(sym_t *sym) return; if (sym->s_scl != EXTERN && sym->s_scl != STATIC) - lerror("chkglvar() 1"); + LERROR("chkglvar()"); glchksz(sym); Modified: head/usr.bin/xlint/lint1/emit1.c ============================================================================== --- head/usr.bin/xlint/lint1/emit1.c Mon Mar 23 17:35:05 2015 (r280386) +++ head/usr.bin/xlint/lint1/emit1.c Mon Mar 23 18:45:29 2015 (r280387) @@ -1,4 +1,4 @@ -/* $NetBSD: emit1.c,v 1.11 2002/01/31 19:36:54 tv Exp $ */ +/* $NetBSD: emit1.c,v 1.14 2004/06/20 22:20:16 jmc Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -34,7 +34,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: emit1.c,v 1.11 2002/01/31 19:36:54 tv Exp $"); +__RCSID("$NetBSD: emit1.c,v 1.14 2004/06/20 22:20:16 jmc Exp $"); #endif __FBSDID("$FreeBSD$"); @@ -117,7 +117,7 @@ outtype(type_t *tp) case STRUCT: t = 'T'; s = 's'; break; case UNION: t = 'T'; s = 'u'; break; default: - lerror("outtyp() 1"); + LERROR("outtyp()"); } if (tp->t_const) outchar('c'); @@ -257,7 +257,7 @@ outsym(sym_t *sym, scl_t sc, def_t def) outchar('e'); break; default: - lerror("outsym() 2"); + LERROR("outsym()"); } if (llibflg && def != DECL) { /* @@ -485,7 +485,7 @@ outfstrg(strg_t *strg) u_char *cp; if (strg->st_tspec != CHAR) - lerror("outfstrg() 1"); + LERROR("outfstrg()"); cp = strg->st_cp; Modified: head/usr.bin/xlint/lint1/err.c ============================================================================== --- head/usr.bin/xlint/lint1/err.c Mon Mar 23 17:35:05 2015 (r280386) +++ head/usr.bin/xlint/lint1/err.c Mon Mar 23 18:45:29 2015 (r280387) @@ -1,4 +1,4 @@ -/* $NetBSD: err.c,v 1.17 2002/01/31 19:36:54 tv Exp $ */ +/* $NetBSD: err.c,v 1.40 2009/04/15 01:20:57 christos Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -33,7 +33,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: err.c,v 1.17 2002/01/31 19:36:54 tv Exp $"); +__RCSID("$NetBSD: err.c,v 1.40 2009/04/15 01:20:57 christos Exp $"); #endif __FBSDID("$FreeBSD$"); @@ -76,7 +76,7 @@ const char *msgs[] = { "null dimension", /* 17 */ "illegal use of 'void'", /* 18 */ "void type for %s", /* 19 */ - "zero or negative array dimension", /* 20 */ + "negative array dimension (%d)", /* 20 */ "redeclaration of formal parameter %s", /* 21 */ "incomplete or misplaced function definition", /* 22 */ "undefined label %s", /* 23 */ @@ -95,7 +95,7 @@ const char *msgs[] = { "illegal bit-field size", /* 36 */ "zero size bit-field", /* 37 */ "function illegal in structure or union", /* 38 */ - "illegal zero sized structure member: %s", /* 39 */ + "zero sized array in struct is a C99 extension: %s", /* 39 */ "unknown size: %s", /* 40 */ "illegal use of bit-field", /* 41 */ "forward reference to enum type", /* 42 */ @@ -103,7 +103,7 @@ const char *msgs[] = { "declaration introduces new type in ANSI C: %s %s", /* 44 */ "base type is really '%s %s'", /* 45 */ "(%s) tag redeclared", /* 46 */ - "zero sized %s", /* 47 */ + "zero sized %s is a C9X feature", /* 47 */ "overflow in enumeration values: %s", /* 48 */ "struct or union member must be named", /* 49 */ "a function is declared as an argument: %s", /* 50 */ @@ -188,7 +188,7 @@ const char *msgs[] = { "expression has null effect", /* 129 */ "enum type mismatch, op %s", /* 130 */ "conversion to '%s' may sign-extend incorrectly", /* 131 */ - "conversion from '%s' may lose accuracy", /* 132 */ + "conversion from '%s' to '%s' may lose accuracy", /* 132 */ "conversion of pointer to '%s' loses bits", /* 133 */ "conversion of pointer to '%s' may lose bits", /* 134 */ "possible pointer alignment problem", /* 135 */ @@ -232,7 +232,7 @@ const char *msgs[] = { "too many array initializers", /* 173 */ "too many initializers", /* 174 */ "initialisation of an incomplete type", /* 175 */ - "invalid initializer", /* 176 */ + "invalid initializer type %s", /* 176 */ "non-constant initializer", /* 177 */ "initializer does not fit", /* 178 */ "cannot initialize struct/union with no named member", /* 179 */ @@ -354,7 +354,7 @@ const char *msgs[] = { "conversion of '%s' to '%s' is out of range, arg #%d", /* 295 */ "conversion of negative constant to unsigned type, arg #%d", /* 296 */ "conversion to '%s' may sign-extend incorrectly, arg #%d", /* 297 */ - "conversion from '%s' may lose accuracy, arg #%d", /* 298 */ + "conversion from '%s' to '%s' may lose accuracy, arg #%d", /* 298 */ "prototype does not match old style definition, arg #%d", /* 299 */ "old style definition", /* 300 */ "array of incomplete type", /* 301 */ @@ -369,6 +369,16 @@ const char *msgs[] = { "symbol renaming can't be used on function arguments", /* 310 */ "symbol renaming can't be used on automatic variables", /* 311 */ "%s C does not support // comments", /* 312 */ + "struct or union member name in initializer is a C9X feature",/* 313 */ + "%s is not a structure or a union", /* 314 */ + "GCC style struct or union member name in initializer", /* 315 */ + "__FUNCTION__ is a GCC extension", /* 316 */ + "__func__ is a C9X feature", /* 317 */ + "variable array dimension is a C99/GCC extension", /* 318 */ + "compound literals are a C9X/GCC extension", /* 319 */ + "({ }) is a GCC extension", /* 320 */ + "array initializer with designators is a C9X feature", /* 321 */ + "zero sized array is a C99 extension", /* 322 */ }; /* @@ -377,10 +387,10 @@ const char *msgs[] = { void msglist(void) { - int i; + size_t i; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 18:45:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F5E6F90; Mon, 23 Mar 2015 18: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 8AC22A38; Mon, 23 Mar 2015 18:45:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NIjcBF032842; Mon, 23 Mar 2015 18:45:38 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NIjcZ0032841; Mon, 23 Mar 2015 18:45:38 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201503231845.t2NIjcZ0032841@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Mon, 23 Mar 2015 18:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280388 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 18:45:38 -0000 Author: benno Date: Mon Mar 23 18:45:37 2015 New Revision: 280388 URL: https://svnweb.freebsd.org/changeset/base/280388 Log: Be consistent with M_ZERO when allocating ccbs. There are four places, all in cam_xpt.c, where ccbs are malloc'ed. Two of these use M_ZERO, two don't. The two that don't meant that allocated ccbs had trash in them making it hard to debug errors where they showed up. Due to this, use M_ZERO all the time when allocating ccbs. Submitted by: Scott Ferris Sponsored by: EMC/Isilon Storage Division Reviewed by: scottl, imp Differential: https://reviews.freebsd.org/D2120 Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Mar 23 18:45:29 2015 (r280387) +++ head/sys/cam/cam_xpt.c Mon Mar 23 18:45:37 2015 (r280388) @@ -4523,7 +4523,7 @@ xpt_get_ccb_nowait(struct cam_periph *pe { union ccb *new_ccb; - new_ccb = malloc(sizeof(*new_ccb), M_CAMCCB, M_NOWAIT); + new_ccb = malloc(sizeof(*new_ccb), M_CAMCCB, M_ZERO|M_NOWAIT); if (new_ccb == NULL) return (NULL); periph->periph_allocated++; @@ -4537,7 +4537,7 @@ xpt_get_ccb(struct cam_periph *periph) union ccb *new_ccb; cam_periph_unlock(periph); - new_ccb = malloc(sizeof(*new_ccb), M_CAMCCB, M_WAITOK); + new_ccb = malloc(sizeof(*new_ccb), M_CAMCCB, M_ZERO|M_WAITOK); cam_periph_lock(periph); periph->periph_allocated++; cam_ccbq_take_opening(&periph->path->device->ccbq); From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 19:08:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 659D0F16 for ; Mon, 23 Mar 2015 19:08: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 C85CBD18 for ; Mon, 23 Mar 2015 19:08:54 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NJ8rXH033571 for ; Mon, 23 Mar 2015 19:08:53 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t2NJ8r9u033566 for svn-src-head@freebsd.org; Mon, 23 Mar 2015 19:08:53 GMT (envelope-from bdrewery) Received: (qmail 24706 invoked from network); 23 Mar 2015 14:08:46 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 23 Mar 2015 14:08:46 -0500 Message-ID: <551064BF.2090806@FreeBSD.org> Date: Mon, 23 Mar 2015 14:08:47 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Ports Management Team Subject: Re: svn commit: r280306 - in head: secure/lib/libcrypto secure/lib/libssl sys/sys References: <201503202348.t2KNmCM0033402@svn.freebsd.org> In-Reply-To: <201503202348.t2KNmCM0033402@svn.freebsd.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8WigA476T4NrhtQtMpagVp7NhrOfBmfGW" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 19:08:55 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8WigA476T4NrhtQtMpagVp7NhrOfBmfGW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 3/20/2015 6:48 PM, Jung-uk Kim wrote: > Author: jkim > Date: Fri Mar 20 23:48:11 2015 > New Revision: 280306 > URL: https://svnweb.freebsd.org/changeset/base/280306 >=20 > Log: > Disable insecure SSLv2 support from the base OpenSSL. > =20 > Differential Revision: https://reviews.freebsd.org/D1304 >=20 > Modified: > head/secure/lib/libcrypto/opensslconf-arm.h > head/secure/lib/libcrypto/opensslconf-mips.h > head/secure/lib/libcrypto/opensslconf-powerpc.h > head/secure/lib/libcrypto/opensslconf-sparc64.h > head/secure/lib/libcrypto/opensslconf-x86.h > head/secure/lib/libssl/Makefile > head/sys/sys/param.h >=20 Can this be backed out until a ports exp-run is done and ports are fixed? This is causing a lot of fallout. --=20 Regards, Bryan Drewery --8WigA476T4NrhtQtMpagVp7NhrOfBmfGW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJVEGS/AAoJEDXXcbtuRpfPRzMH/jgDnj6dzgo3wMgjw09qVkaK Zb7SRCXNRhrIO5jWpa2A2r8CbVHEvk7DvYWdFuZ4Z47xmsV47vPS+4X4TTYVoY36 Zd0ak3vLeUCjYKVzdfTRIj1tOvir+BjukODh1otoQkP1RArJOucILZuUsHEEUdAk metELdprLJHMCPz3LLDl4pSjsPl2QuQxwhl5VDRDPlYClkSxFJOAF2DHGSpZaSzz qKUwyiowjKmshweNdVIO0KBTbK7hbneDsOTQipqHKbZPwE5D+tWcvhGmmjXWcnUY 3vayQ720Td1MeLqs+GMJLpm0HpRSDLCduWPbfLC5fIthl/BQ8nHxzEgxWlVjgR8= =yGxw -----END PGP SIGNATURE----- --8WigA476T4NrhtQtMpagVp7NhrOfBmfGW-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 19:13:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA1412AA for ; Mon, 23 Mar 2015 19:13: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 6C591E12 for ; Mon, 23 Mar 2015 19:13:14 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NJDEvE037098 for ; Mon, 23 Mar 2015 19:13:14 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t2NJDEuR037088 for svn-src-head@freebsd.org; Mon, 23 Mar 2015 19:13:14 GMT (envelope-from bdrewery) Received: (qmail 6874 invoked from network); 23 Mar 2015 14:13:12 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 23 Mar 2015 14:13:12 -0500 Message-ID: <551065CA.9000603@FreeBSD.org> Date: Mon, 23 Mar 2015 14:13:14 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Ports Management Team Subject: Re: svn commit: r280306 - in head: secure/lib/libcrypto secure/lib/libssl sys/sys References: <201503202348.t2KNmCM0033402@svn.freebsd.org> <551064BF.2090806@FreeBSD.org> In-Reply-To: <551064BF.2090806@FreeBSD.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QoGGjJGqmiwxgixiJ1e1on4j3TpapxqU8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 19:13:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QoGGjJGqmiwxgixiJ1e1on4j3TpapxqU8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 3/23/2015 2:08 PM, Bryan Drewery wrote: > On 3/20/2015 6:48 PM, Jung-uk Kim wrote: >> Author: jkim >> Date: Fri Mar 20 23:48:11 2015 >> New Revision: 280306 >> URL: https://svnweb.freebsd.org/changeset/base/280306 >> >> Log: >> Disable insecure SSLv2 support from the base OpenSSL. >> =20 >> Differential Revision: https://reviews.freebsd.org/D1304 >> >> Modified: >> head/secure/lib/libcrypto/opensslconf-arm.h >> head/secure/lib/libcrypto/opensslconf-mips.h >> head/secure/lib/libcrypto/opensslconf-powerpc.h >> head/secure/lib/libcrypto/opensslconf-sparc64.h >> head/secure/lib/libcrypto/opensslconf-x86.h >> head/secure/lib/libssl/Makefile >> head/sys/sys/param.h >> >=20 > Can this be backed out until a ports exp-run is done and ports are > fixed? This is causing a lot of fallout. >=20 >=20 Here are the results actually: http://gohan2.ysv.freebsd.org/build.html?mastername=3Dhead-amd64-default-= baseline&build=3Dp381881_s280335 It is not that bad. --=20 Regards, Bryan Drewery --QoGGjJGqmiwxgixiJ1e1on4j3TpapxqU8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJVEGXKAAoJEDXXcbtuRpfP8EgIANUUN6pFan23x0bNg5NJaO0O Mw0XjnwdKrjhIhciDh6gpG8p9o+5ubnO59/Nwc9ALeOlDfgjzemHdMxxxXzn9FKO 7nt/22eQS+lhUWRmodsxRtwp/U2GANMzeWHZdD1mZhdwVzmw4iJK9NsGB6RjuOcL hkaqmEJXpxJsUJ42FePCjalLjggCkQOcB5xnzlqHUlQD01dZo8NLSMXiZuwlrFCV mUIZQT0g92iEQAg9wfY7Jg1q1IIsGUznOvJKnQErO1bi73HZxjpcKfYODkqCkIKn Bu9beSOa1CfNQhVHepTGxWoViDdBy9PbfjMtFn7uqYr6qa+WF89Sf1ByYlrzQT8= =qPl7 -----END PGP SIGNATURE----- --QoGGjJGqmiwxgixiJ1e1on4j3TpapxqU8-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 19:21:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 257A8770 for ; Mon, 23 Mar 2015 19:21: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 DD56DF21 for ; Mon, 23 Mar 2015 19:21:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NJLDuH040506 for ; Mon, 23 Mar 2015 19:21:13 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t2NJLDI6040503 for svn-src-head@freebsd.org; Mon, 23 Mar 2015 19:21:13 GMT (envelope-from bdrewery) Received: (qmail 61291 invoked from network); 23 Mar 2015 14:21:11 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 23 Mar 2015 14:21:11 -0500 Message-ID: <551067A9.1020406@FreeBSD.org> Date: Mon, 23 Mar 2015 14:21:13 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Ports Management Team Subject: Re: svn commit: r280306 - in head: secure/lib/libcrypto secure/lib/libssl sys/sys References: <201503202348.t2KNmCM0033402@svn.freebsd.org> <551064BF.2090806@FreeBSD.org> <551065CA.9000603@FreeBSD.org> In-Reply-To: <551065CA.9000603@FreeBSD.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xedRuUfWPFDs4oPMS2rQbjwJ0DLjlSFxr" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 19:21:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xedRuUfWPFDs4oPMS2rQbjwJ0DLjlSFxr Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 3/23/2015 2:13 PM, Bryan Drewery wrote: > On 3/23/2015 2:08 PM, Bryan Drewery wrote: >> On 3/20/2015 6:48 PM, Jung-uk Kim wrote: >>> Author: jkim >>> Date: Fri Mar 20 23:48:11 2015 >>> New Revision: 280306 >>> URL: https://svnweb.freebsd.org/changeset/base/280306 >>> >>> Log: >>> Disable insecure SSLv2 support from the base OpenSSL. >>> =20 >>> Differential Revision: https://reviews.freebsd.org/D1304 >>> >>> Modified: >>> head/secure/lib/libcrypto/opensslconf-arm.h >>> head/secure/lib/libcrypto/opensslconf-mips.h >>> head/secure/lib/libcrypto/opensslconf-powerpc.h >>> head/secure/lib/libcrypto/opensslconf-sparc64.h >>> head/secure/lib/libcrypto/opensslconf-x86.h >>> head/secure/lib/libssl/Makefile >>> head/sys/sys/param.h >>> >> >> Can this be backed out until a ports exp-run is done and ports are >> fixed? This is causing a lot of fallout. >> >> >=20 > Here are the results actually: >=20 > http://gohan2.ysv.freebsd.org/build.html?mastername=3Dhead-amd64-defaul= t-baseline&build=3Dp381881_s280335 >=20 > It is not that bad. >=20 Reminds me that I need to implement this https://lists.freebsd.org/pipermail/freebsd-current/2014-September/052187= =2Ehtml --=20 Regards, Bryan Drewery --xedRuUfWPFDs4oPMS2rQbjwJ0DLjlSFxr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJVEGepAAoJEDXXcbtuRpfPN7MH/R3b/gC1d2YHAruTVy7FqKtx Ge+X3pAHQ96PxBZR2Io8/pB3ba/UXwt8UvZ1I7tG2ux9UM2m0gBRe0fjN3Euc/z0 be326bVdE7vQZqMl6jmdBYGe/JCmpzBUQCOOWrIcK1vANu39MjI+ZTr/NOM6h+lj B9AkCS64/HSUuUQZSeZrh9J/Erh7I/+cqIVmMniZMkeNJ/Ej790GhhdbXxOFXMIm 4bNPND77uORz88IL94gZOSvbAGGmMNt8fIDKcA3o2POrhTxDrvOJx9sL/j9raof/ AI/92083PGVMu3xOkbgCsmHSH9vun6zD14ENbMyw5HG0xzYrpYe5EqgkbHZ/XiM= =rlp0 -----END PGP SIGNATURE----- --xedRuUfWPFDs4oPMS2rQbjwJ0DLjlSFxr-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 19:48:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C10FA9C0; Mon, 23 Mar 2015 19: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 AB08E243; Mon, 23 Mar 2015 19:48:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NJm5rw063728; Mon, 23 Mar 2015 19:48:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NJlrIg063643; Mon, 23 Mar 2015 19:47:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503231947.t2NJlrIg063643@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 23 Mar 2015 19:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280393 - in head/sys/dev: ahci ata ata/chipsets mvs siis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 19:48:06 -0000 Author: mav Date: Mon Mar 23 19:47:52 2015 New Revision: 280393 URL: https://svnweb.freebsd.org/changeset/base/280393 Log: Reduce priority of ATA/SATA drivers. Legacy ata(4) -> BUS_PROBE_LOW_PRIORITY; more functional ahci(4), siis(4), mvs(4) -> BUS_PROBE_DEFAULT; BUS_PROBE_VENDOR leave for vendor drivers. MFC after: 2 weeks Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci_pci.c head/sys/dev/ahci/ahciem.c head/sys/dev/ata/ata-all.c head/sys/dev/ata/chipsets/ata-acard.c head/sys/dev/ata/chipsets/ata-acerlabs.c head/sys/dev/ata/chipsets/ata-adaptec.c head/sys/dev/ata/chipsets/ata-amd.c head/sys/dev/ata/chipsets/ata-ati.c head/sys/dev/ata/chipsets/ata-cenatek.c head/sys/dev/ata/chipsets/ata-cypress.c head/sys/dev/ata/chipsets/ata-cyrix.c head/sys/dev/ata/chipsets/ata-fsl.c head/sys/dev/ata/chipsets/ata-highpoint.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ata/chipsets/ata-ite.c head/sys/dev/ata/chipsets/ata-jmicron.c head/sys/dev/ata/chipsets/ata-marvell.c head/sys/dev/ata/chipsets/ata-micron.c head/sys/dev/ata/chipsets/ata-national.c head/sys/dev/ata/chipsets/ata-netcell.c head/sys/dev/ata/chipsets/ata-nvidia.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-serverworks.c head/sys/dev/ata/chipsets/ata-siliconimage.c head/sys/dev/ata/chipsets/ata-sis.c head/sys/dev/ata/chipsets/ata-via.c head/sys/dev/mvs/mvs.c head/sys/dev/mvs/mvs_pci.c head/sys/dev/mvs/mvs_soc.c head/sys/dev/siis/siis.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ahci/ahci.c Mon Mar 23 19:47:52 2015 (r280393) @@ -638,7 +638,7 @@ ahci_ch_probe(device_t dev) { device_set_desc_copy(dev, "AHCI channel"); - return (0); + return (BUS_PROBE_DEFAULT); } static int Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ahci/ahci_pci.c Mon Mar 23 19:47:52 2015 (r280393) @@ -340,13 +340,13 @@ ahci_probe(device_t dev) snprintf(buf, sizeof(buf), "%s AHCI SATA controller", ahci_ids[i].name); device_set_desc_copy(dev, buf); - return (BUS_PROBE_VENDOR); + return (BUS_PROBE_DEFAULT); } } if (!valid) return (ENXIO); device_set_desc_copy(dev, "AHCI SATA controller"); - return (BUS_PROBE_VENDOR); + return (BUS_PROBE_DEFAULT); } static int @@ -366,11 +366,11 @@ ahci_ata_probe(device_t dev) snprintf(buf, sizeof(buf), "%s AHCI SATA controller", ahci_ids[i].name); device_set_desc_copy(dev, buf); - return (BUS_PROBE_VENDOR); + return (BUS_PROBE_DEFAULT); } } device_set_desc_copy(dev, "AHCI SATA controller"); - return (BUS_PROBE_VENDOR); + return (BUS_PROBE_DEFAULT); } static int Modified: head/sys/dev/ahci/ahciem.c ============================================================================== --- head/sys/dev/ahci/ahciem.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ahci/ahciem.c Mon Mar 23 19:47:52 2015 (r280393) @@ -65,7 +65,7 @@ ahci_em_probe(device_t dev) { device_set_desc_copy(dev, "AHCI enclosure management bridge"); - return (0); + return (BUS_PROBE_DEFAULT); } static int Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/ata-all.c Mon Mar 23 19:47:52 2015 (r280393) @@ -91,7 +91,7 @@ FEATURE(ata_cam, "ATA devices are access int ata_probe(device_t dev) { - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } int Modified: head/sys/dev/ata/chipsets/ata-acard.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acard.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-acard.c Mon Mar 23 19:47:52 2015 (r280393) @@ -83,7 +83,7 @@ ata_acard_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_acard_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Mon Mar 23 19:47:52 2015 (r280393) @@ -96,7 +96,7 @@ ata_ali_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_ali_chipinit; ctlr->chipdeinit = ata_ali_chipdeinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-adaptec.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-adaptec.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-adaptec.c Mon Mar 23 19:47:52 2015 (r280393) @@ -75,7 +75,7 @@ ata_adaptec_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_marvell_edma_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } ATA_DECLARE_DRIVER(ata_adaptec); Modified: head/sys/dev/ata/chipsets/ata-amd.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-amd.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-amd.c Mon Mar 23 19:47:52 2015 (r280393) @@ -82,7 +82,7 @@ ata_amd_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_amd_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ati.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-ati.c Mon Mar 23 19:47:52 2015 (r280393) @@ -123,7 +123,7 @@ ata_ati_probe(device_t dev) ctlr->chipinit = ata_ati_chipinit; break; } - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-cenatek.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-cenatek.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-cenatek.c Mon Mar 23 19:47:52 2015 (r280393) @@ -63,7 +63,7 @@ ata_cenatek_probe(device_t dev) ctlr->chipinit = ata_generic_chipinit; device_set_desc(dev, "Cenatek Rocket Drive controller"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } ATA_DECLARE_DRIVER(ata_cenatek); Modified: head/sys/dev/ata/chipsets/ata-cypress.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-cypress.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-cypress.c Mon Mar 23 19:47:52 2015 (r280393) @@ -75,7 +75,7 @@ ata_cypress_probe(device_t dev) pci_get_subclass(dev) == PCIS_STORAGE_IDE) { device_set_desc(dev, "Cypress 82C693 ATA controller"); ctlr->chipinit = ata_cypress_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } return ENXIO; } Modified: head/sys/dev/ata/chipsets/ata-cyrix.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-cyrix.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-cyrix.c Mon Mar 23 19:47:52 2015 (r280393) @@ -66,7 +66,7 @@ ata_cyrix_probe(device_t dev) if (pci_get_devid(dev) == ATA_CYRIX_5530) { device_set_desc(dev, "Cyrix 5530 ATA33 controller"); ctlr->chipinit = ata_cyrix_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } return ENXIO; } Modified: head/sys/dev/ata/chipsets/ata-fsl.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-fsl.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-fsl.c Mon Mar 23 19:47:52 2015 (r280393) @@ -79,7 +79,7 @@ imx_ata_probe(device_t dev) ctrl = device_get_softc(dev); device_set_desc(dev, "Freescale Integrated PATA Controller"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static void Modified: head/sys/dev/ata/chipsets/ata-highpoint.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-highpoint.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-highpoint.c Mon Mar 23 19:47:52 2015 (r280393) @@ -103,7 +103,7 @@ ata_highpoint_probe(device_t dev) device_set_desc_copy(dev, buffer); ctlr->chip = idx; ctlr->chipinit = ata_highpoint_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-intel.c Mon Mar 23 19:47:52 2015 (r280393) @@ -264,7 +264,7 @@ ata_intel_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_intel_chipinit; ctlr->chipdeinit = ata_intel_chipdeinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ite.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-ite.c Mon Mar 23 19:47:52 2015 (r280393) @@ -77,7 +77,7 @@ ata_ite_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_ite_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-jmicron.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-jmicron.c Mon Mar 23 19:47:52 2015 (r280393) @@ -86,7 +86,7 @@ ata_jmicron_probe(device_t dev) device_set_desc_copy(dev, buffer); ctlr->chip = idx; ctlr->chipinit = ata_jmicron_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-marvell.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-marvell.c Mon Mar 23 19:47:52 2015 (r280393) @@ -139,7 +139,7 @@ ata_marvell_probe(device_t dev) ctlr->chipinit = ata_marvell_dummy_chipinit; break; } - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-micron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-micron.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-micron.c Mon Mar 23 19:47:52 2015 (r280393) @@ -63,7 +63,7 @@ ata_micron_probe(device_t dev) device_set_desc(dev, "RZ 100? ATA controller !WARNING! data loss/corruption risk"); ctlr->chipinit = ata_generic_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } return (ENXIO); } Modified: head/sys/dev/ata/chipsets/ata-national.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-national.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-national.c Mon Mar 23 19:47:52 2015 (r280393) @@ -67,7 +67,7 @@ ata_national_probe(device_t dev) if (pci_get_devid(dev) == ATA_SC1100) { device_set_desc(dev, "National Geode SC1100 ATA33 controller"); ctlr->chipinit = ata_national_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } return ENXIO; } Modified: head/sys/dev/ata/chipsets/ata-netcell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-netcell.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-netcell.c Mon Mar 23 19:47:52 2015 (r280393) @@ -66,7 +66,7 @@ ata_netcell_probe(device_t dev) if (pci_get_devid(dev) == ATA_NETCELL_SR) { device_set_desc(dev, "Netcell SyncRAID SR3000/5000 RAID Controller"); ctlr->chipinit = ata_netcell_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } return ENXIO; } Modified: head/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-nvidia.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Mon Mar 23 19:47:52 2015 (r280393) @@ -187,7 +187,7 @@ ata_nvidia_probe(device_t dev) ctlr->chipinit = ata_ahci_chipinit; else ctlr->chipinit = ata_nvidia_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-promise.c Mon Mar 23 19:47:52 2015 (r280393) @@ -209,7 +209,7 @@ ata_promise_probe(device_t dev) device_set_desc_copy(dev, buffer); ctlr->chip = idx; ctlr->chipinit = ata_promise_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Mon Mar 23 19:47:52 2015 (r280393) @@ -96,7 +96,7 @@ ata_serverworks_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_serverworks_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Mon Mar 23 19:47:52 2015 (r280393) @@ -113,7 +113,7 @@ ata_sii_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_sii_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } int Modified: head/sys/dev/ata/chipsets/ata-sis.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-sis.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-sis.c Mon Mar 23 19:47:52 2015 (r280393) @@ -154,7 +154,7 @@ ata_sis_probe(device_t dev) device_set_desc_copy(dev, buffer); ctlr->chip = idx; ctlr->chipinit = ata_sis_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-via.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/ata/chipsets/ata-via.c Mon Mar 23 19:47:52 2015 (r280393) @@ -141,7 +141,7 @@ ata_via_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_via_chipinit; - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_LOW_PRIORITY); } static int Modified: head/sys/dev/mvs/mvs.c ============================================================================== --- head/sys/dev/mvs/mvs.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/mvs/mvs.c Mon Mar 23 19:47:52 2015 (r280393) @@ -107,7 +107,7 @@ mvs_ch_probe(device_t dev) { device_set_desc_copy(dev, "Marvell SATA channel"); - return (0); + return (BUS_PROBE_DEFAULT); } static int Modified: head/sys/dev/mvs/mvs_pci.c ============================================================================== --- head/sys/dev/mvs/mvs_pci.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/mvs/mvs_pci.c Mon Mar 23 19:47:52 2015 (r280393) @@ -88,7 +88,7 @@ mvs_probe(device_t dev) snprintf(buf, sizeof(buf), "%s SATA controller", mvs_ids[i].name); device_set_desc_copy(dev, buf); - return (BUS_PROBE_VENDOR); + return (BUS_PROBE_DEFAULT); } } return (ENXIO); Modified: head/sys/dev/mvs/mvs_soc.c ============================================================================== --- head/sys/dev/mvs/mvs_soc.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/mvs/mvs_soc.c Mon Mar 23 19:47:52 2015 (r280393) @@ -91,7 +91,7 @@ mvs_probe(device_t dev) snprintf(buf, sizeof(buf), "%s SATA controller", mvs_ids[i].name); device_set_desc_copy(dev, buf); - return (BUS_PROBE_VENDOR); + return (BUS_PROBE_DEFAULT); } } return (ENXIO); Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Mon Mar 23 19:44:18 2015 (r280392) +++ head/sys/dev/siis/siis.c Mon Mar 23 19:47:52 2015 (r280393) @@ -129,7 +129,7 @@ siis_probe(device_t dev) snprintf(buf, sizeof(buf), "%s SATA controller", siis_ids[i].name); device_set_desc_copy(dev, buf); - return (BUS_PROBE_VENDOR); + return (BUS_PROBE_DEFAULT); } } return (ENXIO); @@ -451,7 +451,7 @@ siis_ch_probe(device_t dev) { device_set_desc_copy(dev, "SIIS channel"); - return (0); + return (BUS_PROBE_DEFAULT); } static int From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 19:59:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FD81176; Mon, 23 Mar 2015 19:59:28 +0000 (UTC) Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F400E3C9; Mon, 23 Mar 2015 19:59:27 +0000 (UTC) Received: by ieclw3 with SMTP id lw3so44779165iec.2; Mon, 23 Mar 2015 12:59: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:from:date:message-id :subject:to:cc:content-type; bh=7z/nQpxC9sadMVl6wQSPQS0hMi+UfxRoxRlPh0xuXW8=; b=MpVa93PN32fBIy5dLSA9sQV/oox1VDm+Oi7kXKX+9g2jcKtisVrr9iKpB5a03qVtiC dJKpdpe1l/2WrYoNtjpvaMWAR6JlmnDNHQEOMYAY9Q9Zk+uGlkly4kgaPpb/1BrCW/Fr aekYSuBxcE2cRFtX9r0pAX2EQho1KcW9Kh9z9rSn8YLFEXZvtkcQSYUpZTyQMcN21Vkc Zk84BshqC7m9MS2aicNahZOPgbDMDH2JB1kMdBUSL79ff18BfvqxYmytKd0xXOLdXZ85 0ZHT1+RZnHzwN88Wogc+GgpTQhDD86tI3/PS50ckaP6nenrLAE/3qVCjvv2U+qU+6hzJ k4iw== X-Received: by 10.107.167.3 with SMTP id q3mr1426790ioe.18.1427140767147; Mon, 23 Mar 2015 12:59:27 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.158.19 with HTTP; Mon, 23 Mar 2015 12:59:06 -0700 (PDT) In-Reply-To: <201503231845.t2NIjUuK032777@svn.freebsd.org> References: <201503231845.t2NIjUuK032777@svn.freebsd.org> From: Ed Maste Date: Mon, 23 Mar 2015 15:59:06 -0400 X-Google-Sender-Auth: Fc9cimaQNkA9GuRzd0EKUGecfEA Message-ID: Subject: Re: svn commit: r280387 - in head/usr.bin/xlint: arch/sparc64 common lint1 lint2 xlint To: "Pedro F. Giffuni" 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-1 Precedence: list List-Id: SVN 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 Mar 2015 19:59:28 -0000 On 23 March 2015 at 14:45, Pedro F. Giffuni wrote: > Author: pfg > Date: Mon Mar 23 18:45:29 2015 > New Revision: 280387 > URL: https://svnweb.freebsd.org/changeset/base/280387 > > Log: > xlint: update. Nice. I was going to have a look at this at some point, so I'm glad that you've taken it on. Should we merge a copy of the original version, and then this update, to vendor/ to facilitate future merges? -Ed From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 20:13:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C544B6EE for ; Mon, 23 Mar 2015 20:13:38 +0000 (UTC) Received: from nm1-vm1.bullet.mail.bf1.yahoo.com (nm1-vm1.bullet.mail.bf1.yahoo.com [98.139.213.163]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AED17D4 for ; Mon, 23 Mar 2015 20:13:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1427141610; bh=raGnJjyv3MviokUYgw2FfH/bAtGiwrxk+VGK7aHOReE=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=TdrcearndsAiz3LLJT1+NBjSg5N9KneRzsx2kGQp70GN5pDgc2QB2WnheM1aF1Fnr5UfHtMNcW0ezIrE7De+20EnVzzq7ukGSwl2B1+PImIRbJY4qJ+oXPv7/ODz1nQkWcR0hWDvksAoih9Xw0RChmd5nmQ+8hps0QIXSdAh8UXL6/Z6e+PqQGV+Ii5gsKtAS+LRmNiozJRGprqBcn2l1xpyWrl+5xM0IDjv9gbzzi/2Hcl1GPHSWTDDi+KTxC9gO6tnYmQA0FRIhzjhKU76wOeHRno0nCkIlIJYMcvbhH3jHo1rT4S8joyBVzHeQqRHLG1OjOcrzzB/li+ocOKiAw== Received: from [98.139.170.181] by nm1.bullet.mail.bf1.yahoo.com with NNFMP; 23 Mar 2015 20:13:30 -0000 Received: from [98.139.211.162] by tm24.bullet.mail.bf1.yahoo.com with NNFMP; 23 Mar 2015 20:13:30 -0000 Received: from [127.0.0.1] by smtp219.mail.bf1.yahoo.com with NNFMP; 23 Mar 2015 20:13:30 -0000 X-Yahoo-Newman-Id: 579455.91178.bm@smtp219.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: FDb5JhgVM1mN.qjLiLA5ghBjLeFYXYgdUPZHLSbPbhcsve_ Qea1LzlFKhAz3uzgzkqJRS9YkLvvXq3qiN2UsB7QyFozEC5O67cmoMRjUEdu TzaGiSfdd2E_0EtyWA9GodW1ij9SAmRJhj60K6OWYJXwxCOD5S0ZYPt_8w67 ri18W79W3kk53MXCVIWYPDx3cKlBBNP6nSYNK8zbSjVuuGgvVUeWJE42z60A qbdbQr4XVhW4y.rtpcnqKrgSYVsjC3sbHsxqCDxoEoE6Hwd0c2Gyz61jypnd 4pX2GuabH.SMS.AV12M4mc82EQSA41phixSDVjL_dyKXdHPTKpEh4PAe2s.z gW4Swvw.8HbHpUZ_8xoMHFSSwZto4QqbCKcUCRUTvPfTtPn.K6kT82QeupI5 59fHJVAtaRPfwIGHUkMrLRil.8PN2HTns4kCXl22n2nCZCvTkqMbuwgwCcHK K3vzA7lGsA1Hwan2QoqLUk2Dks5027hlD_0AU8J0PQ8lT0qjJdKpxDbPIF.l _kwJeJeeH1YTmgUoXl8BA6KAke1VxpMAe X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <551073E8.9090402@FreeBSD.org> Date: Mon, 23 Mar 2015 15:13:28 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ed Maste Subject: Re: svn commit: r280387 - in head/usr.bin/xlint: arch/sparc64 common lint1 lint2 xlint References: <201503231845.t2NIjUuK032777@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-1 Precedence: list List-Id: SVN 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 Mar 2015 20:13:38 -0000 On 03/23/15 14:59, Ed Maste wrote: > On 23 March 2015 at 14:45, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Mon Mar 23 18:45:29 2015 >> New Revision: 280387 >> URL: https://svnweb.freebsd.org/changeset/base/280387 >> >> Log: >> xlint: update. > Nice. > > I was going to have a look at this at some point, so I'm glad that > you've taken it on. Should we merge a copy of the original version, > and then this update, to vendor/ to facilitate future merges? TBH, I am still sorting out the changes from NetBSD that apply to us. It is not as ugly as libedit used to be but it's not nice either. I was planning phase 2: sync to just before their license change (2-clause BSDL). phase 3: apply the license changes and properly fix the /*-. phase 4: Bring the new updates. If you manage to get us in sync with a plain vendor import, that would be great and would save me from hand merging ;). Pedro. From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 21:13:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 030ECD88; Mon, 23 Mar 2015 21: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 D8A9CE50; Mon, 23 Mar 2015 21:13:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NLDVCE007044; Mon, 23 Mar 2015 21:13:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NLDUDc007038; Mon, 23 Mar 2015 21:13:30 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503232113.t2NLDUDc007038@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 23 Mar 2015 21:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280400 - in head/contrib/llvm: include/llvm/CodeGen lib/CodeGen/SelectionDAG lib/Target/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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:13:32 -0000 Author: dim Date: Mon Mar 23 21:13:29 2015 New Revision: 280400 URL: https://svnweb.freebsd.org/changeset/base/280400 Log: Pull in r230348 from upstream llvm trunk (by Tim Northover): ARM: treat [N x i32] and [N x i64] as AAPCS composite types The logic is almost there already, with our special homogeneous aggregate handling. Tweaking it like this allows front-ends to emit AAPCS compliant code without ever having to count registers or add discarded padding arguments. Only arrays of i32 and i64 are needed to model AAPCS rules, but I decided to apply the logic to all integer arrays for more consistency. This fixes a possible "Unexpected member type for HA" error when compiling lib/msun/bsdsrc/b_tgamma.c for armv6. Reported by: Jakub Palider Modified: head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm/lib/Target/ARM/ARMCallingConv.h head/contrib/llvm/lib/Target/ARM/ARMCallingConv.td head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Modified: head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h Mon Mar 23 20:51:35 2015 (r280399) +++ head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h Mon Mar 23 21:13:29 2015 (r280400) @@ -122,8 +122,8 @@ public: // There is no need to differentiate between a pending CCValAssign and other // kinds, as they are stored in a different list. static CCValAssign getPending(unsigned ValNo, MVT ValVT, MVT LocVT, - LocInfo HTP) { - return getReg(ValNo, ValVT, 0, LocVT, HTP); + LocInfo HTP, unsigned ExtraInfo = 0) { + return getReg(ValNo, ValVT, ExtraInfo, LocVT, HTP); } void convertToReg(unsigned RegNo) { @@ -146,6 +146,7 @@ public: unsigned getLocReg() const { assert(isRegLoc()); return Loc; } unsigned getLocMemOffset() const { assert(isMemLoc()); return Loc; } + unsigned getExtraInfo() const { return Loc; } MVT getLocVT() const { return LocVT; } LocInfo getLocInfo() const { return HTP; } Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Mon Mar 23 20:51:35 2015 (r280399) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Mon Mar 23 21:13:29 2015 (r280400) @@ -7429,11 +7429,8 @@ TargetLowering::LowerCallTo(TargetLoweri } if (Args[i].isNest) Flags.setNest(); - if (NeedsRegBlock) { + if (NeedsRegBlock) Flags.setInConsecutiveRegs(); - if (Value == NumValues - 1) - Flags.setInConsecutiveRegsLast(); - } Flags.setOrigAlign(OriginalAlignment); MVT PartVT = getRegisterType(CLI.RetTy->getContext(), VT); @@ -7482,6 +7479,9 @@ TargetLowering::LowerCallTo(TargetLoweri CLI.Outs.push_back(MyFlags); CLI.OutVals.push_back(Parts[j]); } + + if (NeedsRegBlock && Value == NumValues - 1) + CLI.Outs[CLI.Outs.size() - 1].Flags.setInConsecutiveRegsLast(); } } @@ -7696,11 +7696,8 @@ void SelectionDAGISel::LowerArguments(co } if (F.getAttributes().hasAttribute(Idx, Attribute::Nest)) Flags.setNest(); - if (NeedsRegBlock) { + if (NeedsRegBlock) Flags.setInConsecutiveRegs(); - if (Value == NumValues - 1) - Flags.setInConsecutiveRegsLast(); - } Flags.setOrigAlign(OriginalAlignment); MVT RegisterVT = TLI->getRegisterType(*CurDAG->getContext(), VT); @@ -7715,6 +7712,8 @@ void SelectionDAGISel::LowerArguments(co MyFlags.Flags.setOrigAlign(1); Ins.push_back(MyFlags); } + if (NeedsRegBlock && Value == NumValues - 1) + Ins[Ins.size() - 1].Flags.setInConsecutiveRegsLast(); PartBase += VT.getStoreSize(); } } Modified: head/contrib/llvm/lib/Target/ARM/ARMCallingConv.h ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMCallingConv.h Mon Mar 23 20:51:35 2015 (r280399) +++ head/contrib/llvm/lib/Target/ARM/ARMCallingConv.h Mon Mar 23 21:13:29 2015 (r280400) @@ -160,6 +160,8 @@ static bool RetCC_ARM_AAPCS_Custom_f64(u State); } +static const uint16_t RRegList[] = { ARM::R0, ARM::R1, ARM::R2, ARM::R3 }; + static const uint16_t SRegList[] = { ARM::S0, ARM::S1, ARM::S2, ARM::S3, ARM::S4, ARM::S5, ARM::S6, ARM::S7, ARM::S8, ARM::S9, ARM::S10, ARM::S11, @@ -168,81 +170,114 @@ static const uint16_t DRegList[] = { ARM ARM::D4, ARM::D5, ARM::D6, ARM::D7 }; static const uint16_t QRegList[] = { ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3 }; + // Allocate part of an AAPCS HFA or HVA. We assume that each member of the HA // has InConsecutiveRegs set, and that the last member also has // InConsecutiveRegsLast set. We must process all members of the HA before // we can allocate it, as we need to know the total number of registers that // will be needed in order to (attempt to) allocate a contiguous block. -static bool CC_ARM_AAPCS_Custom_HA(unsigned &ValNo, MVT &ValVT, MVT &LocVT, - CCValAssign::LocInfo &LocInfo, - ISD::ArgFlagsTy &ArgFlags, CCState &State) { - SmallVectorImpl &PendingHAMembers = State.getPendingLocs(); +static bool CC_ARM_AAPCS_Custom_Aggregate(unsigned &ValNo, MVT &ValVT, + MVT &LocVT, + CCValAssign::LocInfo &LocInfo, + ISD::ArgFlagsTy &ArgFlags, + CCState &State) { + SmallVectorImpl &PendingMembers = State.getPendingLocs(); // AAPCS HFAs must have 1-4 elements, all of the same type - assert(PendingHAMembers.size() < 4); - if (PendingHAMembers.size() > 0) - assert(PendingHAMembers[0].getLocVT() == LocVT); + if (PendingMembers.size() > 0) + assert(PendingMembers[0].getLocVT() == LocVT); // Add the argument to the list to be allocated once we know the size of the - // HA - PendingHAMembers.push_back( - CCValAssign::getPending(ValNo, ValVT, LocVT, LocInfo)); - - if (ArgFlags.isInConsecutiveRegsLast()) { - assert(PendingHAMembers.size() > 0 && PendingHAMembers.size() <= 4 && - "Homogeneous aggregates must have between 1 and 4 members"); - - // Try to allocate a contiguous block of registers, each of the correct - // size to hold one member. - ArrayRef RegList; - switch (LocVT.SimpleTy) { - case MVT::f32: - RegList = SRegList; - break; - case MVT::f64: - RegList = DRegList; - break; - case MVT::v2f64: - RegList = QRegList; - break; - default: - llvm_unreachable("Unexpected member type for HA"); - break; - } + // aggregate. Store the type's required alignmnent as extra info for later: in + // the [N x i64] case all trace has been removed by the time we actually get + // to do allocation. + PendingMembers.push_back(CCValAssign::getPending(ValNo, ValVT, LocVT, LocInfo, + ArgFlags.getOrigAlign())); + + if (!ArgFlags.isInConsecutiveRegsLast()) + return true; + + // Try to allocate a contiguous block of registers, each of the correct + // size to hold one member. + unsigned Align = std::min(PendingMembers[0].getExtraInfo(), 8U); + + ArrayRef RegList; + switch (LocVT.SimpleTy) { + case MVT::i32: { + RegList = RRegList; + unsigned RegIdx = State.getFirstUnallocated(RegList.data(), RegList.size()); + + // First consume all registers that would give an unaligned object. Whether + // we go on stack or in regs, no-one will be using them in future. + unsigned RegAlign = RoundUpToAlignment(Align, 4) / 4; + while (RegIdx % RegAlign != 0 && RegIdx < RegList.size()) + State.AllocateReg(RegList[RegIdx++]); - unsigned RegResult = - State.AllocateRegBlock(RegList, PendingHAMembers.size()); + break; + } + case MVT::f32: + RegList = SRegList; + break; + case MVT::f64: + RegList = DRegList; + break; + case MVT::v2f64: + RegList = QRegList; + break; + default: + llvm_unreachable("Unexpected member type for block aggregate"); + break; + } - if (RegResult) { - for (SmallVectorImpl::iterator It = PendingHAMembers.begin(); - It != PendingHAMembers.end(); ++It) { - It->convertToReg(RegResult); - State.addLoc(*It); - ++RegResult; - } - PendingHAMembers.clear(); - return true; + unsigned RegResult = State.AllocateRegBlock(RegList, PendingMembers.size()); + if (RegResult) { + for (SmallVectorImpl::iterator It = PendingMembers.begin(); + It != PendingMembers.end(); ++It) { + It->convertToReg(RegResult); + State.addLoc(*It); + ++RegResult; } + PendingMembers.clear(); + return true; + } - // Register allocation failed, fall back to the stack - - // Mark all VFP regs as unavailable (AAPCS rule C.2.vfp) - for (unsigned regNo = 0; regNo < 16; ++regNo) - State.AllocateReg(SRegList[regNo]); - - unsigned Size = LocVT.getSizeInBits() / 8; - unsigned Align = std::min(Size, 8U); + // Register allocation failed, we'll be needing the stack + unsigned Size = LocVT.getSizeInBits() / 8; + if (LocVT == MVT::i32 && State.getNextStackOffset() == 0) { + // If nothing else has used the stack until this point, a non-HFA aggregate + // can be split between regs and stack. + unsigned RegIdx = State.getFirstUnallocated(RegList.data(), RegList.size()); + for (auto &It : PendingMembers) { + if (RegIdx >= RegList.size()) + It.convertToMem(State.AllocateStack(Size, Size)); + else + It.convertToReg(State.AllocateReg(RegList[RegIdx++])); - for (auto It : PendingHAMembers) { - It.convertToMem(State.AllocateStack(Size, Align)); State.addLoc(It); } - - // All pending members have now been allocated - PendingHAMembers.clear(); + PendingMembers.clear(); + return true; + } else if (LocVT != MVT::i32) + RegList = SRegList; + + // Mark all regs as unavailable (AAPCS rule C.2.vfp for VFP, C.6 for core) + for (auto Reg : RegList) + State.AllocateReg(Reg); + + for (auto &It : PendingMembers) { + It.convertToMem(State.AllocateStack(Size, Align)); + State.addLoc(It); + + // After the first item has been allocated, the rest are packed as tightly + // as possible. (E.g. an incoming i64 would have starting Align of 8, but + // we'll be allocating a bunch of i32 slots). + Align = Size; } - // This will be allocated by the last member of the HA + // All pending members have now been allocated + PendingMembers.clear(); + + // This will be allocated by the last member of the aggregate return true; } Modified: head/contrib/llvm/lib/Target/ARM/ARMCallingConv.td ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMCallingConv.td Mon Mar 23 20:51:35 2015 (r280399) +++ head/contrib/llvm/lib/Target/ARM/ARMCallingConv.td Mon Mar 23 21:13:29 2015 (r280400) @@ -175,7 +175,7 @@ def CC_ARM_AAPCS_VFP : CallingConv<[ CCIfType<[v2i64, v4i32, v8i16, v16i8, v4f32], CCBitConvertToType>, // HFAs are passed in a contiguous block of registers, or on the stack - CCIfConsecutiveRegs>, + CCIfConsecutiveRegs>, CCIfType<[v2f64], CCAssignToReg<[Q0, Q1, Q2, Q3]>>, CCIfType<[f64], CCAssignToReg<[D0, D1, D2, D3, D4, D5, D6, D7]>>, Modified: head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Mon Mar 23 20:51:35 2015 (r280399) +++ head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Mon Mar 23 21:13:29 2015 (r280400) @@ -11280,7 +11280,9 @@ static bool isHomogeneousAggregate(Type return (Members > 0 && Members <= 4); } -/// \brief Return true if a type is an AAPCS-VFP homogeneous aggregate. +/// \brief Return true if a type is an AAPCS-VFP homogeneous aggregate or one of +/// [N x i32] or [N x i64]. This allows front-ends to skip emitting padding when +/// passing according to AAPCS rules. bool ARMTargetLowering::functionArgumentNeedsConsecutiveRegisters( Type *Ty, CallingConv::ID CallConv, bool isVarArg) const { if (getEffectiveCallingConv(CallConv, isVarArg) != @@ -11289,7 +11291,9 @@ bool ARMTargetLowering::functionArgument HABaseType Base = HA_UNKNOWN; uint64_t Members = 0; - bool result = isHomogeneousAggregate(Ty, Base, Members); - DEBUG(dbgs() << "isHA: " << result << " "; Ty->dump()); - return result; + bool IsHA = isHomogeneousAggregate(Ty, Base, Members); + DEBUG(dbgs() << "isHA: " << IsHA << " "; Ty->dump()); + + bool IsIntArray = Ty->isArrayTy() && Ty->getArrayElementType()->isIntegerTy(); + return IsHA || IsIntArray; } From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 21:15:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD0CD1E2; Mon, 23 Mar 2015 21: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 A78C0E77; Mon, 23 Mar 2015 21:15:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NLF8B3007369; Mon, 23 Mar 2015 21:15:08 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NLF8eC007368; Mon, 23 Mar 2015 21:15:08 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503232115.t2NLF8eC007368@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 23 Mar 2015 21:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280401 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:15:08 -0000 Author: dim Date: Mon Mar 23 21:15:07 2015 New Revision: 280401 URL: https://svnweb.freebsd.org/changeset/base/280401 Log: Add llvm patch corresponding to r280400. Added: head/contrib/llvm/patches/patch-10-llvm-r230348-arm-fix-bad-ha.diff Added: head/contrib/llvm/patches/patch-10-llvm-r230348-arm-fix-bad-ha.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-10-llvm-r230348-arm-fix-bad-ha.diff Mon Mar 23 21:15:07 2015 (r280401) @@ -0,0 +1,419 @@ +Pull in r230348 from upstream llvm trunk (by Tim Northover): + + ARM: treat [N x i32] and [N x i64] as AAPCS composite types + + The logic is almost there already, with our special homogeneous + aggregate handling. Tweaking it like this allows front-ends to emit + AAPCS compliant code without ever having to count registers or add + discarded padding arguments. + + Only arrays of i32 and i64 are needed to model AAPCS rules, but I + decided to apply the logic to all integer arrays for more consistency. + +This fixes a possible "Unexpected member type for HA" error when +compiling lib/msun/bsdsrc/b_tgamma.c for armv6. + +Reported by: Jakub Palider + +Introduced here: https://svnweb.freebsd.org/changeset/base/280400 + +Index: include/llvm/CodeGen/CallingConvLower.h +=================================================================== +--- include/llvm/CodeGen/CallingConvLower.h ++++ include/llvm/CodeGen/CallingConvLower.h +@@ -122,8 +122,8 @@ class CCValAssign { + // There is no need to differentiate between a pending CCValAssign and other + // kinds, as they are stored in a different list. + static CCValAssign getPending(unsigned ValNo, MVT ValVT, MVT LocVT, +- LocInfo HTP) { +- return getReg(ValNo, ValVT, 0, LocVT, HTP); ++ LocInfo HTP, unsigned ExtraInfo = 0) { ++ return getReg(ValNo, ValVT, ExtraInfo, LocVT, HTP); + } + + void convertToReg(unsigned RegNo) { +@@ -146,6 +146,7 @@ class CCValAssign { + + unsigned getLocReg() const { assert(isRegLoc()); return Loc; } + unsigned getLocMemOffset() const { assert(isMemLoc()); return Loc; } ++ unsigned getExtraInfo() const { return Loc; } + MVT getLocVT() const { return LocVT; } + + LocInfo getLocInfo() const { return HTP; } +Index: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +=================================================================== +--- lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp ++++ lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +@@ -7429,11 +7429,8 @@ TargetLowering::LowerCallTo(TargetLowering::CallLo + } + if (Args[i].isNest) + Flags.setNest(); +- if (NeedsRegBlock) { ++ if (NeedsRegBlock) + Flags.setInConsecutiveRegs(); +- if (Value == NumValues - 1) +- Flags.setInConsecutiveRegsLast(); +- } + Flags.setOrigAlign(OriginalAlignment); + + MVT PartVT = getRegisterType(CLI.RetTy->getContext(), VT); +@@ -7482,6 +7479,9 @@ TargetLowering::LowerCallTo(TargetLowering::CallLo + CLI.Outs.push_back(MyFlags); + CLI.OutVals.push_back(Parts[j]); + } ++ ++ if (NeedsRegBlock && Value == NumValues - 1) ++ CLI.Outs[CLI.Outs.size() - 1].Flags.setInConsecutiveRegsLast(); + } + } + +@@ -7696,11 +7696,8 @@ void SelectionDAGISel::LowerArguments(const Functi + } + if (F.getAttributes().hasAttribute(Idx, Attribute::Nest)) + Flags.setNest(); +- if (NeedsRegBlock) { ++ if (NeedsRegBlock) + Flags.setInConsecutiveRegs(); +- if (Value == NumValues - 1) +- Flags.setInConsecutiveRegsLast(); +- } + Flags.setOrigAlign(OriginalAlignment); + + MVT RegisterVT = TLI->getRegisterType(*CurDAG->getContext(), VT); +@@ -7715,6 +7712,8 @@ void SelectionDAGISel::LowerArguments(const Functi + MyFlags.Flags.setOrigAlign(1); + Ins.push_back(MyFlags); + } ++ if (NeedsRegBlock && Value == NumValues - 1) ++ Ins[Ins.size() - 1].Flags.setInConsecutiveRegsLast(); + PartBase += VT.getStoreSize(); + } + } +Index: lib/Target/ARM/ARMCallingConv.h +=================================================================== +--- lib/Target/ARM/ARMCallingConv.h ++++ lib/Target/ARM/ARMCallingConv.h +@@ -160,6 +160,8 @@ static bool RetCC_ARM_AAPCS_Custom_f64(unsigned &V + State); + } + ++static const uint16_t RRegList[] = { ARM::R0, ARM::R1, ARM::R2, ARM::R3 }; ++ + static const uint16_t SRegList[] = { ARM::S0, ARM::S1, ARM::S2, ARM::S3, + ARM::S4, ARM::S5, ARM::S6, ARM::S7, + ARM::S8, ARM::S9, ARM::S10, ARM::S11, +@@ -168,81 +170,114 @@ static const uint16_t DRegList[] = { ARM::D0, ARM: + ARM::D4, ARM::D5, ARM::D6, ARM::D7 }; + static const uint16_t QRegList[] = { ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3 }; + ++ + // Allocate part of an AAPCS HFA or HVA. We assume that each member of the HA + // has InConsecutiveRegs set, and that the last member also has + // InConsecutiveRegsLast set. We must process all members of the HA before + // we can allocate it, as we need to know the total number of registers that + // will be needed in order to (attempt to) allocate a contiguous block. +-static bool CC_ARM_AAPCS_Custom_HA(unsigned &ValNo, MVT &ValVT, MVT &LocVT, +- CCValAssign::LocInfo &LocInfo, +- ISD::ArgFlagsTy &ArgFlags, CCState &State) { +- SmallVectorImpl &PendingHAMembers = State.getPendingLocs(); ++static bool CC_ARM_AAPCS_Custom_Aggregate(unsigned &ValNo, MVT &ValVT, ++ MVT &LocVT, ++ CCValAssign::LocInfo &LocInfo, ++ ISD::ArgFlagsTy &ArgFlags, ++ CCState &State) { ++ SmallVectorImpl &PendingMembers = State.getPendingLocs(); + + // AAPCS HFAs must have 1-4 elements, all of the same type +- assert(PendingHAMembers.size() < 4); +- if (PendingHAMembers.size() > 0) +- assert(PendingHAMembers[0].getLocVT() == LocVT); ++ if (PendingMembers.size() > 0) ++ assert(PendingMembers[0].getLocVT() == LocVT); + + // Add the argument to the list to be allocated once we know the size of the +- // HA +- PendingHAMembers.push_back( +- CCValAssign::getPending(ValNo, ValVT, LocVT, LocInfo)); ++ // aggregate. Store the type's required alignmnent as extra info for later: in ++ // the [N x i64] case all trace has been removed by the time we actually get ++ // to do allocation. ++ PendingMembers.push_back(CCValAssign::getPending(ValNo, ValVT, LocVT, LocInfo, ++ ArgFlags.getOrigAlign())); + +- if (ArgFlags.isInConsecutiveRegsLast()) { +- assert(PendingHAMembers.size() > 0 && PendingHAMembers.size() <= 4 && +- "Homogeneous aggregates must have between 1 and 4 members"); ++ if (!ArgFlags.isInConsecutiveRegsLast()) ++ return true; + +- // Try to allocate a contiguous block of registers, each of the correct +- // size to hold one member. +- ArrayRef RegList; +- switch (LocVT.SimpleTy) { +- case MVT::f32: +- RegList = SRegList; +- break; +- case MVT::f64: +- RegList = DRegList; +- break; +- case MVT::v2f64: +- RegList = QRegList; +- break; +- default: +- llvm_unreachable("Unexpected member type for HA"); +- break; +- } ++ // Try to allocate a contiguous block of registers, each of the correct ++ // size to hold one member. ++ unsigned Align = std::min(PendingMembers[0].getExtraInfo(), 8U); + +- unsigned RegResult = +- State.AllocateRegBlock(RegList, PendingHAMembers.size()); ++ ArrayRef RegList; ++ switch (LocVT.SimpleTy) { ++ case MVT::i32: { ++ RegList = RRegList; ++ unsigned RegIdx = State.getFirstUnallocated(RegList.data(), RegList.size()); + +- if (RegResult) { +- for (SmallVectorImpl::iterator It = PendingHAMembers.begin(); +- It != PendingHAMembers.end(); ++It) { +- It->convertToReg(RegResult); +- State.addLoc(*It); +- ++RegResult; +- } +- PendingHAMembers.clear(); +- return true; +- } ++ // First consume all registers that would give an unaligned object. Whether ++ // we go on stack or in regs, no-one will be using them in future. ++ unsigned RegAlign = RoundUpToAlignment(Align, 4) / 4; ++ while (RegIdx % RegAlign != 0 && RegIdx < RegList.size()) ++ State.AllocateReg(RegList[RegIdx++]); + +- // Register allocation failed, fall back to the stack ++ break; ++ } ++ case MVT::f32: ++ RegList = SRegList; ++ break; ++ case MVT::f64: ++ RegList = DRegList; ++ break; ++ case MVT::v2f64: ++ RegList = QRegList; ++ break; ++ default: ++ llvm_unreachable("Unexpected member type for block aggregate"); ++ break; ++ } + +- // Mark all VFP regs as unavailable (AAPCS rule C.2.vfp) +- for (unsigned regNo = 0; regNo < 16; ++regNo) +- State.AllocateReg(SRegList[regNo]); ++ unsigned RegResult = State.AllocateRegBlock(RegList, PendingMembers.size()); ++ if (RegResult) { ++ for (SmallVectorImpl::iterator It = PendingMembers.begin(); ++ It != PendingMembers.end(); ++It) { ++ It->convertToReg(RegResult); ++ State.addLoc(*It); ++ ++RegResult; ++ } ++ PendingMembers.clear(); ++ return true; ++ } + +- unsigned Size = LocVT.getSizeInBits() / 8; +- unsigned Align = std::min(Size, 8U); ++ // Register allocation failed, we'll be needing the stack ++ unsigned Size = LocVT.getSizeInBits() / 8; ++ if (LocVT == MVT::i32 && State.getNextStackOffset() == 0) { ++ // If nothing else has used the stack until this point, a non-HFA aggregate ++ // can be split between regs and stack. ++ unsigned RegIdx = State.getFirstUnallocated(RegList.data(), RegList.size()); ++ for (auto &It : PendingMembers) { ++ if (RegIdx >= RegList.size()) ++ It.convertToMem(State.AllocateStack(Size, Size)); ++ else ++ It.convertToReg(State.AllocateReg(RegList[RegIdx++])); + +- for (auto It : PendingHAMembers) { +- It.convertToMem(State.AllocateStack(Size, Align)); + State.addLoc(It); + } ++ PendingMembers.clear(); ++ return true; ++ } else if (LocVT != MVT::i32) ++ RegList = SRegList; + +- // All pending members have now been allocated +- PendingHAMembers.clear(); ++ // Mark all regs as unavailable (AAPCS rule C.2.vfp for VFP, C.6 for core) ++ for (auto Reg : RegList) ++ State.AllocateReg(Reg); ++ ++ for (auto &It : PendingMembers) { ++ It.convertToMem(State.AllocateStack(Size, Align)); ++ State.addLoc(It); ++ ++ // After the first item has been allocated, the rest are packed as tightly ++ // as possible. (E.g. an incoming i64 would have starting Align of 8, but ++ // we'll be allocating a bunch of i32 slots). ++ Align = Size; + } + +- // This will be allocated by the last member of the HA ++ // All pending members have now been allocated ++ PendingMembers.clear(); ++ ++ // This will be allocated by the last member of the aggregate + return true; + } + +Index: lib/Target/ARM/ARMCallingConv.td +=================================================================== +--- lib/Target/ARM/ARMCallingConv.td ++++ lib/Target/ARM/ARMCallingConv.td +@@ -175,7 +175,7 @@ def CC_ARM_AAPCS_VFP : CallingConv<[ + CCIfType<[v2i64, v4i32, v8i16, v16i8, v4f32], CCBitConvertToType>, + + // HFAs are passed in a contiguous block of registers, or on the stack +- CCIfConsecutiveRegs>, ++ CCIfConsecutiveRegs>, + + CCIfType<[v2f64], CCAssignToReg<[Q0, Q1, Q2, Q3]>>, + CCIfType<[f64], CCAssignToReg<[D0, D1, D2, D3, D4, D5, D6, D7]>>, +Index: lib/Target/ARM/ARMISelLowering.cpp +=================================================================== +--- lib/Target/ARM/ARMISelLowering.cpp ++++ lib/Target/ARM/ARMISelLowering.cpp +@@ -11280,7 +11280,9 @@ static bool isHomogeneousAggregate(Type *Ty, HABas + return (Members > 0 && Members <= 4); + } + +-/// \brief Return true if a type is an AAPCS-VFP homogeneous aggregate. ++/// \brief Return true if a type is an AAPCS-VFP homogeneous aggregate or one of ++/// [N x i32] or [N x i64]. This allows front-ends to skip emitting padding when ++/// passing according to AAPCS rules. + bool ARMTargetLowering::functionArgumentNeedsConsecutiveRegisters( + Type *Ty, CallingConv::ID CallConv, bool isVarArg) const { + if (getEffectiveCallingConv(CallConv, isVarArg) != +@@ -11289,7 +11291,9 @@ bool ARMTargetLowering::functionArgumentNeedsConse + + HABaseType Base = HA_UNKNOWN; + uint64_t Members = 0; +- bool result = isHomogeneousAggregate(Ty, Base, Members); +- DEBUG(dbgs() << "isHA: " << result << " "; Ty->dump()); +- return result; ++ bool IsHA = isHomogeneousAggregate(Ty, Base, Members); ++ DEBUG(dbgs() << "isHA: " << IsHA << " "; Ty->dump()); ++ ++ bool IsIntArray = Ty->isArrayTy() && Ty->getArrayElementType()->isIntegerTy(); ++ return IsHA || IsIntArray; + } +Index: test/CodeGen/ARM/aggregate-padding.ll +=================================================================== +--- test/CodeGen/ARM/aggregate-padding.ll ++++ test/CodeGen/ARM/aggregate-padding.ll +@@ -0,0 +1,101 @@ ++; RUN: llc -mtriple=armv7-linux-gnueabihf %s -o - | FileCheck %s ++ ++; [2 x i64] should be contiguous when split (e.g. we shouldn't try to align all ++; i32 components to 64 bits). Also makes sure i64 based types are properly ++; aligned on the stack. ++define i64 @test_i64_contiguous_on_stack([8 x double], float, i32 %in, [2 x i64] %arg) nounwind { ++; CHECK-LABEL: test_i64_contiguous_on_stack: ++; CHECK-DAG: ldr [[LO0:r[0-9]+]], [sp, #8] ++; CHECK-DAG: ldr [[HI0:r[0-9]+]], [sp, #12] ++; CHECK-DAG: ldr [[LO1:r[0-9]+]], [sp, #16] ++; CHECK-DAG: ldr [[HI1:r[0-9]+]], [sp, #20] ++; CHECK: adds r0, [[LO0]], [[LO1]] ++; CHECK: adc r1, [[HI0]], [[HI1]] ++ ++ %val1 = extractvalue [2 x i64] %arg, 0 ++ %val2 = extractvalue [2 x i64] %arg, 1 ++ %sum = add i64 %val1, %val2 ++ ret i64 %sum ++} ++ ++; [2 x i64] should try to use looks for 4 regs, not 8 (which might happen if the ++; i64 -> i32, i32 split wasn't handled correctly). ++define i64 @test_2xi64_uses_4_regs([8 x double], float, [2 x i64] %arg) nounwind { ++; CHECK-LABEL: test_2xi64_uses_4_regs: ++; CHECK-DAG: mov r0, r2 ++; CHECK-DAG: mov r1, r3 ++ ++ %val = extractvalue [2 x i64] %arg, 1 ++ ret i64 %val ++} ++ ++; An aggregate should be able to split between registers and stack if there is ++; nothing else on the stack. ++define i32 @test_aggregates_split([8 x double], i32, [4 x i32] %arg) nounwind { ++; CHECK-LABEL: test_aggregates_split: ++; CHECK: ldr [[VAL3:r[0-9]+]], [sp] ++; CHECK: add r0, r1, [[VAL3]] ++ ++ %val0 = extractvalue [4 x i32] %arg, 0 ++ %val3 = extractvalue [4 x i32] %arg, 3 ++ %sum = add i32 %val0, %val3 ++ ret i32 %sum ++} ++ ++; If an aggregate has to be moved entirely onto the stack, nothing should be ++; able to use r0-r3 any more. Also checks that [2 x i64] properly aligned when ++; it uses regs. ++define i32 @test_no_int_backfilling([8 x double], float, i32, [2 x i64], i32 %arg) nounwind { ++; CHECK-LABEL: test_no_int_backfilling: ++; CHECK: ldr r0, [sp, #24] ++ ret i32 %arg ++} ++ ++; Even if the argument was successfully allocated as reg block, there should be ++; no backfillig to r1. ++define i32 @test_no_int_backfilling_regsonly(i32, [1 x i64], i32 %arg) { ++; CHECK-LABEL: test_no_int_backfilling_regsonly: ++; CHECK: ldr r0, [sp] ++ ret i32 %arg ++} ++ ++; If an aggregate has to be moved entirely onto the stack, nothing should be ++; able to use r0-r3 any more. ++define float @test_no_float_backfilling([7 x double], [4 x i32], i32, [4 x double], float %arg) nounwind { ++; CHECK-LABEL: test_no_float_backfilling: ++; CHECK: vldr s0, [sp, #40] ++ ret float %arg ++} ++ ++; They're a bit pointless, but types like [N x i8] should work as well. ++define i8 @test_i8_in_regs(i32, [3 x i8] %arg) { ++; CHECK-LABEL: test_i8_in_regs: ++; CHECK: add r0, r1, r3 ++ %val0 = extractvalue [3 x i8] %arg, 0 ++ %val2 = extractvalue [3 x i8] %arg, 2 ++ %sum = add i8 %val0, %val2 ++ ret i8 %sum ++} ++ ++define i16 @test_i16_split(i32, i32, [3 x i16] %arg) { ++; CHECK-LABEL: test_i16_split: ++; CHECK: ldrh [[VAL2:r[0-9]+]], [sp] ++; CHECK: add r0, r2, [[VAL2]] ++ %val0 = extractvalue [3 x i16] %arg, 0 ++ %val2 = extractvalue [3 x i16] %arg, 2 ++ %sum = add i16 %val0, %val2 ++ ret i16 %sum ++} ++ ++; Beware: on the stack each i16 still gets a 32-bit slot, the array is not ++; packed. ++define i16 @test_i16_forced_stack([8 x double], double, i32, i32, [3 x i16] %arg) { ++; CHECK-LABEL: test_i16_forced_stack: ++; CHECK-DAG: ldrh [[VAL0:r[0-9]+]], [sp, #8] ++; CHECK-DAG: ldrh [[VAL2:r[0-9]+]], [sp, #16] ++; CHECK: add r0, [[VAL0]], [[VAL2]] ++ %val0 = extractvalue [3 x i16] %arg, 0 ++ %val2 = extractvalue [3 x i16] %arg, 2 ++ %sum = add i16 %val0, %val2 ++ ret i16 %sum ++} From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 22:42:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1779D649; Mon, 23 Mar 2015 22: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 ED2B6A25; Mon, 23 Mar 2015 22:42:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NMghqx049649; Mon, 23 Mar 2015 22:42:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NMghoP049646; Mon, 23 Mar 2015 22:42:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503232242.t2NMghoP049646@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 23 Mar 2015 22:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280402 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 22:42:44 -0000 Author: ian Date: Mon Mar 23 22:42:42 2015 New Revision: 280402 URL: https://svnweb.freebsd.org/changeset/base/280402 Log: Do not save/restore the TLS pointer on context switch for armv6. The pointer cannot be changed directly by userland code on armv6 (it can be on armv4), so there's no need to save/restore. Submitted by: Michal Meloun Modified: head/sys/arm/arm/swtch.S head/sys/arm/arm/sys_machdep.c head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Mon Mar 23 21:15:07 2015 (r280401) +++ head/sys/arm/arm/swtch.S Mon Mar 23 22:42:42 2015 (r280402) @@ -255,7 +255,7 @@ ENTRY(cpu_switch) mov r4, r0 /* Save the old thread. */ #ifdef ARM_TP_ADDRESS - /* Store the old tp */ + /* Store the old tp; userland can change it on armv4. */ ldr r3, =ARM_TP_ADDRESS ldr r9, [r3] str r9, [r0, #(TD_MD + MD_TP)] @@ -272,11 +272,10 @@ ENTRY(cpu_switch) ldr r9, [r1, #(TD_MD + MD_RAS_END)] str r9, [r3, #8] #else - /* Store the old tp */ - mrc p15, 0, r9, c13, c0, 3 - str r9, [r0, #(TD_MD + MD_TP)] - - /* Set the new tp */ + /* + * Set new tp. No need to store the old one first, userland can't + * change it directly on armv6. + */ ldr r9, [r1, #(TD_MD + MD_TP)] mcr p15, 0, r9, c13, c0, 3 #endif Modified: head/sys/arm/arm/sys_machdep.c ============================================================================== --- head/sys/arm/arm/sys_machdep.c Mon Mar 23 21:15:07 2015 (r280401) +++ head/sys/arm/arm/sys_machdep.c Mon Mar 23 22:42:42 2015 (r280402) @@ -84,13 +84,11 @@ static int arm32_set_tp(struct thread *td, void *args) { - if (td != curthread) - td->td_md.md_tp = (register_t)args; - else + td->td_md.md_tp = (register_t)args; #ifndef ARM_TP_ADDRESS - set_tls(args); + set_tls(args); #else - *(register_t *)ARM_TP_ADDRESS = (register_t)args; + *(register_t *)ARM_TP_ADDRESS = (register_t)args; #endif return (0); } @@ -99,13 +97,10 @@ static int arm32_get_tp(struct thread *td, void *args) { - if (td != curthread) - td->td_retval[0] = td->td_md.md_tp; - else #ifndef ARM_TP_ADDRESS - td->td_retval[0] = (register_t)get_tls(); + td->td_retval[0] = td->td_md.md_tp; #else - td->td_retval[0] = *(register_t *)ARM_TP_ADDRESS; + td->td_retval[0] = *(register_t *)ARM_TP_ADDRESS; #endif return (0); } Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Mon Mar 23 21:15:07 2015 (r280401) +++ head/sys/arm/arm/vm_machdep.c Mon Mar 23 22:42:42 2015 (r280402) @@ -145,7 +145,7 @@ cpu_fork(register struct thread *td1, re #ifdef ARM_TP_ADDRESS td2->td_md.md_tp = *(register_t *)ARM_TP_ADDRESS; #else - td2->td_md.md_tp = (register_t) get_tls(); + td2->td_md.md_tp = td1->td_md.md_tp; #endif } @@ -274,7 +274,7 @@ cpu_set_user_tls(struct thread *td, void #ifdef ARM_TP_ADDRESS *(register_t *)ARM_TP_ADDRESS = (register_t)tls_base; #else - set_tls((void *)tls_base); + set_tls(tls_base); #endif critical_exit(); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 23:06:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFF10C9; Mon, 23 Mar 2015 23: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB4FFCAA; Mon, 23 Mar 2015 23:06:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NN6Xqn059627; Mon, 23 Mar 2015 23:06:33 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NN6Xbi059626; Mon, 23 Mar 2015 23:06:33 GMT (envelope-from np@FreeBSD.org) Message-Id: <201503232306.t2NN6Xbi059626@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 23 Mar 2015 23:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280403 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:06:34 -0000 Author: np Date: Mon Mar 23 23:06:32 2015 New Revision: 280403 URL: https://svnweb.freebsd.org/changeset/base/280403 Log: cxgbe(4): Do not call sbuf_trim on an sbuf with a drain function. 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 Mon Mar 23 22:42:42 2015 (r280402) +++ head/sys/dev/cxgbe/t4_main.c Mon Mar 23 23:06:32 2015 (r280403) @@ -5080,13 +5080,16 @@ cxgbe_sysctls(struct port_info *pi) static int sysctl_int_array(SYSCTL_HANDLER_ARGS) { - int rc, *i; + int rc, *i, space = 0; struct sbuf sb; sbuf_new_for_sysctl(&sb, NULL, 64, req); - for (i = arg1; arg2; arg2 -= sizeof(int), i++) - sbuf_printf(&sb, "%d ", *i); - sbuf_trim(&sb); + for (i = arg1; arg2; arg2 -= sizeof(int), i++) { + if (space) + sbuf_printf(&sb, " "); + sbuf_printf(&sb, "%d", *i); + space = 1; + } rc = sbuf_finish(&sb); sbuf_delete(&sb); return (rc); From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 23:34:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 521DE883; Mon, 23 Mar 2015 23: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 3D3D5F63; Mon, 23 Mar 2015 23:34:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NNYMnk073338; Mon, 23 Mar 2015 23:34:22 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NNYMt8073337; Mon, 23 Mar 2015 23:34:22 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503232334.t2NNYMt8073337@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 23 Mar 2015 23:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280404 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:34:22 -0000 Author: tuexen Date: Mon Mar 23 23:34:21 2015 New Revision: 280404 URL: https://svnweb.freebsd.org/changeset/base/280404 Log: When an ICMP message is received and the MTU shrinks, only mark outstanding chunks for retransmissions. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Mon Mar 23 23:06:32 2015 (r280403) +++ head/sys/netinet/sctp_usrreq.c Mon Mar 23 23:34:21 2015 (r280404) @@ -125,21 +125,19 @@ sctp_pathmtu_adjustment(struct sctp_tcb if (chk->sent < SCTP_DATAGRAM_RESEND) { sctp_flight_size_decrease(chk); sctp_total_flight_decrease(stcb, chk); - } - if (chk->sent != SCTP_DATAGRAM_RESEND) { + chk->sent = SCTP_DATAGRAM_RESEND; sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); + chk->rec.data.doing_fast_retransmit = 0; + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { + sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_PMTU, + chk->whoTo->flight_size, + chk->book_size, + (uintptr_t) chk->whoTo, + chk->rec.data.TSN_seq); + } + /* Clear any time so NO RTT is being done */ + chk->do_rtt = 0; } - chk->sent = SCTP_DATAGRAM_RESEND; - chk->rec.data.doing_fast_retransmit = 0; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { - sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_PMTU, - chk->whoTo->flight_size, - chk->book_size, - (uintptr_t) chk->whoTo, - chk->rec.data.TSN_seq); - } - /* Clear any time so NO RTT is being done */ - chk->do_rtt = 0; } } } From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 00:10:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 967D9904; Tue, 24 Mar 2015 00:10: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 8147B393; Tue, 24 Mar 2015 00:10:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O0ACdM089907; Tue, 24 Mar 2015 00:10:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O0ACZb089906; Tue, 24 Mar 2015 00:10:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201503240010.t2O0ACZb089906@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 24 Mar 2015 00:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280407 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 00:10:12 -0000 Author: mjg Date: Tue Mar 24 00:10:11 2015 New Revision: 280407 URL: https://svnweb.freebsd.org/changeset/base/280407 Log: filedesc: microoptimize fget_unlocked by getting rid of fd < 0 branch Casting fd to an unsigned type simplifies fd range coparison to mere checking if the result is bigger than the table. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Mar 24 00:01:30 2015 (r280406) +++ head/sys/kern/kern_descrip.c Tue Mar 24 00:10:11 2015 (r280407) @@ -2342,7 +2342,7 @@ fget_unlocked(struct filedesc *fdp, int #endif fdt = fdp->fd_files; - if (fd < 0 || fd >= fdt->fdt_nfiles) + if ((u_int)fd >= fdt->fdt_nfiles) return (EBADF); /* * Fetch the descriptor locklessly. We avoid fdrop() races by From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 02:15:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0D90692; Tue, 24 Mar 2015 02:15:33 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtp002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72BE4250; Tue, 24 Mar 2015 02:15:33 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NLP00HPQ29B9H00@st11p02mm-asmtp002.mac.com>; Tue, 24 Mar 2015 02:15:14 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-03-23_05:2015-03-23,2015-03-23,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1503240021 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278479 - in head: etc sys/kern From: Rui Paulo In-reply-to: <20150323010836.GC6798@dft-labs.eu> Date: Mon, 23 Mar 2015 19:15:11 -0700 Content-transfer-encoding: quoted-printable Message-id: <7FC385F3-9E5E-444D-BA2C-4364E2D46656@me.com> References: <201502092313.t19NDpoS083043@svn.freebsd.org> <20150323010836.GC6798@dft-labs.eu> To: Mateusz Guzik X-Mailer: Apple Mail (2.2070.6) 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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:15:33 -0000 On Mar 22, 2015, at 18:08, Mateusz Guzik wrote: >=20 > On Mon, Feb 09, 2015 at 11:13:51PM +0000, Rui Paulo wrote: >> Author: rpaulo >> Date: Mon Feb 9 23:13:50 2015 >> New Revision: 278479 >> URL: https://svnweb.freebsd.org/changeset/base/278479 >>=20 >> Log: >> Notify devd(8) when a process crashed. >>=20 >> This change implements a notification (via devctl) to userland when >> the kernel produces coredumps after a process has crashed. >> devd can then run a specific command to produce a human readable = crash >> report. The command is most usually a helper that runs gdb/lldb >> commands on the file/coredump pair. It's possible to use this >> functionality for implementing automatic generation of crash = reports. >>=20 >> devd(8) will be notified of the full path of the binary that crashed = and >> the full path of the coredump file. >>=20 >=20 > The more I look at this the more I'm convinced this is quite insecure. >=20 > At a minimum this should also grow a flag to decide whether = notification > about jailed process crashes are allowed. Off by default. >=20 > As it is you pass a path leading to a jail, but that's inherently > untrusted and will lead to trouble. We got sidetracked by the devd-bloat discussion, but I can turn this off = until a better approach is programmed.=20 -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 02:17:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6AAA583B; Tue, 24 Mar 2015 02:17: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 54BDC27C; Tue, 24 Mar 2015 02:17:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O2HHKJ052652; Tue, 24 Mar 2015 02:17:17 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O2HHgU052651; Tue, 24 Mar 2015 02:17:17 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201503240217.t2O2HHgU052651@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 24 Mar 2015 02:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280410 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:17:18 -0000 Author: rpaulo Date: Tue Mar 24 02:17:17 2015 New Revision: 280410 URL: https://svnweb.freebsd.org/changeset/base/280410 Log: Disable coredump_devctl because it could lead to leaking paths to jails. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Mar 24 01:32:46 2015 (r280409) +++ head/sys/kern/kern_sig.c Tue Mar 24 02:17:17 2015 (r280410) @@ -180,7 +180,7 @@ static int set_core_nodump_flag = 0; SYSCTL_INT(_kern, OID_AUTO, nodump_coredump, CTLFLAG_RW, &set_core_nodump_flag, 0, "Enable setting the NODUMP flag on coredump files"); -static int coredump_devctl = 1; +static int coredump_devctl = 0; SYSCTL_INT(_kern, OID_AUTO, coredump_devctl, CTLFLAG_RW, &coredump_devctl, 0, "Generate a devctl notification when processes coredump"); From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 02:25:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1CFFB47 for ; Tue, 24 Mar 2015 02:25:19 +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 D5F86383 for ; Tue, 24 Mar 2015 02:25:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O2PJao090994 for ; Tue, 24 Mar 2015 02:25:19 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t2O2PJZL090993 for svn-src-head@freebsd.org; Tue, 24 Mar 2015 02:25:19 GMT (envelope-from bdrewery) Received: (qmail 21888 invoked from network); 23 Mar 2015 21:25:18 -0500 Received: from unknown (HELO blah) (freebsd@shatow.net@10.10.1.90) by sweb.xzibition.com with ESMTPA; 23 Mar 2015 21:25:18 -0500 Message-ID: <5510CB0E.5010208@FreeBSD.org> Date: Mon, 23 Mar 2015 21:25:18 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.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: r280410 - head/sys/kern References: <201503240217.t2O2HHgU052651@svn.freebsd.org> In-Reply-To: <201503240217.t2O2HHgU052651@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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:25:20 -0000 On 3/23/15 9:17 PM, Rui Paulo wrote: > Author: rpaulo > Date: Tue Mar 24 02:17:17 2015 > New Revision: 280410 > URL: https://svnweb.freebsd.org/changeset/base/280410 > > Log: > Disable coredump_devctl because it could lead to leaking paths to > jails. > > Modified: > head/sys/kern/kern_sig.c > > Modified: head/sys/kern/kern_sig.c > ============================================================================== > --- head/sys/kern/kern_sig.c Tue Mar 24 01:32:46 2015 (r280409) > +++ head/sys/kern/kern_sig.c Tue Mar 24 02:17:17 2015 (r280410) > @@ -180,7 +180,7 @@ static int set_core_nodump_flag = 0; > SYSCTL_INT(_kern, OID_AUTO, nodump_coredump, CTLFLAG_RW, &set_core_nodump_flag, > 0, "Enable setting the NODUMP flag on coredump files"); > > -static int coredump_devctl = 1; > +static int coredump_devctl = 0; > SYSCTL_INT(_kern, OID_AUTO, coredump_devctl, CTLFLAG_RW, &coredump_devctl, > 0, "Generate a devctl notification when processes coredump"); > > If there is a security concern about this feature I think more needs to be done than just flipping the default. It could easily be forgotten about and make a release. -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 02:35:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86330D09; Tue, 24 Mar 2015 02:35:47 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58F95658; Tue, 24 Mar 2015 02:35:47 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NLP00LO837I0E40@st11p02mm-asmtp001.mac.com>; Tue, 24 Mar 2015 02:35:45 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-03-23_05:2015-03-23,2015-03-23,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1503240024 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r280410 - head/sys/kern From: Rui Paulo In-reply-to: <5510CB0E.5010208@FreeBSD.org> Date: Mon, 23 Mar 2015 19:35:42 -0700 Content-transfer-encoding: quoted-printable Message-id: <29715C14-0AC2-43A2-A718-E89AC3C57AC0@me.com> References: <201503240217.t2O2HHgU052651@svn.freebsd.org> <5510CB0E.5010208@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.2070.6) 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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:35:47 -0000 On Mar 23, 2015, at 19:25, Bryan Drewery wrote: >=20 > On 3/23/15 9:17 PM, Rui Paulo wrote: >> Author: rpaulo >> Date: Tue Mar 24 02:17:17 2015 >> New Revision: 280410 >> URL: https://svnweb.freebsd.org/changeset/base/280410 >>=20 >> Log: >> Disable coredump_devctl because it could lead to leaking paths to >> jails. >>=20 >> Modified: >> head/sys/kern/kern_sig.c >>=20 >> Modified: head/sys/kern/kern_sig.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_sig.c Tue Mar 24 01:32:46 2015 = (r280409) >> +++ head/sys/kern/kern_sig.c Tue Mar 24 02:17:17 2015 = (r280410) >> @@ -180,7 +180,7 @@ static int set_core_nodump_flag =3D 0; >> SYSCTL_INT(_kern, OID_AUTO, nodump_coredump, CTLFLAG_RW, = &set_core_nodump_flag, >> 0, "Enable setting the NODUMP flag on coredump files"); >>=20 >> -static int coredump_devctl =3D 1; >> +static int coredump_devctl =3D 0; >> SYSCTL_INT(_kern, OID_AUTO, coredump_devctl, CTLFLAG_RW, = &coredump_devctl, >> 0, "Generate a devctl notification when processes coredump"); >>=20 >>=20 >=20 > If there is a security concern about this feature I think more needs = to be done than just flipping the default. It could easily be forgotten = about and make a release. Sure, but to be honest there are already sysctls that make your system = insecure and we've been making releases with them for many years. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 02:47:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34E83F38 for ; Tue, 24 Mar 2015 02:47: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 F189F7B1 for ; Tue, 24 Mar 2015 02:47:14 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O2lExU097780 for ; Tue, 24 Mar 2015 02:47:14 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t2O2lEhM097777 for svn-src-head@freebsd.org; Tue, 24 Mar 2015 02:47:14 GMT (envelope-from bdrewery) Received: (qmail 5717 invoked from network); 23 Mar 2015 21:47:11 -0500 Received: from unknown (HELO blah) (freebsd@shatow.net@10.10.1.90) by sweb.xzibition.com with ESMTPA; 23 Mar 2015 21:47:11 -0500 Message-ID: <5510D02F.2080007@FreeBSD.org> Date: Mon, 23 Mar 2015 21:47:11 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Rui Paulo Subject: Re: svn commit: r280410 - head/sys/kern References: <201503240217.t2O2HHgU052651@svn.freebsd.org> <5510CB0E.5010208@FreeBSD.org> <29715C14-0AC2-43A2-A718-E89AC3C57AC0@me.com> In-Reply-To: <29715C14-0AC2-43A2-A718-E89AC3C57AC0@me.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:47:15 -0000 On 3/23/15 9:35 PM, Rui Paulo wrote: > On Mar 23, 2015, at 19:25, Bryan Drewery wrote: >> >> On 3/23/15 9:17 PM, Rui Paulo wrote: >>> Author: rpaulo >>> Date: Tue Mar 24 02:17:17 2015 >>> New Revision: 280410 >>> URL: https://svnweb.freebsd.org/changeset/base/280410 >>> >>> Log: >>> Disable coredump_devctl because it could lead to leaking paths to >>> jails. >>> >>> Modified: >>> head/sys/kern/kern_sig.c >>> >>> Modified: head/sys/kern/kern_sig.c >>> ============================================================================== >>> --- head/sys/kern/kern_sig.c Tue Mar 24 01:32:46 2015 (r280409) >>> +++ head/sys/kern/kern_sig.c Tue Mar 24 02:17:17 2015 (r280410) >>> @@ -180,7 +180,7 @@ static int set_core_nodump_flag = 0; >>> SYSCTL_INT(_kern, OID_AUTO, nodump_coredump, CTLFLAG_RW, &set_core_nodump_flag, >>> 0, "Enable setting the NODUMP flag on coredump files"); >>> >>> -static int coredump_devctl = 1; >>> +static int coredump_devctl = 0; >>> SYSCTL_INT(_kern, OID_AUTO, coredump_devctl, CTLFLAG_RW, &coredump_devctl, >>> 0, "Generate a devctl notification when processes coredump"); >>> >>> >> >> If there is a security concern about this feature I think more needs to be done than just flipping the default. It could easily be forgotten about and make a release. > > Sure, but to be honest there are already sysctls that make your system insecure and we've been making releases with them for many years. > > -- > Rui Paulo > I just think the known issue should be documented at the least. -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 04:58:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C79E82AD; Tue, 24 Mar 2015 04:58:20 +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 142767D6; Tue, 24 Mar 2015 04:58:20 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 44209781235; Tue, 24 Mar 2015 15:58:15 +1100 (AEDT) Date: Tue, 24 Mar 2015 15:58:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mateusz Guzik Subject: Re: svn commit: r280407 - head/sys/kern In-Reply-To: <201503240010.t2O0ACZb089906@svn.freebsd.org> Message-ID: <20150324135350.N1665@besplex.bde.org> References: <201503240010.t2O0ACZb089906@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=A5NVYcmG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=7mZd-1maibRHfPAOe-sA:9 a=XooPTRC4dljZ9avz:21 a=AhD2TEE5LKyrGx4Z: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-1 Precedence: list List-Id: SVN 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 Mar 2015 04:58:21 -0000 On Tue, 24 Mar 2015, Mateusz Guzik wrote: > Log: > filedesc: microoptimize fget_unlocked by getting rid of fd < 0 branch This has no effect. Compilers optimize to the equivalent of the the unsigned cast hack if this is good. On x86, it is good since no instructions are needed for the conversion, and the only difference between the code generated by if (fd >= fdt->fdt_nfiles) and if (fd < 0 || fd >= fdt->fdt_nfiles) is to change from jl (jump if less than) to jb (jump if below) (both jumps over the if clause). Negative values satisfy jl but not jb. > Casting fd to an unsigned type simplifies fd range coparison to mere checking > if the result is bigger than the table. No, it obfuscates the range comparison. On some arches, conversion to unsigned is slow. Then compilers should optimize in the opposite direction by first undoing the bogus cast to get back to the range check and then optimizing the range check using the best strategy. Compilers should probably first undo the bogus cast even on x86, so as to reduce to the range check case. Range checks are more important and more uniform than bogus casts, so they are more likely to be optimized. Similarly if fd has type u_int to begin with. (Grosser forms of the obfuscation do this. The gross forms are still common :-(. The first one in syscalls.master is "u_int fd" for dup(). But this doesn't even survive as far as do_dup(), since sys_dup() explicitly converts to int. The conversions are: - the arg "int fd" is type-punned to "u_int fd" in the args struct - uap->fd is cast to before passing it to do_dup(). dup2() is similar. The first one in syscalls.master that uses the obfuscation is getgroups() or perhaps getlogin(). The conversions and obfuscations for getgroups are: - the arg "int gidsetlen" is type-punned to "u_int gidsetsize" in the args struct. This also converts the name to a worse one. The arg gives the number of elements, not a length or a size - uap->gidsetsize is compared with a maximum value. This depends on it being u_int to reject negative values. - uap->gidsetsize passed is without a cast to copyout(). It becomes a size_t. This conversion cannot overflow for the checked value even if uap->gidsetsize has the correct type (int), but an explicit cast might be needed to avoid compiler warnings then (sys_dup() does such a cast). copyout() has related naming problems. Its count arg is 'named' len. bcopy() and memcpy()'s count arg is also named 'len' in FreeBSD, but in C99 and POSIX memcpy()'s count arg is just named 'n'. > Modified: head/sys/kern/kern_descrip.c > ============================================================================== > --- head/sys/kern/kern_descrip.c Tue Mar 24 00:01:30 2015 (r280406) > +++ head/sys/kern/kern_descrip.c Tue Mar 24 00:10:11 2015 (r280407) > @@ -2342,7 +2342,7 @@ fget_unlocked(struct filedesc *fdp, int > #endif > > fdt = fdp->fd_files; > - if (fd < 0 || fd >= fdt->fdt_nfiles) > + if ((u_int)fd >= fdt->fdt_nfiles) > return (EBADF); > /* > * Fetch the descriptor locklessly. We avoid fdrop() races by This undoes the changes that removed the obfuscation. Many commits were involved: - 4.4BSD-Lite1 uses the obfuscation in a modification of the above form, with "u_int" spelled in non-BSD style as "unsigned" for at least most of fcntl(), close(), compat_43_fstat(), fstat(), fpathconf(), flock() and dupfdopen(). - 4.4BSD-Lite2 fixed the style bug, so that these functions used the obfuscation in exactly the above form - FreeBSD never merged these changes from Lite2 - dupfd_open() apparently had the BSD spelling in Lite1, so FreeBSD-2+ always had that. jhb committed my change to unobfuscate dupfd_open() in 2002. - I apparently missed half of the obfuscations with the "unsigned" spelling. But half of them were moved into _fget(), fget() or fget_locked(). - early in 2002, the obfuscation was in _fget() in exactly the above form. _fget() far too large for an inline function, but was static inline in kern_descrip.c. - a little later in 2002, the obfuscated part of _fget() and a little more was turned into fget_locked(). fget_locked() was not too large for an inline function, and was static inline in filedesc.h. But this change turned the obfuscation into nonsense. It added the explicit check for the lower bound, but kept the bogus cast. - I asked the committer to fix this, but my instructions were apparently too tl;dr (maybe 1/4 as long as this mail), and the result was less than reversion to the previous obfuscated version -- it was that plus, plus another bogus cast to u_int (the second one has no effect not already given by the first one), and a comment documenting the obfuscation. The comment takes about 4 times as much source code as the unobfuscated version. - I fixed this in 2004. The unobfuscated version is slightly shorter then the version with the doubled bogus cast, even without the comment. - this version of fget_locked() survived until at least FreeBSD-9, but in recent versions its style regressed in other ways. It expanded from 2 lines of statements to 6 to add 1 assert statement and 3 lines with style bugs (2 extra blank lines and one loss of use of a conditional expression). - fget_locked() seems to be unchanged recently, so it doesn't have the obfuscation. fget_unlocked() is newer than the unobfuscated version of fget_locked(). It is in a different file, but may have copied the unobfuscated range check from fget_locked(). This commit restores the obfuscation to it alone. There are now some other range checks in kern_desc.c that are missing the obfuscation: grepping for "fd <" gives: - a magic treatment for negative fd's in closefrom() - the range check in an unobfuscated by confusing form in fdisused(). The check has to be inverted since it is in a KASSERT(), and the inversion is done by reversing the inequalities. - similarly in fdalloc(). I used to use this hack a lot 30 years ago, but stopped when compilers got better 20-25 years ago. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 05:52:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 612ABF80; Tue, 24 Mar 2015 05: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 42334D2D; Tue, 24 Mar 2015 05:52:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O5qVnb055013; Tue, 24 Mar 2015 05:52:31 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O5qTsV055002; Tue, 24 Mar 2015 05:52:29 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201503240552.t2O5qTsV055002@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Tue, 24 Mar 2015 05:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280413 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 05:52:31 -0000 Author: edwin Date: Tue Mar 24 05:52:28 2015 New Revision: 280413 URL: https://svnweb.freebsd.org/changeset/base/280413 Log: MFV of 280411,tzdata{2015b} Release 2015b - 2015-03-19 23:28:11 -0700 Changes affecting future time stamps Mongolia will start observing DST again this year, from the last Saturday in March at 02:00 to the last Saturday in September at 00:00. (Thanks to Ganbold Tsagaankhuu.) Palestine will start DST on March 28, not March 27. Also, correct the fall 2014 transition from September 26 to October 24. Adjust future predictions accordingly. (Thanks to Steffen Thorsen.) Changes affecting past time stamps The 1982 zone shift in Pacific/Easter has been corrected, fixing a 2015a regression. (Thanks to Stuart Bishop for reporting the problem.) Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, these changes affect UTC offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: America/Antigua, America/Cayman, Pacific/Midway, and Pacific/Saipan. Changes affecting time zone abbreviations Correct the 1992-2010 DST abbreviation in Volgograd from "MSK" to "MSD". (Thanks to Hank W.) Modified: head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/europe head/contrib/tzdata/leap-seconds.list 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 24 05:50:39 2015 (r280412) +++ head/contrib/tzdata/asia Tue Mar 24 05:52:28 2015 (r280413) @@ -1904,6 +1904,13 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # was at the start of 2008-03-31 (the day of Steffen Thorsen's report); # this is almost surely wrong. +# From Ganbold Tsagaankhuu (2015-03-10): +# It seems like yesterday Mongolian Government meeting has concluded to use +# daylight saving time in Mongolia.... Starting at 2:00AM of last Saturday of +# March 2015, daylight saving time starts. And 00:00AM of last Saturday of +# September daylight saving time ends. Source: +# http://zasag.mn/news/view/8969 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Mongol 1983 1984 - Apr 1 0:00 1:00 S Rule Mongol 1983 only - Oct 1 0:00 0 - @@ -1924,6 +1931,8 @@ Rule Mongol 1984 1998 - Sep lastSun 0:00 Rule Mongol 2001 only - Apr lastSat 2:00 1:00 S Rule Mongol 2001 2006 - Sep lastSat 2:00 0 - Rule Mongol 2002 2006 - Mar lastSat 2:00 1:00 S +Rule Mongol 2015 max - Mar lastSat 2:00 1:00 S +Rule Mongol 2015 max - Sep lastSat 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] # Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta @@ -2342,13 +2351,19 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # official source...: # http://www.palestinecabinet.gov.ps/ar/Views/ViewDetails.aspx?pid=1252 -# From Paul Eggert (2013-09-24): -# For future dates, guess the last Thursday in March at 24:00 through -# the first Friday on or after September 21 at 00:00. This is consistent with -# the predictions in today's editions of the following URLs, -# which are for Gaza and Hebron respectively: -# http://www.timeanddate.com/worldclock/timezone.html?n=702 -# http://www.timeanddate.com/worldclock/timezone.html?n=2364 +# From Steffen Thorsen (2015-03-03): +# Sources such as http://www.alquds.com/news/article/view/id/548257 +# and http://www.raya.ps/ar/news/890705.html say Palestine areas will +# start DST on 2015-03-28 00:00 which is one day later than expected. +# +# From Paul Eggert (2015-03-03): +# http://www.timeanddate.com/time/change/west-bank/ramallah?year=2014 +# says that the fall 2014 transition was Oct 23 at 24:00. +# For future dates, guess the last Friday in March at 24:00 through +# the first Friday on or after October 21 at 00:00. This is consistent with +# the predictions in today's editions of the following URLs: +# http://www.timeanddate.com/time/change/gaza-strip/gaza +# http://www.timeanddate.com/time/change/west-bank/hebron # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -2374,9 +2389,11 @@ Rule Palestine 2011 only - Apr 1 0:01 1 Rule Palestine 2011 only - Aug 1 0:00 0 - Rule Palestine 2011 only - Aug 30 0:00 1:00 S Rule Palestine 2011 only - Sep 30 0:00 0 - -Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S +Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S Rule Palestine 2012 only - Sep 21 1:00 0 - -Rule Palestine 2013 max - Sep Fri>=21 0:00 0 - +Rule Palestine 2013 only - Sep Fri>=21 0:00 0 - +Rule Palestine 2014 max - Oct Fri>=21 0:00 0 - +Rule Palestine 2015 max - Mar lastFri 24:00 1:00 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Tue Mar 24 05:50:39 2015 (r280412) +++ head/contrib/tzdata/australasia Tue Mar 24 05:52:28 2015 (r280413) @@ -373,6 +373,7 @@ Zone Pacific/Guam -14:21:00 - LMT 1844 D 9:39:00 - LMT 1901 # Agana 10:00 - GST 2000 Dec 23 # Guam 10:00 - ChST # Chamorro Standard Time +Link Pacific/Guam Pacific/Saipan # N Mariana Is # Kiribati # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -388,12 +389,7 @@ Zone Pacific/Kiritimati -10:29:20 - LMT 14:00 - LINT # N Mariana Is -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Saipan -14:17:00 - LMT 1844 Dec 31 - 9:43:00 - LMT 1901 - 9:00 - MPT 1969 Oct # N Mariana Is Time - 10:00 - MPT 2000 Dec 23 - 10:00 - ChST # Chamorro Standard Time +# See Pacific/Guam. # Marshall Is # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -563,6 +559,7 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1 -11:00 - NST 1967 Apr # N=Nome -11:00 - BST 1983 Nov 30 # B=Bering -11:00 - SST # S=Samoa +Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands # Samoa (formerly and also known as Western Samoa) @@ -744,23 +741,7 @@ Zone Pacific/Funafuti 11:56:52 - LMT 190 # uninhabited # Midway -# -# From Mark Brader (2005-01-23): -# [Fallacies and Fantasies of Air Transport History, by R.E.G. Davies, -# published 1994 by Paladwr Press, McLean, VA, USA; ISBN 0-9626483-5-3] -# reproduced a Pan American Airways timetable from 1936, for their weekly -# "Orient Express" flights between San Francisco and Manila, and connecting -# flights to Chicago and the US East Coast. As it uses some time zone -# designations that I've never seen before:.... -# Fri. 6:30A Lv. HONOLOLU (Pearl Harbor), H.I. H.L.T. Ar. 5:30P Sun. -# " 3:00P Ar. MIDWAY ISLAND . . . . . . . . . M.L.T. Lv. 6:00A " -# -Zone Pacific/Midway -11:49:28 - LMT 1901 - -11:00 - NST 1956 Jun 3 - -11:00 1:00 NDT 1956 Sep 2 - -11:00 - NST 1967 Apr # N=Nome - -11:00 - BST 1983 Nov 30 # B=Bering - -11:00 - SST # S=Samoa +# See Pacific/Pago_Pago. # Palmyra # uninhabited since World War II; was probably like Pacific/Kiritimati Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Tue Mar 24 05:50:39 2015 (r280412) +++ head/contrib/tzdata/europe Tue Mar 24 05:52:28 2015 (r280413) @@ -2400,7 +2400,7 @@ Zone Europe/Volgograd 2:57:40 - LMT 192 4:00 Russia VOL%sT 1989 Mar 26 2:00s # Volgograd T 3:00 Russia VOL%sT 1991 Mar 31 2:00s 4:00 - VOLT 1992 Mar 29 2:00s - 3:00 Russia MSK 2011 Mar 27 2:00s + 3:00 Russia MSK/MSD 2011 Mar 27 2:00s 4:00 - MSK 2014 Oct 26 2:00s 3:00 - MSK Modified: head/contrib/tzdata/leap-seconds.list ============================================================================== --- head/contrib/tzdata/leap-seconds.list Tue Mar 24 05:50:39 2015 (r280412) +++ head/contrib/tzdata/leap-seconds.list Tue Mar 24 05:52:28 2015 (r280413) @@ -131,10 +131,10 @@ # over the last few minutes of the day. The frequency of the local # clock is decreased (or increased) to realize the positive (or # negative) leap second. This method removes the time step described -# above. Although the long-term behavior of the time scale is correct -# in this case, this method introduces an error during the adjustment -# period both in time and in frequency with respect to the official -# defintion of UTC. +# above. Although the long-term behavior of the time scale is correct +# in this case, this method introduces an error during the adjustment +# period both in time and in frequency with respect to the official +# definition of UTC. # # Questions or comments to: # Judah Levine Modified: head/contrib/tzdata/northamerica ============================================================================== --- head/contrib/tzdata/northamerica Tue Mar 24 05:50:39 2015 (r280412) +++ head/contrib/tzdata/northamerica Tue Mar 24 05:52:28 2015 (r280413) @@ -2312,8 +2312,24 @@ Zone America/Dawson -9:17:40 - LMT 1900 # "...the new time zone will come into effect at two o'clock on the first Sunday # of February, when we will have to advance the clock one hour from its current # time..." -# # Also, the new zone will not use DST. +# +# From Carlos Raúl Perasso (2015-02-02): +# The decree that modifies the Mexican Hour System Law has finally +# been published at the Diario Oficial de la Federación +# http://www.dof.gob.mx/nota_detalle.php?codigo=5380123&fecha=31/01/2015 +# It establishes 5 zones for Mexico: +# 1- Zona Centro (Central Zone): Corresponds to longitude 90 W, +# includes most of Mexico, excluding what's mentioned below. +# 2- Zona Pacífico (Pacific Zone): Longitude 105 W, includes the +# states of Baja California Sur; Chihuahua; Nayarit (excluding Bahía +# de Banderas which lies in Central Zone); Sinaloa and Sonora. +# 3- Zona Noroeste (Northwest Zone): Longitude 120 W, includes the +# state of Baja California. +# 4- Zona Sureste (Southeast Zone): Longitude 75 W, includes the state +# of Quintana Roo. +# 5- The islands, reefs and keys shall take their timezone from the +# longitude they are located at. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Mexico 1939 only - Feb 5 0:00 1:00 D @@ -2508,13 +2524,8 @@ Zone America/Santa_Isabel -7:39:28 - LMT ############################################################################### # Anguilla -# See America/Port_of_Spain. - # Antigua and Barbuda -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone America/Antigua -4:07:12 - LMT 1912 Mar 2 - -5:00 - EST 1951 - -4:00 - AST +# See America/Port_of_Spain. # Bahamas # @@ -2581,10 +2592,7 @@ Zone Atlantic/Bermuda -4:19:18 - LMT 193 -4:00 US A%sT # Cayman Is -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown - -5:07:11 - KMT 1912 Feb # Kingston Mean Time - -5:00 - EST +# See America/Panama. # Costa Rica @@ -3107,6 +3115,7 @@ Zone America/Managua -5:45:08 - LMT 1890 Zone America/Panama -5:18:08 - LMT 1890 -5:19:36 - CMT 1908 Apr 22 # Colón Mean Time -5:00 - EST +Link America/Panama America/Cayman # Puerto Rico # There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'. Modified: head/contrib/tzdata/southamerica ============================================================================== --- head/contrib/tzdata/southamerica Tue Mar 24 05:50:39 2015 (r280412) +++ head/contrib/tzdata/southamerica Tue Mar 24 05:52:28 2015 (r280413) @@ -1206,10 +1206,13 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # 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 -# From Juan Correa (2015-01-28): -# ... today the Ministry of Energy announced that Chile will drop DST, will keep -# "summer time" (UTC -3 / UTC -5) all year round.... -# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html +# From Eduardo Romero Urra (2015-03-03): +# Today has been published officially that Chile will use the DST time +# permanently until March 25 of 2017 +# http://www.diariooficial.interior.gob.cl/media/2015/03/03/1-large.jpg +# +# From Paul Eggert (2015-03-03): +# For now, assume that the extension will persist indefinitely. # NOTE: ChileAQ rules for Antarctic bases are stored separately in the # 'antarctica' file. @@ -1268,7 +1271,7 @@ Zone America/Santiago -4:42:46 - LMT 189 -3:00 - CLT Zone Pacific/Easter -7:17:44 - LMT 1890 -7:17:28 - EMT 1932 Sep # Easter Mean Time - -7:00 Chile EAS%sT 1982 Mar 13 3:00u # Easter Time + -7:00 Chile EAS%sT 1982 Mar 14 3:00u # Easter Time -6:00 Chile EAS%sT 2015 Apr 26 3:00u -5:00 - EAST # @@ -1603,6 +1606,7 @@ Zone America/Port_of_Spain -4:06:04 - LM # These all agree with Trinidad and Tobago since 1970. Link America/Port_of_Spain America/Anguilla +Link America/Port_of_Spain America/Antigua Link America/Port_of_Spain America/Dominica Link America/Port_of_Spain America/Grenada Link America/Port_of_Spain America/Guadeloupe From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 09:21:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7C8E4FC; Tue, 24 Mar 2015 09: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 C30207BA; Tue, 24 Mar 2015 09:21:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O9LsU7053782; Tue, 24 Mar 2015 09:21:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O9Lsjs053781; Tue, 24 Mar 2015 09:21:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503240921.t2O9Lsjs053781@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 24 Mar 2015 09:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280429 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 09:21:54 -0000 Author: hselasky Date: Tue Mar 24 09:21:53 2015 New Revision: 280429 URL: https://svnweb.freebsd.org/changeset/base/280429 Log: Use the feedback value from the synchronization endpoint as fallback when there is no recording channel. MFC after: 3 days PR: 198444 Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Tue Mar 24 08:27:01 2015 (r280428) +++ head/sys/dev/sound/usb/uaudio.c Tue Mar 24 09:21:53 2015 (r280429) @@ -2026,6 +2026,13 @@ uaudio_chan_play_sync_callback(struct us DPRINTF("Comparing %d Hz :: %d Hz\n", (int)temp, (int)sample_rate); + /* + * Use feedback value as fallback when there is no + * recording channel: + */ + if (ch->priv_sc->sc_rec_chan.num_alt == 0) + ch->jitter_curr = temp - sample_rate; + ch->feedback_rate = temp; break; From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 09:46:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EDAAB54; Tue, 24 Mar 2015 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 7A8749EA; Tue, 24 Mar 2015 09:46:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2O9kmrm064462; Tue, 24 Mar 2015 09:46:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2O9kmIS064461; Tue, 24 Mar 2015 09:46:48 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201503240946.t2O9kmIS064461@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 24 Mar 2015 09:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280430 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 09:46:48 -0000 Author: bz Date: Tue Mar 24 09:46:47 2015 New Revision: 280430 URL: https://svnweb.freebsd.org/changeset/base/280430 Log: Make ix_crcstrip a public symbol for the moment; it probably is not the right solution but I will leave it to experts to untangle this problem to properly stop the build failures. At the moment only if_ix.c includes dev/netmap/ixgbe_netmap.h which is good as ixgbe_netmap.h defines a couple of (file) static variables--thus local to if_ix.c. static int ix_crcstrip however now also got checked from ix_txrx.c (as an extern) and should not be visible there. In fact we do see powerpc and powerpc64 build failures because of this. It is unclear to me why on other (clang built?) architectures this does not lead to a reference of an undefined symbol and similar build breakage. Modified: head/sys/dev/netmap/ixgbe_netmap.h Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Tue Mar 24 09:21:53 2015 (r280429) +++ head/sys/dev/netmap/ixgbe_netmap.h Tue Mar 24 09:46:47 2015 (r280430) @@ -61,7 +61,8 @@ * count packets that might be missed due to lost interrupts. */ SYSCTL_DECL(_dev_netmap); -static int ix_rx_miss, ix_rx_miss_bufs, ix_crcstrip; +static int ix_rx_miss, ix_rx_miss_bufs; +int ix_crcstrip; SYSCTL_INT(_dev_netmap, OID_AUTO, ix_crcstrip, CTLFLAG_RW, &ix_crcstrip, 0, "strip CRC on rx frames"); SYSCTL_INT(_dev_netmap, OID_AUTO, ix_rx_miss, From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 11:22:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6666A69; Tue, 24 Mar 2015 11: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 915F2893; Tue, 24 Mar 2015 11:22:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OBMDZW012311; Tue, 24 Mar 2015 11:22:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OBMD1P012310; Tue, 24 Mar 2015 11:22:13 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503241122.t2OBMD1P012310@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 24 Mar 2015 11:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280431 - head/sys/modules/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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 11:22:13 -0000 Author: arybchik Date: Tue Mar 24 11:22:12 2015 New Revision: 280431 URL: https://svnweb.freebsd.org/changeset/base/280431 Log: sfxge: cleanup: remove trailing whitespaces Sponsored by: Solarflare Communications, Inc. Modified: head/sys/modules/sfxge/Makefile Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Tue Mar 24 09:46:47 2015 (r280430) +++ head/sys/modules/sfxge/Makefile Tue Mar 24 11:22:12 2015 (r280431) @@ -14,7 +14,7 @@ SRCS+= sfxge_port.c sfxge_rx.c sfxge_tx. SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h sfxge_version.h .PATH: ${.CURDIR}/../../dev/sfxge/common -SRCS+= efx_ev.c efx_intr.c efx_mac.c efx_mcdi.c efx_nic.c +SRCS+= efx_ev.c efx_intr.c efx_mac.c efx_mcdi.c efx_nic.c SRCS+= efx_nvram.c efx_phy.c efx_port.c efx_rx.c efx_sram.c efx_tx.c SRCS+= efx_vpd.c efx_wol.c SRCS+= efsys.h @@ -22,7 +22,7 @@ SRCS+= efx.h efx_impl.h efx_mcdi.h efx_r SRCS+= efx_regs_mcdi.h efx_regs_pci.h efx_types.h SRCS+= siena_mac.c siena_nic.c siena_nvram.c siena_phy.c -SRCS+= siena_sram.c siena_vpd.c +SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h DEBUG_FLAGS= -DDEBUG=1 From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 11:25:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B670C5A; Tue, 24 Mar 2015 11: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 065058C0; Tue, 24 Mar 2015 11:25:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OBPKEc012749; Tue, 24 Mar 2015 11:25:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OBPKf9012748; Tue, 24 Mar 2015 11:25:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503241125.t2OBPKf9012748@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 24 Mar 2015 11:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280432 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 11:25:21 -0000 Author: arybchik Date: Tue Mar 24 11:25:19 2015 New Revision: 280432 URL: https://svnweb.freebsd.org/changeset/base/280432 Log: sfxge: cleanup: add a blank line before each #if to improve readability Sponsored by: Solarflare Communications, Inc. Modified: head/sys/dev/sfxge/sfxge.h Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Tue Mar 24 11:22:12 2015 (r280431) +++ head/sys/dev/sfxge/sfxge.h Tue Mar 24 11:25:19 2015 (r280432) @@ -55,25 +55,32 @@ */ #define CACHE_LINE_SIZE 128 #endif + #ifndef IFCAP_LINKSTATE #define IFCAP_LINKSTATE 0 #endif + #ifndef IFCAP_VLAN_HWTSO #define IFCAP_VLAN_HWTSO 0 #endif + #ifndef IFM_10G_T #define IFM_10G_T IFM_UNKNOWN #endif + #ifndef IFM_10G_KX4 #define IFM_10G_KX4 IFM_10G_CX4 #endif + #if (__FreeBSD_version >= 800501 && __FreeBSD_version < 900000) || \ __FreeBSD_version >= 900003 #define SFXGE_HAVE_DESCRIBE_INTR #endif + #ifdef IFM_ETH_RXPAUSE #define SFXGE_HAVE_PAUSE_MEDIAOPTS #endif + #ifndef CTLTYPE_U64 #define CTLTYPE_U64 CTLTYPE_QUAD #endif From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 11:33:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46F9CBB; Tue, 24 Mar 2015 11: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 31D8E9B6; Tue, 24 Mar 2015 11:33:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OBXZ2f017301; Tue, 24 Mar 2015 11:33:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OBXZal017300; Tue, 24 Mar 2015 11:33:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503241133.t2OBXZal017300@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 24 Mar 2015 11:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280433 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 11:33:35 -0000 Author: arybchik Date: Tue Mar 24 11:33:34 2015 New Revision: 280433 URL: https://svnweb.freebsd.org/changeset/base/280433 Log: sfxge: cleanup: fix index variable type to match upper boundary type 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 24 11:25:19 2015 (r280432) +++ head/sys/dev/sfxge/sfxge_tx.c Tue Mar 24 11:33:34 2015 (r280433) @@ -667,7 +667,7 @@ void sfxge_if_qflush(struct ifnet *ifp) { struct sfxge_softc *sc; - int i; + unsigned int i; sc = ifp->if_softc; From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 12:44:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C825FFC5; Tue, 24 Mar 2015 12:44: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 4F7CF103; Tue, 24 Mar 2015 12:44:09 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2OCi6GK003261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 24 Mar 2015 15:44:06 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2OCi6wI003260; Tue, 24 Mar 2015 15:44:06 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 24 Mar 2015 15:44:06 +0300 From: Gleb Smirnoff To: Andrew Rybchenko Subject: Re: svn commit: r280374 - head/sys/dev/sfxge Message-ID: <20150324124405.GM64665@FreeBSD.org> References: <201503231544.t2NFiI90045847@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503231544.t2NFiI90045847@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-1 Precedence: list List-Id: SVN 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 Mar 2015 12:44:10 -0000 On Mon, Mar 23, 2015 at 03:44:18PM +0000, Andrew Rybchenko wrote: A> Author: arybchik A> Date: Mon Mar 23 15:44:17 2015 A> New Revision: 280374 A> URL: https://svnweb.freebsd.org/changeset/base/280374 A> A> Log: A> sfxge: assert either kernel or internal copy of interface flags A> A> ioctl to put interface down sets ifp->if_flags which holds the intended A> administratively defined state and calls driver callback to apply it. A> When everything is done, driver updates internal copy of A> interface flags sc->if_flags which holds the operational state. A> So, transmit from Rx path is possible when interface is intended to be A> administratively down in accordance with ifp->if_flags, but not applied A> yet and the operational state is up in accordance with sc->if_flags. A> A> Sponsored by: Solarflare Communications, Inc. A> Differential Revision: https://reviews.freebsd.org/D2075 In the future ifnet API, that is now being developed in projects/ifnet, the stack promises to change if_flags only via SIOCSIFFLAGS, so driver can and should cashe the value and later access it using internal locking. The if_flags need not be accessed at all by the driver. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 12:46:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB9961C7; Tue, 24 Mar 2015 12:46: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 D6BB512D; Tue, 24 Mar 2015 12:46:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OCkMvj050596; Tue, 24 Mar 2015 12:46:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OCkMKA050595; Tue, 24 Mar 2015 12:46:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503241246.t2OCkMKA050595@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Mar 2015 12:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280434 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 12:46:23 -0000 Author: kib Date: Tue Mar 24 12:46:21 2015 New Revision: 280434 URL: https://svnweb.freebsd.org/changeset/base/280434 Log: Assert that the mapping loop makes progress. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/iommu/intel_idpgtbl.c Modified: head/sys/x86/iommu/intel_idpgtbl.c ============================================================================== --- head/sys/x86/iommu/intel_idpgtbl.c Tue Mar 24 11:33:34 2015 (r280433) +++ head/sys/x86/iommu/intel_idpgtbl.c Tue Mar 24 12:46:21 2015 (r280434) @@ -465,6 +465,7 @@ ctx_map_buf_locked(struct dmar_ctx *ctx, KASSERT(size >= pg_sz, ("mapping loop overflow %p %jx %jx %jx", ctx, (uintmax_t)base, (uintmax_t)size, (uintmax_t)pg_sz)); + KASSERT(pg_sz > 0, ("pg_sz 0 lvl %d", lvl)); pte = ctx_pgtbl_map_pte(ctx, base, lvl, flags, &idx, &sf); if (pte == NULL) { KASSERT((flags & DMAR_PGF_WAITOK) == 0, From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 12:48:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C57B56D; Tue, 24 Mar 2015 12: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 47DFE162; Tue, 24 Mar 2015 12:48:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OCmqUp051027; Tue, 24 Mar 2015 12:48:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OCmqkm051026; Tue, 24 Mar 2015 12:48:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503241248.t2OCmqkm051026@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Mar 2015 12:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280435 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 12:48:52 -0000 Author: kib Date: Tue Mar 24 12:48:51 2015 New Revision: 280435 URL: https://svnweb.freebsd.org/changeset/base/280435 Log: When mapping an allocated entry, use the entry size, instead of the requested size. If tag restrictions caused split entry, its size is less then requsted. Hardware provided by: Michael Fuckner Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/iommu/intel_gas.c Modified: head/sys/x86/iommu/intel_gas.c ============================================================================== --- head/sys/x86/iommu/intel_gas.c Tue Mar 24 12:46:21 2015 (r280434) +++ head/sys/x86/iommu/intel_gas.c Tue Mar 24 12:48:51 2015 (r280435) @@ -649,7 +649,7 @@ dmar_gas_map(struct dmar_ctx *ctx, const entry->flags |= eflags; DMAR_CTX_UNLOCK(ctx); - error = ctx_map_buf(ctx, entry->start, size, ma, + error = ctx_map_buf(ctx, entry->start, entry->end - entry->start, ma, ((eflags & DMAR_MAP_ENTRY_READ) != 0 ? DMAR_PTE_R : 0) | ((eflags & DMAR_MAP_ENTRY_WRITE) != 0 ? DMAR_PTE_W : 0) | ((eflags & DMAR_MAP_ENTRY_SNOOP) != 0 ? DMAR_PTE_SNP : 0) | From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 14:16:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99097B9; Tue, 24 Mar 2015 14:16: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 83A44DCA; Tue, 24 Mar 2015 14:16:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OEGF5j094196; Tue, 24 Mar 2015 14:16:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OEGFpC094195; Tue, 24 Mar 2015 14:16:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503241416.t2OEGFpC094195@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 24 Mar 2015 14:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280436 - head/secure/lib/libcrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 14:16:15 -0000 Author: andrew Date: Tue Mar 24 14:16:14 2015 New Revision: 280436 URL: https://svnweb.freebsd.org/changeset/base/280436 Log: Add the openssl header for arm64. As it is based on MACHINE_CPUARCH it is named opensslconf-aarch64.h. Sponsored by: The FreeBSD Foundation Added: head/secure/lib/libcrypto/opensslconf-aarch64.h (contents, props changed) Added: head/secure/lib/libcrypto/opensslconf-aarch64.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/lib/libcrypto/opensslconf-aarch64.h Tue Mar 24 14:16:14 2015 (r280436) @@ -0,0 +1,242 @@ +/* $FreeBSD$ */ +/* opensslconf.h */ +/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ + +#ifdef __cplusplus +extern "C" { +#endif +/* OpenSSL was configured with the following options: */ +#ifndef OPENSSL_DOING_MAKEDEPEND + + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +#endif +#ifndef OPENSSL_NO_GMP +# define OPENSSL_NO_GMP +#endif +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif +#ifndef OPENSSL_NO_KRB5 +# define OPENSSL_NO_KRB5 +#endif +#ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +#endif +#ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +#endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif +#ifndef OPENSSL_NO_STORE +# define OPENSSL_NO_STORE +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#endif + +#endif /* OPENSSL_DOING_MAKEDEPEND */ + +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +#ifndef OPENSSL_NO_ASM +# define OPENSSL_NO_ASM +#endif +#ifndef OPENSSL_NO_STATIC_ENGINE +# define OPENSSL_NO_STATIC_ENGINE +#endif + +/* The OPENSSL_NO_* macros are also defined as NO_* if the application + asks for it. This is a transient feature that is provided for those + who haven't had the time to do the appropriate changes in their + applications. */ +#ifdef OPENSSL_ALGORITHM_DEFINES +# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) +# define NO_EC_NISTP_64_GCC_128 +# endif +# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) +# define NO_GMP +# endif +# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) +# define NO_JPAKE +# endif +# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) +# define NO_KRB5 +# endif +# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) +# define NO_MD2 +# endif +# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) +# define NO_SCTP +# endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif +# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) +# define NO_STORE +# endif +# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) +# define NO_UNIT_TEST +# endif +#endif + +/* crypto/opensslconf.h.in */ + +/* Generate 80386 code? */ +#undef I386_ONLY + +#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ +#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) +#define ENGINESDIR "/usr/lib/engines" +#define OPENSSLDIR "/etc/ssl" +#endif +#endif + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) +#define IDEA_INT unsigned int +#endif + +#if defined(HEADER_MD2_H) && !defined(MD2_INT) +#define MD2_INT unsigned int +#endif + +#if defined(HEADER_RC2_H) && !defined(RC2_INT) +/* I need to put in a mod for the alpha - eay */ +#define RC2_INT unsigned int +#endif + +#if defined(HEADER_RC4_H) +#if !defined(RC4_INT) +/* using int types make the structure larger but make the code faster + * on most boxes I have tested - up to %20 faster. */ +/* + * I don't know what does "most" mean, but declaring "int" is a must on: + * - Intel P6 because partial register stalls are very expensive; + * - elder Alpha because it lacks byte load/store instructions; + */ +#define RC4_INT unsigned int +#endif +#if !defined(RC4_CHUNK) +/* + * This enables code handling data aligned at natural CPU word + * boundary. See crypto/rc4/rc4_enc.c for further details. + */ +#undef RC4_CHUNK +#endif +#endif + +#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) +/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a + * %20 speed up (longs are 8 bytes, int's are 4). */ +#ifndef DES_LONG +#define DES_LONG unsigned int +#endif +#endif + +#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) +#define CONFIG_HEADER_BN_H +#undef BN_LLONG + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +#define SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#undef THIRTY_TWO_BIT +#endif + +#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) +#define CONFIG_HEADER_RC4_LOCL_H +/* if this is defined data[i] is used instead of *data, this is a %20 + * speedup on x86 */ +#define RC4_INDEX +#endif + +#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) +#define CONFIG_HEADER_BF_LOCL_H +#undef BF_PTR +#endif /* HEADER_BF_LOCL_H */ + +#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) +#define CONFIG_HEADER_DES_LOCL_H +#ifndef DES_DEFAULT_OPTIONS +/* the following is tweaked from a config script, that is why it is a + * protected undef/define */ +#ifndef DES_PTR +#define DES_PTR +#endif + +/* This helps C compiler generate the correct code for multiple functional + * units. It reduces register dependancies at the expense of 2 more + * registers */ +#ifndef DES_RISC1 +#define DES_RISC1 +#endif + +#ifndef DES_RISC2 +#undef DES_RISC2 +#endif + +#if defined(DES_RISC1) && defined(DES_RISC2) +YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! +#endif + +/* Unroll the inner loop, this sometimes helps, sometimes hinders. + * Very mucy CPU dependant */ +#ifndef DES_UNROLL +#define DES_UNROLL +#endif + +/* These default values were supplied by + * Peter Gutman + * They are only used if nothing else has been defined */ +#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) +/* Special defines which change the way the code is built depending on the + CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find + even newer MIPS CPU's, but at the moment one size fits all for + optimization options. Older Sparc's work better with only UNROLL, but + there's no way to tell at compile time what it is you're running on */ + +#if defined( sun ) /* Newer Sparc's */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#elif defined( __ultrix ) /* Older MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined( __osf1__ ) /* Alpha */ +# define DES_PTR +# define DES_RISC2 +#elif defined ( _AIX ) /* RS6000 */ + /* Unknown */ +#elif defined( __hpux ) /* HP-PA */ + /* Unknown */ +#elif defined( __aux ) /* 68K */ + /* Unknown */ +#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ +# define DES_UNROLL +#elif defined( __sgi ) /* Newer MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#endif /* Systems-specific speed defines */ +#endif + +#endif /* DES_DEFAULT_OPTIONS */ +#endif /* HEADER_DES_LOCL_H */ +#ifdef __cplusplus +} +#endif From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 14:23:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59DD55F6; Tue, 24 Mar 2015 14:23: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 44833EDD; Tue, 24 Mar 2015 14:23:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OEN060098662; Tue, 24 Mar 2015 14:23:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OEMxqB098654; Tue, 24 Mar 2015 14:22:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503241422.t2OEMxqB098654@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 24 Mar 2015 14:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280437 - head/contrib/gcc/config/aarch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 14:23:00 -0000 Author: andrew Date: Tue Mar 24 14:22:58 2015 New Revision: 280437 URL: https://svnweb.freebsd.org/changeset/base/280437 Log: Adda minimal gcc config. This is just enough to build the bits of csu we get from gcc, and libgcc_eh. Sponsored by: The FreeBSD Foundation Added: head/contrib/gcc/config/aarch64/ head/contrib/gcc/config/aarch64/aarch64.h (contents, props changed) head/contrib/gcc/config/aarch64/freebsd.h (contents, props changed) Added: head/contrib/gcc/config/aarch64/aarch64.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcc/config/aarch64/aarch64.h Tue Mar 24 14:22:58 2015 (r280437) @@ -0,0 +1,3 @@ +/* $FreeBSD */ + +#define FIRST_PSEUDO_REGISTER 67 Added: head/contrib/gcc/config/aarch64/freebsd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcc/config/aarch64/freebsd.h Tue Mar 24 14:22:58 2015 (r280437) @@ -0,0 +1,6 @@ +/* $FreeBSD$ */ + +#undef INIT_SECTION_ASM_OP +#undef FINI_SECTION_ASM_OP +#define INIT_ARRAY_SECTION_ASM_OP "\t.section\t.init_array,\"aw\",%init_array" +#define FINI_ARRAY_SECTION_ASM_OP "\t.section\t.fini_array,\"aw\",%fini_array" From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 14:51:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 480CB4B8; Tue, 24 Mar 2015 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 32EF02BA; Tue, 24 Mar 2015 14:51:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OEplwO012759; Tue, 24 Mar 2015 14:51:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OEpk6u012758; Tue, 24 Mar 2015 14:51:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503241451.t2OEpk6u012758@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 24 Mar 2015 14:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280439 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 14:51:47 -0000 Author: tuexen Date: Tue Mar 24 14:51:46 2015 New Revision: 280439 URL: https://svnweb.freebsd.org/changeset/base/280439 Log: Fix an accounting bug related to the per stream chunk counter. While there, don't refer to a net articifically. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Mar 24 14:36:10 2015 (r280438) +++ head/sys/netinet/sctputil.c Tue Mar 24 14:51:46 2015 (r280439) @@ -4891,13 +4891,9 @@ sctp_release_pr_sctp_chunk(struct sctp_t chk->rec.data.payloadtype = sp->ppid; chk->rec.data.context = sp->context; chk->flags = sp->act_flags; - if (sp->net) - chk->whoTo = sp->net; - else - chk->whoTo = stcb->asoc.primary_destination; - atomic_add_int(&chk->whoTo->ref_count, 1); + chk->whoTo = NULL; chk->rec.data.TSN_seq = atomic_fetchadd_int(&stcb->asoc.sending_seq, 1); - stcb->asoc.pr_sctp_cnt++; + strq->chunks_on_queues++; TAILQ_INSERT_TAIL(&stcb->asoc.sent_queue, chk, sctp_next); stcb->asoc.sent_queue_cnt++; stcb->asoc.pr_sctp_cnt++; From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 15:05:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F012ADF; Tue, 24 Mar 2015 15:05: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 5A3CB60B; Tue, 24 Mar 2015 15:05:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OF5bZA018189; Tue, 24 Mar 2015 15:05:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OF5buU018188; Tue, 24 Mar 2015 15:05:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503241505.t2OF5buU018188@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 24 Mar 2015 15:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280440 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:05:37 -0000 Author: tuexen Date: Tue Mar 24 15:05:36 2015 New Revision: 280440 URL: https://svnweb.freebsd.org/changeset/base/280440 Log: Fix the bug in the handling of fragmented abandoned SCTP user messages reported in https://code.google.com/p/sctp-refimpl/issues/detail?id=11 Thanks to Lally Singh for reporting it. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue Mar 24 14:51:46 2015 (r280439) +++ head/sys/netinet/sctp_indata.c Tue Mar 24 15:05:36 2015 (r280440) @@ -2597,12 +2597,14 @@ sctp_process_segment_range(struct sctp_t * cumack trackers for first transmissions, * and retransmissions. */ - if ((tp1->whoTo->find_pseudo_cumack == 1) && (tp1->sent < SCTP_DATAGRAM_RESEND) && + if ((tp1->sent < SCTP_DATAGRAM_RESEND) && + (tp1->whoTo->find_pseudo_cumack == 1) && (tp1->snd_count == 1)) { tp1->whoTo->pseudo_cumack = tp1->rec.data.TSN_seq; tp1->whoTo->find_pseudo_cumack = 0; } - if ((tp1->whoTo->find_rtx_pseudo_cumack == 1) && (tp1->sent < SCTP_DATAGRAM_RESEND) && + if ((tp1->sent < SCTP_DATAGRAM_RESEND) && + (tp1->whoTo->find_rtx_pseudo_cumack == 1) && (tp1->snd_count > 1)) { tp1->whoTo->rtx_pseudo_cumack = tp1->rec.data.TSN_seq; tp1->whoTo->find_rtx_pseudo_cumack = 0; @@ -3512,7 +3514,7 @@ sctp_window_probe_recovery(struct sctp_t if ((tp1->sent >= SCTP_DATAGRAM_ACKED) || (tp1->data == NULL)) { /* TSN's skipped we do NOT move back. */ sctp_misc_ints(SCTP_FLIGHT_LOG_DWN_WP_FWD, - tp1->whoTo->flight_size, + tp1->whoTo ? tp1->whoTo->flight_size : 0, tp1->book_size, (uintptr_t) tp1->whoTo, tp1->rec.data.TSN_seq); From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 15:08:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B00BEC78; Tue, 24 Mar 2015 15:08: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 9AEFB63E; Tue, 24 Mar 2015 15:08:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OF8iXp018579; Tue, 24 Mar 2015 15:08:44 GMT (envelope-from lstewart@FreeBSD.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OF8iPD018578; Tue, 24 Mar 2015 15:08:44 GMT (envelope-from lstewart@FreeBSD.org) Message-Id: <201503241508.t2OF8iPD018578@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lstewart set sender to lstewart@FreeBSD.org using -f From: Lawrence Stewart Date: Tue, 24 Mar 2015 15:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280441 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:08:44 -0000 Author: lstewart Date: Tue Mar 24 15:08:43 2015 New Revision: 280441 URL: https://svnweb.freebsd.org/changeset/base/280441 Log: The addition of flowid and flowtype in r280233 and r280237 respectively forgot to extend the IPv6 packet node format string, which causes a build failure when SIFTR is compiled with IPv6 support. Reported by: Lars Eggert Modified: head/sys/netinet/siftr.c Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Tue Mar 24 15:05:36 2015 (r280440) +++ head/sys/netinet/siftr.c Tue Mar 24 15:08:43 2015 (r280441) @@ -448,7 +448,7 @@ siftr_process_pkt(struct pkt_node * pkt_ MAX_LOG_MSG_LEN, "%c,0x%08x,%zd.%06ld,%x:%x:%x:%x:%x:%x:%x:%x,%u,%x:%x:%x:" "%x:%x:%x:%x:%x,%u,%ld,%ld,%ld,%ld,%ld,%u,%u,%u,%u,%u,%u," - "%u,%d,%u,%u,%u,%u,%u,%u\n", + "%u,%d,%u,%u,%u,%u,%u,%u,%u,%u\n", direction[pkt_node->direction], pkt_node->hash, pkt_node->tval.tv_sec, From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 15:45:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30B4672D; Tue, 24 Mar 2015 15:45:47 +0000 (UTC) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19837ABC; Tue, 24 Mar 2015 15:45:46 +0000 (UTC) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPSA id D057BD2A07; Tue, 24 Mar 2015 08:45:45 -0700 (PDT) Date: Tue, 24 Mar 2015 08:45:45 -0700 From: hiren panchasara To: Lawrence Stewart Subject: Re: svn commit: r280441 - head/sys/netinet Message-ID: <20150324154545.GA53237@strugglingcoder.info> References: <201503241508.t2OF8iPD018578@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="c/UxJciryulPFo89" Content-Disposition: inline In-Reply-To: <201503241508.t2OF8iPD018578@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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:45:47 -0000 --c/UxJciryulPFo89 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 03/24/15 at 03:08P, Lawrence Stewart wrote: > Author: lstewart > Date: Tue Mar 24 15:08:43 2015 > New Revision: 280441 > URL: https://svnweb.freebsd.org/changeset/base/280441 >=20 > Log: > The addition of flowid and flowtype in r280233 and r280237 respectively= forgot > to extend the IPv6 packet node format string, which causes a build fail= ure when > SIFTR is compiled with IPv6 support. > =20 > Reported by: Lars Eggert My bad :-( Thanks for quickly fixing this. Hiren --c/UxJciryulPFo89 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJVEYaoXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lKg8H/AuY3mlPlInsWdMS+mD4zPqE XAuQ66QRSSX7m5zbD2bBc6p4GMAckP7cOnFIN5vvzkjNs/B3gPcoRpTAm7u8zgy6 X2ztqrKqWc/VBXDirG1b0F4nfHltKnBff5OczrNOLQSxEUFCnhT15vATIzFn1A3e l2bjdwdS4FCTwLZTj4+XfoBL6/V8DknfvM0rDjbopEaDNLriy0zl8WIoj2iS4rem loFtlv3c1cv1zlfQpuHZu4VqaJo4T+RJmAuz5Orz5F36agfXBoMPenmI/2WXHP89 DeY/MdcKGW+4igk4r8BzzLv2sHWFYxUhqwWJXE1sE+OiwtF7/UK8mFbtkQ+n9Ao= =UHlq -----END PGP SIGNATURE----- --c/UxJciryulPFo89-- From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 16:31:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39589682; Tue, 24 Mar 2015 16:31: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 22877D7; Tue, 24 Mar 2015 16:31:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OGVQbk060591; Tue, 24 Mar 2015 16:31:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OGVNwe060578; Tue, 24 Mar 2015 16:31:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503241631.t2OGVNwe060578@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 24 Mar 2015 16:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280442 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:31:26 -0000 Author: hselasky Date: Tue Mar 24 16:31:22 2015 New Revision: 280442 URL: https://svnweb.freebsd.org/changeset/base/280442 Log: Make all PCM core sysctls tunable and remove redundant TUNABLE() statements. This allows for setting all PCM core parameters in the kernel environment through loader.conf(5) or kenv(1) which is useful for pluggable PCM devices like USB audio devices which might be plugged after that sysctl.conf(5) is executed. Modified: head/sys/dev/sound/pcm/channel.c head/sys/dev/sound/pcm/dsp.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/sndstat.c head/sys/dev/sound/pcm/sound.c head/sys/dev/sound/pcm/vchan.c Modified: head/sys/dev/sound/pcm/channel.c ============================================================================== --- head/sys/dev/sound/pcm/channel.c Tue Mar 24 15:08:43 2015 (r280441) +++ head/sys/dev/sound/pcm/channel.c Tue Mar 24 16:31:22 2015 (r280442) @@ -42,14 +42,13 @@ SND_DECLARE_FILE("$FreeBSD$"); int report_soft_formats = 1; SYSCTL_INT(_hw_snd, OID_AUTO, report_soft_formats, CTLFLAG_RW, - &report_soft_formats, 1, "report software-emulated formats"); + &report_soft_formats, 0, "report software-emulated formats"); int report_soft_matrix = 1; SYSCTL_INT(_hw_snd, OID_AUTO, report_soft_matrix, CTLFLAG_RW, - &report_soft_matrix, 1, "report software-emulated channel matrixing"); + &report_soft_matrix, 0, "report software-emulated channel matrixing"); int chn_latency = CHN_LATENCY_DEFAULT; -TUNABLE_INT("hw.snd.latency", &chn_latency); static int sysctl_hw_snd_latency(SYSCTL_HANDLER_ARGS) @@ -67,12 +66,11 @@ sysctl_hw_snd_latency(SYSCTL_HANDLER_ARG return err; } -SYSCTL_PROC(_hw_snd, OID_AUTO, latency, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_hw_snd, OID_AUTO, latency, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_snd_latency, "I", "buffering latency (0=low ... 10=high)"); int chn_latency_profile = CHN_LATENCY_PROFILE_DEFAULT; -TUNABLE_INT("hw.snd.latency_profile", &chn_latency_profile); static int sysctl_hw_snd_latency_profile(SYSCTL_HANDLER_ARGS) @@ -90,13 +88,12 @@ sysctl_hw_snd_latency_profile(SYSCTL_HAN return err; } -SYSCTL_PROC(_hw_snd, OID_AUTO, latency_profile, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_hw_snd, OID_AUTO, latency_profile, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_snd_latency_profile, "I", "buffering latency profile (0=aggressive 1=safe)"); static int chn_timeout = CHN_TIMEOUT; -TUNABLE_INT("hw.snd.timeout", &chn_timeout); -#ifdef SND_DEBUG + static int sysctl_hw_snd_timeout(SYSCTL_HANDLER_ARGS) { @@ -113,17 +110,15 @@ sysctl_hw_snd_timeout(SYSCTL_HANDLER_ARG return err; } -SYSCTL_PROC(_hw_snd, OID_AUTO, timeout, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_hw_snd, OID_AUTO, timeout, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_snd_timeout, "I", "interrupt timeout (1 - 10) seconds"); -#endif static int chn_vpc_autoreset = 1; SYSCTL_INT(_hw_snd, OID_AUTO, vpc_autoreset, CTLFLAG_RWTUN, &chn_vpc_autoreset, 0, "automatically reset channels volume to 0db"); static int chn_vol_0db_pcm = SND_VOL_0DB_PCM; -TUNABLE_INT("hw.snd.vpc_0db", &chn_vol_0db_pcm); static void chn_vpc_proc(int reset, int db) @@ -169,7 +164,7 @@ sysctl_hw_snd_vpc_0db(SYSCTL_HANDLER_ARG return (0); } -SYSCTL_PROC(_hw_snd, OID_AUTO, vpc_0db, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_hw_snd, OID_AUTO, vpc_0db, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_snd_vpc_0db, "I", "0db relative level"); @@ -193,16 +188,13 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, vpc_reset "reset volume on all channels"); static int chn_usefrags = 0; -TUNABLE_INT("hw.snd.usefrags", &chn_usefrags); static int chn_syncdelay = -1; -TUNABLE_INT("hw.snd.syncdelay", &chn_syncdelay); -#ifdef SND_DEBUG -SYSCTL_INT(_hw_snd, OID_AUTO, usefrags, CTLFLAG_RW, - &chn_usefrags, 1, "prefer setfragments() over setblocksize()"); -SYSCTL_INT(_hw_snd, OID_AUTO, syncdelay, CTLFLAG_RW, - &chn_syncdelay, 1, + +SYSCTL_INT(_hw_snd, OID_AUTO, usefrags, CTLFLAG_RWTUN, + &chn_usefrags, 0, "prefer setfragments() over setblocksize()"); +SYSCTL_INT(_hw_snd, OID_AUTO, syncdelay, CTLFLAG_RWTUN, + &chn_syncdelay, 0, "append (0-1000) millisecond trailing buffer delay on each sync"); -#endif /** * @brief Channel sync group lock Modified: head/sys/dev/sound/pcm/dsp.c ============================================================================== --- head/sys/dev/sound/pcm/dsp.c Tue Mar 24 15:08:43 2015 (r280441) +++ head/sys/dev/sound/pcm/dsp.c Tue Mar 24 16:31:22 2015 (r280442) @@ -44,7 +44,7 @@ SND_DECLARE_FILE("$FreeBSD$"); static int dsp_mmap_allow_prot_exec = 0; -SYSCTL_INT(_hw_snd, OID_AUTO, compat_linux_mmap, CTLFLAG_RW, +SYSCTL_INT(_hw_snd, OID_AUTO, compat_linux_mmap, CTLFLAG_RWTUN, &dsp_mmap_allow_prot_exec, 0, "linux mmap compatibility (-1=force disable 0=auto 1=force enable)"); Modified: head/sys/dev/sound/pcm/feeder_eq.c ============================================================================== --- head/sys/dev/sound/pcm/feeder_eq.c Tue Mar 24 15:08:43 2015 (r280441) +++ head/sys/dev/sound/pcm/feeder_eq.c Tue Mar 24 16:31:22 2015 (r280442) @@ -682,12 +682,10 @@ feeder_eq_initsys(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "eq", CTLTYPE_INT | CTLFLAG_RW, d, sizeof(d), + "eq", CTLTYPE_INT | CTLFLAG_RWTUN, d, sizeof(d), sysctl_dev_pcm_eq, "I", "Bass/Treble Equalizer (0=disable, 1=enable, 2=bypass)"); - bzero(buf, sizeof(buf)); - (void)snprintf(buf, sizeof(buf), "Bass/Treble Equalizer Preamp " "(-/+ %d.0dB , %d.%ddB step)", FEEDEQ_GAIN_MAX, FEEDEQ_GAIN_STEP / FEEDEQ_GAIN_DIV, @@ -696,7 +694,7 @@ feeder_eq_initsys(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "eq_preamp", CTLTYPE_STRING | CTLFLAG_RW, d, sizeof(d), + "eq_preamp", CTLTYPE_STRING | CTLFLAG_RWTUN, d, sizeof(d), sysctl_dev_pcm_eq_preamp, "A", buf); } #endif Modified: head/sys/dev/sound/pcm/feeder_rate.c ============================================================================== --- head/sys/dev/sound/pcm/feeder_rate.c Tue Mar 24 15:08:43 2015 (r280441) +++ head/sys/dev/sound/pcm/feeder_rate.c Tue Mar 24 16:31:22 2015 (r280442) @@ -162,12 +162,6 @@ static int feeder_rate_polyphase_max = Z static char feeder_rate_presets[] = FEEDER_RATE_PRESETS; SYSCTL_STRING(_hw_snd, OID_AUTO, feeder_rate_presets, CTLFLAG_RD, &feeder_rate_presets, 0, "compile-time rate presets"); - -TUNABLE_INT("hw.snd.feeder_rate_min", &feeder_rate_min); -TUNABLE_INT("hw.snd.feeder_rate_max", &feeder_rate_max); -TUNABLE_INT("hw.snd.feeder_rate_round", &feeder_rate_round); -TUNABLE_INT("hw.snd.feeder_rate_quality", &feeder_rate_quality); - SYSCTL_INT(_hw_snd, OID_AUTO, feeder_rate_polyphase_max, CTLFLAG_RWTUN, &feeder_rate_polyphase_max, 0, "maximum allowable polyphase entries"); @@ -189,7 +183,7 @@ sysctl_hw_snd_feeder_rate_min(SYSCTL_HAN return (0); } -SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_min, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_min, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_snd_feeder_rate_min, "I", "minimum allowable rate"); @@ -211,7 +205,7 @@ sysctl_hw_snd_feeder_rate_max(SYSCTL_HAN return (0); } -SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_max, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_snd_feeder_rate_max, "I", "maximum allowable rate"); @@ -233,7 +227,7 @@ sysctl_hw_snd_feeder_rate_round(SYSCTL_H return (0); } -SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_round, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_round, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_snd_feeder_rate_round, "I", "sample rate converter rounding threshold"); @@ -285,7 +279,7 @@ sysctl_hw_snd_feeder_rate_quality(SYSCTL return (0); } -SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_quality, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_quality, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_snd_feeder_rate_quality, "I", "sample rate converter quality ("__XSTRING(Z_QUALITY_MIN)"=low .. " __XSTRING(Z_QUALITY_MAX)"=high)"); Modified: head/sys/dev/sound/pcm/mixer.c ============================================================================== --- head/sys/dev/sound/pcm/mixer.c Tue Mar 24 15:08:43 2015 (r280441) +++ head/sys/dev/sound/pcm/mixer.c Tue Mar 24 16:31:22 2015 (r280442) @@ -883,10 +883,10 @@ mixer_hwvol_init(device_t dev) m->hwvol_step = 5; SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "hwvol_step", CTLFLAG_RW, &m->hwvol_step, 0, ""); + OID_AUTO, "hwvol_step", CTLFLAG_RWTUN, &m->hwvol_step, 0, ""); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "hwvol_mixer", CTLTYPE_STRING | CTLFLAG_RW, m, 0, + OID_AUTO, "hwvol_mixer", CTLTYPE_STRING | CTLFLAG_RWTUN, m, 0, sysctl_hw_snd_hwvol_mixer, "A", ""); return 0; } Modified: head/sys/dev/sound/pcm/sndstat.c ============================================================================== --- head/sys/dev/sound/pcm/sndstat.c Tue Mar 24 15:08:43 2015 (r280441) +++ head/sys/dev/sound/pcm/sndstat.c Tue Mar 24 16:31:22 2015 (r280442) @@ -83,7 +83,6 @@ static int sndstat_files = 0; static SLIST_HEAD(, sndstat_entry) sndstat_devlist = SLIST_HEAD_INITIALIZER(sndstat_devlist); int snd_verbose = 0; -TUNABLE_INT("hw.snd.verbose", &snd_verbose); #ifdef SND_DEBUG static int @@ -104,7 +103,7 @@ sysctl_hw_snd_sndstat_pid(SYSCTL_HANDLER sx_unlock(&sndstat_lock); return (err); } -SYSCTL_PROC(_hw_snd, OID_AUTO, sndstat_pid, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_hw_snd, OID_AUTO, sndstat_pid, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_snd_sndstat_pid, "I", "sndstat busy pid"); #endif @@ -125,7 +124,7 @@ sysctl_hw_sndverbose(SYSCTL_HANDLER_ARGS } return error; } -SYSCTL_PROC(_hw_snd, OID_AUTO, verbose, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_hw_snd, OID_AUTO, verbose, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_sndverbose, "I", "verbosity level"); static int Modified: head/sys/dev/sound/pcm/sound.c ============================================================================== --- head/sys/dev/sound/pcm/sound.c Tue Mar 24 15:08:43 2015 (r280441) +++ head/sys/dev/sound/pcm/sound.c Tue Mar 24 16:31:22 2015 (r280442) @@ -49,20 +49,17 @@ devclass_t pcm_devclass; int pcm_veto_load = 1; int snd_unit = -1; -TUNABLE_INT("hw.snd.default_unit", &snd_unit); static int snd_unit_auto = -1; SYSCTL_INT(_hw_snd, OID_AUTO, default_auto, CTLFLAG_RWTUN, &snd_unit_auto, 0, "assign default unit to a newly attached device"); int snd_maxautovchans = 16; -/* XXX: a tunable implies that we may need more than one sound channel before - the system can change a sysctl (/etc/sysctl.conf), do we really need - this? */ -TUNABLE_INT("hw.snd.maxautovchans", &snd_maxautovchans); SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_RD, 0, "Sound driver"); +static void pcm_sysinit(device_t); + /* * XXX I've had enough with people not telling proper version/arch * while reporting problems, not after 387397913213th questions/requests. @@ -444,7 +441,7 @@ sysctl_hw_snd_default_unit(SYSCTL_HANDLE } /* XXX: do we need a way to let the user change the default unit? */ SYSCTL_PROC(_hw_snd, OID_AUTO, default_unit, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_ANYBODY, 0, sizeof(int), sysctl_hw_snd_default_unit, "I", "default sound device"); @@ -474,7 +471,7 @@ sysctl_hw_snd_maxautovchans(SYSCTL_HANDL } return (error); } -SYSCTL_PROC(_hw_snd, OID_AUTO, maxautovchans, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_hw_snd, OID_AUTO, maxautovchans, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_snd_maxautovchans, "I", "maximum virtual channel"); struct pcm_channel * @@ -766,16 +763,17 @@ pcm_setstatus(device_t dev, char *str) { struct snddev_info *d = device_get_softc(dev); + /* should only be called once */ + if (d->flags & SD_F_REGISTERED) + return (EINVAL); + PCM_BUSYASSERT(d); if (d->playcount == 0 || d->reccount == 0) d->flags |= SD_F_SIMPLEX; - if ((d->playcount > 0 || d->reccount > 0) && - !(d->flags & SD_F_AUTOVCHAN)) { + if (d->playcount > 0 || d->reccount > 0) d->flags |= SD_F_AUTOVCHAN; - vchan_initsys(dev); - } pcm_setmaxautovchans(d, snd_maxautovchans); @@ -794,6 +792,12 @@ pcm_setstatus(device_t dev, char *str) PCM_UNLOCK(d); + /* + * Create all sysctls once SD_F_REGISTERED is set else + * tunable sysctls won't work: + */ + pcm_sysinit(dev); + if (snd_unit_auto < 0) snd_unit_auto = (snd_unit < 0) ? 1 : 0; if (snd_unit < 0 || snd_unit_auto > 1) @@ -1001,11 +1005,49 @@ sysctl_hw_snd_clone_gc(SYSCTL_HANDLER_AR return (err); } -SYSCTL_PROC(_hw_snd, OID_AUTO, clone_gc, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_hw_snd, OID_AUTO, clone_gc, CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_hw_snd_clone_gc, "I", "global clone garbage collector"); #endif +static void +pcm_sysinit(device_t dev) +{ + struct snddev_info *d = device_get_softc(dev); + + /* XXX: an user should be able to set this with a control tool, the + sysadmin then needs min+max sysctls for this */ + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "buffersize", CTLFLAG_RD, &d->bufsz, 0, "allocated buffer size"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "bitperfect", CTLTYPE_INT | CTLFLAG_RWTUN, d, sizeof(d), + sysctl_dev_pcm_bitperfect, "I", + "bit-perfect playback/recording (0=disable, 1=enable)"); +#ifdef SND_DEBUG + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "clone_flags", CTLTYPE_UINT | CTLFLAG_RWTUN, d, sizeof(d), + sysctl_dev_pcm_clone_flags, "IU", + "clone flags"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "clone_deadline", CTLTYPE_INT | CTLFLAG_RWTUN, d, sizeof(d), + sysctl_dev_pcm_clone_deadline, "I", + "clone expiration deadline (ms)"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "clone_gc", CTLTYPE_INT | CTLFLAG_RWTUN, d, sizeof(d), + sysctl_dev_pcm_clone_gc, "I", + "clone garbage collector"); +#endif + if (d->flags & SD_F_AUTOVCHAN) + vchan_initsys(dev); + if (d->flags & SD_F_EQ) + feeder_eq_initsys(dev); +} + int pcm_register(device_t dev, void *devinfo, int numplay, int numrec) { @@ -1087,41 +1129,9 @@ pcm_register(device_t dev, void *devinfo d->rec_sysctl_tree = SYSCTL_ADD_NODE(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rec", CTLFLAG_RD, 0, "record channels node"); - /* XXX: an user should be able to set this with a control tool, the - sysadmin then needs min+max sysctls for this */ - SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "buffersize", CTLFLAG_RD, &d->bufsz, 0, "allocated buffer size"); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "bitperfect", CTLTYPE_INT | CTLFLAG_RW, d, sizeof(d), - sysctl_dev_pcm_bitperfect, "I", - "bit-perfect playback/recording (0=disable, 1=enable)"); -#ifdef SND_DEBUG - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "clone_flags", CTLTYPE_UINT | CTLFLAG_RW, d, sizeof(d), - sysctl_dev_pcm_clone_flags, "IU", - "clone flags"); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "clone_deadline", CTLTYPE_INT | CTLFLAG_RW, d, sizeof(d), - sysctl_dev_pcm_clone_deadline, "I", - "clone expiration deadline (ms)"); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "clone_gc", CTLTYPE_INT | CTLFLAG_RW, d, sizeof(d), - sysctl_dev_pcm_clone_gc, "I", - "clone garbage collector"); -#endif - if (numplay > 0 || numrec > 0) { + if (numplay > 0 || numrec > 0) d->flags |= SD_F_AUTOVCHAN; - vchan_initsys(dev); - } - - if (d->flags & SD_F_EQ) - feeder_eq_initsys(dev); sndstat_register(dev, d->status, sndstat_prepare_pcm); Modified: head/sys/dev/sound/pcm/vchan.c ============================================================================== --- head/sys/dev/sound/pcm/vchan.c Tue Mar 24 15:08:43 2015 (r280441) +++ head/sys/dev/sound/pcm/vchan.c Tue Mar 24 16:31:22 2015 (r280442) @@ -45,7 +45,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #ifdef SND_DEBUG static int snd_passthrough_verbose = 0; -SYSCTL_INT(_hw_snd, OID_AUTO, passthrough_verbose, CTLFLAG_RW, +SYSCTL_INT(_hw_snd, OID_AUTO, passthrough_verbose, CTLFLAG_RWTUN, &snd_passthrough_verbose, 0, "passthrough verbosity"); #endif @@ -946,45 +946,45 @@ vchan_initsys(device_t dev) /* Play */ SYSCTL_ADD_PROC(&d->play_sysctl_ctx, SYSCTL_CHILDREN(d->play_sysctl_tree), - OID_AUTO, "vchans", CTLTYPE_INT | CTLFLAG_RW, + OID_AUTO, "vchans", CTLTYPE_INT | CTLFLAG_RWTUN, VCHAN_SYSCTL_DATA(unit, PLAY), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchans, "I", "total allocated virtual channel"); SYSCTL_ADD_PROC(&d->play_sysctl_ctx, SYSCTL_CHILDREN(d->play_sysctl_tree), - OID_AUTO, "vchanmode", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "vchanmode", CTLTYPE_STRING | CTLFLAG_RWTUN, VCHAN_SYSCTL_DATA(unit, PLAY), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchanmode, "A", "vchan format/rate selection: 0=fixed, 1=passthrough, 2=adaptive"); SYSCTL_ADD_PROC(&d->play_sysctl_ctx, SYSCTL_CHILDREN(d->play_sysctl_tree), - OID_AUTO, "vchanrate", CTLTYPE_INT | CTLFLAG_RW, + OID_AUTO, "vchanrate", CTLTYPE_INT | CTLFLAG_RWTUN, VCHAN_SYSCTL_DATA(unit, PLAY), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchanrate, "I", "virtual channel mixing speed/rate"); SYSCTL_ADD_PROC(&d->play_sysctl_ctx, SYSCTL_CHILDREN(d->play_sysctl_tree), - OID_AUTO, "vchanformat", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "vchanformat", CTLTYPE_STRING | CTLFLAG_RWTUN, VCHAN_SYSCTL_DATA(unit, PLAY), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchanformat, "A", "virtual channel mixing format"); /* Rec */ SYSCTL_ADD_PROC(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(d->rec_sysctl_tree), - OID_AUTO, "vchans", CTLTYPE_INT | CTLFLAG_RW, + OID_AUTO, "vchans", CTLTYPE_INT | CTLFLAG_RWTUN, VCHAN_SYSCTL_DATA(unit, REC), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchans, "I", "total allocated virtual channel"); SYSCTL_ADD_PROC(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(d->rec_sysctl_tree), - OID_AUTO, "vchanmode", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "vchanmode", CTLTYPE_STRING | CTLFLAG_RWTUN, VCHAN_SYSCTL_DATA(unit, REC), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchanmode, "A", "vchan format/rate selection: 0=fixed, 1=passthrough, 2=adaptive"); SYSCTL_ADD_PROC(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(d->rec_sysctl_tree), - OID_AUTO, "vchanrate", CTLTYPE_INT | CTLFLAG_RW, + OID_AUTO, "vchanrate", CTLTYPE_INT | CTLFLAG_RWTUN, VCHAN_SYSCTL_DATA(unit, REC), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchanrate, "I", "virtual channel mixing speed/rate"); SYSCTL_ADD_PROC(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(d->rec_sysctl_tree), - OID_AUTO, "vchanformat", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "vchanformat", CTLTYPE_STRING | CTLFLAG_RWTUN, VCHAN_SYSCTL_DATA(unit, REC), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchanformat, "A", "virtual channel mixing format"); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 16:37:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15E67890; Tue, 24 Mar 2015 16:37: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 00788131; Tue, 24 Mar 2015 16:37:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OGbKDH061826; Tue, 24 Mar 2015 16:37:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OGbKYg061824; Tue, 24 Mar 2015 16:37:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503241637.t2OGbKYg061824@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 24 Mar 2015 16:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280443 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:37:21 -0000 Author: hselasky Date: Tue Mar 24 16:37:19 2015 New Revision: 280443 URL: https://svnweb.freebsd.org/changeset/base/280443 Log: Correct string pointer offset for error printout. Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Tue Mar 24 16:31:22 2015 (r280442) +++ head/sys/kern/kern_sysctl.c Tue Mar 24 16:37:19 2015 (r280443) @@ -285,7 +285,7 @@ sysctl_load_tunable_by_oid_locked(struct error = sysctl_root_handler_locked(oidp, oidp->oid_arg1, oidp->oid_arg2, &req); if (error != 0) - printf("Setting sysctl %s failed: %d\n", path, error); + printf("Setting sysctl %s failed: %d\n", path + rem, error); if (penv != NULL) freeenv(penv); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 16:45:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29FE3AD; Tue, 24 Mar 2015 16: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 14B9F241; Tue, 24 Mar 2015 16:45:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OGjpuP066995; Tue, 24 Mar 2015 16:45:51 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OGjpoe066993; Tue, 24 Mar 2015 16:45:51 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201503241645.t2OGjpoe066993@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 24 Mar 2015 16:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280444 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:45:52 -0000 Author: glebius Date: Tue Mar 24 16:45:50 2015 New Revision: 280444 URL: https://svnweb.freebsd.org/changeset/base/280444 Log: Move ip6_sprintf() declaration from in6_var.h to in6.h. This is a simple function that works with in6_addr and it is not related to the INET6 stack implementation. Sponsored by: Nginx, Inc. Modified: head/sys/netinet6/in6.h head/sys/netinet6/in6_var.h Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Tue Mar 24 16:37:19 2015 (r280443) +++ head/sys/netinet6/in6.h Tue Mar 24 16:45:50 2015 (r280444) @@ -651,6 +651,7 @@ int in6_cksum_partial(struct mbuf *, u_i int in6_localaddr(struct in6_addr *); int in6_localip(struct in6_addr *); int in6_addrscope(const struct in6_addr *); +char *ip6_sprintf(char *, const struct in6_addr *); struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *); extern void in6_if_up(struct ifnet *); struct sockaddr; Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Tue Mar 24 16:37:19 2015 (r280443) +++ head/sys/netinet6/in6_var.h Tue Mar 24 16:45:50 2015 (r280444) @@ -811,7 +811,6 @@ struct in6_ifaddr *in6ifa_ifpforlinkloca struct in6_ifaddr *in6ifa_ifpwithaddr(struct ifnet *, struct in6_addr *); struct in6_ifaddr *in6ifa_ifwithaddr(const struct in6_addr *, uint32_t); struct in6_ifaddr *in6ifa_llaonifp(struct ifnet *); -char *ip6_sprintf(char *, const struct in6_addr *); int in6_addr2zoneid(struct ifnet *, struct in6_addr *, u_int32_t *); int in6_matchlen(struct in6_addr *, struct in6_addr *); int in6_are_prefix_equal(struct in6_addr *, struct in6_addr *, int); From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 16:46:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CDAB1FB; Tue, 24 Mar 2015 16: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 87652258; Tue, 24 Mar 2015 16:46:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OGkfT7067148; Tue, 24 Mar 2015 16:46:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OGkf2U067147; Tue, 24 Mar 2015 16:46:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201503241646.t2OGkf2U067147@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 24 Mar 2015 16:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280445 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:46:41 -0000 Author: glebius Date: Tue Mar 24 16:46:40 2015 New Revision: 280445 URL: https://svnweb.freebsd.org/changeset/base/280445 Log: Do not include if_var.h and in6_var.h into kern_jail.c. It is now possible after r280444. Sponsored by: Nginx, Inc. Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue Mar 24 16:45:50 2015 (r280444) +++ head/sys/kern/kern_jail.c Tue Mar 24 16:46:40 2015 (r280445) @@ -62,16 +62,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #ifdef DDB #include -#ifdef INET6 -#include -#endif /* INET6 */ #endif /* DDB */ #include From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 17:12:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C37ECC67; Tue, 24 Mar 2015 17:12: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 ACE3A85E; Tue, 24 Mar 2015 17:12:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OHCcTg081779; Tue, 24 Mar 2015 17:12:38 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OHCaNu081774; Tue, 24 Mar 2015 17:12:36 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201503241712.t2OHCaNu081774@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Tue, 24 Mar 2015 17:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280447 - in head/sys/amd64: include vmm vmm/amd 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-1 Precedence: list List-Id: SVN 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 Mar 2015 17:12:38 -0000 Author: tychon Date: Tue Mar 24 17:12:36 2015 New Revision: 280447 URL: https://svnweb.freebsd.org/changeset/base/280447 Log: When fetching an instruction in non-64bit mode, consider the value of the code segment base address. Also if an instruction doesn't support a mod R/M (modRM) byte, don't be concerned if the CPU is in real mode. Reviewed by: neel Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/amd/svm.c 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 Tue Mar 24 16:53:16 2015 (r280446) +++ head/sys/amd64/include/vmm.h Tue Mar 24 17:12:36 2015 (r280447) @@ -551,6 +551,7 @@ struct vm_exit { struct { uint64_t gpa; uint64_t gla; + uint64_t cs_base; int cs_d; /* CS.D */ struct vm_guest_paging paging; struct vie vie; Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Tue Mar 24 16:53:16 2015 (r280446) +++ head/sys/amd64/vmm/amd/svm.c Tue Mar 24 17:12:36 2015 (r280447) @@ -799,8 +799,13 @@ svm_handle_inst_emul(struct vmcb *vmcb, KASSERT(error == 0, ("%s: vmcb_seg(CS) error %d", __func__, error)); switch(paging->cpu_mode) { + case CPU_MODE_REAL: + vmexit->u.inst_emul.cs_base = seg.base; + vmexit->u.inst_emul.cs_d = 0; case CPU_MODE_PROTECTED: case CPU_MODE_COMPATIBILITY: + vmexit->u.inst_emul.cs_base = seg.base; + /* * Section 4.8.1 of APM2, Default Operand Size or D bit. */ @@ -808,6 +813,7 @@ svm_handle_inst_emul(struct vmcb *vmcb, 1 : 0; break; default: + vmexit->u.inst_emul.cs_base = 0; vmexit->u.inst_emul.cs_d = 0; break; } Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Tue Mar 24 16:53:16 2015 (r280446) +++ head/sys/amd64/vmm/intel/vmx.c Tue Mar 24 17:12:36 2015 (r280447) @@ -1784,12 +1784,18 @@ vmexit_inst_emul(struct vm_exit *vmexit, vmexit->u.inst_emul.gla = gla; vmx_paging_info(paging); switch (paging->cpu_mode) { + case CPU_MODE_REAL: + vmexit->u.inst_emul.cs_base = vmcs_read(VMCS_GUEST_CS_BASE); + vmexit->u.inst_emul.cs_d = 0; + break; case CPU_MODE_PROTECTED: case CPU_MODE_COMPATIBILITY: + vmexit->u.inst_emul.cs_base = vmcs_read(VMCS_GUEST_CS_BASE); csar = vmcs_read(VMCS_GUEST_CS_ACCESS_RIGHTS); vmexit->u.inst_emul.cs_d = SEG_DESC_DEF32(csar); break; default: + vmexit->u.inst_emul.cs_base = 0; vmexit->u.inst_emul.cs_d = 0; break; } Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Tue Mar 24 16:53:16 2015 (r280446) +++ head/sys/amd64/vmm/vmm.c Tue Mar 24 17:12:36 2015 (r280447) @@ -1251,7 +1251,7 @@ vm_handle_inst_emul(struct vm *vm, int v struct vie *vie; struct vcpu *vcpu; struct vm_exit *vme; - uint64_t gla, gpa; + uint64_t gla, gpa, cs_base; struct vm_guest_paging *paging; mem_region_read_t mread; mem_region_write_t mwrite; @@ -1263,6 +1263,7 @@ vm_handle_inst_emul(struct vm *vm, int v gla = vme->u.inst_emul.gla; gpa = vme->u.inst_emul.gpa; + cs_base = vme->u.inst_emul.cs_base; cs_d = vme->u.inst_emul.cs_d; vie = &vme->u.inst_emul.vie; paging = &vme->u.inst_emul.paging; @@ -1277,8 +1278,8 @@ vm_handle_inst_emul(struct vm *vm, int v * maximum size instruction. */ length = vme->inst_length ? vme->inst_length : VIE_INST_SIZE; - error = vmm_fetch_instruction(vm, vcpuid, paging, vme->rip, - length, vie); + error = vmm_fetch_instruction(vm, vcpuid, paging, vme->rip + + cs_base, length, vie); } else { /* * The instruction bytes have already been copied into 'vie' Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Tue Mar 24 16:53:16 2015 (r280446) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Tue Mar 24 17:12:36 2015 (r280447) @@ -1825,12 +1825,12 @@ decode_modrm(struct vie *vie, enum vm_cp { uint8_t x; - if (cpu_mode == CPU_MODE_REAL) - return (-1); - if (vie->op.op_flags & VIE_OP_F_NO_MODRM) return (0); + if (cpu_mode == CPU_MODE_REAL) + return (-1); + if (vie_peek(vie, &x)) return (-1); From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 17:42:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EB8574E; Tue, 24 Mar 2015 17: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 29128C0F; Tue, 24 Mar 2015 17:42:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OHgsWt096810; Tue, 24 Mar 2015 17:42:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OHgs7D096809; Tue, 24 Mar 2015 17:42:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503241742.t2OHgs7D096809@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 24 Mar 2015 17:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280450 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 17:42:54 -0000 Author: hselasky Date: Tue Mar 24 17:42:53 2015 New Revision: 280450 URL: https://svnweb.freebsd.org/changeset/base/280450 Log: Make sure tunable sysctls are only fetched once. The existing code can re-register sysctls when destroying sysctl contexts or when moving sysctls from one tree to another. Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Tue Mar 24 17:37:31 2015 (r280449) +++ head/sys/kern/kern_sysctl.c Tue Mar 24 17:42:53 2015 (r280450) @@ -353,6 +353,9 @@ sysctl_register_oid(struct sysctl_oid *o #endif (oidp->oid_kind & CTLFLAG_TUN) != 0 && (oidp->oid_kind & CTLFLAG_NOFETCH) == 0) { + /* only fetch value once */ + oidp->oid_kind |= CTLFLAG_NOFETCH; + /* try to fetch value from kernel environment */ sysctl_load_tunable_by_oid_locked(oidp); } } From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 18:09:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11B35EB2; Tue, 24 Mar 2015 18: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 EC899EB7; Tue, 24 Mar 2015 18:09:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OI9D4O010092; Tue, 24 Mar 2015 18:09:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OI974b010068; Tue, 24 Mar 2015 18:09:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503241809.t2OI974b010068@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 24 Mar 2015 18:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280451 - in head: . share/man/man4 sys/arm/mv sys/boot/forth sys/conf sys/dev/ata sys/dev/ata/chipsets sys/modules/ata/atapci/chipsets sys/modules/ata/atapci/chipsets/ataadaptec sys/mo... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 18:09:14 -0000 Author: mav Date: Tue Mar 24 18:09:07 2015 New Revision: 280451 URL: https://svnweb.freebsd.org/changeset/base/280451 Log: Remove from legacy ata(4) driver support for hardware, supported by newer and more functional drivers ahci(4), siis(4) and mvs(4). This removes about 3400 lines of code, unused since FreeBSD 9.0 release. Deleted: head/sys/arm/mv/mv_sata.c head/sys/dev/ata/chipsets/ata-adaptec.c head/sys/dev/ata/chipsets/ata-ahci.c head/sys/modules/ata/atapci/chipsets/ataadaptec/ head/sys/modules/ata/atapci/chipsets/ataahci/ Modified: head/UPDATING head/share/man/man4/ahci.4 head/share/man/man4/ata.4 head/share/man/man4/mvs.4 head/share/man/man4/siis.4 head/sys/arm/mv/files.mv head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-acerlabs.c head/sys/dev/ata/chipsets/ata-ati.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ata/chipsets/ata-jmicron.c head/sys/dev/ata/chipsets/ata-marvell.c head/sys/dev/ata/chipsets/ata-nvidia.c head/sys/dev/ata/chipsets/ata-siliconimage.c head/sys/dev/ata/chipsets/ata-via.c head/sys/modules/ata/atapci/chipsets/Makefile Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Mar 24 17:42:53 2015 (r280450) +++ head/UPDATING Tue Mar 24 18:09:07 2015 (r280451) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150324: + From legacy ata(4) driver was removed support for SATA controllers + supported by more functional drivers ahci(4), siis(4) and mvs(4). + Kernel modules ataahci and ataadaptec were removed completely, + replaced by ahci and mvs modules respectively. + 20150315: Clang, llvm and lldb have been upgraded to 3.6.0 release. Please see the 20141231 entry below for information about prerequisites and Modified: head/share/man/man4/ahci.4 ============================================================================== --- head/share/man/man4/ahci.4 Tue Mar 24 17:42:53 2015 (r280450) +++ head/share/man/man4/ahci.4 Tue Mar 24 18:09:07 2015 (r280451) @@ -143,12 +143,6 @@ device for localization and status repor Supporting AHCI controllers may transmit that information to the backplane controllers via SGPIO interface. Backplane controllers interpret received statuses in some way (IBPI standard) to report them using present indicators. -.Pp -AHCI hardware is also supported by ataahci driver from -.Xr ata 4 -subsystem. -If both drivers are loaded at the same time, this one will be -given precedence as the more functional of the two. .Sh HARDWARE The .Nm Modified: head/share/man/man4/ata.4 ============================================================================== --- head/share/man/man4/ata.4 Tue Mar 24 17:42:53 2015 (r280450) +++ head/share/man/man4/ata.4 Tue Mar 24 18:09:07 2015 (r280451) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 3, 2012 +.Dd March 23, 2015 .Dt ATA 4 .Os .Sh NAME @@ -50,8 +50,6 @@ atapci_load="YES" ataacard_load="YES" ataacerlabs_load="YES" -ataadaptec_load="YES" -ataahci_load="YES" ataamd_load="YES" ataati_load="YES" atacenatek_load="YES" @@ -76,16 +74,11 @@ atavia_load="YES" The first line is for the common hardware independent code, and is a prerequisite for the other modules. The next three lines are generic bus-specific drivers. -Of the rest, ataahci is the AHCI driver. -The others are vendor-specific PCI drivers. +The rest are vendor-specific PCI drivers. .Pp The following tunables are settable from the .Xr loader 8 : .Bl -ohang -.It Va hw.ahci.force -set to nonzero value for forcing drivers to attach to some known AHCI-capable -chips even if they are configured for legacy IDE emulation (the default is 1, -force the attach). .It Va hw.ata.ata_dma_check_80pin set to 0 to disable the 80pin cable check (the default is 1, check the cable). .It Va hint.atapci.X.msi @@ -106,13 +99,6 @@ Interface Power Management is disabled. This is the default value. .It 1 The device is allowed to initiate a PM state change; the host is passive. -.It 2 -The host initiates a PARTIAL PM state transition every time a port becomes idle. -.It 3 -host initiates SLUMBER PM state transition every time port becomes idle. -.El -.Pp -Modes 2 and 3 are only supported for AHCI. .It Va hint.ata. Ns Ar X Ns Va .dev Ns Ar X Ns Va .sata_rev limits the initial SATA revision (speed) for the specified device on the specified channel. @@ -198,8 +184,7 @@ IT8211F, IT8212F, IT8213F. .It JMicron: JMB360, JMB361, JMB363, JMB365, JMB366, JMB368. .It Marvell -88SX5040, 88SX5041, 88SX5080, 88SX5081, 88SX6041, 88SX6042, 88SX6081, 88SE6101, -88SE6102, 88SE6111, 88SE6121, 88SE6141, 88SE6145, 88SX7042. +88SE6101, 88SE6102, 88SE6111, 88SE6121, 88SE6141, 88SE6145. .It National: SC1100. .It NetCell: @@ -216,7 +201,7 @@ PDC40718, PDC40719. .It ServerWorks: HT1000, ROSB4, CSB5, CSB6, K2, Frodo4, Frodo8. .It Silicon Image: -SiI0680, SiI3112, SiI3114, SiI3124, SiI3132, SiI3512. +SiI0680, SiI3112, SiI3114, SiI3512. .It SiS: SIS180, SIS181, SIS182, SIS5513, SIS530, SIS540, SIS550, SIS620, SIS630, SIS630S, SIS633, SIS635, SIS730, SIS733, SIS735, SIS745, SIS961, SIS962, @@ -227,13 +212,10 @@ VT82C686A, VT82C686B, VT8231, VT8233, VT VT8237A, VT8237S, VT8251, CX700, VX800, VX855, VX900. .El .Pp -Some of above chips are also supported by the more featured -.Xr ahci 4 , -.Xr mvs 4 , -and -.Xr siis 4 -drivers. -If both drivers are loaded at the same time, those will have precedence. +Some of above chips can be configured for AHCI mode. +In such case they are supported by +.Xr ahci 4 +driver instead. .Pp Unknown ATA chipsets are supported in PIO modes, and if the standard busmaster DMA registers are present and contain valid setup, DMA is Modified: head/share/man/man4/mvs.4 ============================================================================== --- head/share/man/man4/mvs.4 Tue Mar 24 17:42:53 2015 (r280450) +++ head/share/man/man4/mvs.4 Tue Mar 24 18:09:07 2015 (r280451) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2013 +.Dd March 23, 2015 .Dt MVS 4 .Os .Sh NAME @@ -109,13 +109,6 @@ Port Multipliers (including FIS-based sw hardware command queues (up to 31 command per port), Native Command Queuing, SATA interface Power Management, device hot-plug and Message Signaled Interrupts. -.Pp -The same hardware is also supported by the atamarvell and ataadaptec -drivers from the -.Xr ata 4 -subsystem. -If both drivers are loaded at the same time, this one will be -given precedence as the more functional of the two. .Sh HARDWARE The .Nm Modified: head/share/man/man4/siis.4 ============================================================================== --- head/share/man/man4/siis.4 Tue Mar 24 17:42:53 2015 (r280450) +++ head/share/man/man4/siis.4 Tue Mar 24 18:09:07 2015 (r280451) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 8, 2011 +.Dd March 23, 2015 .Dt SIIS 4 .Os .Sh NAME @@ -98,12 +98,6 @@ The activity LEDs of the adapters suppor driver can be controlled via the .Xr led 4 API for localization or status reporting purposes. -.Pp -Same hardware is also supported by the atasiliconimage driver from -.Xr ata 4 -subsystem. -If both drivers are loaded at the same time, this one will be -given precedence as the more functional of the two. .Sh HARDWARE The .Nm Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Tue Mar 24 17:42:53 2015 (r280450) +++ head/sys/arm/mv/files.mv Tue Mar 24 18:09:07 2015 (r280451) @@ -27,7 +27,6 @@ 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 -arm/mv/mv_sata.c optional ata | atamvsata arm/mv/mv_ts.c standard arm/mv/timer.c standard arm/mv/twsi.c optional iicbus Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Tue Mar 24 17:42:53 2015 (r280450) +++ head/sys/boot/forth/loader.conf Tue Mar 24 18:09:07 2015 (r280451) @@ -148,10 +148,8 @@ module_path="/boot/modules" # Set the mo ### ATA modules ############################################## ############################################################## -ataahci_load="NO" # AHCI SATA ataacard_load="NO" # ACARD ataacerlabs_load="NO" # Acer Labs Inc. (ALI) -ataadaptec_load="NO" # Adaptec ataamd_load="NO" # American Micro Devices (AMD) ataati_load="NO" # ATI atacenatek_load="NO" # Cenatek Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Mar 24 17:42:53 2015 (r280450) +++ head/sys/conf/NOTES Tue Mar 24 18:09:07 2015 (r280451) @@ -1722,10 +1722,8 @@ device ata #device atapci # PCI bus support; only generic chipset support # PCI ATA chipsets -#device ataahci # AHCI SATA #device ataacard # ACARD #device ataacerlabs # Acer Labs Inc. (ALI) -#device ataadaptec # Adaptec #device ataamd # American Micro Devices (AMD) #device ataati # ATI #device atacenatek # Cenatek Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Mar 24 17:42:53 2015 (r280450) +++ head/sys/conf/files Tue Mar 24 18:09:07 2015 (r280451) @@ -684,12 +684,8 @@ dev/ata/ata-card.c optional ata pccard dev/ata/ata-cbus.c optional ata pc98 | atapc98 dev/ata/ata-isa.c optional ata isa | ataisa dev/ata/ata-pci.c optional ata pci | atapci -dev/ata/chipsets/ata-ahci.c optional ata pci | ataahci | ataacerlabs | \ - ataati | ataintel | atajmicron | \ - atavia | atanvidia dev/ata/chipsets/ata-acard.c optional ata pci | ataacard dev/ata/chipsets/ata-acerlabs.c optional ata pci | ataacerlabs -dev/ata/chipsets/ata-adaptec.c optional ata pci | ataadaptec dev/ata/chipsets/ata-amd.c optional ata pci | ataamd dev/ata/chipsets/ata-ati.c optional ata pci | ataati dev/ata/chipsets/ata-cenatek.c optional ata pci | atacenatek @@ -699,7 +695,7 @@ dev/ata/chipsets/ata-highpoint.c optiona dev/ata/chipsets/ata-intel.c optional ata pci | ataintel dev/ata/chipsets/ata-ite.c optional ata pci | ataite dev/ata/chipsets/ata-jmicron.c optional ata pci | atajmicron -dev/ata/chipsets/ata-marvell.c optional ata pci | atamarvell | ataadaptec +dev/ata/chipsets/ata-marvell.c optional ata pci | atamarvell dev/ata/chipsets/ata-micron.c optional ata pci | atamicron dev/ata/chipsets/ata-national.c optional ata pci | atanational dev/ata/chipsets/ata-netcell.c optional ata pci | atanetcell Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Tue Mar 24 17:42:53 2015 (r280450) +++ head/sys/dev/ata/ata-all.h Tue Mar 24 18:09:07 2015 (r280451) @@ -150,139 +150,6 @@ #define ATA_SACTIVE 16 -/* SATA AHCI v1.0 register defines */ -#define ATA_AHCI_CAP 0x00 -#define ATA_AHCI_CAP_NPMASK 0x0000001f -#define ATA_AHCI_CAP_SXS 0x00000020 -#define ATA_AHCI_CAP_EMS 0x00000040 -#define ATA_AHCI_CAP_CCCS 0x00000080 -#define ATA_AHCI_CAP_NCS 0x00001F00 -#define ATA_AHCI_CAP_NCS_SHIFT 8 -#define ATA_AHCI_CAP_PSC 0x00002000 -#define ATA_AHCI_CAP_SSC 0x00004000 -#define ATA_AHCI_CAP_PMD 0x00008000 -#define ATA_AHCI_CAP_FBSS 0x00010000 -#define ATA_AHCI_CAP_SPM 0x00020000 -#define ATA_AHCI_CAP_SAM 0x00080000 -#define ATA_AHCI_CAP_ISS 0x00F00000 -#define ATA_AHCI_CAP_ISS_SHIFT 20 -#define ATA_AHCI_CAP_SCLO 0x01000000 -#define ATA_AHCI_CAP_SAL 0x02000000 -#define ATA_AHCI_CAP_SALP 0x04000000 -#define ATA_AHCI_CAP_SSS 0x08000000 -#define ATA_AHCI_CAP_SMPS 0x10000000 -#define ATA_AHCI_CAP_SSNTF 0x20000000 -#define ATA_AHCI_CAP_SNCQ 0x40000000 -#define ATA_AHCI_CAP_64BIT 0x80000000 - -#define ATA_AHCI_GHC 0x04 -#define ATA_AHCI_GHC_AE 0x80000000 -#define ATA_AHCI_GHC_IE 0x00000002 -#define ATA_AHCI_GHC_HR 0x00000001 - -#define ATA_AHCI_IS 0x08 -#define ATA_AHCI_PI 0x0c -#define ATA_AHCI_VS 0x10 - -#define ATA_AHCI_OFFSET 0x80 - -#define ATA_AHCI_P_CLB 0x100 -#define ATA_AHCI_P_CLBU 0x104 -#define ATA_AHCI_P_FB 0x108 -#define ATA_AHCI_P_FBU 0x10c -#define ATA_AHCI_P_IS 0x110 -#define ATA_AHCI_P_IE 0x114 -#define ATA_AHCI_P_IX_DHR 0x00000001 -#define ATA_AHCI_P_IX_PS 0x00000002 -#define ATA_AHCI_P_IX_DS 0x00000004 -#define ATA_AHCI_P_IX_SDB 0x00000008 -#define ATA_AHCI_P_IX_UF 0x00000010 -#define ATA_AHCI_P_IX_DP 0x00000020 -#define ATA_AHCI_P_IX_PC 0x00000040 -#define ATA_AHCI_P_IX_DI 0x00000080 - -#define ATA_AHCI_P_IX_PRC 0x00400000 -#define ATA_AHCI_P_IX_IPM 0x00800000 -#define ATA_AHCI_P_IX_OF 0x01000000 -#define ATA_AHCI_P_IX_INF 0x04000000 -#define ATA_AHCI_P_IX_IF 0x08000000 -#define ATA_AHCI_P_IX_HBD 0x10000000 -#define ATA_AHCI_P_IX_HBF 0x20000000 -#define ATA_AHCI_P_IX_TFE 0x40000000 -#define ATA_AHCI_P_IX_CPD 0x80000000 - -#define ATA_AHCI_P_CMD 0x118 -#define ATA_AHCI_P_CMD_ST 0x00000001 -#define ATA_AHCI_P_CMD_SUD 0x00000002 -#define ATA_AHCI_P_CMD_POD 0x00000004 -#define ATA_AHCI_P_CMD_CLO 0x00000008 -#define ATA_AHCI_P_CMD_FRE 0x00000010 -#define ATA_AHCI_P_CMD_CCS_MASK 0x00001f00 -#define ATA_AHCI_P_CMD_ISS 0x00002000 -#define ATA_AHCI_P_CMD_FR 0x00004000 -#define ATA_AHCI_P_CMD_CR 0x00008000 -#define ATA_AHCI_P_CMD_CPS 0x00010000 -#define ATA_AHCI_P_CMD_PMA 0x00020000 -#define ATA_AHCI_P_CMD_HPCP 0x00040000 -#define ATA_AHCI_P_CMD_ISP 0x00080000 -#define ATA_AHCI_P_CMD_CPD 0x00100000 -#define ATA_AHCI_P_CMD_ATAPI 0x01000000 -#define ATA_AHCI_P_CMD_DLAE 0x02000000 -#define ATA_AHCI_P_CMD_ALPE 0x04000000 -#define ATA_AHCI_P_CMD_ASP 0x08000000 -#define ATA_AHCI_P_CMD_ICC_MASK 0xf0000000 -#define ATA_AHCI_P_CMD_NOOP 0x00000000 -#define ATA_AHCI_P_CMD_ACTIVE 0x10000000 -#define ATA_AHCI_P_CMD_PARTIAL 0x20000000 -#define ATA_AHCI_P_CMD_SLUMBER 0x60000000 - -#define ATA_AHCI_P_TFD 0x120 -#define ATA_AHCI_P_SIG 0x124 -#define ATA_AHCI_P_SSTS 0x128 -#define ATA_AHCI_P_SCTL 0x12c -#define ATA_AHCI_P_SERR 0x130 -#define ATA_AHCI_P_SACT 0x134 -#define ATA_AHCI_P_CI 0x138 -#define ATA_AHCI_P_SNTF 0x13C -#define ATA_AHCI_P_FBS 0x140 - -#define ATA_AHCI_CL_SIZE 32 -#define ATA_AHCI_CL_OFFSET 0 -#define ATA_AHCI_FB_OFFSET (ATA_AHCI_CL_SIZE * 32) -#define ATA_AHCI_CT_OFFSET (ATA_AHCI_FB_OFFSET + 4096) -#define ATA_AHCI_CT_SIZE (2176 + 128) - -struct ata_ahci_dma_prd { - u_int64_t dba; - u_int32_t reserved; - u_int32_t dbc; /* 0 based */ -#define ATA_AHCI_PRD_MASK 0x003fffff /* max 4MB */ -#define ATA_AHCI_PRD_IPC (1<<31) -} __packed; - -struct ata_ahci_cmd_tab { - u_int8_t cfis[64]; - u_int8_t acmd[32]; - u_int8_t reserved[32]; -#define ATA_AHCI_DMA_ENTRIES 129 - struct ata_ahci_dma_prd prd_tab[ATA_AHCI_DMA_ENTRIES]; -} __packed; - -struct ata_ahci_cmd_list { - u_int16_t cmd_flags; -#define ATA_AHCI_CMD_ATAPI 0x0020 -#define ATA_AHCI_CMD_WRITE 0x0040 -#define ATA_AHCI_CMD_PREFETCH 0x0080 -#define ATA_AHCI_CMD_RESET 0x0100 -#define ATA_AHCI_CMD_BIST 0x0200 -#define ATA_AHCI_CMD_CLR_BUSY 0x0400 - - u_int16_t prd_length; /* PRD entries */ - u_int32_t bytecount; - u_int64_t cmd_table_phys; /* 128byte aligned */ -} __packed; - - /* DMA register defines */ #define ATA_DMA_ENTRIES 256 #define ATA_DMA_EOT 0x80000000 Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Tue Mar 24 17:42:53 2015 (r280450) +++ head/sys/dev/ata/ata-pci.h Tue Mar 24 18:09:07 2015 (r280451) @@ -169,93 +169,49 @@ struct ata_pci_controller { #define ATA_I6300ESB_R1 0x25b08086 #define ATA_I63XXESB2 0x269e8086 #define ATA_I63XXESB2_S1 0x26808086 -#define ATA_I63XXESB2_S2 0x26818086 -#define ATA_I63XXESB2_R1 0x26828086 -#define ATA_I63XXESB2_R2 0x26838086 #define ATA_I82801FB 0x266f8086 #define ATA_I82801FB_S1 0x26518086 #define ATA_I82801FB_R1 0x26528086 #define ATA_I82801FBM 0x26538086 #define ATA_I82801GB 0x27df8086 #define ATA_I82801GB_S1 0x27c08086 -#define ATA_I82801GB_AH 0x27c18086 -#define ATA_I82801GB_R1 0x27c38086 #define ATA_I82801GBM_S1 0x27c48086 -#define ATA_I82801GBM_AH 0x27c58086 -#define ATA_I82801GBM_R1 0x27c68086 #define ATA_I82801HB_S1 0x28208086 -#define ATA_I82801HB_AH6 0x28218086 -#define ATA_I82801HB_R1 0x28228086 -#define ATA_I82801HB_AH4 0x28248086 #define ATA_I82801HB_S2 0x28258086 #define ATA_I82801HBM 0x28508086 #define ATA_I82801HBM_S1 0x28288086 -#define ATA_I82801HBM_S2 0x28298086 -#define ATA_I82801HBM_S3 0x282a8086 #define ATA_I82801IB_S1 0x29208086 #define ATA_I82801IB_S3 0x29218086 -#define ATA_I82801IB_AH6 0x29228086 -#define ATA_I82801IB_AH4 0x29238086 #define ATA_I82801IB_R1 0x29258086 #define ATA_I82801IB_S2 0x29268086 #define ATA_I82801IBM_S1 0x29288086 -#define ATA_I82801IBM_AH 0x29298086 -#define ATA_I82801IBM_R1 0x292a8086 #define ATA_I82801IBM_S2 0x292d8086 #define ATA_I82801JIB_S1 0x3a208086 -#define ATA_I82801JIB_AH 0x3a228086 -#define ATA_I82801JIB_R1 0x3a258086 #define ATA_I82801JIB_S2 0x3a268086 #define ATA_I82801JD_S1 0x3a008086 -#define ATA_I82801JD_AH 0x3a028086 -#define ATA_I82801JD_R1 0x3a058086 #define ATA_I82801JD_S2 0x3a068086 #define ATA_I82801JI_S1 0x3a208086 -#define ATA_I82801JI_AH 0x3a228086 -#define ATA_I82801JI_R1 0x3a258086 #define ATA_I82801JI_S2 0x3a268086 #define ATA_5Series_S1 0x3b208086 #define ATA_5Series_S2 0x3b218086 -#define ATA_5Series_AH1 0x3b228086 -#define ATA_5Series_AH2 0x3b238086 -#define ATA_5Series_R1 0x3b258086 #define ATA_5Series_S3 0x3b268086 #define ATA_5Series_S4 0x3b288086 -#define ATA_5Series_AH3 0x3b298086 -#define ATA_5Series_R2 0x3b2c8086 #define ATA_5Series_S5 0x3b2d8086 #define ATA_5Series_S6 0x3b2e8086 -#define ATA_5Series_AH4 0x3b2f8086 #define ATA_CPT_S1 0x1c008086 #define ATA_CPT_S2 0x1c018086 -#define ATA_CPT_AH1 0x1c028086 -#define ATA_CPT_AH2 0x1c038086 -#define ATA_CPT_R1 0x1c048086 -#define ATA_CPT_R2 0x1c058086 #define ATA_CPT_S3 0x1c088086 #define ATA_CPT_S4 0x1c098086 #define ATA_PBG_S1 0x1d008086 -#define ATA_PBG_AH1 0x1d028086 -#define ATA_PBG_R1 0x1d048086 -#define ATA_PBG_R2 0x1d068086 -#define ATA_PBG_R3 0x28268086 #define ATA_PBG_S2 0x1d088086 #define ATA_PPT_S1 0x1e008086 #define ATA_PPT_S2 0x1e018086 -#define ATA_PPT_AH1 0x1e028086 -#define ATA_PPT_AH2 0x1e038086 -#define ATA_PPT_R1 0x1e048086 -#define ATA_PPT_R2 0x1e058086 -#define ATA_PPT_R3 0x1e068086 -#define ATA_PPT_R4 0x1e078086 #define ATA_PPT_S3 0x1e088086 #define ATA_PPT_S4 0x1e098086 -#define ATA_PPT_R5 0x1e0e8086 -#define ATA_PPT_R6 0x1e0f8086 #define ATA_AVOTON_S1 0x1f208086 #define ATA_AVOTON_S2 0x1f218086 @@ -264,29 +220,13 @@ struct ata_pci_controller { #define ATA_LPT_S1 0x8c008086 #define ATA_LPT_S2 0x8c018086 -#define ATA_LPT_AH1 0x8c028086 -#define ATA_LPT_AH2 0x8c038086 -#define ATA_LPT_R1 0x8c048086 -#define ATA_LPT_R2 0x8c058086 -#define ATA_LPT_R3 0x8c068086 -#define ATA_LPT_R4 0x8c078086 #define ATA_LPT_S3 0x8c088086 #define ATA_LPT_S4 0x8c098086 -#define ATA_LPT_R5 0x8c0e8086 -#define ATA_LPT_R6 0x8c0f8086 #define ATA_WCPT_S1 0x8c808086 #define ATA_WCPT_S2 0x8c818086 -#define ATA_WCPT_AH1 0x8c828086 -#define ATA_WCPT_AH2 0x8c838086 -#define ATA_WCPT_R1 0x8c848086 -#define ATA_WCPT_R2 0x8c858086 -#define ATA_WCPT_R3 0x8c868086 -#define ATA_WCPT_R4 0x8c878086 #define ATA_WCPT_S3 0x8c888086 #define ATA_WCPT_S4 0x8c898086 -#define ATA_WCPT_R5 0x8c8e8086 -#define ATA_WCPT_R6 0x8c8f8086 #define ATA_WELLS_S1 0x8d008086 #define ATA_WELLS_S2 0x8d088086 @@ -300,9 +240,7 @@ struct ata_pci_controller { #define ATA_I31244 0x32008086 #define ATA_ISCH 0x811a8086 -#define ATA_DH89XXCC 0x23238086 -#define ATA_COLETOCRK_AH1 0x23a38086 #define ATA_COLETOCRK_S1 0x23a18086 #define ATA_COLETOCRK_S2 0x23a68086 @@ -322,14 +260,6 @@ struct ata_pci_controller { #define ATA_JMB368_2 0x0368197b #define ATA_MARVELL_ID 0x11ab -#define ATA_M88SX5040 0x504011ab -#define ATA_M88SX5041 0x504111ab -#define ATA_M88SX5080 0x508011ab -#define ATA_M88SX5081 0x508111ab -#define ATA_M88SX6041 0x604111ab -#define ATA_M88SX6042 0x604211ab -#define ATA_M88SX6081 0x608111ab -#define ATA_M88SX7042 0x704211ab #define ATA_M88SE6101 0x610111ab #define ATA_M88SE6102 0x610211ab #define ATA_M88SE6111 0x611111ab @@ -505,10 +435,6 @@ struct ata_pci_controller { #define ATA_SII3512 0x35121095 #define ATA_SII3112 0x31121095 #define ATA_SII3112_1 0x02401095 -#define ATA_SII3124 0x31241095 -#define ATA_SII3132 0x31321095 -#define ATA_SII3132_1 0x02421095 -#define ATA_SII3132_2 0x02441095 #define ATA_SII0680 0x06801095 #define ATA_CMD646 0x06461095 #define ATA_CMD648 0x06481095 @@ -631,8 +557,6 @@ const struct ata_chip_id *ata_find_chip( int ata_mode2idx(int mode); /* global prototypes from chipsets/ata-*.c */ -int ata_ahci_chipinit(device_t); -int ata_marvell_edma_chipinit(device_t); int ata_sii_chipinit(device_t); /* externs */ Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Tue Mar 24 17:42:53 2015 (r280450) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Tue Mar 24 18:09:07 2015 (r280451) @@ -117,11 +117,6 @@ ata_ali_chipinit(device_t dev) ctlr->setmode = ata_sata_setmode; ctlr->getrev = ata_sata_getrev; - /* AHCI mode is correctly supported only on the ALi 5288. */ - if ((ctlr->chip->chipid == ATA_ALI_5288) && - (ata_ahci_chipinit(dev) != ENXIO)) - return 0; - /* Allocate resources for later use by channel attach routines. */ res = malloc(sizeof(struct ali_sata_resources), M_ATAPCI, M_WAITOK); for (i = 0; i < 4; i++) { @@ -347,4 +342,3 @@ ata_ali_setmode(device_t dev, int target } ATA_DECLARE_DRIVER(ata_ali); -MODULE_DEPEND(ata_ali, ata_ahci, 1, 1, 1); Modified: head/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ati.c Tue Mar 24 17:42:53 2015 (r280450) +++ head/sys/dev/ata/chipsets/ata-ati.c Tue Mar 24 18:09:07 2015 (r280451) @@ -64,9 +64,6 @@ static int ata_ati_setmode(device_t dev, #define ATI_PATA 0x02 #define ATI_AHCI 0x04 -static int force_ahci = 1; -TUNABLE_INT("hw.ahci.force", &force_ahci); - /* * ATI chipset support functions */ @@ -104,8 +101,6 @@ ata_ati_probe(device_t dev) if (!(ctlr->chip = ata_match_chip(dev, ids))) return ENXIO; - ata_set_desc(dev); - switch (ctlr->chip->cfg1) { case ATI_PATA: ctlr->chipinit = ata_ati_chipinit; @@ -117,12 +112,13 @@ ata_ati_probe(device_t dev) ctlr->chipinit = ata_sii_chipinit; break; case ATI_AHCI: - if (force_ahci == 1 || pci_get_subclass(dev) != PCIS_STORAGE_IDE) - ctlr->chipinit = ata_ahci_chipinit; - else - ctlr->chipinit = ata_ati_chipinit; + if (pci_get_subclass(dev) != PCIS_STORAGE_IDE) + return (ENXIO); + ctlr->chipinit = ata_ati_chipinit; break; } + + ata_set_desc(dev); return (BUS_PROBE_LOW_PRIORITY); } @@ -264,5 +260,4 @@ ata_ati_setmode(device_t dev, int target } ATA_DECLARE_DRIVER(ata_ati); -MODULE_DEPEND(ata_ati, ata_ahci, 1, 1, 1); MODULE_DEPEND(ata_ati, ata_sii, 1, 1, 1); Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Tue Mar 24 17:42:53 2015 (r280450) +++ head/sys/dev/ata/chipsets/ata-intel.c Tue Mar 24 18:09:07 2015 (r280451) @@ -80,7 +80,6 @@ static void ata_intel_31244_tf_write(str static void ata_intel_31244_reset(device_t dev); /* misc defines */ -#define INTEL_AHCI 1 #define INTEL_ICH5 2 #define INTEL_6CH 4 #define INTEL_6CH2 8 @@ -127,118 +126,57 @@ ata_intel_probe(device_t dev) { ATA_I6300ESB_S1, 0, INTEL_ICH5, 2, ATA_SA150, "6300ESB" }, { ATA_I6300ESB_R1, 0, INTEL_ICH5, 2, ATA_SA150, "6300ESB" }, { ATA_I82801FB, 0, 0, 2, ATA_UDMA5, "ICH6" }, - { ATA_I82801FB_S1, 0, INTEL_AHCI, 0, ATA_SA150, "ICH6" }, - { ATA_I82801FB_R1, 0, INTEL_AHCI, 0, ATA_SA150, "ICH6" }, - { ATA_I82801FBM, 0, INTEL_AHCI, 0, ATA_SA150, "ICH6M" }, + { ATA_I82801FB_S1, 0, 0, 0, ATA_SA150, "ICH6" }, + { ATA_I82801FB_R1, 0, 0, 0, ATA_SA150, "ICH6" }, + { ATA_I82801FBM, 0, 0, 0, ATA_SA150, "ICH6M" }, { ATA_I82801GB, 0, 0, 1, ATA_UDMA5, "ICH7" }, { ATA_I82801GB_S1, 0, INTEL_ICH7, 0, ATA_SA300, "ICH7" }, - { ATA_I82801GB_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, - { ATA_I82801GB_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, { ATA_I82801GBM_S1, 0, INTEL_ICH7, 0, ATA_SA150, "ICH7M" }, - { ATA_I82801GBM_R1, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, - { ATA_I82801GBM_AH, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, { ATA_I63XXESB2, 0, 0, 1, ATA_UDMA5, "63XXESB2" }, { ATA_I63XXESB2_S1, 0, 0, 0, ATA_SA300, "63XXESB2" }, - { ATA_I63XXESB2_S2, 0, INTEL_AHCI, 0, ATA_SA300, "63XXESB2" }, - { ATA_I63XXESB2_R1, 0, INTEL_AHCI, 0, ATA_SA300, "63XXESB2" }, - { ATA_I63XXESB2_R2, 0, INTEL_AHCI, 0, ATA_SA300, "63XXESB2" }, { ATA_I82801HB_S1, 0, INTEL_6CH, 0, ATA_SA300, "ICH8" }, { ATA_I82801HB_S2, 0, INTEL_6CH2, 0, ATA_SA300, "ICH8" }, - { ATA_I82801HB_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH8" }, - { ATA_I82801HB_AH4, 0, INTEL_AHCI, 0, ATA_SA300, "ICH8" }, - { ATA_I82801HB_AH6, 0, INTEL_AHCI, 0, ATA_SA300, "ICH8" }, { ATA_I82801HBM, 0, 0, 1, ATA_UDMA5, "ICH8M" }, { ATA_I82801HBM_S1, 0, INTEL_6CH, 0, ATA_SA300, "ICH8M" }, - { ATA_I82801HBM_S2, 0, INTEL_AHCI, 0, ATA_SA300, "ICH8M" }, - { ATA_I82801HBM_S3, 0, INTEL_AHCI, 0, ATA_SA300, "ICH8M" }, { ATA_I82801IB_S1, 0, INTEL_6CH, 0, ATA_SA300, "ICH9" }, { ATA_I82801IB_S2, 0, INTEL_6CH2, 0, ATA_SA300, "ICH9" }, { ATA_I82801IB_S3, 0, INTEL_6CH2, 0, ATA_SA300, "ICH9" }, - { ATA_I82801IB_AH4, 0, INTEL_AHCI, 0, ATA_SA300, "ICH9" }, - { ATA_I82801IB_AH6, 0, INTEL_AHCI, 0, ATA_SA300, "ICH9" }, - { ATA_I82801IB_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH9" }, { ATA_I82801IBM_S1, 0, INTEL_6CH2, 0, ATA_SA300, "ICH9M" }, - { ATA_I82801IBM_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH9M" }, - { ATA_I82801IBM_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH9M" }, { ATA_I82801IBM_S2, 0, INTEL_6CH2, 0, ATA_SA300, "ICH9M" }, { ATA_I82801JIB_S1, 0, INTEL_6CH, 0, ATA_SA300, "ICH10" }, - { ATA_I82801JIB_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, - { ATA_I82801JIB_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JIB_S2, 0, INTEL_6CH2, 0, ATA_SA300, "ICH10" }, { ATA_I82801JD_S1, 0, INTEL_6CH, 0, ATA_SA300, "ICH10" }, - { ATA_I82801JD_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, - { ATA_I82801JD_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JD_S2, 0, INTEL_6CH2, 0, ATA_SA300, "ICH10" }, { ATA_I82801JI_S1, 0, INTEL_6CH, 0, ATA_SA300, "ICH10" }, - { ATA_I82801JI_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, - { ATA_I82801JI_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JI_S2, 0, INTEL_6CH2, 0, ATA_SA300, "ICH10" }, { ATA_5Series_S1, 0, INTEL_6CH, 0, ATA_SA300, "5 Series/3400 Series PCH" }, { ATA_5Series_S2, 0, INTEL_6CH2, 0, ATA_SA300, "5 Series/3400 Series PCH" }, - { ATA_5Series_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, - { ATA_5Series_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, - { ATA_5Series_R1, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, { ATA_5Series_S3, 0, INTEL_6CH2, 0, ATA_SA300, "5 Series/3400 Series PCH" }, { ATA_5Series_S4, 0, INTEL_6CH, 0, ATA_SA300, "5 Series/3400 Series PCH" }, - { ATA_5Series_AH3, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, - { ATA_5Series_R2, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, { ATA_5Series_S5, 0, INTEL_6CH2, 0, ATA_SA300, "5 Series/3400 Series PCH" }, { ATA_5Series_S6, 0, INTEL_6CH, 0, ATA_SA300, "5 Series/3400 Series PCH" }, - { ATA_5Series_AH4, 0, INTEL_AHCI, 0, ATA_SA300, "5 Series/3400 Series PCH" }, { ATA_CPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Cougar Point" }, { ATA_CPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Cougar Point" }, - { ATA_CPT_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Cougar Point" }, - { ATA_CPT_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "Cougar Point" }, - { ATA_CPT_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Cougar Point" }, - { ATA_CPT_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Cougar Point" }, { ATA_CPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Cougar Point" }, { ATA_CPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Cougar Point" }, { ATA_PBG_S1, 0, INTEL_6CH, 0, ATA_SA300, "Patsburg" }, - { ATA_PBG_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, - { ATA_PBG_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, - { ATA_PBG_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, - { ATA_PBG_R3, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, { ATA_PBG_S2, 0, INTEL_6CH2, 0, ATA_SA300, "Patsburg" }, { ATA_PPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Panther Point" }, { ATA_PPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Panther Point" }, - { ATA_PPT_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, - { ATA_PPT_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, - { ATA_PPT_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, - { ATA_PPT_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, - { ATA_PPT_R3, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, - { ATA_PPT_R4, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, { ATA_PPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Panther Point" }, { ATA_PPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Panther Point" }, - { ATA_PPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, - { ATA_PPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, { ATA_AVOTON_S1, 0, INTEL_6CH, 0, ATA_SA300, "Avoton" }, { ATA_AVOTON_S2, 0, INTEL_6CH, 0, ATA_SA300, "Avoton" }, { ATA_AVOTON_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Avoton" }, { ATA_AVOTON_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Avoton" }, { ATA_LPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point" }, - { ATA_LPT_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, - { ATA_LPT_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, - { ATA_LPT_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, - { ATA_LPT_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, - { ATA_LPT_R3, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, - { ATA_LPT_R4, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point" }, - { ATA_LPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, - { ATA_LPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, { ATA_WCPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Wildcat Point" }, { ATA_WCPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Wildcat Point" }, - { ATA_WCPT_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, - { ATA_WCPT_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, - { ATA_WCPT_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, - { ATA_WCPT_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, - { ATA_WCPT_R3, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, - { ATA_WCPT_R4, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, { ATA_WCPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Wildcat Point" }, { ATA_WCPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Wildcat Point" }, - { ATA_WCPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, - { ATA_WCPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, { ATA_WELLS_S1, 0, INTEL_6CH, 0, ATA_SA300, "Wellsburg" }, { ATA_WELLS_S2, 0, INTEL_6CH2, 0, ATA_SA300, "Wellsburg" }, { ATA_WELLS_S3, 0, INTEL_6CH, 0, ATA_SA300, "Wellsburg" }, @@ -249,10 +187,8 @@ ata_intel_probe(device_t dev) { ATA_LPTLP_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point-LP" }, { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, - { ATA_DH89XXCC, 0, INTEL_AHCI, 0, ATA_SA300, "DH89xxCC" }, { ATA_COLETOCRK_S1, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" }, { ATA_COLETOCRK_S2, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" }, - { ATA_COLETOCRK_AH1,0, INTEL_AHCI, 0, ATA_SA300, "COLETOCRK" }, { 0, 0, 0, 0, 0, 0}}; if (pci_get_vendor(dev) != ATA_INTEL_ID) @@ -326,15 +262,6 @@ ata_intel_chipinit(device_t dev) ctlr->ch_detach = ata_pci_ch_detach; ctlr->reset = ata_intel_reset; - /* - * if we have AHCI capability and AHCI or RAID mode enabled - * in BIOS we try for AHCI mode - */ - if ((ctlr->chip->cfg1 & INTEL_AHCI) && - (pci_read_config(dev, 0x90, 1) & 0xc0) && - (ata_ahci_chipinit(dev) != ENXIO)) - return 0; - /* BAR(5) may point to SATA interface registers */ if ((ctlr->chip->cfg1 & INTEL_ICH7)) { ctlr->r_type2 = SYS_RES_MEMORY; @@ -995,4 +922,3 @@ ata_intel_31244_reset(device_t dev) } ATA_DECLARE_DRIVER(ata_intel); -MODULE_DEPEND(ata_intel, ata_ahci, 1, 1, 1); Modified: head/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-jmicron.c Tue Mar 24 17:42:53 2015 (r280450) +++ head/sys/dev/ata/chipsets/ata-jmicron.c Tue Mar 24 18:09:07 2015 (r280451) @@ -100,11 +100,7 @@ ata_jmicron_chipinit(device_t dev) /* do we have multiple PCI functions ? */ if (pci_read_config(dev, 0xdf, 1) & 0x40) { - /* are we on the AHCI part ? */ - if (ata_ahci_chipinit(dev) != ENXIO) - return 0; - - /* otherwise we are on the PATA part */ + /* If this was not claimed by AHCI, then we are on the PATA part */ ctlr->ch_attach = ata_jmicron_ch_attach; ctlr->ch_detach = ata_pci_ch_detach; ctlr->reset = ata_generic_reset; @@ -160,4 +156,3 @@ ata_jmicron_setmode(device_t dev, int ta } ATA_DECLARE_DRIVER(ata_jmicron); -MODULE_DEPEND(ata_jmicron, ata_ahci, 1, 1, 1); Modified: head/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-marvell.c Tue Mar 24 17:42:53 2015 (r280450) +++ head/sys/dev/ata/chipsets/ata-marvell.c Tue Mar 24 18:09:07 2015 (r280451) @@ -55,20 +55,8 @@ static int ata_marvell_chipinit(device_t static int ata_marvell_ch_attach(device_t dev); static int ata_marvell_setmode(device_t dev, int target, int mode); static int ata_marvell_dummy_chipinit(device_t dev); -static int ata_marvell_edma_ch_attach(device_t dev); -static int ata_marvell_edma_ch_detach(device_t dev); -static int ata_marvell_edma_status(device_t dev); -static int ata_marvell_edma_begin_transaction(struct ata_request *request); -static int ata_marvell_edma_end_transaction(struct ata_request *request); -static void ata_marvell_edma_reset(device_t dev); -static void ata_marvell_edma_dmasetprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); -static void ata_marvell_edma_dmainit(device_t dev); /* misc defines */ -#define MV_50XX 50 -#define MV_60XX 60 -#define MV_6042 62 -#define MV_7042 72 #define MV_61XX 61 #define MV_91XX 91 @@ -99,15 +87,7 @@ ata_marvell_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); static const struct ata_chip_id ids[] = - {{ ATA_M88SX5040, 0, 4, MV_50XX, ATA_SA150, "88SX5040" }, - { ATA_M88SX5041, 0, 4, MV_50XX, ATA_SA150, "88SX5041" }, - { ATA_M88SX5080, 0, 8, MV_50XX, ATA_SA150, "88SX5080" }, - { ATA_M88SX5081, 0, 8, MV_50XX, ATA_SA150, "88SX5081" }, - { ATA_M88SX6041, 0, 4, MV_60XX, ATA_SA300, "88SX6041" }, - { ATA_M88SX6042, 0, 4, MV_6042, ATA_SA300, "88SX6042" }, - { ATA_M88SX6081, 0, 8, MV_60XX, ATA_SA300, "88SX6081" }, - { ATA_M88SX7042, 0, 4, MV_7042, ATA_SA300, "88SX7042" }, - { ATA_M88SE6101, 0, 0, MV_61XX, ATA_UDMA6, "88SE6101" }, + {{ ATA_M88SE6101, 0, 0, MV_61XX, ATA_UDMA6, "88SE6101" }, { ATA_M88SE6102, 0, 0, MV_61XX, ATA_UDMA6, "88SE6102" }, { ATA_M88SE6111, 0, 1, MV_61XX, ATA_UDMA6, "88SE6111" }, { ATA_M88SE6121, 0, 2, MV_61XX, ATA_UDMA6, "88SE6121" }, @@ -126,12 +106,6 @@ ata_marvell_probe(device_t dev) ata_set_desc(dev); switch (ctlr->chip->cfg2) { - case MV_50XX: - case MV_60XX: - case MV_6042: - case MV_7042: - ctlr->chipinit = ata_marvell_edma_chipinit; - break; case MV_61XX: ctlr->chipinit = ata_marvell_chipinit; break; @@ -205,425 +179,4 @@ ata_marvell_dummy_chipinit(device_t dev) return (0); } -int -ata_marvell_edma_chipinit(device_t dev) -{ - struct ata_pci_controller *ctlr = device_get_softc(dev); - - if (ata_setup_interrupt(dev, ata_generic_intr)) - return ENXIO; - - ctlr->r_type1 = SYS_RES_MEMORY; - ctlr->r_rid1 = PCIR_BAR(0); - if (!(ctlr->r_res1 = bus_alloc_resource_any(dev, ctlr->r_type1, - &ctlr->r_rid1, RF_ACTIVE))) - return ENXIO; - - /* mask all host controller interrupts */ - ATA_OUTL(ctlr->r_res1, 0x01d64, 0x00000000); - - /* mask all PCI interrupts */ - ATA_OUTL(ctlr->r_res1, 0x01d5c, 0x00000000); - - ctlr->ch_attach = ata_marvell_edma_ch_attach; - ctlr->ch_detach = ata_marvell_edma_ch_detach; - ctlr->reset = ata_marvell_edma_reset; - ctlr->setmode = ata_sata_setmode; - ctlr->getrev = ata_sata_getrev; - ctlr->channels = ctlr->chip->cfg1; - - /* clear host controller interrupts */ - ATA_OUTL(ctlr->r_res1, 0x20014, 0x00000000); - if (ctlr->chip->cfg1 > 4) - ATA_OUTL(ctlr->r_res1, 0x30014, 0x00000000); - - /* clear PCI interrupts */ - ATA_OUTL(ctlr->r_res1, 0x01d58, 0x00000000); - - /* unmask PCI interrupts we want */ - ATA_OUTL(ctlr->r_res1, 0x01d5c, 0x007fffff); - - /* unmask host controller interrupts we want */ - ATA_OUTL(ctlr->r_res1, 0x01d64, 0x000000ff/*HC0*/ | 0x0001fe00/*HC1*/ | - /*(1<<19) | (1<<20) | (1<<21) |*/(1<<22) | (1<<24) | (0x7f << 25)); - - return 0; -} - -static int -ata_marvell_edma_ch_attach(device_t dev) -{ - struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); - struct ata_channel *ch = device_get_softc(dev); - u_int64_t work; - int i; - - ata_marvell_edma_dmainit(dev); - work = ch->dma.work_bus; - /* clear work area */ - bzero(ch->dma.work, 1024+256); - bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - - /* set legacy ATA resources */ - for (i = ATA_DATA; i <= ATA_COMMAND; i++) { - ch->r_io[i].res = ctlr->r_res1; - ch->r_io[i].offset = 0x02100 + (i << 2) + ATA_MV_EDMA_BASE(ch); - } - ch->r_io[ATA_CONTROL].res = ctlr->r_res1; - ch->r_io[ATA_CONTROL].offset = 0x02120 + ATA_MV_EDMA_BASE(ch); - ch->r_io[ATA_IDX_ADDR].res = ctlr->r_res1; - ata_default_registers(dev); - - /* set SATA resources */ - switch (ctlr->chip->cfg2) { - case MV_50XX: - ch->r_io[ATA_SSTATUS].res = ctlr->r_res1; - ch->r_io[ATA_SSTATUS].offset = 0x00100 + ATA_MV_HOST_BASE(ch); - ch->r_io[ATA_SERROR].res = ctlr->r_res1; - ch->r_io[ATA_SERROR].offset = 0x00104 + ATA_MV_HOST_BASE(ch); - ch->r_io[ATA_SCONTROL].res = ctlr->r_res1; - ch->r_io[ATA_SCONTROL].offset = 0x00108 + ATA_MV_HOST_BASE(ch); - break; - case MV_60XX: - case MV_6042: - case MV_7042: - ch->r_io[ATA_SSTATUS].res = ctlr->r_res1; - ch->r_io[ATA_SSTATUS].offset = 0x02300 + ATA_MV_EDMA_BASE(ch); - ch->r_io[ATA_SERROR].res = ctlr->r_res1; - ch->r_io[ATA_SERROR].offset = 0x02304 + ATA_MV_EDMA_BASE(ch); - ch->r_io[ATA_SCONTROL].res = ctlr->r_res1; - ch->r_io[ATA_SCONTROL].offset = 0x02308 + ATA_MV_EDMA_BASE(ch); - ch->r_io[ATA_SACTIVE].res = ctlr->r_res1; - ch->r_io[ATA_SACTIVE].offset = 0x02350 + ATA_MV_EDMA_BASE(ch); - break; - } - - ch->flags |= ATA_NO_SLAVE; - ch->flags |= ATA_USE_16BIT; /* XXX SOS needed ? */ - ch->flags |= ATA_SATA; - ata_generic_hw(dev); - ch->hw.begin_transaction = ata_marvell_edma_begin_transaction; - ch->hw.end_transaction = ata_marvell_edma_end_transaction; - ch->hw.status = ata_marvell_edma_status; - - /* disable the EDMA machinery */ - ATA_OUTL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch), 0x00000002); - DELAY(100000); /* SOS should poll for disabled */ - - /* set configuration to non-queued 128b read transfers stop on error */ - ATA_OUTL(ctlr->r_res1, 0x02000 + ATA_MV_EDMA_BASE(ch), (1<<11) | (1<<13)); - - /* request queue base high */ - ATA_OUTL(ctlr->r_res1, 0x02010 + ATA_MV_EDMA_BASE(ch), work >> 32); - - /* request queue in ptr */ - ATA_OUTL(ctlr->r_res1, 0x02014 + ATA_MV_EDMA_BASE(ch), work & 0xffffffff); - - /* request queue out ptr */ - ATA_OUTL(ctlr->r_res1, 0x02018 + ATA_MV_EDMA_BASE(ch), 0x0); - - /* response queue base high */ - work += 1024; - ATA_OUTL(ctlr->r_res1, 0x0201c + ATA_MV_EDMA_BASE(ch), work >> 32); - - /* response queue in ptr */ - ATA_OUTL(ctlr->r_res1, 0x02020 + ATA_MV_EDMA_BASE(ch), 0x0); - - /* response queue out ptr */ - ATA_OUTL(ctlr->r_res1, 0x02024 + ATA_MV_EDMA_BASE(ch), work & 0xffffffff); - - /* clear SATA error register */ - ATA_IDX_OUTL(ch, ATA_SERROR, ATA_IDX_INL(ch, ATA_SERROR)); - - /* clear any outstanding error interrupts */ - ATA_OUTL(ctlr->r_res1, 0x02008 + ATA_MV_EDMA_BASE(ch), 0x0); - - /* unmask all error interrupts */ - ATA_OUTL(ctlr->r_res1, 0x0200c + ATA_MV_EDMA_BASE(ch), ~0x0); - - /* enable EDMA machinery */ - ATA_OUTL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch), 0x00000001); - return 0; -} - -static int -ata_marvell_edma_ch_detach(device_t dev) -{ - struct ata_channel *ch = device_get_softc(dev); - - if (ch->dma.work_tag && ch->dma.work_map) - bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - ata_dmafini(dev); - return (0); -} - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 18:46:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2D52949; Tue, 24 Mar 2015 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 AD1EC5EF; Tue, 24 Mar 2015 18:46:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OIk2BG030378; Tue, 24 Mar 2015 18:46:02 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OIk2Im030374; Tue, 24 Mar 2015 18:46:02 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503241846.t2OIk2Im030374@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 24 Mar 2015 18:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280452 - in head/sys: arm/broadcom/bcm2835 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-1 Precedence: list List-Id: SVN 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 Mar 2015 18:46:02 -0000 Author: andrew Date: Tue Mar 24 18:46:01 2015 New Revision: 280452 URL: https://svnweb.freebsd.org/changeset/base/280452 Log: Add the SOC_BCM2835 and SOC_BCM2836 options for the arm kernel and add the former to std.bcm2835. These will be used to enable support for the Raspberry Pi 2. MFC after: 1 week Modified: head/sys/arm/broadcom/bcm2835/std.bcm2835 head/sys/conf/options.arm Modified: head/sys/arm/broadcom/bcm2835/std.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/std.bcm2835 Tue Mar 24 18:09:07 2015 (r280451) +++ head/sys/arm/broadcom/bcm2835/std.bcm2835 Tue Mar 24 18:46:01 2015 (r280452) @@ -3,6 +3,7 @@ machine arm armv6 cpu CPU_ARM1176 makeoptions CONF_CFLAGS="-mcpu=arm1176jzf-s" +options SOC_BCM2835 files "../broadcom/bcm2835/files.bcm2835" files "../broadcom/bcm2835/files.bcm283x" Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Tue Mar 24 18:09:07 2015 (r280451) +++ head/sys/conf/options.arm Tue Mar 24 18:46:01 2015 (r280452) @@ -39,6 +39,8 @@ SOCDEV_PA opt_global.h SOCDEV_VA opt_global.h PV_STATS opt_pmap.h QEMU_WORKAROUNDS opt_global.h +SOC_BCM2835 opt_global.h +SOC_BCM2836 opt_global.h SOC_MV_ARMADAXP opt_global.h SOC_MV_DISCOVERY opt_global.h SOC_MV_DOVE opt_global.h From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 19:01:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11DC8E62; Tue, 24 Mar 2015 19:01: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 F0C72853; Tue, 24 Mar 2015 19:01:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OJ1huj037449; Tue, 24 Mar 2015 19:01:43 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OJ1hYc037445; Tue, 24 Mar 2015 19:01:43 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503241901.t2OJ1hYc037445@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 24 Mar 2015 19:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280453 - in head/sys/arm: broadcom/bcm2835 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-1 Precedence: list List-Id: SVN 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 Mar 2015 19:01:44 -0000 Author: andrew Date: Tue Mar 24 19:01:42 2015 New Revision: 280453 URL: https://svnweb.freebsd.org/changeset/base/280453 Log: Move including std.bcm2835 to the RPI-B kernel config. The std.rpi file will be shared between the existing Raspberry Pi config, and the new Raspberry Pi 2 config. MFC after: 1 week Modified: head/sys/arm/broadcom/bcm2835/std.rpi head/sys/arm/conf/RPI-B Modified: head/sys/arm/broadcom/bcm2835/std.rpi ============================================================================== --- head/sys/arm/broadcom/bcm2835/std.rpi Tue Mar 24 18:46:01 2015 (r280452) +++ head/sys/arm/broadcom/bcm2835/std.rpi Tue Mar 24 19:01:42 2015 (r280453) @@ -1,7 +1,5 @@ # $FreeBSD$ -include "../broadcom/bcm2835/std.bcm2835" - options KERNVIRTADDR=0xc0100000 makeoptions KERNVIRTADDR=0xc0100000 options KERNPHYSADDR=0x00100000 Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Tue Mar 24 18:46:01 2015 (r280452) +++ head/sys/arm/conf/RPI-B Tue Mar 24 19:01:42 2015 (r280453) @@ -21,6 +21,7 @@ ident RPI-B include "../broadcom/bcm2835/std.rpi" +include "../broadcom/bcm2835/std.bcm2835" options HZ=100 options SCHED_4BSD # 4BSD scheduler From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 20:07:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E55374FB; Tue, 24 Mar 2015 20: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 D1857F0B; Tue, 24 Mar 2015 20:07:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OK7Sf9069857; Tue, 24 Mar 2015 20:07:28 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OK7SAO069856; Tue, 24 Mar 2015 20:07:28 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201503242007.t2OK7SAO069856@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 24 Mar 2015 20:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280456 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 20:07:29 -0000 Author: rpaulo Date: Tue Mar 24 20:07:27 2015 New Revision: 280456 URL: https://svnweb.freebsd.org/changeset/base/280456 Log: Remove whitespace. Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Mar 24 20:00:11 2015 (r280455) +++ head/sys/vm/vm_page.c Tue Mar 24 20:07:27 2015 (r280456) @@ -160,7 +160,7 @@ vm_page_init_fakepg(void *dummy) { fakepg_zone = uma_zcreate("fakepg", sizeof(struct vm_page), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE | UMA_ZONE_VM); + NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE | UMA_ZONE_VM); } /* Make sure that u_long is at least 64 bits when PAGE_SIZE is 32K. */ @@ -443,7 +443,7 @@ vm_page_startup(vm_offset_t vaddr) */ for (pa = new_end; pa < phys_avail[biggestone + 1]; pa += PAGE_SIZE) dump_add_page(pa); -#endif +#endif phys_avail[biggestone + 1] = new_end; /* @@ -702,7 +702,7 @@ vm_page_unhold(vm_page_t mem) * vm_page_unhold_pages: * * Unhold each of the pages that is referenced by the given array. - */ + */ void vm_page_unhold_pages(vm_page_t *ma, int count) { @@ -1303,7 +1303,7 @@ vm_page_rename(vm_page_t m, vm_object_t * zero is given for "end", then the range's upper bound is * infinity. If the given object is backed by a vnode and it * transitions from having one or more cached pages to none, the - * vnode's hold count is reduced. + * vnode's hold count is reduced. */ void vm_page_cache_free(vm_object_t object, vm_pindex_t start, vm_pindex_t end) @@ -1455,7 +1455,7 @@ vm_page_is_cached(vm_object_t object, vm * VM_ALLOC_NOBUSY do not exclusive busy the page * VM_ALLOC_NODUMP do not include the page in a kernel core dump * VM_ALLOC_NOOBJ page is not associated with an object and - * should not be exclusive busy + * should not be exclusive busy * VM_ALLOC_SBUSY shared busy the allocated page * VM_ALLOC_WIRED wire the allocated page * VM_ALLOC_ZERO prefer a zeroed page @@ -1563,7 +1563,7 @@ vm_page_alloc(vm_object_t object, vm_pin ("vm_page_alloc: page %p has unexpected queue %d", m, m->queue)); KASSERT(m->wire_count == 0, ("vm_page_alloc: page %p is wired", m)); KASSERT(m->hold_count == 0, ("vm_page_alloc: page %p is held", m)); - KASSERT(!vm_page_sbusied(m), + KASSERT(!vm_page_sbusied(m), ("vm_page_alloc: page %p is busy", m)); KASSERT(m->dirty == 0, ("vm_page_alloc: page %p is dirty", m)); KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, @@ -1702,7 +1702,7 @@ vm_page_alloc_contig_vdrop(struct spglis * optional allocation flags: * VM_ALLOC_NOBUSY do not exclusive busy the page * VM_ALLOC_NOOBJ page is not associated with an object and - * should not be exclusive busy + * should not be exclusive busy * VM_ALLOC_SBUSY shared busy the allocated page * VM_ALLOC_WIRED wire the allocated page * VM_ALLOC_ZERO prefer a zeroed page @@ -2399,7 +2399,7 @@ vm_page_unwire(vm_page_t m, uint8_t queu * This will cause them to be moved to the cache more quickly and * if not actively re-referenced, reclaimed more quickly. If we just * stick these pages at the end of the inactive queue, heavy filesystem - * meta-data accesses can cause an unnecessary paging load on memory bound + * meta-data accesses can cause an unnecessary paging load on memory bound * processes. This optimization causes one-time-use metadata to be * reused more quickly. * @@ -2537,7 +2537,7 @@ vm_page_cache(vm_page_t m) /* * Remove the page from the object's collection of resident - * pages. + * pages. */ vm_radix_remove(&object->rtree, m->pindex); TAILQ_REMOVE(&object->memq, m, listq); @@ -2610,7 +2610,7 @@ vm_page_cache(vm_page_t m) * it gets reused quickly. However, this can result in a silly syndrome * due to the page recycling too quickly. Small objects will not be * fully cached. On the other hand, if we move the page to the inactive - * queue we wind up with a problem whereby very large objects + * queue we wind up with a problem whereby very large objects * unnecessarily blow away our inactive and cache queues. * * The solution is to move the pages based on a fixed weighting. We @@ -2712,7 +2712,7 @@ retrylookup: vm_page_xbusied(m) : vm_page_busied(m); if (sleep) { if ((allocflags & VM_ALLOC_NOWAIT) != 0) - return (NULL); + return (NULL); /* * Reference the page before unlocking and * sleeping so that the page daemon is less @@ -2808,7 +2808,7 @@ vm_page_set_valid_range(vm_page_t m, int pmap_zero_page_area(m, frag, base - frag); /* - * If the ending offset is not DEV_BSIZE aligned and the + * If the ending offset is not DEV_BSIZE aligned and the * valid bit is clear, we have to zero out a portion of * the last block. */ @@ -2820,7 +2820,7 @@ vm_page_set_valid_range(vm_page_t m, int /* * Assert that no previously invalid block that is now being validated - * is already dirty. + * is already dirty. */ KASSERT((~m->valid & vm_page_bits(base, size) & m->dirty) == 0, ("vm_page_set_valid_range: page %p is dirty", m)); @@ -2915,7 +2915,7 @@ vm_page_set_validclean(vm_page_t m, int pmap_zero_page_area(m, frag, base - frag); /* - * If the ending offset is not DEV_BSIZE aligned and the + * If the ending offset is not DEV_BSIZE aligned and the * valid bit is clear, we have to zero out a portion of * the last block. */ @@ -3011,12 +3011,12 @@ vm_page_set_invalid(vm_page_t m, int bas /* * vm_page_zero_invalid() * - * The kernel assumes that the invalid portions of a page contain + * The kernel assumes that the invalid portions of a page contain * garbage, but such pages can be mapped into memory by user code. * When this occurs, we must zero out the non-valid portions of the * page so user code sees what it expects. * - * Pages are most often semi-valid when the end of a file is mapped + * Pages are most often semi-valid when the end of a file is mapped * into memory and the file's size is not page aligned. */ void @@ -3033,10 +3033,10 @@ vm_page_zero_invalid(vm_page_t m, boolea * vm_page_set_validclean(). */ for (b = i = 0; i <= PAGE_SIZE / DEV_BSIZE; ++i) { - if (i == (PAGE_SIZE / DEV_BSIZE) || + if (i == (PAGE_SIZE / DEV_BSIZE) || (m->valid & ((vm_page_bits_t)1 << i))) { if (i > b) { - pmap_zero_page_area(m, + pmap_zero_page_area(m, b << DEV_BSHIFT, (i - b) << DEV_BSHIFT); } b = i + 1; From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 20:09:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72DFB784; Tue, 24 Mar 2015 20: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 5F406F3A; Tue, 24 Mar 2015 20:09:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OK9uPe070194; Tue, 24 Mar 2015 20:09:56 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OK9u3Q070193; Tue, 24 Mar 2015 20:09:56 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201503242009.t2OK9u3Q070193@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 24 Mar 2015 20:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280457 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 20:09:56 -0000 Author: rpaulo Date: Tue Mar 24 20:09:55 2015 New Revision: 280457 URL: https://svnweb.freebsd.org/changeset/base/280457 Log: Use TUNABLE_INT_FETCH for boot_pages. vm.boot_pages is marked as a CTLFLAG_RDTUN, but it's used by the VM before the sysctl subsystem is initialsed. We manually fetch the variable from the environment to work around this problem. Tested by: Keith White kwhite at uottawa.ca MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Mar 24 20:07:27 2015 (r280456) +++ head/sys/vm/vm_page.c Tue Mar 24 20:09:55 2015 (r280457) @@ -134,8 +134,9 @@ long first_page; int vm_page_zero_count; static int boot_pages = UMA_BOOT_PAGES; -SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RDTUN, &boot_pages, 0, - "number of pages allocated for bootstrapping the VM system"); +SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + &boot_pages, 0, + "number of pages allocated for bootstrapping the VM system"); static int pa_tryrelock_restart; SYSCTL_INT(_vm, OID_AUTO, tryrelock_restart, CTLFLAG_RD, @@ -349,6 +350,7 @@ vm_page_startup(vm_offset_t vaddr) * Allocate memory for use when boot strapping the kernel memory * allocator. */ + TUNABLE_INT_FETCH("vm.boot_pages", &boot_pages); new_end = end - (boot_pages * UMA_SLAB_SIZE); new_end = trunc_page(new_end); mapped = pmap_map(&vaddr, new_end, end, From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 20:33:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1095FF11; Tue, 24 Mar 2015 20:33: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 F0DB127C; Tue, 24 Mar 2015 20:33:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OKXPUC084147; Tue, 24 Mar 2015 20:33:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OKXP6A084142; Tue, 24 Mar 2015 20:33:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503242033.t2OKXP6A084142@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 24 Mar 2015 20:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280458 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 20:33:26 -0000 Author: pfg Date: Tue Mar 24 20:33:24 2015 New Revision: 280458 URL: https://svnweb.freebsd.org/changeset/base/280458 Log: Introduce nonnull attributes in the signal and pthread headers. The `nonnull' attribute specifies that some function parameters should be non-null pointers. This is very useful as it helps the compiler generate warnings on suspicious code and can also enable some small optimizations. In clang this is also useful for the static analyzer. While we could go on defining this all over the tree, it only makes sense to annotate a subset of critical functions. Hinted by: Android's bionic libc Differential Revision: https://reviews.freebsd.org/D2101 Modified: head/include/pthread.h head/include/signal.h Modified: head/include/pthread.h ============================================================================== --- head/include/pthread.h Tue Mar 24 20:09:55 2015 (r280457) +++ head/include/pthread.h Tue Mar 24 20:33:24 2015 (r280458) @@ -144,19 +144,23 @@ struct _pthread_cleanup_info { */ __BEGIN_DECLS int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); -int pthread_attr_destroy(pthread_attr_t *); +int pthread_attr_destroy(pthread_attr_t *) __nonnull(1); int pthread_attr_getstack(const pthread_attr_t * __restrict, - void ** __restrict, size_t * __restrict); -int pthread_attr_getstacksize(const pthread_attr_t *, size_t *); + void ** __restrict, size_t * __restrict) + __nonnull(1, 2, 3); +int pthread_attr_getstacksize(const pthread_attr_t *, size_t *) + __nonnull(1, 2); int pthread_attr_getguardsize(const pthread_attr_t *, size_t *); int pthread_attr_getstackaddr(const pthread_attr_t *, void **); -int pthread_attr_getdetachstate(const pthread_attr_t *, int *); -int pthread_attr_init(pthread_attr_t *); -int pthread_attr_setstacksize(pthread_attr_t *, size_t); -int pthread_attr_setguardsize(pthread_attr_t *, size_t); -int pthread_attr_setstack(pthread_attr_t *, void *, size_t); +int pthread_attr_getdetachstate(const pthread_attr_t *, int *) + __nonnull(1, 2); +int pthread_attr_init(pthread_attr_t *) __nonnull(1); +int pthread_attr_setstacksize(pthread_attr_t *, size_t) __nonnull(1); +int pthread_attr_setguardsize(pthread_attr_t *, size_t) __nonnull(1); +int pthread_attr_setstack(pthread_attr_t *, void *, size_t) + __nonnull(1); int pthread_attr_setstackaddr(pthread_attr_t *, void *); -int pthread_attr_setdetachstate(pthread_attr_t *, int); +int pthread_attr_setdetachstate(pthread_attr_t *, int) __nonnull(1); int pthread_barrier_destroy(pthread_barrier_t *); int pthread_barrier_init(pthread_barrier_t *, const pthread_barrierattr_t *, unsigned); @@ -164,7 +168,7 @@ int pthread_barrier_wait(pthread_barrie int pthread_barrierattr_destroy(pthread_barrierattr_t *); int pthread_barrierattr_getpshared(const pthread_barrierattr_t *, int *); -int pthread_barrierattr_init(pthread_barrierattr_t *); +int pthread_barrierattr_init(pthread_barrierattr_t *) __nonnull(1); int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); #define pthread_cleanup_push(cleanup_routine, cleanup_arg) \ @@ -180,85 +184,96 @@ int pthread_barrierattr_setpshared(pthr __pthread_cleanup_pop_imp(execute); \ } -int pthread_condattr_destroy(pthread_condattr_t *); +int pthread_condattr_destroy(pthread_condattr_t *) __nonnull(1); int pthread_condattr_getclock(const pthread_condattr_t *, - clockid_t *); -int pthread_condattr_getpshared(const pthread_condattr_t *, int *); -int pthread_condattr_init(pthread_condattr_t *); -int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); -int pthread_condattr_setpshared(pthread_condattr_t *, int); -int pthread_cond_broadcast(pthread_cond_t *); -int pthread_cond_destroy(pthread_cond_t *); + clockid_t *) __nonnull(1, 2); +int pthread_condattr_getpshared(const pthread_condattr_t *, int *) + __nonnull(1, 2); +int pthread_condattr_init(pthread_condattr_t *) __nonnull(1); +int pthread_condattr_setclock(pthread_condattr_t *, clockid_t) + __nonnull(1); +int pthread_condattr_setpshared(pthread_condattr_t *, int) + __nonnull(1); +int pthread_cond_broadcast(pthread_cond_t *) + __nonnull(1); +int pthread_cond_destroy(pthread_cond_t *) + __nonnull(1); int pthread_cond_init(pthread_cond_t *, - const pthread_condattr_t *); -int pthread_cond_signal(pthread_cond_t *); + const pthread_condattr_t *) __nonnull(1); +int pthread_cond_signal(pthread_cond_t *) __nonnull(1); int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *__mutex, const struct timespec *) - __requires_exclusive(*__mutex); + __nonnull(1, 2, 3) __requires_exclusive(*__mutex); int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *__mutex) - __requires_exclusive(*__mutex); + __nonnull(1, 2) __requires_exclusive(*__mutex); int pthread_create(pthread_t *, const pthread_attr_t *, - void *(*) (void *), void *); + void *(*) (void *), void *) __nonnull(1, 3); int pthread_detach(pthread_t); int pthread_equal(pthread_t, pthread_t); void pthread_exit(void *) __dead2; void *pthread_getspecific(pthread_key_t); -int pthread_getcpuclockid(pthread_t, clockid_t *); +int pthread_getcpuclockid(pthread_t, clockid_t *) __nonnull(2); int pthread_join(pthread_t, void **); int pthread_key_create(pthread_key_t *, - void (*) (void *)); + void (*) (void *)) __nonnull(1); int pthread_key_delete(pthread_key_t); -int pthread_mutexattr_init(pthread_mutexattr_t *); -int pthread_mutexattr_destroy(pthread_mutexattr_t *); +int pthread_mutexattr_init(pthread_mutexattr_t *) __nonnull(1); +int pthread_mutexattr_destroy(pthread_mutexattr_t *) __nonnull(1); int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, - int *); -int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); -int pthread_mutexattr_settype(pthread_mutexattr_t *, int); -int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); + int *) __nonnull(1, 2); +int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *) + __nonnull(1, 2); +int pthread_mutexattr_settype(pthread_mutexattr_t *, int) + __nonnull(1); +int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int) + __nonnull(1); int pthread_mutex_destroy(pthread_mutex_t *__mutex) - __requires_unlocked(*__mutex); + __nonnull(1) __requires_unlocked(*__mutex); int pthread_mutex_init(pthread_mutex_t *__mutex, const pthread_mutexattr_t *) - __requires_unlocked(*__mutex); + __nonnull(1) __requires_unlocked(*__mutex); int pthread_mutex_lock(pthread_mutex_t *__mutex) - __locks_exclusive(*__mutex); + __nonnull(1) __locks_exclusive(*__mutex); int pthread_mutex_trylock(pthread_mutex_t *__mutex) - __trylocks_exclusive(0, *__mutex); + __nonnull(1) __trylocks_exclusive(0, *__mutex); int pthread_mutex_timedlock(pthread_mutex_t *__mutex, const struct timespec *) - __trylocks_exclusive(0, *__mutex); + __nonnull(1, 2) __trylocks_exclusive(0, *__mutex); int pthread_mutex_unlock(pthread_mutex_t *__mutex) - __unlocks(*__mutex); -int pthread_once(pthread_once_t *, void (*) (void)); + __nonnull(1) __unlocks(*__mutex); +int pthread_once(pthread_once_t *, void (*) (void)) __nonnull(1, 2); int pthread_rwlock_destroy(pthread_rwlock_t *__rwlock) - __requires_unlocked(*__rwlock); + __nonnull(1) __requires_unlocked(*__rwlock); int pthread_rwlock_init(pthread_rwlock_t *__rwlock, const pthread_rwlockattr_t *) - __requires_unlocked(*__rwlock); + __nonnull(1) __requires_unlocked(*__rwlock); int pthread_rwlock_rdlock(pthread_rwlock_t *__rwlock) - __locks_shared(*__rwlock); + __nonnull(1) __locks_shared(*__rwlock); int pthread_rwlock_timedrdlock(pthread_rwlock_t *__rwlock, const struct timespec *) - __trylocks_shared(0, *__rwlock); + __nonnull(1, 2) __trylocks_shared(0, *__rwlock); int pthread_rwlock_timedwrlock(pthread_rwlock_t *__rwlock, const struct timespec *) - __trylocks_exclusive(0, *__rwlock); + __nonnull(1, 2) __trylocks_exclusive(0, *__rwlock); int pthread_rwlock_tryrdlock(pthread_rwlock_t *__rwlock) - __trylocks_shared(0, *__rwlock); + __nonnull(1) __trylocks_shared(0, *__rwlock); int pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock) - __trylocks_exclusive(0, *__rwlock); + __nonnull(1) __trylocks_exclusive(0, *__rwlock); int pthread_rwlock_unlock(pthread_rwlock_t *__rwlock) - __unlocks(*__rwlock); + __nonnull(1) __unlocks(*__rwlock); int pthread_rwlock_wrlock(pthread_rwlock_t *__rwlock) - __locks_exclusive(*__rwlock); -int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); + __nonnull(1) __locks_exclusive(*__rwlock); +int pthread_rwlockattr_destroy(pthread_rwlockattr_t *) + __nonnull(1); int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, int *); int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, - int *); -int pthread_rwlockattr_init(pthread_rwlockattr_t *); + int *) __nonnull(1, 2); +int pthread_rwlockattr_init(pthread_rwlockattr_t *) + __nonnull(1); int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); -int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); +int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int) + __nonnull(1); pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); @@ -295,18 +310,20 @@ int pthread_mutexattr_setprotocol(pthre int pthread_attr_getinheritsched(const pthread_attr_t *, int *); int pthread_attr_getschedparam(const pthread_attr_t *, - struct sched_param *); -int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); -int pthread_attr_getscope(const pthread_attr_t *, int *); + struct sched_param *) __nonnull(1, 2); +int pthread_attr_getschedpolicy(const pthread_attr_t *, int *) + __nonnull(1, 2); +int pthread_attr_getscope(const pthread_attr_t *, int *) + __nonnull(1, 2); int pthread_attr_setinheritsched(pthread_attr_t *, int); int pthread_attr_setschedparam(pthread_attr_t *, - const struct sched_param *); -int pthread_attr_setschedpolicy(pthread_attr_t *, int); -int pthread_attr_setscope(pthread_attr_t *, int); + const struct sched_param *) __nonnull(1, 2); +int pthread_attr_setschedpolicy(pthread_attr_t *, int) __nonnull(1); +int pthread_attr_setscope(pthread_attr_t *, int) __nonnull(1); int pthread_getschedparam(pthread_t pthread, int *, - struct sched_param *); + struct sched_param *) __nonnull(2, 3); int pthread_setschedparam(pthread_t, int, - const struct sched_param *); + const struct sched_param *) __nonnull(3); #if __XSI_VISIBLE int pthread_getconcurrency(void); int pthread_setconcurrency(int); Modified: head/include/signal.h ============================================================================== --- head/include/signal.h Tue Mar 24 20:09:55 2015 (r280457) +++ head/include/signal.h Tue Mar 24 20:33:24 2015 (r280458) @@ -78,10 +78,10 @@ int sigdelset(sigset_t *, int); int sigemptyset(sigset_t *); int sigfillset(sigset_t *); int sigismember(const sigset_t *, int); -int sigpending(sigset_t *); +int sigpending(sigset_t *) __nonnull(1); int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); -int sigsuspend(const sigset_t *); -int sigwait(const sigset_t * __restrict, int * __restrict); +int sigsuspend(const sigset_t *) __nonnull(1); +int sigwait(const sigset_t * __restrict, int * __restrict) __nonnull(1, 2); #endif #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600 From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 21:12:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8227979; Tue, 24 Mar 2015 21:12: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 8B119903; Tue, 24 Mar 2015 21:12:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OLCkes003205; Tue, 24 Mar 2015 21:12:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OLCkiK003203; Tue, 24 Mar 2015 21:12:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503242112.t2OLCkiK003203@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 24 Mar 2015 21:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280459 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:12:46 -0000 Author: tuexen Date: Tue Mar 24 21:12:45 2015 New Revision: 280459 URL: https://svnweb.freebsd.org/changeset/base/280459 Log: Fix two bugs which resulted in a screwed up end point list: * Use a save way to walk throught a list while manipulting it. * Have to appropiate locks in place. Joint work with rrs@ MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Mar 24 20:33:24 2015 (r280458) +++ head/sys/netinet/sctp_pcb.c Tue Mar 24 21:12:45 2015 (r280459) @@ -1867,7 +1867,7 @@ sctp_swap_inpcb_for_listen(struct sctp_i { /* For 1-2-1 with port reuse */ struct sctppcbhead *head; - struct sctp_inpcb *tinp; + struct sctp_inpcb *tinp, *ninp; if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_PORTREUSE)) { /* only works with port reuse on */ @@ -1877,10 +1877,11 @@ sctp_swap_inpcb_for_listen(struct sctp_i return (0); } SCTP_INP_RUNLOCK(inp); + SCTP_INP_INFO_WLOCK(); head = &SCTP_BASE_INFO(sctp_ephash)[SCTP_PCBHASH_ALLADDR(inp->sctp_lport, SCTP_BASE_INFO(hashmark))]; /* Kick out all non-listeners to the TCP hash */ - LIST_FOREACH(tinp, head, sctp_hash) { + LIST_FOREACH_SAFE(tinp, head, sctp_hash, ninp) { if (tinp->sctp_lport != inp->sctp_lport) { continue; } @@ -1908,6 +1909,7 @@ sctp_swap_inpcb_for_listen(struct sctp_i LIST_INSERT_HEAD(head, inp, sctp_hash); SCTP_INP_WUNLOCK(inp); SCTP_INP_RLOCK(inp); + SCTP_INP_INFO_WUNLOCK(); return (0); } Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue Mar 24 20:33:24 2015 (r280458) +++ head/sys/netinet/sctp_usrreq.c Tue Mar 24 21:12:45 2015 (r280459) @@ -6965,8 +6965,8 @@ sctp_listen(struct socket *so, int backl #endif SOCK_LOCK(so); error = solisten_proto_check(so); + SOCK_UNLOCK(so); if (error) { - SOCK_UNLOCK(so); SCTP_INP_RUNLOCK(inp); return (error); } @@ -6979,28 +6979,27 @@ sctp_listen(struct socket *so, int backl * move the guy that was listener to the TCP Pool. */ if (sctp_swap_inpcb_for_listen(inp)) { - goto in_use; + SCTP_INP_RUNLOCK(inp); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EADDRINUSE); + return (EADDRINUSE); } } if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) { /* We are already connected AND the TCP model */ -in_use: SCTP_INP_RUNLOCK(inp); - SOCK_UNLOCK(so); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EADDRINUSE); return (EADDRINUSE); } SCTP_INP_RUNLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) { /* We must do a bind. */ - SOCK_UNLOCK(so); if ((error = sctp_inpcb_bind(so, NULL, NULL, p))) { /* bind error, probably perm */ return (error); } - SOCK_LOCK(so); } + SOCK_LOCK(so); /* It appears for 7.0 and on, we must always call this. */ solisten_proto(so, backlog); if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 21:42:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C0EA193; Tue, 24 Mar 2015 21:42: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 38BF4CFF; Tue, 24 Mar 2015 21:42:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OLgTGF019270; Tue, 24 Mar 2015 21:42:29 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OLgT4b019269; Tue, 24 Mar 2015 21:42:29 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201503242142.t2OLgT4b019269@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 24 Mar 2015 21:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280463 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:42:29 -0000 Author: ken Date: Tue Mar 24 21:42:28 2015 New Revision: 280463 URL: https://svnweb.freebsd.org/changeset/base/280463 Log: Remove some #if 0'ed code that apparently confuses cscope. Requested by: Peter Xu MFC after: 3 days Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Mar 24 21:32:49 2015 (r280462) +++ head/sys/cam/ctl/ctl.c Tue Mar 24 21:42:28 2015 (r280463) @@ -12152,9 +12152,6 @@ ctl_lun_reset(struct ctl_lun *lun, union /* * Run through the OOA queue and abort each I/O. */ -#if 0 - TAILQ_FOREACH((struct ctl_io_hdr *)xio, &lun->ooa_queue, ooa_links) { -#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 | CTL_FLAG_ABORT_STATUS; @@ -12335,9 +12332,6 @@ ctl_abort_task(union ctl_io *io) * untagged command to abort, simply abort the first untagged command * we come to. We only allow one untagged command at a time of course. */ -#if 0 - TAILQ_FOREACH((struct ctl_io_hdr *)xio, &lun->ooa_queue, ooa_links) { -#endif for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL; xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) { #if 0 @@ -12375,7 +12369,7 @@ ctl_abort_task(union ctl_io *io) #if 0 if (((xio->scsiio.tag_type == CTL_TAG_UNTAGGED) && (io->taskio.tag_type == CTL_TAG_UNTAGGED)) - || (xio->scsiio.tag_num == io->taskio.tag_num)) { + || (xio->scsiio.tag_num == io->taskio.tag_num)) #endif /* * XXX KDM we've got problems with FC, because it From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 22:39:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97324FBF; Tue, 24 Mar 2015 22: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 83C0A32F; Tue, 24 Mar 2015 22:39:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OMdocv045823; Tue, 24 Mar 2015 22:39:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OMdoC9045822; Tue, 24 Mar 2015 22:39:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503242239.t2OMdoC9045822@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 24 Mar 2015 22:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280475 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 22:39:50 -0000 Author: ngie Date: Tue Mar 24 22:39:49 2015 New Revision: 280475 URL: https://svnweb.freebsd.org/changeset/base/280475 Log: The number of commands added when ddb(4) is enabled is 3, not 2 MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/witness.4 Modified: head/share/man/man4/witness.4 ============================================================================== --- head/share/man/man4/witness.4 Tue Mar 24 22:39:18 2015 (r280474) +++ head/share/man/man4/witness.4 Tue Mar 24 22:39:49 2015 (r280475) @@ -127,7 +127,7 @@ can be set via .Pp The .Nm -code also provides two extra +code also provides three extra .Xr ddb 4 commands if both .Nm From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 22:40:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0429184; Tue, 24 Mar 2015 22:40: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 CCF93337; Tue, 24 Mar 2015 22:40:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2OMeHLf046477; Tue, 24 Mar 2015 22:40:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2OMeHt0046476; Tue, 24 Mar 2015 22:40:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201503242240.t2OMeHt0046476@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 24 Mar 2015 22:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280476 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 22:40:18 -0000 Author: ngie Date: Tue Mar 24 22:40:16 2015 New Revision: 280476 URL: https://svnweb.freebsd.org/changeset/base/280476 Log: Bump .Dd Modified: head/share/man/man4/witness.4 Modified: head/share/man/man4/witness.4 ============================================================================== --- head/share/man/man4/witness.4 Tue Mar 24 22:39:49 2015 (r280475) +++ head/share/man/man4/witness.4 Tue Mar 24 22:40:16 2015 (r280476) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2015 +.Dd March 24, 2015 .Dt WITNESS 4 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 04:58:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9284C144 for ; Wed, 25 Mar 2015 04:58: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 58043122 for ; Wed, 25 Mar 2015 04:58:37 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t2P4wb9s037369 for ; Wed, 25 Mar 2015 04:58:37 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t2P4wblT037368 for svn-src-head@freebsd.org; Wed, 25 Mar 2015 04:58:37 GMT (envelope-from bdrewery) Received: (qmail 33390 invoked from network); 24 Mar 2015 23:58:35 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 24 Mar 2015 23:58:35 -0500 Message-ID: <5512407E.2040505@FreeBSD.org> Date: Tue, 24 Mar 2015 23:58:38 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.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: r279361 - in head: sys/kern sys/sys usr.sbin/jail References: <201502271628.t1RGSurE067472@svn.freebsd.org> In-Reply-To: <201502271628.t1RGSurE067472@svn.freebsd.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qE6JkqtRN8MjIF9cfEAN008M9AEr40GR2" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 04:58:37 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qE6JkqtRN8MjIF9cfEAN008M9AEr40GR2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/27/2015 10:28 AM, Ian Lepore wrote: > Author: ian > Date: Fri Feb 27 16:28:55 2015 > New Revision: 279361 > URL: https://svnweb.freebsd.org/changeset/base/279361 >=20 > Log: > Allow the kern.osrelease and kern.osreldate sysctl values to be set i= n a > jail's creation parameters. This allows the kernel version to be rel= iably For package building we very much need to be able to override hw.ncpu, hw.physmem and kern.smp.cpus. Too many ports spy on those rather than using the values we pass in the environment. Java ports have this issue. We set a ulimit on the jail and Java sees there is 96GB of RAM on the system and tries to allocate a very large portion of it and fails. Hence we cannot run package builds with any sort of memory limits. Ports disrespecting the MAKE_JOBS_NUMBER we assign to them will no longer be an issue if we can spoof hw.ncpu/kern.smp.cpus as well. Bonus points for allowing these to be changed on-demand. We may setup a jail and want to change how much memory or CPUs it is allowed depending on what is going to be built next. I had been planning to look at this eventually but if someone beats me to it that would be great! --=20 Regards, Bryan Drewery --qE6JkqtRN8MjIF9cfEAN008M9AEr40GR2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJVEkB+AAoJEDXXcbtuRpfPZLQH/3d2oxN3l6sTsg4hPAwlo+f4 IIf42iWq3t0LK2C/W2xAzDRuOxZP8VyX527njF3yxxkbJu1jHZSBnis7swKwscfl ch8FyT/XdFuVFn6VxXd3md5NH20V8XfbfCBA2ovIRgETML/uFkf6LkvSuy2A1Gsr xHij2u7rKTH0jgR2CuclMevjcXeBVf3RS/ax6q357GMpCIy0MOYuGcOYVQ/Q251M liKkYR2EmR0CWqZhiQVo48MSM090pZ9HsQwk+dYCD94iBwcy60RwSdKZ3a0aRk6a ud9dcKNwb/KLu0/juXcrxP3j2/e1zx3S8AaGL4y6ekfcmAOF8AEmps9kBkx6eDw= =wDDi -----END PGP SIGNATURE----- --qE6JkqtRN8MjIF9cfEAN008M9AEr40GR2-- From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 08:55:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 635C99EB; Wed, 25 Mar 2015 08:55: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 4E20DB88; Wed, 25 Mar 2015 08:55:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2P8tZth038468; Wed, 25 Mar 2015 08:55:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2P8tZFp038467; Wed, 25 Mar 2015 08:55:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503250855.t2P8tZFp038467@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 Mar 2015 08:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280495 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 08:55:35 -0000 Author: hselasky Date: Wed Mar 25 08:55:34 2015 New Revision: 280495 URL: https://svnweb.freebsd.org/changeset/base/280495 Log: Implement a simple OID number garbage collector. Given the increasing number of dynamically created and destroyed SYSCTLs during runtime it is very likely that the current new OID number limit of 0x7fffffff can be reached. Especially if dynamic OID creation and destruction results from automatic tests. Additional changes: - Optimize the typical use case by decrementing the next automatic OID sequence number instead of incrementing it. This saves searching time when inserting new OIDs into a fresh parent OID node. - Add simple check for duplicate non-automatic OID numbers. MFC after: 1 week Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Wed Mar 25 08:23:08 2015 (r280494) +++ head/sys/kern/kern_sysctl.c Wed Mar 25 08:55:34 2015 (r280495) @@ -296,6 +296,8 @@ sysctl_register_oid(struct sysctl_oid *o struct sysctl_oid_list *parent = oidp->oid_parent; struct sysctl_oid *p; struct sysctl_oid *q; + int oid_number; + int timeout = 2; /* * First check if another oid with the same name already @@ -312,37 +314,66 @@ sysctl_register_oid(struct sysctl_oid *o return; } } + /* get current OID number */ + oid_number = oidp->oid_number; + +#if (OID_AUTO >= 0) +#error "OID_AUTO is expected to be a negative value" +#endif /* - * If this oid has a number OID_AUTO, give it a number which - * is greater than any current oid. + * Any negative OID number qualifies as OID_AUTO. Valid OID + * numbers should always be positive. + * * NOTE: DO NOT change the starting value here, change it in * , and make sure it is at least 256 to * accomodate e.g. net.inet.raw as a static sysctl node. */ - if (oidp->oid_number == OID_AUTO) { - static int newoid = CTL_AUTO_START; + if (oid_number < 0) { + static int newoid; + + /* + * By decrementing the next OID number we spend less + * time inserting the OIDs into a sorted list. + */ + if (--newoid < CTL_AUTO_START) + newoid = 0x7fffffff; - oidp->oid_number = newoid++; - if (newoid == 0x7fffffff) - panic("out of oids"); - } -#if 0 - else if (oidp->oid_number >= CTL_AUTO_START) { - /* do not panic; this happens when unregistering sysctl sets */ - printf("static sysctl oid too high: %d", oidp->oid_number); + oid_number = newoid; } -#endif /* - * Insert the oid into the parent's list in order. + * Insert the OID into the parent's list sorted by OID number. */ +retry: q = NULL; SLIST_FOREACH(p, parent, oid_link) { - if (oidp->oid_number < p->oid_number) + /* check if the current OID number is in use */ + if (oid_number == p->oid_number) { + /* get the next valid OID number */ + if (oid_number < CTL_AUTO_START || + oid_number == 0x7fffffff) { + /* wraparound - restart */ + oid_number = CTL_AUTO_START; + /* don't loop forever */ + if (!timeout--) + panic("sysctl: Out of OID numbers\n"); + goto retry; + } else { + oid_number++; + } + } else if (oid_number < p->oid_number) break; q = p; } - if (q) + /* check for non-auto OID number collision */ + if (oidp->oid_number >= 0 && oidp->oid_number < CTL_AUTO_START && + oid_number >= CTL_AUTO_START) { + printf("sysctl: OID number(%d) is already in use for '%s'\n", + oidp->oid_number, oidp->oid_name); + } + /* update the OID number, if any */ + oidp->oid_number = oid_number; + if (q != NULL) SLIST_INSERT_AFTER(q, oidp, oid_link); else SLIST_INSERT_HEAD(parent, oidp, oid_link); From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 10:26:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 046FE802; Wed, 25 Mar 2015 10: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 E2C757FB; Wed, 25 Mar 2015 10:26:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAQ89a083483; Wed, 25 Mar 2015 10:26:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAQ7OZ083478; Wed, 25 Mar 2015 10:26:07 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503251026.t2PAQ7OZ083478@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 25 Mar 2015 10:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280520 - in head/sys: boot/fdt/dts/arm modules/dtb/rpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 10:26:09 -0000 Author: andrew Date: Wed Mar 25 10:26:07 2015 New Revision: 280520 URL: https://svnweb.freebsd.org/changeset/base/280520 Log: Add the Raspberry Pi 2 dtb, based on the existing rpi.dts, but with a different base address for the devces. MFC after: 1 week Added: head/sys/boot/fdt/dts/arm/bcm2836.dtsi - copied, changed from r280125, head/sys/boot/fdt/dts/arm/bcm2835.dtsi head/sys/boot/fdt/dts/arm/rpi2.dts - copied, changed from r280125, head/sys/boot/fdt/dts/arm/rpi.dts Modified: head/sys/modules/dtb/rpi/Makefile Copied and modified: head/sys/boot/fdt/dts/arm/bcm2836.dtsi (from r280125, head/sys/boot/fdt/dts/arm/bcm2835.dtsi) ============================================================================== --- head/sys/boot/fdt/dts/arm/bcm2835.dtsi Sun Mar 15 21:57:44 2015 (r280125, copy source) +++ head/sys/boot/fdt/dts/arm/bcm2836.dtsi Wed Mar 25 10:26:07 2015 (r280520) @@ -29,19 +29,19 @@ #address-cells = <1>; #size-cells = <1>; - cpus { - cpu@0 { - compatible = "arm,1176jzf-s"; - }; + timer { + compatible = "arm,armv7-timer"; + clock-frequency = <19200000>; + interrupts = <72 73 75 74>; + interrupt-parent = <&intc>; }; - SOC: axi { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; - reg = <0x20000000 0x01000000>; - ranges = <0 0x20000000 0x01000000>; + reg = <0x3f000000 0x01000000>; + ranges = <0 0x3f000000 0x01000000>; intc: interrupt-controller { compatible = "broadcom,bcm2835-armctrl-ic", @@ -101,30 +101,6 @@ */ }; - timer { - compatible = "broadcom,bcm2835-system-timer", - "broadcom,bcm2708-system-timer"; - reg = <0x3000 0x1000>; - interrupts = <8 9 10 11>; - interrupt-parent = <&intc>; - - clock-frequency = <1000000>; - }; - - armtimer { - /* Not AMBA compatible */ - compatible = "broadcom,bcm2835-sp804", "arm,sp804"; - reg = <0xB400 0x24>; - interrupts = <0>; - interrupt-parent = <&intc>; - }; - - watchdog0 { - compatible = "broadcom,bcm2835-wdt", - "broadcom,bcm2708-wdt"; - reg = <0x10001c 0x0c>; /* 0x1c, 0x20, 0x24 */ - }; - gpio: gpio { compatible = "broadcom,bcm2835-gpio", "broadcom,bcm2708-gpio"; @@ -397,8 +373,6 @@ }; bsc0 { - #address-cells = <1>; - #size-cells = <0>; compatible = "broadcom,bcm2835-bsc", "broadcom,bcm2708-bsc"; reg = <0x205000 0x20>; @@ -407,8 +381,6 @@ }; bsc1 { - #address-cells = <1>; - #size-cells = <0>; compatible = "broadcom,bcm2835-bsc", "broadcom,bcm2708-bsc"; reg = <0x804000 0x20>; @@ -459,7 +431,7 @@ interrupts = <70>; interrupt-parent = <&intc>; - clock-frequency = <50000000>; /* Set by VideoCore */ + clock-frequency = <2500000000>; /* Set by VideoCore */ }; uart0: uart0 { Copied and modified: head/sys/boot/fdt/dts/arm/rpi2.dts (from r280125, head/sys/boot/fdt/dts/arm/rpi.dts) ============================================================================== --- head/sys/boot/fdt/dts/arm/rpi.dts Sun Mar 15 21:57:44 2015 (r280125, copy source) +++ head/sys/boot/fdt/dts/arm/rpi2.dts Wed Mar 25 10:26:07 2015 (r280520) @@ -26,12 +26,11 @@ */ /dts-v1/; -/include/ "bcm2835.dtsi" +/include/ "bcm2836.dtsi" / { - model = "Raspberry Pi (BCM2835)"; - compatible = "raspberrypi,model-a", "raspberrypi,model-b", - "broadcom,bcm2835-vc", "broadcom,bcm2708-vc"; + model = "Raspberry Pi 2 Model B"; + compatible = "brcm,bcm2709"; memreserve = <0x08000000 0x08000000>; /* Set by VideoCore */ @@ -39,10 +38,10 @@ #address-cells = <1>; #size-cells = <0>; cpu@0 { - compatible = "arm,1176jzf-s"; + compatible = "arm,cortex-a7"; device_type = "cpu"; - reg = <0>; /* CPU ID=0 */ - clock-frequency = <700000000>; /* 700MHz */ + reg = <0xf00>; /* CPU ID=0xf00 */ + clock-frequency = <800000000>; /* 800MHz */ }; }; @@ -307,8 +306,6 @@ }; }; - - }; display { Modified: head/sys/modules/dtb/rpi/Makefile ============================================================================== --- head/sys/modules/dtb/rpi/Makefile Wed Mar 25 10:25:45 2015 (r280519) +++ head/sys/modules/dtb/rpi/Makefile Wed Mar 25 10:26:07 2015 (r280520) @@ -1,5 +1,5 @@ # $FreeBSD$ # DTS files for the Raspberry Pi-B -DTS=rpi.dts +DTS=rpi.dts rpi2.dts .include From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 10:54:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDB1C2C2; Wed, 25 Mar 2015 10:54:12 +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 557A4C25; Wed, 25 Mar 2015 10:54:11 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2PAs9pc009423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 25 Mar 2015 13:54:09 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2PAs9ee009422; Wed, 25 Mar 2015 13:54:09 +0300 (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 Mar 2015 13:54:09 +0300 From: Gleb Smirnoff To: Hans Petter Selasky Subject: Re: svn commit: r280495 - head/sys/kern Message-ID: <20150325105409.GS64665@FreeBSD.org> References: <201503250855.t2P8tZFp038467@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503250855.t2P8tZFp038467@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-1 Precedence: list List-Id: SVN 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 Mar 2015 10:54:12 -0000 On Wed, Mar 25, 2015 at 08:55:35AM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Wed Mar 25 08:55:34 2015 H> New Revision: 280495 H> URL: https://svnweb.freebsd.org/changeset/base/280495 H> H> Log: H> Implement a simple OID number garbage collector. Given the increasing H> number of dynamically created and destroyed SYSCTLs during runtime it H> is very likely that the current new OID number limit of 0x7fffffff can H> be reached. Especially if dynamic OID creation and destruction results H> from automatic tests. Additional changes: H> H> - Optimize the typical use case by decrementing the next automatic OID H> sequence number instead of incrementing it. This saves searching time H> when inserting new OIDs into a fresh parent OID node. H> H> - Add simple check for duplicate non-automatic OID numbers. Why didn't you use alloc_unr(9) for that? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 10:59:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFDD0D06; Wed, 25 Mar 2015 10: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 A5922C9C; Wed, 25 Mar 2015 10:59:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAxk1t000701; Wed, 25 Mar 2015 10:59:46 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAxhdm000685; Wed, 25 Mar 2015 10:59:43 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503251059.t2PAxhdm000685@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 25 Mar 2015 10:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280558 - in head/sys/arm: broadcom/bcm2835 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-1 Precedence: list List-Id: SVN 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 Mar 2015 10:59:46 -0000 Author: andrew Date: Wed Mar 25 10:59:42 2015 New Revision: 280558 URL: https://svnweb.freebsd.org/changeset/base/280558 Log: Add support for the Raspberry Pi 2. As the chip is based on the bcm2835 in the Raspberry Pi B we support most of the devices are already supported, however the base address has changed. A few items are not working, or missing. The main ones are: * DMA doesn't work in the sdhci driver. * Enabling vchiq halts the boot, may be interrupt related. * There is no U-Boot port yet so the DTB is embedded in the kernel. The last point will make it difficult to boot FreeBSD, however there is support for the Raspberry Pi 2 in the U-Boot git repo. As I have not tested this it is left as an open task to create a port to build. X-MFC: When the above issues are fixed Sponsored by: ABT Systems Ltd Added: head/sys/arm/broadcom/bcm2835/bcm2836.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2836.h (contents, props changed) head/sys/arm/broadcom/bcm2835/files.bcm2836 (contents, props changed) head/sys/arm/broadcom/bcm2835/std.bcm2836 (contents, props changed) head/sys/arm/conf/RPI2 - copied, changed from r280125, head/sys/arm/conf/RPI-B Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Wed Mar 25 10:59:24 2015 (r280557) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Wed Mar 25 10:59:42 2015 (r280558) @@ -45,6 +45,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef SOC_BCM2836 +#include +#endif + #define INTC_PENDING_BASIC 0x00 #define INTC_PENDING_BANK1 0x04 #define INTC_PENDING_BANK2 0x08 @@ -61,10 +65,12 @@ __FBSDID("$FreeBSD$"); #define BANK2_START (BANK1_START + 32) #define BANK2_END (BANK2_START + 32 - 1) #define BANK3_START (BANK2_START + 32) +#define BANK3_END (BANK3_START + 32 - 1) #define IS_IRQ_BASIC(n) (((n) >= 0) && ((n) < BANK1_START)) #define IS_IRQ_BANK1(n) (((n) >= BANK1_START) && ((n) <= BANK1_END)) #define IS_IRQ_BANK2(n) (((n) >= BANK2_START) && ((n) <= BANK2_END)) +#define ID_IRQ_BCM2836(n) (((n) >= BANK3_START) && ((n) <= BANK3_END)) #define IRQ_BANK1(n) ((n) - BANK1_START) #define IRQ_BANK2(n) ((n) - BANK2_START) @@ -148,11 +154,19 @@ arm_get_next_irq(int last_irq) struct bcm_intc_softc *sc = bcm_intc_sc; uint32_t pending; int32_t irq = last_irq + 1; +#ifdef SOC_BCM2836 + int ret; +#endif /* Sanity check */ if (irq < 0) irq = 0; +#ifdef SOC_BCM2836 + if ((ret = bcm2836_get_next_irq(irq)) >= 0) + return (ret + BANK3_START); +#endif + /* TODO: should we mask last_irq? */ if (irq < BANK1_START) { pending = intc_read_4(sc, INTC_PENDING_BASIC); @@ -197,6 +211,10 @@ arm_mask_irq(uintptr_t nb) intc_write_4(sc, INTC_DISABLE_BANK1, (1 << IRQ_BANK1(nb))); else if (IS_IRQ_BANK2(nb)) intc_write_4(sc, INTC_DISABLE_BANK2, (1 << IRQ_BANK2(nb))); +#ifdef SOC_BCM2836 + else if (ID_IRQ_BCM2836(nb)) + bcm2836_mask_irq(nb - BANK3_START); +#endif else printf("arm_mask_irq: Invalid IRQ number: %d\n", nb); } @@ -213,6 +231,10 @@ arm_unmask_irq(uintptr_t nb) intc_write_4(sc, INTC_ENABLE_BANK1, (1 << IRQ_BANK1(nb))); else if (IS_IRQ_BANK2(nb)) intc_write_4(sc, INTC_ENABLE_BANK2, (1 << IRQ_BANK2(nb))); +#ifdef SOC_BCM2836 + else if (ID_IRQ_BCM2836(nb)) + bcm2836_unmask_irq(nb - BANK3_START); +#endif else printf("arm_mask_irq: Invalid IRQ number: %d\n", nb); } Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Wed Mar 25 10:59:24 2015 (r280557) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Wed Mar 25 10:59:42 2015 (r280558) @@ -88,6 +88,7 @@ bcm2835_late_init(platform_t plat) } } +#ifdef SOC_BCM2835 /* * Set up static device mappings. * All on-chip peripherals exist in a 16MB range starting at 0x20000000. @@ -100,6 +101,17 @@ bcm2835_devmap_init(platform_t plat) arm_devmap_add_entry(0x20000000, 0x01000000); return (0); } +#endif + +#ifdef SOC_BCM2836 +static int +bcm2836_devmap_init(platform_t plat) +{ + + arm_devmap_add_entry(0x3f000000, 0x01000000); + return (0); +} +#endif struct arm32_dma_range * bus_dma_get_range(void) @@ -121,6 +133,8 @@ cpu_reset() bcmwd_watchdog_reset(); while (1); } + +#ifdef SOC_BCM2835 static platform_method_t bcm2835_methods[] = { PLATFORMMETHOD(platform_devmap_init, bcm2835_devmap_init), PLATFORMMETHOD(platform_lastaddr, bcm2835_lastaddr), @@ -128,6 +142,16 @@ static platform_method_t bcm2835_methods PLATFORMMETHOD_END, }; - FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, "raspberrypi,model-b"); +#endif + +#ifdef SOC_BCM2836 +static platform_method_t bcm2836_methods[] = { + PLATFORMMETHOD(platform_devmap_init, bcm2836_devmap_init), + PLATFORMMETHOD(platform_lastaddr, bcm2835_lastaddr), + PLATFORMMETHOD(platform_late_init, bcm2835_late_init), + PLATFORMMETHOD_END, +}; +FDT_PLATFORM_DEF(bcm2836, "bcm2836", 0, "brcm,bcm2709"); +#endif Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Wed Mar 25 10:59:24 2015 (r280557) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Wed Mar 25 10:59:42 2015 (r280558) @@ -68,8 +68,16 @@ __FBSDID("$FreeBSD$"); #define dprintf(fmt, args...) #endif +/* DMA doesn't yet work with the bcm3826 */ +#ifdef SOC_BCM2836 +#define PIO_MODE 1 +#else +#define PIO_MODE 0 +#error +#endif + static int bcm2835_sdhci_hs = 1; -static int bcm2835_sdhci_pio_mode = 0; +static int bcm2835_sdhci_pio_mode = PIO_MODE; TUNABLE_INT("hw.bcm2835.sdhci.hs", &bcm2835_sdhci_hs); TUNABLE_INT("hw.bcm2835.sdhci.pio_mode", &bcm2835_sdhci_pio_mode); Added: head/sys/arm/broadcom/bcm2835/bcm2836.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2836.c Wed Mar 25 10:59:42 2015 (r280558) @@ -0,0 +1,184 @@ +/* + * Copyright 2015 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 +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#define ARM_LOCAL_BASE 0x40000000 +#define ARM_LOCAL_SIZE 0x00001000 + +#define ARM_LOCAL_CONTROL 0x00 +#define ARM_LOCAL_PRESCALER 0x08 +#define PRESCALER_19_2 0x80000000 /* 19.2 MHz */ +#define ARM_LOCAL_INT_TIMER(n) (0x40 + (n) * 4) +#define ARM_LOCAL_INT_MAILBOX(n) (0x50 + (n) * 4) +#define ARM_LOCAL_INT_PENDING(n) (0x60 + (n) * 4) +#define INT_PENDING_MASK 0x0f + +/* + * A driver for features of the bcm2836. + */ + +struct bcm2836_softc { + device_t sc_dev; + struct resource *sc_mem; +}; + +static device_identify_t bcm2836_identify; +static device_probe_t bcm2836_probe; +static device_attach_t bcm2836_attach; + +struct bcm2836_softc *softc; + +static void +bcm2836_identify(driver_t *driver, device_t parent) +{ + + if (BUS_ADD_CHILD(parent, 0, "bcm2836", -1) == NULL) + device_printf(parent, "add child failed\n"); +} + +static int +bcm2836_probe(device_t dev) +{ + + if (softc != NULL) + return (ENXIO); + + device_set_desc(dev, "Broadcom bcm2836"); + + return (BUS_PROBE_DEFAULT); +} + +static int +bcm2836_attach(device_t dev) +{ + int i, rid; + + softc = device_get_softc(dev); + softc->sc_dev = dev; + + rid = 0; + softc->sc_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, + ARM_LOCAL_BASE, ARM_LOCAL_BASE + ARM_LOCAL_SIZE, ARM_LOCAL_SIZE, + RF_ACTIVE); + if (softc->sc_mem == NULL) { + device_printf(dev, "could not allocate memory resource\n"); + return (ENXIO); + } + + bus_write_4(softc->sc_mem, ARM_LOCAL_CONTROL, 0); + bus_write_4(softc->sc_mem, ARM_LOCAL_PRESCALER, PRESCALER_19_2); + + for (i = 0; i < 4; i++) + bus_write_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i), 0); + + for (i = 0; i < 4; i++) + bus_write_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(i), 1); + + return (0); +} + +int +bcm2836_get_next_irq(int last_irq) +{ + uint32_t reg; + int cpu; + int irq; + + cpu = PCPU_GET(cpuid); + + reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_PENDING(cpu)); + reg &= INT_PENDING_MASK; + if (reg == 0) + return (-1); + + irq = ffs(reg) - 1; + + return (irq); +} + +void +bcm2836_mask_irq(uintptr_t irq) +{ + uint32_t reg; + int i; + + for (i = 0; i < 4; i++) { + reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i)); + reg &= ~(1 << irq); + bus_write_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i), reg); + } +} + +void +bcm2836_unmask_irq(uintptr_t irq) +{ + uint32_t reg; + int i; + + for (i = 0; i < 4; i++) { + reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i)); + reg |= (1 << irq); + bus_write_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i), reg); + } +} + +static device_method_t bcm2836_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, bcm2836_identify), + DEVMETHOD(device_probe, bcm2836_probe), + DEVMETHOD(device_attach, bcm2836_attach), + + DEVMETHOD_END +}; + +static devclass_t bcm2836_devclass; + +static driver_t bcm2836_driver = { + "bcm2836", + bcm2836_methods, + sizeof(struct bcm2836_softc), +}; + +EARLY_DRIVER_MODULE(bcm2836, nexus, bcm2836_driver, bcm2836_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); Added: head/sys/arm/broadcom/bcm2835/bcm2836.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2836.h Wed Mar 25 10:59:42 2015 (r280558) @@ -0,0 +1,37 @@ +/* + * Copyright 2015 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 _BCM2815_BCM2836_H +#define _BCM2815_BCM2836_H + +int bcm2836_get_next_irq(int); +void bcm2836_mask_irq(uintptr_t); +void bcm2836_unmask_irq(uintptr_t); + +#endif Added: head/sys/arm/broadcom/bcm2835/files.bcm2836 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/files.bcm2836 Wed Mar 25 10:59:42 2015 (r280558) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +arm/arm/cpufunc_asm_armv7.S standard +arm/arm/generic_timer.c standard + +arm/broadcom/bcm2835/bcm2836.c standard Added: head/sys/arm/broadcom/bcm2835/std.bcm2836 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/std.bcm2836 Wed Mar 25 10:59:42 2015 (r280558) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +machine arm armv6 +cpu CPU_CORTEXA +makeoptions CONF_CFLAGS="-march=armv7a" +options SOC_BCM2836 + +files "../broadcom/bcm2835/files.bcm2836" +files "../broadcom/bcm2835/files.bcm283x" + Copied and modified: head/sys/arm/conf/RPI2 (from r280125, head/sys/arm/conf/RPI-B) ============================================================================== --- head/sys/arm/conf/RPI-B Sun Mar 15 21:57:44 2015 (r280125, copy source) +++ head/sys/arm/conf/RPI2 Wed Mar 25 10:59:42 2015 (r280558) @@ -21,6 +21,7 @@ ident RPI-B include "../broadcom/bcm2835/std.rpi" +include "../broadcom/bcm2835/std.bcm2836" options HZ=100 options SCHED_4BSD # 4BSD scheduler @@ -80,7 +81,7 @@ options INVARIANT_SUPPORT # Extra sanit #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=ue0 -#options ROOTDEVNAME=\"ufs:mmcsd0s2\" +options ROOTDEVNAME=\"ufs:mmcsd0s2\" device bpf device loop @@ -129,13 +130,13 @@ device smsc device spibus device bcm2835_spi -device vchiq -device sound +#device vchiq +#device sound # Flattened Device Tree options FDT # Configure using FDT/DTB data # Note: DTB is normally loaded and modified by RPi boot loader, then # handed to kernel via U-Boot and ubldr. -#options FDT_DTB_STATIC -#makeoptions FDT_DTS_FILE=rpi.dts +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=rpi2.dts makeoptions MODULES_EXTRA=dtb/rpi From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 11:06:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4B22567; Wed, 25 Mar 2015 11:06:09 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.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 A2569D91; Wed, 25 Mar 2015 11:06:08 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B3C3E1FE022; Wed, 25 Mar 2015 12:05:59 +0100 (CET) Message-ID: <551296C6.9070402@selasky.org> Date: Wed, 25 Mar 2015 12:06:46 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r280495 - head/sys/kern References: <201503250855.t2P8tZFp038467@svn.freebsd.org> <20150325105409.GS64665@FreeBSD.org> In-Reply-To: <20150325105409.GS64665@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; 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-1 Precedence: list List-Id: SVN 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 Mar 2015 11:06:10 -0000 On 03/25/15 11:54, Gleb Smirnoff wrote: > On Wed, Mar 25, 2015 at 08:55:35AM +0000, Hans Petter Selasky wrote: > H> Author: hselasky > H> Date: Wed Mar 25 08:55:34 2015 > H> New Revision: 280495 > H> URL: https://svnweb.freebsd.org/changeset/base/280495 > H> > H> Log: > H> Implement a simple OID number garbage collector. Given the increasing > H> number of dynamically created and destroyed SYSCTLs during runtime it > H> is very likely that the current new OID number limit of 0x7fffffff can > H> be reached. Especially if dynamic OID creation and destruction results > H> from automatic tests. Additional changes: > H> > H> - Optimize the typical use case by decrementing the next automatic OID > H> sequence number instead of incrementing it. This saves searching time > H> when inserting new OIDs into a fresh parent OID node. > H> > H> - Add simple check for duplicate non-automatic OID numbers. > > Why didn't you use alloc_unr(9) for that? > Hi Gleb, I thought about using alloc_unr(). The problem is that sysctls have no clear concept of freeing. For example in some existing code sysctl are unregistered and registered again assuming that the oid_number will be preserved. I didn't want touch those parts. Also, hence we are already traversing a list to insert an SYSCTL object in an ordered fashion, the benefit of alloc_unr() is not that big. What do you think? --HPS From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 11:14:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E4291A6; Wed, 25 Mar 2015 11:14:36 +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 0AD34EBD; Wed, 25 Mar 2015 11:14:35 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2PBEX0s009703 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 25 Mar 2015 14:14:33 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2PBEXl0009702; Wed, 25 Mar 2015 14:14:33 +0300 (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 Mar 2015 14:14:33 +0300 From: Gleb Smirnoff To: Hans Petter Selasky Subject: Re: svn commit: r280495 - head/sys/kern Message-ID: <20150325111433.GT64665@FreeBSD.org> References: <201503250855.t2P8tZFp038467@svn.freebsd.org> <20150325105409.GS64665@FreeBSD.org> <551296C6.9070402@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <551296C6.9070402@selasky.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-1 Precedence: list List-Id: SVN 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 Mar 2015 11:14:36 -0000 On Wed, Mar 25, 2015 at 12:06:46PM +0100, Hans Petter Selasky wrote: H> On 03/25/15 11:54, Gleb Smirnoff wrote: H> > On Wed, Mar 25, 2015 at 08:55:35AM +0000, Hans Petter Selasky wrote: H> > H> Author: hselasky H> > H> Date: Wed Mar 25 08:55:34 2015 H> > H> New Revision: 280495 H> > H> URL: https://svnweb.freebsd.org/changeset/base/280495 H> > H> H> > H> Log: H> > H> Implement a simple OID number garbage collector. Given the increasing H> > H> number of dynamically created and destroyed SYSCTLs during runtime it H> > H> is very likely that the current new OID number limit of 0x7fffffff can H> > H> be reached. Especially if dynamic OID creation and destruction results H> > H> from automatic tests. Additional changes: H> > H> H> > H> - Optimize the typical use case by decrementing the next automatic OID H> > H> sequence number instead of incrementing it. This saves searching time H> > H> when inserting new OIDs into a fresh parent OID node. H> > H> H> > H> - Add simple check for duplicate non-automatic OID numbers. H> > H> > Why didn't you use alloc_unr(9) for that? H> > H> H> Hi Gleb, H> H> I thought about using alloc_unr(). The problem is that sysctls have no H> clear concept of freeing. For example in some existing code sysctl are H> unregistered and registered again assuming that the oid_number will be H> preserved. I didn't want touch those parts. Also, hence we are already H> traversing a list to insert an SYSCTL object in an ordered fashion, the H> benefit of alloc_unr() is not that big. What do you think? Is it possible to split the space into two halves: one for static OIDs and other for dynamic ones? The latter allocated via alloc_unr? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 11:27:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4702546F; Wed, 25 Mar 2015 11:27:06 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::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 06D49FF2; Wed, 25 Mar 2015 11:27:06 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 8CCEA1FE022; Wed, 25 Mar 2015 12:27:02 +0100 (CET) Message-ID: <55129BB5.4000502@selasky.org> Date: Wed, 25 Mar 2015 12:27:49 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r280495 - head/sys/kern References: <201503250855.t2P8tZFp038467@svn.freebsd.org> <20150325105409.GS64665@FreeBSD.org> <551296C6.9070402@selasky.org> <20150325111433.GT64665@FreeBSD.org> In-Reply-To: <20150325111433.GT64665@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; 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-1 Precedence: list List-Id: SVN 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 Mar 2015 11:27:06 -0000 On 03/25/15 12:14, Gleb Smirnoff wrote: > On Wed, Mar 25, 2015 at 12:06:46PM +0100, Hans Petter Selasky wrote: > H> On 03/25/15 11:54, Gleb Smirnoff wrote: > H> > On Wed, Mar 25, 2015 at 08:55:35AM +0000, Hans Petter Selasky wrote: > H> > H> Author: hselasky > H> > H> Date: Wed Mar 25 08:55:34 2015 > H> > H> New Revision: 280495 > H> > H> URL: https://svnweb.freebsd.org/changeset/base/280495 > H> > H> > H> > H> Log: > H> > H> Implement a simple OID number garbage collector. Given the increasing > H> > H> number of dynamically created and destroyed SYSCTLs during runtime it > H> > H> is very likely that the current new OID number limit of 0x7fffffff can > H> > H> be reached. Especially if dynamic OID creation and destruction results > H> > H> from automatic tests. Additional changes: > H> > H> > H> > H> - Optimize the typical use case by decrementing the next automatic OID > H> > H> sequence number instead of incrementing it. This saves searching time > H> > H> when inserting new OIDs into a fresh parent OID node. > H> > H> > H> > H> - Add simple check for duplicate non-automatic OID numbers. > H> > > H> > Why didn't you use alloc_unr(9) for that? > H> > > H> > H> Hi Gleb, > H> > H> I thought about using alloc_unr(). The problem is that sysctls have no > H> clear concept of freeing. For example in some existing code sysctl are > H> unregistered and registered again assuming that the oid_number will be > H> preserved. I didn't want touch those parts. Also, hence we are already > H> traversing a list to insert an SYSCTL object in an ordered fashion, the > H> benefit of alloc_unr() is not that big. What do you think? > > Is it possible to split the space into two halves: one for static OIDs and > other for dynamic ones? The latter allocated via alloc_unr? > Yes, it is possible to do. One issue though is that the OID numbers shouldn't be recycled right away to preserve the old behaviour. It is not written anywhere, but I think there is some cleverness into the fact that the newoid value does not repeat instantly, as would happen using alloc_unr() to avoid races accessing OIDs from userspace? Does alloc_unr() support a sort of rotating allocation number mode within the defined range? The OID numbers are only required to be unique per directory level from what I can see. --HPS From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 11:53:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C0F4A61; Wed, 25 Mar 2015 11: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 066AA39C; Wed, 25 Mar 2015 11:53:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PBrq7R029647; Wed, 25 Mar 2015 11:53:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PBrqs6029646; Wed, 25 Mar 2015 11:53:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503251153.t2PBrqs6029646@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 25 Mar 2015 11:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280571 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 11:53:53 -0000 Author: andrew Date: Wed Mar 25 11:53:52 2015 New Revision: 280571 URL: https://svnweb.freebsd.org/changeset/base/280571 Log: Remove a debug #error from the bcm2835 sdhci driver. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Wed Mar 25 11:14:17 2015 (r280570) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Wed Mar 25 11:53:52 2015 (r280571) @@ -73,7 +73,6 @@ __FBSDID("$FreeBSD$"); #define PIO_MODE 1 #else #define PIO_MODE 0 -#error #endif static int bcm2835_sdhci_hs = 1; From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 12:14:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4BAFF44; Wed, 25 Mar 2015 12: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 A4DEC7E2; Wed, 25 Mar 2015 12:14:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PCEZfH039131; Wed, 25 Mar 2015 12:14:35 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PCEZoT039130; Wed, 25 Mar 2015 12:14:35 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201503251214.t2PCEZoT039130@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Wed, 25 Mar 2015 12:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280572 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 12:14:35 -0000 Author: brueffer Date: Wed Mar 25 12:14:34 2015 New Revision: 280572 URL: https://svnweb.freebsd.org/changeset/base/280572 Log: mdoc cleanup; fix spelling. Modified: head/share/man/man4/ixlv.4 Modified: head/share/man/man4/ixlv.4 ============================================================================== --- head/share/man/man4/ixlv.4 Wed Mar 25 11:53:52 2015 (r280571) +++ head/share/man/man4/ixlv.4 Wed Mar 25 12:14:34 2015 (r280572) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2015 +.Dd March 25, 2015 .Dt IXLV 4 .Os .Sh NAME @@ -77,13 +77,13 @@ and/or TSO6, and finally LRO can be set For more information on configuring this device, see .Xr ifconfig 8 . .Pp -NOTE that The +.Em NOTE : +The .Nm Driver is only used by means of SRIOV, normally in a VM on a hosting server with the .Xr ixl 4 driver. -.Pp .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 @@ -92,10 +92,10 @@ prompt before booting the kernel or stor .Bl -tag -width indent .It Va hw.ixlv.ringsz Set the number of descriptors in the rings, note that this -changes BOTH the TX and RX rings, they cannot be set independly. +changes BOTH the TX and RX rings, they cannot be set independently. .It Va hw.ixlv.max_queues Set the number of queues (each a TX/RX pair) for the port, this -allows one to override the autocalculation if its set to 0. +allows one to override the autocalculation if it is set to 0. .It Va hw.ixlv.txbrsz Set the size of the buff ring used by the transmit side of the stack, we have found that it is necessary to have it quite large @@ -109,7 +109,6 @@ The RX interrupt rate value, set to 8K b .It Va hw.ixlv.tx_itr The TX interrupt rate value, set to 4K by default. .El -.Pp .Sh SUPPORT For general information and support, go to the Intel support website at: @@ -119,8 +118,8 @@ If an issue is identified with this driv email all the specific information related to the issue to .Aq freebsd@intel.com . .Sh SEE ALSO -.Xr ixl 4 , .Xr arp 4 , +.Xr ixl 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr vlan 4 , From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 12:45:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E450E93B; Wed, 25 Mar 2015 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 CDD49BAD; Wed, 25 Mar 2015 12:45:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PCjUmL053540; Wed, 25 Mar 2015 12:45:30 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PCjUJp053539; Wed, 25 Mar 2015 12:45:30 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201503251245.t2PCjUJp053539@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Wed, 25 Mar 2015 12:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280573 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 12:45:31 -0000 Author: brueffer Date: Wed Mar 25 12:45:29 2015 New Revision: 280573 URL: https://svnweb.freebsd.org/changeset/base/280573 Log: Fix a typo and EOL whitespace missed in the previous commit. Modified: head/share/man/man4/ixlv.4 Modified: head/share/man/man4/ixlv.4 ============================================================================== --- head/share/man/man4/ixlv.4 Wed Mar 25 12:14:34 2015 (r280572) +++ head/share/man/man4/ixlv.4 Wed Mar 25 12:45:29 2015 (r280573) @@ -78,12 +78,12 @@ For more information on configuring this .Xr ifconfig 8 . .Pp .Em NOTE : -The +The .Nm -Driver is only used by means of SRIOV, normally in a VM on a +driver is only used by means of SRIOV, normally in a VM on a hosting server with the .Xr ixl 4 -driver. +driver. .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 12:46:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3F42A82; Wed, 25 Mar 2015 12:46: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 A33F0BBA; Wed, 25 Mar 2015 12:46:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PCkKJ3053693; Wed, 25 Mar 2015 12:46:20 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PCkKSi053692; Wed, 25 Mar 2015 12:46:20 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201503251246.t2PCkKSi053692@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Wed, 25 Mar 2015 12:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280574 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 12:46:21 -0000 Author: brueffer Date: Wed Mar 25 12:46:19 2015 New Revision: 280574 URL: https://svnweb.freebsd.org/changeset/base/280574 Log: mdoc cleanup; fix spelling; Xref ixlv.4 Modified: head/share/man/man4/ixl.4 Modified: head/share/man/man4/ixl.4 ============================================================================== --- head/share/man/man4/ixl.4 Wed Mar 25 12:45:29 2015 (r280573) +++ head/share/man/man4/ixl.4 Wed Mar 25 12:46:19 2015 (r280574) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2015 +.Dd March 25, 2015 .Dt IXL 4 .Os .Sh NAME @@ -113,8 +113,6 @@ Intel DUAL RATE 1G/10G SFP+ LR (bailed) Note that X710/XL710 Based SFP+ adapters also support all passive and active limiting direct attach cables that comply with SFF-8431 v4.1 and SFF-8472 v10.4 specifications. - -.Pp .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 @@ -125,10 +123,10 @@ prompt before booting the kernel or stor Allows one to enable/disable MSIX, thus forcing MSI instead. .It Va hw.ixl.ringsz Set the number of descriptors in the rings, note that this -changes BOTH the TX and RX rings, they cannot be set independly. +changes BOTH the TX and RX rings, they cannot be set independently. .It Va hw.ixl.max_queues Set the number of queues (each a TX/RX pair) for the port, this -allows one to override the autocalculation if its set to 0. +allows one to override the autocalculation if it is set to 0. .It Va hw.ixl.dynamic_rx_itr The dynamic RX interrupt control, set to 1 to enable. .It Va hw.ixl.dynamic_tx_itr @@ -138,27 +136,31 @@ The RX interrupt rate value, set to 8K b .It Va hw.ixl.tx_itr The TX interrupt rate value, set to 4K by default. .El -.Pp .Sh SYSCTL PROCEDURES .Bl -tag -width indent .It Va hw.ixl.fc -Allows one to set the flow control value. A value of 0 disables +Allows one to set the flow control value. +A value of 0 disables flow control, 3 enables full, 1 is RX, and 2 is TX pause. .It Va hw.ixl.advertise_speed Allows one to set advertised link speeds, this will then -cause a link renegotiation. With the appropriate adapter -this can cause a link at 10GB, 1GB, or 100MB. +cause a link renegotiation. +With the appropriate adapter +this can cause a link at 10GB, 1GB, or 100MB. .It Va hw.ixl.current_speed This is a display of the current setting. .It Va hw.ixl.fw_version This is a display of the Firmware version. +.El .Sh Interrupt Storms -It is important to note that 40G operation can generate high +It is important to note that 40G operation can generate high numbers of interrupts, often incorrectly being interpreted as -a storm condition in the kernel. It is suggested that this +a storm condition in the kernel. +It is suggested that this be resolved by setting: .Bl -tag -width indent .It Va hw.intr_storm_threshold: 0 +.El .Sh SUPPORT For general information and support, go to the Intel support website at: @@ -169,6 +171,7 @@ email all the specific information relat .Aq freebsd@intel.com . .Sh SEE ALSO .Xr arp 4 , +.Xr ixlv 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr vlan 4 , From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 12:54:09 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E9E6DF0; Wed, 25 Mar 2015 12:54:09 +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 88E6D1E84; Wed, 25 Mar 2015 12:54:07 +0000 (UTC) Message-ID: <5512AF84.2000303@FreeBSD.org> Date: Wed, 25 Mar 2015 15:52:20 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.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: r280444 - head/sys/netinet6 References: <201503241645.t2OGjpoe066993@svn.freebsd.org> In-Reply-To: <201503241645.t2OGjpoe066993@svn.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CtJKSKfvohiJQdDcQ85QaBo5wCO2g2DR5" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 12:54:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CtJKSKfvohiJQdDcQ85QaBo5wCO2g2DR5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 24.03.2015 19:45, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Mar 24 16:45:50 2015 > New Revision: 280444 > URL: https://svnweb.freebsd.org/changeset/base/280444 >=20 > Log: > Move ip6_sprintf() declaration from in6_var.h to in6.h. This is a sim= ple > function that works with in6_addr and it is not related to the INET6 > stack implementation. Hi, maybe it will be better just remove ip6_sprintf() and use inet_ntop() instead? --=20 WBR, Andrey V. Elsukov --CtJKSKfvohiJQdDcQ85QaBo5wCO2g2DR5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVEq+IAAoJEAHF6gQQyKF6pGAIAL+DvI5jz79zFmjPHocqYNGN 7f7ToSlQqxGJJgaT0FGBaZL3JcUUB+hpdWBRTU7lcjSulfMUGboEZ9IbgriaXUjy TNTyyfVfcMJxsLtjD8Y5BAN8+euryE3QpQZGvN0SPRQCFRON5uzFTSzPD0bzOgwA Wxeok0ftPqTp44T5vkipCaCMzcDQQXR2N02qzWS23wE8JpjbWKycKmquMXLfjm4L LzGws5VQDHp15diUdm3LfMKQmAu/nae+RqeBz0pGDSNQ4FBsrfh72w8453mZfeS4 /u3SWakzOnQb1lxm3dqKJE/cersyTIBqCVWaQQ46pXXOa8QZDnWO1GBLPx3N9YA= =K1ZZ -----END PGP SIGNATURE----- --CtJKSKfvohiJQdDcQ85QaBo5wCO2g2DR5-- From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 13:28:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26155931; Wed, 25 Mar 2015 13: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 0F83419B; Wed, 25 Mar 2015 13:28:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDSESk075861; Wed, 25 Mar 2015 13:28:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDSEOk075860; Wed, 25 Mar 2015 13:28:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503251328.t2PDSEOk075860@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 Mar 2015 13:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280597 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 13:28:15 -0000 Author: hselasky Date: Wed Mar 25 13:28:13 2015 New Revision: 280597 URL: https://svnweb.freebsd.org/changeset/base/280597 Log: Add DA_Q_NO_RC16 quirk for USB mass storage device. PR: 198647 MFC after: 1 week Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Mar 25 13:18:51 2015 (r280596) +++ head/sys/cam/scsi/scsi_da.c Wed Mar 25 13:28:13 2015 (r280597) @@ -1182,6 +1182,13 @@ static struct da_quirk_entry da_quirk_ta { T_DIRECT, SIP_MEDIA_REMOVABLE, "Innostor", "Innostor*", "*" }, /*quirks*/DA_Q_NO_RC16 }, + { + /* + * MX-ES USB Drive by Mach Xtreme + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "MX", "MXUB3SES*", "*"}, + /*quirks*/DA_Q_NO_RC16 + }, }; static disk_strategy_t dastrategy; From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 13:32:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE52DBBA; Wed, 25 Mar 2015 13: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 C74292B5; Wed, 25 Mar 2015 13:32:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PDWSRL080227; Wed, 25 Mar 2015 13:32:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PDWSS0080226; Wed, 25 Mar 2015 13:32:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503251332.t2PDWSS0080226@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 Mar 2015 13:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280598 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 13:32:29 -0000 Author: hselasky Date: Wed Mar 25 13:32:27 2015 New Revision: 280598 URL: https://svnweb.freebsd.org/changeset/base/280598 Log: Add definition of the ISOCHRONOUS endpoint usage bits. Refer to the USB v2.0 specification for more information. MFC after: 1 week Modified: head/sys/dev/usb/usb.h Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Wed Mar 25 13:28:13 2015 (r280597) +++ head/sys/dev/usb/usb.h Wed Mar 25 13:32:27 2015 (r280598) @@ -542,6 +542,11 @@ struct usb_endpoint_descriptor { #define UE_ISO_ADAPT 0x08 #define UE_ISO_SYNC 0x0c #define UE_GET_ISO_TYPE(a) ((a) & UE_ISO_TYPE) +#define UE_ISO_USAGE 0x30 +#define UE_ISO_USAGE_DATA 0x00 +#define UE_ISO_USAGE_FEEDBACK 0x10 +#define UE_ISO_USAGE_IMPLICT_FB 0x20 +#define UE_GET_ISO_USAGE(a) ((a) & UE_ISO_USAGE) uWord wMaxPacketSize; #define UE_ZERO_MPS 0xFFFF /* for internal use only */ uByte bInterval; From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 15:51:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A013B4C3; Wed, 25 Mar 2015 15: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 8A98F995; Wed, 25 Mar 2015 15:51:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PFpgH6048560; Wed, 25 Mar 2015 15:51:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PFpg9n048556; Wed, 25 Mar 2015 15:51:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503251551.t2PFpg9n048556@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 25 Mar 2015 15:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280621 - in head/sys: i386/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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:51:42 -0000 Author: jhb Date: Wed Mar 25 15:51:41 2015 New Revision: 280621 URL: https://svnweb.freebsd.org/changeset/base/280621 Log: Apply r276208 to non-amd64 NOTES files as well to fix tinderbox builds run under a system using vt(4) instead of syscons(4): Use compiled in default keymaps which are available both in syscons and vt. Modified: head/sys/i386/conf/NOTES head/sys/sparc64/conf/NOTES Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Wed Mar 25 14:36:17 2015 (r280620) +++ head/sys/i386/conf/NOTES Wed Mar 25 15:51:41 2015 (r280621) @@ -433,7 +433,7 @@ hint.atkbd.0.irq="1" # Options for atkbd: options ATKBD_DFLT_KEYMAP # specify the built-in keymap -makeoptions ATKBD_DFLT_KEYMAP=jp.106 +makeoptions ATKBD_DFLT_KEYMAP=fr.dvorak # `flags' for atkbd: # 0x01 Force detection of keyboard, else we always assume a keyboard Modified: head/sys/sparc64/conf/NOTES ============================================================================== --- head/sys/sparc64/conf/NOTES Wed Mar 25 14:36:17 2015 (r280620) +++ head/sys/sparc64/conf/NOTES Wed Mar 25 15:51:41 2015 (r280621) @@ -67,7 +67,7 @@ device atkbd # Options for atkbd: options ATKBD_DFLT_KEYMAP # specify the built-in keymap -makeoptions ATKBD_DFLT_KEYMAP=jp.106 +makeoptions ATKBD_DFLT_KEYMAP=fr.dvorak # `flags' for atkbd: # 0x01 Force detection of keyboard, else we always assume a keyboard @@ -84,7 +84,7 @@ options SUNKBD_EMULATE_ATKBD # allows t # in share/syscons/keymaps, required # for SUNKBD_DFLT_KEYMAP and kbdmux options SUNKBD_DFLT_KEYMAP # specify the built-in keymap -makeoptions SUNKBD_DFLT_KEYMAP=jp.106 +makeoptions SUNKBD_DFLT_KEYMAP=fr.dvorak ##################################################################### From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 15:57:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F33D934; Wed, 25 Mar 2015 15:57:56 +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 B924AA92; Wed, 25 Mar 2015 15:57:54 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2PFvp0q011710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 25 Mar 2015 18:57:51 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2PFvpBp011709; Wed, 25 Mar 2015 18:57:51 +0300 (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 Mar 2015 18:57:51 +0300 From: Gleb Smirnoff To: "Andrey V. Elsukov" Subject: Re: svn commit: r280444 - head/sys/netinet6 Message-ID: <20150325155751.GE64665@FreeBSD.org> References: <201503241645.t2OGjpoe066993@svn.freebsd.org> <5512AF84.2000303@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5512AF84.2000303@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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:57:56 -0000 On Wed, Mar 25, 2015 at 03:52:20PM +0300, Andrey V. Elsukov wrote: A> On 24.03.2015 19:45, Gleb Smirnoff wrote: A> > Author: glebius A> > Date: Tue Mar 24 16:45:50 2015 A> > New Revision: 280444 A> > URL: https://svnweb.freebsd.org/changeset/base/280444 A> > A> > Log: A> > Move ip6_sprintf() declaration from in6_var.h to in6.h. This is a simple A> > function that works with in6_addr and it is not related to the INET6 A> > stack implementation. A> A> maybe it will be better just remove ip6_sprintf() and use inet_ntop() A> instead? That's up to you, guys. My aim was to remove yet another user of if_var.h -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 16:01:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39A05BC0; Wed, 25 Mar 2015 16:01: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 241EBBB3; Wed, 25 Mar 2015 16:01:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PG1lm4055576; Wed, 25 Mar 2015 16:01:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PG1kde055575; Wed, 25 Mar 2015 16:01:46 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201503251601.t2PG1kde055575@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 25 Mar 2015 16:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280622 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:01:47 -0000 Author: glebius Date: Wed Mar 25 16:01:46 2015 New Revision: 280622 URL: https://svnweb.freebsd.org/changeset/base/280622 Log: Fix couple of fallouts from r280280. The first one is a simple typo, where counter was incremented on parent, instead of vlan(4) interface. The second is more complicated. Historically, in our stack the incoming packets are accounted in drivers, while incoming bytes for Ethernet drivers are accounted in ether_input_internal(). Thus, it should be removed from vlan(4) driver. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Wed Mar 25 15:51:41 2015 (r280621) +++ head/sys/net/if_vlan.c Wed Mar 25 16:01:46 2015 (r280622) @@ -1163,8 +1163,7 @@ vlan_input(struct ifnet *ifp, struct mbu TRUNK_RUNLOCK(trunk); m->m_pkthdr.rcvif = ifv->ifv_ifp; - if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); + if_inc_counter(ifv->ifv_ifp, IFCOUNTER_IPACKETS, 1); /* Pass it back through the parent's input routine. */ (*ifp->if_input)(ifv->ifv_ifp, m); From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 16:54:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5408299; Wed, 25 Mar 2015 16:54: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 3ED701FC; Wed, 25 Mar 2015 16:54:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PGscIb080066; Wed, 25 Mar 2015 16:54:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PGscPg080065; Wed, 25 Mar 2015 16:54:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503251654.t2PGscPg080065@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 25 Mar 2015 16:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280626 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:54:39 -0000 Author: pfg Date: Wed Mar 25 16:54:37 2015 New Revision: 280626 URL: https://svnweb.freebsd.org/changeset/base/280626 Log: Clean sparse spaces. Modified: head/include/stdlib.h Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Wed Mar 25 16:40:08 2015 (r280625) +++ head/include/stdlib.h Wed Mar 25 16:54:37 2015 (r280626) @@ -277,9 +277,9 @@ int cgetustr(char *, const char *, char int daemon(int, int); char *devname(__dev_t, __mode_t); -char *devname_r(__dev_t, __mode_t, char *, int); +char *devname_r(__dev_t, __mode_t, char *, int); char *fdevname(int); -char *fdevname_r(int, char *, int); +char *fdevname_r(int, char *, int); int getloadavg(double [], int); const char * getprogname(void); From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 18:02:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1461C7B9; Wed, 25 Mar 2015 18: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 F35B5C30; Wed, 25 Mar 2015 18:02:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PI277f014101; Wed, 25 Mar 2015 18:02:07 GMT (envelope-from culot@FreeBSD.org) Received: (from culot@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PI27lL014100; Wed, 25 Mar 2015 18:02:07 GMT (envelope-from culot@FreeBSD.org) Message-Id: <201503251802.t2PI27lL014100@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: culot set sender to culot@FreeBSD.org using -f From: Frederic Culot Date: Wed, 25 Mar 2015 18:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280629 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 18:02:08 -0000 Author: culot (ports committer) Date: Wed Mar 25 18:02:06 2015 New Revision: 280629 URL: https://svnweb.freebsd.org/changeset/base/280629 Log: Update the portmgr members list Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Wed Mar 25 17:58:44 2015 (r280628) +++ head/share/misc/organization.dot Wed Mar 25 18:02:06 2015 (r280629) @@ -30,7 +30,7 @@ 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\nantoine, bapt, bdrewery,\ndecke, erwin, mat, swills"] +portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bapt, bdrewery,\nerwin, mat, swills"] 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"] From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 18:56:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B55672B7; Wed, 25 Mar 2015 18: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 9FEA71C8; Wed, 25 Mar 2015 18:56:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PIucxP038710; Wed, 25 Mar 2015 18:56:38 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PIuaMv038702; Wed, 25 Mar 2015 18:56:36 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201503251856.t2PIuaMv038702@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 25 Mar 2015 18:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280630 - in head: lib/libfetch sys/sys usr.bin/fetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 18:56:38 -0000 Author: jkim Date: Wed Mar 25 18:56:36 2015 New Revision: 280630 URL: https://svnweb.freebsd.org/changeset/base/280630 Log: Remove defunct SSLv2 support from fetch(1) and fetch(3). Modified: head/lib/libfetch/common.c head/lib/libfetch/fetch.3 head/sys/sys/param.h head/usr.bin/fetch/fetch.1 head/usr.bin/fetch/fetch.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Wed Mar 25 18:02:06 2015 (r280629) +++ head/lib/libfetch/common.c Wed Mar 25 18:56:36 2015 (r280630) @@ -672,9 +672,7 @@ fetch_ssl_setup_transport_layer(SSL_CTX { long ssl_ctx_options; - ssl_ctx_options = SSL_OP_ALL | SSL_OP_NO_TICKET; - if (getenv("SSL_ALLOW_SSL2") == NULL) - ssl_ctx_options |= SSL_OP_NO_SSLv2; + ssl_ctx_options = SSL_OP_ALL | SSL_OP_NO_SSLv2 | SSL_OP_NO_TICKET; if (getenv("SSL_ALLOW_SSL3") == NULL) ssl_ctx_options |= SSL_OP_NO_SSLv3; if (getenv("SSL_NO_TLS1") != NULL) Modified: head/lib/libfetch/fetch.3 ============================================================================== --- head/lib/libfetch/fetch.3 Wed Mar 25 18:02:06 2015 (r280629) +++ head/lib/libfetch/fetch.3 Wed Mar 25 18:56:36 2015 (r280630) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 15, 2014 +.Dd March 25, 2015 .Dt FETCH 3 .Os .Sh NAME @@ -441,10 +441,8 @@ By default allows TLSv1 and newer when negotiating the connecting with the remote peer. You can change this behavior by setting the -.Ev SSL_ALLOW_SSL2 -and .Ev SSL_ALLOW_SSL3 -environment variables to allow SSLv2 and SSLv3, respectively, and +environment variable to allow SSLv3 and .Ev SSL_NO_TLS1 , .Ev SSL_NO_TLS1_1 and .Ev SSL_NO_TLS1_2 @@ -646,8 +644,6 @@ which proxies should not be used. Same as .Ev NO_PROXY , for compatibility. -.It Ev SSL_ALLOW_SSL2 -Allow SSL version 2 when negotiating the connection (not recommended). .It Ev SSL_ALLOW_SSL3 Allow SSL version 3 when negotiating the connection (not recommended). .It Ev SSL_CA_CERT_FILE Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Mar 25 18:02:06 2015 (r280629) +++ head/sys/sys/param.h Wed Mar 25 18:56:36 2015 (r280630) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100066 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100067 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/usr.bin/fetch/fetch.1 ============================================================================== --- head/usr.bin/fetch/fetch.1 Wed Mar 25 18:02:06 2015 (r280629) +++ head/usr.bin/fetch/fetch.1 Wed Mar 25 18:56:36 2015 (r280630) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 28, 2014 +.Dd March 25, 2015 .Dt FETCH 1 .Os .Sh NAME @@ -39,7 +39,6 @@ .Sh SYNOPSIS .Nm .Op Fl 146AadFlMmnPpqRrsUv -.Op Fl -allow-sslv2 .Op Fl B Ar bytes .Op Fl -bind-address= Ns Ar host .Op Fl -ca-cert= Ns Ar file @@ -113,9 +112,6 @@ Some broken Web sites will return a redi error when the requested object does not exist. .It Fl a , -retry Automatically retry the transfer upon soft failures. -.It Fl -allow-sslv2 -[SSL] -Allow SSL version 2 when negotiating the connection. .It Fl B Ar bytes , Fl -buffer-size= Ns Ar bytes Specify the read buffer size in bytes. The default is 16,384 bytes. @@ -350,7 +346,6 @@ for a description of additional environm .Ev NETRC , .Ev NO_PROXY , .Ev no_proxy , -.Ev SSL_ALLOW_SSL2 , .Ev SSL_CA_CERT_FILE , .Ev SSL_CA_CERT_PATH , .Ev SSL_CLIENT_CERT_FILE , Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Wed Mar 25 18:02:06 2015 (r280629) +++ head/usr.bin/fetch/fetch.c Wed Mar 25 18:56:36 2015 (r280630) @@ -102,7 +102,6 @@ enum options OPTION_HTTP_REFERER, OPTION_HTTP_USER_AGENT, OPTION_NO_PROXY, - OPTION_SSL_ALLOW_SSL2, OPTION_SSL_CA_CERT_FILE, OPTION_SSL_CA_CERT_PATH, OPTION_SSL_CLIENT_CERT_FILE, @@ -154,7 +153,6 @@ static struct option longopts[] = { "referer", required_argument, NULL, OPTION_HTTP_REFERER }, { "user-agent", required_argument, NULL, OPTION_HTTP_USER_AGENT }, { "no-proxy", required_argument, NULL, OPTION_NO_PROXY }, - { "allow-sslv2", no_argument, NULL, OPTION_SSL_ALLOW_SSL2 }, { "ca-cert", required_argument, NULL, OPTION_SSL_CA_CERT_FILE }, { "ca-path", required_argument, NULL, OPTION_SSL_CA_CERT_PATH }, { "cert", required_argument, NULL, OPTION_SSL_CLIENT_CERT_FILE }, @@ -845,17 +843,17 @@ static void usage(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: fetch [-146AadFlMmnPpqRrsUv] [--allow-sslv2] [-B bytes]", -" [--bind-address=host] [--ca-cert=file] [--ca-path=dir] [--cert=file]", -" [--crl=file] [-i file] [--key=file] [-N file] [--no-passive]", -" [--no-proxy=list] [--no-sslv3] [--no-tlsv1] [--no-verify-hostname]", -" [--no-verify-peer] [-o file] [--referer=URL] [-S bytes] [-T seconds]", +"usage: fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [--bind-address=host]", +" [--ca-cert=file] [--ca-path=dir] [--cert=file] [--crl=file]", +" [-i file] [--key=file] [-N file] [--no-passive] [--no-proxy=list]", +" [--no-sslv3] [--no-tlsv1] [--no-verify-hostname] [--no-verify-peer]", +" [-o file] [--referer=URL] [-S bytes] [-T seconds]", " [--user-agent=agent-string] [-w seconds] URL ...", -" fetch [-146AadFlMmnPpqRrsUv] [--allow-sslv2] [-B bytes]", -" [--bind-address=host] [--ca-cert=file] [--ca-path=dir] [--cert=file]", -" [--crl=file] [-i file] [--key=file] [-N file] [--no-passive]", -" [--no-proxy=list] [--no-sslv3] [--no-tlsv1] [--no-verify-hostname]", -" [--no-verify-peer] [-o file] [--referer=URL] [-S bytes] [-T seconds]", +" fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [--bind-address=host]", +" [--ca-cert=file] [--ca-path=dir] [--cert=file] [--crl=file]", +" [-i file] [--key=file] [-N file] [--no-passive] [--no-proxy=list]", +" [--no-sslv3] [--no-tlsv1] [--no-verify-hostname] [--no-verify-peer]", +" [-o file] [--referer=URL] [-S bytes] [-T seconds]", " [--user-agent=agent-string] [-w seconds] -h host -f file [-c dir]"); } @@ -1004,9 +1002,6 @@ main(int argc, char *argv[]) case OPTION_NO_PROXY: setenv("NO_PROXY", optarg, 1); break; - case OPTION_SSL_ALLOW_SSL2: - setenv("SSL_ALLOW_SSL2", "", 1); - break; case OPTION_SSL_CA_CERT_FILE: setenv("SSL_CA_CERT_FILE", optarg, 1); break; From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 20:15:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1282C83E; Wed, 25 Mar 2015 20:15:30 +0000 (UTC) Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9322DC83; Wed, 25 Mar 2015 20:15:29 +0000 (UTC) Received: by wgdm6 with SMTP id m6so40900024wgd.2; Wed, 25 Mar 2015 13:15:28 -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=BgOwk2XQY3iZ6GEFotLMdYbmEgWMsELIC9uBuXvAIkg=; b=0Kb3ehhreeR+90EhBia1weGXi4BS+9iOwku8wW41J+Q90cMVcUOROsDngJrjFxMdmq eLvEXON0X8tOQ2t6kASbdPSVmhUoeM29D2wsHJfax71IpHR45lY/OIR/4Q77Y7cSsmC5 pk+wWEleedRQRoFm+0q2nO0W1u5StkydBg7IFIWGly9T6glv2s/AD9lGGLP11kluSVl/ C2i4CzXevVpg8TGWij/8Y0OugdvhRWgAIIP6m2xcBu3R9VCea3zRveBFzLeJuDsKHeIU iGZdhNYbNIq7iQwY1hA+/jCAZ7u6HMcN76UAXF3GInSYEj8mSp+b/8G5yV92Q3SYt8HC 9Qgw== X-Received: by 10.180.221.232 with SMTP id qh8mr40505608wic.19.1427314527993; Wed, 25 Mar 2015 13:15:27 -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 j9sm5212461wjy.18.2015.03.25.13.15.26 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 25 Mar 2015 13:15:27 -0700 (PDT) Date: Wed, 25 Mar 2015 21:15:24 +0100 From: Mateusz Guzik To: Bruce Evans Subject: Re: svn commit: r280407 - head/sys/kern Message-ID: <20150325201524.GB14280@dft-labs.eu> References: <201503240010.t2O0ACZb089906@svn.freebsd.org> <20150324135350.N1665@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150324135350.N1665@besplex.bde.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-1 Precedence: list List-Id: SVN 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 Mar 2015 20:15:30 -0000 On Tue, Mar 24, 2015 at 03:58:14PM +1100, Bruce Evans wrote: > On Tue, 24 Mar 2015, Mateusz Guzik wrote: > > >Log: > > filedesc: microoptimize fget_unlocked by getting rid of fd < 0 branch > > This has no effect. Compilers optimize to the equivalent of the the > unsigned cast hack if this is good. On x86, it is good since no > instructions are needed for the conversion, and the only difference > between the code generated by > > if (fd >= fdt->fdt_nfiles) > > and > > if (fd < 0 || fd >= fdt->fdt_nfiles) > > is to change from jl (jump if less than) to jb (jump if below) (both > jumps over the if clause). Negative values satisfy jl but not jb. > I would not commit the change if it did not affect generated assembly at least on amd64. if (fd < 0 || fd >= fdt->fdt_nfiles): 0xffffffff807d147d : sub $0x38,%rsp 0xffffffff807d1481 : test %esi,%esi 0xffffffff807d1483 : js 0xffffffff807d15b8 0xffffffff807d1489 : mov (%rdi),%rbx 0xffffffff807d148c : cmp %esi,(%rbx) 0xffffffff807d148e : jle 0xffffffff807d15bf if ((u_int)fd >= fdt->fdt_nfiles): 0xffffffff807d147d : sub $0x38,%rsp 0xffffffff807d1481 : mov (%rdi),%rbx 0xffffffff807d1484 : cmp %esi,(%rbx) 0xffffffff807d1486 : jbe 0xffffffff807d15a8 I did not check other archs prior to the commit. This is clang 3.6 as present in head. Sources compiled with -O2. Also see below for other compiler test. > > Casting fd to an unsigned type simplifies fd range coparison to mere checking > > if the result is bigger than the table. > > No, it obfuscates the range comparison. > It is a standard hack which is hard to misread and which seems to add a slight benefit (see below). > On some arches, conversion to unsigned is slow. Then compilers should > optimize in the opposite direction by first undoing the bogus cast to > get back to the range check and then optimizing the range check using > the best strategy. Compilers should probably first undo the bogus > cast even on x86, so as to reduce to the range check case. Range checks > are more important and more uniform than bogus casts, so they are more > likely to be optimized. Similarly if fd has type u_int to begin with. It affects assembly on all arm, powerpc64 and mips64 as well. Both arm and powerpc just get rid of zero-test and use the same instructions to perform the other comparison. I only found a difference on mips64 which used sltu instead of slt (but still got rid of the zero-check). Granted I don't know mips instruction costs and I don't have the real hadrware to benchark on. Seems like a win for most architectures anyway. > > >Modified: head/sys/kern/kern_descrip.c > >============================================================================== > >--- head/sys/kern/kern_descrip.c Tue Mar 24 00:01:30 2015 (r280406) > >+++ head/sys/kern/kern_descrip.c Tue Mar 24 00:10:11 2015 (r280407) > >@@ -2342,7 +2342,7 @@ fget_unlocked(struct filedesc *fdp, int > >#endif > > > > fdt = fdp->fd_files; > >- if (fd < 0 || fd >= fdt->fdt_nfiles) > >+ if ((u_int)fd >= fdt->fdt_nfiles) > > return (EBADF); > > /* > > * Fetch the descriptor locklessly. We avoid fdrop() races by > [..] > - fget_locked() seems to be unchanged recently, so it doesn't have the > obfuscation. fget_unlocked() is newer than the unobfuscated version > of fget_locked(). It is in a different file, but may have copied the > unobfuscated range check from fget_locked(). This commit restores the > obfuscation to it alone. > This definitely should be synced one way or the other, thanks for pointing this out. > There are now some other range checks in kern_desc.c that are missing > the obfuscation: grepping for "fd <" gives: > - a magic treatment for negative fd's in closefrom() Well I'll start with a short note that I don't know what's up with uap->lowfd = 0; instead of retuning with EINVAL. Anyay, the cast there would not have any use. > - the range check in an unobfuscated by confusing form in fdisused(). > The check has to be inverted since it is in a KASSERT(), and the > inversion is done by reversing the inequalities. Correct, this likely should also be synced (one way or the other). > - similarly in fdalloc(). > Same. > I used to use this hack a lot 30 years ago, but stopped when compilers > got better 20-25 years ago. > I wrote a toy program and checked e.g. gcc5 and it still did not optimise zero-test away. In fact I would argue the optimisation in question is impossible unless upper limit check is against a constant in (0, INT_MAX) range or against a var whose range is known at compile time. In particular this is problematic for negative values. Consider: int fd, limit; ............ if (fd < 0 || fd >= limit) Let's have fd = -5 and limit = -4. Should the fd < 0 check be dropped by the compiler and the expression turned into (u_int)fd >= limit, the coparison would be false thus changing the outcome. As such, I prefer to keep the cast. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 20:57:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1B19100; Wed, 25 Mar 2015 20:57: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 AD95DF0; Wed, 25 Mar 2015 20:57:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PKv9Rn096919; Wed, 25 Mar 2015 20:57:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PKv9G2096918; Wed, 25 Mar 2015 20:57:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503252057.t2PKv9G2096918@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 25 Mar 2015 20:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280631 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 20:57:09 -0000 Author: emaste Date: Wed Mar 25 20:57:08 2015 New Revision: 280631 URL: https://svnweb.freebsd.org/changeset/base/280631 Log: Force MK_INCLUDES for the legacy stage As legacy executes "make installincludes" we don't want it to be disabled by a src.conf setting. Reviewed by: imp MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2143 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Mar 25 18:56:36 2015 (r280630) +++ head/Makefile.inc1 Wed Mar 25 20:57:08 2015 (r280631) @@ -259,7 +259,8 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ - MK_LLDB=no MK_TESTS=no + MK_LLDB=no MK_TESTS=no \ + MK_INCLUDES=yes # build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 21:41:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99CE6D81; Wed, 25 Mar 2015 21:41: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 85224836; Wed, 25 Mar 2015 21:41:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PLfLcg019047; Wed, 25 Mar 2015 21:41:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PLfLNn019046; Wed, 25 Mar 2015 21:41:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503252141.t2PLfLNn019046@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 25 Mar 2015 21:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280634 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:41:21 -0000 Author: tuexen Date: Wed Mar 25 21:41:20 2015 New Revision: 280634 URL: https://svnweb.freebsd.org/changeset/base/280634 Log: Use the reference count of the right SCTP inp. Joint work with rrs@ MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Mar 25 21:31:36 2015 (r280633) +++ head/sys/netinet/sctp_usrreq.c Wed Mar 25 21:41:20 2015 (r280634) @@ -6953,7 +6953,7 @@ sctp_listen(struct socket *so, int backl SCTP_INP_DECR_REF(tinp); return (EADDRINUSE); } else if (tinp) { - SCTP_INP_DECR_REF(inp); + SCTP_INP_DECR_REF(tinp); } } } From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 21:53:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5685F9; Wed, 25 Mar 2015 21: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 97C9F94C; Wed, 25 Mar 2015 21:53:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PLrIV8025857; Wed, 25 Mar 2015 21:53:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PLrInc025854; Wed, 25 Mar 2015 21:53:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503252153.t2PLrInc025854@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 25 Mar 2015 21:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280636 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:53:18 -0000 Author: pfg Date: Wed Mar 25 21:53:17 2015 New Revision: 280636 URL: https://svnweb.freebsd.org/changeset/base/280636 Log: Temporarily revert 280458. GCC is still carries an old version of cdefs.h which doesn't accept multiple parameters for the nonnull attribute. Since this issue probably affects many ports in the tree we will revert it for now until gcc gets fixed. Modified: head/include/pthread.h head/include/signal.h Modified: head/include/pthread.h ============================================================================== --- head/include/pthread.h Wed Mar 25 21:53:16 2015 (r280635) +++ head/include/pthread.h Wed Mar 25 21:53:17 2015 (r280636) @@ -144,23 +144,19 @@ struct _pthread_cleanup_info { */ __BEGIN_DECLS int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); -int pthread_attr_destroy(pthread_attr_t *) __nonnull(1); +int pthread_attr_destroy(pthread_attr_t *); int pthread_attr_getstack(const pthread_attr_t * __restrict, - void ** __restrict, size_t * __restrict) - __nonnull(1, 2, 3); -int pthread_attr_getstacksize(const pthread_attr_t *, size_t *) - __nonnull(1, 2); + void ** __restrict, size_t * __restrict); +int pthread_attr_getstacksize(const pthread_attr_t *, size_t *); int pthread_attr_getguardsize(const pthread_attr_t *, size_t *); int pthread_attr_getstackaddr(const pthread_attr_t *, void **); -int pthread_attr_getdetachstate(const pthread_attr_t *, int *) - __nonnull(1, 2); -int pthread_attr_init(pthread_attr_t *) __nonnull(1); -int pthread_attr_setstacksize(pthread_attr_t *, size_t) __nonnull(1); -int pthread_attr_setguardsize(pthread_attr_t *, size_t) __nonnull(1); -int pthread_attr_setstack(pthread_attr_t *, void *, size_t) - __nonnull(1); +int pthread_attr_getdetachstate(const pthread_attr_t *, int *); +int pthread_attr_init(pthread_attr_t *); +int pthread_attr_setstacksize(pthread_attr_t *, size_t); +int pthread_attr_setguardsize(pthread_attr_t *, size_t); +int pthread_attr_setstack(pthread_attr_t *, void *, size_t); int pthread_attr_setstackaddr(pthread_attr_t *, void *); -int pthread_attr_setdetachstate(pthread_attr_t *, int) __nonnull(1); +int pthread_attr_setdetachstate(pthread_attr_t *, int); int pthread_barrier_destroy(pthread_barrier_t *); int pthread_barrier_init(pthread_barrier_t *, const pthread_barrierattr_t *, unsigned); @@ -168,7 +164,7 @@ int pthread_barrier_wait(pthread_barrie int pthread_barrierattr_destroy(pthread_barrierattr_t *); int pthread_barrierattr_getpshared(const pthread_barrierattr_t *, int *); -int pthread_barrierattr_init(pthread_barrierattr_t *) __nonnull(1); +int pthread_barrierattr_init(pthread_barrierattr_t *); int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); #define pthread_cleanup_push(cleanup_routine, cleanup_arg) \ @@ -184,96 +180,85 @@ int pthread_barrierattr_setpshared(pthr __pthread_cleanup_pop_imp(execute); \ } -int pthread_condattr_destroy(pthread_condattr_t *) __nonnull(1); +int pthread_condattr_destroy(pthread_condattr_t *); int pthread_condattr_getclock(const pthread_condattr_t *, - clockid_t *) __nonnull(1, 2); -int pthread_condattr_getpshared(const pthread_condattr_t *, int *) - __nonnull(1, 2); -int pthread_condattr_init(pthread_condattr_t *) __nonnull(1); -int pthread_condattr_setclock(pthread_condattr_t *, clockid_t) - __nonnull(1); -int pthread_condattr_setpshared(pthread_condattr_t *, int) - __nonnull(1); -int pthread_cond_broadcast(pthread_cond_t *) - __nonnull(1); -int pthread_cond_destroy(pthread_cond_t *) - __nonnull(1); + clockid_t *); +int pthread_condattr_getpshared(const pthread_condattr_t *, int *); +int pthread_condattr_init(pthread_condattr_t *); +int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); +int pthread_condattr_setpshared(pthread_condattr_t *, int); +int pthread_cond_broadcast(pthread_cond_t *); +int pthread_cond_destroy(pthread_cond_t *); int pthread_cond_init(pthread_cond_t *, - const pthread_condattr_t *) __nonnull(1); -int pthread_cond_signal(pthread_cond_t *) __nonnull(1); + const pthread_condattr_t *); +int pthread_cond_signal(pthread_cond_t *); int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *__mutex, const struct timespec *) - __nonnull(1, 2, 3) __requires_exclusive(*__mutex); + __requires_exclusive(*__mutex); int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *__mutex) - __nonnull(1, 2) __requires_exclusive(*__mutex); + __requires_exclusive(*__mutex); int pthread_create(pthread_t *, const pthread_attr_t *, - void *(*) (void *), void *) __nonnull(1, 3); + void *(*) (void *), void *); int pthread_detach(pthread_t); int pthread_equal(pthread_t, pthread_t); void pthread_exit(void *) __dead2; void *pthread_getspecific(pthread_key_t); -int pthread_getcpuclockid(pthread_t, clockid_t *) __nonnull(2); +int pthread_getcpuclockid(pthread_t, clockid_t *); int pthread_join(pthread_t, void **); int pthread_key_create(pthread_key_t *, - void (*) (void *)) __nonnull(1); + void (*) (void *)); int pthread_key_delete(pthread_key_t); -int pthread_mutexattr_init(pthread_mutexattr_t *) __nonnull(1); -int pthread_mutexattr_destroy(pthread_mutexattr_t *) __nonnull(1); +int pthread_mutexattr_init(pthread_mutexattr_t *); +int pthread_mutexattr_destroy(pthread_mutexattr_t *); int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, - int *) __nonnull(1, 2); -int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *) - __nonnull(1, 2); -int pthread_mutexattr_settype(pthread_mutexattr_t *, int) - __nonnull(1); -int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int) - __nonnull(1); + int *); +int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); +int pthread_mutexattr_settype(pthread_mutexattr_t *, int); +int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); int pthread_mutex_destroy(pthread_mutex_t *__mutex) - __nonnull(1) __requires_unlocked(*__mutex); + __requires_unlocked(*__mutex); int pthread_mutex_init(pthread_mutex_t *__mutex, const pthread_mutexattr_t *) - __nonnull(1) __requires_unlocked(*__mutex); + __requires_unlocked(*__mutex); int pthread_mutex_lock(pthread_mutex_t *__mutex) - __nonnull(1) __locks_exclusive(*__mutex); + __locks_exclusive(*__mutex); int pthread_mutex_trylock(pthread_mutex_t *__mutex) - __nonnull(1) __trylocks_exclusive(0, *__mutex); + __trylocks_exclusive(0, *__mutex); int pthread_mutex_timedlock(pthread_mutex_t *__mutex, const struct timespec *) - __nonnull(1, 2) __trylocks_exclusive(0, *__mutex); + __trylocks_exclusive(0, *__mutex); int pthread_mutex_unlock(pthread_mutex_t *__mutex) - __nonnull(1) __unlocks(*__mutex); -int pthread_once(pthread_once_t *, void (*) (void)) __nonnull(1, 2); + __unlocks(*__mutex); +int pthread_once(pthread_once_t *, void (*) (void)); int pthread_rwlock_destroy(pthread_rwlock_t *__rwlock) - __nonnull(1) __requires_unlocked(*__rwlock); + __requires_unlocked(*__rwlock); int pthread_rwlock_init(pthread_rwlock_t *__rwlock, const pthread_rwlockattr_t *) - __nonnull(1) __requires_unlocked(*__rwlock); + __requires_unlocked(*__rwlock); int pthread_rwlock_rdlock(pthread_rwlock_t *__rwlock) - __nonnull(1) __locks_shared(*__rwlock); + __locks_shared(*__rwlock); int pthread_rwlock_timedrdlock(pthread_rwlock_t *__rwlock, const struct timespec *) - __nonnull(1, 2) __trylocks_shared(0, *__rwlock); + __trylocks_shared(0, *__rwlock); int pthread_rwlock_timedwrlock(pthread_rwlock_t *__rwlock, const struct timespec *) - __nonnull(1, 2) __trylocks_exclusive(0, *__rwlock); + __trylocks_exclusive(0, *__rwlock); int pthread_rwlock_tryrdlock(pthread_rwlock_t *__rwlock) - __nonnull(1) __trylocks_shared(0, *__rwlock); + __trylocks_shared(0, *__rwlock); int pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock) - __nonnull(1) __trylocks_exclusive(0, *__rwlock); + __trylocks_exclusive(0, *__rwlock); int pthread_rwlock_unlock(pthread_rwlock_t *__rwlock) - __nonnull(1) __unlocks(*__rwlock); + __unlocks(*__rwlock); int pthread_rwlock_wrlock(pthread_rwlock_t *__rwlock) - __nonnull(1) __locks_exclusive(*__rwlock); -int pthread_rwlockattr_destroy(pthread_rwlockattr_t *) - __nonnull(1); + __locks_exclusive(*__rwlock); +int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, int *); int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, - int *) __nonnull(1, 2); -int pthread_rwlockattr_init(pthread_rwlockattr_t *) - __nonnull(1); + int *); +int pthread_rwlockattr_init(pthread_rwlockattr_t *); int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); -int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int) - __nonnull(1); +int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); @@ -310,20 +295,18 @@ int pthread_mutexattr_setprotocol(pthre int pthread_attr_getinheritsched(const pthread_attr_t *, int *); int pthread_attr_getschedparam(const pthread_attr_t *, - struct sched_param *) __nonnull(1, 2); -int pthread_attr_getschedpolicy(const pthread_attr_t *, int *) - __nonnull(1, 2); -int pthread_attr_getscope(const pthread_attr_t *, int *) - __nonnull(1, 2); + struct sched_param *); +int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); +int pthread_attr_getscope(const pthread_attr_t *, int *); int pthread_attr_setinheritsched(pthread_attr_t *, int); int pthread_attr_setschedparam(pthread_attr_t *, - const struct sched_param *) __nonnull(1, 2); -int pthread_attr_setschedpolicy(pthread_attr_t *, int) __nonnull(1); -int pthread_attr_setscope(pthread_attr_t *, int) __nonnull(1); + const struct sched_param *); +int pthread_attr_setschedpolicy(pthread_attr_t *, int); +int pthread_attr_setscope(pthread_attr_t *, int); int pthread_getschedparam(pthread_t pthread, int *, - struct sched_param *) __nonnull(2, 3); + struct sched_param *); int pthread_setschedparam(pthread_t, int, - const struct sched_param *) __nonnull(3); + const struct sched_param *); #if __XSI_VISIBLE int pthread_getconcurrency(void); int pthread_setconcurrency(int); Modified: head/include/signal.h ============================================================================== --- head/include/signal.h Wed Mar 25 21:53:16 2015 (r280635) +++ head/include/signal.h Wed Mar 25 21:53:17 2015 (r280636) @@ -78,10 +78,10 @@ int sigdelset(sigset_t *, int); int sigemptyset(sigset_t *); int sigfillset(sigset_t *); int sigismember(const sigset_t *, int); -int sigpending(sigset_t *) __nonnull(1); +int sigpending(sigset_t *); int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); -int sigsuspend(const sigset_t *) __nonnull(1); -int sigwait(const sigset_t * __restrict, int * __restrict) __nonnull(1, 2); +int sigsuspend(const sigset_t *); +int sigwait(const sigset_t * __restrict, int * __restrict); #endif #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600 From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 21:59:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D9BB587; Wed, 25 Mar 2015 21: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 1F102994; Wed, 25 Mar 2015 21:59:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PLxbs8026851; Wed, 25 Mar 2015 21:59:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PLxbpo026850; Wed, 25 Mar 2015 21:59:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503252159.t2PLxbpo026850@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 25 Mar 2015 21:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280639 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:59:38 -0000 Author: imp Date: Wed Mar 25 21:59:36 2015 New Revision: 280639 URL: https://svnweb.freebsd.org/changeset/base/280639 Log: Add some more explanation to the different phases of the build. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Mar 25 21:57:03 2015 (r280638) +++ head/Makefile.inc1 Wed Mar 25 21:59:36 2015 (r280639) @@ -209,7 +209,9 @@ INSTALLTMP!= /usr/bin/mktemp -d -u -t in # 1. legacy stage [BMAKE] # This stage is responsible for creating compatibility # shims that are needed by the bootstrap-tools, -# build-tools and cross-tools stages. +# build-tools and cross-tools stages. These are generally +# APIs that tools from one of those three stages need to +# build that aren't present on the host. # 1. bootstrap-tools stage [BMAKE] # This stage is responsible for creating programs that # are needed for backward compatibility reasons. They @@ -220,7 +222,7 @@ INSTALLTMP!= /usr/bin/mktemp -d -u -t in # the build process. # 3. cross-tools stage [XMAKE] # This stage is responsible for creating any tools that -# are needed for cross-builds. A cross-compiler is one +# are needed for building the system. A cross-compiler is one # of them. # 4. world stage [WMAKE] # This stage actually builds the world. @@ -1222,7 +1224,9 @@ update: # # -# legacy: Build compatibility shims for the next three targets +# legacy: Build compatibility shims for the next three targets. This is a minimal +# set of tools and shims necessary to compensate for older systems which don't have +# the APIs that the targets built in bootstrap-tools, build-tools or cross-tools. # legacy: .if ${BOOTSTRAPPING} < 800107 && ${BOOTSTRAPPING} != 0 @@ -1240,7 +1244,10 @@ legacy: .endfor # -# bootstrap-tools: Build tools needed for compatibility +# bootstrap-tools: Build tools needed for compatibility. These are binaries that +# are built to build other binaries in the system. However, the focus of these +# binaries is usually quite narrow. Bootstrap tools use the host's compiler and +# libraries, augmented by -legacy. # _bt= _bootstrap-tools @@ -1446,7 +1453,9 @@ kernel-tools: .MAKE -p ${MAKEOBJDIRPREFIX}/usr >/dev/null # -# cross-tools: Build cross-building tools +# cross-tools: All the tools needed to build the rest of the system after +# we get done with the earlier stages. It is the last set of tools needed +# to begin building the target binaries. # .if ${TARGET_ARCH} != ${MACHINE_ARCH} .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 22:08:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E89FA78B; Wed, 25 Mar 2015 22:08: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 D37F6A76; Wed, 25 Mar 2015 22:08:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PM84gR031536; Wed, 25 Mar 2015 22:08:04 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PM83Su031525; Wed, 25 Mar 2015 22:08:03 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201503252208.t2PM83Su031525@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 25 Mar 2015 22:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280640 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 22:08:05 -0000 Author: gjb Date: Wed Mar 25 22:08:02 2015 New Revision: 280640 URL: https://svnweb.freebsd.org/changeset/base/280640 Log: Crochet sources moved to a new home; update accordingly. MFC after: 3 days 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 Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Wed Mar 25 21:59:36 2015 (r280639) +++ head/release/arm/BEAGLEBONE.conf Wed Mar 25 22:08:02 2015 (r280640) @@ -32,6 +32,6 @@ load_target_env() { export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" export KERNEL="BEAGLEBONE" - export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" + export CROCHETSRC="https://github.com/freebsd/crochet" export CROCHETBRANCH="trunk@r744" } Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Wed Mar 25 21:59:36 2015 (r280639) +++ head/release/arm/PANDABOARD.conf Wed Mar 25 22:08:02 2015 (r280640) @@ -32,6 +32,6 @@ load_target_env() { export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" export KERNEL="PANDABOARD" - export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" + export CROCHETSRC="https://github.com/freebsd/crochet" export CROCHETBRANCH="trunk@r744" } Modified: head/release/arm/RPI-B.conf ============================================================================== --- head/release/arm/RPI-B.conf Wed Mar 25 21:59:36 2015 (r280639) +++ head/release/arm/RPI-B.conf Wed Mar 25 22:08:02 2015 (r280640) @@ -32,7 +32,7 @@ load_target_env() { export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" export KERNEL="RPI-B" - export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" + export CROCHETSRC="https://github.com/freebsd/crochet" export CROCHETBRANCH="trunk@r744" export UBOOTSRC="https://github.com/gonzoua/u-boot-pi" export UBOOTBRANCH="trunk" Modified: head/release/arm/WANDBOARD-QUAD.conf ============================================================================== --- head/release/arm/WANDBOARD-QUAD.conf Wed Mar 25 21:59:36 2015 (r280639) +++ head/release/arm/WANDBOARD-QUAD.conf Wed Mar 25 22:08:02 2015 (r280640) @@ -32,6 +32,6 @@ load_target_env() { export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" export KERNEL="WANDBOARD-QUAD" - export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" + export CROCHETSRC="https://github.com/freebsd/crochet" export CROCHETBRANCH="trunk@r744" } Modified: head/release/arm/ZEDBOARD.conf ============================================================================== --- head/release/arm/ZEDBOARD.conf Wed Mar 25 21:59:36 2015 (r280639) +++ head/release/arm/ZEDBOARD.conf Wed Mar 25 22:08:02 2015 (r280640) @@ -31,6 +31,6 @@ load_target_env() { export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" export KERNEL="ZEDBOARD" - export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" + export CROCHETSRC="https://github.com/freebsd/crochet" export CROCHETBRANCH="trunk@r744" } From owner-svn-src-head@FreeBSD.ORG Wed Mar 25 22:45:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACE7BEF1; Wed, 25 Mar 2015 22: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 97C8DE44; Wed, 25 Mar 2015 22:45:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PMjtMA052492; Wed, 25 Mar 2015 22:45:55 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PMjtgc052491; Wed, 25 Mar 2015 22:45:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503252245.t2PMjtgc052491@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 25 Mar 2015 22:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280642 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 22:45:55 -0000 Author: tuexen Date: Wed Mar 25 22:45:54 2015 New Revision: 280642 URL: https://svnweb.freebsd.org/changeset/base/280642 Log: Make sure that we don't free an SCTP shared key too early. Thanks to Pouyan Sepehrdad from Qualcomm Product Security Initiative for reporting the issue. MFC after: 3 days Modified: head/sys/netinet/sctp_auth.c Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Wed Mar 25 22:35:08 2015 (r280641) +++ head/sys/netinet/sctp_auth.c Wed Mar 25 22:45:54 2015 (r280642) @@ -576,13 +576,12 @@ sctp_auth_key_release(struct sctp_tcb *s /* decrement the ref count */ if (skey) { - sctp_free_sharedkey(skey); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u refcount release to %d\n", __FUNCTION__, (void *)stcb, key_id, skey->refcount); /* see if a notification should be generated */ - if ((skey->refcount <= 1) && (skey->deactivated)) { + if ((skey->refcount <= 2) && (skey->deactivated)) { /* notify ULP that key is no longer used */ sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb, key_id, 0, so_locked); @@ -590,6 +589,7 @@ sctp_auth_key_release(struct sctp_tcb *s "%s: stcb %p key %u no longer used, %d\n", __FUNCTION__, (void *)stcb, key_id, skey->refcount); } + sctp_free_sharedkey(skey); } } From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 01:51:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25CA7BE6; Thu, 26 Mar 2015 01:51:03 +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 85E1F36E; Thu, 26 Mar 2015 01:51:02 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 8C78878407C; Thu, 26 Mar 2015 12:50:52 +1100 (AEDT) Date: Thu, 26 Mar 2015 12:50:48 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mateusz Guzik Subject: Re: svn commit: r280407 - head/sys/kern In-Reply-To: <20150325201524.GB14280@dft-labs.eu> Message-ID: <20150326103908.G993@besplex.bde.org> References: <201503240010.t2O0ACZb089906@svn.freebsd.org> <20150324135350.N1665@besplex.bde.org> <20150325201524.GB14280@dft-labs.eu> 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=ZuzUdbLG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=gTxjnMf5gfhHc4B0dfAA:9 a=WDFHsLVgq9RVs6JP:21 a=H6X1VPRX2YTj_r_X: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-1 Precedence: list List-Id: SVN 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 Mar 2015 01:51:03 -0000 On Wed, 25 Mar 2015, Mateusz Guzik wrote: > On Tue, Mar 24, 2015 at 03:58:14PM +1100, Bruce Evans wrote: >> On Tue, 24 Mar 2015, Mateusz Guzik wrote: >> >>> Log: >>> filedesc: microoptimize fget_unlocked by getting rid of fd < 0 branch >> >> This has no effect. Compilers optimize to the equivalent of the the >> unsigned cast hack if this is good. On x86, it is good since no >> instructions are needed for the conversion, and the only difference >> between the code generated by >> >> if (fd >= fdt->fdt_nfiles) >> >> and >> >> if (fd < 0 || fd >= fdt->fdt_nfiles) >> >> is to change from jl (jump if less than) to jb (jump if below) (both >> jumps over the if clause). Negative values satisfy jl but not jb. > > I would not commit the change if it did not affect generated assembly at > least on amd64. Interesting. All compilers that I tested (gcc-4.2, gcc-4.8 and clang pessimize this). clang generates especially fancy "optimizations" which actually give pessimizations of 1-4 cycles for time and 15-25 bytes for space (larger time penalties from the space pessimization in real use where everything doesnt fit in the I-cache. gcc-4.8 only gives a 1 cycle time pessimization plus the 5-10 bytes of space pessimizations for the extra instructions for this, with less fancy scheduling that is easier to untangle to remove the 1-cycle pessimization. Micro- Benchmark program below. > if (fd < 0 || fd >= fdt->fdt_nfiles): > 0xffffffff807d147d : sub $0x38,%rsp > 0xffffffff807d1481 : test %esi,%esi > 0xffffffff807d1483 : js 0xffffffff807d15b8 objdump output is of low quality, especially on 64-bit arches where the 0xff... numbers are twice as bloated. This is the extra branch. In the micro-benchmark, clang pre-loads a pointer to the volatile return values and jumps to common code to load the value. This is its main pessimization relative to gcc. clang also generates code that runs into itself. It generates 2 loads of one of the pointers. This is mostly a space pessimization, except it may be necessary for the rest of the fancy scheduling to cost only 1 cycle. Here the return value for the error case is constant and the return value for the other case is variable, so this pessimization is inhibited. In the microbenchmark with the return values changed to non-volatile, clang does a fancier "optimization" involving pre-loading the values, then conditional moves. This gives an additional pessimization of 1 cycle. > 0xffffffff807d1489 : mov (%rdi),%rbx > 0xffffffff807d148c : cmp %esi,(%rbx) Here rbx is naturally a pointer, so this is the best comparison instruction. In the micro-benchmark, at least with the volatile limit, both clang and gcc-4.8 load a pointer to the limit instead of doing a cmp on the memory variable. Old versions of gcc know that this is usually bad, and have options -fforce-addr and -fforce-mem to change the default of not doing this. In the micro-benchmark, this just wastes space. In real use, loading the pointer to volatile data or loading non-volatile data is best if the variable is accessed more than once and the register pressure is not large. > 0xffffffff807d148e : jle 0xffffffff807d15bf > > if ((u_int)fd >= fdt->fdt_nfiles): > 0xffffffff807d147d : sub $0x38,%rsp > 0xffffffff807d1481 : mov (%rdi),%rbx > 0xffffffff807d1484 : cmp %esi,(%rbx) > 0xffffffff807d1486 : jbe 0xffffffff807d15a8 > > I did not check other archs prior to the commit. > > This is clang 3.6 as present in head. Sources compiled with -O2. Also > see below for other compiler test. > >>> Casting fd to an unsigned type simplifies fd range coparison to mere checking >>> if the result is bigger than the table. >> >> No, it obfuscates the range comparison. > > It is a standard hack which is hard to misread and which seems to add a > slight benefit (see below). Because the compiler doesn't actually do it. I'm sure compilers sometimes do it. Apparently just when the top limit is constant. > ... > It affects assembly on all arm, powerpc64 and mips64 as well. Both arm > and powerpc just get rid of zero-test and use the same instructions to > perform the other comparison. I only found a difference on mips64 which > used sltu instead of slt (but still got rid of the zero-check). Getting rid of the zero test should give what I want. The code might differ due to register allocation. Are arm and powerpc still using gcc? > [..] >> - fget_locked() seems to be unchanged recently, so it doesn't have the >> obfuscation. fget_unlocked() is newer than the unobfuscated version >> of fget_locked(). It is in a different file, but may have copied the >> unobfuscated range check from fget_locked(). This commit restores the >> obfuscation to it alone. > > This definitely should be synced one way or the other, thanks for > pointing this out. To the unobfuscated version :-). > I wrote a toy program and checked e.g. gcc5 and it still did not > optimise zero-test away. > > In fact I would argue the optimisation in question is impossible unless > upper limit check is against a constant in (0, INT_MAX) range or against > a var whose range is known at compile time. Argh. That must be it, or possibly -fno-wrapv. I get the same results with and without wrapv. > In particular this is problematic for negative values. > > Consider: > int fd, limit; > ............ > if (fd < 0 || fd >= limit) > > Let's have fd = -5 and limit = -4. > > Should the fd < 0 check be dropped by the compiler and the expression > turned into (u_int)fd >= limit, the coparison would be false thus > changing the outcome. Wrapv doesn't affect this. Compilers can use wrapping behaviour internally for some things, but not for signed comparisons. E.g., on x86 for (fd >= limit) they can check the flags after (fd - limit). The flags are the same as after cmp(fd, limit). But the non-wrapping flag (ge) must be used, not the wrapping flag (ae). > As such, I prefer to keep the cast. Now I dislike the cast even more. The sign conversions are especially delicate. If the limit were u_int, then the sign conversions would happen without the cast, and are even more confusing since they are implicit. The limits for fd's are intentionally signed, the same as for fd's, since otherwise there would be lots of confusing automatic conversions and compiler warnings for some of them. BTW, sysctl limits like maxfiles and maxfilesperproc are signed. Foot- shooting is correctly allowed for these like for most sysctls, so they can be set to preposterous negative limits as well as to preposterously large positive ones, unlike for the corresponding rlimit. So the comparison (fd < (limit = -4)) may happen in practice. In practice, other sign extension bugs usually occur first. The first reference to maxfiles* in kern_descrip.c has 3 and a half sign/extension overflow bugs including one for maxfilesperproc. It uses min() to convert maxfilesperproc to u_int. It does the same for the other arg after first truncating the arg's value from 64 bits signed to 32 bits signed (not even to 32 bits unsigned to give defined behaviour and to match min()'s type). min() gives a 32-bit unsigned value. This is assigned to a td_retval[0], which is 32 bits signed on 32-bit arches and 64-bit signed on 64-bit arches, so there is only a bug on half of the arches for the final step. Problems don't accur in practice because the rlimit is clamped to well below 0x7fffffff. Values near RLIM_INFINITY are allowed for mose limits but not the files limit. Pseudo-infinite values like 0x7fffffff00000001 would become 1 after truncation. Micro-benchmark program: X #include X X volatile int err = 1; X volatile int ok = 0; X volatile int toplimit = 20; X X int __noinline X foo(int x) X { X if (x < 0 || x >= toplimit) X return (err); X return (ok); X } X X int X main(void) X { X int errcount, i; X X errcount = 0; X for (i = 0; i < 266681953; i++) /* the magic number is tsc_freq/10 */ X errcount += foo(i); X printf("errcount = %d\n", errcount); X } Since the optimization that I wanted is invalid, this is just a benchmark of how far away the compiler is from generating optimal code. Timing on freefall: clang: 7 cycles clang: 7 cycles (with manual editing... didn't help, tended to harm) clang: 6 cycles (with above changed to use unsigned hack) gcc-4.8: 6 cycles gcc-4.8: 5 cycles (with manual editing of asm output to get the invalid opt) gcc-4.8: 5 cycles (with above changed to use unsigned hack) This is with -O. Other "optimizations are mostly pessimizations: clang -O2: no change gcc-4.8 -O2: 1 cycle slower clang with __predict_true(): 1 cycles slower clang with __predict_false(): 2 cycles slower (slower with the correct pred!) gcc-48 with __predict_false() or __predict_false() in above: no change Adding __predict_*() to the above with the unsigned hacks makes no further change. The bad code generated by clang for the above is: X movl $err, %eax X testl %edi, %edi X js .LBB0_3 X # BB#1: # %lor.lhs.false X movl toplimit(%rip), %ecx X movl $ok, %eax X cmpl %edi, %ecx X jg .LBB0_3 X # BB#2: # %select.mid X movl $err, %eax X .LBB0_3: # %return X movl (%rax), %eax X popq %rbp X retq This uses fancy scheduling of a bad method to lose by only 1 cycle relative to gcc. The loss is from pre-loading pointers so as to jump to a common load at the end. It seems stupid to load $err twice, but this saves 1 cycle. __predict_false() gives the following changes: X --- z.s~ 2015-03-26 01:11:17.825573000 +0000 X +++ z.s 2015-03-26 01:10:47.728912000 +0000 X @@ -19,10 +19,10 @@ X js .LBB0_3 X -# BB#1: # %lor.lhs.false X +# BB#1: # %lor.rhs X movl toplimit(%rip), %ecx X - movl $ok, %eax X + movl $err, %eax X cmpl %edi, %ecx X - jg .LBB0_3 X + jle .LBB0_3 X # BB#2: # %select.mid X - movl $err, %eax X -.LBB0_3: # %return X + movl $ok, %eax X +.LBB0_3: # %lor.end X movl (%rax), %eax This costs 2 cycles. It leaves a doubled load of $err which makes no sense now since the code no longer runs into itself and the second load is redundant. The extra instruction might be useful as padding, but is actually negatively useful. Removing it reduces the loss to 1 cycle relative to the unpredicted version, by giving essentially the same code as the unpredicted version with my editing to avoid the apparently-unnecessary doubled load. __predict_true() loses only 1 cycle, essentially by producing the above without the extra instruction. That it, it takes 8 cycles. 2 more than gcc and 3 more than the best seen with the unsigned hack. These cycle counts intentionally include many for loop and function call overhead. I used a function and many volatile variables to prevent most things being calculated a compile time. With __inline instead of __noinline, most or all variants take about 2.7 cycles with clang (I think 2 cycles is the minimum loop overhead and other operations run in parallel with the loop and themselves). gcc-4.8 then takes 2.7 cycles with the unsigned hack but 3.5 cycles without it. gcc's not so fancy scheduling loses instead of wins when it is inlined. In real code, the optimizer has even more chances to do fancy scheduling to hide the latency of extra branches, but 1 more branch may thrash branch prediction caches. Anyway, you won't be able to measure 1-cycle optimizations in real code. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 02:14:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D0841F3; Thu, 26 Mar 2015 02:14: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 3DEE67D1; Thu, 26 Mar 2015 02:14:18 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id B14B6D67098; Thu, 26 Mar 2015 13:14:06 +1100 (AEDT) Date: Thu, 26 Mar 2015 13:14:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" Subject: Re: svn commit: r280636 - head/include In-Reply-To: <201503252153.t2PLrInc025854@svn.freebsd.org> Message-ID: <20150326130403.W993@besplex.bde.org> References: <201503252153.t2PLrInc025854@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=A5NVYcmG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=v8WTfNS-EKsu7SCtGhkA: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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:14:19 -0000 On Wed, 25 Mar 2015, Pedro F. Giffuni wrote: > Log: > Temporarily revert 280458. > > GCC is still carries an old version of cdefs.h which doesn't > accept multiple parameters for the nonnull attribute. > > Since this issue probably affects many ports in the tree > we will revert it for now until gcc gets fixed. Note that sys/cdefs.h is supposed to work with any version of gcc back to gcc-1, and does mostly work back to at least gcc-2.95. The whole point of sys/cdefs.h is to provide compatibity macros for old and other non-default compilers. Standard compilers don't even have __attribute__(()). So no changes in future versions of gcc will fix the previous commit. The ifdefs for __nonnull() seem to be broken. They assume that all versions of gcc >= 3.3 support the same semantics for __nonnull() and that no non-gcc compiler supports the __nonnull__() attribute. Non-gcc compilers like clang get this by pretending to be gcc. Non-gcc compilers like icc tend to not get this by not pretending to be gcc. __nonnull__() is one of the few attributes that is only a hint, so definining it as nothing when it is not known to work is correct. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 03:02:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DE4A719 for ; Thu, 26 Mar 2015 03:02:44 +0000 (UTC) Received: from nm24-vm0.bullet.mail.bf1.yahoo.com (nm24-vm0.bullet.mail.bf1.yahoo.com [98.139.213.161]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8718E73 for ; Thu, 26 Mar 2015 03:02:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1427338961; bh=Gbdd5CZL0zRAxssAqWXw1QOreYLPdOubTlPCI4dmPgk=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=NtV9g/Awzsbkdj0MiY6dReOt+gBGgyK1wpB2cR0a6DEoZ8YHJeKCicG5iEmjEhhr5QHM4fEvubdhJisp4cUKiKl9PToP9XXX3jNnYAy/eAJptvj3CppY4/iFJMaw3XEOBMTYeR7CSTlzUUjnFJ/3OwFDDHMa7Dd1xzofq2RXh4OSJ9iDn/9b6GXHeYCPHbNvToZ4e1B9P6ixNVOWh6kKrIounugkF/ARqkIf+Yx2PX6UnvRtGOXjuPlxrfVnw1cOKlikUDiOF/S6Rnfx5l3EWTAAPtNMRoFsuMpqTVJ22xZ8Zdu1Ylrbg4VHxgKmiKucBELxwWrM9g7c6b7MXh/SgA== Received: from [98.139.170.181] by nm24.bullet.mail.bf1.yahoo.com with NNFMP; 26 Mar 2015 03:02:41 -0000 Received: from [98.139.211.192] by tm24.bullet.mail.bf1.yahoo.com with NNFMP; 26 Mar 2015 03:02:41 -0000 Received: from [127.0.0.1] by smtp201.mail.bf1.yahoo.com with NNFMP; 26 Mar 2015 03:02:41 -0000 X-Yahoo-Newman-Id: 794932.28704.bm@smtp201.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: _mZHH4MVM1nKvZMFPRykiG1JoFz0EHlR7vyNcTvbGOMibGb u9XUpQ7HulhdNwrBhXy01aqxO0m7NbDg8A3R0Nt5HngPRKGwRNE4.GijFvrG Qe4mNT_IfMD.BISosb9FswOuQAmTvq5bUj.wjN8k69UPAWfLA0bExjQZk4zB qnu2PgNqSeVN499Dhy0KgvIFBP_dG4F5vPgyGGyvSyBCtfq2V_qYTnzDYCzH E5jIN18rDoqFuuLGvFY0j2JUWeqzEhGh1HfzUvYNvd.HsMq0GtTGChM_Q8CP fNHEokBbqpLFYbWf5yDczEvXH6d7cCAvYSVYngpc9SRDZ1EmkqSQlqYqcxjP LY2vmIcS1n_FDn7tBBtAWoXRR23p26lq0Tqt6aYeZlrZD5oNhL9BFeqr0FKH dWoN2eUk3UL.q2KuKxtM.zlrKEa8Hd.sErLl7vWU8olfg0e1kloDpWRTnO9j G0kU.x0Z_bUtwJeA9.4x7xJC6sUnRad.cILWsV8rjnqEvFnxI5hthImG4MRp .dvRsupKE3Et.M6VTPzlVTnTr9dcpWEamGpj4NdkiH6OhFRyqk.mn4pgbgr2 T_yylqfRtQVbcKvOQ6Jkke4MC6AmDW4jjNxbKkTtoOiv12WB55x3ttLnx7Iy OmxqtdEC9mOabCY1T3dVGXZlYvIADt0lfVZnMgW5K2Dkp34XZyNiY75Yvl46 AgtnvW8w- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <551376D4.4030003@FreeBSD.org> Date: Wed, 25 Mar 2015 22:02:44 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r280636 - head/include References: <201503252153.t2PLrInc025854@svn.freebsd.org> <20150326130403.W993@besplex.bde.org> In-Reply-To: <20150326130403.W993@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; 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-1 Precedence: list List-Id: SVN 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 Mar 2015 03:02:44 -0000 On 03/25/15 21:14, Bruce Evans wrote: > On Wed, 25 Mar 2015, Pedro F. Giffuni wrote: > >> Log: >> Temporarily revert 280458. >> >> GCC is still carries an old version of cdefs.h which doesn't >> accept multiple parameters for the nonnull attribute. >> >> Since this issue probably affects many ports in the tree >> we will revert it for now until gcc gets fixed. > > Note that sys/cdefs.h is supposed to work with any version of > gcc back to gcc-1, and does mostly work back to at least gcc-2.95. > The whole point of sys/cdefs.h is to provide compatibity macros > for old and other non-default compilers. Standard compilers don't > even have __attribute__(()). So no changes in future versions > of gcc will fix the previous commit. > cdefs.h still works for all versions of gcc back to gcc-1 AFAICT. > The ifdefs for __nonnull() seem to be broken. They assume that > all versions of gcc >= 3.3 support the same semantics for __nonnull() > and that no non-gcc compiler supports the __nonnull__() attribute. All versions of gcc >= 3.3 support the same semantics for __nonnull(). Unfortunately an older revision of cdefs.h was only accepting one argument while gcc accepts multiple arguments just fine. > Non-gcc compilers like clang get this by pretending to be gcc. Clang claims support for gcc attributes [1] and has a __has_attribute() macro for testing. It also reports itself as gcc 4.2 for compatibility so we don't need to test for availability for the older attributes. > > Non-gcc compilers like icc tend to not get this by not pretending to > be gcc. __nonnull__() is one of the few attributes that is only a > hint, so definining it as nothing when it is not known to work is > correct. > The reason why I had to revert the change is actually a systematic bug in gcc: during it's build process gcc generates a new cdefs.h from our headers. Attempting to use an older gcc from ports that was build with the broken mono-parameter __nonnull() ended up causing breakage in any code using signal.h or pthreads.h. The lesson here is to update gcc every time cdefs.h is updated (I will be updating it at least once more[2]) and, in my case, I'll have to wait a couple of weeks after committing a cdefs.h change before using the new attributes to give time for people to update their gcc* ports, and I'll likely have to note it in UPDATING too, JIC. Cheers, Pedro. [1] http://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros [2] https://reviews.freebsd.org/D2107 From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 05:20:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08647130; Thu, 26 Mar 2015 05:20: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 E79CCCB0; Thu, 26 Mar 2015 05:20:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2Q5KJZM041753; Thu, 26 Mar 2015 05:20:19 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2Q5KJ6G041751; Thu, 26 Mar 2015 05:20:19 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201503260520.t2Q5KJ6G041751@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Thu, 26 Mar 2015 05:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280665 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 05:20:20 -0000 Author: rpaulo Date: Thu Mar 26 05:20:18 2015 New Revision: 280665 URL: https://svnweb.freebsd.org/changeset/base/280665 Log: Add comments about CTLFLAG_RDTUN vs. TUNABLE_INT_FETCH. Requested by: julian Modified: head/sys/vm/memguard.c head/sys/vm/vm_page.c Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Thu Mar 26 05:18:17 2015 (r280664) +++ head/sys/vm/memguard.c Thu Mar 26 05:20:18 2015 (r280665) @@ -69,7 +69,7 @@ static SYSCTL_NODE(_vm, OID_AUTO, memgua static u_int vm_memguard_divisor; SYSCTL_UINT(_vm_memguard, OID_AUTO, divisor, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &vm_memguard_divisor, - 0, "(kmem_size/memguard_divisor) == memguard submap size"); + 0, "(kmem_size/memguard_divisor) == memguard submap size"); /* * Short description (ks_shortdesc) of memory type to monitor. @@ -162,6 +162,7 @@ memguard_fudge(unsigned long km_size, co u_long mem_pgs, parent_size; vm_memguard_divisor = 10; + /* CTFLAG_RDTUN doesn't work during the early boot process. */ TUNABLE_INT_FETCH("vm.memguard.divisor", &vm_memguard_divisor); parent_size = vm_map_max(parent_map) - vm_map_min(parent_map) + Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Mar 26 05:18:17 2015 (r280664) +++ head/sys/vm/vm_page.c Thu Mar 26 05:20:18 2015 (r280665) @@ -349,6 +349,9 @@ vm_page_startup(vm_offset_t vaddr) /* * Allocate memory for use when boot strapping the kernel memory * allocator. + * + * CTFLAG_RDTUN doesn't work during the early boot process, so we must + * manually fetch the value. */ TUNABLE_INT_FETCH("vm.boot_pages", &boot_pages); new_end = end - (boot_pages * UMA_SLAB_SIZE); From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 06:38:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76755180; Thu, 26 Mar 2015 06:38:03 +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 37C175F4; Thu, 26 Mar 2015 06:38:03 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 881654249AD; Thu, 26 Mar 2015 17:37:54 +1100 (AEDT) Date: Thu, 26 Mar 2015 17:37:53 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pedro Giffuni Subject: Re: svn commit: r280636 - head/include In-Reply-To: <551376D4.4030003@FreeBSD.org> Message-ID: <20150326170535.U2239@besplex.bde.org> References: <201503252153.t2PLrInc025854@svn.freebsd.org> <20150326130403.W993@besplex.bde.org> <551376D4.4030003@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=ZuzUdbLG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=aE7OyBw8yOmdTJHGsokA: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-1 Precedence: list List-Id: SVN 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 Mar 2015 06:38:03 -0000 On Wed, 25 Mar 2015, Pedro Giffuni wrote: > On 03/25/15 21:14, Bruce Evans wrote: >> On Wed, 25 Mar 2015, Pedro F. Giffuni wrote: >> >>> Log: >>> Temporarily revert 280458. >>> >>> GCC is still carries an old version of cdefs.h which doesn't >>> accept multiple parameters for the nonnull attribute. >>> Since this issue probably affects many ports in the tree >>> we will revert it for now until gcc gets fixed. >> >> Note that sys/cdefs.h is supposed to work with any version of >> gcc back to gcc-1, and does mostly work back to at least gcc-2.95. >> The whole point of sys/cdefs.h is to provide compatibity macros >> for old and other non-default compilers. Standard compilers don't >> even have __attribute__(()). So no changes in future versions >> of gcc will fix the previous commit. >> > cdefs.h still works for all versions of gcc back to gcc-1 AFAICT. I now remember other bugs in it. I think you put the varargs stuff in the non-gcc version. That won't work compilers that don't support varargs for macros. Neither will not changing the non-gcc version. glibc (2.6 at least) avoids using varargs in its __nonnull() macro by using the same portable method that is used in many optional debugging statements including FreeBSD's KASSERT(). (KASSERT() is broken as designed. It never needed this since it wasn't implmented until several years after C99 standardized varargs for macros.) The macro takes a single arg consisting of a normal list of args enclosed in parentheses. The extra parentheses are not passed to the __attribute__() list. All invocations of the macro must be ugly to supply the parantheses. The parentheses give a large syntactic difference, so the ugliness cannot be fixed easily by switching to varargs macros. For KASSERT(), there would be about 7500 in /usr/src lines to clean up. For __nonnull(), there would be only about lines 160 in /usr/src to change. Mostly __nonnull(1) -> __nonnull((1)). But __nonnull() is more likely to be (mis)used in ports. > The reason why I had to revert the change is actually a systematic > bug in gcc: during it's build process gcc generates a new cdefs.h > from our headers. Attempting to use an older gcc from ports > that was build with the broken mono-parameter __nonnull() ended > up causing breakage in any code using signal.h or pthreads.h. I see. gcc's "fixed" headers cause lots of problems. > The lesson here is to update gcc every time cdefs.h is updated Whenever a "fixed" header is changed. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 09:13:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E91DEEE; Thu, 26 Mar 2015 09: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 EDE22806; Thu, 26 Mar 2015 09:13:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2Q9DHNQ052799; Thu, 26 Mar 2015 09:13:17 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2Q9DHL6052798; Thu, 26 Mar 2015 09:13:17 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201503260913.t2Q9DHL6052798@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 26 Mar 2015 09:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280680 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 09:13:18 -0000 Author: kevlo Date: Thu Mar 26 09:13:16 2015 New Revision: 280680 URL: https://svnweb.freebsd.org/changeset/base/280680 Log: Print size_t's with %zu rather than "%zd. Reviewed by: bde Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Thu Mar 26 08:38:53 2015 (r280679) +++ head/usr.bin/top/machine.c Thu Mar 26 09:13:16 2015 (r280680) @@ -373,7 +373,7 @@ machine_init(struct statics *statics, ch size = sizeof(long) * maxcpu * CPUSTATES; times = malloc(size); if (times == NULL) - err(1, "malloc %zd bytes", size); + err(1, "malloc %zu bytes", size); if (sysctlbyname("kern.cp_times", times, &size, NULL, 0) == -1) err(1, "sysctlbyname kern.cp_times"); pcpu_cp_time = calloc(1, size); @@ -1004,7 +1004,7 @@ format_next_process(caddr_t handle, char argbuflen = cmdlen * 4; argbuf = (char *)malloc(argbuflen + 1); if (argbuf == NULL) { - warn("malloc(%zd)", argbuflen + 1); + warn("malloc(%zu)", argbuflen + 1); free(cmdbuf); return NULL; } From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 11:02:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A416835; Thu, 26 Mar 2015 11: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 850A73F0; Thu, 26 Mar 2015 11:02:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QB2UjL003953; Thu, 26 Mar 2015 11:02:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QB2UhA003952; Thu, 26 Mar 2015 11:02:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503261102.t2QB2UhA003952@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 26 Mar 2015 11:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280685 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 11:02:30 -0000 Author: mav Date: Thu Mar 26 11:02:29 2015 New Revision: 280685 URL: https://svnweb.freebsd.org/changeset/base/280685 Log: When searching for provider by name, prefer non-withered one. MFC after: 2 weeks Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Thu Mar 26 10:44:16 2015 (r280684) +++ head/sys/geom/geom_subr.c Thu Mar 26 11:02:29 2015 (r280685) @@ -683,21 +683,27 @@ g_provider_by_name(char const *arg) { struct g_class *cp; struct g_geom *gp; - struct g_provider *pp; + struct g_provider *pp, *wpp; if (strncmp(arg, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) arg += sizeof(_PATH_DEV) - 1; + wpp = NULL; LIST_FOREACH(cp, &g_classes, class) { LIST_FOREACH(gp, &cp->geom, geom) { LIST_FOREACH(pp, &gp->provider, provider) { - if (!strcmp(arg, pp->name)) + if (strcmp(arg, pp->name) != 0) + continue; + if ((gp->flags & G_GEOM_WITHER) == 0 && + (pp->flags & G_PF_WITHER) == 0) return (pp); + else + wpp = pp; } } } - return (NULL); + return (wpp); } void From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 11:19:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 002B7C2F; Thu, 26 Mar 2015 11: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 DEB5A775; Thu, 26 Mar 2015 11:19:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QBJPT0009431; Thu, 26 Mar 2015 11:19:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QBJPnH009430; Thu, 26 Mar 2015 11:19:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503261119.t2QBJPnH009430@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 26 Mar 2015 11:19:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280686 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 11:19:26 -0000 Author: mav Date: Thu Mar 26 11:19:24 2015 New Revision: 280686 URL: https://svnweb.freebsd.org/changeset/base/280686 Log: Report withered providers as such alike to GEOMs. MFC after: 2 weeks Modified: head/sys/geom/geom_dump.c Modified: head/sys/geom/geom_dump.c ============================================================================== --- head/sys/geom/geom_dump.c Thu Mar 26 11:02:29 2015 (r280685) +++ head/sys/geom/geom_dump.c Thu Mar 26 11:19:24 2015 (r280686) @@ -216,7 +216,9 @@ g_conf_provider(struct sbuf *sb, struct sbuf_printf(sb, "\t %u\n", pp->sectorsize); sbuf_printf(sb, "\t %u\n", pp->stripesize); sbuf_printf(sb, "\t %u\n", pp->stripeoffset); - if (pp->geom->flags & G_GEOM_WITHER) + if (pp->flags & G_PF_WITHER) + sbuf_printf(sb, "\t \n"); + else if (pp->geom->flags & G_GEOM_WITHER) ; else if (pp->geom->dumpconf != NULL) { sbuf_printf(sb, "\t \n"); From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 12:17:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 023DEA18; Thu, 26 Mar 2015 12: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 E12D5DF6; Thu, 26 Mar 2015 12:17:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QCHmbV037161; Thu, 26 Mar 2015 12:17:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QCHlPf037147; Thu, 26 Mar 2015 12:17:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503261217.t2QCHlPf037147@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 26 Mar 2015 12:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280687 - in head: lib/libgeom sbin/geom/class/part 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-1 Precedence: list List-Id: SVN 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 Mar 2015 12:17:49 -0000 Author: mav Date: Thu Mar 26 12:17:47 2015 New Revision: 280687 URL: https://svnweb.freebsd.org/changeset/base/280687 Log: Make GEOM_PART work in presence of previous withered self. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/lib/libgeom/geom_xml2tree.c head/sbin/geom/class/part/geom_part.c head/sys/geom/part/g_part.c Modified: head/lib/libgeom/geom_xml2tree.c ============================================================================== --- head/lib/libgeom/geom_xml2tree.c Thu Mar 26 11:19:24 2015 (r280686) +++ head/lib/libgeom/geom_xml2tree.c Thu Mar 26 12:17:47 2015 (r280687) @@ -186,6 +186,7 @@ static void EndElement(void *userData, const char *name) { struct mystate *mt; + struct gconf *c; struct gconfig *gc; char *p; @@ -259,7 +260,14 @@ EndElement(void *userData, const char *n return; } - if (mt->config != NULL) { + if (mt->config != NULL || (!strcmp(name, "wither") && + (mt->provider != NULL || mt->geom != NULL))) { + if (mt->config != NULL) + c = mt->config; + else if (mt->provider != NULL) + c = &mt->provider->lg_config; + else + c = &mt->geom->lg_config; gc = calloc(1, sizeof *gc); if (gc == NULL) { mt->error = errno; @@ -270,14 +278,15 @@ EndElement(void *userData, const char *n } gc->lg_name = strdup(name); if (gc->lg_name == NULL) { + free(gc); mt->error = errno; XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; } - gc->lg_val = p; - LIST_INSERT_HEAD(mt->config, gc, lg_config); + gc->lg_val = p ? p : strdup("1"); + LIST_INSERT_HEAD(c, gc, lg_config); return; } Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Thu Mar 26 11:19:24 2015 (r280686) +++ head/sbin/geom/class/part/geom_part.c Thu Mar 26 12:17:47 2015 (r280687) @@ -207,15 +207,20 @@ find_class(struct gmesh *mesh, const cha static struct ggeom * find_geom(struct gclass *classp, const char *name) { - struct ggeom *gp; + struct ggeom *gp, *wgp; if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) name += sizeof(_PATH_DEV) - 1; + wgp = NULL; LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { - if (strcmp(gp->lg_name, name) == 0) + if (strcmp(gp->lg_name, name) != 0) + continue; + if (find_geomcfg(gp, "wither") == NULL) return (gp); + else + wgp = gp; } - return (NULL); + return (wgp); } static const char * @@ -609,6 +614,8 @@ gpart_show_geom(struct ggeom *gp, const off_t length, secsz; int idx, wblocks, wname, wmax; + if (find_geomcfg(gp, "wither")) + return; scheme = find_geomcfg(gp, "scheme"); if (scheme == NULL) errx(EXIT_FAILURE, "Scheme not found for geom %s", gp->lg_name); Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Thu Mar 26 11:19:24 2015 (r280686) +++ head/sys/geom/part/g_part.c Thu Mar 26 12:17:47 2015 (r280687) @@ -452,7 +452,8 @@ g_part_find_geom(const char *name) { struct g_geom *gp; LIST_FOREACH(gp, &g_part_class.geom, geom) { - if (!strcmp(name, gp->name)) + if ((gp->flags & G_GEOM_WITHER) == 0 && + strcmp(name, gp->name) == 0) break; } return (gp); @@ -474,10 +475,6 @@ g_part_parm_geom(struct gctl_req *req, c gctl_error(req, "%d %s '%s'", EINVAL, name, gname); return (EINVAL); } - if ((gp->flags & G_GEOM_WITHER) != 0) { - gctl_error(req, "%d %s", ENXIO, gname); - return (ENXIO); - } *v = gp; return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 12:52:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C0F9342; Thu, 26 Mar 2015 12: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 079F920C; Thu, 26 Mar 2015 12:52:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QCqL9w055381; Thu, 26 Mar 2015 12:52:21 GMT (envelope-from ru@FreeBSD.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QCqL6Y055380; Thu, 26 Mar 2015 12:52:21 GMT (envelope-from ru@FreeBSD.org) Message-Id: <201503261252.t2QCqL6Y055380@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ru set sender to ru@FreeBSD.org using -f From: Ruslan Ermilov Date: Thu, 26 Mar 2015 12:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280688 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 12:52:22 -0000 Author: ru Date: Thu Mar 26 12:52:21 2015 New Revision: 280688 URL: https://svnweb.freebsd.org/changeset/base/280688 Log: Corrected descriptions of net.inet.icmp.icmplim and icmplim_output. Reviewed by: pluknet Modified: head/share/man/man4/icmp.4 Modified: head/share/man/man4/icmp.4 ============================================================================== --- head/share/man/man4/icmp.4 Thu Mar 26 12:17:47 2015 (r280687) +++ head/share/man/man4/icmp.4 Thu Mar 26 12:52:21 2015 (r280688) @@ -28,7 +28,7 @@ .\" @(#)icmp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd September 30, 2014 +.Dd March 26, 2015 .Dt ICMP 4 .Os .Sh NAME @@ -177,13 +177,11 @@ Defaults to 0. .It Va icmplim .Pq Vt integer Bandwidth limit for ICMP replies in packets/second. -Used when -.Va icmplim_output -is non-zero. +If set to zero, no limiting will occur. Defaults to 200. .It Va icmplim_output .Pq Vt boolean -Enable/disable bandwidth limiting of ICMP replies. +Enable/disable logging of ICMP replies bandwidth limiting. Defaults to true. .It Va drop_redirect .Pq Vt boolean From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 12:58:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46F605BD; Thu, 26 Mar 2015 12:58: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 32CAC23E; Thu, 26 Mar 2015 12:58:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QCwUsD056335; Thu, 26 Mar 2015 12:58:30 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QCwUVj056334; Thu, 26 Mar 2015 12:58:30 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201503261258.t2QCwUVj056334@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 26 Mar 2015 12:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280689 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 12:58:31 -0000 Author: gjb Date: Thu Mar 26 12:58:30 2015 New Revision: 280689 URL: https://svnweb.freebsd.org/changeset/base/280689 Log: Remove duplicate AH_DEBUG_ALQ option. Sponsored by: The FreeBSD Foundation Modified: head/sys/mips/conf/AR91XX_BASE Modified: head/sys/mips/conf/AR91XX_BASE ============================================================================== --- head/sys/mips/conf/AR91XX_BASE Thu Mar 26 12:52:21 2015 (r280688) +++ head/sys/mips/conf/AR91XX_BASE Thu Mar 26 12:58:30 2015 (r280689) @@ -68,7 +68,6 @@ device ath_ahb # Atheros host bus glue options ATH_DEBUG options ATH_DIAGAPI option ATH_ENABLE_11N -option AH_DEBUG_ALQ # Don't bother compiling the whole HAL - AH_SUPPORT_AR9130 breaks the # rest of the 11n chipset support at the moment and the pre-AR5212 From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 13:22:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAAE2BBB; Thu, 26 Mar 2015 13:22:07 +0000 (UTC) Received: from mailrelay103.isp.belgacom.be (mailrelay103.isp.belgacom.be [195.238.20.130]) by mx1.freebsd.org (Postfix) with ESMTP id BBBF0751; Thu, 26 Mar 2015 13:22:06 +0000 (UTC) X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=ZT6Ny9SzQUL0U4sOn6xM6rLbT25dGdPOAe/imaXRw80= c=1 sm=2 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=Fbp1fs8650Vf3TmiwTgA:9 a=CjuIK1q_8ugA:10 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BTDgCkBhRV/8q28VFcgwaBLMsiAoFaTQEBAQEBAX1BAYNSAQEBAwEnExwREhALDgoJJQ8qHgYBEognDAHLBwEBAQEBAQEBAgEBAQEBARyLIYR2B4QtAQSaPoEcgzCHGIhJIoICHIFRPTGBAiSBHQEBAQ Received: from 202.182-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.182.202]) by relay.skynet.be with ESMTP; 26 Mar 2015 14:20:54 +0100 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 t2QDKqnX002451; Thu, 26 Mar 2015 14:20:53 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Thu, 26 Mar 2015 14:20:52 +0100 From: Tijl Coosemans To: Bruce Evans , Pedro Giffuni Subject: Re: svn commit: r280636 - head/include Message-ID: <20150326142052.6789dd50@kalimero.tijl.coosemans.org> In-Reply-To: <20150326170535.U2239@besplex.bde.org> References: <201503252153.t2PLrInc025854@svn.freebsd.org> <20150326130403.W993@besplex.bde.org> <551376D4.4030003@FreeBSD.org> <20150326170535.U2239@besplex.bde.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, gerald@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 13:22:08 -0000 On Thu, 26 Mar 2015 17:37:53 +1100 (EST) Bruce Evans wrote: > On Wed, 25 Mar 2015, Pedro Giffuni wrote: >> On 03/25/15 21:14, Bruce Evans wrote: >>> On Wed, 25 Mar 2015, Pedro F. Giffuni wrote: >>>> Log: >>>> Temporarily revert 280458. >>>> >>>> GCC is still carries an old version of cdefs.h which doesn't >>>> accept multiple parameters for the nonnull attribute. >>>> Since this issue probably affects many ports in the tree >>>> we will revert it for now until gcc gets fixed. >>> >>> Note that sys/cdefs.h is supposed to work with any version of >>> gcc back to gcc-1, and does mostly work back to at least gcc-2.95. >>> The whole point of sys/cdefs.h is to provide compatibity macros >>> for old and other non-default compilers. Standard compilers don't >>> even have __attribute__(()). So no changes in future versions >>> of gcc will fix the previous commit. >> >> cdefs.h still works for all versions of gcc back to gcc-1 AFAICT. > > I now remember other bugs in it. I think you put the varargs stuff > in the non-gcc version. That won't work compilers that don't support > varargs for macros. Neither will not changing the non-gcc version. > > glibc (2.6 at least) avoids using varargs in its __nonnull() macro > by using the same portable method that is used in many optional > debugging statements including FreeBSD's KASSERT(). (KASSERT() is > broken as designed. It never needed this since it wasn't implmented > until several years after C99 standardized varargs for macros.) > The macro takes a single arg consisting of a normal list of args > enclosed in parentheses. The extra parentheses are not passed to > the __attribute__() list. All invocations of the macro must be > ugly to supply the parantheses. The parentheses give a large > syntactic difference, so the ugliness cannot be fixed easily by > switching to varargs macros. For KASSERT(), there would be about > 7500 in /usr/src lines to clean up. For __nonnull(), there would > be only about lines 160 in /usr/src to change. Mostly > __nonnull(1) -> __nonnull((1)). But __nonnull() is more likely to > be (mis)used in ports. Maybe introduce a __nonnull_all macro and leave __nonnull varargs-free: #define __nonnull(x) __attribute__((__nonnull__(x))) #define __nonnull_all __attribute__((__nonnull__)) Then in the rare cases where multiple arguments must be nonnull but __nonnull_all doesn't apply you can use multiple __nonnull: int f(void *, void *, void *) __nonnull(1) __nonnull(2); >> The reason why I had to revert the change is actually a systematic >> bug in gcc: during it's build process gcc generates a new cdefs.h >> from our headers. Attempting to use an older gcc from ports >> that was build with the broken mono-parameter __nonnull() ended >> up causing breakage in any code using signal.h or pthreads.h. > > I see. gcc's "fixed" headers cause lots of problems. I've complained about this multiple times in the past. The gcc ports should not install these "fixed" headers. Pedro, by reverting this commit you only allow this problem to persist, so please reapply it. You also shouldn't wait weeks before applying the next commit. No amount of waiting is enough. There will always be users bitten by it. The problem is in the ports. It needs to be fixed there. If you receive any problem reports that are caused by this gcc problem, forward them to the gcc port maintainer. From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 13:31:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39C3AD93; Thu, 26 Mar 2015 13: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 254C17A2; Thu, 26 Mar 2015 13:31:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QDV4vn072959; Thu, 26 Mar 2015 13:31:04 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QDV4gs072958; Thu, 26 Mar 2015 13:31:04 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201503261331.t2QDV4gs072958@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Thu, 26 Mar 2015 13:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280690 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 13:31:05 -0000 Author: pluknet Date: Thu Mar 26 13:31:04 2015 New Revision: 280690 URL: https://svnweb.freebsd.org/changeset/base/280690 Log: Static'ize pf_fillup_fragment body to match its declaration. Missed in 278925. Modified: head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Thu Mar 26 12:58:30 2015 (r280689) +++ head/sys/netpfil/pf/pf_norm.c Thu Mar 26 13:31:04 2015 (r280690) @@ -386,7 +386,7 @@ pf_create_fragment(u_short *reason) return (frent); } -struct pf_fragment * +static struct pf_fragment * pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, u_short *reason) { From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 14:06:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8CCDB06 for ; Thu, 26 Mar 2015 14:06:00 +0000 (UTC) Received: from nm30-vm0.bullet.mail.bf1.yahoo.com (nm30-vm0.bullet.mail.bf1.yahoo.com [98.139.213.126]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CEF4CD4 for ; Thu, 26 Mar 2015 14:06:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1427378753; bh=fanq69AOzJQgyp7EJbEz1wdzbTRgFeU66Ath7UjgmuY=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=r3/quHvntN5r+XJdMctmZ2X48kCMoN1XbA0qYfpM8srZveVWjOjJ3dKTk4cDhTvzi1Sd8kIycLSw4y34po8Mb5siZj7nLQH8t3lrp1xL4Q5eBI/aCYDyRd3ZaGvgYnbOcby7HtZS+tsGqouHny2aiXTIbxonM/u8LaH2voGDbMCLm7ZCpTjdxYwQ2dkQpokPkUPEY1BP5lomkdDEC5yNGaO40BAag4zgH41AKjcjWD5U0Qcn8PlGo6XdsJd3dIcoap4CJa/JMs6cCsysyom0ewy40a2FKcnXoPwW/Ob8lizzuvcDpSJCRhzuqq4S/pxxoiicmsNchklugUTgEp+Scg== Received: from [98.139.170.178] by nm30.bullet.mail.bf1.yahoo.com with NNFMP; 26 Mar 2015 14:05:53 -0000 Received: from [98.139.211.202] by tm21.bullet.mail.bf1.yahoo.com with NNFMP; 26 Mar 2015 14:05:53 -0000 Received: from [127.0.0.1] by smtp211.mail.bf1.yahoo.com with NNFMP; 26 Mar 2015 14:05:53 -0000 X-Yahoo-Newman-Id: 998110.51619.bm@smtp211.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: i71NvMUVM1nzfRQypWgQ8i_w6_1FtjyenJPpmU8.kuJXc_Y P_PBJG5HJaPW9PHsUa4xWQvgnebHQStNY9qLoweyV7imVboH6TYX9DopV3ow 6NQ1CY1DepBBObK9GLBKpvnfRH0POJTV7Pn3AohAv.MJFGcxCUpOPFAiSg55 TRyaJWVzCRunWUvhz1GBPfTtkX3_89CSbWYKciSMC1pWDlOYiFV_3a15NvfV ljCb2NGEyWjnYTF51m121cmmUxmaJIPALEBJq2hySTw7Dr9605DngtLMU0r4 LxA4Vx8CDTeDVlBx18xcCB9Sa41aUte9Vaj72ZoxsolXYz2kaUYAlGTK_KA. Gd.M2Db1IfqTOQmpfuxWjs4NF83Ij0CxE7xvnwnecDjud1unok691D1kU4ld VvMTZs7F6HstHPaVwcUio4AffDecjWL25_RJRpTJ9u698QzG.XLjmuGvF3py 6z79crkXFQH6B75dwZ0m2OgCP3Ty3btGVFAMcDVueLJdKcmrP77oTUcyjRUC Hq_lvEh2b5TQMJJNh_SAMe9Ix1DxgaDYSSCpWs4RB1.t.v.Lgn5V1OTcBShy c1f4RWKwHoHSmBsTL9QuY9w8JnTw9iSyy39MyB3axXChX369e3GafYwvzm4b WsmhpxCFfr40- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <55141244.7030408@FreeBSD.org> Date: Thu, 26 Mar 2015 09:05:56 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r280636 - head/include References: <201503252153.t2PLrInc025854@svn.freebsd.org> <20150326130403.W993@besplex.bde.org> <551376D4.4030003@FreeBSD.org> <20150326170535.U2239@besplex.bde.org> In-Reply-To: <20150326170535.U2239@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-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-1 Precedence: list List-Id: SVN 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 Mar 2015 14:06:01 -0000 On 03/26/15 01:37, Bruce Evans wrote: > On Wed, 25 Mar 2015, Pedro Giffuni wrote: > >> On 03/25/15 21:14, Bruce Evans wrote: >>> On Wed, 25 Mar 2015, Pedro F. Giffuni wrote: >>> >>>> Log: >>>> Temporarily revert 280458. >>>> >>>> GCC is still carries an old version of cdefs.h which doesn't >>>> accept multiple parameters for the nonnull attribute. >>>> Since this issue probably affects many ports in the tree >>>> we will revert it for now until gcc gets fixed. >>> >>> Note that sys/cdefs.h is supposed to work with any version of >>> gcc back to gcc-1, and does mostly work back to at least gcc-2.95. >>> The whole point of sys/cdefs.h is to provide compatibity macros >>> for old and other non-default compilers. Standard compilers don't >>> even have __attribute__(()). So no changes in future versions >>> of gcc will fix the previous commit. >>> >> cdefs.h still works for all versions of gcc back to gcc-1 AFAICT. > > I now remember other bugs in it. I think you put the varargs stuff > in the non-gcc version. That won't work compilers that don't support > varargs for macros. Neither will not changing the non-gcc version. > According to the gcc documentation [1] "Variadic macros are a new feature in C99. GNU CPP has supported them for a long time, but only with a named variable argument (‘args...’, not ‘...’ and |__VA_ARGS__|). If you are concerned with portability to previous versions of GCC, you should use only named variable arguments. On the other hand, if you are concerned with portability to other conforming implementations of C99, you should use only |__VA_ARGS__|." I gave priority for C99 conformant compilers instead of older (which?) gcc versions. > glibc (2.6 at least) avoids using varargs in its __nonnull() macro > by using the same portable method that is used in many optional > debugging statements including FreeBSD's KASSERT(). I will take a look at KASSERT(), I normally avoid looking at glibc as it is likely to have GNUisms, and maybe even license issues. > (KASSERT() is > broken as designed. It never needed this since it wasn't implmented > until several years after C99 standardized varargs for macros.) > The macro takes a single arg consisting of a normal list of args > enclosed in parentheses. Hmm.. I think Android's Bionic libc does the same, it's really ugly. Thanks, Pedro. [1] https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 14:25:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FB56B30 for ; Thu, 26 Mar 2015 14:25:25 +0000 (UTC) Received: from nm31-vm6.bullet.mail.bf1.yahoo.com (nm31-vm6.bullet.mail.bf1.yahoo.com [72.30.239.14]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA5F5FC6 for ; Thu, 26 Mar 2015 14:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1427379587; bh=I1/8+vU7azXSOPWkj37nXHkSj7rGpyDnmIxzGFZYyLs=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=rioYwe9WloZS644vuwNbAOVph0amgv3cUtNVlsWGEDHwg73aP0V+QmXyBmQLMOuNJWzhTlgjWgEzjvSnnVIISEs4AgxUJTziff9N1abo/H3u6GVh1KtejVYmAVFYhuYqnGpJe8S5UZFWgmRH/58+xY+8aI2CVTujfnVPcKQr5N+AyBCl1NS2DIgEB2Fw/Dp5iToBlSOZfunn9bW5l9cV4eJzpgWgPmIrKaZWR3eYayMmFr33nqOAG/QFuQAyjnoxVwY5PxJoUtoYxFBpM7bgu+WM0MRo8oXHo6Xdc849AN6sJbimr/Gv7Jaoj8PRVa92bBH+e0hy+axWr2qbrIunRg== Received: from [98.139.170.181] by nm31.bullet.mail.bf1.yahoo.com with NNFMP; 26 Mar 2015 14:19:47 -0000 Received: from [98.139.211.201] by tm24.bullet.mail.bf1.yahoo.com with NNFMP; 26 Mar 2015 14:19:47 -0000 Received: from [127.0.0.1] by smtp210.mail.bf1.yahoo.com with NNFMP; 26 Mar 2015 14:19:47 -0000 X-Yahoo-Newman-Id: 206948.76965.bm@smtp210.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: glBnX_oVM1lEqEV9o.sQ6ZaKe3PKFCkg2cMp8SioFdK5Zbz lFKwhKcaZnaV7RNXW6YlLoGKnwWKm1PwKFGM3FK_94mP9fIMtFbhBffOl4Fs slBG166zyXg0r6zIgjWRRTGa8jM7_66Z.ZWEsKNDf2f_sJih0iJnu0zl2ehS tVcQaGT9NUf3r6Nb6XLsqwHuKOzGUK2uuVwYDH6HaCcZMuVchbItqeUEZYla Is5n1.FP1RS9xvkSgfPK0ArL4u3IaTlotB4Il76jnK1QDrSjHyzxSPccSM5r 7T3gCmyOzWiYaVeng_qbcktDTIp_aEIipjH0h3n9jo8zPA6QPLgeSMLnFzF2 1jthkw5YzR.46G.9MnSoxQbUtepuJUlJSc142_KOemYGRMMsquMKRYYeIo.9 ekO4CFxXodzydXUrVnEUJ3nNpfSGkGBss0rhEvPZjVu2uTl9iy0.GZUuKbnS MlIa_VsSpHMMxeY82H0qr.JYBqaQF4lVkvMjP3HieTJ9ZyT23bKi3KvdMNhS 28buJsYMbaepD0Cq3Klo94Y___Q-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <55141584.6030600@FreeBSD.org> Date: Thu, 26 Mar 2015 09:19:48 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Tijl Coosemans , Bruce Evans Subject: Re: svn commit: r280636 - head/include References: <201503252153.t2PLrInc025854@svn.freebsd.org> <20150326130403.W993@besplex.bde.org> <551376D4.4030003@FreeBSD.org> <20150326170535.U2239@besplex.bde.org> <20150326142052.6789dd50@kalimero.tijl.coosemans.org> In-Reply-To: <20150326142052.6789dd50@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, gerald@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 14:25:25 -0000 On 03/26/15 08:20, Tijl Coosemans wrote: > On Thu, 26 Mar 2015 17:37:53 +1100 (EST) Bruce Evans wrote: >> --- snip --- >> >> glibc (2.6 at least) avoids using varargs in its __nonnull() macro >> by using the same portable method that is used in many optional >> debugging statements including FreeBSD's KASSERT(). (KASSERT() is >> broken as designed. It never needed this since it wasn't implmented >> until several years after C99 standardized varargs for macros.) >> The macro takes a single arg consisting of a normal list of args >> enclosed in parentheses. The extra parentheses are not passed to >> the __attribute__() list. All invocations of the macro must be >> ugly to supply the parantheses. The parentheses give a large >> syntactic difference, so the ugliness cannot be fixed easily by >> switching to varargs macros. For KASSERT(), there would be about >> 7500 in /usr/src lines to clean up. For __nonnull(), there would >> be only about lines 160 in /usr/src to change. Mostly >> __nonnull(1) -> __nonnull((1)). But __nonnull() is more likely to >> be (mis)used in ports. > Maybe introduce a __nonnull_all macro and leave __nonnull varargs-free: > > #define __nonnull(x) __attribute__((__nonnull__(x))) > #define __nonnull_all __attribute__((__nonnull__)) > > Then in the rare cases where multiple arguments must be nonnull but > __nonnull_all doesn't apply you can use multiple __nonnull: > > int f(void *, void *, void *) __nonnull(1) __nonnull(2); > the __all extension takes more space than the extra parenthesis. I honestly see no reason to cope with pre-C99 compilers. The base compilers accept the standard varargs fine, for previous compilers we will ignore non standard varargs and use the null implementation. >>> The reason why I had to revert the change is actually a systematic >>> bug in gcc: during it's build process gcc generates a new cdefs.h >>> from our headers. Attempting to use an older gcc from ports >>> that was build with the broken mono-parameter __nonnull() ended >>> up causing breakage in any code using signal.h or pthreads.h. >> I see. gcc's "fixed" headers cause lots of problems. > I've complained about this multiple times in the past. The gcc ports > should not install these "fixed" headers. Yes it is a gcc bug. And I already forwarded the issue to the gcc maintainer. > Pedro, by reverting this commit you only allow this problem to persist, > so please reapply it. You also shouldn't wait weeks before applying > the next commit. No amount of waiting is enough. There will always be > users bitten by it. The problem is in the ports. It needs to be fixed > there. If you receive any problem reports that are caused by this gcc > problem, forward them to the gcc port maintainer. > There's no good reason not to be nice with our developers. I will update cdefs with a week anticipation and point them to update gcc after the header changes. I will MFC the cdefs updates but not the header changes. Pedro. From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 14:41:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB7231C0; Thu, 26 Mar 2015 14:41:43 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83F861A2; Thu, 26 Mar 2015 14:41:43 +0000 (UTC) Received: from coleburn.avinity.tv (host-229-161-243.77.avinity.tv [77.243.161.229]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id B4A4B5C48; Thu, 26 Mar 2015 15:41:36 +0100 (CET) Subject: Re: svn commit: r280636 - head/include Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_CFE69B44-2AD2-434E-A929-914F083897A9"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b6 From: Dimitry Andric In-Reply-To: <20150326142052.6789dd50@kalimero.tijl.coosemans.org> Date: Thu, 26 Mar 2015 15:41:26 +0100 Message-Id: <9AFF932D-77B3-4574-BC95-DDD3B95AC8A2@FreeBSD.org> References: <201503252153.t2PLrInc025854@svn.freebsd.org> <20150326130403.W993@besplex.bde.org> <551376D4.4030003@FreeBSD.org> <20150326170535.U2239@besplex.bde.org> <20150326142052.6789dd50@kalimero.tijl.coosemans.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.2070.6) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , Bruce Evans , svn-src-head@freebsd.org, gerald@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 14:41:43 -0000 --Apple-Mail=_CFE69B44-2AD2-434E-A929-914F083897A9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 26 Mar 2015, at 14:20, Tijl Coosemans wrote: >=20 > On Thu, 26 Mar 2015 17:37:53 +1100 (EST) Bruce Evans = wrote: >> On Wed, 25 Mar 2015, Pedro Giffuni wrote: ... >>> The reason why I had to revert the change is actually a systematic >>> bug in gcc: during it's build process gcc generates a new cdefs.h >>> from our headers. Attempting to use an older gcc from ports >>> that was build with the broken mono-parameter __nonnull() ended >>> up causing breakage in any code using signal.h or pthreads.h. >>=20 >> I see. gcc's "fixed" headers cause lots of problems. >=20 > I've complained about this multiple times in the past. The gcc ports > should not install these "fixed" headers. Indeed. See also this recent discussion on -current: = https://lists.freebsd.org/pipermail/freebsd-current/2015-March/055111.html= where a "fixed" stdio.h (from a gcc port) causes trouble. -Dimitry --Apple-Mail=_CFE69B44-2AD2-434E-A929-914F083897A9 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.27 iEYEARECAAYFAlUUGpsACgkQsF6jCi4glqMxqgCeIe+a0GyeYIPKtUx5PhdfE2BA lYAAnjMbDoOqZdWqohQKoMD+k/DpqnX1 =hyAN -----END PGP SIGNATURE----- --Apple-Mail=_CFE69B44-2AD2-434E-A929-914F083897A9-- From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 14:51:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6854627; Thu, 26 Mar 2015 14:51: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 B129D394; Thu, 26 Mar 2015 14:51:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QEpQXf013005; Thu, 26 Mar 2015 14:51:26 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QEpP1N013001; Thu, 26 Mar 2015 14:51:25 GMT (envelope-from br@FreeBSD.org) Message-Id: <201503261451.t2QEpP1N013001@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 26 Mar 2015 14:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280691 - in head/sys/mips: include 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-1 Precedence: list List-Id: SVN 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 Mar 2015 14:51:26 -0000 Author: br Date: Thu Mar 26 14:51:24 2015 New Revision: 280691 URL: https://svnweb.freebsd.org/changeset/base/280691 Log: Add 64 byte linesize cache flushing routines for L1 instruction, L1 data and L2 data caches. Sponsored by: HEIF5 Modified: head/sys/mips/include/cache_mipsNN.h head/sys/mips/include/cache_r4k.h head/sys/mips/mips/cache.c head/sys/mips/mips/cache_mipsNN.c Modified: head/sys/mips/include/cache_mipsNN.h ============================================================================== --- head/sys/mips/include/cache_mipsNN.h Thu Mar 26 13:31:04 2015 (r280690) +++ head/sys/mips/include/cache_mipsNN.h Thu Mar 26 14:51:24 2015 (r280691) @@ -43,37 +43,50 @@ void mipsNN_cache_init(struct mips_cpuin void mipsNN_icache_sync_all_16(void); void mipsNN_icache_sync_all_32(void); +void mipsNN_icache_sync_all_64(void); +void mipsNN_icache_sync_all_128(void); void mipsNN_icache_sync_range_16(vm_offset_t, vm_size_t); void mipsNN_icache_sync_range_32(vm_offset_t, vm_size_t); +void mipsNN_icache_sync_range_64(vm_offset_t, vm_size_t); +void mipsNN_icache_sync_range_128(vm_offset_t, vm_size_t); void mipsNN_icache_sync_range_index_16(vm_offset_t, vm_size_t); void mipsNN_icache_sync_range_index_32(vm_offset_t, vm_size_t); +void mipsNN_icache_sync_range_index_64(vm_offset_t, vm_size_t); +void mipsNN_icache_sync_range_index_128(vm_offset_t, vm_size_t); void mipsNN_pdcache_wbinv_all_16(void); void mipsNN_pdcache_wbinv_all_32(void); +void mipsNN_pdcache_wbinv_all_64(void); +void mipsNN_pdcache_wbinv_all_128(void); void mipsNN_pdcache_wbinv_range_16(vm_offset_t, vm_size_t); void mipsNN_pdcache_wbinv_range_32(vm_offset_t, vm_size_t); +void mipsNN_pdcache_wbinv_range_64(vm_offset_t, vm_size_t); +void mipsNN_pdcache_wbinv_range_128(vm_offset_t, vm_size_t); void mipsNN_pdcache_wbinv_range_index_16(vm_offset_t, vm_size_t); void mipsNN_pdcache_wbinv_range_index_32(vm_offset_t, vm_size_t); +void mipsNN_pdcache_wbinv_range_index_64(vm_offset_t, vm_size_t); +void mipsNN_pdcache_wbinv_range_index_128(vm_offset_t, vm_size_t); void mipsNN_pdcache_inv_range_16(vm_offset_t, vm_size_t); void mipsNN_pdcache_inv_range_32(vm_offset_t, vm_size_t); +void mipsNN_pdcache_inv_range_64(vm_offset_t, vm_size_t); +void mipsNN_pdcache_inv_range_128(vm_offset_t, vm_size_t); void mipsNN_pdcache_wb_range_16(vm_offset_t, vm_size_t); void mipsNN_pdcache_wb_range_32(vm_offset_t, vm_size_t); -void mipsNN_icache_sync_all_128(void); -void mipsNN_icache_sync_range_128(vm_offset_t, vm_size_t); -void mipsNN_icache_sync_range_index_128(vm_offset_t, vm_size_t); -void mipsNN_pdcache_wbinv_all_128(void); -void mipsNN_pdcache_wbinv_range_128(vm_offset_t, vm_size_t); -void mipsNN_pdcache_wbinv_range_index_128(vm_offset_t, vm_size_t); -void mipsNN_pdcache_inv_range_128(vm_offset_t, vm_size_t); +void mipsNN_pdcache_wb_range_64(vm_offset_t, vm_size_t); void mipsNN_pdcache_wb_range_128(vm_offset_t, vm_size_t); void mipsNN_sdcache_wbinv_all_32(void); -void mipsNN_sdcache_wbinv_range_32(vm_offset_t, vm_size_t); -void mipsNN_sdcache_wbinv_range_index_32(vm_offset_t, vm_size_t); -void mipsNN_sdcache_inv_range_32(vm_offset_t, vm_size_t); -void mipsNN_sdcache_wb_range_32(vm_offset_t, vm_size_t); +void mipsNN_sdcache_wbinv_all_64(void); void mipsNN_sdcache_wbinv_all_128(void); +void mipsNN_sdcache_wbinv_range_32(vm_offset_t, vm_size_t); +void mipsNN_sdcache_wbinv_range_64(vm_offset_t, vm_size_t); void mipsNN_sdcache_wbinv_range_128(vm_offset_t, vm_size_t); +void mipsNN_sdcache_wbinv_range_index_32(vm_offset_t, vm_size_t); +void mipsNN_sdcache_wbinv_range_index_64(vm_offset_t, vm_size_t); void mipsNN_sdcache_wbinv_range_index_128(vm_offset_t, vm_size_t); +void mipsNN_sdcache_inv_range_32(vm_offset_t, vm_size_t); +void mipsNN_sdcache_inv_range_64(vm_offset_t, vm_size_t); void mipsNN_sdcache_inv_range_128(vm_offset_t, vm_size_t); +void mipsNN_sdcache_wb_range_32(vm_offset_t, vm_size_t); +void mipsNN_sdcache_wb_range_64(vm_offset_t, vm_size_t); void mipsNN_sdcache_wb_range_128(vm_offset_t, vm_size_t); #endif /* _MACHINE_CACHE_MIPSNN_H_ */ Modified: head/sys/mips/include/cache_r4k.h ============================================================================== --- head/sys/mips/include/cache_r4k.h Thu Mar 26 13:31:04 2015 (r280690) +++ head/sys/mips/include/cache_r4k.h Thu Mar 26 14:51:24 2015 (r280691) @@ -114,6 +114,25 @@ do { \ } while (/*CONSTCOND*/0) /* + * cache_r4k_op_8lines_64: + * + * Perform the specified cache operation on 8 64-byte cache lines. + */ +#define cache_r4k_op_8lines_64(va, op) \ +do { \ + __asm __volatile( \ + ".set noreorder \n\t" \ + "cache %1, 0x000(%0); cache %1, 0x040(%0) \n\t" \ + "cache %1, 0x080(%0); cache %1, 0x0c0(%0) \n\t" \ + "cache %1, 0x100(%0); cache %1, 0x140(%0) \n\t" \ + "cache %1, 0x180(%0); cache %1, 0x1c0(%0) \n\t" \ + ".set reorder" \ + : \ + : "r" (va), "i" (op) \ + : "memory"); \ +} while (/*CONSTCOND*/0) + +/* * cache_r4k_op_32lines_16: * * Perform the specified cache operation on 32 16-byte @@ -178,6 +197,38 @@ do { \ } while (/*CONSTCOND*/0) /* + * cache_r4k_op_32lines_64: + * + * Perform the specified cache operation on 32 64-byte + * cache lines. + */ +#define cache_r4k_op_32lines_64(va, op) \ +do { \ + __asm __volatile( \ + ".set noreorder \n\t" \ + "cache %1, 0x000(%0); cache %1, 0x040(%0); \n\t" \ + "cache %1, 0x080(%0); cache %1, 0x0c0(%0); \n\t" \ + "cache %1, 0x100(%0); cache %1, 0x140(%0); \n\t" \ + "cache %1, 0x180(%0); cache %1, 0x1c0(%0); \n\t" \ + "cache %1, 0x200(%0); cache %1, 0x240(%0); \n\t" \ + "cache %1, 0x280(%0); cache %1, 0x2c0(%0); \n\t" \ + "cache %1, 0x300(%0); cache %1, 0x340(%0); \n\t" \ + "cache %1, 0x380(%0); cache %1, 0x3c0(%0); \n\t" \ + "cache %1, 0x400(%0); cache %1, 0x440(%0); \n\t" \ + "cache %1, 0x480(%0); cache %1, 0x4c0(%0); \n\t" \ + "cache %1, 0x500(%0); cache %1, 0x540(%0); \n\t" \ + "cache %1, 0x580(%0); cache %1, 0x5c0(%0); \n\t" \ + "cache %1, 0x600(%0); cache %1, 0x640(%0); \n\t" \ + "cache %1, 0x680(%0); cache %1, 0x6c0(%0); \n\t" \ + "cache %1, 0x700(%0); cache %1, 0x740(%0); \n\t" \ + "cache %1, 0x780(%0); cache %1, 0x7c0(%0); \n\t" \ + ".set reorder" \ + : \ + : "r" (va), "i" (op) \ + : "memory"); \ +} while (/*CONSTCOND*/0) + +/* * cache_r4k_op_32lines_128: * * Perform the specified cache operation on 32 128-byte Modified: head/sys/mips/mips/cache.c ============================================================================== --- head/sys/mips/mips/cache.c Thu Mar 26 13:31:04 2015 (r280690) +++ head/sys/mips/mips/cache.c Thu Mar 26 14:51:24 2015 (r280691) @@ -104,6 +104,13 @@ mips_config_cache(struct mips_cpuinfo * mips_cache_ops.mco_icache_sync_range_index = mipsNN_icache_sync_range_index_32; break; + case 64: + mips_cache_ops.mco_icache_sync_all = mipsNN_icache_sync_all_64; + mips_cache_ops.mco_icache_sync_range = + mipsNN_icache_sync_range_64; + mips_cache_ops.mco_icache_sync_range_index = + mipsNN_icache_sync_range_index_64; + break; case 128: mips_cache_ops.mco_icache_sync_all = mipsNN_icache_sync_all_128; mips_cache_ops.mco_icache_sync_range = @@ -170,6 +177,21 @@ mips_config_cache(struct mips_cpuinfo * mipsNN_pdcache_wb_range_32; #endif break; + case 64: + mips_cache_ops.mco_pdcache_wbinv_all = + mips_cache_ops.mco_intern_pdcache_wbinv_all = + mipsNN_pdcache_wbinv_all_64; + mips_cache_ops.mco_pdcache_wbinv_range = + mipsNN_pdcache_wbinv_range_64; + mips_cache_ops.mco_pdcache_wbinv_range_index = + mips_cache_ops.mco_intern_pdcache_wbinv_range_index = + mipsNN_pdcache_wbinv_range_index_64; + mips_cache_ops.mco_pdcache_inv_range = + mipsNN_pdcache_inv_range_64; + mips_cache_ops.mco_pdcache_wb_range = + mips_cache_ops.mco_intern_pdcache_wb_range = + mipsNN_pdcache_wb_range_64; + break; case 128: mips_cache_ops.mco_pdcache_wbinv_all = mips_cache_ops.mco_intern_pdcache_wbinv_all = @@ -275,6 +297,18 @@ mips_config_cache(struct mips_cpuinfo * mips_cache_ops.mco_sdcache_wb_range = mipsNN_sdcache_wb_range_32; break; + case 64: + mips_cache_ops.mco_sdcache_wbinv_all = + mipsNN_sdcache_wbinv_all_64; + mips_cache_ops.mco_sdcache_wbinv_range = + mipsNN_sdcache_wbinv_range_64; + mips_cache_ops.mco_sdcache_wbinv_range_index = + mipsNN_sdcache_wbinv_range_index_64; + mips_cache_ops.mco_sdcache_inv_range = + mipsNN_sdcache_inv_range_64; + mips_cache_ops.mco_sdcache_wb_range = + mipsNN_sdcache_wb_range_64; + break; case 128: mips_cache_ops.mco_sdcache_wbinv_all = mipsNN_sdcache_wbinv_all_128; Modified: head/sys/mips/mips/cache_mipsNN.c ============================================================================== --- head/sys/mips/mips/cache_mipsNN.c Thu Mar 26 13:31:04 2015 (r280690) +++ head/sys/mips/mips/cache_mipsNN.c Thu Mar 26 14:51:24 2015 (r280691) @@ -52,6 +52,9 @@ __FBSDID("$FreeBSD$"); #define round_line32(x) (((x) + 31) & ~31) #define trunc_line32(x) ((x) & ~31) +#define round_line64(x) (((x) + 63) & ~63) +#define trunc_line64(x) ((x) & ~63) + #define round_line128(x) (((x) + 127) & ~127) #define trunc_line128(x) ((x) & ~127) @@ -213,6 +216,29 @@ mipsNN_icache_sync_all_32(void) } void +mipsNN_icache_sync_all_64(void) +{ + vm_offset_t va, eva; + + va = MIPS_PHYS_TO_KSEG0(0); + eva = va + picache_size; + + /* + * Since we're hitting the whole thing, we don't have to + * worry about the N different "ways". + */ + + mips_intern_dcache_wbinv_all(); + + while (va < eva) { + cache_r4k_op_32lines_64(va, CACHE_R4K_I|CACHEOP_R4K_INDEX_INV); + va += (32 * 64); + } + + SYNC; +} + +void mipsNN_icache_sync_range_16(vm_offset_t va, vm_size_t size) { vm_offset_t eva; @@ -259,6 +285,29 @@ mipsNN_icache_sync_range_32(vm_offset_t } void +mipsNN_icache_sync_range_64(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva; + + eva = round_line64(va + size); + va = trunc_line64(va); + + mips_intern_dcache_wb_range(va, (eva - va)); + + while ((eva - va) >= (32 * 64)) { + cache_r4k_op_32lines_64(va, CACHE_R4K_I|CACHEOP_R4K_HIT_INV); + va += (32 * 64); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_I|CACHEOP_R4K_HIT_INV); + va += 64; + } + + SYNC; +} + +void mipsNN_icache_sync_range_index_16(vm_offset_t va, vm_size_t size) { vm_offset_t eva, tmpva; @@ -345,6 +394,49 @@ mipsNN_icache_sync_range_index_32(vm_off } void +mipsNN_icache_sync_range_index_64(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva, tmpva; + int i, stride, loopcount; + + /* + * Since we're doing Index ops, we expect to not be able + * to access the address we've been given. So, get the + * bits that determine the cache index, and make a KSEG0 + * address out of them. + */ + va = MIPS_PHYS_TO_KSEG0(va & picache_way_mask); + + eva = round_line64(va + size); + va = trunc_line64(va); + + /* + * GCC generates better code in the loops if we reference local + * copies of these global variables. + */ + stride = picache_stride; + loopcount = picache_loopcount; + + mips_intern_dcache_wbinv_range_index(va, (eva - va)); + + while ((eva - va) >= (8 * 64)) { + tmpva = va; + for (i = 0; i < loopcount; i++, tmpva += stride) + cache_r4k_op_8lines_64(tmpva, + CACHE_R4K_I|CACHEOP_R4K_INDEX_INV); + va += 8 * 64; + } + + while (va < eva) { + tmpva = va; + for (i = 0; i < loopcount; i++, tmpva += stride) + cache_op_r4k_line(tmpva, + CACHE_R4K_I|CACHEOP_R4K_INDEX_INV); + va += 64; + } +} + +void mipsNN_pdcache_wbinv_all_16(void) { vm_offset_t va, eva; @@ -389,6 +481,28 @@ mipsNN_pdcache_wbinv_all_32(void) } void +mipsNN_pdcache_wbinv_all_64(void) +{ + vm_offset_t va, eva; + + va = MIPS_PHYS_TO_KSEG0(0); + eva = va + pdcache_size; + + /* + * Since we're hitting the whole thing, we don't have to + * worry about the N different "ways". + */ + + while (va < eva) { + cache_r4k_op_32lines_64(va, + CACHE_R4K_D|CACHEOP_R4K_INDEX_WB_INV); + va += (32 * 64); + } + + SYNC; +} + +void mipsNN_pdcache_wbinv_range_16(vm_offset_t va, vm_size_t size) { vm_offset_t eva; @@ -433,6 +547,28 @@ mipsNN_pdcache_wbinv_range_32(vm_offset_ } void +mipsNN_pdcache_wbinv_range_64(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva; + + eva = round_line64(va + size); + va = trunc_line64(va); + + while ((eva - va) >= (32 * 64)) { + cache_r4k_op_32lines_64(va, + CACHE_R4K_D|CACHEOP_R4K_HIT_WB_INV); + va += (32 * 64); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_D|CACHEOP_R4K_HIT_WB_INV); + va += 64; + } + + SYNC; +} + +void mipsNN_pdcache_wbinv_range_index_16(vm_offset_t va, vm_size_t size) { vm_offset_t eva, tmpva; @@ -513,6 +649,47 @@ mipsNN_pdcache_wbinv_range_index_32(vm_o va += 32; } } + +void +mipsNN_pdcache_wbinv_range_index_64(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva, tmpva; + int i, stride, loopcount; + + /* + * Since we're doing Index ops, we expect to not be able + * to access the address we've been given. So, get the + * bits that determine the cache index, and make a KSEG0 + * address out of them. + */ + va = MIPS_PHYS_TO_KSEG0(va & pdcache_way_mask); + + eva = round_line64(va + size); + va = trunc_line64(va); + + /* + * GCC generates better code in the loops if we reference local + * copies of these global variables. + */ + stride = pdcache_stride; + loopcount = pdcache_loopcount; + + while ((eva - va) >= (8 * 64)) { + tmpva = va; + for (i = 0; i < loopcount; i++, tmpva += stride) + cache_r4k_op_8lines_64(tmpva, + CACHE_R4K_D|CACHEOP_R4K_INDEX_WB_INV); + va += 8 * 64; + } + + while (va < eva) { + tmpva = va; + for (i = 0; i < loopcount; i++, tmpva += stride) + cache_op_r4k_line(tmpva, + CACHE_R4K_D|CACHEOP_R4K_INDEX_WB_INV); + va += 64; + } +} void mipsNN_pdcache_inv_range_16(vm_offset_t va, vm_size_t size) @@ -557,6 +734,27 @@ mipsNN_pdcache_inv_range_32(vm_offset_t } void +mipsNN_pdcache_inv_range_64(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva; + + eva = round_line64(va + size); + va = trunc_line64(va); + + while ((eva - va) >= (32 * 64)) { + cache_r4k_op_32lines_64(va, CACHE_R4K_D|CACHEOP_R4K_HIT_INV); + va += (32 * 64); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_D|CACHEOP_R4K_HIT_INV); + va += 64; + } + + SYNC; +} + +void mipsNN_pdcache_wb_range_16(vm_offset_t va, vm_size_t size) { vm_offset_t eva; @@ -598,6 +796,26 @@ mipsNN_pdcache_wb_range_32(vm_offset_t v SYNC; } +void +mipsNN_pdcache_wb_range_64(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva; + + eva = round_line64(va + size); + va = trunc_line64(va); + + while ((eva - va) >= (32 * 64)) { + cache_r4k_op_32lines_64(va, CACHE_R4K_D|CACHEOP_R4K_HIT_WB); + va += (32 * 64); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_D|CACHEOP_R4K_HIT_WB); + va += 64; + } + + SYNC; +} #ifdef CPU_CNMIPS @@ -882,6 +1100,19 @@ mipsNN_sdcache_wbinv_all_32(void) } void +mipsNN_sdcache_wbinv_all_64(void) +{ + vm_offset_t va = MIPS_PHYS_TO_KSEG0(0); + vm_offset_t eva = va + sdcache_size; + + while (va < eva) { + cache_r4k_op_32lines_64(va, + CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); + va += (32 * 64); + } +} + +void mipsNN_sdcache_wbinv_range_32(vm_offset_t va, vm_size_t size) { vm_offset_t eva = round_line32(va + size); @@ -901,6 +1132,25 @@ mipsNN_sdcache_wbinv_range_32(vm_offset_ } void +mipsNN_sdcache_wbinv_range_64(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva = round_line64(va + size); + + va = trunc_line64(va); + + while ((eva - va) >= (32 * 64)) { + cache_r4k_op_32lines_64(va, + CACHE_R4K_SD|CACHEOP_R4K_HIT_WB_INV); + va += (32 * 64); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB_INV); + va += 64; + } +} + +void mipsNN_sdcache_wbinv_range_index_32(vm_offset_t va, vm_size_t size) { vm_offset_t eva; @@ -929,6 +1179,34 @@ mipsNN_sdcache_wbinv_range_index_32(vm_o } void +mipsNN_sdcache_wbinv_range_index_64(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva; + + /* + * Since we're doing Index ops, we expect to not be able + * to access the address we've been given. So, get the + * bits that determine the cache index, and make a KSEG0 + * address out of them. + */ + va = MIPS_PHYS_TO_KSEG0(va & (sdcache_size - 1)); + + eva = round_line64(va + size); + va = trunc_line64(va); + + while ((eva - va) >= (32 * 64)) { + cache_r4k_op_32lines_64(va, + CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); + va += (32 * 64); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); + va += 64; + } +} + +void mipsNN_sdcache_inv_range_32(vm_offset_t va, vm_size_t size) { vm_offset_t eva = round_line32(va + size); @@ -947,6 +1225,24 @@ mipsNN_sdcache_inv_range_32(vm_offset_t } void +mipsNN_sdcache_inv_range_64(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva = round_line64(va + size); + + va = trunc_line64(va); + + while ((eva - va) >= (32 * 64)) { + cache_r4k_op_32lines_64(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_INV); + va += (32 * 64); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_INV); + va += 64; + } +} + +void mipsNN_sdcache_wb_range_32(vm_offset_t va, vm_size_t size) { vm_offset_t eva = round_line32(va + size); @@ -965,6 +1261,24 @@ mipsNN_sdcache_wb_range_32(vm_offset_t v } void +mipsNN_sdcache_wb_range_64(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva = round_line64(va + size); + + va = trunc_line64(va); + + while ((eva - va) >= (32 * 64)) { + cache_r4k_op_32lines_64(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB); + va += (32 * 64); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB); + va += 64; + } +} + +void mipsNN_sdcache_wbinv_all_128(void) { vm_offset_t va = MIPS_PHYS_TO_KSEG0(0); From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 14:55:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 976FC8BB; Thu, 26 Mar 2015 14: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 68F313DF; Thu, 26 Mar 2015 14:55:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QEtNBb014730; Thu, 26 Mar 2015 14:55:23 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QEtNqv014729; Thu, 26 Mar 2015 14:55:23 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201503261455.t2QEtNqv014729@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 26 Mar 2015 14:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280692 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 14:55:23 -0000 Author: jhibbits Date: Thu Mar 26 14:55:22 2015 New Revision: 280692 URL: https://svnweb.freebsd.org/changeset/base/280692 Log: Make several modules unconditionally built, there's no need for them to be hidden. These modules pass a tinderbox build. Discussed with: ian and others MFC after: 1 month Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Mar 26 14:51:24 2015 (r280691) +++ head/sys/modules/Makefile Thu Mar 26 14:55:22 2015 (r280692) @@ -108,7 +108,7 @@ SUBDIR= \ ${_et} \ ${_ex} \ ${_exca} \ - ${_ext2fs} \ + ext2fs \ ${_fatm} \ fdc \ fdescfs \ @@ -132,7 +132,7 @@ SUBDIR= \ ${_hptrr} \ hwpmc \ ${_hyperv} \ - ${_i2c} \ + i2c \ ${_ibcore} \ ${_ibcs2} \ ${_ichwd} \ @@ -315,11 +315,11 @@ SUBDIR= \ siis \ sis \ sk \ - ${_smbfs} \ + smbfs \ sn \ ${_snc} \ snp \ - ${_sound} \ + sound \ ${_speaker} \ ${_splash} \ ${_sppp} \ @@ -498,10 +498,8 @@ _em= em _ep= ep _et= et _exca= exca -_ext2fs= ext2fs _fe= fe _filemon= filemon -_i2c= i2c .if ${MK_OFED} != "no" || defined(ALL_MODULES) _ibcore= ibcore .endif @@ -530,8 +528,6 @@ _rdma= rdma _safe= safe _scsi_low= scsi_low _si= si -_smbfs= smbfs -_sound= sound _speaker= speaker _splash= splash _sppp= sppp @@ -688,7 +684,6 @@ _snc= snc .if ${MACHINE_CPUARCH} == "arm" _cfi= cfi _cpsw= cpsw -_sound= sound .endif .if ${MACHINE_CPUARCH} == "powerpc" @@ -709,14 +704,11 @@ _nvram= powermac_nvram _opensolaris= opensolaris .endif _pccard= pccard -_smbfs= smbfs -_sound= sound _wi= wi .endif .if ${MACHINE_ARCH} == "powerpc64" _drm2= drm2 -_i2c= i2c .if ${MK_ZFS} != "no" || defined(ALL_MODULES) _zfs= zfs .endif @@ -726,13 +718,10 @@ _zfs= zfs _auxio= auxio _em= em _epic= epic -_i2c= i2c _igb= igb .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _opensolaris= opensolaris .endif -_smbfs= smbfs -_sound= sound .if ${MK_ZFS} != "no" || defined(ALL_MODULES) _zfs= zfs .endif From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 15:27:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16DC05A5; Thu, 26 Mar 2015 15: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 02D049C5; Thu, 26 Mar 2015 15:27:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QFRdcU029241; Thu, 26 Mar 2015 15:27:39 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QFRdCC029240; Thu, 26 Mar 2015 15:27:39 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201503261527.t2QFRdCC029240@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 26 Mar 2015 15:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280696 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:27:40 -0000 Author: kp Date: Thu Mar 26 15:27:38 2015 New Revision: 280696 URL: https://svnweb.freebsd.org/changeset/base/280696 Log: Add myself (kp) to committers-src.dot Approved by: philip (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Mar 26 15:25:01 2015 (r280695) +++ head/share/misc/committers-src.dot Thu Mar 26 15:27:38 2015 (r280696) @@ -211,6 +211,7 @@ kensmith [label="Ken Smith\nkensmith@Fre kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2006/07/23"] kib [label="Konstantin Belousov\nkib@FreeBSD.org\n2006/06/03"] kmacy [label="Kip Macy\nkmacy@FreeBSD.org\n2005/06/01"] +kp [label="Kristof Provost\nkp@FreeBSD.org\n2015/03/22"] le [label="Lukas Ertl\nle@FreeBSD.org\n2004/02/02"] loos [label="Luiz Otavio O Souza\nloos@FreeBSD.org\n2013/07/03"] lstewart [label="Lawrence Stewart\nlstewart@FreeBSD.org\n2008/10/06"] @@ -446,6 +447,7 @@ gnn -> np gnn -> davide gnn -> arybchik gnn -> erj +gnn -> kp grehan -> bryanv @@ -624,6 +626,7 @@ philip -> ed philip -> jls philip -> matteo philip -> uqs +philip -> kp phk -> jkoshy phk -> mux From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 15:40:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 095E7BD3; Thu, 26 Mar 2015 15:40: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 E8462BAF; Thu, 26 Mar 2015 15:40:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QFenfV037705; Thu, 26 Mar 2015 15:40:49 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QFem4u037702; Thu, 26 Mar 2015 15:40:48 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201503261540.t2QFem4u037702@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 26 Mar 2015 15:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280697 - head/usr.sbin/pmcstudy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 15:40:50 -0000 Author: rrs Date: Thu Mar 26 15:40:47 2015 New Revision: 280697 URL: https://svnweb.freebsd.org/changeset/base/280697 Log: Update the manual page to be a bit more sane. It still may need some work, but at least now it will read properly. (gnn you are still on the hook to help out with this like you committed). Sponsored by: Netflix. Added: head/usr.sbin/pmcstudy/pmcstudy.8 (contents, props changed) Deleted: head/usr.sbin/pmcstudy/pmcstudy.1 Modified: head/usr.sbin/pmcstudy/Makefile head/usr.sbin/pmcstudy/pmcstudy.c Modified: head/usr.sbin/pmcstudy/Makefile ============================================================================== --- head/usr.sbin/pmcstudy/Makefile Thu Mar 26 15:27:38 2015 (r280696) +++ head/usr.sbin/pmcstudy/Makefile Thu Mar 26 15:40:47 2015 (r280697) @@ -2,6 +2,7 @@ # $FreeBSD$ PROG= pmcstudy +MAN= pmcstudy.8 SRCS= pmcstudy.c eval_expr.c CFLAGS+= -Wall -Werror Added: head/usr.sbin/pmcstudy/pmcstudy.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pmcstudy/pmcstudy.8 Thu Mar 26 15:40:47 2015 (r280697) @@ -0,0 +1,131 @@ +.\" Copyright (c) 2015 +.\" Netflix 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 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 Mar 26, 2015 +.Dt PMCSTUDY 1 +.Os +.Sh NAME +.Nm pmcstudy +.Nd Perform various study's on a systems overall PMC's. +.Sh SYNOPSIS +.Nm +.Oo Fl i Ar inputfile | Fl T | Fl v | Fl m Ar max | Fl e exp | Fl Ar E | Fl h | fl H Oc +.Nm +.Fl i Ar inputfile +.Nm +.Fl v +.Nm +.Fl m Ar max +.Nm +.Fl e Ar exp-name +.Nm +.Fl E Ar your-expr +.Nm +.Fl h +.Nm +.Fl H +.Nm +.Fl T +.Sh DESCRIPTION +The +.Nm +program is designed to run various tests against your systems +performance. There are roughly 20-22 canned tests that setup specific +PMC's and then run various formulas on the output information. +These formulas can be found in Intel documentation "Using Intel Vtune +amplifier xe on NNN Generation Intel Core Processors". The NNN is either +2nd, 3rd or 4th generation i.e. Sandy Bridge, Ivy Bridge and Haswell. +Currently the program only works on these three Intel processor types. +.Sh OPTIONS +The following options are available: +.Bl -tag -width indent +.It Fl i Ar filename +If this option is supplied, instead of running a +.Xr pmcstat 8 +command to collecte the current running information the filename will be read +in as input instead. +.It Fl H +This option will display the complete list of canned formulas that can be run including +there names which can be input to the +.Fl e +option. +.It Fl e Ar name +Execute the canned test +.Ar name +on the running kernel. +.It Fl h +If you add this option to the +.Fl e +option the test will not execute but instead give you a small description +of the test that would run. +.It Fl T +This option will execute a test of every PMC to validate that they are working +on your system. If a PMC does not show up in this test chances +are the kernel hwpmc driver needs updating with new PMC information. +.It Fl m Ar num +This option can restrict the number of one second samples that will +be collected by your system when running a test (it bounds the +time the test will run). Without this option the test will run +for 1024 seconds or until the user types ctrl-c. +.It Fl v +The verbose option adds debugging output to the command. +.It Fl E Ar expression +This option can be used by those that have there own ideas +on what formulas that you want to run. The expression given to +the +.Fl E +option is a "formula". The formula can declare directly the PMC's by name +or you can use an abbreviation %NNN. To find out the abbreviations +on your system you may run the +.Fl L +option. +An example of a formula of your own might be +.Fl E +"FP_ASSIST.ANY / INST_RETIRED.ANY_P" or using the abbreviations on a +Haswell machine you would type +.Fl E +" %176 / %150". You must have spaces between each entry and +you may use paraenthisis to prioritize the operators. Add (+), Subtract (-), +Divide (/) and Multiplication (*) are supported. You may also introduce +constant numbers as well. So for example you can do a standard efficency +test like +.FL E +"UOPS_RETIRED.RETIRE_SLOTS / (4 * CPU_CLK_UNHALTED.THREAD_P)". + +.It Fl L +This option will list all known PMC's and there abbreviation (%NNN). +.Sh SEE ALSO +.Xr pmc 3 , +.Xr pmclog 3 , +.Xr hwpmc 4 , +.Xr pmcstat 8 , +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 11.0. +.Sh AUTHORS +.An Randall Stewart Aq Mt rrs@FreeBSD.org Modified: head/usr.sbin/pmcstudy/pmcstudy.c ============================================================================== --- head/usr.sbin/pmcstudy/pmcstudy.c Thu Mar 26 15:27:38 2015 (r280696) +++ head/usr.sbin/pmcstudy/pmcstudy.c Thu Mar 26 15:40:47 2015 (r280697) @@ -2139,7 +2139,11 @@ test_for_a_pmc(const char *pmc, int out_ printf(" "); } } - printf("%s", &line[j]); + if (len) { + printf("%s", &line[j]); + } else { + printf("\n"); + } goto out; } } From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 15:43:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E100ADC0; Thu, 26 Mar 2015 15: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 CC9E3C87; Thu, 26 Mar 2015 15:43:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QFhwAY038104; Thu, 26 Mar 2015 15:43:58 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QFhwpT038102; Thu, 26 Mar 2015 15:43:58 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201503261543.t2QFhwpT038102@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 26 Mar 2015 15:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280698 - head/usr.sbin/pmcstudy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 15:43:59 -0000 Author: rrs Date: Thu Mar 26 15:43:57 2015 New Revision: 280698 URL: https://svnweb.freebsd.org/changeset/base/280698 Log: Opps its section 8 not 1 silly. MFC after: 3 days Sponsored by: Netflix Modified: head/usr.sbin/pmcstudy/pmcstudy.8 Modified: head/usr.sbin/pmcstudy/pmcstudy.8 ============================================================================== --- head/usr.sbin/pmcstudy/pmcstudy.8 Thu Mar 26 15:40:47 2015 (r280697) +++ head/usr.sbin/pmcstudy/pmcstudy.8 Thu Mar 26 15:43:57 2015 (r280698) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd Mar 26, 2015 -.Dt PMCSTUDY 1 +.Dt PMCSTUDY 8 .Os .Sh NAME .Nm pmcstudy From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 15:54:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2564030D; Thu, 26 Mar 2015 15: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 064E3DBD; Thu, 26 Mar 2015 15:54:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QFstd7043095; Thu, 26 Mar 2015 15:54:55 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QFstDh043094; Thu, 26 Mar 2015 15:54:55 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201503261554.t2QFstDh043094@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Thu, 26 Mar 2015 15:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280699 - head/usr.sbin/pmcstudy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 15:54:56 -0000 Author: brueffer Date: Thu Mar 26 15:54:54 2015 New Revision: 280699 URL: https://svnweb.freebsd.org/changeset/base/280699 Log: Rough first mdoc, spelling and grammar cleanup pass. Modified: head/usr.sbin/pmcstudy/pmcstudy.8 Modified: head/usr.sbin/pmcstudy/pmcstudy.8 ============================================================================== --- head/usr.sbin/pmcstudy/pmcstudy.8 Thu Mar 26 15:43:57 2015 (r280698) +++ head/usr.sbin/pmcstudy/pmcstudy.8 Thu Mar 26 15:54:54 2015 (r280699) @@ -29,14 +29,14 @@ .Os .Sh NAME .Nm pmcstudy -.Nd Perform various study's on a systems overall PMC's. +.Nd Perform various studies on a system's overall PMCs. .Sh SYNOPSIS .Nm .Oo Fl i Ar inputfile | Fl T | Fl v | Fl m Ar max | Fl e exp | Fl Ar E | Fl h | fl H Oc -.Nm -.Fl i Ar inputfile .Nm -.Fl v +.Fl i Ar inputfile +.Nm +.Fl v .Nm .Fl m Ar max .Nm @@ -53,23 +53,25 @@ The .Nm program is designed to run various tests against your systems -performance. There are roughly 20-22 canned tests that setup specific -PMC's and then run various formulas on the output information. +performance. +There are roughly 20-22 canned tests that setup specific +PMCs and then run various formulas on the output information. These formulas can be found in Intel documentation "Using Intel Vtune -amplifier xe on NNN Generation Intel Core Processors". The NNN is either -2nd, 3rd or 4th generation i.e. Sandy Bridge, Ivy Bridge and Haswell. +amplifier xe on NNN Generation Intel Core Processors". +The NNN is either +2nd, 3rd or 4th generation i.e., Sandy Bridge, Ivy Bridge and Haswell. Currently the program only works on these three Intel processor types. .Sh OPTIONS The following options are available: .Bl -tag -width indent .It Fl i Ar filename If this option is supplied, instead of running a -.Xr pmcstat 8 -command to collecte the current running information the filename will be read +.Xr pmcstat 8 +command to collect the current running information the filename will be read in as input instead. .It Fl H This option will display the complete list of canned formulas that can be run including -there names which can be input to the +their names which can be input to the .Fl e option. .It Fl e Ar name @@ -83,22 +85,28 @@ option the test will not execute but ins of the test that would run. .It Fl T This option will execute a test of every PMC to validate that they are working -on your system. If a PMC does not show up in this test chances -are the kernel hwpmc driver needs updating with new PMC information. +on your system. +If a PMC does not show up in this test chances +are the kernel +.Xr hwpmc 4 +driver needs updating with new PMC information. .It Fl m Ar num This option can restrict the number of one second samples that will be collected by your system when running a test (it bounds the -time the test will run). Without this option the test will run +time the test will run). +Without this option the test will run for 1024 seconds or until the user types ctrl-c. .It Fl v The verbose option adds debugging output to the command. .It Fl E Ar expression -This option can be used by those that have there own ideas -on what formulas that you want to run. The expression given to -the +This option can be used by those that have their own ideas +on what formulas they want to run. +The expression given to the .Fl E -option is a "formula". The formula can declare directly the PMC's by name -or you can use an abbreviation %NNN. To find out the abbreviations +option is a "formula". +The formula can declare directly the PMCs by name +or you can use an abbreviation %NNN. +To find out the abbreviations on your system you may run the .Fl L option. @@ -107,21 +115,25 @@ An example of a formula of your own migh "FP_ASSIST.ANY / INST_RETIRED.ANY_P" or using the abbreviations on a Haswell machine you would type .Fl E -" %176 / %150". You must have spaces between each entry and -you may use paraenthisis to prioritize the operators. Add (+), Subtract (-), -Divide (/) and Multiplication (*) are supported. You may also introduce -constant numbers as well. So for example you can do a standard efficency +" %176 / %150". +You must have spaces between each entry and +you may use parentheses to prioritize the operators. +Add (+), Subtract (-), +Divide (/) and Multiplication (*) are supported. +You may also introduce +constant numbers. +For example you can do a standard efficency test like -.FL E +.Fl E "UOPS_RETIRED.RETIRE_SLOTS / (4 * CPU_CLK_UNHALTED.THREAD_P)". - .It Fl L -This option will list all known PMC's and there abbreviation (%NNN). +This option will list all known PMCs and their abbreviation (%NNN). +.El .Sh SEE ALSO .Xr pmc 3 , .Xr pmclog 3 , .Xr hwpmc 4 , -.Xr pmcstat 8 , +.Xr pmcstat 8 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 16:00:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82DC8681; Thu, 26 Mar 2015 16: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 56453EDA; Thu, 26 Mar 2015 16:00:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QG0aI5045102; Thu, 26 Mar 2015 16:00:36 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QG0as2045101; Thu, 26 Mar 2015 16:00:36 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503261600.t2QG0as2045101@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 26 Mar 2015 16:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280700 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:00:36 -0000 Author: pfg Date: Thu Mar 26 16:00:35 2015 New Revision: 280700 URL: https://svnweb.freebsd.org/changeset/base/280700 Log: Introduce some allocation function attributes. Bring support for two gcc function attributes that are likely to be used in our system headers: __alloc_size The alloc_size attribute is used to tell the compiler that the function return value points to memory, where the size is given by one or two of the functions parameters. __result_use_check Causes a warning to be emitted if a caller of the function with this attribute does not use its return value. This is known in gcc as "warn_unused_result" but we considered the original naming unsuitable for an attribute. The __alloc_size attribute required some workarounds for lint(1). Both attributes are supported by clang. Also see: D2107 MFC after: 3 days Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Thu Mar 26 15:54:54 2015 (r280699) +++ head/sys/sys/cdefs.h Thu Mar 26 16:00:35 2015 (r280700) @@ -40,6 +40,9 @@ * Testing against Clang-specific extensions. */ +#ifndef __has_attribute +#define __has_attribute(x) 0 +#endif #ifndef __has_extension #define __has_extension __has_feature #endif @@ -209,6 +212,7 @@ #define __unused #define __packed #define __aligned(x) +#define __alloc_size(...) #define __section(x) #define __weak #else @@ -233,6 +237,11 @@ #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #endif +#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) +#define __alloc_size(...) __attribute__((alloc_size(__VA_ARGS__))) +#else +#define __alloc_size(...) +#endif #if defined(__INTEL_COMPILER) #define __dead2 __attribute__((__noreturn__)) #define __pure2 __attribute__((__const__)) @@ -242,7 +251,7 @@ #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #endif -#endif +#endif /* lint */ #if !__GNUC_PREREQ__(2, 95) #define __alignof(x) __offsetof(struct { char __a; x __b; }, __b) @@ -363,8 +372,10 @@ #if __GNUC_PREREQ__(3, 4) #define __fastcall __attribute__((__fastcall__)) +#define __result_use_check __attribute__((__warn_unused_result__)) #else #define __fastcall +#define __result_use_check #endif #if __GNUC_PREREQ__(4, 1) From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 17:13:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAE5FB9F; Thu, 26 Mar 2015 17: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 B6CDCA0F; Thu, 26 Mar 2015 17:13:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QHDCOl081061; Thu, 26 Mar 2015 17:13:12 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QHDCBY081060; Thu, 26 Mar 2015 17:13:12 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201503261713.t2QHDCBY081060@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 26 Mar 2015 17:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280701 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 17:13:12 -0000 Author: kp Date: Thu Mar 26 17:13:11 2015 New Revision: 280701 URL: https://svnweb.freebsd.org/changeset/base/280701 Log: Clarify the ministat default width The man page states that: '-w width Width of ASCII-art plot in characters, default is 74.' This is not entirely correct. The mini-help is more accurate: '-w : width of graph/test output (default 74 or terminal width)' In other words: the man page fails to explain that ministat will default to the terminal width, not 74. It will only fall back to 74 if stdout is not a TTY. Submitted by: Ben Hutchings Approved by: philip (mentor) Modified: head/usr.bin/ministat/ministat.1 Modified: head/usr.bin/ministat/ministat.1 ============================================================================== --- head/usr.bin/ministat/ministat.1 Thu Mar 26 16:00:35 2015 (r280700) +++ head/usr.bin/ministat/ministat.1 Thu Mar 26 17:13:11 2015 (r280701) @@ -68,7 +68,9 @@ See .Xr strtok 3 for details. .It Fl w Ar width -Width of ASCII-art plot in characters, default is 74. +Width of ASCII-art plot in characters. +The default is the terminal width, or 74 if standard output is not a +terminal. .El .Pp A sample output could look like this: From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 17:21:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D662DB9; Thu, 26 Mar 2015 17: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 89554A7A; Thu, 26 Mar 2015 17:21:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QHLD7b083020; Thu, 26 Mar 2015 17:21:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QHLDCB083019; Thu, 26 Mar 2015 17:21:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503261721.t2QHLDCB083019@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 26 Mar 2015 17:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280702 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 17:21:13 -0000 Author: mav Date: Thu Mar 26 17:21:12 2015 New Revision: 280702 URL: https://svnweb.freebsd.org/changeset/base/280702 Log: Make swapper release orphaned (lost) GEOM provider. Swap device is still reported as enabled, and system still may crash later if some swapped-out kernel pages were lost with the device, but at least GEOM and CAM can now release the lost disk, allowing it to be reconnected. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Thu Mar 26 17:13:11 2015 (r280701) +++ head/sys/vm/swap_pager.c Thu Mar 26 17:21:12 2015 (r280702) @@ -2563,18 +2563,42 @@ DECLARE_GEOM_CLASS(g_swap_class, g_class static void +swapgeom_close_ev(void *arg, int flags) +{ + struct g_consumer *cp; + + cp = arg; + g_access(cp, -1, -1, 0); + g_detach(cp); + g_destroy_consumer(cp); +} + +static void swapgeom_done(struct bio *bp2) { + struct swdevt *sp; struct buf *bp; + struct g_consumer *cp; + int destroy; bp = bp2->bio_caller2; + cp = bp2->bio_from; bp->b_ioflags = bp2->bio_flags; if (bp2->bio_error) bp->b_ioflags |= BIO_ERROR; bp->b_resid = bp->b_bcount - bp2->bio_completed; bp->b_error = bp2->bio_error; bufdone(bp); + mtx_lock(&sw_dev_mtx); + destroy = ((--cp->index) == 0 && cp->private); + if (destroy) { + sp = bp2->bio_caller1; + sp->sw_id = NULL; + } + mtx_unlock(&sw_dev_mtx); g_destroy_bio(bp2); + if (destroy) + g_waitfor_event(swapgeom_close_ev, cp, M_WAITOK, NULL); } static void @@ -2583,13 +2607,17 @@ swapgeom_strategy(struct buf *bp, struct struct bio *bio; struct g_consumer *cp; + mtx_lock(&sw_dev_mtx); cp = sp->sw_id; if (cp == NULL) { + mtx_unlock(&sw_dev_mtx); bp->b_error = ENXIO; bp->b_ioflags |= BIO_ERROR; bufdone(bp); return; } + cp->index++; + mtx_unlock(&sw_dev_mtx); if (bp->b_iocmd == BIO_WRITE) bio = g_new_bio(); else @@ -2601,6 +2629,7 @@ swapgeom_strategy(struct buf *bp, struct return; } + bio->bio_caller1 = sp; bio->bio_caller2 = bp; bio->bio_cmd = bp->b_iocmd; bio->bio_offset = (bp->b_blkno - sp->sw_first) * PAGE_SIZE; @@ -2624,31 +2653,36 @@ static void swapgeom_orphan(struct g_consumer *cp) { struct swdevt *sp; + int destroy; mtx_lock(&sw_dev_mtx); - TAILQ_FOREACH(sp, &swtailq, sw_list) - if (sp->sw_id == cp) + TAILQ_FOREACH(sp, &swtailq, sw_list) { + if (sp->sw_id == cp) { sp->sw_flags |= SW_CLOSING; + break; + } + } + cp->private = (void *)(uintptr_t)1; + destroy = ((sp != NULL) && (cp->index == 0)); + if (destroy) + sp->sw_id = NULL; mtx_unlock(&sw_dev_mtx); -} - -static void -swapgeom_close_ev(void *arg, int flags) -{ - struct g_consumer *cp; - - cp = arg; - g_access(cp, -1, -1, 0); - g_detach(cp); - g_destroy_consumer(cp); + if (destroy) + swapgeom_close_ev(cp, 0); } static void swapgeom_close(struct thread *td, struct swdevt *sw) { + struct g_consumer *cp; + mtx_lock(&sw_dev_mtx); + cp = sw->sw_id; + sw->sw_id = NULL; + mtx_unlock(&sw_dev_mtx); /* XXX: direct call when Giant untangled */ - g_waitfor_event(swapgeom_close_ev, sw->sw_id, M_WAITOK, NULL); + if (cp != NULL) + g_waitfor_event(swapgeom_close_ev, cp, M_WAITOK, NULL); } @@ -2689,6 +2723,8 @@ swapongeom_ev(void *arg, int flags) if (gp == NULL) gp = g_new_geomf(&g_swap_class, "swap"); cp = g_new_consumer(gp); + cp->index = 0; /* Number of active I/Os. */ + cp->private = NULL; /* Orphanization flag */ g_attach(cp, pp); /* * XXX: Everytime you think you can improve the margin for From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 17:29:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6AC641E8; Thu, 26 Mar 2015 17:29:41 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07513BF8; Thu, 26 Mar 2015 17:29:41 +0000 (UTC) Received: by wibgn9 with SMTP id gn9so95661410wib.1; Thu, 26 Mar 2015 10:29:39 -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:mail-followup-to :references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=BkjcZFiCCkFb0Qz+DRyZ5qrx6wefgMhIlq4aIqAFMqo=; b=bfzBDibo1Dk33AC0vmOHLPZ0nc74TlwLsvxpf7vBI0Mb5RcWQh166BVg5Yqz0ZFrDY GjcsgJfKd3A7hLWnlAOGWQmmjvuGrH6Jf2Gm95uRDiUvwXE8NKMQil/XbhA35sOuBLlG qId4Wi0EMRHeDfOk5KTyQRoGKHY0b19A6u0ozVbEhTjoLjW9/6s4g/gse8auLzy7n8uZ 8a1jrGUI8tRxAcsNnNXXuoCXKddi6FHLmsOm0h9xQHq24wS2UGItdCJTFa7dsQMhq/t0 OYJ8OOLCQVjfLperXVOrfwimL8eHkRw/Df6COetSyvfhFNMnh75xW8lPGnghRz7VbInt Y1WA== X-Received: by 10.194.110.233 with SMTP id id9mr30370556wjb.136.1427390979539; Thu, 26 Mar 2015 10:29:39 -0700 (PDT) Received: from brick.home (evj112.neoplus.adsl.tpnet.pl. [83.20.207.112]) by mx.google.com with ESMTPSA id dc9sm26227454wib.9.2015.03.26.10.29.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2015 10:29:38 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 26 Mar 2015 18:29:36 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= Subject: Re: svn commit: r280183 - in head/sys: dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/drm2/ttm modules modules/drm2 modules/drm2/drm2 modules/drm2/radeonkms Message-ID: <20150326172936.GA3999@brick.home> Mail-Followup-To: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201503171850.t2HIoYJr045422@svn.freebsd.org> <20150317202954.GA8030@brick.home> <5508A468.9050802@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5508A468.9050802@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-1 Precedence: list List-Id: SVN 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 Mar 2015 17:29:41 -0000 On 0317T2302, Jean-Sébastien Pédron wrote: > On 17.03.2015 21:29, Edward Tomasz NapieraÅ‚a wrote: > >> o Support for the setmaster/dropmaster ioctls. For instance, they > >> are used to run multiple X servers simultaneously. > > > > Does it fix fast user switching in Xorg/GNOME, by any chance? > > Maybe, I don't know how this works in GNOME. But as long as it relies on > two X sessions running at the same time, then yes it surely helps. I've just tested, and user switching in GNOME works now. Yay! From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 18:25:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82107AA1; Thu, 26 Mar 2015 18: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 6D5C5389; Thu, 26 Mar 2015 18:25:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QIPsrw014818; Thu, 26 Mar 2015 18:25:54 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QIPsMO014817; Thu, 26 Mar 2015 18:25:54 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503261825.t2QIPsMO014817@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 26 Mar 2015 18:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280704 - head/contrib/gcc/config/aarch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 18:25:54 -0000 Author: andrew Date: Thu Mar 26 18:25:53 2015 New Revision: 280704 URL: https://svnweb.freebsd.org/changeset/base/280704 Log: Also define DWARF_FRAME_REGISTERS. This is used to size arrays, without this exceptions could write over the stack. Sponsored by: The FreeBSD Foundation Modified: head/contrib/gcc/config/aarch64/aarch64.h Modified: head/contrib/gcc/config/aarch64/aarch64.h ============================================================================== --- head/contrib/gcc/config/aarch64/aarch64.h Thu Mar 26 17:51:11 2015 (r280703) +++ head/contrib/gcc/config/aarch64/aarch64.h Thu Mar 26 18:25:53 2015 (r280704) @@ -1,3 +1,3 @@ -/* $FreeBSD */ #define FIRST_PSEUDO_REGISTER 67 +#define DWARF_FRAME_REGISTERS 97 From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 18:44:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E18C3ED; Thu, 26 Mar 2015 18:44:54 +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 D102A7CB; Thu, 26 Mar 2015 18:44:52 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2QIihMb018841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 26 Mar 2015 21:44:43 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2QIigvX018840; Thu, 26 Mar 2015 21:44:42 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 26 Mar 2015 21:44:42 +0300 From: Gleb Smirnoff To: Randall Stewart Subject: Re: svn commit: r280697 - head/usr.sbin/pmcstudy Message-ID: <20150326184442.GM64665@FreeBSD.org> References: <201503261540.t2QFem4u037702@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503261540.t2QFem4u037702@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-1 Precedence: list List-Id: SVN 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 Mar 2015 18:44:55 -0000 Randall, On Thu, Mar 26, 2015 at 03:40:48PM +0000, Randall Stewart wrote: R> Added: R> head/usr.sbin/pmcstudy/pmcstudy.8 (contents, props changed) R> Deleted: R> head/usr.sbin/pmcstudy/pmcstudy.1 Now you need to add pmcstudy.1 to ObsoleteFiles.inc. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 18:45:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA26637A; Thu, 26 Mar 2015 18: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 A58987E1; Thu, 26 Mar 2015 18:45:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QIjqJm024173; Thu, 26 Mar 2015 18:45:52 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QIjqvw024172; Thu, 26 Mar 2015 18:45:52 GMT (envelope-from np@FreeBSD.org) Message-Id: <201503261845.t2QIjqvw024172@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 26 Mar 2015 18:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280706 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 18:45:52 -0000 Author: np Date: Thu Mar 26 18:45:51 2015 New Revision: 280706 URL: https://svnweb.freebsd.org/changeset/base/280706 Log: cxgbe(4): provide the exact RSS hash type instead of a catch-all value to the upper layers. Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Mar 26 18:44:59 2015 (r280705) +++ head/sys/dev/cxgbe/t4_sge.c Thu Mar 26 18:45:51 2015 (r280706) @@ -1736,6 +1736,12 @@ t4_eth_rx(struct sge_iq *iq, const struc #if defined(INET) || defined(INET6) struct lro_ctrl *lro = &rxq->lro; #endif + static const int sw_hashtype[4][2] = { + {M_HASHTYPE_NONE, M_HASHTYPE_NONE}, + {M_HASHTYPE_RSS_IPV4, M_HASHTYPE_RSS_IPV6}, + {M_HASHTYPE_RSS_TCP_IPV4, M_HASHTYPE_RSS_TCP_IPV6}, + {M_HASHTYPE_RSS_UDP_IPV4, M_HASHTYPE_RSS_UDP_IPV6}, + }; KASSERT(m0 != NULL, ("%s: no payload with opcode %02x", __func__, rss->opcode)); @@ -1745,7 +1751,7 @@ t4_eth_rx(struct sge_iq *iq, const struc m0->m_data += fl_pktshift; m0->m_pkthdr.rcvif = ifp; - M_HASHTYPE_SET(m0, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(m0, sw_hashtype[rss->hash_type][rss->ipv6]); m0->m_pkthdr.flowid = be32toh(rss->hash_val); if (cpl->csum_calc && !cpl->err_vec) { From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 19:33:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53F46179; Thu, 26 Mar 2015 19:33: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 2509BD2B; Thu, 26 Mar 2015 19:33:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QJX8qD047484; Thu, 26 Mar 2015 19:33:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QJX8A2047483; Thu, 26 Mar 2015 19:33:08 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503261933.t2QJX8A2047483@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 Mar 2015 19:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280709 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 19:33:08 -0000 Author: ian Date: Thu Mar 26 19:33:07 2015 New Revision: 280709 URL: https://svnweb.freebsd.org/changeset/base/280709 Log: Use pmap_mapdev()/unmapdev() to temporarily map on-chip sram while copying the startup trampoline code. The old code allocated a kva page, mapped it using using pmap_kenter_nocache(), then freed the kva without destroying the mapping. This is the only use of pmap_kenter_nocache() in the system, so redoing this one use of allows it to be garbage collected in the near future. Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Thu Mar 26 19:13:54 2015 (r280708) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Thu Mar 26 19:33:07 2015 (r280709) @@ -106,7 +106,7 @@ void platform_mp_start_ap(void) { uint32_t reg, *src, *dst, cpu_num, div_val, cputype; - vm_offset_t smp_boot, pmu_boot_off; + vm_offset_t pmu_boot_off; /* * Initialization procedure depends on core revision, * in this step CHIP ID is checked to choose proper procedure @@ -114,22 +114,18 @@ platform_mp_start_ap(void) cputype = cpufunc_id(); cputype &= CPU_ID_CPU_MASK; - 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; - + dst = pmap_mapdev(0xffff0000, PAGE_SIZE); for (src = (uint32_t *)mptramp; src < (uint32_t *)mptramp_end; src++, dst++) { *dst = *src; } - kva_free(smp_boot, PAGE_SIZE); - + pmap_unmapdev((vm_offset_t)dst, PAGE_SIZE); if (cputype == CPU_ID_MV88SV584X_V7) { /* Core rev A0 */ div_val = read_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL1); From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 20:08:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2BCAD65; Thu, 26 Mar 2015 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 CE2A611E; Thu, 26 Mar 2015 20:08:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QK8QOg062451; Thu, 26 Mar 2015 20:08:26 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QK8QCk062450; Thu, 26 Mar 2015 20:08:26 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201503262008.t2QK8QCk062450@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 26 Mar 2015 20:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280710 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 20:08:27 -0000 Author: rrs Date: Thu Mar 26 20:08:25 2015 New Revision: 280710 URL: https://svnweb.freebsd.org/changeset/base/280710 Log: Per Gleb, add the pmcstudy.1.gz which was moved to pmcstudy.8.gz Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Mar 26 19:33:07 2015 (r280709) +++ head/ObsoleteFiles.inc Thu Mar 26 20:08:25 2015 (r280710) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20150326 +OLD_FILES+=usr/share/man/man1/pmcstudy.1.gz # 20150315: new clang import which bumps version from 3.5.1 to 3.6.0. OLD_FILES+=usr/include/clang/3.5.1/__wmmintrin_aes.h OLD_FILES+=usr/include/clang/3.5.1/__wmmintrin_pclmul.h From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 21:10:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D4E789C; Thu, 26 Mar 2015 21:10: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 6E35FB3A; Thu, 26 Mar 2015 21:10:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QLAi4N092420; Thu, 26 Mar 2015 21:10:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QLAhf6092416; Thu, 26 Mar 2015 21:10:43 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503262110.t2QLAhf6092416@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 26 Mar 2015 21:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280711 - head/sys/arm64/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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:10:44 -0000 Author: andrew Date: Thu Mar 26 21:10:42 2015 New Revision: 280711 URL: https://svnweb.freebsd.org/changeset/base/280711 Log: Add more arm64 machine dependent headers. With this we now have the minimum set of machine headers needed to build the userland toolchain. Differential Revision: https://reviews.freebsd.org/D2148 Reviewed by: imp Sponsored by: The FreeBSD Foundation Added: head/sys/arm64/include/frame.h (contents, props changed) head/sys/arm64/include/ptrace.h (contents, props changed) head/sys/arm64/include/reg.h (contents, props changed) head/sys/arm64/include/sysarch.h (contents, props changed) Added: head/sys/arm64/include/frame.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/frame.h Thu Mar 26 21:10:42 2015 (r280711) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * Copyright (c) 2014 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner 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 _MACHINE_FRAME_H_ +#define _MACHINE_FRAME_H_ + +#ifndef LOCORE + +#include +#include + +/* + * NOTE: keep this structure in sync with struct reg and struct mcontext. + */ +struct trapframe { + uint64_t tf_sp; + uint64_t tf_lr; + uint64_t tf_elr; + uint64_t tf_spsr; + uint64_t tf_x[30]; +}; + +/* + * Signal frame, pushedonto the user stack + */ +struct sigframe { + siginfo_t sf_si; /* actual saved siginfo */ + ucontext_t sf_uc; /* actual saved ucontext */ +}; + +/* + * There is no fixed frame layout, other than to be 16-byte aligned + */ +struct frame { + int dummy; +}; + +#endif /* !LOCORE */ + +#endif /* !_MACHINE_FRAME_H_ */ Added: head/sys/arm64/include/ptrace.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/ptrace.h Thu Mar 26 21:10:42 2015 (r280711) @@ -0,0 +1 @@ +/* $FreeBSD$ */ Added: head/sys/arm64/include/reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/reg.h Thu Mar 26 21:10:42 2015 (r280711) @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * Copyright (c) 2014-2015 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner 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 _MACHINE_REG_H_ +#define _MACHINE_REG_H_ + +struct reg { + uint64_t x[30]; + uint64_t lr; + uint64_t sp; + uint64_t elr; + uint32_t spsr; +}; + +struct fpreg { + __uint128_t fp_q[32]; + uint32_t fp_sr; + uint32_t fp_cr; +}; + +struct dbreg { + int dummy; +}; + +#ifdef _KERNEL +/* + * XXX these interfaces are MI, so they should be declared in a MI place. + */ +int fill_regs(struct thread *, struct reg *); +int set_regs(struct thread *, struct reg *); +int fill_fpregs(struct thread *, struct fpreg *); +int set_fpregs(struct thread *, struct fpreg *); +int fill_dbregs(struct thread *, struct dbreg *); +int set_dbregs(struct thread *, struct dbreg *); +#endif + +#endif /* !_MACHINE_REG_H_ */ Added: head/sys/arm64/include/sysarch.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/sysarch.h Thu Mar 26 21:10:42 2015 (r280711) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 1993 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 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 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: FreeBSD: src/sys/i386/include/sysarch.h,v 1.14 2000/09/21 + * $FreeBSD$ + */ + +/* + * Architecture specific syscalls (arm64) + */ +#ifndef _MACHINE_SYSARCH_H_ +#define _MACHINE_SYSARCH_H_ + +#ifndef _KERNEL + +__BEGIN_DECLS +int sysarch(int _number, void *_args); +__END_DECLS + +#endif + +#endif /* !_MACHINE_SYSARCH_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 21:13:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1B5FA06; Thu, 26 Mar 2015 21:13: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 9B25CB66; Thu, 26 Mar 2015 21:13:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QLDuAB095171; Thu, 26 Mar 2015 21:13:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QLDscD095158; Thu, 26 Mar 2015 21:13:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503262113.t2QLDscD095158@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 Mar 2015 21:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280712 - in head/sys: arm/arm arm/include 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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:13:56 -0000 Author: ian Date: Thu Mar 26 21:13:53 2015 New Revision: 280712 URL: https://svnweb.freebsd.org/changeset/base/280712 Log: New pmap code for armv6. Disabled by default, option ARM_NEW_PMAP enables it. This is pretty much a complete rewrite based on the existing i386 code. The patches have been circulating for a couple years and have been looked at by plenty of people, but I'm not putting anybody on the hook as having reviewed this in any formal sense except myself. After this has gotten wider testing from the user community, ARM_NEW_PMAP will become the default and various dregs of the old pmap code will be removed. Submitted by: Svatopluk Kraus , Michal Meloun Added: head/sys/arm/arm/pmap-v6-new.c (contents, props changed) head/sys/arm/include/pmap-v6.h (contents, props changed) head/sys/arm/include/pmap_var.h (contents, props changed) head/sys/arm/include/pte-v6.h (contents, props changed) Modified: head/sys/arm/arm/genassym.c head/sys/arm/arm/machdep.c head/sys/arm/arm/mem.c head/sys/arm/arm/minidump_machdep.c head/sys/arm/arm/mp_machdep.c head/sys/arm/arm/swtch.S head/sys/arm/include/machdep.h head/sys/arm/include/pcb.h head/sys/arm/include/pmap.h head/sys/arm/include/pte.h head/sys/arm/include/sf_buf.h head/sys/arm/include/smp.h head/sys/arm/include/vm.h head/sys/arm/include/vmparam.h head/sys/conf/files.arm head/sys/conf/options.arm Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Thu Mar 26 21:10:42 2015 (r280711) +++ head/sys/arm/arm/genassym.c Thu Mar 26 21:13:53 2015 (r280712) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -58,12 +59,19 @@ __FBSDID("$FreeBSD$"); ASSYM(KERNBASE, KERNBASE); ASSYM(PCB_NOALIGNFLT, PCB_NOALIGNFLT); +#ifdef ARM_NEW_PMAP +ASSYM(CPU_ASID_KERNEL,CPU_ASID_KERNEL); +#endif ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); +#ifndef ARM_NEW_PMAP ASSYM(PCB_DACR, offsetof(struct pcb, pcb_dacr)); +#endif ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); ASSYM(PCB_PAGEDIR, offsetof(struct pcb, pcb_pagedir)); +#ifndef ARM_NEW_PMAP ASSYM(PCB_L1VEC, offsetof(struct pcb, pcb_l1vec)); ASSYM(PCB_PL1VEC, offsetof(struct pcb, pcb_pl1vec)); +#endif ASSYM(PCB_R4, offsetof(struct pcb, pcb_regs.sf_r4)); ASSYM(PCB_R5, offsetof(struct pcb, pcb_regs.sf_r5)); ASSYM(PCB_R6, offsetof(struct pcb, pcb_regs.sf_r6)); @@ -131,7 +139,6 @@ ASSYM(PC_CURPMAP, offsetof(struct pcpu, #endif ASSYM(PAGE_SIZE, PAGE_SIZE); -ASSYM(PDESIZE, PDESIZE); ASSYM(PMAP_DOMAIN_KERNEL, PMAP_DOMAIN_KERNEL); #ifdef PMAP_INCLUDE_PTE_SYNC ASSYM(PMAP_INCLUDE_PTE_SYNC, 1); @@ -145,8 +152,13 @@ ASSYM(TRAPFRAMESIZE, sizeof(struct trapf ASSYM(MAXCOMLEN, MAXCOMLEN); ASSYM(MAXCPU, MAXCPU); +ASSYM(_NCPUWORDS, _NCPUWORDS); ASSYM(NIRQ, NIRQ); ASSYM(PCPU_SIZE, sizeof(struct pcpu)); +ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); +ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); +ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); +ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); ASSYM(DCACHE_LINE_SIZE, offsetof(struct cpuinfo, dcache_line_size)); ASSYM(DCACHE_LINE_MASK, offsetof(struct cpuinfo, dcache_line_mask)); Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Thu Mar 26 21:10:42 2015 (r280711) +++ head/sys/arm/arm/machdep.c Thu Mar 26 21:13:53 2015 (r280712) @@ -138,6 +138,14 @@ int _min_bzero_size = 0; extern int *end; #ifdef FDT +vm_paddr_t pmap_pa; + +#ifdef ARM_NEW_PMAP +vm_offset_t systempage; +vm_offset_t irqstack; +vm_offset_t undstack; +vm_offset_t abtstack; +#else /* * This is the number of L2 page tables required for covering max * (hypothetical) memsize of 4GB and all kernel mappings (vectors, msgbuf, @@ -147,15 +155,13 @@ extern int *end; static struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; -vm_paddr_t pmap_pa; - struct pv_addr systempage; static struct pv_addr msgbufpv; struct pv_addr irqstack; struct pv_addr undstack; struct pv_addr abtstack; static struct pv_addr kernelstack; - +#endif #endif #if defined(LINUX_BOOT_ABI) @@ -381,9 +387,11 @@ cpu_startup(void *dummy) vm_pager_bufferinit(); pcb->pcb_regs.sf_sp = (u_int)thread0.td_kstack + USPACE_SVC_STACK_TOP; - vector_page_setprot(VM_PROT_READ); pmap_set_pcb_pagedir(pmap_kernel(), pcb); +#ifndef ARM_NEW_PMAP + vector_page_setprot(VM_PROT_READ); pmap_postinit(); +#endif #ifdef ARM_TP_ADDRESS #ifdef ARM_CACHE_LOCK_ENABLE pmap_kenter_user(ARM_TP_ADDRESS, ARM_TP_ADDRESS); @@ -1003,6 +1011,19 @@ init_proc0(vm_offset_t kstack) pcpup->pc_curpcb = thread0.td_pcb; } +#ifdef ARM_NEW_PMAP +void +set_stackptrs(int cpu) +{ + + set_stackptr(PSR_IRQ32_MODE, + irqstack + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); + set_stackptr(PSR_ABT32_MODE, + abtstack + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); + set_stackptr(PSR_UND32_MODE, + undstack + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); +} +#else void set_stackptrs(int cpu) { @@ -1014,6 +1035,7 @@ set_stackptrs(int cpu) set_stackptr(PSR_UND32_MODE, undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); } +#endif #ifdef FDT static char * @@ -1048,6 +1070,7 @@ print_kenv(void) debugf(" %x %s\n", (uint32_t)cp, cp); } +#ifndef ARM_NEW_PMAP void * initarm(struct arm_boot_params *abp) { @@ -1316,4 +1339,181 @@ initarm(struct arm_boot_params *abp) return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); } +#else /* !ARM_NEW_PMAP */ +void * +initarm(struct arm_boot_params *abp) +{ + struct mem_region mem_regions[FDT_MEM_REGIONS]; + vm_paddr_t lastaddr; + vm_offset_t dtbp, kernelstack, dpcpu; + uint32_t memsize; + char *env; + void *kmdp; + int err_devmap, mem_regions_sz; + + /* get last allocated physical address */ + arm_physmem_kernaddr = abp->abp_physaddr; + lastaddr = parse_boot_param(abp) - KERNVIRTADDR + arm_physmem_kernaddr; + + memsize = 0; + set_cpufuncs(); + cpuinfo_init(); + + /* + * Find the dtb passed in by the boot loader. + */ + kmdp = preload_search_by_type("elf kernel"); + if (kmdp != NULL) + dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); + else + dtbp = (vm_offset_t)NULL; +#if defined(FDT_DTB_STATIC) + /* + * In case the device tree blob was not retrieved (from metadata) try + * to use the statically embedded one. + */ + if (dtbp == (vm_offset_t)NULL) + dtbp = (vm_offset_t)&fdt_static_dtb; #endif + + if (OF_install(OFW_FDT, 0) == FALSE) + panic("Cannot install FDT"); + + if (OF_init((void *)dtbp) != 0) + panic("OF_init failed with the found device tree"); + + /* Grab physical memory regions information from device tree. */ + if (fdt_get_mem_regions(mem_regions, &mem_regions_sz, &memsize) != 0) + panic("Cannot get physical memory regions"); + arm_physmem_hardware_regions(mem_regions, mem_regions_sz); + + /* Grab reserved memory regions information from device tree. */ + if (fdt_get_reserved_regions(mem_regions, &mem_regions_sz) == 0) + arm_physmem_exclude_regions(mem_regions, mem_regions_sz, + EXFLAG_NODUMP | EXFLAG_NOALLOC); + + /* + * Set TEX remapping registers. + * Setup kernel page tables and switch to kernel L1 page table. + */ + pmap_set_tex(); + pmap_bootstrap_prepare(lastaddr); + + /* + * Now that proper page tables are installed, call cpu_setup() to enable + * instruction and data caches and other chip-specific features. + */ + cpu_setup(""); + + /* Platform-specific initialisation */ + platform_probe_and_attach(); + pcpu0_init(); + + /* Do basic tuning, hz etc */ + init_param1(); + + /* + * Allocate a page for the system page mapped to 0xffff0000 + * This page will just contain the system vectors and can be + * shared by all processes. + */ + systempage = pmap_preboot_get_pages(1); + + /* Map the vector page. */ + pmap_preboot_map_pages(systempage, ARM_VECTORS_HIGH, 1); + if (virtual_end >= ARM_VECTORS_HIGH) + virtual_end = ARM_VECTORS_HIGH - 1; + + /* Allocate dynamic per-cpu area. */ + dpcpu = pmap_preboot_get_vpages(DPCPU_SIZE / PAGE_SIZE); + dpcpu_init((void *)dpcpu, 0); + + /* Allocate stacks for all modes */ + irqstack = pmap_preboot_get_vpages(IRQ_STACK_SIZE * MAXCPU); + abtstack = pmap_preboot_get_vpages(ABT_STACK_SIZE * MAXCPU); + undstack = pmap_preboot_get_vpages(UND_STACK_SIZE * MAXCPU ); + kernelstack = pmap_preboot_get_vpages(KSTACK_PAGES * MAXCPU); + + /* Allocate message buffer. */ + msgbufp = (void *)pmap_preboot_get_vpages( + round_page(msgbufsize) / PAGE_SIZE); + + /* + * Pages were allocated during the secondary bootstrap for the + * stacks for different CPU modes. + * We must now set the r13 registers in the different CPU modes to + * point to these stacks. + * Since the ARM stacks use STMFD etc. we must set r13 to the top end + * of the stack memory. + */ + set_stackptrs(0); + mutex_init(); + + /* Establish static device mappings. */ + err_devmap = platform_devmap_init(); + arm_devmap_bootstrap(0, NULL); + vm_max_kernel_address = platform_lastaddr(); + + /* + * Only after the SOC registers block is mapped we can perform device + * tree fixups, as they may attempt to read parameters from hardware. + */ + OF_interpret("perform-fixup", 0); + platform_gpio_init(); + cninit(); + + debugf("initarm: console initialized\n"); + debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)kmdp); + debugf(" boothowto = 0x%08x\n", boothowto); + debugf(" dtbp = 0x%08x\n", (uint32_t)dtbp); + debugf(" lastaddr1: 0x%08x\n", lastaddr); + print_kenv(); + + env = kern_getenv("kernelname"); + if (env != NULL) + strlcpy(kernelname, env, sizeof(kernelname)); + + if (err_devmap != 0) + printf("WARNING: could not fully configure devmap, error=%d\n", + err_devmap); + + platform_late_init(); + + /* + * We must now clean the cache again.... + * Cleaning may be done by reading new data to displace any + * dirty data in the cache. This will have happened in setttb() + * but since we are boot strapping the addresses used for the read + * may have just been remapped and thus the cache could be out + * of sync. A re-clean after the switch will cure this. + * After booting there are no gross relocations of the kernel thus + * this problem will not occur after initarm(). + */ + /* Set stack for exception handlers */ + undefined_init(); + init_proc0(kernelstack); + arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); + enable_interrupts(PSR_A); + pmap_bootstrap(0); + + /* Exclude the kernel (and all the things we allocated which immediately + * follow the kernel) from the VM allocation pool but not from crash + * dumps. virtual_avail is a global variable which tracks the kva we've + * "allocated" while setting up pmaps. + * + * Prepare the list of physical memory available to the vm subsystem. + */ + arm_physmem_exclude_region(abp->abp_physaddr, + pmap_preboot_get_pages(0) - abp->abp_physaddr, EXFLAG_NOALLOC); + arm_physmem_init_kernel_globals(); + + init_param2(physmem); + /* Init message buffer. */ + msgbufinit(msgbufp, msgbufsize); + kdb_init(); + return ((void *)STACKALIGN(thread0.td_pcb)); + +} + +#endif /* !ARM_NEW_PMAP */ +#endif /* FDT */ Modified: head/sys/arm/arm/mem.c ============================================================================== --- head/sys/arm/arm/mem.c Thu Mar 26 21:10:42 2015 (r280711) +++ head/sys/arm/arm/mem.c Thu Mar 26 21:13:53 2015 (r280712) @@ -113,6 +113,9 @@ memrw(struct cdev *dev, struct uio *uio, return (EINVAL); sx_xlock(&tmppt_lock); pmap_kenter((vm_offset_t)_tmppt, v); +#ifdef ARM_NEW_PMAP + pmap_tlb_flush(kernel_pmap, (vm_offset_t)_tmppt); +#endif o = (int)uio->uio_offset & PAGE_MASK; c = (u_int)(PAGE_SIZE - ((int)iov->iov_base & PAGE_MASK)); c = min(c, (u_int)(PAGE_SIZE - o)); Modified: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- head/sys/arm/arm/minidump_machdep.c Thu Mar 26 21:10:42 2015 (r280711) +++ head/sys/arm/arm/minidump_machdep.c Thu Mar 26 21:13:53 2015 (r280712) @@ -61,7 +61,10 @@ CTASSERT(sizeof(struct kerneldumpheader) uint32_t *vm_page_dump; int vm_page_dump_size; +#ifndef ARM_NEW_PMAP + static struct kerneldumpheader kdh; + static off_t dumplo; /* Handle chunked writes. */ @@ -473,8 +476,20 @@ fail: else printf("\n** DUMP FAILED (ERROR %d) **\n", error); return (error); + return (0); } +#else /* ARM_NEW_PMAP */ + +int +minidumpsys(struct dumperinfo *di) +{ + + return (0); +} + +#endif + void dump_add_page(vm_paddr_t pa) { Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Thu Mar 26 21:10:42 2015 (r280711) +++ head/sys/arm/arm/mp_machdep.c Thu Mar 26 21:13:53 2015 (r280712) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -151,10 +152,20 @@ init_secondary(int cpu) uint32_t loop_counter; int start = 0, end = 0; +#ifdef ARM_NEW_PMAP + pmap_set_tex(); + reinit_mmu(pmap_kern_ttb, (1<<6) | (1<< 0), (1<<6) | (1<< 0)); + cpu_setup(""); + + /* Provide stack pointers for other processor modes. */ + set_stackptrs(cpu); + + enable_interrupts(PSR_A); +#else /* ARM_NEW_PMAP */ cpu_setup(NULL); setttb(pmap_pa); cpu_tlb_flushID(); - +#endif /* ARM_NEW_PMAP */ pc = &__pcpu[cpu]; /* @@ -166,10 +177,10 @@ init_secondary(int cpu) pcpu_init(pc, cpu, sizeof(struct pcpu)); dpcpu_init(dpcpu[cpu - 1], cpu); - +#ifndef ARM_NEW_PMAP /* Provide stack pointers for other processor modes. */ set_stackptrs(cpu); - +#endif /* Signal our startup to BSP */ atomic_add_rel_32(&mp_naps, 1); @@ -298,6 +309,12 @@ ipi_handler(void *arg) CTR1(KTR_SMP, "%s: IPI_TLB", __func__); cpufuncs.cf_tlb_flushID(); break; +#ifdef ARM_NEW_PMAP + case IPI_LAZYPMAP: + CTR1(KTR_SMP, "%s: IPI_LAZYPMAP", __func__); + pmap_lazyfix_action(); + break; +#endif default: panic("Unknown IPI 0x%0x on cpu %d", ipi, curcpu); } Added: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/pmap-v6-new.c Thu Mar 26 21:13:53 2015 (r280712) @@ -0,0 +1,6723 @@ +/*- + * Copyright (c) 1991 Regents of the University of California. + * Copyright (c) 1994 John S. Dyson + * Copyright (c) 1994 David Greenman + * Copyright (c) 2005-2010 Alan L. Cox + * Copyright (c) 2014 Svatopluk Kraus + * Copyright (c) 2014 Michal Meloun + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department and William Jolitz of UUNET Technologies 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. + * 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 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: @(#)pmap.c 7.7 (Berkeley) 5/12/91 + */ +/*- + * Copyright (c) 2003 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Jake Burkholder, + * Safeport Network Services, and Network Associates Laboratories, the + * Security Research Division of Network Associates, Inc. under + * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA + * CHATS research program. + * + * 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$"); + +/* + * Manages physical address maps. + * + * Since the information managed by this module is + * also stored by the logical address mapping module, + * this module may throw away valid virtual-to-physical + * mappings at almost any time. However, invalidations + * of virtual-to-physical mappings must be done as + * requested. + * + * In order to cope with hardware architectures which + * make virtual-to-physical map invalidates expensive, + * this module may delay invalidate or reduced protection + * operations until such time as they are actually + * necessary. This module is given full information as + * to which processors are currently using which maps, + * and to when physical maps must be made correct. + */ + +#include "opt_vm.h" +#include "opt_pmap.h" +#include "opt_ddb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef SMP +#include +#else +#include +#endif + +#ifdef DDB +#include +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#ifdef SMP +#include +#endif + +#ifndef PMAP_SHPGPERPROC +#define PMAP_SHPGPERPROC 200 +#endif + +#ifndef DIAGNOSTIC +#define PMAP_INLINE __inline +#else +#define PMAP_INLINE +#endif + +#ifdef PMAP_DEBUG +static void pmap_zero_page_check(vm_page_t m); +void pmap_debug(int level); +int pmap_pid_dump(int pid); +void pmap_pvdump(vm_paddr_t pa); + +#define PDEBUG(_lev_,_stat_) \ + if (pmap_debug_level >= (_lev_)) \ + ((_stat_)) +#define dprintf printf +int pmap_debug_level = 1; +#else /* PMAP_DEBUG */ +#define PDEBUG(_lev_,_stat_) /* Nothing */ +#define dprintf(x, arg...) +#endif /* PMAP_DEBUG */ + +/* + * Level 2 page tables map definion ('max' is excluded). + */ + +#define PT2V_MIN_ADDRESS ((vm_offset_t)PT2MAP) +#define PT2V_MAX_ADDRESS ((vm_offset_t)PT2MAP + PT2MAP_SIZE) + +#define UPT2V_MIN_ADDRESS ((vm_offset_t)PT2MAP) +#define UPT2V_MAX_ADDRESS \ + ((vm_offset_t)(PT2MAP + (KERNBASE >> PT2MAP_SHIFT))) + +/* + * Promotion to a 1MB (PTE1) page mapping requires that the corresponding + * 4KB (PTE2) page mappings have identical settings for the following fields: + */ +#define PTE2_PROMOTE (PTE2_V | PTE2_A | PTE2_NM | PTE2_S | PTE2_NG | \ + PTE2_NX | PTE2_RO | PTE2_U | PTE2_W | \ + PTE2_ATTR_MASK) + +#define PTE1_PROMOTE (PTE1_V | PTE1_A | PTE1_NM | PTE1_S | PTE1_NG | \ + PTE1_NX | PTE1_RO | PTE1_U | PTE1_W | \ + PTE1_ATTR_MASK) + +#define ATTR_TO_L1(l2_attr) ((((l2_attr) & L2_TEX0) ? L1_S_TEX0 : 0) | \ + (((l2_attr) & L2_C) ? L1_S_C : 0) | \ + (((l2_attr) & L2_B) ? L1_S_B : 0) | \ + (((l2_attr) & PTE2_A) ? PTE1_A : 0) | \ + (((l2_attr) & PTE2_NM) ? PTE1_NM : 0) | \ + (((l2_attr) & PTE2_S) ? PTE1_S : 0) | \ + (((l2_attr) & PTE2_NG) ? PTE1_NG : 0) | \ + (((l2_attr) & PTE2_NX) ? PTE1_NX : 0) | \ + (((l2_attr) & PTE2_RO) ? PTE1_RO : 0) | \ + (((l2_attr) & PTE2_U) ? PTE1_U : 0) | \ + (((l2_attr) & PTE2_W) ? PTE1_W : 0)) + +#define ATTR_TO_L2(l1_attr) ((((l1_attr) & L1_S_TEX0) ? L2_TEX0 : 0) | \ + (((l1_attr) & L1_S_C) ? L2_C : 0) | \ + (((l1_attr) & L1_S_B) ? L2_B : 0) | \ + (((l1_attr) & PTE1_A) ? PTE2_A : 0) | \ + (((l1_attr) & PTE1_NM) ? PTE2_NM : 0) | \ + (((l1_attr) & PTE1_S) ? PTE2_S : 0) | \ + (((l1_attr) & PTE1_NG) ? PTE2_NG : 0) | \ + (((l1_attr) & PTE1_NX) ? PTE2_NX : 0) | \ + (((l1_attr) & PTE1_RO) ? PTE2_RO : 0) | \ + (((l1_attr) & PTE1_U) ? PTE2_U : 0) | \ + (((l1_attr) & PTE1_W) ? PTE2_W : 0)) + +/* + * PTE2 descriptors creation macros. + */ +#define PTE2_KPT(pa) PTE2_KERN(pa, PTE2_AP_KRW, pt_memattr) +#define PTE2_KPT_NG(pa) PTE2_KERN_NG(pa, PTE2_AP_KRW, pt_memattr) + +#define PTE2_KRW(pa) PTE2_KERN(pa, PTE2_AP_KRW, PTE2_ATTR_NORMAL) +#define PTE2_KRO(pa) PTE2_KERN(pa, PTE2_AP_KR, PTE2_ATTR_NORMAL) + +#define PV_STATS +#ifdef PV_STATS +#define PV_STAT(x) do { x ; } while (0) +#else +#define PV_STAT(x) do { } while (0) +#endif + +/* + * The boot_pt1 is used temporary in very early boot stage as L1 page table. + * We can init many things with no memory allocation thanks to its static + * allocation and this brings two main advantages: + * (1) other cores can be started very simply, + * (2) various boot loaders can be supported as its arguments can be processed + * in virtual address space and can be moved to safe location before + * first allocation happened. + * Only disadvantage is that boot_pt1 is used only in very early boot stage. + * However, the table is uninitialized and so lays in bss. Therefore kernel + * image size is not influenced. + * + * QQQ: In the future, maybe, boot_pt1 can be used for soft reset and + * CPU suspend/resume game. + */ +extern pt1_entry_t boot_pt1[]; + +vm_paddr_t base_pt1; +pt1_entry_t *kern_pt1; +pt2_entry_t *kern_pt2tab; +pt2_entry_t *PT2MAP; + +static uint32_t ttb_flags; +static vm_memattr_t pt_memattr; +ttb_entry_t pmap_kern_ttb; + +/* XXX use converion function*/ +#define PTE2_ATTR_NORMAL VM_MEMATTR_DEFAULT +#define PTE1_ATTR_NORMAL ATTR_TO_L1(PTE2_ATTR_NORMAL) + +struct pmap kernel_pmap_store; +LIST_HEAD(pmaplist, pmap); +static struct pmaplist allpmaps; +static struct mtx allpmaps_lock; + +vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ +vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */ + +static vm_offset_t kernel_vm_end_new; +vm_offset_t kernel_vm_end = KERNBASE + NKPT2PG * NPT2_IN_PG * PTE1_SIZE; +vm_offset_t vm_max_kernel_address; +vm_paddr_t kernel_l1pa; + +static struct rwlock __aligned(CACHE_LINE_SIZE) pvh_global_lock; + +/* + * Data for the pv entry allocation mechanism + */ +static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); +static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0; +static struct md_page *pv_table; /* XXX: Is it used only the list in md_page? */ +static int shpgperproc = PMAP_SHPGPERPROC; + +struct pv_chunk *pv_chunkbase; /* KVA block for pv_chunks */ +int pv_maxchunks; /* How many chunks we have KVA for */ +vm_offset_t pv_vafree; /* freelist stored in the PTE */ + +vm_paddr_t first_managed_pa; +#define pa_to_pvh(pa) (&pv_table[pte1_index(pa - first_managed_pa)]) + +/* + * All those kernel PT submaps that BSD is so fond of + */ +struct sysmaps { + struct mtx lock; + pt2_entry_t *CMAP1; + pt2_entry_t *CMAP2; + pt2_entry_t *CMAP3; + caddr_t CADDR1; + caddr_t CADDR2; + caddr_t CADDR3; +}; +static struct sysmaps sysmaps_pcpu[MAXCPU]; +static pt2_entry_t *CMAP3; +static caddr_t CADDR3; +caddr_t _tmppt = 0; + +struct msgbuf *msgbufp = 0; /* XXX move it to machdep.c */ + +/* + * Crashdump maps. + */ +static caddr_t crashdumpmap; + +static pt2_entry_t *PMAP1 = 0, *PMAP2; +static pt2_entry_t *PADDR1 = 0, *PADDR2; +#ifdef DDB +static pt2_entry_t *PMAP3; +static pt2_entry_t *PADDR3; +static int PMAP3cpu __unused; /* for SMP only */ +#endif +#ifdef SMP +static int PMAP1cpu; +static int PMAP1changedcpu; +SYSCTL_INT(_debug, OID_AUTO, PMAP1changedcpu, CTLFLAG_RD, + &PMAP1changedcpu, 0, + "Number of times pmap_pte2_quick changed CPU with same PMAP1"); +#endif +static int PMAP1changed; +SYSCTL_INT(_debug, OID_AUTO, PMAP1changed, CTLFLAG_RD, + &PMAP1changed, 0, + "Number of times pmap_pte2_quick changed PMAP1"); +static int PMAP1unchanged; +SYSCTL_INT(_debug, OID_AUTO, PMAP1unchanged, CTLFLAG_RD, + &PMAP1unchanged, 0, + "Number of times pmap_pte2_quick didn't change PMAP1"); +static struct mtx PMAP2mutex; + +static __inline void pt2_wirecount_init(vm_page_t m); +static boolean_t pmap_demote_pte1(pmap_t pmap, pt1_entry_t *pte1p, + vm_offset_t va); +void cache_icache_sync_fresh(vm_offset_t va, vm_paddr_t pa, vm_size_t size); + +/* + * Function to set the debug level of the pmap code. + */ +#ifdef PMAP_DEBUG +void +pmap_debug(int level) +{ + + pmap_debug_level = level; + dprintf("pmap_debug: level=%d\n", pmap_debug_level); +} +#endif /* PMAP_DEBUG */ + +/* + * This table must corespond with memory attribute configuration in vm.h. + * First entry is used for normal system mapping. + * + * Device memory is always marked as shared. + * Normal memory is shared only in SMP . + * Not outer shareable bits are not used yet. + * Class 6 cannot be used on ARM11. + */ +#define TEXDEF_TYPE_SHIFT 0 +#define TEXDEF_TYPE_MASK 0x3 +#define TEXDEF_INNER_SHIFT 2 +#define TEXDEF_INNER_MASK 0x3 +#define TEXDEF_OUTER_SHIFT 4 +#define TEXDEF_OUTER_MASK 0x3 +#define TEXDEF_NOS_SHIFT 6 +#define TEXDEF_NOS_MASK 0x1 + +#define TEX(t, i, o, s) \ + ((t) << TEXDEF_TYPE_SHIFT) | \ + ((i) << TEXDEF_INNER_SHIFT) | \ + ((o) << TEXDEF_OUTER_SHIFT | \ + ((s) << TEXDEF_NOS_SHIFT)) + +static uint32_t tex_class[8] = { +/* type inner cache outer cache */ + TEX(PRRR_MEM, NMRR_WB_WA, NMRR_WB_WA, 0), /* 0 - ATTR_WB_WA */ + TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 1 - ATTR_NOCACHE */ + TEX(PRRR_DEV, NMRR_NC, NMRR_NC, 0), /* 2 - ATTR_DEVICE */ + TEX(PRRR_SO, NMRR_NC, NMRR_NC, 0), /* 3 - ATTR_SO */ + TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 4 - NOT USED YET */ + TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 5 - NOT USED YET */ + TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 6 - NOT USED YET */ + TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 7 - NOT USED YET */ +}; +#undef TEX + +/* + * Convert TEX definition entry to TTB flags. + */ +static uint32_t +encode_ttb_flags(int idx) +{ + uint32_t inner, outer, nos, reg; + + inner = (tex_class[idx] >> TEXDEF_INNER_SHIFT) & + TEXDEF_INNER_MASK; + outer = (tex_class[idx] >> TEXDEF_OUTER_SHIFT) & + TEXDEF_OUTER_MASK; + nos = (tex_class[idx] >> TEXDEF_NOS_SHIFT) & + TEXDEF_NOS_MASK; + + reg = nos << 5; + reg |= outer << 3; + if (cpuinfo.coherent_walk) + reg |= (inner & 0x1) << 6; + reg |= (inner & 0x2) >> 1; +#ifdef SMP + reg |= 1 << 1; +#endif + return reg; +} + +/* + * Set TEX remapping registers in current CPU. + */ +void +pmap_set_tex(void) +{ + uint32_t prrr, nmrr; + uint32_t type, inner, outer, nos; + int i; + +#ifdef PMAP_PTE_NOCACHE + /* XXX fixme */ + if (cpuinfo.coherent_walk) { + pt_memattr = VM_MEMATTR_WB_WA; + ttb_flags = encode_ttb_flags(0); + } + else { + pt_memattr = VM_MEMATTR_NOCACHE; + ttb_flags = encode_ttb_flags(1); + } +#else + pt_memattr = VM_MEMATTR_WB_WA; + ttb_flags = encode_ttb_flags(0); +#endif + + prrr = 0; + nmrr = 0; + + /* Build remapping register from TEX classes. */ + for (i = 0; i < 8; i++) { + type = (tex_class[i] >> TEXDEF_TYPE_SHIFT) & + TEXDEF_TYPE_MASK; + inner = (tex_class[i] >> TEXDEF_INNER_SHIFT) & + TEXDEF_INNER_MASK; + outer = (tex_class[i] >> TEXDEF_OUTER_SHIFT) & + TEXDEF_OUTER_MASK; + nos = (tex_class[i] >> TEXDEF_NOS_SHIFT) & + TEXDEF_NOS_MASK; + + prrr |= type << (i * 2); + prrr |= nos << (i + 24); + nmrr |= inner << (i * 2); + nmrr |= outer << (i * 2 + 16); + } + /* Add shareable bits for device memory. */ + prrr |= PRRR_DS0 | PRRR_DS1; + + /* Add shareable bits for normal memory in SMP case. */ +#ifdef SMP + prrr |= PRRR_NS1; +#endif + cp15_prrr_set(prrr); + cp15_nmrr_set(nmrr); + + /* Caches are disabled, so full TLB flush should be enough. */ + tlb_flush_all_local(); +} + +/* + * KERNBASE must be multiple of NPT2_IN_PG * PTE1_SIZE. In other words, + * KERNBASE is mapped by first L2 page table in L2 page table page. It + * meets same constrain due to PT2MAP being placed just under KERNBASE. + */ +CTASSERT((KERNBASE & (NPT2_IN_PG * PTE1_SIZE - 1)) == 0); +CTASSERT((KERNBASE - VM_MAXUSER_ADDRESS) >= PT2MAP_SIZE); + +/* + * In crazy dreams, PAGE_SIZE could be a multiple of PTE2_SIZE in general. + * For now, anyhow, the following check must be fulfilled. + */ +CTASSERT(PAGE_SIZE == PTE2_SIZE); +/* + * We don't want to mess up MI code with all MMU and PMAP definitions, + * so some things, which depend on other ones, are defined independently. + * Now, it is time to check that we don't screw up something. + */ +CTASSERT(PDRSHIFT == PTE1_SHIFT); +/* + * Check L1 and L2 page table entries definitions consistency. + */ +CTASSERT(NB_IN_PT1 == (sizeof(pt1_entry_t) * NPTE1_IN_PT1)); +CTASSERT(NB_IN_PT2 == (sizeof(pt2_entry_t) * NPTE2_IN_PT2)); +/* + * Check L2 page tables page consistency. + */ +CTASSERT(PAGE_SIZE == (NPT2_IN_PG * NB_IN_PT2)); +CTASSERT((1 << PT2PG_SHIFT) == NPT2_IN_PG); +/* + * Check PT2TAB consistency. + * PT2TAB_ENTRIES is defined as a division of NPTE1_IN_PT1 by NPT2_IN_PG. + * This should be done without remainder. + */ +CTASSERT(NPTE1_IN_PT1 == (PT2TAB_ENTRIES * NPT2_IN_PG)); + +/* + * A PT2MAP magic. + * + * All level 2 page tables (PT2s) are mapped continuously and accordingly + * into PT2MAP address space. As PT2 size is less than PAGE_SIZE, this can + * be done only if PAGE_SIZE is a multiple of PT2 size. All PT2s in one page + * must be used together, but not necessary at once. The first PT2 in a page + * must map things on correctly aligned address and the others must follow + * in right order. + */ +#define NB_IN_PT2TAB (PT2TAB_ENTRIES * sizeof(pt2_entry_t)) +#define NPT2_IN_PT2TAB (NB_IN_PT2TAB / NB_IN_PT2) +#define NPG_IN_PT2TAB (NB_IN_PT2TAB / PAGE_SIZE) + +/* + * Check PT2TAB consistency. + * NPT2_IN_PT2TAB is defined as a division of NB_IN_PT2TAB by NB_IN_PT2. + * NPG_IN_PT2TAB is defined as a division of NB_IN_PT2TAB by PAGE_SIZE. + * The both should be done without remainder. + */ +CTASSERT(NB_IN_PT2TAB == (NPT2_IN_PT2TAB * NB_IN_PT2)); +CTASSERT(NB_IN_PT2TAB == (NPG_IN_PT2TAB * PAGE_SIZE)); +/* + * The implementation was made general, however, with the assumption + * bellow in mind. In case of another value of NPG_IN_PT2TAB, + * the code should be once more rechecked. + */ +CTASSERT(NPG_IN_PT2TAB == 1); + +/* + * Get offset of PT2 in a page + * associated with given PT1 index. + */ +static __inline u_int +page_pt2off(u_int pt1_idx) +{ + + return ((pt1_idx & PT2PG_MASK) * NB_IN_PT2); +} + +/* + * Get physical address of PT2 + * associated with given PT2s page and PT1 index. + */ +static __inline vm_paddr_t +page_pt2pa(vm_paddr_t pgpa, u_int pt1_idx) +{ + + return (pgpa + page_pt2off(pt1_idx)); +} + +/* + * Get first entry of PT2 + * associated with given PT2s page and PT1 index. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 21:58:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F946713; Thu, 26 Mar 2015 21: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 00B4BF62; Thu, 26 Mar 2015 21:58:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QLw6Yw014615; Thu, 26 Mar 2015 21:58:06 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QLw6v2014614; Thu, 26 Mar 2015 21:58:06 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201503262158.t2QLw6v2014614@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 26 Mar 2015 21:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280713 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:58:07 -0000 Author: jilles Date: Thu Mar 26 21:58:06 2015 New Revision: 280713 URL: https://svnweb.freebsd.org/changeset/base/280713 Log: setmode(): Use sysctl kern.proc.umask instead of umask() if possible. The kern.proc.umask. sysctl allows querying the umask without temporarily modifying it. Modified: head/lib/libc/gen/setmode.c Modified: head/lib/libc/gen/setmode.c ============================================================================== --- head/lib/libc/gen/setmode.c Thu Mar 26 21:13:53 2015 (r280712) +++ head/lib/libc/gen/setmode.c Thu Mar 26 21:58:06 2015 (r280713) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #include #include @@ -68,6 +69,7 @@ typedef struct bitcmd { #define CMD2_OBITS 0x08 #define CMD2_UBITS 0x10 +static mode_t getumask(void); static BITCMD *addcmd(BITCMD *, mode_t, mode_t, mode_t, mode_t); static void compress_mode(BITCMD *); #ifdef SETMODE_DEBUG @@ -169,7 +171,6 @@ setmode(const char *p) int serrno; char op, *ep; BITCMD *set, *saveset, *endset; - sigset_t sigset, sigoset; mode_t mask, perm, permXbits, who; long perml; int equalopdone; @@ -182,15 +183,9 @@ setmode(const char *p) /* * Get a copy of the mask for the permissions that are mask relative. - * Flip the bits, we want what's not set. Since it's possible that - * the caller is opening files inside a signal handler, protect them - * as best we can. + * Flip the bits, we want what's not set. */ - sigfillset(&sigset); - (void)_sigprocmask(SIG_BLOCK, &sigset, &sigoset); - (void)umask(mask = umask(0)); - mask = ~mask; - (void)_sigprocmask(SIG_SETMASK, &sigoset, NULL); + mask = ~getumask(); setlen = SET_LEN + 2; @@ -346,6 +341,35 @@ out: return NULL; } +static mode_t +getumask(void) +{ + sigset_t sigset, sigoset; + size_t len; + mode_t mask; + u_short smask; + + /* + * First try requesting the umask without temporarily modifying it. + * Note that this does not work if the sysctl + * security.bsd.unprivileged_proc_debug is set to 0. + */ + len = sizeof(smask); + if (sysctl((int[4]){ CTL_KERN, KERN_PROC, KERN_PROC_UMASK, getpid() }, + 4, &smask, &len, NULL, 0) == 0) + return (smask); + + /* + * Since it's possible that the caller is opening files inside a signal + * handler, protect them as best we can. + */ + sigfillset(&sigset); + (void)_sigprocmask(SIG_BLOCK, &sigset, &sigoset); + (void)umask(mask = umask(0)); + (void)_sigprocmask(SIG_SETMASK, &sigoset, NULL); + return (mask); +} + static BITCMD * addcmd(BITCMD *set, mode_t op, mode_t who, mode_t oparg, mode_t mask) { From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 22:05:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65F70B65; Thu, 26 Mar 2015 22:05: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 36B1DAA; Thu, 26 Mar 2015 22:05:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QM5Xu1019182; Thu, 26 Mar 2015 22:05:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QM5WPY019180; Thu, 26 Mar 2015 22:05:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503262205.t2QM5WPY019180@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 26 Mar 2015 22:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280714 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 22:05:33 -0000 Author: tuexen Date: Thu Mar 26 22:05:31 2015 New Revision: 280714 URL: https://svnweb.freebsd.org/changeset/base/280714 Log: Improve the selection of the destination address of SACK chunks. This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196755 and is joint work with rrs@. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctp_structs.h Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Mar 26 21:58:06 2015 (r280713) +++ head/sys/netinet/sctp_output.c Thu Mar 26 22:05:31 2015 (r280714) @@ -10409,32 +10409,17 @@ sctp_send_sack(struct sctp_tcb *stcb, in a_chk->sent = SCTP_DATAGRAM_UNSENT; a_chk->whoTo = NULL; - if ((asoc->numduptsns) || - (!(asoc->last_data_chunk_from->dest_state & SCTP_ADDR_REACHABLE))) { + if (!(asoc->last_data_chunk_from->dest_state & SCTP_ADDR_REACHABLE)) { /*- - * Ok, we have some duplicates or the destination for the - * sack is unreachable, lets see if we can select an - * alternate than asoc->last_data_chunk_from + * Ok, the destination for the SACK is unreachable, lets see if + * we can select an alternate to asoc->last_data_chunk_from */ - if ((asoc->last_data_chunk_from->dest_state & SCTP_ADDR_REACHABLE) && - (asoc->used_alt_onsack > asoc->numnets)) { - /* We used an alt last time, don't this time */ - a_chk->whoTo = NULL; - } else { - asoc->used_alt_onsack++; - a_chk->whoTo = sctp_find_alternate_net(stcb, asoc->last_data_chunk_from, 0); - } + a_chk->whoTo = sctp_find_alternate_net(stcb, asoc->last_data_chunk_from, 0); if (a_chk->whoTo == NULL) { /* Nope, no alternate */ a_chk->whoTo = asoc->last_data_chunk_from; - asoc->used_alt_onsack = 0; } } else { - /* - * No duplicates so we use the last place we received data - * from. - */ - asoc->used_alt_onsack = 0; a_chk->whoTo = asoc->last_data_chunk_from; } if (a_chk->whoTo) { Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Thu Mar 26 21:58:06 2015 (r280713) +++ head/sys/netinet/sctp_structs.h Thu Mar 26 22:05:31 2015 (r280714) @@ -1174,7 +1174,6 @@ struct sctp_association { struct sctp_scoping scope; /* flags to handle send alternate net tracking */ - uint8_t used_alt_onsack; uint8_t used_alt_asconfack; uint8_t fast_retran_loss_recovery; uint8_t sat_t3_loss_recovery; From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 22:34:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9E1F2AF; Thu, 26 Mar 2015 22:34: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 A43AA3E3; Thu, 26 Mar 2015 22:34:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QMYSUH033059; Thu, 26 Mar 2015 22:34:28 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QMYSKf033058; Thu, 26 Mar 2015 22:34:28 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201503262234.t2QMYSKf033058@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 26 Mar 2015 22:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280716 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 22:34:28 -0000 Author: delphij Date: Thu Mar 26 22:34:27 2015 New Revision: 280716 URL: https://svnweb.freebsd.org/changeset/base/280716 Log: - Correct type for checkAgainst. - Staticify flags that are not used outside the file scope. PR: bin/193471 Submitted by: Robert Sprowson MFC after: 2 weeks Modified: head/sbin/md5/md5.c Modified: head/sbin/md5/md5.c ============================================================================== --- head/sbin/md5/md5.c Thu Mar 26 22:31:55 2015 (r280715) +++ head/sbin/md5/md5.c Thu Mar 26 22:34:27 2015 (r280716) @@ -42,11 +42,11 @@ __FBSDID("$FreeBSD$"); #define TEST_BLOCK_COUNT 100000 #define MDTESTCOUNT 8 -int qflag; -int rflag; -int sflag; -unsigned char* checkAgainst; -int checksFailed; +static int qflag; +static int rflag; +static int sflag; +static char* checkAgainst; +static int checksFailed; typedef void (DIGEST_Init)(void *); typedef void (DIGEST_Update)(void *, const unsigned char *, size_t); From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 22:37:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E49C5504; Thu, 26 Mar 2015 22:37:09 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AD9AA5EB; Thu, 26 Mar 2015 22:37:09 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t2QMb2EC009428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Mar 2015 15:37:02 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t2QMb2V3009427; Thu, 26 Mar 2015 15:37:02 -0700 (PDT) (envelope-from jmg) Date: Thu, 26 Mar 2015 15:37:02 -0700 From: John-Mark Gurney To: Hans Petter Selasky Subject: Re: svn commit: r280442 - head/sys/dev/sound/pcm Message-ID: <20150326223701.GO51048@funkthat.com> References: <201503241631.t2OGVNwe060578@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503241631.t2OGVNwe060578@svn.freebsd.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 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? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Thu, 26 Mar 2015 15:37: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-1 Precedence: list List-Id: SVN 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 Mar 2015 22:37:10 -0000 Hans Petter Selasky wrote this message on Tue, Mar 24, 2015 at 16:31 +0000: > Author: hselasky > Date: Tue Mar 24 16:31:22 2015 > New Revision: 280442 > URL: https://svnweb.freebsd.org/changeset/base/280442 > > Log: > Make all PCM core sysctls tunable and remove redundant TUNABLE() > statements. This allows for setting all PCM core parameters in the > kernel environment through loader.conf(5) or kenv(1) which is useful > for pluggable PCM devices like USB audio devices which might be > plugged after that sysctl.conf(5) is executed. should we make sysctl.conf set all vars as tunables too then? -- 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 26 23:37:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67FB8D70; Thu, 26 Mar 2015 23:37: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 53058C79; Thu, 26 Mar 2015 23:37:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QNb4uT062762; Thu, 26 Mar 2015 23:37:04 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QNb4r2062761; Thu, 26 Mar 2015 23:37:04 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201503262337.t2QNb4r2062761@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Thu, 26 Mar 2015 23:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280719 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:37:04 -0000 Author: rodrigc Date: Thu Mar 26 23:37:03 2015 New Revision: 280719 URL: https://svnweb.freebsd.org/changeset/base/280719 Log: Add --sysroot to the compiler flags for clang or gcc external toolchains Before this fix, --sysroot was only added to the compiler flags if a clang external toolchain was used. Reviewed by: imp Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Mar 26 22:50:35 2015 (r280718) +++ head/Makefile.inc1 Thu Mar 26 23:37:03 2015 (r280719) @@ -384,9 +384,9 @@ DEPFLAGS+= -I${WORLDTMP}/usr/include/c++ TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XCFLAGS+= -target ${TARGET_TRIPLE} +.endif XCFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS} XCXXFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS} -.endif .else .if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX}) BFLAGS+= -B${CROSS_BINUTILS_PREFIX} From owner-svn-src-head@FreeBSD.ORG Thu Mar 26 23:40:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1083122; Thu, 26 Mar 2015 23:40: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 9C06BCA8; Thu, 26 Mar 2015 23:40:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2QNeNtZ063282; Thu, 26 Mar 2015 23:40:23 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2QNeNfS063281; Thu, 26 Mar 2015 23:40:23 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503262340.t2QNeNfS063281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 26 Mar 2015 23:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280720 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:40:23 -0000 Author: ae Date: Thu Mar 26 23:40:22 2015 New Revision: 280720 URL: https://svnweb.freebsd.org/changeset/base/280720 Log: Fix a possible mbuf leak on interface departure. Reported by: Alexandre Martins Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Mar 26 23:37:03 2015 (r280719) +++ head/sys/net/if_lagg.c Thu Mar 26 23:40:22 2015 (r280720) @@ -1669,7 +1669,11 @@ lagg_input(struct ifnet *ifp, struct mbu ETHER_BPF_MTAP(scifp, m); - m = (lp->lp_detaching == 0) ? lagg_proto_input(sc, lp, m) : NULL; + if (lp->lp_detaching != 0) { + m_freem(m); + m = NULL; + } else + m = lagg_proto_input(sc, lp, m); if (m != NULL) { if (scifp->if_flags & IFF_MONITOR) { From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 00:37:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87E368A4; Fri, 27 Mar 2015 00: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 5848536C; Fri, 27 Mar 2015 00:37:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R0bgU9091803; Fri, 27 Mar 2015 00:37:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R0bg6g091798; Fri, 27 Mar 2015 00:37:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503270037.t2R0bg6g091798@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 27 Mar 2015 00:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280721 - in head: etc/defaults etc/periodic/daily 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-1 Precedence: list List-Id: SVN 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 Mar 2015 00:37:43 -0000 Author: jhb Date: Fri Mar 27 00:37:41 2015 New Revision: 280721 URL: https://svnweb.freebsd.org/changeset/base/280721 Log: Allow additional flags to be passed to netstat -i in the daily status check. In particular, this allows an administrator to specify "-h" for human readable output if that is preferred. The default setting passes "-d", so that can be excluded by using a custom setting. Differential Revision: https://reviews.freebsd.org/D2034 Submitted by: Lystopad Aleksandr (patch to add option for -h) Reviewed by: bz MFC after: 1 week Modified: head/etc/defaults/periodic.conf head/etc/periodic/daily/420.status-network head/share/man/man5/periodic.conf.5 Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Thu Mar 26 23:40:22 2015 (r280720) +++ head/etc/defaults/periodic.conf Fri Mar 27 00:37:41 2015 (r280721) @@ -113,6 +113,7 @@ daily_status_gconcat_enable="NO" # Che # 420.status-network daily_status_network_enable="YES" # Check network status daily_status_network_usedns="YES" # DNS lookups are ok +daily_status_network_netstat_flags="-d" # netstat(1) flags # 430.status-rwho daily_status_rwho_enable="YES" # Check system status Modified: head/etc/periodic/daily/420.status-network ============================================================================== --- head/etc/periodic/daily/420.status-network Thu Mar 26 23:40:22 2015 (r280720) +++ head/etc/periodic/daily/420.status-network Fri Mar 27 00:37:41 2015 (r280721) @@ -16,12 +16,14 @@ case "$daily_status_network_enable" in echo "" echo "Network interface status:" + flags="${daily_status_network_netstat_flags}" case "$daily_status_network_usedns" in [Yy][Ee][Ss]) - netstat -id && rc=0 || rc=3;; + ;; *) - netstat -idn && rc=0 || rc=3;; - esac;; + flags="${flags} -n";; + esac + netstat -i ${flags} && rc=0 || rc=3;; *) rc=0;; esac Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Thu Mar 26 23:40:22 2015 (r280720) +++ head/share/man/man5/periodic.conf.5 Fri Mar 27 00:37:41 2015 (r280721) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2015 +.Dd March 26, 2015 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -401,6 +401,16 @@ Set to .Dq Li YES if you want to run .Nm netstat Fl i . +.It Va daily_status_network_netstat_flags +.Pq Vt str +Set to additional arguments for the +.Xr netstat 1 +utility when +.Va daily_status_network_enable +is set to +.Dq Li YES . +The default is +.Fl d . .It Va daily_status_network_usedns .Pq Vt bool Set to From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 00:40:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6959A5C; Fri, 27 Mar 2015 00:40:31 +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 80CD438F; Fri, 27 Mar 2015 00:40:31 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 63A34D6384D; Fri, 27 Mar 2015 11:40:28 +1100 (AEDT) Date: Fri, 27 Mar 2015 11:40:27 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" Subject: Re: svn commit: r280700 - head/sys/sys In-Reply-To: <201503261600.t2QG0as2045101@svn.freebsd.org> Message-ID: <20150327104018.D994@besplex.bde.org> References: <201503261600.t2QG0as2045101@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=ZuzUdbLG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=9wEU9czeM3SnHlj6lUEA: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-1 Precedence: list List-Id: SVN 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 Mar 2015 00:40:32 -0000 On Thu, 26 Mar 2015, Pedro F. Giffuni wrote: > Log: > Introduce some allocation function attributes. > > Bring support for two gcc function attributes that are likely to be used > in our system headers: > ... > The __alloc_size attribute required some workarounds for lint(1). > Both attributes are supported by clang. It is broken for all non-C99 compilers, the same as __nonull(). lint may be one of these, depending on implementation details and on how well it supports non-C99 mode (I think it knows almost nothing of C99, but uses cpp and is not careful to kill C99 features). FreeBSD even has a non-C90 compiler (modulo bugs). It is named c89. Even the compilers that implement most of C99 have a C90 mode. This is specifed by the compiler flag -std=c89 or -std=gnu89. The follow breakage happens for ... and/or __VA_ARGS__: - c89 -E on ... alone q.c:1:13: warning: variadic macros are a C99 feature [-Wvariadic-macros] #define foo(...) ^ foo(1, 2, 3) then expands to nothing. - c89 -E on ... and __VA_ARGS__: Same warning. __VA_ARGS__ then expands as in C99. - clang -E -std=c89: Same as in C99. -std=c89 is not very std. - clang -E -std=c89 -pedantic Same as for c89. c89 uses -pedantic so as to be more std. - gcc295 -E -std=c89: z.c:1: warning: invalid character in macro parameter name z.c:1: badly punctuated parameter list in `#define' foo(1, 2, 3) then expands to nothing for the empty macro and __VA_ARGS__ expands as in C99. -std=c89 actually works for gcc295 - gcc34 -E -std=c89 [-pedantic], - gcc42 -E -std=c89 [-pedantic]: Like clang, but with a better error message: q.c:1:13: warning: anonymous variadic macros were introduced in C99 - gcc48 -E -std=c89 [-pedantic]: Like clang, except the error message has not regressed so far (it is verbose as in clang, but missing colorization). - TenDRA 5.0.0 (an actual C90 compiler. I sometimes use this for its better diagnostics. Though very verbose, the references to C90 section numbers are useful): "z4.c", line 1: Error: [ISO C90 6.8.3]: Badly punctuated parameters for macro 'foo'. "z4.c", line 3: Error: [ISO C90 6.8.3]: Macro 'foo' applied with 3 arguments, not 0. TenDRA has its own headers which are very clean, but to use it even to do syntax checks, you have to use the system headers (tcc -Ysystem). > Modified: head/sys/sys/cdefs.h > ============================================================================== > --- head/sys/sys/cdefs.h Thu Mar 26 15:54:54 2015 (r280699) > +++ head/sys/sys/cdefs.h Thu Mar 26 16:00:35 2015 (r280700) > @@ -209,6 +212,7 @@ > #define __unused > #define __packed > #define __aligned(x) > +#define __alloc_size(...) > #define __section(x) > #define __weak > #else The first bug is here. This is for lint. This is supposed to give a null macro, but actually gives a syntax error except for C99 compilers. > @@ -233,6 +237,11 @@ > #define __aligned(x) __attribute__((__aligned__(x))) > #define __section(x) __attribute__((__section__(x))) > #endif > +#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) > +#define __alloc_size(...) __attribute__((alloc_size(__VA_ARGS__))) This is broken by namespace pollution. alloc_size is in the application namespace. It must be spelled with underscores like all the other attributes in the macros. The "..." in this is broken in c89 mode. Passing the #if only guarantees that the attribute is supported. It doesn't guarantee that "..." is supported. The name of the attribute may be relevant here too. We want most the special macros to work in c89 and other strict standard modes. Their names are spelled with underscores to make this possible. Standard modes turn off gcc features like asm() and even "inline". Perhaps they do the same for alloc_size(). > +#else > +#define __alloc_size(...) > +#endif Similarly for all hard-coded uses of "...". This #else clause is supposed to give compatibility for all compilers that don't support alloc_size(). But most of these compilers also don't support "...", so this almost never works. > @@ -363,8 +372,10 @@ > > #if __GNUC_PREREQ__(3, 4) > #define __fastcall __attribute__((__fastcall__)) > +#define __result_use_check __attribute__((__warn_unused_result__)) > #else > #define __fastcall > +#define __result_use_check > #endif Changes like this are correct since they don't depend on compiler-[option]- dependent syntactic features. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 01:29:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 028FD5BD for ; Fri, 27 Mar 2015 01:29:01 +0000 (UTC) Received: from nm28.bullet.mail.bf1.yahoo.com (nm28.bullet.mail.bf1.yahoo.com [98.139.212.187]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFA00A24 for ; Fri, 27 Mar 2015 01:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1427419738; bh=+Zm2L2dj4emWqg91Cd3XpzAheHaT742fFh4s8LVKSaE=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=ewKDX3yzHNG1nwrvEbMm5mXZEFpQRDQrNOGEFEjVaGOkA3EWB97h2bFJFqK/i6cpqqHei/lWd69nsouGUSFLPeN4hr13cCV3wfIwUWt3h7Po2V/nDi8tUGnaQcCqRjK/Ppp6ZdtbV3nr+Oc7UzH72p4FlRnbQysRHZ1RiqoNy6mjiNzCeMFGFpe58UHuDVhxotZDD5bYrDuqyeqVrApgk8Z0+ceuDT9xud/KqRUxzb0gHuFrBEDvOXaCJah5tabnbAFsMbRk1GWNI528KqAxoDqxEDck5U7XuLpcy6zlQl1fMRssgO3uk1sGOb8wLa+ph2zKmTajEsD5YVjFtfmB7g== Received: from [98.139.170.178] by nm28.bullet.mail.bf1.yahoo.com with NNFMP; 27 Mar 2015 01:28:58 -0000 Received: from [98.139.213.14] by tm21.bullet.mail.bf1.yahoo.com with NNFMP; 27 Mar 2015 01:28:58 -0000 Received: from [127.0.0.1] by smtp114.mail.bf1.yahoo.com with NNFMP; 27 Mar 2015 01:28:58 -0000 X-Yahoo-Newman-Id: 747230.74692.bm@smtp114.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Eao.k9MVM1m2rNkeaBcUeXHZQYiAK1WOMtwOC0uz2RhBYfI kHCOCae29ytWqvt7.FxPOhdX8Jxg04Zj7F9rvu4WWxJ6w6FtF4DWS9FRucHl kZ9BfoXrCE_LV_HPmoyJKIULEmlK8lvt0iFCOc8WqsCXaDj_lFDiqRWmuiyz lp_zwvL3BXgVxaki92rNta9kfUILBRFiZGSmGb5prKFKTl6HhAH7XZd1jBGX 9fb2ntdlHA6vb6CJQ2qvV1iwq7u4VviRKoM4EBvKtPQN4CPhT6fswh22p.Cx xR4sv6Sc5DROWrR1657fKbPAx0g_63cNeBmrriTYlu2CAntfCv3QU0x96l6. xAznR1TOkFnIt6fRIHjw4yu.bZpgS5fa2wQSQJwht8gO1IXikH8NOBrccQCE 1xWu4BsVOmrpKh5HIQY72_tRhNEHHY4z6UTyvsgUtDBhG_xGVf3_srnlLQQl wMGCKLKSz6GRbNtGVFwxtRaa2jAU8g9bkAcujsrY8b766MOCb.o76gQAx0rG OLqWedtEaAkwrbfUYY5V3APJV_Q4lLOkd X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r280700 - head/sys/sys From: Pedro Giffuni In-Reply-To: <20150327104018.D994@besplex.bde.org> Date: Thu, 26 Mar 2015 20:28:54 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <2EC15229-DE96-4200-A905-803028B22707@FreeBSD.org> References: <201503261600.t2QG0as2045101@svn.freebsd.org> <20150327104018.D994@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-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-1 Precedence: list List-Id: SVN 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 Mar 2015 01:29:01 -0000 > Il giorno 26/mar/2015, alle ore 19:40, Bruce Evans = ha scritto: >=20 > On Thu, 26 Mar 2015, Pedro F. Giffuni wrote: >=20 >> Log: >> Introduce some allocation function attributes. >>=20 >> Bring support for two gcc function attributes that are likely to be = used >> in our system headers: >> ... >> The __alloc_size attribute required some workarounds for lint(1). >> Both attributes are supported by clang. >=20 > It is broken for all non-C99 compilers, the same as __nonull(). lint > may be one of these, depending on implementation details and on how > well it supports non-C99 mode (I think it knows almost nothing of > C99, but uses cpp and is not careful to kill C99 features). >=20 It is not a bug, it=E2=80=99s a feature. I did check and variadic macros were introduced in gcc 2.95. the = __nonnull() stuff requires gcc 3.3. __alloc_size requires gcc 4.3. All compilers we = use in base and support in FreeBSD have the feature. For the base system it doesn=E2=80=99t really make sense to hold new = features to support inferior compilers. If you need an older compiler it may be = perhaps to support a new platform and I recall gcc 2.95 doesn=E2=80=99t even = support amd64. > FreeBSD even has a non-C90 compiler (modulo bugs). It is named c89. = Even the compilers that implement most of C99 have a C90 mode. This > is specifed by the compiler flag -std=3Dc89 or -std=3Dgnu89. >=20 OK. you can cause breakage by using old modes.This may have to be = evaluated running an exp run on the ports tree. =20 > The follow breakage happens for ... and/or __VA_ARGS__: >=20 > - c89 -E on ... alone > q.c:1:13: warning: variadic macros are a C99 feature = [-Wvariadic-macros] > #define foo(...) > ^ > foo(1, 2, 3) then expands to nothing. >=20 > - c89 -E on ... and __VA_ARGS__: > Same warning. __VA_ARGS__ then expands as in C99. >=20 > - clang -E -std=3Dc89: > Same as in C99. -std=3Dc89 is not very std. >=20 > - clang -E -std=3Dc89 -pedantic > Same as for c89. c89 uses -pedantic so as to be more std. >=20 > - gcc295 -E -std=3Dc89: > z.c:1: warning: invalid character in macro parameter name > z.c:1: badly punctuated parameter list in `#define' >=20 > foo(1, 2, 3) then expands to nothing for the empty macro > and __VA_ARGS__ expands as in C99. -std=3Dc89 actually works > for gcc295 >=20 > - gcc34 -E -std=3Dc89 [-pedantic], > - gcc42 -E -std=3Dc89 [-pedantic]: > Like clang, but with a better error message: >=20 > q.c:1:13: warning: anonymous variadic macros were introduced in C99 >=20 > - gcc48 -E -std=3Dc89 [-pedantic]: > Like clang, except the error message has not regressed so far (it > is verbose as in clang, but missing colorization). >=20 The above are all warnings. You can usually get around those by setting options and those won=E2=80=99t stop your code from building. > - TenDRA 5.0.0 (an actual C90 compiler. I sometimes use this for its > better diagnostics. Though very verbose, the references to C90 > section numbers are useful): >=20 TenDRA is awesome. I recall it uses it=E2=80=99s own C headers with = different compatibility modes so it won=E2=80=99t be affected by cdefs.h and the use of such macros in = our headers. > "z4.c", line 1: Error: > [ISO C90 6.8.3]: Badly punctuated parameters for macro 'foo'. >=20 > "z4.c", line 3: Error: > [ISO C90 6.8.3]: Macro 'foo' applied with 3 arguments, not 0. >=20 > TenDRA has its own headers which are very clean, but to use it > even to do syntax checks, you have to use the system headers > (tcc -Ysystem). >=20 >> Modified: head/sys/sys/cdefs.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/cdefs.h Thu Mar 26 15:54:54 2015 = (r280699) >> +++ head/sys/sys/cdefs.h Thu Mar 26 16:00:35 2015 = (r280700) >> @@ -209,6 +212,7 @@ >> #define __unused >> #define __packed >> #define __aligned(x) >> +#define __alloc_size(...) >> #define __section(x) >> #define __weak >> #else >=20 > The first bug is here. This is for lint. This is supposed to give a > null macro, but actually gives a syntax error except for C99 = compilers. >=20 I tried to update lint and fix it. I did the former and I failed the = later. Other BSDs (Dragonfly and OpenBSD) were less patient ;). Compilers without some level of C99 compliance are likely to have much = bigger problems to compile FreeBSD. If someone with real need for such support submits s = fix I=E2=80=99ll be glad to commit it, but at this time I would really like to use __alloc_size( = 1, 2) for calloc(). >> @@ -233,6 +237,11 @@ >> #define __aligned(x) __attribute__((__aligned__(x))) >> #define __section(x) __attribute__((__section__(x))) >> #endif >> +#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) >> +#define __alloc_size(...) = __attribute__((alloc_size(__VA_ARGS__))) >=20 > This is broken by namespace pollution. alloc_size is in the = application > namespace. It must be spelled with underscores like all the other > attributes in the macros. >=20 I overlooked that, thank you! > The "..." in this is broken in c89 mode. Passing the #if only = guarantees > that the attribute is supported. It doesn't guarantee that "..." is > supported. The name of the attribute may be relevant here too. We = want > most the special macros to work in c89 and other strict standard = modes. > Their names are spelled with underscores to make this possible. = Standard > modes turn off gcc features like asm() and even "inline". Perhaps = they > do the same for alloc_size(). >=20 >> +#else >> +#define __alloc_size(...) >> +#endif >=20 > Similarly for all hard-coded uses of "...". This #else clause is = supposed > to give compatibility for all compilers that don't support = alloc_size(). > But most of these compilers also don't support "...", so this almost > never works. >=20 >> @@ -363,8 +372,10 @@ >>=20 >> #if __GNUC_PREREQ__(3, 4) >> #define __fastcall __attribute__((__fastcall__)) >> +#define __result_use_check = __attribute__((__warn_unused_result__)) >> #else >> #define __fastcall >> +#define __result_use_check >> #endif >=20 > Changes like this are correct since they don't depend on = compiler-[option]- > dependent syntactic features. >=20 Pedro. From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 01:58:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E101BF6E; Fri, 27 Mar 2015 01: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 B21FDD24; Fri, 27 Mar 2015 01:58:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R1wkTq028895; Fri, 27 Mar 2015 01:58:46 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R1wj6Y028888; Fri, 27 Mar 2015 01:58:45 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201503270158.t2R1wj6Y028888@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Fri, 27 Mar 2015 01:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280725 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 01:58:47 -0000 Author: grehan Date: Fri Mar 27 01:58:44 2015 New Revision: 280725 URL: https://svnweb.freebsd.org/changeset/base/280725 Log: Move legacy interrupt allocation for virtio devices to common code. There are a number of assumptions about legacy interrupts always being available in virtio so don't allow back-ends to make the decision to support them. This fixes the issue seen with virtio-rnd on OpenBSD. MSI-x vectors were not being used, and the virtio-rnd backend wasn't allocating a legacy interrupt resulting in a bhyve assert and guest exit. Reported by: Julian Hsiao, madoka at nyanisore dot net Reviewed by: neel MFC after: 1 week Modified: head/usr.sbin/bhyve/pci_virtio_block.c head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/virtio.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 01:48:54 2015 (r280724) +++ head/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 01:58:44 2015 (r280725) @@ -370,8 +370,6 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_STORAGE); pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_BLOCK); - pci_lintr_request(pi); - if (vi_intr_init(&sc->vbsc_vs, 1, fbsdrun_virtio_msix())) { blockif_close(sc->bc); free(sc); Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Fri Mar 27 01:48:54 2015 (r280724) +++ head/usr.sbin/bhyve/pci_virtio_net.c Fri Mar 27 01:58:44 2015 (r280725) @@ -640,8 +640,6 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_NETWORK); pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_NET); - pci_lintr_request(pi); - /* link always up */ sc->vsc_config.status = 1; Modified: head/usr.sbin/bhyve/virtio.c ============================================================================== --- head/usr.sbin/bhyve/virtio.c Fri Mar 27 01:48:54 2015 (r280724) +++ head/usr.sbin/bhyve/virtio.c Fri Mar 27 01:58:44 2015 (r280725) @@ -148,8 +148,13 @@ vi_intr_init(struct virtio_softc *vs, in return (1); } else vs->vs_flags &= ~VIRTIO_USE_MSIX; + /* Only 1 MSI vector for bhyve */ pci_emul_add_msicap(vs->vs_pi, 1); + + /* Legacy interrupts are mandatory for virtio devices */ + pci_lintr_request(vs->vs_pi); + return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 02:01:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7BC2164; Fri, 27 Mar 2015 02: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 B9A40DCA; Fri, 27 Mar 2015 02:01:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R21NrX030362; Fri, 27 Mar 2015 02:01:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R21NvR030361; Fri, 27 Mar 2015 02:01:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503270201.t2R21NvR030361@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 27 Mar 2015 02:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280726 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:01:24 -0000 Author: pfg Date: Fri Mar 27 02:01:22 2015 New Revision: 280726 URL: https://svnweb.freebsd.org/changeset/base/280726 Log: Fix __size_alloc() Use underscore for the attributes name: this should fix the use of the attributes in macros for lint(1). Suggested by: bde X-MFC with: r280700 Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Mar 27 01:58:44 2015 (r280725) +++ head/sys/sys/cdefs.h Fri Mar 27 02:01:22 2015 (r280726) @@ -212,7 +212,6 @@ #define __unused #define __packed #define __aligned(x) -#define __alloc_size(...) #define __section(x) #define __weak #else @@ -237,11 +236,6 @@ #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #endif -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) -#define __alloc_size(...) __attribute__((alloc_size(__VA_ARGS__))) -#else -#define __alloc_size(...) -#endif #if defined(__INTEL_COMPILER) #define __dead2 __attribute__((__noreturn__)) #define __pure2 __attribute__((__const__)) @@ -384,6 +378,12 @@ #define __returns_twice #endif +#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) +#define __alloc_size(...) __attribute__((__alloc_size__(__VA_ARGS__))) +#else +#define __alloc_size(...) +#endif + /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ #if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) #define __func__ NULL From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 02:35:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAD9B7D2; Fri, 27 Mar 2015 02:35: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 9C449CE; Fri, 27 Mar 2015 02:35:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R2ZC6Q047156; Fri, 27 Mar 2015 02:35:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R2ZCwp047154; Fri, 27 Mar 2015 02:35:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503270235.t2R2ZCwp047154@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 27 Mar 2015 02:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280727 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:35:12 -0000 Author: imp Date: Fri Mar 27 02:35:11 2015 New Revision: 280727 URL: https://svnweb.freebsd.org/changeset/base/280727 Log: Add support for specifying unsupported / broken options that override any defaults or user specified actions on the command line. This would be useful for specifying features that are always broken or that cannot make sense on a specific architecture, like ACPI on pc98 or EISA on !i386 (!x86 usage of EISA is broken and there's no supported hardware that could have it in any event). Any items in __ALWAYS_NO_OPTIONS are forced to "no" regardless of other settings. Differential Revision: https://reviews.freebsd.org/D2011 Modified: head/share/mk/bsd.mkopt.mk head/sys/conf/kern.opts.mk Modified: head/share/mk/bsd.mkopt.mk ============================================================================== --- head/share/mk/bsd.mkopt.mk Fri Mar 27 02:01:22 2015 (r280726) +++ head/share/mk/bsd.mkopt.mk Fri Mar 27 02:35:11 2015 (r280727) @@ -67,6 +67,15 @@ MK_${var}:= no # MK_* options which are always no, usually because they are # unsupported/badly broken on this architecture. # +.for var in ${__ALWAYS_NO_OPTIONS} +MK_${var}:= no +.endfor +.undef __ALWAYS_NO_OPTIONS + +# +# MK_* options which are always no, usually because they are +# unsupported/badly broken on this architecture. +# .for var in ${BROKEN_OPTIONS} MK_${var}:= no .endfor Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Fri Mar 27 02:01:22 2015 (r280726) +++ head/sys/conf/kern.opts.mk Fri Mar 27 02:35:11 2015 (r280727) @@ -120,6 +120,16 @@ MK_${var}:= no #end of bsd.mkopt.mk expanded inline. # +# MK_* options which are always no, usually because they are +# unsupported/badly broken on this architecture. +# +.for var in ${__ALWAYS_NO_OPTIONS} +MK_${var}:= no +.endfor +.undef __ALWAYS_NO_OPTIONS +#end of bsd.mkopt.mk expanded inline. + +# # MK_*_SUPPORT options which default to "yes" unless their corresponding # MK_* variable is set to "no". # From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 02:35:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D63D890E; Fri, 27 Mar 2015 02: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1A7AD3; Fri, 27 Mar 2015 02:35:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R2ZQLb047221; Fri, 27 Mar 2015 02:35:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R2ZQeA047220; Fri, 27 Mar 2015 02:35:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503270235.t2R2ZQeA047220@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 27 Mar 2015 02:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280728 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:35:26 -0000 Author: imp Date: Fri Mar 27 02:35:25 2015 New Revision: 280728 URL: https://svnweb.freebsd.org/changeset/base/280728 Log: Categorize certain kernel builds as being broken in certain places. Differential Revision: https://reviews.freebsd.org/D2011 Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Fri Mar 27 02:35:11 2015 (r280727) +++ head/sys/conf/kern.opts.mk Fri Mar 27 02:35:25 2015 (r280728) @@ -75,6 +75,34 @@ BROKEN_OPTIONS+= EISA BROKEN_OPTIONS+= OFED .endif +# Options that cannot be turned on this architecture, usually because +# of compilation or other issues so severe it cannot be used even +# on an experimental basis +__ALWAYS_NO_OPTIONS= + +# Things that don't work based on the CPU +.if ${MACHINE_CPUARCH} == "arm" +__ALWAYS_NO_OPTIONS+= CDDL ZFS +.endif + +.if ${MACHINE_CPUARCH} == "mips" +__ALWAYS_NO_OPTIONS+= CDDL ZFS +.endif + +.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpc64" +__ALWAYS_NO_OPTIONS+= ZFS +.endif + +# Things that don't work because the kernel doesn't have the support +# for them. +.if ${MACHINE} != "i386" +__ALWAYS_NO_OPTIONS+= EISA +.endif + +.if ${MACHINE} != "i386" && ${MACHINE} != "amd64" +__ALWAYS_NO_OPTIONS+= OFED +.endif + # expanded inline from bsd.mkopt.mk to avoid share/mk dependency # Those that default to yes From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 02:35:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7516A48; Fri, 27 Mar 2015 02: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 A2FC4D7; Fri, 27 Mar 2015 02:35:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R2ZYhe047274; Fri, 27 Mar 2015 02:35:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R2ZYma047273; Fri, 27 Mar 2015 02:35:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503270235.t2R2ZYma047273@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 27 Mar 2015 02:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280729 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:35:34 -0000 Author: imp Date: Fri Mar 27 02:35:33 2015 New Revision: 280729 URL: https://svnweb.freebsd.org/changeset/base/280729 Log: sym and cxgb build on arm, add them to the build. Differential Revision: https://reviews.freebsd.org/D514 Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Mar 27 02:35:25 2015 (r280728) +++ head/sys/modules/Makefile Fri Mar 27 02:35:33 2015 (r280729) @@ -466,7 +466,7 @@ _syscons= syscons _vpo= vpo .endif -.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" +.if ${MACHINE_CPUARCH} != "mips" # no BUS_SPACE_UNSPECIFIED # No barrier instruction support (specific to this driver) _sym= sym From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 03:05:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4FF295F7; Fri, 27 Mar 2015 03:05:15 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23F2F6EB; Fri, 27 Mar 2015 03:05:14 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NLU00A0NOJNJE50@st11p02mm-asmtp001.mac.com>; Fri, 27 Mar 2015 03:04:41 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-03-26_05:2015-03-26,2015-03-26,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1503270031 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r280728 - head/sys/conf From: Rui Paulo In-reply-to: <201503270235.t2R2ZQeA047220@svn.freebsd.org> Date: Thu, 26 Mar 2015 20:04:35 -0700 Content-transfer-encoding: quoted-printable Message-id: <2AF9E0A0-3B9B-4AF0-89B9-FEBA7FEFCA8B@me.com> References: <201503270235.t2R2ZQeA047220@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-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-1 Precedence: list List-Id: SVN 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 Mar 2015 03:05:15 -0000 On Mar 26, 2015, at 19:35, Warner Losh wrote: >=20 > Author: imp > Date: Fri Mar 27 02:35:25 2015 > New Revision: 280728 > URL: https://svnweb.freebsd.org/changeset/base/280728 >=20 > Log: > Categorize certain kernel builds as being broken in certain places. >=20 > Differential Revision: https://reviews.freebsd.org/D2011 >=20 > Modified: > head/sys/conf/kern.opts.mk >=20 > Modified: head/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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/conf/kern.opts.mk Fri Mar 27 02:35:11 2015 = (r280727) > +++ head/sys/conf/kern.opts.mk Fri Mar 27 02:35:25 2015 = (r280728) > @@ -75,6 +75,34 @@ BROKEN_OPTIONS+=3D EISA > BROKEN_OPTIONS+=3D OFED > .endif >=20 > +# Options that cannot be turned on this architecture, usually because > +# of compilation or other issues so severe it cannot be used even > +# on an experimental basis > +__ALWAYS_NO_OPTIONS=3D > + > +# Things that don't work based on the CPU > +.if ${MACHINE_CPUARCH} =3D=3D "arm" > +__ALWAYS_NO_OPTIONS+=3D CDDL ZFS > +.endif This isn't entirely true. With a properly tuned ARC and kmem size, ZFS = seems to work on a BeagleBone. There have been reports on the = freebsd-arm mailing list this month. Based on my understanding of your = previous commit, it looks like this can't be overridden which is a = problem. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 04:44:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55DDD388 for ; Fri, 27 Mar 2015 04:44:17 +0000 (UTC) Received: from mail-ig0-f170.google.com (mail-ig0-f170.google.com [209.85.213.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18B81FCB for ; Fri, 27 Mar 2015 04:44:16 +0000 (UTC) Received: by igcxg11 with SMTP id xg11so10864146igc.0 for ; Thu, 26 Mar 2015 21:44: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:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=e4PK8aJR8BvZNoz31K8kLEo8e9M1BJ7v6xa77FzVe+c=; b=V7YNCnVz5OdPbLQcpwFtdEMSYBmNxNrKk29/KUC8ZTOjnVGTeXuu/n0eoIhCwmbZLR evJxVrBgb/KfjzQl4g4ACU0BQNLdpYbjkONun2tPCH/OmUzeFRM3OKfc3rBxZsH/pVRu 182lYdFWX6EEYnCMB3hbDL2WjZfjgwCIvZwbCnRZLJNfJ5neCz8kG5W+3EeBBloGsy50 XQa2+NTPickzeVFubgxnBK1g/Tt4VuVkgVOHWKncqKVa7PGGnvesPKzWIB/3xPaUATCq tvkBDNmnD55d21TO0Xt549SIV2aH5fnlvZr85HdcZAJXWlpPWkhcBXY1IgoVa4a1hFBA e5fw== X-Gm-Message-State: ALoCoQl2ijDcJmPw6dGtQxEcQ4HeeJCY82YTEmhkAsA1yKxTRfXiPxV9APbeitk+hJ+XnB/xwS7Z X-Received: by 10.107.135.75 with SMTP id j72mr26840907iod.0.1427431450504; Thu, 26 Mar 2015 21:44:10 -0700 (PDT) Received: from netflix-mac.bsdimp.com ([50.253.99.174]) by mx.google.com with ESMTPSA id k9sm690190ige.6.2015.03.26.21.44.09 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Mar 2015 21:44:09 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r280728 - head/sys/conf Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_FABA8285-A2C0-4EAF-8274-7F37835C0CC4"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Warner Losh In-Reply-To: <2AF9E0A0-3B9B-4AF0-89B9-FEBA7FEFCA8B@me.com> Date: Thu, 26 Mar 2015 22:44:08 -0600 Message-Id: References: <201503270235.t2R2ZQeA047220@svn.freebsd.org> <2AF9E0A0-3B9B-4AF0-89B9-FEBA7FEFCA8B@me.com> To: Rui Paulo X-Mailer: Apple Mail (2.2070.6) 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-1 Precedence: list List-Id: SVN 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 Mar 2015 04:44:17 -0000 --Apple-Mail=_FABA8285-A2C0-4EAF-8274-7F37835C0CC4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 26, 2015, at 9:04 PM, Rui Paulo wrote: >=20 > On Mar 26, 2015, at 19:35, Warner Losh wrote: >>=20 >> Author: imp >> Date: Fri Mar 27 02:35:25 2015 >> New Revision: 280728 >> URL: https://svnweb.freebsd.org/changeset/base/280728 >>=20 >> Log: >> Categorize certain kernel builds as being broken in certain places. >>=20 >> Differential Revision: https://reviews.freebsd.org/D2011 >>=20 >> Modified: >> head/sys/conf/kern.opts.mk >>=20 >> Modified: head/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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/conf/kern.opts.mk Fri Mar 27 02:35:11 2015 = (r280727) >> +++ head/sys/conf/kern.opts.mk Fri Mar 27 02:35:25 2015 = (r280728) >> @@ -75,6 +75,34 @@ BROKEN_OPTIONS+=3D EISA >> BROKEN_OPTIONS+=3D OFED >> .endif >>=20 >> +# Options that cannot be turned on this architecture, usually = because >> +# of compilation or other issues so severe it cannot be used even >> +# on an experimental basis >> +__ALWAYS_NO_OPTIONS=3D >> + >> +# Things that don't work based on the CPU >> +.if ${MACHINE_CPUARCH} =3D=3D "arm" >> +__ALWAYS_NO_OPTIONS+=3D CDDL ZFS >> +.endif >=20 > This isn't entirely true. With a properly tuned ARC and kmem size, = ZFS seems to work on a BeagleBone. There have been reports on the = freebsd-arm mailing list this month. Based on my understanding of your = previous commit, it looks like this can't be overridden which is a = problem. Yea, the ships passed in the night. I=E2=80=99ve had these changes in my = tree for a while. However, It kinda can be overridden by compiling the modules directly. = Since the actual module=E2=80=99s Makefiles don=E2=80=99t depend on this, I = think we=E2=80=99re OK. Can you test building a kernel on the BBB you have and let me know if it produces = working ZFS? Warner --Apple-Mail=_FABA8285-A2C0-4EAF-8274-7F37835C0CC4 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 iQIcBAEBCgAGBQJVFOAYAAoJEGwc0Sh9sBEAQ20P+wdYD6mPNGufXCsb+YdQ9T50 Dsp0d2aYyQ+aTt1CACd+sPOiYjdYZpRZNPkrvvT2uPTcbTAGSv0bdiaZ5Pp5qa42 7IIn2xNPL9tWDMs5GwlqmFwRsInmwbmYCFM8i8ppPHK+H1tdvFWSE0OtG7/w4hhj Q6uPYKEEZogRgQUWiobHCM0Dj5Qi//TNRzxcr13e3Ip1sPcMy2XimlmocV2gsRWD e1HfH+rc4HrAe5Tl+5HtVuuF66jK3/jpWEHIRkhRiPCn2KwRuJ1sHGyhgYKAp6te tK4vUdqC07eI9kGhAQGaQ7KVCMqP+jEGDxJsMcP597Qm7qIW6xGbj4tATl85wCYB pGE2uQsVThjfRrwkekL0zwvsgmU5LhE+bXLK+Yk4vFbVKD/1QXu1+mqwg9MuXLnB uC8xOy1My+W+BolwyluN/FPjLEyodz4m/csX9f/6rHaEz3vR+oGsJPEdGeLFLFiI lQK30BJ70J66KTIWji0p2Dajbrfc5OVu8IP27Qfpmb/i42d5VperQIMcSRy8BNyE 7/uD8pivOoBwuH0+ihXdzmxnbQZLU6hruWGb9qQ1ZQVqUzoJ/Q9UseXBv9eI+0Id BiWhwDNrApTjNMRQ9Di+FFEeMGCBMYxhsBq1mrNGxMYPQwQaRPJZhWINPQecUtkk tFfHMX3SNmiEKi+c6nRz =MQSJ -----END PGP SIGNATURE----- --Apple-Mail=_FABA8285-A2C0-4EAF-8274-7F37835C0CC4-- From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 07:55:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 882DECA3; Fri, 27 Mar 2015 07:55:24 +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 39F5238A; Fri, 27 Mar 2015 07:55:24 +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 3B07525D3AA0; Fri, 27 Mar 2015 07:55:12 +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 946E4C76FE0; Fri, 27 Mar 2015 07:55:11 +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 7_z6AAFwvpkF; Fri, 27 Mar 2015 07:55:09 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:5997:9da1:5d8e:de02] (unknown [IPv6:fde9:577b:c1a9:4410:5997:9da1:5d8e:de02]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 7C481C76FD0; Fri, 27 Mar 2015 07:55:09 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r280728 - head/sys/conf From: "Bjoern A. Zeeb" In-Reply-To: <201503270235.t2R2ZQeA047220@svn.freebsd.org> Date: Fri, 27 Mar 2015 07:54:37 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201503270235.t2R2ZQeA047220@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-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-1 Precedence: list List-Id: SVN 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 Mar 2015 07:55:24 -0000 > On 27 Mar 2015, at 02:35 , Warner Losh wrote: >=20 > Author: imp > Date: Fri Mar 27 02:35:25 2015 > New Revision: 280728 > URL: https://svnweb.freebsd.org/changeset/base/280728 >=20 > Log: > Categorize certain kernel builds as being broken in certain places. >=20 > Differential Revision: https://reviews.freebsd.org/D2011 >=20 > Modified: > head/sys/conf/kern.opts.mk >=20 > Modified: head/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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/conf/kern.opts.mk Fri Mar 27 02:35:11 2015 = (r280727) > +++ head/sys/conf/kern.opts.mk Fri Mar 27 02:35:25 2015 = (r280728) > @@ -75,6 +75,34 @@ BROKEN_OPTIONS+=3D EISA > BROKEN_OPTIONS+=3D OFED > .endif >=20 > +# Options that cannot be turned on this architecture, usually because > +# of compilation or other issues so severe it cannot be used even > +# on an experimental basis > +__ALWAYS_NO_OPTIONS=3D > + > +# Things that don't work based on the CPU > +.if ${MACHINE_CPUARCH} =3D=3D "arm" > +__ALWAYS_NO_OPTIONS+=3D CDDL ZFS > +.endif > + > +.if ${MACHINE_CPUARCH} =3D=3D "mips" > +__ALWAYS_NO_OPTIONS+=3D CDDL ZFS > +.endif > + Wouldn=E2=80=99t this also mean no Dtrace on arm or mips? Please revert = this. =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 08:47:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F94C73A; Fri, 27 Mar 2015 08: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 D6662B35; Fri, 27 Mar 2015 08:47:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2R8lHZf021249; Fri, 27 Mar 2015 08:47:17 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2R8lHrI021245; Fri, 27 Mar 2015 08:47:17 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201503270847.t2R8lHrI021245@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 27 Mar 2015 08:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280737 - in head/sys: arm/include 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-1 Precedence: list List-Id: SVN 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 Mar 2015 08:47:18 -0000 Author: bz Date: Fri Mar 27 08:47:16 2015 New Revision: 280737 URL: https://svnweb.freebsd.org/changeset/base/280737 Log: Rather than defining our own magic checks here use INKERNEL() for the PMC_IN_KERNEL() macro definition. Add missing macros to extract the return address (LR) from the trapframe. Discussed with: andrew Obtained from: Cambridge/L41 Sponsored by: DARPA, AFRL MFC after: 2 weeks Modified: head/sys/arm/include/pmc_mdep.h head/sys/dev/hwpmc/hwpmc_arm.c Modified: head/sys/arm/include/pmc_mdep.h ============================================================================== --- head/sys/arm/include/pmc_mdep.h Fri Mar 27 08:47:02 2015 (r280736) +++ head/sys/arm/include/pmc_mdep.h Fri Mar 27 08:47:16 2015 (r280737) @@ -56,8 +56,7 @@ union pmc_md_pmc { #define PMC_IN_KERNEL_STACK(S,START,END) \ ((S) >= (START) && (S) < (END)) -#define PMC_IN_KERNEL(va) (((va) >= USRSTACK) && \ - ((va) < VM_MAX_KERNEL_ADDRESS)) +#define PMC_IN_KERNEL(va) INKERNEL((va)) #define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) @@ -65,6 +64,8 @@ union pmc_md_pmc { #define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_r11) #define PMC_TRAPFRAME_TO_SVC_SP(TF) ((TF)->tf_svc_sp) #define PMC_TRAPFRAME_TO_USR_SP(TF) ((TF)->tf_usr_sp) +#define PMC_TRAPFRAME_TO_SVC_LR(TF) ((TF)->tf_svc_lr) +#define PMC_TRAPFRAME_TO_USR_LR(TF) ((TF)->tf_usr_lr) /* Build a fake kernel trapframe from current instruction pointer. */ #define PMC_FAKE_TRAPFRAME(TF) \ Modified: head/sys/dev/hwpmc/hwpmc_arm.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_arm.c Fri Mar 27 08:47:02 2015 (r280736) +++ head/sys/dev/hwpmc/hwpmc_arm.c Fri Mar 27 08:47:16 2015 (r280737) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 10:00:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 803A691E; Fri, 27 Mar 2015 10:00:25 +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 36EFD62A; Fri, 27 Mar 2015 10:00:25 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YbR3n-0002ja-0R; Fri, 27 Mar 2015 13:00:15 +0300 Date: Fri, 27 Mar 2015 13:00:14 +0300 From: Slawa Olhovchenkov To: Warner Losh Subject: Re: svn commit: r280727 - in head: share/mk sys/conf Message-ID: <20150327100014.GA74532@zxy.spb.ru> References: <201503270235.t2R2ZCwp047154@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503270235.t2R2ZCwp047154@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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-1 Precedence: list List-Id: SVN 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 Mar 2015 10:00:25 -0000 On Fri, Mar 27, 2015 at 02:35:12AM +0000, Warner Losh wrote: > Author: imp > Date: Fri Mar 27 02:35:11 2015 > New Revision: 280727 > URL: https://svnweb.freebsd.org/changeset/base/280727 > > Log: > Add support for specifying unsupported / broken options that override > any defaults or user specified actions on the command line. This would > be useful for specifying features that are always broken or that > cannot make sense on a specific architecture, like ACPI on pc98 or > EISA on !i386 (!x86 usage of EISA is broken and there's no supported > hardware that could have it in any event). Any items in > __ALWAYS_NO_OPTIONS are forced to "no" regardless of other settings. Alpha 21064 support EISA. FreeBSD support Digi EISA card. From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 11:01:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65A8ADE4; Fri, 27 Mar 2015 11:01: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 23946EC2; Fri, 27 Mar 2015 11:01:47 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id F184BD64414; Fri, 27 Mar 2015 22:01:37 +1100 (AEDT) Date: Fri, 27 Mar 2015 22:01:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Tijl Coosemans Subject: Re: svn commit: r280636 - head/include In-Reply-To: <20150326142052.6789dd50@kalimero.tijl.coosemans.org> Message-ID: <20150327214341.E2629@besplex.bde.org> References: <201503252153.t2PLrInc025854@svn.freebsd.org> <20150326130403.W993@besplex.bde.org> <551376D4.4030003@FreeBSD.org> <20150326170535.U2239@besplex.bde.org> <20150326142052.6789dd50@kalimero.tijl.coosemans.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=ZuzUdbLG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=13UMWzg37cEECB_ZgkkA:9 a=CjuIK1q_8ugA:10 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , Bruce Evans , svn-src-head@freebsd.org, gerald@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 11:01:48 -0000 On Thu, 26 Mar 2015, Tijl Coosemans wrote: > On Thu, 26 Mar 2015 17:37:53 +1100 (EST) Bruce Evans wrote: >> On Wed, 25 Mar 2015, Pedro Giffuni wrote: >>> On 03/25/15 21:14, Bruce Evans wrote: >>>> On Wed, 25 Mar 2015, Pedro F. Giffuni wrote: >>>>> Log: >>>>> Temporarily revert 280458. >>>>> >>>>> GCC is still carries an old version of cdefs.h which doesn't >>>>> accept multiple parameters for the nonnull attribute. >>>>> Since this issue probably affects many ports in the tree >>>>> we will revert it for now until gcc gets fixed. >>>> >>>> Note that sys/cdefs.h is supposed to work with any version of >>>> gcc back to gcc-1, and does mostly work back to at least gcc-2.95. >>>> The whole point of sys/cdefs.h is to provide compatibity macros >>>> for old and other non-default compilers. Standard compilers don't >>>> even have __attribute__(()). So no changes in future versions >>>> of gcc will fix the previous commit. >>> >>> cdefs.h still works for all versions of gcc back to gcc-1 AFAICT. >> >> I now remember other bugs in it. I think you put the varargs stuff >> in the non-gcc version. That won't work compilers that don't support >> varargs for macros. Neither will not changing the non-gcc version. I confirmed the complete brokenness of the varargs stuff for the non-C99 case. >> glibc (2.6 at least) avoids using varargs in its __nonnull() macro >> by using the same portable method that is used in many optional >> debugging statements including FreeBSD's KASSERT(). ... > > Maybe introduce a __nonnull_all macro and leave __nonnull varargs-free: > > #define __nonnull(x) __attribute__((__nonnull__(x))) > #define __nonnull_all __attribute__((__nonnull__)) > > Then in the rare cases where multiple arguments must be nonnull but > __nonnull_all doesn't apply you can use multiple __nonnull: > > int f(void *, void *, void *) __nonnull(1) __nonnull(2); Good idea. There aren't many functions that accept null for some pointer args but not others. The multiple __nonnull() method is already used a lot. E.g., in sys/systm.h it is used 11 times. systm.h also gives many examples where __nonnull_all cannot be used. It cannot be used for the strto* family because endptr can be null, or for the copyinstr() family for similar reasons (a value may be returned indirectly but the pointer for this is null if this value is not needed). >> I see. gcc's "fixed" headers cause lots of problems. > > I've complained about this multiple times in the past. The gcc ports > should not install these "fixed" headers. Is this easy to do, and does it work without problems? It might be easier and would be safet to install everything and change the default include path in a way that can be changed back at runtime. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 11:14:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DDF71C5; Fri, 27 Mar 2015 11: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 ED37129; Fri, 27 Mar 2015 11:14:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RBED1X094846; Fri, 27 Mar 2015 11:14:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RBEDkn094845; Fri, 27 Mar 2015 11:14:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503271114.t2RBEDkn094845@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 11:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280756 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 11:14:14 -0000 Author: mav Date: Fri Mar 27 11:14:12 2015 New Revision: 280756 URL: https://svnweb.freebsd.org/changeset/base/280756 Log: Fix bug on memory allocation error in split method. While there, use bioq_takefirst() in place where it is convenient. MFC after: 1 week Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri Mar 27 09:32:34 2015 (r280755) +++ head/sys/geom/mirror/g_mirror.c Fri Mar 27 11:14:12 2015 (r280756) @@ -1582,7 +1582,7 @@ g_mirror_request_split(struct g_mirror_s cbp = g_clone_bio(bp); if (cbp == NULL) { while ((cbp = bioq_takefirst(&queue)) != NULL) - bioq_remove(&queue, cbp); + g_destroy_bio(cbp);; if (bp->bio_error == 0) bp->bio_error = ENOMEM; g_io_deliver(bp, bp->bio_error); @@ -1865,7 +1865,7 @@ g_mirror_worker(void *arg) */ /* Get first request from the queue. */ mtx_lock(&sc->sc_queue_mtx); - bp = bioq_first(&sc->sc_queue); + bp = bioq_takefirst(&sc->sc_queue); if (bp == NULL) { if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { @@ -1893,7 +1893,6 @@ g_mirror_worker(void *arg) G_MIRROR_DEBUG(5, "%s: I'm here 4.", __func__); continue; } - bioq_remove(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); if (bp->bio_from->geom == sc->sc_sync.ds_geom && From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 12:44:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C7F7BA5; Fri, 27 Mar 2015 12:44: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 6D0C0CDF; Fri, 27 Mar 2015 12:44:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RCiUW7037118; Fri, 27 Mar 2015 12:44:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RCiT9W037115; Fri, 27 Mar 2015 12:44:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503271244.t2RCiT9W037115@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 12:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280757 - in head/sys/geom: mirror 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 12:44:30 -0000 Author: mav Date: Fri Mar 27 12:44:28 2015 New Revision: 280757 URL: https://svnweb.freebsd.org/changeset/base/280757 Log: Remove request sorting from GEOM_MIRROR and GEOM_RAID. When CPU is not busy, those queues are typically empty. When CPU is busy, then one more extra sorting is the last thing it needs. If specific device (HDD) really needs sorting, then it will be done later by CAM. This supposed to fix livelock reported for mirror of two SSDs, when UFS fires zillion of BIO_DELETE requests, that totally blocks I/O subsystem by pointless sorting of requests and responses under single mutex lock. MFC after: 2 weeks Modified: head/sys/geom/mirror/g_mirror.c head/sys/geom/raid/g_raid.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri Mar 27 11:14:12 2015 (r280756) +++ head/sys/geom/mirror/g_mirror.c Fri Mar 27 12:44:28 2015 (r280757) @@ -888,7 +888,7 @@ g_mirror_done(struct bio *bp) sc = bp->bio_from->geom->softc; bp->bio_cflags = G_MIRROR_BIO_FLAG_REGULAR; mtx_lock(&sc->sc_queue_mtx); - bioq_disksort(&sc->sc_queue, bp); + bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); wakeup(sc); } @@ -975,7 +975,7 @@ g_mirror_regular_request(struct bio *bp) else { pbp->bio_error = 0; mtx_lock(&sc->sc_queue_mtx); - bioq_disksort(&sc->sc_queue, pbp); + bioq_insert_tail(&sc->sc_queue, pbp); mtx_unlock(&sc->sc_queue_mtx); G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); wakeup(sc); @@ -1015,7 +1015,7 @@ g_mirror_sync_done(struct bio *bp) sc = bp->bio_from->geom->softc; bp->bio_cflags = G_MIRROR_BIO_FLAG_SYNC; mtx_lock(&sc->sc_queue_mtx); - bioq_disksort(&sc->sc_queue, bp); + bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); wakeup(sc); } @@ -1144,7 +1144,7 @@ g_mirror_start(struct bio *bp) return; } mtx_lock(&sc->sc_queue_mtx); - bioq_disksort(&sc->sc_queue, bp); + bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); wakeup(sc); Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Fri Mar 27 11:14:12 2015 (r280756) +++ head/sys/geom/raid/g_raid.c Fri Mar 27 12:44:28 2015 (r280757) @@ -1132,7 +1132,7 @@ g_raid_start(struct bio *bp) return; } mtx_lock(&sc->sc_queue_mtx); - bioq_disksort(&sc->sc_queue, bp); + bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); if (!dumping) { G_RAID_DEBUG1(4, sc, "Waking up %p.", sc); @@ -1344,7 +1344,7 @@ g_raid_unlock_range(struct g_raid_volume (intmax_t)(lp->l_offset+lp->l_length)); mtx_lock(&sc->sc_queue_mtx); while ((bp = bioq_takefirst(&vol->v_locked)) != NULL) - bioq_disksort(&sc->sc_queue, bp); + bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); free(lp, M_RAID); return (0); @@ -1438,7 +1438,7 @@ g_raid_disk_done(struct bio *bp) sd = bp->bio_caller1; sc = sd->sd_softc; mtx_lock(&sc->sc_queue_mtx); - bioq_disksort(&sc->sc_queue, bp); + bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); if (!dumping) wakeup(sc); From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 12:45:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBD40CEE; Fri, 27 Mar 2015 12: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 C6F58CED; Fri, 27 Mar 2015 12:45:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RCjLmd037311; Fri, 27 Mar 2015 12:45:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RCjLQY037309; Fri, 27 Mar 2015 12:45:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503271245.t2RCjLQY037309@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Mar 2015 12:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280758 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 12:45:22 -0000 Author: mav Date: Fri Mar 27 12:45:20 2015 New Revision: 280758 URL: https://svnweb.freebsd.org/changeset/base/280758 Log: Remove extra semicolon. MFC after: 1 week Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri Mar 27 12:44:28 2015 (r280757) +++ head/sys/geom/mirror/g_mirror.c Fri Mar 27 12:45:20 2015 (r280758) @@ -1582,7 +1582,7 @@ g_mirror_request_split(struct g_mirror_s cbp = g_clone_bio(bp); if (cbp == NULL) { while ((cbp = bioq_takefirst(&queue)) != NULL) - g_destroy_bio(cbp);; + g_destroy_bio(cbp); if (bp->bio_error == 0) bp->bio_error = ENOMEM; g_io_deliver(bp, bp->bio_error); From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 13:27:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82878BE6; Fri, 27 Mar 2015 13:27: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 5357D181; Fri, 27 Mar 2015 13:27:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RDR0jT056121; Fri, 27 Mar 2015 13:27:00 GMT (envelope-from fabient@FreeBSD.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RDQxd3056112; Fri, 27 Mar 2015 13:26:59 GMT (envelope-from fabient@FreeBSD.org) Message-Id: <201503271326.t2RDQxd3056112@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: fabient set sender to fabient@FreeBSD.org using -f From: Fabien Thomas Date: Fri, 27 Mar 2015 13:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280759 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 13:27:00 -0000 Author: fabient Date: Fri Mar 27 13:26:59 2015 New Revision: 280759 URL: https://svnweb.freebsd.org/changeset/base/280759 Log: On multi CPU systems, we may emit successive packets with the same id. Fix the race by using an atomic operation. Differential Revision: https://reviews.freebsd.org/D2141 Obtained from: emeric.poupon@stormshield.eu MFC after: 1 week Sponsored by: Stormshield Modified: head/sys/netinet/ip_output.c head/sys/netinet/ip_var.h Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Mar 27 12:45:20 2015 (r280758) +++ head/sys/netinet/ip_output.c Fri Mar 27 13:26:59 2015 (r280759) @@ -91,7 +91,7 @@ __FBSDID("$FreeBSD$"); #include -VNET_DEFINE(u_short, ip_id); +VNET_DEFINE(uint32_t, ip_id); #ifdef MBUF_STRESS_TEST static int mbuf_frag_size = 0; Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Fri Mar 27 12:45:20 2015 (r280758) +++ head/sys/netinet/ip_var.h Fri Mar 27 13:26:59 2015 (r280759) @@ -174,7 +174,7 @@ struct inpcb; struct route; struct sockopt; -VNET_DECLARE(u_short, ip_id); /* ip packet ctr, for ids */ +VNET_DECLARE(uint32_t, ip_id); /* ip packet ctr, for ids */ VNET_DECLARE(int, ip_defttl); /* default IP ttl */ VNET_DECLARE(int, ipforwarding); /* ip forwarding */ #ifdef IPSTEALTH @@ -228,7 +228,7 @@ struct in_ifaddr * void ip_savecontrol(struct inpcb *, struct mbuf **, struct ip *, struct mbuf *); void ip_slowtimo(void); -u_int16_t ip_randomid(void); +uint16_t ip_randomid(void); int rip_ctloutput(struct socket *, struct sockopt *); void rip_ctlinput(int, struct sockaddr *, void *); void rip_init(void); @@ -305,8 +305,18 @@ extern int (*ip_dn_io_ptr)(struct mbuf * VNET_DECLARE(int, ip_do_randomid); #define V_ip_do_randomid VNET(ip_do_randomid) -#define ip_newid() ((V_ip_do_randomid != 0) ? ip_randomid() : \ - htons(V_ip_id++)) +static __inline uint16_t +ip_newid(void) +{ + uint16_t res; + + if (V_ip_do_randomid != 0) + return (ip_randomid()); + else { + res = atomic_fetchadd_32(&V_ip_id, 1) & 0xFFFF; + return (htons(res)); + } +} #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 13:51:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC5B1DB5; Fri, 27 Mar 2015 13:51:38 +0000 (UTC) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id 8C3A8758; Fri, 27 Mar 2015 13:51:37 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 29BDB56082; Fri, 27 Mar 2015 08:51:37 -0500 (CDT) Date: Fri, 27 Mar 2015 08:51:37 -0500 From: Mark Linimon To: Slawa Olhovchenkov Subject: Re: svn commit: r280727 - in head: share/mk sys/conf Message-ID: <20150327135136.GA2397@lonesome.com> References: <201503270235.t2R2ZCwp047154@svn.freebsd.org> <20150327100014.GA74532@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150327100014.GA74532@zxy.spb.ru> User-Agent: Mutt/1.5.21 (2010-09-15) 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-1 Precedence: list List-Id: SVN 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 Mar 2015 13:51:38 -0000 On Fri, Mar 27, 2015 at 01:00:14PM +0300, Slawa Olhovchenkov wrote: > Alpha 21064 support EISA. Alpha is no longer supported in FreeBSD. mcl From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 13:55:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DE6DF8; Fri, 27 Mar 2015 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E41E7A1; Fri, 27 Mar 2015 13:55:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RDtvoU071070; Fri, 27 Mar 2015 13:55:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RDtuLt071068; Fri, 27 Mar 2015 13:55:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503271355.t2RDtuLt071068@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 27 Mar 2015 13:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280760 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 13:55:57 -0000 Author: kib Date: Fri Mar 27 13:55:56 2015 New Revision: 280760 URL: https://svnweb.freebsd.org/changeset/base/280760 Log: Fix the hand after the immediate reboot when the following command sequence is performed on UFS SU+J rootfs: cp -Rp /sbin/init /sbin/init.old mv -f /sbin/init.old /sbin/init Hang occurs on the rootfs unmount. There are two issues: 1. Removed init binary, which is still mapped, creates a reference to the removed vnode. The inodeblock for such vnode must have active inodedep, which is (eventually) linked through the unlinked list. This means that ffs_sync(MNT_SUSPEND) cannot succeed, because number of softdep workitems for the mp is always > 0. FFS is suspended during unmount, so unmount just hangs. 2. As noted above, the inodedep is linked eventually. It is not linked until the superblock is written. But at the vfs_unmountall() time, when the rootfs is unmounted, the call is made to ffs_unmount()->ffs_sync() before vflush(), and ffs_sync() only calls ffs_sbupdate() after all workitems are flushed. It is masked for normal system operations, because syncer works in parallel and eventually flushes superblock. Syncer is stopped when rootfs unmounted, so ffs_sync() must do sb update on its own. Correct the issues listed above. For MNT_SUSPEND, count the number of linked unlinked inodedeps (this is not a typo) and substract the count of such workitems from the total. For the second issue, the ffs_sbupdate() is called right after device sync in ffs_sync() loop. There is third problem, occuring with both SU and SU+J. The softdep_waitidle() loop, which waits for softdep_flush() thread to clear the worklist, only waits 20ms max. It seems that the 1 tick, specified for msleep(9), was a typo. Add fsync(devvp, MNT_WAIT) call to softdep_waitidle(), which seems to significantly help the softdep thread, and change the MNT_LAZY update at the reboot time to MNT_WAIT for similar reasons. Note that userspace cannot create more work while devvp is flushed, since the mount point is always suspended before the call to softdep_waitidle() in unmount or remount path. PR: 195458 In collaboration with: gjb, pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri Mar 27 13:26:59 2015 (r280759) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Mar 27 13:55:56 2015 (r280760) @@ -1885,8 +1885,8 @@ softdep_flushworklist(oldmnt, countp, td struct thread *td; { struct vnode *devvp; - int count, error = 0; struct ufsmount *ump; + int count, error; /* * Alternately flush the block device associated with the mount @@ -1895,6 +1895,7 @@ softdep_flushworklist(oldmnt, countp, td * are found. */ *countp = 0; + error = 0; ump = VFSTOUFS(oldmnt); devvp = ump->um_devvp; while ((count = softdep_process_worklist(oldmnt, 1)) > 0) { @@ -1902,37 +1903,47 @@ softdep_flushworklist(oldmnt, countp, td vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_FSYNC(devvp, MNT_WAIT, td); VOP_UNLOCK(devvp, 0); - if (error) + if (error != 0) break; } return (error); } +#define SU_WAITIDLE_RETRIES 20 static int softdep_waitidle(struct mount *mp, int flags __unused) { struct ufsmount *ump; - int error; - int i; + struct vnode *devvp; + struct thread *td; + int error, i; ump = VFSTOUFS(mp); + devvp = ump->um_devvp; + td = curthread; + error = 0; ACQUIRE_LOCK(ump); - for (i = 0; i < 10 && ump->softdep_deps; i++) { + for (i = 0; i < SU_WAITIDLE_RETRIES && ump->softdep_deps != 0; i++) { ump->softdep_req = 1; KASSERT((flags & FORCECLOSE) == 0 || ump->softdep_on_worklist == 0, ("softdep_waitidle: work added after flush")); - msleep(&ump->softdep_deps, LOCK_PTR(ump), PVM, "softdeps", 1); + msleep(&ump->softdep_deps, LOCK_PTR(ump), PVM | PDROP, + "softdeps", 10 * hz); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); + error = VOP_FSYNC(devvp, MNT_WAIT, td); + VOP_UNLOCK(devvp, 0); + if (error != 0) + break; + ACQUIRE_LOCK(ump); } ump->softdep_req = 0; - FREE_LOCK(ump); - error = 0; - if (i == 10) { + if (i == SU_WAITIDLE_RETRIES && error == 0 && ump->softdep_deps != 0) { error = EBUSY; printf("softdep_waitidle: Failed to flush worklist for %p\n", mp); } - + FREE_LOCK(ump); return (error); } @@ -7637,17 +7648,13 @@ check_inode_unwritten(inodedep) return (1); } -/* - * Try to free an inodedep structure. Return 1 if it could be freed. - */ static int -free_inodedep(inodedep) +check_inodedep_free(inodedep) struct inodedep *inodedep; { LOCK_OWNED(VFSTOUFS(inodedep->id_list.wk_mp)); - if ((inodedep->id_state & (ONWORKLIST | UNLINKED)) != 0 || - (inodedep->id_state & ALLCOMPLETE) != ALLCOMPLETE || + if ((inodedep->id_state & ALLCOMPLETE) != ALLCOMPLETE || !LIST_EMPTY(&inodedep->id_dirremhd) || !LIST_EMPTY(&inodedep->id_pendinghd) || !LIST_EMPTY(&inodedep->id_bufwait) || @@ -7662,6 +7669,21 @@ free_inodedep(inodedep) inodedep->id_nlinkdelta != 0 || inodedep->id_savedino1 != NULL) return (0); + return (1); +} + +/* + * Try to free an inodedep structure. Return 1 if it could be freed. + */ +static int +free_inodedep(inodedep) + struct inodedep *inodedep; +{ + + LOCK_OWNED(VFSTOUFS(inodedep->id_list.wk_mp)); + if ((inodedep->id_state & (ONWORKLIST | UNLINKED)) != 0 || + !check_inodedep_free(inodedep)) + return (0); if (inodedep->id_state & ONDEPLIST) LIST_REMOVE(inodedep, id_deps); LIST_REMOVE(inodedep, id_hash); @@ -13846,7 +13868,8 @@ softdep_check_suspend(struct mount *mp, { struct bufobj *bo; struct ufsmount *ump; - int error; + struct inodedep *inodedep; + int error, unlinked; bo = &devvp->v_bufobj; ASSERT_BO_WLOCKED(bo); @@ -13907,6 +13930,20 @@ softdep_check_suspend(struct mount *mp, break; } + unlinked = 0; + if (MOUNTEDSUJ(mp)) { + for (inodedep = TAILQ_FIRST(&ump->softdep_unlinked); + inodedep != NULL; + inodedep = TAILQ_NEXT(inodedep, id_unlinked)) { + if ((inodedep->id_state & (UNLINKED | UNLINKLINKS | + UNLINKONLIST)) != (UNLINKED | UNLINKLINKS | + UNLINKONLIST) || + !check_inodedep_free(inodedep)) + continue; + unlinked++; + } + } + /* * Reasons for needing more work before suspend: * - Dirty buffers on devvp. @@ -13916,8 +13953,8 @@ softdep_check_suspend(struct mount *mp, error = 0; if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0 || - softdep_depcnt != 0 || - ump->softdep_deps != 0 || + softdep_depcnt != unlinked || + ump->softdep_deps != unlinked || softdep_accdepcnt != ump->softdep_accdeps || secondary_writes != 0 || mp->mnt_secondary_writes != 0 || Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Mar 27 13:26:59 2015 (r280759) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Mar 27 13:55:56 2015 (r280760) @@ -1502,8 +1502,11 @@ ffs_sync(mp, waitfor) if (fs->fs_fmod != 0 && fs->fs_ronly != 0 && ump->um_fsckpid == 0) panic("%s: ffs_sync: modification on read-only filesystem", fs->fs_fsmnt); - if (waitfor == MNT_LAZY) - return (ffs_sync_lazy(mp)); + if (waitfor == MNT_LAZY) { + if (!rebooting) + return (ffs_sync_lazy(mp)); + waitfor = MNT_NOWAIT; + } /* * Write back each (modified) inode. @@ -1560,7 +1563,7 @@ loop: /* * Force stale filesystem control information to be flushed. */ - if (waitfor == MNT_WAIT) { + if (waitfor == MNT_WAIT || rebooting) { if ((error = softdep_flushworklist(ump->um_mountp, &count, td))) allerror = error; /* Flushed work items may create new vnodes to clean */ @@ -1577,9 +1580,12 @@ loop: if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) { BO_UNLOCK(bo); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - if ((error = VOP_FSYNC(devvp, waitfor, td)) != 0) - allerror = error; + error = VOP_FSYNC(devvp, waitfor, td); VOP_UNLOCK(devvp, 0); + if (MOUNTEDSOFTDEP(mp) && (error == 0 || error == EAGAIN)) + error = ffs_sbupdate(ump, waitfor, 0); + if (error != 0) + allerror = error; if (allerror == 0 && waitfor == MNT_WAIT) goto loop; } else if (suspend != 0) { From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 14:15:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 280DEBC5; Fri, 27 Mar 2015 14:15:36 +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 D3870A41; Fri, 27 Mar 2015 14:15:35 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YbV2q-000Daa-85; Fri, 27 Mar 2015 17:15:32 +0300 Date: Fri, 27 Mar 2015 17:15:32 +0300 From: Slawa Olhovchenkov To: Mark Linimon Subject: Re: svn commit: r280727 - in head: share/mk sys/conf Message-ID: <20150327141532.GY23643@zxy.spb.ru> References: <201503270235.t2R2ZCwp047154@svn.freebsd.org> <20150327100014.GA74532@zxy.spb.ru> <20150327135136.GA2397@lonesome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150327135136.GA2397@lonesome.com> User-Agent: Mutt/1.5.23 (2014-03-12) 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, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 14:15:36 -0000 On Fri, Mar 27, 2015 at 08:51:37AM -0500, Mark Linimon wrote: > On Fri, Mar 27, 2015 at 01:00:14PM +0300, Slawa Olhovchenkov wrote: > > Alpha 21064 support EISA. > > Alpha is no longer supported in FreeBSD. I am lost this. From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 14:31:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F3A231F for ; Fri, 27 Mar 2015 14:31:03 +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 ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33A74CD3 for ; Fri, 27 Mar 2015 14:31:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1427466656; bh=XSPFV9xIUYSuHt/+KhCwQ2Pcc7YtfujJAdm3JfrpWVI=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=jD8ACa0+G8+RI2xjoCVrFZJb9W6WKkYlk0cgv1pZWl/otKiLkk04Aoyx4ibqtRznyvLL5QVf0j8Yvy6iBRDk7dOgIWReTGmbMAsrhv48muVnyoyNfCe8VoDBi6o9efnuaQ1Y/A+P7c4QQDxaKTR7pTjrl/wSb2UMoLOuHr1reZO3EFyHOJzFNd5brOWBsKOGXsuW3AC7D+DN/xxybornCbx5UATtjtRNCqmX4vlL8X+/m9Cjscq3tvU+Iv1EFQI94cVIZZ9lm2mjpEKi5r8vQF5CXt57+X9VrRqdyEQK/26T2ARyDHNkMEZ4pW/uYKZEGcFwXlS7X/S6ENXidBRoHA== Received: from [98.139.170.181] by nm26.bullet.mail.bf1.yahoo.com with NNFMP; 27 Mar 2015 14:30:56 -0000 Received: from [68.142.230.75] by tm24.bullet.mail.bf1.yahoo.com with NNFMP; 27 Mar 2015 14:30:56 -0000 Received: from [127.0.0.1] by smtp232.mail.bf1.yahoo.com with NNFMP; 27 Mar 2015 14:30:56 -0000 X-Yahoo-Newman-Id: 828470.53953.bm@smtp232.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: qnXk8CQVM1kCR7_9R9dM6B2.nMlvwhKE3v4jdsP6Cvi29NG bgpNTkElV_jHuYU4TH_PwMzft8bw5l5o8_0j.yNuFNicgLRYKGgNTH_ImWEi qQCDnU0AgeumDuRAtlcWg1B_Bxq4ol8nfyE_YGVugzHxGsGQ57.YedcouKUO z3mEDX3zdadyMvc.tojpfyS5UCflnzmnDwoFur7dwQZ4HX7Z5cnqzILBFyST RBZ_bimQwlVFveX8XGXWxtZ.6cRezWuaP7yPIPYgOGVnFgro7UChWxAEh19E K5yNO6LwgtkZZR6wa3tf2mKhE.frfQ4IklPpnm6zHm0hpmTodkP0kcTJ0ktl rZ3Ml52Qxglx1UIHqzkLrufiBdYIPh5l9e9VWhecJEIH4IyffjFnni_xKZg4 UefYJjud42lSUmXZ8EIqYdZHHjcwMm7Exr4tiCTsH9o7ibJZFGONqBDFBuHC PNq63Ngfs9Aj9ZpapvLYBqXoFefMRCgzRsG2Vtpya10xx50fr1FO16OECh1F xes24FCpjmPay4jmVb0jT4rJ_UOM_JVsj X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <551569A6.9010601@FreeBSD.org> Date: Fri, 27 Mar 2015 09:31:02 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Bruce Evans , Tijl Coosemans Subject: Re: svn commit: r280636 - head/include References: <201503252153.t2PLrInc025854@svn.freebsd.org> <20150326130403.W993@besplex.bde.org> <551376D4.4030003@FreeBSD.org> <20150326170535.U2239@besplex.bde.org> <20150326142052.6789dd50@kalimero.tijl.coosemans.org> <20150327214341.E2629@besplex.bde.org> In-Reply-To: <20150327214341.E2629@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, gerald@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 14:31:03 -0000 On 03/27/15 06:01, Bruce Evans wrote: > On Thu, 26 Mar 2015, Tijl Coosemans wrote: > >> On Thu, 26 Mar 2015 17:37:53 +1100 (EST) Bruce Evans >> wrote: >>> On Wed, 25 Mar 2015, Pedro Giffuni wrote: >>>> On 03/25/15 21:14, Bruce Evans wrote: >>>>> On Wed, 25 Mar 2015, Pedro F. Giffuni wrote: >>>>>> Log: >>>>>> Temporarily revert 280458. >>>>>> >>>>>> GCC is still carries an old version of cdefs.h which doesn't >>>>>> accept multiple parameters for the nonnull attribute. >>>>>> Since this issue probably affects many ports in the tree >>>>>> we will revert it for now until gcc gets fixed. >>>>> >>>>> Note that sys/cdefs.h is supposed to work with any version of >>>>> gcc back to gcc-1, and does mostly work back to at least gcc-2.95. >>>>> The whole point of sys/cdefs.h is to provide compatibity macros >>>>> for old and other non-default compilers. Standard compilers don't >>>>> even have __attribute__(()). So no changes in future versions >>>>> of gcc will fix the previous commit. >>>> >>>> cdefs.h still works for all versions of gcc back to gcc-1 AFAICT. >>> >>> I now remember other bugs in it. I think you put the varargs stuff >>> in the non-gcc version. That won't work compilers that don't support >>> varargs for macros. Neither will not changing the non-gcc version. > > I confirmed the complete brokenness of the varargs stuff for the > non-C99 case. > Hmm ... disabling existing compiler features to get a -Wall error doesn't qualify as complete brokenness. since gcc 2.95 C99 supports vararg macros we are basically talking about support for gcc 2.8 here. >>> glibc (2.6 at least) avoids using varargs in its __nonnull() macro >>> by using the same portable method that is used in many optional >>> debugging statements including FreeBSD's KASSERT(). ... >> >> Maybe introduce a __nonnull_all macro and leave __nonnull varargs-free: >> >> #define __nonnull(x) __attribute__((__nonnull__(x))) >> #define __nonnull_all __attribute__((__nonnull__)) >> >> Then in the rare cases where multiple arguments must be nonnull but >> __nonnull_all doesn't apply you can use multiple __nonnull: >> >> int f(void *, void *, void *) __nonnull(1) __nonnull(2); > > Good idea. There aren't many functions that accept null for some > pointer args but not others. > > The multiple __nonnull() method is already used a lot. E.g., in > sys/systm.h it is used 11 times. systm.h also gives many examples > where __nonnull_all cannot be used. It cannot be used for the > strto* family because endptr can be null, or for the copyinstr() > family for similar reasons (a value may be returned indirectly > but the pointer for this is null if this value is not needed). > This would become very long for some of the functions in pthread.h. I can accept reverting the variadic macro merge in 10-stable but I really think FreeBSD 11 has to move on. Pedro. From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 14:40:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C326F646; Fri, 27 Mar 2015 14: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 AE594DF3; Fri, 27 Mar 2015 14:40:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2REexS7091857; Fri, 27 Mar 2015 14:40:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2REex0u091855; Fri, 27 Mar 2015 14:40:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503271440.t2REex0u091855@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Mar 2015 14:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280761 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 14:40:59 -0000 Author: emaste Date: Fri Mar 27 14:40:58 2015 New Revision: 280761 URL: https://svnweb.freebsd.org/changeset/base/280761 Log: Remove ALPHA leftover Modified: head/sys/sys/kerneldump.h Modified: head/sys/sys/kerneldump.h ============================================================================== --- head/sys/sys/kerneldump.h Fri Mar 27 13:55:56 2015 (r280760) +++ head/sys/sys/kerneldump.h Fri Mar 27 14:40:58 2015 (r280761) @@ -66,7 +66,6 @@ struct kerneldumpheader { uint32_t version; #define KERNELDUMPVERSION 1 uint32_t architectureversion; -#define KERNELDUMP_ALPHA_VERSION 1 #define KERNELDUMP_AMD64_VERSION 2 #define KERNELDUMP_ARM_VERSION 1 #define KERNELDUMP_I386_VERSION 2 From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 15:43:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98333180; Fri, 27 Mar 2015 15:43:26 +0000 (UTC) Received: from relay.mailchannels.net (aso-006-i440.relay.mailchannels.net [23.91.64.121]) by mx1.freebsd.org (Postfix) with ESMTP id 622DA7E5; Fri, 27 Mar 2015 15:43:24 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp2.ore.mailhop.org (ip-10-237-13-110.us-west-2.compute.internal [10.237.13.110]) by relay.mailchannels.net (Postfix) with ESMTPA id D641B100010; Fri, 27 Mar 2015 15:43:17 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp2.ore.mailhop.org (smtp2.ore.mailhop.org [10.83.15.107]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Fri, 27 Mar 2015 15:43:18 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1427470997977:701782904 X-MC-Ingress-Time: 1427470997976 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp2.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YbWPl-0003Aq-2d; Fri, 27 Mar 2015 15:43:17 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2RFhFlO050079; Fri, 27 Mar 2015 09:43:15 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX19ADVCdaMVOhcj7rtIrXu5H Message-ID: <1427470995.91374.7.camel@freebsd.org> Subject: Re: svn commit: r280760 - head/sys/ufs/ffs From: Ian Lepore To: Konstantin Belousov Date: Fri, 27 Mar 2015 09:43:15 -0600 In-Reply-To: <201503271355.t2RDtuLt071068@svn.freebsd.org> References: <201503271355.t2RDtuLt071068@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie Cc: svn-src-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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:43:26 -0000 On Fri, 2015-03-27 at 13:55 +0000, Konstantin Belousov wrote: > Author: kib > Date: Fri Mar 27 13:55:56 2015 > New Revision: 280760 > URL: https://svnweb.freebsd.org/changeset/base/280760 > > Log: > Fix the hand after the immediate reboot when the following command > sequence is performed on UFS SU+J rootfs: > cp -Rp /sbin/init /sbin/init.old > mv -f /sbin/init.old /sbin/init > > Hang occurs on the rootfs unmount. There are two issues: > > 1. Removed init binary, which is still mapped, creates a reference to > the removed vnode. The inodeblock for such vnode must have active > inodedep, which is (eventually) linked through the unlinked list. This > means that ffs_sync(MNT_SUSPEND) cannot succeed, because number of > softdep workitems for the mp is always > 0. FFS is suspended during > unmount, so unmount just hangs. > > 2. As noted above, the inodedep is linked eventually. It is not > linked until the superblock is written. But at the vfs_unmountall() > time, when the rootfs is unmounted, the call is made to > ffs_unmount()->ffs_sync() before vflush(), and ffs_sync() only calls > ffs_sbupdate() after all workitems are flushed. It is masked for > normal system operations, because syncer works in parallel and > eventually flushes superblock. Syncer is stopped when rootfs > unmounted, so ffs_sync() must do sb update on its own. > > Correct the issues listed above. For MNT_SUSPEND, count the number of > linked unlinked inodedeps (this is not a typo) and substract the count > of such workitems from the total. For the second issue, the > ffs_sbupdate() is called right after device sync in ffs_sync() loop. > > There is third problem, occuring with both SU and SU+J. The > softdep_waitidle() loop, which waits for softdep_flush() thread to > clear the worklist, only waits 20ms max. It seems that the 1 tick, > specified for msleep(9), was a typo. > > Add fsync(devvp, MNT_WAIT) call to softdep_waitidle(), which seems to > significantly help the softdep thread, and change the MNT_LAZY update > at the reboot time to MNT_WAIT for similar reasons. Note that > userspace cannot create more work while devvp is flushed, since the > mount point is always suspended before the call to softdep_waitidle() > in unmount or remount path. > > PR: 195458 > In collaboration with: gjb, pho > Reviewed by: mckusick > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > > Modified: > head/sys/ufs/ffs/ffs_softdep.c > head/sys/ufs/ffs/ffs_vfsops.c This is causing warning: function declaration isn't a prototype on platforms that still compile with old gcc. Simple fix, but I thought you might want to do the commit so you can get an mfc reminder along with the main commit. -- Ian Index: sys/ufs/ffs/ffs_softdep.c =================================================================== --- sys/ufs/ffs/ffs_softdep.c (revision 280761) +++ sys/ufs/ffs/ffs_softdep.c (working copy) @@ -804,6 +804,7 @@ static struct indirdep *indirdep_lookup(struct mou struct buf *); static void cancel_indirdep(struct indirdep *, struct buf *, struct freeblks *); +static int check_inodedep_free(struct inodedep *); static void free_indirdep(struct indirdep *); static void free_diradd(struct diradd *, struct workhead *); static void merge_diradd(struct inodedep *, struct diradd *); From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 15:46:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B42D4A6; Fri, 27 Mar 2015 15:46:00 +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 02DDA81B; Fri, 27 Mar 2015 15:45:59 +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 t2RFjrpQ087845 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 27 Mar 2015 17:45:53 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2RFjrpQ087845 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2RFjr0Y087844; Fri, 27 Mar 2015 17:45:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Mar 2015 17:45:53 +0200 From: Konstantin Belousov To: Ian Lepore Subject: Re: svn commit: r280760 - head/sys/ufs/ffs Message-ID: <20150327154552.GN2379@kib.kiev.ua> References: <201503271355.t2RDtuLt071068@svn.freebsd.org> <1427470995.91374.7.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1427470995.91374.7.camel@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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:46:00 -0000 On Fri, Mar 27, 2015 at 09:43:15AM -0600, Ian Lepore wrote: > On Fri, 2015-03-27 at 13:55 +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Mar 27 13:55:56 2015 > > New Revision: 280760 > > URL: https://svnweb.freebsd.org/changeset/base/280760 > > > > Log: > > Fix the hand after the immediate reboot when the following command > > sequence is performed on UFS SU+J rootfs: > > cp -Rp /sbin/init /sbin/init.old > > mv -f /sbin/init.old /sbin/init > > > > Hang occurs on the rootfs unmount. There are two issues: > > > > 1. Removed init binary, which is still mapped, creates a reference to > > the removed vnode. The inodeblock for such vnode must have active > > inodedep, which is (eventually) linked through the unlinked list. This > > means that ffs_sync(MNT_SUSPEND) cannot succeed, because number of > > softdep workitems for the mp is always > 0. FFS is suspended during > > unmount, so unmount just hangs. > > > > 2. As noted above, the inodedep is linked eventually. It is not > > linked until the superblock is written. But at the vfs_unmountall() > > time, when the rootfs is unmounted, the call is made to > > ffs_unmount()->ffs_sync() before vflush(), and ffs_sync() only calls > > ffs_sbupdate() after all workitems are flushed. It is masked for > > normal system operations, because syncer works in parallel and > > eventually flushes superblock. Syncer is stopped when rootfs > > unmounted, so ffs_sync() must do sb update on its own. > > > > Correct the issues listed above. For MNT_SUSPEND, count the number of > > linked unlinked inodedeps (this is not a typo) and substract the count > > of such workitems from the total. For the second issue, the > > ffs_sbupdate() is called right after device sync in ffs_sync() loop. > > > > There is third problem, occuring with both SU and SU+J. The > > softdep_waitidle() loop, which waits for softdep_flush() thread to > > clear the worklist, only waits 20ms max. It seems that the 1 tick, > > specified for msleep(9), was a typo. > > > > Add fsync(devvp, MNT_WAIT) call to softdep_waitidle(), which seems to > > significantly help the softdep thread, and change the MNT_LAZY update > > at the reboot time to MNT_WAIT for similar reasons. Note that > > userspace cannot create more work while devvp is flushed, since the > > mount point is always suspended before the call to softdep_waitidle() > > in unmount or remount path. > > > > PR: 195458 > > In collaboration with: gjb, pho > > Reviewed by: mckusick > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 weeks > > > > Modified: > > head/sys/ufs/ffs/ffs_softdep.c > > head/sys/ufs/ffs/ffs_vfsops.c > > This is causing warning: function declaration isn't a prototype on > platforms that still compile with old gcc. Simple fix, but I thought > you might want to do the commit so you can get an mfc reminder along > with the main commit. > > -- Ian > > Index: sys/ufs/ffs/ffs_softdep.c > =================================================================== > --- sys/ufs/ffs/ffs_softdep.c (revision 280761) > +++ sys/ufs/ffs/ffs_softdep.c (working copy) > @@ -804,6 +804,7 @@ static struct indirdep *indirdep_lookup(struct mou > struct buf *); > static void cancel_indirdep(struct indirdep *, struct buf *, > struct freeblks *); > +static int check_inodedep_free(struct inodedep *); > static void free_indirdep(struct indirdep *); > static void free_diradd(struct diradd *, struct workhead *); > static void merge_diradd(struct inodedep *, struct diradd *); > Yes, thank you. I was already notified and trying to compile ppc GENERIC64 kernel to confirm the same fix. Did you compile-tested the change on arm with gcc ? If so, I will just commit it. From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 15:49:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F26470C; Fri, 27 Mar 2015 15:49: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 6A89E865; Fri, 27 Mar 2015 15:49:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RFnMnB025142; Fri, 27 Mar 2015 15:49:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RFnMcb025141; Fri, 27 Mar 2015 15:49:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503271549.t2RFnMcb025141@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 27 Mar 2015 15:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280763 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:49:22 -0000 Author: kib Date: Fri Mar 27 15:49:21 2015 New Revision: 280763 URL: https://svnweb.freebsd.org/changeset/base/280763 Log: Fix build (with gcc). Reported by: bz, ian Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri Mar 27 15:06:31 2015 (r280762) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Mar 27 15:49:21 2015 (r280763) @@ -738,6 +738,7 @@ static int softdep_process_worklist(stru static int softdep_waitidle(struct mount *, int); static void drain_output(struct vnode *); static struct buf *getdirtybuf(struct buf *, struct rwlock *, int); +static int check_inodedep_free(struct inodedep *); static void clear_remove(struct mount *); static void clear_inodedeps(struct mount *); static void unlinked_inodedep(struct mount *, struct inodedep *); From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 16:16:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D226531E; Fri, 27 Mar 2015 16:16: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 B3691C65; Fri, 27 Mar 2015 16:16:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RGGP9W039035; Fri, 27 Mar 2015 16:16:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RGGOKJ039030; Fri, 27 Mar 2015 16:16:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503271616.t2RGGOKJ039030@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 27 Mar 2015 16:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280764 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:16:25 -0000 Author: hselasky Date: Fri Mar 27 16:16:23 2015 New Revision: 280764 URL: https://svnweb.freebsd.org/changeset/base/280764 Log: Fixes for the LinuxAPI completion wrappers: - make sure the timeout computations are always above zero by using the existing "linux_timer_jiffies_until()" function. Negative timeouts can result in undefined behaviour. - declare all completion functions like external symbols and move the code to the LinuxAPI kernel module. - add a proper prefix to all LinuxAPI kernel functions to avoid namespace collision with other parts of the FreeBSD kernel. - clean up header file inclusions in the linux/completion.h, linux/in.h and linux/fs.h header files. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/linux/completion.h head/sys/ofed/include/linux/fs.h head/sys/ofed/include/linux/in.h head/sys/ofed/include/linux/linux_compat.c Modified: head/sys/ofed/include/linux/completion.h ============================================================================== --- head/sys/ofed/include/linux/completion.h Fri Mar 27 15:49:21 2015 (r280763) +++ head/sys/ofed/include/linux/completion.h Fri Mar 27 16:16:23 2015 (r280764) @@ -32,124 +32,35 @@ #include -#include -#include -#include -#include -#include - struct completion { unsigned int done; }; -#define INIT_COMPLETION(c) ((c).done = 0) -#define init_completion(c) ((c)->done = 0) - -static inline void -_complete_common(struct completion *c, int all) -{ - int wakeup_swapper; - - sleepq_lock(c); - c->done++; - if (all) - wakeup_swapper = sleepq_broadcast(c, SLEEPQ_SLEEP, 0, 0); - else - wakeup_swapper = sleepq_signal(c, SLEEPQ_SLEEP, 0, 0); - sleepq_release(c); - if (wakeup_swapper) - kick_proc0(); -} - -#define complete(c) _complete_common(c, 0) -#define complete_all(c) _complete_common(c, 1) - -/* - * Indefinite wait for done != 0 with or without signals. - */ -static inline long -_wait_for_common(struct completion *c, int flags) -{ - - flags |= SLEEPQ_SLEEP; - for (;;) { - sleepq_lock(c); - if (c->done) - break; - sleepq_add(c, NULL, "completion", flags, 0); - if (flags & SLEEPQ_INTERRUPTIBLE) { - if (sleepq_wait_sig(c, 0) != 0) - return (-ERESTARTSYS); - } else - sleepq_wait(c, 0); - } - c->done--; - sleepq_release(c); - - return (0); -} - -#define wait_for_completion(c) _wait_for_common(c, 0) -#define wait_for_completion_interuptible(c) \ - _wait_for_common(c, SLEEPQ_INTERRUPTIBLE) - -static inline long -_wait_for_timeout_common(struct completion *c, long timeout, int flags) -{ - long end; - - end = ticks + timeout; - flags |= SLEEPQ_SLEEP; - for (;;) { - sleepq_lock(c); - if (c->done) - break; - sleepq_add(c, NULL, "completion", flags, 0); - sleepq_set_timeout(c, end - ticks); - if (flags & SLEEPQ_INTERRUPTIBLE) { - if (sleepq_timedwait_sig(c, 0) != 0) - return (-ERESTARTSYS); - } else - sleepq_timedwait(c, 0); - } - c->done--; - sleepq_release(c); - timeout = end - ticks; - - return (timeout > 0 ? timeout : 1); -} - -#define wait_for_completion_timeout(c, timeout) \ - _wait_for_timeout_common(c, timeout, 0) -#define wait_for_completion_interruptible_timeout(c, timeout) \ - _wait_for_timeout_common(c, timeout, SLEEPQ_INTERRUPTIBLE) - -static inline int -try_wait_for_completion(struct completion *c) -{ - int isdone; - - isdone = 1; - sleepq_lock(c); - if (c->done) - c->done--; - else - isdone = 0; - sleepq_release(c); - return (isdone); -} - -static inline int -completion_done(struct completion *c) -{ - int isdone; - - isdone = 1; - sleepq_lock(c); - if (c->done == 0) - isdone = 0; - sleepq_release(c); - return (isdone); -} +#define INIT_COMPLETION(c) \ + ((c).done = 0) +#define init_completion(c) \ + ((c)->done = 0) +#define complete(c) \ + linux_complete_common((c), 0) +#define complete_all(c) \ + linux_complete_common((c), 1) +#define wait_for_completion(c) \ + linux_wait_for_common((c), 0) +#define wait_for_completion_interuptible(c) \ + linux_wait_for_common((c), 1) +#define wait_for_completion_timeout(c, timeout) \ + linux_wait_for_timeout_common((c), (timeout), 0) +#define wait_for_completion_interruptible_timeout(c, timeout) \ + linux_wait_for_timeout_common((c), (timeout), 1) +#define try_wait_for_completion(c) \ + linux_try_wait_for_completion(c) +#define completion_done(c) \ + linux_completion_done(c) + +extern void linux_complete_common(struct completion *, int); +extern long linux_wait_for_common(struct completion *, int); +extern long linux_wait_for_timeout_common(struct completion *, long, int); +extern int linux_try_wait_for_completion(struct completion *); +extern int linux_completion_done(struct completion *); -#endif /* _LINUX_COMPLETION_H_ */ +#endif /* _LINUX_COMPLETION_H_ */ Modified: head/sys/ofed/include/linux/fs.h ============================================================================== --- head/sys/ofed/include/linux/fs.h Fri Mar 27 15:49:21 2015 (r280763) +++ head/sys/ofed/include/linux/fs.h Fri Mar 27 16:16:23 2015 (r280764) @@ -29,6 +29,8 @@ #ifndef _LINUX_FS_H_ #define _LINUX_FS_H_ +#include +#include #include #include #include Modified: head/sys/ofed/include/linux/in.h ============================================================================== --- head/sys/ofed/include/linux/in.h Fri Mar 27 15:49:21 2015 (r280763) +++ head/sys/ofed/include/linux/in.h Fri Mar 27 16:16:23 2015 (r280764) @@ -31,6 +31,9 @@ #include "opt_inet.h" +#include +#include +#include #include #include Modified: head/sys/ofed/include/linux/linux_compat.c ============================================================================== --- head/sys/ofed/include/linux/linux_compat.c Fri Mar 27 15:49:21 2015 (r280763) +++ head/sys/ofed/include/linux/linux_compat.c Fri Mar 27 16:16:23 2015 (r280764) @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include #include @@ -781,6 +783,117 @@ linux_timer_init(void *arg) } SYSINIT(linux_timer, SI_SUB_DRIVERS, SI_ORDER_FIRST, linux_timer_init, NULL); +void +linux_complete_common(struct completion *c, int all) +{ + int wakeup_swapper; + + sleepq_lock(c); + c->done++; + if (all) + wakeup_swapper = sleepq_broadcast(c, SLEEPQ_SLEEP, 0, 0); + else + wakeup_swapper = sleepq_signal(c, SLEEPQ_SLEEP, 0, 0); + sleepq_release(c); + if (wakeup_swapper) + kick_proc0(); +} + +/* + * Indefinite wait for done != 0 with or without signals. + */ +long +linux_wait_for_common(struct completion *c, int flags) +{ + + if (flags != 0) + flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; + else + flags = SLEEPQ_SLEEP; + for (;;) { + sleepq_lock(c); + if (c->done) + break; + sleepq_add(c, NULL, "completion", flags, 0); + if (flags & SLEEPQ_INTERRUPTIBLE) { + if (sleepq_wait_sig(c, 0) != 0) + return (-ERESTARTSYS); + } else + sleepq_wait(c, 0); + } + c->done--; + sleepq_release(c); + + return (0); +} + +/* + * Time limited wait for done != 0 with or without signals. + */ +long +linux_wait_for_timeout_common(struct completion *c, long timeout, int flags) +{ + long end = jiffies + timeout; + + if (flags != 0) + flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; + else + flags = SLEEPQ_SLEEP; + for (;;) { + int ret; + + sleepq_lock(c); + if (c->done) + break; + sleepq_add(c, NULL, "completion", flags, 0); + sleepq_set_timeout(c, linux_timer_jiffies_until(end)); + if (flags & SLEEPQ_INTERRUPTIBLE) + ret = sleepq_timedwait_sig(c, 0); + else + ret = sleepq_timedwait(c, 0); + if (ret != 0) { + /* check for timeout or signal */ + if (ret == EWOULDBLOCK) + return (0); + else + return (-ERESTARTSYS); + } + } + c->done--; + sleepq_release(c); + + /* return how many jiffies are left */ + return (linux_timer_jiffies_until(end)); +} + +int +linux_try_wait_for_completion(struct completion *c) +{ + int isdone; + + isdone = 1; + sleepq_lock(c); + if (c->done) + c->done--; + else + isdone = 0; + sleepq_release(c); + return (isdone); +} + +int +linux_completion_done(struct completion *c) +{ + int isdone; + + isdone = 1; + sleepq_lock(c); + if (c->done == 0) + isdone = 0; + sleepq_release(c); + return (isdone); +} + static void linux_compat_init(void *arg) { From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 16:36:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11736BE2 for ; Fri, 27 Mar 2015 16:36:33 +0000 (UTC) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D188FF0B for ; Fri, 27 Mar 2015 16:36:32 +0000 (UTC) Received: by pdcp1 with SMTP id p1so9703007pdc.3 for ; Fri, 27 Mar 2015 09:36:26 -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:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=iTlBxWzE97hG+QF2rmgzdPNxJn+XnVl52AzIKjbHfrk=; b=LUwHcNhS31+jhE8PTWFxZN9mG8FEmvmeIYpe5PJWOzAUaWB+IAJEXKm8IJ2sQUDGwO kzwoc4GLYZ76QxAm+cQzXoX5DZb69EMcNcO1Yo3e5dr+TfV4TgNCZ0HTlaFS5i4KcpCl w05u+y3qQnTKOdZkczp2CQDjv/i4DHgBeHCoEuh1u3DJ63Y83ZmnJWmPiFzcRgD87RQM K4fbilQ1Y5wvn2dopaT7KJ0UG/xzLW0j7acm7BZuRxUgI4efp9SDC5dqI8d7Apjrx8T8 5qqcFCzRPiy6IjQBy9OMQ6Dx93w3GhgjnGQtea8mg8+O6rtomxxVBHrcIUkrKsa2HGry 37sg== X-Gm-Message-State: ALoCoQmpuo2f06SNm2Tvwy6eLnfRSo9th2KjxCVzPeglEsgQpE4wWNFN8Hl1Bvp1XAZQjl7HcQJO X-Received: by 10.68.110.37 with SMTP id hx5mr36967756pbb.46.1427474186169; Fri, 27 Mar 2015 09:36:26 -0700 (PDT) Received: from [10.64.24.166] ([69.53.236.236]) by mx.google.com with ESMTPSA id ed5sm2651100pbd.19.2015.03.27.09.36.18 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Mar 2015 09:36:18 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r280728 - head/sys/conf Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_35DE64ED-764A-4F1A-BDF4-9AAC59A2DF0A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Warner Losh In-Reply-To: Date: Fri, 27 Mar 2015 10:36:15 -0600 Message-Id: <7F5C3FC3-3306-458E-83A2-5E67F8F78688@bsdimp.com> References: <201503270235.t2R2ZQeA047220@svn.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.2070.6) 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:36:33 -0000 --Apple-Mail=_35DE64ED-764A-4F1A-BDF4-9AAC59A2DF0A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 27, 2015, at 1:54 AM, Bjoern A. Zeeb wrote: >=20 >=20 >> On 27 Mar 2015, at 02:35 , Warner Losh wrote: >>=20 >> Author: imp >> Date: Fri Mar 27 02:35:25 2015 >> New Revision: 280728 >> URL: https://svnweb.freebsd.org/changeset/base/280728 >>=20 >> Log: >> Categorize certain kernel builds as being broken in certain places. >>=20 >> Differential Revision: https://reviews.freebsd.org/D2011 >>=20 >> Modified: >> head/sys/conf/kern.opts.mk >>=20 >> Modified: head/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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/conf/kern.opts.mk Fri Mar 27 02:35:11 2015 = (r280727) >> +++ head/sys/conf/kern.opts.mk Fri Mar 27 02:35:25 2015 = (r280728) >> @@ -75,6 +75,34 @@ BROKEN_OPTIONS+=3D EISA >> BROKEN_OPTIONS+=3D OFED >> .endif >>=20 >> +# Options that cannot be turned on this architecture, usually = because >> +# of compilation or other issues so severe it cannot be used even >> +# on an experimental basis >> +__ALWAYS_NO_OPTIONS=3D >> + >> +# Things that don't work based on the CPU >> +.if ${MACHINE_CPUARCH} =3D=3D "arm" >> +__ALWAYS_NO_OPTIONS+=3D CDDL ZFS >> +.endif >> + >> +.if ${MACHINE_CPUARCH} =3D=3D "mips" >> +__ALWAYS_NO_OPTIONS+=3D CDDL ZFS >> +.endif >> + >=20 >=20 > Wouldn=E2=80=99t this also mean no Dtrace on arm or mips? Please = revert this. This just enshrines what=E2=80=99s already in the sys/modules/Makefiles. = It already wasn=E2=80=99t building them for arm or mips. This doesn=E2=80=99t change that. It also = doesn=E2=80=99t change the ability of people to add these to the list of files that are built. = The module files don=E2=80=99t check. There=E2=80=99s nothing to revert. Warner --Apple-Mail=_35DE64ED-764A-4F1A-BDF4-9AAC59A2DF0A 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 iQIcBAEBCgAGBQJVFYcAAAoJEGwc0Sh9sBEA3HEP/2ow0ZHhaZZLiOdUHC3JF0sM oP+ih3yf6mWjrgVbAwSwMVPng66m5uKmwMy6yk6cCSL5h4ZgilOA64toIGDAMOEI Y6LXGhXoLEPZFKZt8DLBwjsOMPOsM0uUL4hNtye7MiSOgCkXEHU5ul7lh1eq8/Le tF0vqTvBmvM1QWMKi7hOWyi3NVoFKLEtHMFjN5MjXTRHHjf2UJdCu2YksWxQDIlT u1iD+ZQ2Rdp76cNCmQHJeMk7Pw129t2xvgiNT8qhhlTpYuem4+anHGmnyTu2mS5f JeOiDB6aF+ME0n1KVctOls1ojRMX3KKm5cdten3ob6BtZ7/cjqjFsuWCr6gdZs3u h0P7K9+nrwNSOeEIys+8wZyPjbSays1JSZxo/zf70Xdt+E6HlWEj9jeHvp2oZwSq GK5xm3mrs2WUDMCX3T1bkCxF1XLfxwwu46291Hp7/WsRyZ4Vytn6d89AxEZR2tD6 XWxVxzsznmZsaNoVIDGVJe9HA7RZ11C0rbMhkg2agRRAj/mHKArIUPCKFsVPoihx FhL76gD44tu6Jw4PRLf0CSHVfqQ3y3ZyQu9ZzQVPBKURVf7x0BrtOT5PJzz/h4B3 vHvgElEz04AIz3YbduBN5vY11K7z9CD2/eC/AHikr5oXkQwkAzXd/j9nf2SXXlgH Vc1FmjsyhFDRne2fRgrL =9GCT -----END PGP SIGNATURE----- --Apple-Mail=_35DE64ED-764A-4F1A-BDF4-9AAC59A2DF0A-- From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 17:15:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4867A7F9; Fri, 27 Mar 2015 17:15: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 334D7666; Fri, 27 Mar 2015 17:15:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RHFIQH067585; Fri, 27 Mar 2015 17:15:18 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RHFIhl067584; Fri, 27 Mar 2015 17:15:18 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201503271715.t2RHFIhl067584@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 27 Mar 2015 17:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280765 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 17:15:19 -0000 Author: brueffer Date: Fri Mar 27 17:15:17 2015 New Revision: 280765 URL: https://svnweb.freebsd.org/changeset/base/280765 Log: Mention support for 16h family processors, added in r263169. PR: 198933 Submitted by: isoa@kapsi.fi MFC after: 1 week Modified: head/share/man/man4/amdtemp.4 Modified: head/share/man/man4/amdtemp.4 ============================================================================== --- head/share/man/man4/amdtemp.4 Fri Mar 27 16:16:23 2015 (r280764) +++ head/share/man/man4/amdtemp.4 Fri Mar 27 17:15:17 2015 (r280765) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 2012 +.Dd March 27, 2015 .Dt AMDTEMP 4 .Os .Sh NAME @@ -53,7 +53,7 @@ The driver provides support for the on-die digital thermal sensor present in .Tn AMD -Family 0Fh, 10h, 11h, 12h, 14h, and 15h processors. +Family 0Fh, 10h, 11h, 12h, 14h, 15h, and 16h processors. .Pp For Family 0Fh processors, the .Nm @@ -64,7 +64,7 @@ The driver also creates in the corresponding CPU device's sysctl tree, displaying the maximum temperature of the two sensors located in each CPU core. .Pp -For Family 10h, 11h, 12h, 14h, and 15h processors, the driver reports each +For Family 10h, 11h, 12h, 14h, 15h and 16h processors, the driver reports each package's temperature through a sysctl node, named .Va dev.amdtemp.%d.core0.sensor0 . The driver also creates From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 17:36:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD55717E; Fri, 27 Mar 2015 17:36: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 9EDF3972; Fri, 27 Mar 2015 17:36:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RHaNUF077091; Fri, 27 Mar 2015 17:36:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RHaNL8077090; Fri, 27 Mar 2015 17:36:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503271736.t2RHaNL8077090@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 27 Mar 2015 17:36:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280766 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 17:36:23 -0000 Author: imp Date: Fri Mar 27 17:36:22 2015 New Revision: 280766 URL: https://svnweb.freebsd.org/changeset/base/280766 Log: Add a note of clarification. MK_* variables only control what modules are built by default. You can still override that with MODULES_EXTRA for experimental features like ZFS and dtrace on some architectures. Also note that kernel config files are not affected by MK_ options listed, though some targets might be. Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Fri Mar 27 17:15:17 2015 (r280765) +++ head/sys/conf/kern.opts.mk Fri Mar 27 17:36:22 2015 (r280766) @@ -51,6 +51,10 @@ __DEFAULT_NO_OPTIONS = \ # Some options are totally broken on some architectures. We disable # them. If you need to enable them on an experimental basis, you # must change this code. +# Note: These only apply to the list of modules we build by default +# and sometimes what is in the opt_*.h files by default. +# Kernel config files are unaffected, though some targets can be +# affected by KERNEL_SYMBOLS, FORMAT_EXTENSIONS, CTF and SSP. # Things that don't work based on the CPU .if ${MACHINE_CPUARCH} == "arm" @@ -75,34 +79,6 @@ BROKEN_OPTIONS+= EISA BROKEN_OPTIONS+= OFED .endif -# Options that cannot be turned on this architecture, usually because -# of compilation or other issues so severe it cannot be used even -# on an experimental basis -__ALWAYS_NO_OPTIONS= - -# Things that don't work based on the CPU -.if ${MACHINE_CPUARCH} == "arm" -__ALWAYS_NO_OPTIONS+= CDDL ZFS -.endif - -.if ${MACHINE_CPUARCH} == "mips" -__ALWAYS_NO_OPTIONS+= CDDL ZFS -.endif - -.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpc64" -__ALWAYS_NO_OPTIONS+= ZFS -.endif - -# Things that don't work because the kernel doesn't have the support -# for them. -.if ${MACHINE} != "i386" -__ALWAYS_NO_OPTIONS+= EISA -.endif - -.if ${MACHINE} != "i386" && ${MACHINE} != "amd64" -__ALWAYS_NO_OPTIONS+= OFED -.endif - # expanded inline from bsd.mkopt.mk to avoid share/mk dependency # Those that default to yes @@ -148,16 +124,6 @@ MK_${var}:= no #end of bsd.mkopt.mk expanded inline. # -# MK_* options which are always no, usually because they are -# unsupported/badly broken on this architecture. -# -.for var in ${__ALWAYS_NO_OPTIONS} -MK_${var}:= no -.endfor -.undef __ALWAYS_NO_OPTIONS -#end of bsd.mkopt.mk expanded inline. - -# # MK_*_SUPPORT options which default to "yes" unless their corresponding # MK_* variable is set to "no". # From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 18:23:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82B97DE3; Fri, 27 Mar 2015 18:23: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 6E016F7B; Fri, 27 Mar 2015 18:23:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RIN8so000294; Fri, 27 Mar 2015 18:23:08 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RIN7sX000292; Fri, 27 Mar 2015 18:23:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201503271823.t2RIN7sX000292@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 27 Mar 2015 18:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280767 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 18:23:08 -0000 Author: delphij Date: Fri Mar 27 18:23:06 2015 New Revision: 280767 URL: https://svnweb.freebsd.org/changeset/base/280767 Log: Fix remaining warnings. MFC after: 2 weeks Modified: head/sbin/md5/Makefile head/sbin/md5/md5.c Modified: head/sbin/md5/Makefile ============================================================================== --- head/sbin/md5/Makefile Fri Mar 27 17:36:22 2015 (r280766) +++ head/sbin/md5/Makefile Fri Mar 27 18:23:06 2015 (r280767) @@ -13,9 +13,6 @@ MLINKS= md5.1 rmd160.1 \ md5.1 sha256.1 \ md5.1 sha512.1 -NO_WMISSING_VARIABLE_DECLARATIONS= -WFORMAT?= 1 - LIBADD= md .include Modified: head/sbin/md5/md5.c ============================================================================== --- head/sbin/md5/md5.c Fri Mar 27 17:36:22 2015 (r280766) +++ head/sbin/md5/md5.c Fri Mar 27 18:23:06 2015 (r280767) @@ -91,7 +91,7 @@ typedef union { /* algorithm function table */ -struct Algorithm_t Algorithm[] = { +static struct Algorithm_t Algorithm[] = { { "md5", "MD5", &MD5TestOutput, (DIGEST_Init*)&MD5Init, (DIGEST_Update*)&MD5_Update, (DIGEST_End*)&MD5End, &MD5Data, &MD5File }, @@ -282,7 +282,7 @@ MDTimeTrial(Algorithm_t *alg) * Digests a reference suite of strings and prints the results. */ -const char *MDTestInput[MDTESTCOUNT] = { +static const char *MDTestInput[MDTESTCOUNT] = { "", "a", "abc", From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 19:08:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3597B69D; Fri, 27 Mar 2015 19:08: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 205BA69C; Fri, 27 Mar 2015 19:08:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RJ8BO9019650; Fri, 27 Mar 2015 19:08:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RJ8BtS019649; Fri, 27 Mar 2015 19:08:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503271908.t2RJ8BtS019649@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 27 Mar 2015 19:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280768 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 19:08:12 -0000 Author: hselasky Date: Fri Mar 27 19:08:11 2015 New Revision: 280768 URL: https://svnweb.freebsd.org/changeset/base/280768 Log: Fix variable casting: - Jiffies or ticks in FreeBSD have integer type and are not long. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/linux/jiffies.h Modified: head/sys/ofed/include/linux/jiffies.h ============================================================================== --- head/sys/ofed/include/linux/jiffies.h Fri Mar 27 18:23:06 2015 (r280767) +++ head/sys/ofed/include/linux/jiffies.h Fri Mar 27 19:08:11 2015 (r280768) @@ -45,14 +45,12 @@ msecs_to_jiffies(int msec) return (tvtohz(&tv)); } - #define jiffies ticks #define jiffies_to_msecs(x) (((int64_t)(x)) * 1000 / hz) - -#define time_after(a, b) ((long)(b) - (long)(a) < 0) +#define time_after(a, b) ((int)((b) - (a)) < 0) #define time_before(a, b) time_after(b,a) -#define time_after_eq(a, b) ((long)(a) - (long)(b) >= 0) +#define time_after_eq(a, b) ((int)((a) - (b)) >= 0) #define time_before_eq(a, b) time_after_eq(b, a) #define HZ hz From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 19:34:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DC43FBB; Fri, 27 Mar 2015 19:34: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 787F0AAD; Fri, 27 Mar 2015 19:34:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RJYP2D033282; Fri, 27 Mar 2015 19:34:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RJYPpO033281; Fri, 27 Mar 2015 19:34:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503271934.t2RJYPpO033281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Mar 2015 19:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280769 - head/usr.sbin/crunch/crunchide X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 19:34:25 -0000 Author: emaste Date: Fri Mar 27 19:34:24 2015 New Revision: 280769 URL: https://svnweb.freebsd.org/changeset/base/280769 Log: crunchide: arm64 support Submitted by: andrew@ Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/crunch/crunchide/Makefile Modified: head/usr.sbin/crunch/crunchide/Makefile ============================================================================== --- head/usr.sbin/crunch/crunchide/Makefile Fri Mar 27 19:08:11 2015 (r280768) +++ head/usr.sbin/crunch/crunchide/Makefile Fri Mar 27 19:34:24 2015 (r280769) @@ -10,7 +10,8 @@ CFLAGS+=-DNLIST_AOUT SRCS+= exec_aout.c .endif -.if ${TARGET_ARCH} == amd64 || ${TARGET_ARCH} == powerpc64 || \ +.if ${TARGET_ARCH} == aarch64 || ${TARGET_ARCH} == amd64 || \ + ${TARGET_ARCH} == powerpc64 || \ ${TARGET_ARCH} == sparc64 || ${TARGET_ARCH:Mmips64*} CFLAGS+=-DNLIST_ELF64 SRCS+= exec_elf64.c From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 19:42:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB985318; Fri, 27 Mar 2015 19:42: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 9650CBE7; Fri, 27 Mar 2015 19:42:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RJgdRQ037844; Fri, 27 Mar 2015 19:42:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RJgdvf037843; Fri, 27 Mar 2015 19:42:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503271942.t2RJgdvf037843@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Mar 2015 19:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280770 - head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 19:42:39 -0000 Author: emaste Date: Fri Mar 27 19:42:38 2015 New Revision: 280770 URL: https://svnweb.freebsd.org/changeset/base/280770 Log: lldb: Move debug register output into __amd64__ This debug register diagnostic is really only applicable to amd64 at present. Sponsored by: The FreeBSD Foundation Modified: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Modified: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Fri Mar 27 19:34:24 2015 (r280769) +++ head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Fri Mar 27 19:42:38 2015 (r280770) @@ -112,8 +112,6 @@ PtraceWrapper(int req, lldb::pid_t pid, log->Printf("PT_GETREGS: bp=0x%lx", r->r_rbp); log->Printf("PT_GETREGS: ax=0x%lx", r->r_rax); } -#endif -#ifndef __powerpc__ if (req == PT_GETDBREGS || req == PT_SETDBREGS) { struct dbreg *r = (struct dbreg *) addr; char setget = (req == PT_GETDBREGS) ? 'G' : 'S'; From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 21:47:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3548BA7D; Fri, 27 Mar 2015 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 2015BBF1; Fri, 27 Mar 2015 21:47:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RLlFWu095232; Fri, 27 Mar 2015 21:47:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RLlFiN095231; Fri, 27 Mar 2015 21:47:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503272147.t2RLlFiN095231@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 27 Mar 2015 21:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280771 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:47:16 -0000 Author: imp Date: Fri Mar 27 21:47:15 2015 New Revision: 280771 URL: https://svnweb.freebsd.org/changeset/base/280771 Log: Revert the __ALWAYS_NO stuff. It had already been committed as BROKEN. Modified: head/share/mk/bsd.mkopt.mk Modified: head/share/mk/bsd.mkopt.mk ============================================================================== --- head/share/mk/bsd.mkopt.mk Fri Mar 27 19:42:38 2015 (r280770) +++ head/share/mk/bsd.mkopt.mk Fri Mar 27 21:47:15 2015 (r280771) @@ -67,15 +67,6 @@ MK_${var}:= no # MK_* options which are always no, usually because they are # unsupported/badly broken on this architecture. # -.for var in ${__ALWAYS_NO_OPTIONS} -MK_${var}:= no -.endfor -.undef __ALWAYS_NO_OPTIONS - -# -# MK_* options which are always no, usually because they are -# unsupported/badly broken on this architecture. -# .for var in ${BROKEN_OPTIONS} MK_${var}:= no .endfor From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 23:10:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAC66CD3; Fri, 27 Mar 2015 23:10: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 B4960638; Fri, 27 Mar 2015 23:10:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2RNAH0u035004; Fri, 27 Mar 2015 23:10:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2RNAGsn035000; Fri, 27 Mar 2015 23:10:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503272310.t2RNAGsn035000@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 27 Mar 2015 23:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280772 - in head/sys: conf dev/fdt 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:10:17 -0000 Author: ian Date: Fri Mar 27 23:10:15 2015 New Revision: 280772 URL: https://svnweb.freebsd.org/changeset/base/280772 Log: Make simplebus a base class of ofwbus. This allows the elimination of duplicated code in the two classes, and also allows devices in FDT-based systems to declare simplebus as their parent and still work correctly when the FDT data describes the device at the root of the tree rather than as a child of a simplebus (which is common for interrupt, clock, and power controllers). Differential Revision: https://reviews.freebsd.org/D1990 Submitted by: Michal Meloun Modified: head/sys/conf/files.powerpc head/sys/dev/fdt/simplebus.c head/sys/dev/fdt/simplebus.h head/sys/dev/ofw/ofwbus.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Mar 27 21:47:15 2015 (r280771) +++ head/sys/conf/files.powerpc Fri Mar 27 23:10:15 2015 (r280772) @@ -29,6 +29,8 @@ dev/adb/adb_buttons.c optional adb dev/agp/agp_apple.c optional agp powermac dev/fb/fb.c optional sc dev/fdt/fdt_powerpc.c optional fdt +# ofwbus depends on simplebus. +dev/fdt/simplebus.c optional aim | fdt dev/hwpmc/hwpmc_powerpc.c optional hwpmc dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc dev/hwpmc/hwpmc_ppc970.c optional hwpmc Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Fri Mar 27 21:47:15 2015 (r280771) +++ head/sys/dev/fdt/simplebus.c Fri Mar 27 23:10:15 2015 (r280772) @@ -49,7 +49,10 @@ static struct resource *simplebus_alloc_ int *, u_long, u_long, u_long, u_int); static void simplebus_probe_nomatch(device_t bus, device_t child); static int simplebus_print_child(device_t bus, device_t child); - +static device_t simplebus_add_child(device_t dev, u_int order, + const char *name, int unit); +static struct resource_list *simplebus_get_resource_list(device_t bus, + device_t child); /* * ofw_bus interface */ @@ -62,8 +65,6 @@ static const struct ofw_bus_devinfo *sim static int simplebus_fill_ranges(phandle_t node, struct simplebus_softc *sc); -static struct simplebus_devinfo *simplebus_setup_dinfo(device_t dev, - phandle_t node); /* * Driver methods. @@ -72,10 +73,17 @@ static device_method_t simplebus_methods /* Device interface */ DEVMETHOD(device_probe, simplebus_probe), DEVMETHOD(device_attach, simplebus_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ + DEVMETHOD(bus_add_child, simplebus_add_child), DEVMETHOD(bus_print_child, simplebus_print_child), DEVMETHOD(bus_probe_nomatch, simplebus_probe_nomatch), + DEVMETHOD(bus_read_ivar, bus_generic_read_ivar), + DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, simplebus_alloc_resource), @@ -83,7 +91,10 @@ static device_method_t simplebus_methods DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + DEVMETHOD(bus_get_resource_list, simplebus_get_resource_list), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, simplebus_get_devinfo), @@ -132,13 +143,33 @@ static int simplebus_attach(device_t dev) { struct simplebus_softc *sc; - struct simplebus_devinfo *di; phandle_t node; - device_t cdev; - node = ofw_bus_get_node(dev); sc = device_get_softc(dev); + simplebus_init(dev, 0); + if (simplebus_fill_ranges(sc->node, sc) < 0) { + device_printf(dev, "could not get ranges\n"); + return (ENXIO); + } + + /* + * In principle, simplebus could have an interrupt map, but ignore that + * for now + */ + + for (node = OF_child(sc->node); node > 0; node = OF_peer(node)) + simplebus_add_device(dev, node, 0, NULL, -1, NULL); + return (bus_generic_attach(dev)); +} + +void +simplebus_init(device_t dev, phandle_t node) +{ + struct simplebus_softc *sc; + sc = device_get_softc(dev); + if (node == 0) + node = ofw_bus_get_node(dev); sc->dev = dev; sc->node = node; @@ -149,33 +180,6 @@ simplebus_attach(device_t dev) OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); sc->scells = 1; OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); - - if (simplebus_fill_ranges(node, sc) < 0) { - device_printf(dev, "could not get ranges\n"); - return (ENXIO); - } - - /* - * In principle, simplebus could have an interrupt map, but ignore that - * for now - */ - - for (node = OF_child(node); node > 0; node = OF_peer(node)) { - if ((di = simplebus_setup_dinfo(dev, node)) == NULL) - continue; - cdev = device_add_child(dev, NULL, -1); - if (cdev == NULL) { - device_printf(dev, "<%s>: device_add_child failed\n", - di->obdinfo.obd_name); - resource_list_free(&di->rl); - ofw_bus_gen_destroy_devinfo(&di->obdinfo); - free(di, M_DEVBUF); - continue; - } - device_set_ivars(cdev, di); - } - - return (bus_generic_attach(dev)); } static int @@ -227,17 +231,21 @@ simplebus_fill_ranges(phandle_t node, st return (sc->nranges); } -static struct simplebus_devinfo * -simplebus_setup_dinfo(device_t dev, phandle_t node) +struct simplebus_devinfo * +simplebus_setup_dinfo(device_t dev, phandle_t node, + struct simplebus_devinfo *di) { struct simplebus_softc *sc; struct simplebus_devinfo *ndi; sc = device_get_softc(dev); - - ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + if (di == NULL) + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + else + ndi = di; if (ofw_bus_gen_setup_devinfo(&ndi->obdinfo, node) != 0) { - free(ndi, M_DEVBUF); + if (di == NULL) + free(ndi, M_DEVBUF); return (NULL); } @@ -248,6 +256,48 @@ simplebus_setup_dinfo(device_t dev, phan return (ndi); } +device_t +simplebus_add_device(device_t dev, phandle_t node, u_int order, + const char *name, int unit, struct simplebus_devinfo *di) +{ + struct simplebus_devinfo *ndi; + device_t cdev; + + if ((ndi = simplebus_setup_dinfo(dev, node, di)) == NULL) + return (NULL); + cdev = device_add_child_ordered(dev, order, name, unit); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + ndi->obdinfo.obd_name); + resource_list_free(&ndi->rl); + ofw_bus_gen_destroy_devinfo(&ndi->obdinfo); + if (di == NULL) + free(ndi, M_DEVBUF); + return (NULL); + } + device_set_ivars(cdev, ndi); + + return(cdev); +} + +static device_t +simplebus_add_child(device_t dev, u_int order, const char *name, int unit) +{ + device_t cdev; + struct simplebus_devinfo *ndi; + + cdev = device_add_child_ordered(dev, order, name, unit); + if (cdev == NULL) + return (NULL); + + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + ndi->obdinfo.obd_node = -1; + resource_list_init(&ndi->rl); + device_set_ivars(cdev, ndi); + + return (cdev); +} + static const struct ofw_bus_devinfo * simplebus_get_devinfo(device_t bus __unused, device_t child) { @@ -257,6 +307,15 @@ simplebus_get_devinfo(device_t bus __unu return (&ndi->obdinfo); } +static struct resource_list * +simplebus_get_resource_list(device_t bus __unused, device_t child) +{ + struct simplebus_devinfo *ndi; + + ndi = device_get_ivars(child); + return (&ndi->rl); +} + static struct resource * simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -335,9 +394,11 @@ simplebus_probe_nomatch(device_t bus, de if (!bootverbose) return; + compat = ofw_bus_get_compat(child); + if (compat == NULL) + return; name = ofw_bus_get_name(child); type = ofw_bus_get_type(child); - compat = ofw_bus_get_compat(child); device_printf(bus, "<%s>", name != NULL ? name : "unknown"); simplebus_print_res(device_get_ivars(child)); @@ -345,9 +406,7 @@ simplebus_probe_nomatch(device_t bus, de printf(" disabled"); if (type) printf(" type %s", type); - if (compat) - printf(" compat %s", compat); - printf(" (no driver attached)\n"); + printf(" compat %s (no driver attached)\n", compat); } static int Modified: head/sys/dev/fdt/simplebus.h ============================================================================== --- head/sys/dev/fdt/simplebus.h Fri Mar 27 21:47:15 2015 (r280771) +++ head/sys/dev/fdt/simplebus.h Fri Mar 27 23:10:15 2015 (r280772) @@ -26,8 +26,10 @@ * $FreeBSD$ */ -#ifndef _FDT_SIMPLEBUS_PRIVATE_H -#define _FDT_SIMPLEBUS_PRIVATE_H +#ifndef _FDT_SIMPLEBUS_H +#define _FDT_SIMPLEBUS_H + +#include /* FDT simplebus */ DECLARE_CLASS(simplebus_driver); @@ -53,4 +55,10 @@ struct simplebus_devinfo { struct ofw_bus_devinfo obdinfo; struct resource_list rl; }; -#endif /* _FDT_SIMPLEBUS_PRIVATE_H */ + +void simplebus_init(device_t dev, phandle_t node); +device_t simplebus_add_device(device_t dev, phandle_t node, u_int order, + const char *name, int unit, struct simplebus_devinfo *di); +struct simplebus_devinfo *simplebus_setup_dinfo(device_t dev, phandle_t node, + struct simplebus_devinfo *di); +#endif /* _FDT_SIMPLEBUS_H */ Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Fri Mar 27 21:47:15 2015 (r280771) +++ head/sys/dev/ofw/ofwbus.c Fri Mar 27 23:10:15 2015 (r280772) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -62,13 +63,8 @@ __FBSDID("$FreeBSD$"); * */ -struct ofwbus_devinfo { - struct ofw_bus_devinfo ndi_obdinfo; - struct resource_list ndi_rl; -}; - struct ofwbus_softc { - uint32_t acells, scells; + struct simplebus_softc simplebus_sc; struct rman sc_intr_rman; struct rman sc_mem_rman; }; @@ -76,113 +72,31 @@ struct ofwbus_softc { static device_identify_t ofwbus_identify; static device_probe_t ofwbus_probe; static device_attach_t ofwbus_attach; -static bus_print_child_t ofwbus_print_child; -static bus_add_child_t ofwbus_add_child; -static bus_probe_nomatch_t ofwbus_probe_nomatch; static bus_alloc_resource_t ofwbus_alloc_resource; static bus_adjust_resource_t ofwbus_adjust_resource; static bus_release_resource_t ofwbus_release_resource; -static bus_get_resource_list_t ofwbus_get_resource_list; -static ofw_bus_get_devinfo_t ofwbus_get_devinfo; - -static int ofwbus_inlist(const char *, const char *const *); -static struct ofwbus_devinfo * ofwbus_setup_dinfo(device_t, phandle_t); -static void ofwbus_destroy_dinfo(struct ofwbus_devinfo *); -static int ofwbus_print_res(struct ofwbus_devinfo *); static device_method_t ofwbus_methods[] = { /* Device interface */ DEVMETHOD(device_identify, ofwbus_identify), DEVMETHOD(device_probe, ofwbus_probe), DEVMETHOD(device_attach, ofwbus_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, ofwbus_print_child), - DEVMETHOD(bus_probe_nomatch, ofwbus_probe_nomatch), - DEVMETHOD(bus_read_ivar, bus_generic_read_ivar), - DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), - DEVMETHOD(bus_add_child, ofwbus_add_child), - DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), DEVMETHOD(bus_alloc_resource, ofwbus_alloc_resource), DEVMETHOD(bus_adjust_resource, ofwbus_adjust_resource), DEVMETHOD(bus_release_resource, ofwbus_release_resource), - DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), - DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), - DEVMETHOD(bus_get_resource_list, ofwbus_get_resource_list), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_config_intr, bus_generic_config_intr), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - - /* ofw_bus interface */ - DEVMETHOD(ofw_bus_get_devinfo, ofwbus_get_devinfo), - DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), - DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), - DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), - DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), - DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), DEVMETHOD_END }; -static driver_t ofwbus_driver = { - "ofwbus", - ofwbus_methods, - sizeof(struct ofwbus_softc) -}; +DEFINE_CLASS_1(ofwbus, ofwbus_driver, ofwbus_methods, + sizeof(struct ofwbus_softc), simplebus_driver); static devclass_t ofwbus_devclass; EARLY_DRIVER_MODULE(ofwbus, nexus, ofwbus_driver, ofwbus_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(ofwbus, 1); -static const char *const ofwbus_excl_name[] = { - "FJSV,system", - "aliases", - "associations", - "chosen", - "cmp", - "counter-timer", /* No separate device; handled by psycho/sbus */ - "failsafe", - "memory", - "openprom", - "options", - "packages", - "physical-memory", - "rsc", - "sgcn", - "todsg", - "virtual-memory", - NULL -}; - -static const char *const ofwbus_excl_type[] = { - "core", - "cpu", - NULL -}; - -static int -ofwbus_inlist(const char *name, const char *const *list) -{ - int i; - - if (name == NULL) - return (0); - for (i = 0; list[i] != NULL; i++) - if (strcmp(name, list[i]) == 0) - return (1); - return (0); -} - -#define OFWBUS_EXCLUDED(name, type) \ - (ofwbus_inlist((name), ofwbus_excl_name) || \ - ((type) != NULL && ofwbus_inlist((type), ofwbus_excl_type))) - static void ofwbus_identify(driver_t *driver, device_t parent) { @@ -190,7 +104,7 @@ ofwbus_identify(driver_t *driver, device /* Check if Open Firmware has been instantiated */ if (OF_peer(0) == 0) return; - + if (device_find_child(parent, "ofwbus", -1) == NULL) BUS_ADD_CHILD(parent, 0, "ofwbus", -1); } @@ -206,10 +120,9 @@ ofwbus_probe(device_t dev) static int ofwbus_attach(device_t dev) { - struct ofwbus_devinfo *ndi; struct ofwbus_softc *sc; - device_t cdev; phandle_t node; + struct ofw_bus_devinfo obd; sc = device_get_softc(dev); @@ -221,6 +134,11 @@ ofwbus_attach(device_t dev) if (node == -1) return (ENXIO); + /* + * ofwbus bus starts on unamed node in FDT, so we cannot make + * ofw_bus_devinfo from it. Pass node to simplebus_init directly. + */ + simplebus_init(dev, node); sc->sc_intr_rman.rm_type = RMAN_ARRAY; sc->sc_intr_rman.rm_descr = "Interrupts"; sc->sc_mem_rman.rm_type = RMAN_ARRAY; @@ -237,78 +155,16 @@ ofwbus_attach(device_t dev) bus_generic_probe(dev); /* - * Some important numbers - */ - sc->acells = 2; - OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); - sc->scells = 1; - OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); - - /* * Now walk the OFW tree and attach top-level devices. */ for (node = OF_child(node); node > 0; node = OF_peer(node)) { - if ((ndi = ofwbus_setup_dinfo(dev, node)) == NULL) + if (ofw_bus_gen_setup_devinfo(&obd, node) != 0) continue; - cdev = device_add_child(dev, NULL, -1); - if (cdev == NULL) { - device_printf(dev, "<%s>: device_add_child failed\n", - ndi->ndi_obdinfo.obd_name); - ofwbus_destroy_dinfo(ndi); - continue; - } - device_set_ivars(cdev, ndi); + simplebus_add_device(dev, node, 0, NULL, -1, NULL); } return (bus_generic_attach(dev)); } -static device_t -ofwbus_add_child(device_t dev, u_int order, const char *name, int unit) -{ - device_t cdev; - struct ofwbus_devinfo *ndi; - - cdev = device_add_child_ordered(dev, order, name, unit); - if (cdev == NULL) - return (NULL); - - ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); - ndi->ndi_obdinfo.obd_node = -1; - resource_list_init(&ndi->ndi_rl); - device_set_ivars(cdev, ndi); - - return (cdev); -} - -static int -ofwbus_print_child(device_t bus, device_t child) -{ - int rv; - - rv = bus_print_child_header(bus, child); - rv += ofwbus_print_res(device_get_ivars(child)); - rv += bus_print_child_footer(bus, child); - return (rv); -} - -static void -ofwbus_probe_nomatch(device_t bus, device_t child) -{ - const char *name, *type; - - if (!bootverbose) - return; - - name = ofw_bus_get_name(child); - type = ofw_bus_get_type(child); - - device_printf(bus, "<%s>", - name != NULL ? name : "unknown"); - ofwbus_print_res(device_get_ivars(child)); - printf(" type %s (no driver attached)\n", - type != NULL ? type : "unknown"); -} - static struct resource * ofwbus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -323,14 +179,15 @@ ofwbus_alloc_resource(device_t bus, devi passthrough = (device_get_parent(child) != bus); sc = device_get_softc(bus); rle = NULL; - if (!passthrough && isdefault) { rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), type, *rid); - if (rle == NULL) + if (rle == NULL) { + if (bootverbose) + device_printf(bus, "no default resources for " + "rid = %d, type = %d\n", *rid, type); return (NULL); - if (rle->res != NULL) - panic("%s: resource entry is busy", __func__); + } start = rle->start; count = ulmax(count, rle->count); end = ulmax(rle->end, start + count - 1); @@ -417,72 +274,3 @@ ofwbus_release_resource(device_t bus, de } return (rman_release_resource(r)); } - -static struct resource_list * -ofwbus_get_resource_list(device_t bus __unused, device_t child) -{ - struct ofwbus_devinfo *ndi; - - ndi = device_get_ivars(child); - return (&ndi->ndi_rl); -} - -static const struct ofw_bus_devinfo * -ofwbus_get_devinfo(device_t bus __unused, device_t child) -{ - struct ofwbus_devinfo *ndi; - - ndi = device_get_ivars(child); - return (&ndi->ndi_obdinfo); -} - -static struct ofwbus_devinfo * -ofwbus_setup_dinfo(device_t dev, phandle_t node) -{ - struct ofwbus_softc *sc; - struct ofwbus_devinfo *ndi; - const char *nodename; - - sc = device_get_softc(dev); - - ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); - if (ofw_bus_gen_setup_devinfo(&ndi->ndi_obdinfo, node) != 0) { - free(ndi, M_DEVBUF); - return (NULL); - } - nodename = ndi->ndi_obdinfo.obd_name; - if (OFWBUS_EXCLUDED(nodename, ndi->ndi_obdinfo.obd_type)) { - ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); - free(ndi, M_DEVBUF); - return (NULL); - } - - resource_list_init(&ndi->ndi_rl); - ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &ndi->ndi_rl); - ofw_bus_intr_to_rl(dev, node, &ndi->ndi_rl); - - return (ndi); -} - -static void -ofwbus_destroy_dinfo(struct ofwbus_devinfo *ndi) -{ - - resource_list_free(&ndi->ndi_rl); - ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); - free(ndi, M_DEVBUF); -} - -static int -ofwbus_print_res(struct ofwbus_devinfo *ndi) -{ - int rv; - - rv = 0; - rv += resource_list_print_type(&ndi->ndi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); - rv += resource_list_print_type(&ndi->ndi_rl, "irq", SYS_RES_IRQ, - "%ld"); - return (rv); -} - From owner-svn-src-head@FreeBSD.ORG Fri Mar 27 23:11:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F2E0E90; Fri, 27 Mar 2015 23:11:25 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72759651; Fri, 27 Mar 2015 23:11:24 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NLW00LHY8EOR640@st11p02mm-asmtp002.mac.com>; Fri, 27 Mar 2015 23:11:16 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-03-27_08:2015-03-27,2015-03-27,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1503270226 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r280728 - head/sys/conf From: Rui Paulo In-reply-to: Date: Fri, 27 Mar 2015 16:11:12 -0700 Content-transfer-encoding: quoted-printable Message-id: References: <201503270235.t2R2ZQeA047220@svn.freebsd.org> <2AF9E0A0-3B9B-4AF0-89B9-FEBA7FEFCA8B@me.com> To: Warner Losh X-Mailer: Apple Mail (2.2070.6) 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:11:25 -0000 On Mar 26, 2015, at 21:44, Warner Losh wrote: > Yea, the ships passed in the night. I=E2=80=99ve had these changes in = my tree for a while. >=20 > However, It kinda can be overridden by compiling the modules directly. = Since > the actual module=E2=80=99s Makefiles don=E2=80=99t depend on this, I = think we=E2=80=99re OK. Can you test > building a kernel on the BBB you have and let me know if it produces = working ZFS? As long as this change works with MODULES_OVERRIDE, I'm fine with it. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 01:11:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBBBC281; Sat, 28 Mar 2015 01: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 9CBFA30E; Sat, 28 Mar 2015 01:11:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2S1BK4s092515; Sat, 28 Mar 2015 01:11:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2S1BJFu092507; Sat, 28 Mar 2015 01:11:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201503280111.t2S1BJFu092507@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 28 Mar 2015 01:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280773 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 01:11:20 -0000 Author: markj Date: Sat Mar 28 01:11:18 2015 New Revision: 280773 URL: https://svnweb.freebsd.org/changeset/base/280773 Log: tcp provider tests: sleep for a bit after closing the socket so that libdtrace has a chance to capture the traced data. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh Fri Mar 27 23:10:15 2015 (r280772) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh Sat Mar 28 01:11:18 2015 (r280773) @@ -73,6 +73,7 @@ cat > test.pl <<-EOPERL Timeout => 3); die "Could not connect to host $local port $tcpport" unless \$s; close \$s; + sleep(2); EOPERL $dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin < test.pl <<-EOPERL Timeout => 3); die "Could not connect to host $dest port $tcpport" unless \$s; close \$s; + sleep(2); EOPERL $dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin < test.pl <<-EOPERL die "Could not connect to host $local port $tcpport" unless \$s; print \$s "testing state machine transitions"; close \$s; + sleep(2); EOPERL $dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin < test.pl <<-EOPERL die "Could not connect to host $dest port $tcpport" unless \$s; print \$s "testing state machine transitions"; close \$s; + sleep(2); EOPERL $dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin < Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AAFAC66; Sat, 28 Mar 2015 02:36: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 0C431C65; Sat, 28 Mar 2015 02:36:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2S2aoPl032744; Sat, 28 Mar 2015 02:36:50 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2S2aoeI032743; Sat, 28 Mar 2015 02:36:50 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201503280236.t2S2aoeI032743@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sat, 28 Mar 2015 02:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280774 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:36:51 -0000 Author: jeff Date: Sat Mar 28 02:36:49 2015 New Revision: 280774 URL: https://svnweb.freebsd.org/changeset/base/280774 Log: - Eliminate pagequeue locking in the dirty code in vm_pageout_scan(). - Use a more precise series of tests to see if the page changed while we were locking the vnode. Reviewed by: alc Sponsored by: EMC / Isilon Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sat Mar 28 01:11:18 2015 (r280773) +++ head/sys/vm/vm_pageout.c Sat Mar 28 02:36:49 2015 (r280774) @@ -1157,6 +1157,7 @@ vm_pageout_scan(struct vm_domain *vmd, i int swap_pageouts_ok; struct vnode *vp = NULL; struct mount *mp = NULL; + vm_pindex_t pindex; if ((object->type != OBJT_SWAP) && (object->type != OBJT_DEFAULT)) { swap_pageouts_ok = 1; @@ -1217,6 +1218,7 @@ vm_pageout_scan(struct vm_domain *vmd, i KASSERT(mp != NULL, ("vp %p with NULL v_mount", vp)); vm_object_reference_locked(object); + pindex = m->pindex; VM_OBJECT_WUNLOCK(object); lockmode = MNT_SHARED_WRITES(vp->v_mount) ? LK_SHARED : LK_EXCLUSIVE; @@ -1231,17 +1233,18 @@ vm_pageout_scan(struct vm_domain *vmd, i } VM_OBJECT_WLOCK(object); vm_page_lock(m); - vm_pagequeue_lock(pq); - queues_locked = TRUE; /* - * The page might have been moved to another - * queue during potential blocking in vget() - * above. The page might have been freed and - * reused for another vnode. + * While the object and page were unlocked, + * the page may have been + * (1) moved to a different queue, + * (2) reallocated to a different object, + * (3) reallocated to a different offset, or + * (4) cleaned. */ if (m->queue != PQ_INACTIVE || m->object != object || - TAILQ_NEXT(m, plinks.q) != &vmd->vmd_marker) { + m->pindex != pindex || + m->dirty == 0) { vm_page_unlock(m); if (object->flags & OBJ_MIGHTBEDIRTY) vnodes_skipped++; @@ -1271,8 +1274,6 @@ vm_pageout_scan(struct vm_domain *vmd, i vnodes_skipped++; goto unlock_and_continue; } - vm_pagequeue_unlock(pq); - queues_locked = FALSE; } /* @@ -1293,10 +1294,6 @@ unlock_and_continue: vm_page_lock_assert(m, MA_NOTOWNED); VM_OBJECT_WUNLOCK(object); if (mp != NULL) { - if (queues_locked) { - vm_pagequeue_unlock(pq); - queues_locked = FALSE; - } if (vp != NULL) vput(vp); vm_object_deallocate(object); From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 02:41:47 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FA46DFE; Sat, 28 Mar 2015 02:41:47 +0000 (UTC) Received: from gw.catspoiler.org (cl-1657.chi-02.us.sixxs.net [IPv6:2001:4978:f:678::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 0628BD2F; Sat, 28 Mar 2015 02:41:46 +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 t2S2fWcQ078499; Fri, 27 Mar 2015 18:41:36 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201503280241.t2S2fWcQ078499@gw.catspoiler.org> Date: Fri, 27 Mar 2015 19:41:32 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r280327 - in head/sys: kern vm To: alc@FreeBSD.org In-Reply-To: <201503211756.t2LHuumt035234@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, clusteradm@FreeBSD.org, portmgr@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 02:41:47 -0000 On 21 Mar, Alan Cox wrote: > Author: alc > Date: Sat Mar 21 17:56:55 2015 > New Revision: 280327 > URL: https://svnweb.freebsd.org/changeset/base/280327 > > Log: > Introduce vm_object_color() and use it in mmap(2) to set the color of > named objects to zero before the virtual address is selected. Previously, > the color setting was delayed until after the virtual address was > selected. In rtld, this delay effectively prevented the mapping of a > shared library's code section using superpages. Now, for example, we see > the first 1 MB of libc's code on armv6 mapped by a superpage after we've > gotten through the initial cold misses that bring the first 1 MB of code > into memory. (With the page clustering that we perform on read faults, > this happens quickly.) > > Differential Revision: https://reviews.freebsd.org/D2013 > Reviewed by: jhb, kib > Tested by: Svatopluk Kraus (armv6) > MFC after: 6 weeks > > Modified: > head/sys/kern/kern_exec.c > head/sys/vm/vm_fault.c > head/sys/vm/vm_mmap.c > head/sys/vm/vm_object.h > head/sys/vm/vnode_pager.c This change appears to have partially broken package building. I recently set up a package building machine running 11.0-CURRENT r280642 and found that it was unable to build openjdk7 packages inside FreeBSD 8.4 and 9.3 poudriere jails, for both i386 and amd64. [snip] Compiling ../generated/adfiles/ad_x86_64_gen.cpp rm -f ad_x86_64_gen.o c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"24.76-b04\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"root\"" -DHOTSPOT_LIB_ARCH=\"amd64\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -O2 -pipe -fstack-protector -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno! -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-omit-frame-pointer -DINCLUDE_TRACE=1 -Wpointer-arith -Wconversion -Wsign-compare -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_format.o.d -o ad_x86_64_format.o ../generated/adfiles/ad_x86_64_format.cpp c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"24.76-b04\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"root\"" -DHOTSPOT_LIB_ARCH=\"amd64\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -O2 -pipe -fstack-protector -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno! -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-omit-frame-pointer -DINCLUDE_TRACE=1 -Wpointer-arith -Wconversion -Wsign-compare -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_gen.o.d -o ad_x86_64_gen.o ../generated/adfiles/ad_x86_64_gen.cpp Compiling ../generated/adfiles/ad_x86_64_misc.cpp rm -f ad_x86_64_misc.o c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"24.76-b04\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"root\"" -DHOTSPOT_LIB_ARCH=\"amd64\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -O2 -pipe -fstack-protector -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno! -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-omit-frame-pointer -DINCLUDE_TRACE=1 -Wpointer-arith -Wconversion -Wsign-compare -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_misc.o.d -o ad_x86_64_misc.o ../generated/adfiles/ad_x86_64_misc.cpp /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/compiler/abstractCompiler.cpp:1: fatal error: had to relocate PCH compilation terminated. /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/utilities/accessFlags.cpp:1: fatal error: had to relocate PCH compilation terminated. /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'abstractCompiler.o' failed gmake[6]: *** [abstractCompiler.o] Error 1 gmake[6]: *** Waiting for unfinished jobs.... ../generated/adfiles/ad_x86_64.cpp:1: fatal error: had to relocate PCH compilation terminated. ../generated/adfiles/ad_x86_64_clone.cpp:1: fatal error: had to relocate PCH compilation terminated. /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'accessFlags.o' failed gmake[6]: *** [accessFlags.o] Error 1 /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'ad_x86_64_clone.o' failed gmake[6]: *** [ad_x86_64_clone.o] Error 1 /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'ad_x86_64.o' failed gmake[6]: *** [ad_x86_64.o] Error 1 ../generated/adfiles/ad_x86_64_expand.cpp:1: fatal error: had to relocate PCH compilation terminated. /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'ad_x86_64_expand.o' failed gmake[6]: *** [ad_x86_64_expand.o] Error 1 ../generated/adfiles/ad_x86_64_gen.cpp:1: fatal error: had to relocate PCH compilation terminated. ../generated/adfiles/ad_x86_64_misc.cpp:1: fatal error: had to relocate PCH compilation terminated. /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'ad_x86_64_gen.o' failed gmake[6]: *** [ad_x86_64_gen.o] Error 1 /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'ad_x86_64_misc.o' failed gmake[6]: *** [ad_x86_64_misc.o] Error 1 ../generated/adfiles/ad_x86_64_format.cpp:1: fatal error: had to relocate PCH compilation terminated. /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'ad_x86_64_format.o' failed gmake[6]: *** [ad_x86_64_format.o] Error 1 gmake[6]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/openjdk/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product' /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/top.make:128: recipe for target 'the_vm' failed gmake[5]: *** [the_vm] Error 2 gmake[5]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/openjdk/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product' /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/Makefile:292: recipe for target 'product' failed gmake[4]: *** [product] Error 2 gmake[4]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/openjdk/build/bsd-amd64/hotspot/outputdir' Makefile:191: recipe for target 'generic_build2' failed gmake[3]: *** [generic_build2] Error 2 gmake[3]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make' Makefile:151: recipe for target 'product' failed gmake[2]: *** [product] Error 2 gmake[2]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make' make/hotspot-rules.gmk:111: recipe for target 'hotspot-build' failed gmake[1]: *** [hotspot-build] Error 2 gmake[1]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/openjdk' Makefile:251: recipe for target 'build_product_image' failed gmake: *** [build_product_image] Error 2 ===> Compilation failed unexpectedly. I was not seeing this problem on my older package builder running 10.1-STABLE. Since this problem has not shown up on the FreeBSD package building cluster, I got suspicious that the change was quite recent. This old gcc bug report: led me to suspect mmap(). The old gcc source file /usr/src/contrib/gcc/ggc-common.c does a couple of mmap() calls. Tne first is in mmap_gt_pch_get_address() where a NULL first argument is used. The address that gets returned is stashed away and the region is unmapped. Then a later call in mmap_gt_pch_use_address() passes this saved address to mmap() as a hint. It expects the mapped region to get mapped to the same base address. If this does not happen, the above error is the result. If I go back to kernel source r280326, which immediately preceeds the above commit, I am able to successfully build openjdk7. I recommend that any machines in the ports cluster being used to build packages for FreeBSD 8 and 9 avoid upgrading past r280326 until this issue is resolved. I have not observed any problems building packages for FreeBSD 10 and 11. From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 02:55:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 422152A5; Sat, 28 Mar 2015 02: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 13A4BE3B; Sat, 28 Mar 2015 02:55:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2S2tHJB041553; Sat, 28 Mar 2015 02:55:17 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2S2tHcL041552; Sat, 28 Mar 2015 02:55:17 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201503280255.t2S2tHcL041552@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 28 Mar 2015 02:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280775 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 02:55:18 -0000 Author: neel Date: Sat Mar 28 02:55:16 2015 New Revision: 280775 URL: https://svnweb.freebsd.org/changeset/base/280775 Log: Fix the RTC device model to operate correctly in 12-hour mode. The following table documents the values in the RTC 'hour' field in the two modes: Hour-of-the-day 12-hour mode 24-hour mode 12 AM 12 0 [1-11] AM [1-11] [1-11] 12 PM 0x80 | 12 12 [1-11] PM 0x80 | [1-11] [13-23] Reported by: Julian Hsiao (madoka@nyanisore.net) MFC after: 1 week Modified: head/sys/amd64/vmm/io/vrtc.c Modified: head/sys/amd64/vmm/io/vrtc.c ============================================================================== --- head/sys/amd64/vmm/io/vrtc.c Sat Mar 28 02:36:49 2015 (r280774) +++ head/sys/amd64/vmm/io/vrtc.c Sat Mar 28 02:55:16 2015 (r280775) @@ -214,9 +214,27 @@ secs_to_rtc(time_t rtctime, struct vrtc rtc->sec = rtcset(rtc, ct.sec); rtc->min = rtcset(rtc, ct.min); - hour = ct.hour; - if ((rtc->reg_b & RTCSB_24HR) == 0) - hour = (hour % 12) + 1; /* convert to a 12-hour format */ + if (rtc->reg_b & RTCSB_24HR) { + hour = ct.hour; + } else { + /* + * Convert to the 12-hour format. + */ + switch (ct.hour) { + case 0: /* 12 AM */ + case 12: /* 12 PM */ + hour = 12; + break; + default: + /* + * The remaining 'ct.hour' values are interpreted as: + * [1 - 11] -> 1 - 11 AM + * [13 - 23] -> 1 - 11 PM + */ + hour = ct.hour % 12; + break; + } + } rtc->hour = rtcset(rtc, hour); @@ -287,9 +305,26 @@ rtc_to_secs(struct vrtc *vrtc) } error = rtcget(rtc, hour, &ct.hour); if ((rtc->reg_b & RTCSB_24HR) == 0) { - ct.hour -= 1; - if (pm) - ct.hour += 12; + if (ct.hour >= 1 && ct.hour <= 12) { + /* + * Convert from 12-hour format to internal 24-hour + * representation as follows: + * + * 12-hour format ct.hour + * 12 AM 0 + * 1 - 11 AM 1 - 11 + * 12 PM 12 + * 1 - 11 PM 13 - 23 + */ + if (ct.hour == 12) + ct.hour = 0; + if (pm) + ct.hour += 12; + } else { + VM_CTR2(vm, "Invalid RTC 12-hour format %#x/%d", + rtc->hour, ct.hour); + goto fail; + } } if (error || ct.hour < 0 || ct.hour > 23) { From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 06:54:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A66A5FA7; Sat, 28 Mar 2015 06: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 9164F8AA; Sat, 28 Mar 2015 06:54:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2S6sJn5053626; Sat, 28 Mar 2015 06:54:19 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2S6sJSK053625; Sat, 28 Mar 2015 06:54:19 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503280654.t2S6sJSK053625@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 28 Mar 2015 06:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280779 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 06:54:19 -0000 Author: adrian Date: Sat Mar 28 06:54:18 2015 New Revision: 280779 URL: https://svnweb.freebsd.org/changeset/base/280779 Log: Set VM_KMEM_SIZE_SCALE=1 for the AR91xx SoCs. Without this the autotuning fails for small amounts of RAM (32mb), which all the AR91xx shipping products seemed to have. Thanks to gjb for reminding me to re-test this stuff. Tested: * AR91xx, TP-Link TL-WR1043nd v1 Modified: head/sys/mips/conf/AR91XX_BASE Modified: head/sys/mips/conf/AR91XX_BASE ============================================================================== --- head/sys/mips/conf/AR91XX_BASE Sat Mar 28 05:16:52 2015 (r280778) +++ head/sys/mips/conf/AR91XX_BASE Sat Mar 28 06:54:18 2015 (r280779) @@ -26,6 +26,9 @@ options DDB options KDB options ALQ +# For small memory footprints +options VM_KMEM_SIZE_SCALE=1 + options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #InterNETworking From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 08:34:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3B80E10; Sat, 28 Mar 2015 08:34:54 +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 B4C893CC; Sat, 28 Mar 2015 08:34:53 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2S8YhoE029617 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 28 Mar 2015 11:34:43 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2S8YhdQ029616; Sat, 28 Mar 2015 11:34:43 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 28 Mar 2015 11:34:43 +0300 From: Gleb Smirnoff To: Fabien Thomas Subject: Re: svn commit: r280759 - head/sys/netinet Message-ID: <20150328083443.GV64665@FreeBSD.org> References: <201503271326.t2RDQxd3056112@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503271326.t2RDQxd3056112@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-1 Precedence: list List-Id: SVN 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 Mar 2015 08:34:54 -0000 On Fri, Mar 27, 2015 at 01:26:59PM +0000, Fabien Thomas wrote: F> Author: fabient F> Date: Fri Mar 27 13:26:59 2015 F> New Revision: 280759 F> URL: https://svnweb.freebsd.org/changeset/base/280759 F> F> Log: F> On multi CPU systems, we may emit successive packets with the same id. F> Fix the race by using an atomic operation. F> F> Differential Revision: https://reviews.freebsd.org/D2141 F> Obtained from: emeric.poupon@stormshield.eu F> MFC after: 1 week F> Sponsored by: Stormshield The D2141 says that benchmarking were done in presence of IPSEC, which of course is the bottleneck and performance of this instruction can't be benchmarked in its presence. Anyway, I believe that results of right benchmark would still show little difference between atomic and non-atomic increment of a shared value. I think we can use per-cpu ID counters, each CPU incrementing its own. If we start with random values, then probability of two packets with the same ID emitting at the allowed timeframe will be acceptably small. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 08:55:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C87DB154; Sat, 28 Mar 2015 08:55:14 +0000 (UTC) Received: from vlakno.cz (mail.vlakno.cz [91.217.96.224]) by mx1.freebsd.org (Postfix) with ESMTP id 8D2DD78B; Sat, 28 Mar 2015 08:55:13 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 67F8D1D95AB9; Sat, 28 Mar 2015 09:54:25 +0100 (CET) Date: Sat, 28 Mar 2015 09:54:25 +0100 From: Roman Divacky To: Xin LI Subject: Re: svn commit: r280767 - head/sbin/md5 Message-ID: <20150328085425.GA99099@vlakno.cz> References: <201503271823.t2RIN7sX000292@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503271823.t2RIN7sX000292@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-1 Precedence: list List-Id: SVN 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 Mar 2015 08:55:14 -0000 > Modified: head/sbin/md5/md5.c > ============================================================================== > --- head/sbin/md5/md5.c Fri Mar 27 17:36:22 2015 (r280766) > +++ head/sbin/md5/md5.c Fri Mar 27 18:23:06 2015 (r280767) > @@ -91,7 +91,7 @@ typedef union { > > /* algorithm function table */ > > -struct Algorithm_t Algorithm[] = { > +static struct Algorithm_t Algorithm[] = { > { "md5", "MD5", &MD5TestOutput, (DIGEST_Init*)&MD5Init, > (DIGEST_Update*)&MD5_Update, (DIGEST_End*)&MD5End, > &MD5Data, &MD5File }, > @@ -282,7 +282,7 @@ MDTimeTrial(Algorithm_t *alg) > * Digests a reference suite of strings and prints the results. > */ Can this be static const? From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 09:02:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DC6D46E; Sat, 28 Mar 2015 09:02: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 ED706864; Sat, 28 Mar 2015 09:02:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2S92KHw013243; Sat, 28 Mar 2015 09:02:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2S92K0p013242; Sat, 28 Mar 2015 09:02:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503280902.t2S92K0p013242@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 28 Mar 2015 09:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280780 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 09:02:21 -0000 Author: kib Date: Sat Mar 28 09:02:19 2015 New Revision: 280780 URL: https://svnweb.freebsd.org/changeset/base/280780 Log: The #ss fault handler erronously does not check for the fault originated from the return to usermode. #ss must be handled same as #np. Reported by: Andrew Lutomirski through secteam Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sat Mar 28 06:54:18 2015 (r280779) +++ head/sys/amd64/amd64/trap.c Sat Mar 28 09:02:19 2015 (r280780) @@ -443,8 +443,6 @@ trap(struct trapframe *frame) goto out; case T_STKFLT: /* stack fault */ - break; - case T_PROTFLT: /* general protection fault */ case T_SEGNPFLT: /* segment not present fault */ if (td->td_intr_nesting_level != 0) From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 09:03:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F0F25DF; Sat, 28 Mar 2015 09:03: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 6AEE5872; Sat, 28 Mar 2015 09:03:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2S93t7b013453; Sat, 28 Mar 2015 09:03:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2S93tgH013452; Sat, 28 Mar 2015 09:03:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503280903.t2S93tgH013452@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 28 Mar 2015 09:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280781 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 09:03:55 -0000 Author: kib Date: Sat Mar 28 09:03:54 2015 New Revision: 280781 URL: https://svnweb.freebsd.org/changeset/base/280781 Log: Make it possible for the signal handler to act on #ss. Load the canonical user data segment' selector into %ss when calling the handler. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Mar 28 09:02:19 2015 (r280780) +++ head/sys/amd64/amd64/machdep.c Sat Mar 28 09:03:54 2015 (r280781) @@ -443,6 +443,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; + regs->tf_ss = _udatasel; regs->tf_es = _udatasel; regs->tf_fs = _ufssel; regs->tf_gs = _ugssel; From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 09:08:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 373CB74E; Sat, 28 Mar 2015 09: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 22818895; Sat, 28 Mar 2015 09:08:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2S98wcc014073; Sat, 28 Mar 2015 09:08:58 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2S98voR014072; Sat, 28 Mar 2015 09:08:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503280908.t2S98voR014072@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 28 Mar 2015 09:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280782 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 09:08:58 -0000 Author: tuexen Date: Sat Mar 28 09:08:57 2015 New Revision: 280782 URL: https://svnweb.freebsd.org/changeset/base/280782 Log: Add an SCTP symbol which was missed in https://svnweb.freebsd.org/base?view=revision&revision=169622 This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197783 Thanks to Jukka Ukkonen for reporting the bug and providing a fix. MFC after: 3 days Modified: head/lib/libc/net/Symbol.map Modified: head/lib/libc/net/Symbol.map ============================================================================== --- head/lib/libc/net/Symbol.map Sat Mar 28 09:03:54 2015 (r280781) +++ head/lib/libc/net/Symbol.map Sat Mar 28 09:08:57 2015 (r280782) @@ -124,6 +124,7 @@ FBSD_1.0 { in6addr_nodelocal_allnodes; in6addr_linklocal_allnodes; sctp_getaddrlen; + sctp_getassocid; sctp_bindx; sctp_connectx; sctp_peeloff; From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 09:13:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5873F901; Sat, 28 Mar 2015 09:13:43 +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 D7610942; Sat, 28 Mar 2015 09:13:42 +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 t2S9Dbsg029481 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 28 Mar 2015 11:13:37 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2S9Dbsg029481 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2S9Dau3029480; Sat, 28 Mar 2015 11:13:37 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 Mar 2015 11:13:36 +0200 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r280780 - head/sys/amd64/amd64 Message-ID: <20150328091336.GT2379@kib.kiev.ua> References: <201503280902.t2S92K0p013242@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503280902.t2S92K0p013242@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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 09:13:43 -0000 On Sat, Mar 28, 2015 at 09:02:20AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Sat Mar 28 09:02:19 2015 > New Revision: 280780 > URL: https://svnweb.freebsd.org/changeset/base/280780 > > Log: > The #ss fault handler erronously does not check for the fault > originated from the return to usermode. #ss must be handled same as > #np. Note that this is an omission in r275833. I fixed the wrong gs base for #ss and #np, but failed to note the lack of required check for iretd faulting on the way to usermode for #ss. So this is not a 'security' issue, only the local DoS: kernel excessively panics instead of delivering trap to userspace. From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 10:20:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1A53627; Sat, 28 Mar 2015 10:20: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 7308FE94; Sat, 28 Mar 2015 10:20:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SAKLEA047878; Sat, 28 Mar 2015 10:20:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SAKKfg047876; Sat, 28 Mar 2015 10:20:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503281020.t2SAKKfg047876@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 28 Mar 2015 10:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280783 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 10:20:21 -0000 Author: arybchik Date: Sat Mar 28 10:20:20 2015 New Revision: 280783 URL: https://svnweb.freebsd.org/changeset/base/280783 Log: sfxge: set correct RSS hash type instead of opaque Reviewed by: adrian, gnn Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D2124 Modified: head/sys/dev/sfxge/sfxge_rx.c head/sys/dev/sfxge/sfxge_version.h Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Sat Mar 28 09:08:57 2015 (r280782) +++ head/sys/dev/sfxge/sfxge_rx.c Sat Mar 28 10:20:20 2015 (r280783) @@ -330,11 +330,16 @@ sfxge_rx_deliver(struct sfxge_softc *sc, if (rx_desc->flags & EFX_CKSUM_TCPUDP) csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; - /* The hash covers a 4-tuple for TCP only */ - if (rx_desc->flags & EFX_PKT_TCP) { + if (rx_desc->flags & (EFX_PKT_IPV4 | EFX_PKT_IPV6)) { m->m_pkthdr.flowid = EFX_RX_HASH_VALUE(EFX_RX_HASHALG_TOEPLITZ, mtod(m, uint8_t *)); - M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + /* The hash covers a 4-tuple for TCP only */ + M_HASHTYPE_SET(m, + (rx_desc->flags & EFX_PKT_IPV4) ? + ((rx_desc->flags & EFX_PKT_TCP) ? + M_HASHTYPE_RSS_TCP_IPV4 : M_HASHTYPE_RSS_IPV4) : + ((rx_desc->flags & EFX_PKT_TCP) ? + M_HASHTYPE_RSS_TCP_IPV6 : M_HASHTYPE_RSS_IPV6)); } m->m_data += sc->rx_prefix_size; m->m_len = rx_desc->size - sc->rx_prefix_size; @@ -385,7 +390,9 @@ sfxge_lro_deliver(struct sfxge_lro_state } m->m_pkthdr.flowid = c->conn_hash; - M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(m, + SFXGE_LRO_CONN_IS_TCPIPV4(c) ? + M_HASHTYPE_RSS_TCP_IPV4 : M_HASHTYPE_RSS_TCP_IPV6); m->m_pkthdr.csum_flags = csum_flags; __sfxge_rx_deliver(sc, m); Modified: head/sys/dev/sfxge/sfxge_version.h ============================================================================== --- head/sys/dev/sfxge/sfxge_version.h Sat Mar 28 09:08:57 2015 (r280782) +++ head/sys/dev/sfxge/sfxge_version.h Sat Mar 28 10:20:20 2015 (r280783) @@ -32,6 +32,6 @@ #ifndef _SFXGE_VERSION_H #define _SFXGE_VERSION_H -#define SFXGE_VERSION_STRING "v3.3.4.6363" +#define SFXGE_VERSION_STRING "v3.3.4.6365" #endif /* _SFXGE_DRIVER_VERSION_H */ From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 12:23:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96781A82; Sat, 28 Mar 2015 12: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 81568C86; Sat, 28 Mar 2015 12:23:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SCNGjU009391; Sat, 28 Mar 2015 12:23:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SCNGUc009390; Sat, 28 Mar 2015 12:23:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503281223.t2SCNGUc009390@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 28 Mar 2015 12:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280784 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 12:23:16 -0000 Author: dim Date: Sat Mar 28 12:23:15 2015 New Revision: 280784 URL: https://svnweb.freebsd.org/changeset/base/280784 Log: Re-enable using -mllvm -enable-load-pre=false in CLANG_OPT_SMALL for clang versions before 3.5.0. This should enable building head's version of sys/boot/i386/boot2 on 9.x and 10.x again. Reported by: bz Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sat Mar 28 10:20:20 2015 (r280783) +++ head/share/mk/bsd.sys.mk Sat Mar 28 12:23:15 2015 (r280784) @@ -131,6 +131,8 @@ CLANG_OPT_SMALL= -mstack-alignment=8 -ml -mllvm -simplifycfg-dup-ret .if ${COMPILER_VERSION} >= 30500 CLANG_OPT_SMALL+= -mllvm -enable-gvn=false +.else +CLANG_OPT_SMALL+= -mllvm -enable-load-pre=false .endif CFLAGS.clang+= -Qunused-arguments .if ${MACHINE_CPUARCH} == "sparc64" From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 12:50:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C8C5F74; Sat, 28 Mar 2015 12:50: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 85AB9E97; Sat, 28 Mar 2015 12:50:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SCoQrw020307; Sat, 28 Mar 2015 12:50:26 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SCoOkt020297; Sat, 28 Mar 2015 12:50:24 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201503281250.t2SCoOkt020297@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Sat, 28 Mar 2015 12:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280785 - in head/sys: kern netgraph/atm/sscop netgraph/atm/uni 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-1 Precedence: list List-Id: SVN 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 Mar 2015 12:50:26 -0000 Author: rrs Date: Sat Mar 28 12:50:24 2015 New Revision: 280785 URL: https://svnweb.freebsd.org/changeset/base/280785 Log: Change the callout to supply -1 to indicate we are not changing CPU, also add protection against invalid CPU's as well as split c_flags and c_iflags so that if a user plays with the active flag (the one expected to be played with by callers in MPSAFE) without a lock, it won't adversely affect the callout system by causing a corrupt list. This also means that all callers need to use the macros and *not* play with the falgs directly (like netgraph used to). Differential Revision: htts://reviews.freebsd.org/D1894 Reviewed by: .. timed out but looked at by jhb, imp, adrian hselasky tested by hiren and netflix. Sponsored by: Netflix Inc. Modified: head/sys/kern/kern_timeout.c head/sys/netgraph/atm/sscop/ng_sscop_cust.h head/sys/netgraph/atm/uni/ng_uni_cust.h head/sys/sys/_callout.h head/sys/sys/callout.h Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sat Mar 28 12:23:15 2015 (r280784) +++ head/sys/kern/kern_timeout.c Sat Mar 28 12:50:24 2015 (r280785) @@ -163,6 +163,7 @@ struct callout_cpu { sbintime_t cc_lastscan; void *cc_cookie; u_int cc_bucket; + u_int cc_inited; char cc_ktr_event_name[20]; }; @@ -266,6 +267,7 @@ callout_callwheel_init(void *dummy) * XXX: Clip callout to result of previous function of maxusers * maximum 384. This is still huge, but acceptable. */ + memset(cc_cpu, 0, sizeof(cc_cpu)); ncallout = imin(16 + maxproc + maxfiles, 18508); TUNABLE_INT_FETCH("kern.ncallout", &ncallout); @@ -307,6 +309,7 @@ callout_cpu_init(struct callout_cpu *cc, mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE); SLIST_INIT(&cc->cc_callfree); + cc->cc_inited = 1; cc->cc_callwheel = malloc(sizeof(struct callout_list) * callwheelsize, M_CALLOUT, M_WAITOK); for (i = 0; i < callwheelsize; i++) @@ -322,7 +325,7 @@ callout_cpu_init(struct callout_cpu *cc, for (i = 0; i < ncallout; i++) { c = &cc->cc_callout[i]; callout_init(c, 0); - c->c_flags = CALLOUT_LOCAL_ALLOC; + c->c_iflags = CALLOUT_LOCAL_ALLOC; SLIST_INSERT_HEAD(&cc->cc_callfree, c, c_links.sle); } } @@ -477,7 +480,7 @@ callout_process(sbintime_t now) * Consumer told us the callout may be run * directly from hardware interrupt context. */ - if (tmp->c_flags & CALLOUT_DIRECT) { + if (tmp->c_iflags & CALLOUT_DIRECT) { #ifdef CALLOUT_PROFILING ++depth_dir; #endif @@ -497,7 +500,7 @@ callout_process(sbintime_t now) LIST_REMOVE(tmp, c_links.le); TAILQ_INSERT_TAIL(&cc->cc_expireq, tmp, c_links.tqe); - tmp->c_flags |= CALLOUT_PROCESSED; + tmp->c_iflags |= CALLOUT_PROCESSED; tmp = tmpn; } continue; @@ -583,8 +586,9 @@ callout_cc_add(struct callout *c, struct if (sbt < cc->cc_lastscan) sbt = cc->cc_lastscan; c->c_arg = arg; - c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); - c->c_flags &= ~CALLOUT_PROCESSED; + c->c_iflags |= CALLOUT_PENDING; + c->c_iflags &= ~CALLOUT_PROCESSED; + c->c_flags |= CALLOUT_ACTIVE; c->c_func = func; c->c_time = sbt; c->c_precision = precision; @@ -614,7 +618,7 @@ static void callout_cc_del(struct callout *c, struct callout_cpu *cc) { - if ((c->c_flags & CALLOUT_LOCAL_ALLOC) == 0) + if ((c->c_iflags & CALLOUT_LOCAL_ALLOC) == 0) return; c->c_func = NULL; SLIST_INSERT_HEAD(&cc->cc_callfree, c, c_links.sle); @@ -633,7 +637,7 @@ softclock_call_cc(struct callout *c, str struct lock_class *class; struct lock_object *c_lock; uintptr_t lock_status; - int c_flags; + int c_iflags; #ifdef SMP struct callout_cpu *new_cc; void (*new_func)(void *); @@ -648,9 +652,10 @@ softclock_call_cc(struct callout *c, str static timeout_t *lastfunc; #endif - KASSERT((c->c_flags & (CALLOUT_PENDING | CALLOUT_ACTIVE)) == - (CALLOUT_PENDING | CALLOUT_ACTIVE), - ("softclock_call_cc: pend|act %p %x", c, c->c_flags)); + KASSERT((c->c_iflags & CALLOUT_PENDING) == CALLOUT_PENDING, + ("softclock_call_cc: pend %p %x", c, c->c_iflags)); + KASSERT((c->c_flags & CALLOUT_ACTIVE) == CALLOUT_ACTIVE, + ("softclock_call_cc: act %p %x", c, c->c_flags)); class = (c->c_lock != NULL) ? LOCK_CLASS(c->c_lock) : NULL; lock_status = 0; if (c->c_flags & CALLOUT_SHAREDLOCK) { @@ -662,11 +667,11 @@ softclock_call_cc(struct callout *c, str c_lock = c->c_lock; c_func = c->c_func; c_arg = c->c_arg; - c_flags = c->c_flags; - if (c->c_flags & CALLOUT_LOCAL_ALLOC) - c->c_flags = CALLOUT_LOCAL_ALLOC; + c_iflags = c->c_iflags; + if (c->c_iflags & CALLOUT_LOCAL_ALLOC) + c->c_iflags = CALLOUT_LOCAL_ALLOC; else - c->c_flags &= ~CALLOUT_PENDING; + c->c_iflags &= ~CALLOUT_PENDING; cc_exec_curr(cc, direct) = c; cc_exec_cancel(cc, direct) = false; @@ -729,7 +734,7 @@ softclock_call_cc(struct callout *c, str #endif KTR_STATE0(KTR_SCHED, "callout", cc->cc_ktr_event_name, "idle"); CTR1(KTR_CALLOUT, "callout %p finished", c); - if ((c_flags & CALLOUT_RETURNUNLOCKED) == 0) + if ((c_iflags & CALLOUT_RETURNUNLOCKED) == 0) class->lc_unlock(c_lock); skip: CC_LOCK(cc); @@ -749,14 +754,14 @@ skip: * It should be assert here that the callout is not * destroyed but that is not easy. */ - c->c_flags &= ~CALLOUT_DFRMIGRATION; + c->c_iflags &= ~CALLOUT_DFRMIGRATION; } cc_exec_waiting(cc, direct) = false; CC_UNLOCK(cc); wakeup(&cc_exec_waiting(cc, direct)); CC_LOCK(cc); } else if (cc_cce_migrating(cc, direct)) { - KASSERT((c_flags & CALLOUT_LOCAL_ALLOC) == 0, + KASSERT((c_iflags & CALLOUT_LOCAL_ALLOC) == 0, ("Migrating legacy callout %p", c)); #ifdef SMP /* @@ -783,7 +788,7 @@ skip: callout_cc_del(c, cc); return; } - c->c_flags &= ~CALLOUT_DFRMIGRATION; + c->c_iflags &= ~CALLOUT_DFRMIGRATION; new_cc = callout_cpu_switch(c, cc, new_cpu); flags = (direct) ? C_DIRECT_EXEC : 0; @@ -799,14 +804,14 @@ skip: * If the current callout is locally allocated (from * timeout(9)) then put it on the freelist. * - * Note: we need to check the cached copy of c_flags because + * Note: we need to check the cached copy of c_iflags because * if it was not local, then it's not safe to deref the * callout pointer. */ - KASSERT((c_flags & CALLOUT_LOCAL_ALLOC) == 0 || - c->c_flags == CALLOUT_LOCAL_ALLOC, + KASSERT((c_iflags & CALLOUT_LOCAL_ALLOC) == 0 || + c->c_iflags == CALLOUT_LOCAL_ALLOC, ("corrupted callout")); - if (c_flags & CALLOUT_LOCAL_ALLOC) + if (c_iflags & CALLOUT_LOCAL_ALLOC) callout_cc_del(c, cc); } @@ -943,8 +948,16 @@ callout_reset_sbt_on(struct callout *c, sbintime_t to_sbt, pr; struct callout_cpu *cc; int cancelled, direct; + int ignore_cpu=0; cancelled = 0; + if (cpu == -1) { + ignore_cpu = 1; + } else if ((cpu >= MAXCPU) || + (cc_cpu[cpu].cc_inited == 0)) { + /* Invalid CPU spec */ + panic("Invalid CPU in callout %d", cpu); + } if (flags & C_ABSOLUTE) { to_sbt = sbt; } else { @@ -986,24 +999,29 @@ callout_reset_sbt_on(struct callout *c, if (pr > precision) precision = pr; } - /* - * Don't allow migration of pre-allocated callouts lest they - * become unbalanced. - */ - if (c->c_flags & CALLOUT_LOCAL_ALLOC) - cpu = c->c_cpu; /* * This flag used to be added by callout_cc_add, but the * first time you call this we could end up with the * wrong direct flag if we don't do it before we add. */ if (flags & C_DIRECT_EXEC) { - c->c_flags |= CALLOUT_DIRECT; + direct = 1; + } else { + direct = 0; } - direct = (c->c_flags & CALLOUT_DIRECT) != 0; KASSERT(!direct || c->c_lock == NULL, ("%s: direct callout %p has lock", __func__, c)); cc = callout_lock(c); + /* + * Don't allow migration of pre-allocated callouts lest they + * become unbalanced or handle the case where the user does + * not care. + */ + if ((c->c_iflags & CALLOUT_LOCAL_ALLOC) || + ignore_cpu) { + cpu = c->c_cpu; + } + if (cc_exec_curr(cc, direct) == c) { /* * We're being asked to reschedule a callout which is @@ -1043,15 +1061,17 @@ callout_reset_sbt_on(struct callout *c, } #endif } - if (c->c_flags & CALLOUT_PENDING) { - if ((c->c_flags & CALLOUT_PROCESSED) == 0) { + if (c->c_iflags & CALLOUT_PENDING) { + if ((c->c_iflags & CALLOUT_PROCESSED) == 0) { if (cc_exec_next(cc) == c) cc_exec_next(cc) = LIST_NEXT(c, c_links.le); LIST_REMOVE(c, c_links.le); - } else + } else { TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe); + } cancelled = 1; - c->c_flags &= ~(CALLOUT_ACTIVE | CALLOUT_PENDING); + c->c_iflags &= ~ CALLOUT_PENDING; + c->c_flags &= ~ CALLOUT_ACTIVE; } #ifdef SMP @@ -1083,7 +1103,8 @@ callout_reset_sbt_on(struct callout *c, cc_migration_prec(cc, direct) = precision; cc_migration_func(cc, direct) = ftn; cc_migration_arg(cc, direct) = arg; - c->c_flags |= (CALLOUT_DFRMIGRATION | CALLOUT_ACTIVE | CALLOUT_PENDING); + c->c_iflags |= (CALLOUT_DFRMIGRATION | CALLOUT_PENDING); + c->c_flags |= CALLOUT_ACTIVE; CTR6(KTR_CALLOUT, "migration of %p func %p arg %p in %d.%08x to %u deferred", c, c->c_func, c->c_arg, (int)(to_sbt >> 32), @@ -1145,14 +1166,19 @@ _callout_stop_safe(struct callout *c, in } } else use_lock = 0; - direct = (c->c_flags & CALLOUT_DIRECT) != 0; + if (c->c_iflags & CALLOUT_DIRECT) { + direct = 1; + } else { + direct = 0; + } sq_locked = 0; old_cc = NULL; again: cc = callout_lock(c); - if ((c->c_flags & (CALLOUT_DFRMIGRATION | CALLOUT_ACTIVE | CALLOUT_PENDING)) == - (CALLOUT_DFRMIGRATION | CALLOUT_ACTIVE | CALLOUT_PENDING)) { + if ((c->c_iflags & (CALLOUT_DFRMIGRATION | CALLOUT_PENDING)) == + (CALLOUT_DFRMIGRATION | CALLOUT_PENDING) && + ((c->c_flags & CALLOUT_ACTIVE) == CALLOUT_ACTIVE)) { /* * Special case where this slipped in while we * were migrating *as* the callout is about to @@ -1165,7 +1191,8 @@ again: * on one yet). When the callout wheel runs, * it will ignore this callout. */ - c->c_flags &= ~(CALLOUT_PENDING|CALLOUT_ACTIVE); + c->c_iflags &= ~CALLOUT_PENDING; + c->c_flags &= ~CALLOUT_ACTIVE; not_on_a_list = 1; } else { not_on_a_list = 0; @@ -1193,7 +1220,7 @@ again: * don't attempt to remove it from the queue. We can try to * stop it by other means however. */ - if (!(c->c_flags & CALLOUT_PENDING)) { + if (!(c->c_iflags & CALLOUT_PENDING)) { c->c_flags &= ~CALLOUT_ACTIVE; /* @@ -1281,6 +1308,16 @@ again: c, c->c_func, c->c_arg); KASSERT(!cc_cce_migrating(cc, direct), ("callout wrongly scheduled for migration")); + if (callout_migrating(c)) { + c->c_iflags &= ~CALLOUT_DFRMIGRATION; +#ifdef SMP + cc_migration_cpu(cc, direct) = CPUBLOCK; + cc_migration_time(cc, direct) = 0; + cc_migration_prec(cc, direct) = 0; + cc_migration_func(cc, direct) = NULL; + cc_migration_arg(cc, direct) = NULL; +#endif + } CC_UNLOCK(cc); KASSERT(!sq_locked, ("sleepqueue chain locked")); return (1); @@ -1293,7 +1330,7 @@ again: * but we can't stop the one thats running so * we return 0. */ - c->c_flags &= ~CALLOUT_DFRMIGRATION; + c->c_iflags &= ~CALLOUT_DFRMIGRATION; #ifdef SMP /* * We can't call cc_cce_cleanup here since @@ -1322,17 +1359,19 @@ again: if (sq_locked) sleepq_release(&cc_exec_waiting(cc, direct)); - c->c_flags &= ~(CALLOUT_ACTIVE | CALLOUT_PENDING); + c->c_iflags &= ~CALLOUT_PENDING; + c->c_flags &= ~CALLOUT_ACTIVE; CTR3(KTR_CALLOUT, "cancelled %p func %p arg %p", c, c->c_func, c->c_arg); if (not_on_a_list == 0) { - if ((c->c_flags & CALLOUT_PROCESSED) == 0) { + if ((c->c_iflags & CALLOUT_PROCESSED) == 0) { if (cc_exec_next(cc) == c) cc_exec_next(cc) = LIST_NEXT(c, c_links.le); LIST_REMOVE(c, c_links.le); - } else + } else { TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe); + } } callout_cc_del(c, cc); CC_UNLOCK(cc); @@ -1345,10 +1384,10 @@ callout_init(struct callout *c, int mpsa bzero(c, sizeof *c); if (mpsafe) { c->c_lock = NULL; - c->c_flags = CALLOUT_RETURNUNLOCKED; + c->c_iflags = CALLOUT_RETURNUNLOCKED; } else { c->c_lock = &Giant.lock_object; - c->c_flags = 0; + c->c_iflags = 0; } c->c_cpu = timeout_cpu; } @@ -1365,7 +1404,7 @@ _callout_init_lock(struct callout *c, st KASSERT(lock == NULL || !(LOCK_CLASS(lock)->lc_flags & (LC_SPINLOCK | LC_SLEEPABLE)), ("%s: invalid lock class", __func__)); - c->c_flags = flags & (CALLOUT_RETURNUNLOCKED | CALLOUT_SHAREDLOCK); + c->c_iflags = flags & (CALLOUT_RETURNUNLOCKED | CALLOUT_SHAREDLOCK); c->c_cpu = timeout_cpu; } Modified: head/sys/netgraph/atm/sscop/ng_sscop_cust.h ============================================================================== --- head/sys/netgraph/atm/sscop/ng_sscop_cust.h Sat Mar 28 12:23:15 2015 (r280784) +++ head/sys/netgraph/atm/sscop/ng_sscop_cust.h Sat Mar 28 12:50:24 2015 (r280785) @@ -115,7 +115,7 @@ typedef struct callout sscop_timer_t; ng_callout(&(S)->t_##T, (S)->aarg, NULL, \ hz * (S)->timer##T / 1000, T##_func, (S), 0); \ } while (0) -#define TIMER_ISACT(S, T) ((S)->t_##T.c_flags & (CALLOUT_PENDING)) +#define TIMER_ISACT(S, T) (callout_pending(&(S)->t_##T)) /* * This assumes, that the user argument is the node pointer. Modified: head/sys/netgraph/atm/uni/ng_uni_cust.h ============================================================================== --- head/sys/netgraph/atm/uni/ng_uni_cust.h Sat Mar 28 12:23:15 2015 (r280784) +++ head/sys/netgraph/atm/uni/ng_uni_cust.h Sat Mar 28 12:50:24 2015 (r280785) @@ -87,8 +87,8 @@ struct uni_timer { #define _TIMER_STOP(UNI,FIELD) do { \ ng_uncallout(&FIELD.c, (UNI)->arg); \ } while (0) -#define TIMER_ISACT(UNI,T) ((UNI)->T.c.c_flags & (CALLOUT_ACTIVE | \ - CALLOUT_PENDING)) +#define TIMER_ISACT(UNI,T) (callout_active(&(UNI)->T.c) || \ + callout_pending(&(UNI)->T.c)) #define _TIMER_START(UNI,ARG,FIELD,DUE,FUNC) do { \ _TIMER_STOP(UNI, FIELD); \ ng_callout(&FIELD.c, (UNI)->arg, NULL, \ Modified: head/sys/sys/_callout.h ============================================================================== --- head/sys/sys/_callout.h Sat Mar 28 12:23:15 2015 (r280784) +++ head/sys/sys/_callout.h Sat Mar 28 12:50:24 2015 (r280785) @@ -57,7 +57,8 @@ struct callout { void *c_arg; /* function argument */ void (*c_func)(void *); /* function to call */ struct lock_object *c_lock; /* lock to handle */ - int c_flags; /* state of this entry */ + int c_flags; /* User State */ + int c_iflags; /* Internal State */ volatile int c_cpu; /* CPU we're scheduled on */ }; Modified: head/sys/sys/callout.h ============================================================================== --- head/sys/sys/callout.h Sat Mar 28 12:23:15 2015 (r280784) +++ head/sys/sys/callout.h Sat Mar 28 12:50:24 2015 (r280785) @@ -63,8 +63,23 @@ struct callout_handle { }; #ifdef _KERNEL +/* + * Note the flags field is actually *two* fields. The c_flags + * field is the one that caller operations that may, or may not have + * a lock touches i.e. callout_deactivate(). The other, the c_iflags, + * is the internal flags that *must* be kept correct on which the + * callout system depend on i.e. callout_migrating() & callout_pending(), + * these are used internally by the callout system to determine which + * list and other critical internal state. Callers *should not* use the + * c_flags field directly but should use the macros! + * + * If the caller wants to keep the c_flags field sane they + * should init with a mutex *or* if using the older + * mpsafe option, they *must* lock there own lock + * before calling callout_deactivate(). + */ #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) -#define callout_migrating(c) ((c)->c_flags & CALLOUT_DFRMIGRATION) +#define callout_migrating(c) ((c)->c_iflags & CALLOUT_DFRMIGRATION) #define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) #define callout_drain(c) _callout_stop_safe(c, 1) void callout_init(struct callout *, int); @@ -78,11 +93,11 @@ void _callout_init_lock(struct callout * #define callout_init_rw(c, rw, flags) \ _callout_init_lock((c), ((rw) != NULL) ? &(rw)->lock_object : \ NULL, (flags)) -#define callout_pending(c) ((c)->c_flags & CALLOUT_PENDING) +#define callout_pending(c) ((c)->c_iflags & CALLOUT_PENDING) int callout_reset_sbt_on(struct callout *, sbintime_t, sbintime_t, void (*)(void *), void *, int, int); #define callout_reset_sbt(c, sbt, pr, fn, arg, flags) \ - callout_reset_sbt_on((c), (sbt), (pr), (fn), (arg), (c)->c_cpu, (flags)) + callout_reset_sbt_on((c), (sbt), (pr), (fn), (arg), -1, (flags)) #define callout_reset_sbt_curcpu(c, sbt, pr, fn, arg, flags) \ callout_reset_sbt_on((c), (sbt), (pr), (fn), (arg), PCPU_GET(cpuid),\ (flags)) @@ -90,14 +105,14 @@ int callout_reset_sbt_on(struct callout callout_reset_sbt_on((c), tick_sbt * (to_ticks), 0, (fn), (arg), \ (cpu), C_HARDCLOCK) #define callout_reset(c, on_tick, fn, arg) \ - callout_reset_on((c), (on_tick), (fn), (arg), (c)->c_cpu) + callout_reset_on((c), (on_tick), (fn), (arg), -1) #define callout_reset_curcpu(c, on_tick, fn, arg) \ callout_reset_on((c), (on_tick), (fn), (arg), PCPU_GET(cpuid)) #define callout_schedule_sbt_on(c, sbt, pr, cpu, flags) \ callout_reset_sbt_on((c), (sbt), (pr), (c)->c_func, (c)->c_arg, \ (cpu), (flags)) #define callout_schedule_sbt(c, sbt, pr, flags) \ - callout_schedule_sbt_on((c), (sbt), (pr), (c)->c_cpu, (flags)) + callout_schedule_sbt_on((c), (sbt), (pr), -1, (flags)) #define callout_schedule_sbt_curcpu(c, sbt, pr, flags) \ callout_schedule_sbt_on((c), (sbt), (pr), PCPU_GET(cpuid), (flags)) int callout_schedule(struct callout *, int); From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 13:33:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56636647; Sat, 28 Mar 2015 13:33:48 +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 0747C340; Sat, 28 Mar 2015 13:33:47 +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 5508825D3A98; Sat, 28 Mar 2015 13:33:37 +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 6A127C77058; Sat, 28 Mar 2015 13:33:36 +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 DXHnYV_6Q3N4; Sat, 28 Mar 2015 13:33:34 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:b88f:8a06:70f:7ed3] (unknown [IPv6:fde9:577b:c1a9:4410:b88f:8a06:70f:7ed3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id B4880C7700C; Sat, 28 Mar 2015 13:33:32 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r280785 - in head/sys: kern netgraph/atm/sscop netgraph/atm/uni sys From: "Bjoern A. Zeeb" In-Reply-To: <201503281250.t2SCoOkt020297@svn.freebsd.org> Date: Sat, 28 Mar 2015 13:33:00 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <233AB248-B7A0-4A45-AB1B-6807D17C98B6@FreeBSD.org> References: <201503281250.t2SCoOkt020297@svn.freebsd.org> To: Randall Stewart X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-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-1 Precedence: list List-Id: SVN 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 Mar 2015 13:33:48 -0000 > On 28 Mar 2015, at 12:50 , Randall Stewart wrote: >=20 > Author: rrs > Date: Sat Mar 28 12:50:24 2015 > New Revision: 280785 > URL: https://svnweb.freebsd.org/changeset/base/280785 >=20 > Log: > Change the callout to supply -1 to indicate we are not changing > CPU, also add protection against invalid CPU's as well as > split c_flags and c_iflags so that if a user plays with the active > flag (the one expected to be played with by callers in MPSAFE) = without > a lock, it won't adversely affect the callout system by causing a = corrupt > list. This also means that all callers need to use the macros and = *not* > play with the falgs directly (like netgraph used to). >=20 > Differential Revision: htts://reviews.freebsd.org/D1894 > Reviewed by: .. timed out but looked at by jhb, imp, adrian hselasky > tested by hiren and netflix. > Sponsored by: Netflix Inc. >=20 > Modified: > head/sys/kern/kern_timeout.c > head/sys/netgraph/atm/sscop/ng_sscop_cust.h > head/sys/netgraph/atm/uni/ng_uni_cust.h > head/sys/sys/_callout.h > head/sys/sys/callout.h I seem mips kernels starting to fail; might also be gcc kernels; = can=E2=80=99t say yet but you should fix this anyway please: /scratch/tmp/bz/head.svn/sys/kern/kern_timeout.c: In function = 'callout_callwheel_init': /scratch/tmp/bz/head.svn/sys/kern/kern_timeout.c:270: error: = convert_for_assignment: incompatible type for argument 1 of 'memset' /scratch/tmp/bz/head.svn/sys/kern/kern_timeout.c: In function = 'callout_reset_sbt_on': /scratch/tmp/bz/head.svn/sys/kern/kern_timeout.c:957: error: subscripted = value is neither array nor pointer =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 14:27:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A1F2F09; Sat, 28 Mar 2015 14:27:07 +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 196059B1; Sat, 28 Mar 2015 14:27:07 +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 CEDC625D3A9B; Sat, 28 Mar 2015 14:27:03 +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 C7C62C7707C; Sat, 28 Mar 2015 14:27:02 +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 nE4RHmqVU5NL; Sat, 28 Mar 2015 14:27:01 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:b88f:8a06:70f:7ed3] (unknown [IPv6:fde9:577b:c1a9:4410:b88f:8a06:70f:7ed3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id B7079C7700C; Sat, 28 Mar 2015 14:27:00 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r280785 - in head/sys: kern netgraph/atm/sscop netgraph/atm/uni sys From: "Bjoern A. Zeeb" In-Reply-To: <233AB248-B7A0-4A45-AB1B-6807D17C98B6@FreeBSD.org> Date: Sat, 28 Mar 2015 14:26:44 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <8CD30EE9-C338-40E9-ADB6-BE6AB5CE82F4@FreeBSD.org> References: <201503281250.t2SCoOkt020297@svn.freebsd.org> <233AB248-B7A0-4A45-AB1B-6807D17C98B6@FreeBSD.org> To: Randall Stewart X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-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-1 Precedence: list List-Id: SVN 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 Mar 2015 14:27:07 -0000 > On 28 Mar 2015, at 13:33 , Bjoern A. Zeeb wrote: >=20 >=20 >> On 28 Mar 2015, at 12:50 , Randall Stewart wrote: >>=20 >> Author: rrs >> Date: Sat Mar 28 12:50:24 2015 >> New Revision: 280785 >> URL: https://svnweb.freebsd.org/changeset/base/280785 >>=20 >> Log: >> Change the callout to supply -1 to indicate we are not changing >> CPU, also add protection against invalid CPU's as well as >> split c_flags and c_iflags so that if a user plays with the active >> flag (the one expected to be played with by callers in MPSAFE) = without >> a lock, it won't adversely affect the callout system by causing a = corrupt >> list. This also means that all callers need to use the macros and = *not* >> play with the falgs directly (like netgraph used to). >>=20 >> Differential Revision: htts://reviews.freebsd.org/D1894 >> Reviewed by: .. timed out but looked at by jhb, imp, adrian hselasky >> tested by hiren and netflix. >> Sponsored by: Netflix Inc. >>=20 >> Modified: >> head/sys/kern/kern_timeout.c >> head/sys/netgraph/atm/sscop/ng_sscop_cust.h >> head/sys/netgraph/atm/uni/ng_uni_cust.h >> head/sys/sys/_callout.h >> head/sys/sys/callout.h >=20 > I seem mips kernels starting to fail; might also be gcc kernels; = can=E2=80=99t say yet but you should fix this anyway please: >=20 > /scratch/tmp/bz/head.svn/sys/kern/kern_timeout.c: In function = 'callout_callwheel_init': > /scratch/tmp/bz/head.svn/sys/kern/kern_timeout.c:270: error: = convert_for_assignment: incompatible type for argument 1 of 'memset' > /scratch/tmp/bz/head.svn/sys/kern/kern_timeout.c: In function = 'callout_reset_sbt_on': > /scratch/tmp/bz/head.svn/sys/kern/kern_timeout.c:957: error: = subscripted value is neither array nor pointer Ah it=E2=80=99s !SMP it seems which is broken; oh well; looking. =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 15:07:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AF6626F; Sat, 28 Mar 2015 15: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 8603ADA9; Sat, 28 Mar 2015 15:07:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SF7K0f085538; Sat, 28 Mar 2015 15:07:20 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SF7KfH085537; Sat, 28 Mar 2015 15:07:20 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201503281507.t2SF7KfH085537@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 28 Mar 2015 15:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280786 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 15:07:20 -0000 Author: bz Date: Sat Mar 28 15:07:19 2015 New Revision: 280786 URL: https://svnweb.freebsd.org/changeset/base/280786 Log: Try to unbreak !SMP kernels broken in r280785 by using the proper macros to access cc_cpu. Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sat Mar 28 12:50:24 2015 (r280785) +++ head/sys/kern/kern_timeout.c Sat Mar 28 15:07:19 2015 (r280786) @@ -267,7 +267,7 @@ callout_callwheel_init(void *dummy) * XXX: Clip callout to result of previous function of maxusers * maximum 384. This is still huge, but acceptable. */ - memset(cc_cpu, 0, sizeof(cc_cpu)); + memset(CC_CPU(0), 0, sizeof(cc_cpu)); ncallout = imin(16 + maxproc + maxfiles, 18508); TUNABLE_INT_FETCH("kern.ncallout", &ncallout); @@ -954,7 +954,7 @@ callout_reset_sbt_on(struct callout *c, if (cpu == -1) { ignore_cpu = 1; } else if ((cpu >= MAXCPU) || - (cc_cpu[cpu].cc_inited == 0)) { + ((CC_CPU(cpu))->cc_inited == 0)) { /* Invalid CPU spec */ panic("Invalid CPU in callout %d", cpu); } From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 16:06:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6B802F2; Sat, 28 Mar 2015 16: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 D14503F7; Sat, 28 Mar 2015 16:06:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SG6lZO015539; Sat, 28 Mar 2015 16:06:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SG6lNP015538; Sat, 28 Mar 2015 16:06:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201503281606.t2SG6lNP015538@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 28 Mar 2015 16:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280787 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:06:48 -0000 Author: glebius Date: Sat Mar 28 16:06:46 2015 New Revision: 280787 URL: https://svnweb.freebsd.org/changeset/base/280787 Log: Initialize random IP ID engine via SYSINIT() instead of doing that on first packet. This allow to use M_WAITOK and cut down some error handling. Sponsored by: Nginx, Inc. Modified: head/sys/netinet/ip_id.c Modified: head/sys/netinet/ip_id.c ============================================================================== --- head/sys/netinet/ip_id.c Sat Mar 28 15:07:19 2015 (r280786) +++ head/sys/netinet/ip_id.c Sat Mar 28 16:06:46 2015 (r280787) @@ -91,18 +91,17 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_IPID, "ipid", "randomized ip id state"); -static u_int16_t *id_array = NULL; -static bitstr_t *id_bits = NULL; -static int array_ptr = 0; -static int array_size = 8192; -static int random_id_collisions = 0; -static int random_id_total = 0; +static uint16_t *id_array; +static bitstr_t *id_bits; +static int array_ptr; +static int array_size; +static int random_id_collisions; +static int random_id_total; static struct mtx ip_id_mtx; -static void ip_initid(void); +static void ip_initid(int); static int sysctl_ip_id_change(SYSCTL_HANDLER_ARGS); - -MTX_SYSINIT(ip_id_mtx, &ip_id_mtx, "ip_id_mtx", MTX_DEF); +static void ip_sysinitid(void); SYSCTL_DECL(_net_inet_ip); SYSCTL_PROC(_net_inet_ip, OID_AUTO, random_id_period, CTLTYPE_INT|CTLFLAG_RW, @@ -120,73 +119,44 @@ sysctl_ip_id_change(SYSCTL_HANDLER_ARGS) new = array_size; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr) { - if (new >= 512 && new <= 32768) { - mtx_lock(&ip_id_mtx); - array_size = new; - ip_initid(); - mtx_unlock(&ip_id_mtx); - } else + if (new >= 512 && new <= 32768) + ip_initid(new); + else error = EINVAL; } return (error); } -/* - * ip_initid() runs with a mutex held and may execute in a network context. - * As a result, it uses M_NOWAIT. Ideally, we would always do this - * allocation from the sysctl contact and have it be an invariant that if - * this random ID allocation mode is selected, the buffers are present. This - * would also avoid potential network context failures of IP ID generation. - */ static void -ip_initid(void) +ip_initid(int new_size) { + uint16_t *new_array; + bitstr_t *new_bits; - mtx_assert(&ip_id_mtx, MA_OWNED); + new_array = malloc(new_size * sizeof(uint16_t), M_IPID, + M_WAITOK | M_ZERO); + new_bits = malloc(bitstr_size(65536), M_IPID, M_WAITOK | M_ZERO); + mtx_lock(&ip_id_mtx); if (id_array != NULL) { free(id_array, M_IPID); free(id_bits, M_IPID); } + id_array = new_array; + id_bits = new_bits; + array_size = new_size; + array_ptr = 0; random_id_collisions = 0; random_id_total = 0; - array_ptr = 0; - id_array = (u_int16_t *) malloc(array_size * sizeof(u_int16_t), - M_IPID, M_NOWAIT | M_ZERO); - id_bits = (bitstr_t *) malloc(bitstr_size(65536), M_IPID, - M_NOWAIT | M_ZERO); - if (id_array == NULL || id_bits == NULL) { - /* Neither or both. */ - if (id_array != NULL) { - free(id_array, M_IPID); - id_array = NULL; - } - if (id_bits != NULL) { - free(id_bits, M_IPID); - id_bits = NULL; - } - } + mtx_unlock(&ip_id_mtx); } -u_int16_t +uint16_t ip_randomid(void) { - u_int16_t new_id; + uint16_t new_id; mtx_lock(&ip_id_mtx); - if (id_array == NULL) - ip_initid(); - - /* - * Fail gracefully; return a fixed id if memory allocation failed; - * ideally we wouldn't do allocation in this context in order to - * avoid the possibility of this failure mode. - */ - if (id_array == NULL) { - mtx_unlock(&ip_id_mtx); - return (1); - } - /* * To avoid a conflict with the zeros that the array is initially * filled with, we never hand out an id of zero. @@ -207,3 +177,12 @@ ip_randomid(void) mtx_unlock(&ip_id_mtx); return (new_id); } + +static void +ip_sysinitid(void) +{ + + mtx_init(&ip_id_mtx, "ip_id_mtx", NULL, MTX_DEF); + ip_initid(8192); +} +SYSINIT(ip_id, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, ip_sysinitid, NULL); From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 16:59:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25593F6E; Sat, 28 Mar 2015 16:59: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 076CEA7C; Sat, 28 Mar 2015 16:59:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SGxw9S039530; Sat, 28 Mar 2015 16:59:58 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SGxwXf039529; Sat, 28 Mar 2015 16:59:58 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201503281659.t2SGxwXf039529@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 28 Mar 2015 16:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280788 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 16:59:59 -0000 Author: glebius Date: Sat Mar 28 16:59:57 2015 New Revision: 280788 URL: https://svnweb.freebsd.org/changeset/base/280788 Log: VNETalize random IP ID engine. Sponsored by: Nginx, Inc. Modified: head/sys/netinet/ip_id.c Modified: head/sys/netinet/ip_id.c ============================================================================== --- head/sys/netinet/ip_id.c Sat Mar 28 16:06:46 2015 (r280787) +++ head/sys/netinet/ip_id.c Sat Mar 28 16:59:57 2015 (r280788) @@ -85,38 +85,51 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include + #include #include -#include static MALLOC_DEFINE(M_IPID, "ipid", "randomized ip id state"); -static uint16_t *id_array; -static bitstr_t *id_bits; -static int array_ptr; -static int array_size; -static int random_id_collisions; -static int random_id_total; -static struct mtx ip_id_mtx; +static VNET_DEFINE(uint16_t *, id_array); +static VNET_DEFINE(bitstr_t *, id_bits); +static VNET_DEFINE(int, array_ptr); +static VNET_DEFINE(int, array_size); +static VNET_DEFINE(int, random_id_collisions); +static VNET_DEFINE(int, random_id_total); +static VNET_DEFINE(struct mtx, ip_id_mtx); +#define V_id_array VNET(id_array) +#define V_id_bits VNET(id_bits) +#define V_array_ptr VNET(array_ptr) +#define V_array_size VNET(array_size) +#define V_random_id_collisions VNET(random_id_collisions) +#define V_random_id_total VNET(random_id_total) +#define V_ip_id_mtx VNET(ip_id_mtx) static void ip_initid(int); static int sysctl_ip_id_change(SYSCTL_HANDLER_ARGS); -static void ip_sysinitid(void); +static void ipid_sysinit(void); +static void ipid_sysuninit(void); SYSCTL_DECL(_net_inet_ip); -SYSCTL_PROC(_net_inet_ip, OID_AUTO, random_id_period, CTLTYPE_INT|CTLFLAG_RW, - &array_size, 0, sysctl_ip_id_change, "IU", "IP ID Array size"); -SYSCTL_INT(_net_inet_ip, OID_AUTO, random_id_collisions, CTLFLAG_RD, - &random_id_collisions, 0, "Count of IP ID collisions"); -SYSCTL_INT(_net_inet_ip, OID_AUTO, random_id_total, CTLFLAG_RD, - &random_id_total, 0, "Count of IP IDs created"); +SYSCTL_PROC(_net_inet_ip, OID_AUTO, random_id_period, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(array_size), 0, sysctl_ip_id_change, "IU", "IP ID Array size"); +SYSCTL_INT(_net_inet_ip, OID_AUTO, random_id_collisions, + CTLFLAG_RD | CTLFLAG_VNET, + &VNET_NAME(random_id_collisions), 0, "Count of IP ID collisions"); +SYSCTL_INT(_net_inet_ip, OID_AUTO, random_id_total, CTLFLAG_RD | CTLFLAG_VNET, + &VNET_NAME(random_id_total), 0, "Count of IP IDs created"); static int sysctl_ip_id_change(SYSCTL_HANDLER_ARGS) { int error, new; - new = array_size; + new = V_array_size; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr) { if (new >= 512 && new <= 32768) @@ -137,18 +150,18 @@ ip_initid(int new_size) M_WAITOK | M_ZERO); new_bits = malloc(bitstr_size(65536), M_IPID, M_WAITOK | M_ZERO); - mtx_lock(&ip_id_mtx); - if (id_array != NULL) { - free(id_array, M_IPID); - free(id_bits, M_IPID); + mtx_lock(&V_ip_id_mtx); + if (V_id_array != NULL) { + free(V_id_array, M_IPID); + free(V_id_bits, M_IPID); } - id_array = new_array; - id_bits = new_bits; - array_size = new_size; - array_ptr = 0; - random_id_collisions = 0; - random_id_total = 0; - mtx_unlock(&ip_id_mtx); + V_id_array = new_array; + V_id_bits = new_bits; + V_array_size = new_size; + V_array_ptr = 0; + V_random_id_collisions = 0; + V_random_id_total = 0; + mtx_unlock(&V_ip_id_mtx); } uint16_t @@ -156,7 +169,7 @@ ip_randomid(void) { uint16_t new_id; - mtx_lock(&ip_id_mtx); + mtx_lock(&V_ip_id_mtx); /* * To avoid a conflict with the zeros that the array is initially * filled with, we never hand out an id of zero. @@ -164,25 +177,35 @@ ip_randomid(void) new_id = 0; do { if (new_id != 0) - random_id_collisions++; + V_random_id_collisions++; arc4rand(&new_id, sizeof(new_id), 0); - } while (bit_test(id_bits, new_id) || new_id == 0); - bit_clear(id_bits, id_array[array_ptr]); - bit_set(id_bits, new_id); - id_array[array_ptr] = new_id; - array_ptr++; - if (array_ptr == array_size) - array_ptr = 0; - random_id_total++; - mtx_unlock(&ip_id_mtx); + } while (bit_test(V_id_bits, new_id) || new_id == 0); + bit_clear(V_id_bits, V_id_array[V_array_ptr]); + bit_set(V_id_bits, new_id); + V_id_array[V_array_ptr] = new_id; + V_array_ptr++; + if (V_array_ptr == V_array_size) + V_array_ptr = 0; + V_random_id_total++; + mtx_unlock(&V_ip_id_mtx); return (new_id); } static void -ip_sysinitid(void) +ipid_sysinit(void) { - mtx_init(&ip_id_mtx, "ip_id_mtx", NULL, MTX_DEF); + mtx_init(&V_ip_id_mtx, "ip_id_mtx", NULL, MTX_DEF); ip_initid(8192); } -SYSINIT(ip_id, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, ip_sysinitid, NULL); +VNET_SYSINIT(ip_id, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, ipid_sysinit, NULL); + +static void +ipid_sysuninit(void) +{ + + mtx_destroy(&V_ip_id_mtx); + free(V_id_array, M_IPID); + free(V_id_bits, M_IPID); +} +VNET_SYSUNINIT(ip_id, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, ipid_sysuninit, NULL); From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 17:23:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF5B08F8; Sat, 28 Mar 2015 17:23:20 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AEAF1D40; Sat, 28 Mar 2015 17:23:20 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t2SHNDux038563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Mar 2015 10:23:13 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t2SHNDRw038562; Sat, 28 Mar 2015 10:23:13 -0700 (PDT) (envelope-from jmg) Date: Sat, 28 Mar 2015 10:23:13 -0700 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r280759 - head/sys/netinet Message-ID: <20150328172313.GC51048@funkthat.com> References: <201503271326.t2RDQxd3056112@svn.freebsd.org> <20150328083443.GV64665@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150328083443.GV64665@FreeBSD.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 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? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sat, 28 Mar 2015 10:23:13 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Fabien Thomas X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 17:23:21 -0000 Gleb Smirnoff wrote this message on Sat, Mar 28, 2015 at 11:34 +0300: > On Fri, Mar 27, 2015 at 01:26:59PM +0000, Fabien Thomas wrote: > F> Author: fabient > F> Date: Fri Mar 27 13:26:59 2015 > F> New Revision: 280759 > F> URL: https://svnweb.freebsd.org/changeset/base/280759 > F> > F> Log: > F> On multi CPU systems, we may emit successive packets with the same id. > F> Fix the race by using an atomic operation. > F> > F> Differential Revision: https://reviews.freebsd.org/D2141 > F> Obtained from: emeric.poupon@stormshield.eu > F> MFC after: 1 week > F> Sponsored by: Stormshield > > The D2141 says that benchmarking were done in presence of IPSEC, which > of course is the bottleneck and performance of this instruction can't > be benchmarked in its presence. Anyway, I believe that results of > right benchmark would still show little difference between atomic and > non-atomic increment of a shared value. > > I think we can use per-cpu ID counters, each CPU incrementing its > own. If we start with random values, then probability of two packets with > the same ID emitting at the allowed timeframe will be acceptably small. Please do not use per-cpu id counters.. That will just push the duplicate ids to being more rare, but just as much of a problem... Please read: https://tools.ietf.org/html/rfc6864 And then implement one hased upon source/dest/protocol... 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 Sat Mar 28 17:29:08 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82250A8F for ; Sat, 28 Mar 2015 17:29:08 +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 5A832D73 for ; Sat, 28 Mar 2015 17:29:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SHT7Kl067965 for ; Sat, 28 Mar 2015 17:29:07 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t2SHT7h3067962 for svn-src-head@FreeBSD.org; Sat, 28 Mar 2015 17:29:07 GMT (envelope-from bdrewery) Received: (qmail 23948 invoked from network); 28 Mar 2015 12:29:05 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 28 Mar 2015 12:29:05 -0500 Message-ID: <5516E4EA.60201@FreeBSD.org> Date: Sat, 28 Mar 2015 12:29:14 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Don Lewis , alc@FreeBSD.org Subject: Re: svn commit: r280327 - in head/sys: kern vm References: <201503280241.t2S2fWcQ078499@gw.catspoiler.org> In-Reply-To: <201503280241.t2S2fWcQ078499@gw.catspoiler.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9U3ngmVQRHrRd1wngbqhuv8MgLOFQaHQi" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, clusteradm@FreeBSD.org, portmgr@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 17:29:08 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9U3ngmVQRHrRd1wngbqhuv8MgLOFQaHQi Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 3/27/2015 9:41 PM, Don Lewis wrote: > On 21 Mar, Alan Cox wrote: >> Author: alc >> Date: Sat Mar 21 17:56:55 2015 >> New Revision: 280327 >> URL: https://svnweb.freebsd.org/changeset/base/280327 >> >> Log: >> Introduce vm_object_color() and use it in mmap(2) to set the color o= f >> named objects to zero before the virtual address is selected. Previ= ously, >> the color setting was delayed until after the virtual address was >> selected. In rtld, this delay effectively prevented the mapping of = a >> shared library's code section using superpages. Now, for example, w= e see >> the first 1 MB of libc's code on armv6 mapped by a superpage after w= e've >> gotten through the initial cold misses that bring the first 1 MB of = code >> into memory. (With the page clustering that we perform on read faul= ts, >> this happens quickly.) >> =20 >> Differential Revision: https://reviews.freebsd.org/D2013 >> Reviewed by: jhb, kib >> Tested by: Svatopluk Kraus (armv6) >> MFC after: 6 weeks >> >> Modified: >> head/sys/kern/kern_exec.c >> head/sys/vm/vm_fault.c >> head/sys/vm/vm_mmap.c >> head/sys/vm/vm_object.h >> head/sys/vm/vnode_pager.c >=20 > This change appears to have partially broken package building. >=20 > I recently set up a package building machine running 11.0-CURRENT > r280642 and found that it was unable to build openjdk7 packages inside > FreeBSD 8.4 and 9.3 poudriere jails, for both i386 and amd64. >=20 > [snip] > Compiling ../generated/adfiles/ad_x86_64_gen.cpp > rm -f ad_x86_64_gen.o > c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/usr= /ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs/u= sr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr/p= orts/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrkdi= rs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdirs= /usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/wr= kdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrkdi= rs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../gene= rated -DHOTSPOT_RELEASE_VERSION=3D"\"24.76-b04\"" -DHOTSPOT_BUILD_TARGET=3D= "\"product\"" -DHOTSPOT_BUILD_USER=3D"\"root\"" -DHOTSPOT_LIB_ARCH=3D\"am= d64\" -DHOTSPOT_VM_DISTRO=3D"\"OpenJDK\"" -O2 -pipe -fstack-protector -fn= o-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_= MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -= DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno! > -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAMI= LY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_= x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -= DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pip= e -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=3D1 -fno-omit-frame= -pointer -DINCLUDE_TRACE=3D1 -Wpointer-arith -Wconversion -Wsign-compare= -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_forma= t.o.d -o ad_x86_64_format.o ../generated/adfiles/ad_x86_64_format.cpp=20 > c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/usr= /ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs/u= sr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr/p= orts/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrkdi= rs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdirs= /usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/wr= kdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrkdi= rs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../gene= rated -DHOTSPOT_RELEASE_VERSION=3D"\"24.76-b04\"" -DHOTSPOT_BUILD_TARGET=3D= "\"product\"" -DHOTSPOT_BUILD_USER=3D"\"root\"" -DHOTSPOT_LIB_ARCH=3D\"am= d64\" -DHOTSPOT_VM_DISTRO=3D"\"OpenJDK\"" -O2 -pipe -fstack-protector -fn= o-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_= MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -= DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno! > -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAMI= LY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_= x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -= DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pip= e -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=3D1 -fno-omit-frame= -pointer -DINCLUDE_TRACE=3D1 -Wpointer-arith -Wconversion -Wsign-compare= -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_gen.o= =2Ed -o ad_x86_64_gen.o ../generated/adfiles/ad_x86_64_gen.cpp=20 > Compiling ../generated/adfiles/ad_x86_64_misc.cpp > rm -f ad_x86_64_misc.o > c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/usr= /ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs/u= sr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr/p= orts/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrkdi= rs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdirs= /usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/wr= kdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrkdi= rs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../gene= rated -DHOTSPOT_RELEASE_VERSION=3D"\"24.76-b04\"" -DHOTSPOT_BUILD_TARGET=3D= "\"product\"" -DHOTSPOT_BUILD_USER=3D"\"root\"" -DHOTSPOT_LIB_ARCH=3D\"am= d64\" -DHOTSPOT_VM_DISTRO=3D"\"OpenJDK\"" -O2 -pipe -fstack-protector -fn= o-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_= MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -= DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno! > -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAMI= LY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_= x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -= DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pip= e -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=3D1 -fno-omit-frame= -pointer -DINCLUDE_TRACE=3D1 -Wpointer-arith -Wconversion -Wsign-compare= -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_misc.= o.d -o ad_x86_64_misc.o ../generated/adfiles/ad_x86_64_misc.cpp=20 > /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/comp= iler/abstractCompiler.cpp:1: fatal error: had to relocate PCH > compilation terminated. > /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/util= ities/accessFlags.cpp:1: fatal error: had to relocate PCH > compilation terminated. > /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefile= s/rules.make:149: recipe for target 'abstractCompiler.o' failed > gmake[6]: *** [abstractCompiler.o] Error 1 > gmake[6]: *** Waiting for unfinished jobs.... > ../generated/adfiles/ad_x86_64.cpp:1: fatal error: had to relocate PCH > compilation terminated. Are you using ccache? > ../generated/adfiles/ad_x86_64_clone.cpp:1: fatal error: had to relocat= e PCH > compilation terminated. > /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefile= s/rules.make:149: recipe for target 'accessFlags.o' failed > gmake[6]: *** [accessFlags.o] Error 1 > /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefile= s/rules.make:149: recipe for target 'ad_x86_64_clone.o' failed > gmake[6]: *** [ad_x86_64_clone.o] Error 1 > /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefile= s/rules.make:149: recipe for target 'ad_x86_64.o' failed > gmake[6]: *** [ad_x86_64.o] Error 1 > ../generated/adfiles/ad_x86_64_expand.cpp:1: fatal error: had to reloca= te PCH > compilation terminated. > /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefile= s/rules.make:149: recipe for target 'ad_x86_64_expand.o' failed > gmake[6]: *** [ad_x86_64_expand.o] Error 1 > ../generated/adfiles/ad_x86_64_gen.cpp:1: fatal error: had to relocate = PCH > compilation terminated. > ../generated/adfiles/ad_x86_64_misc.cpp:1: fatal error: had to relocate= PCH > compilation terminated. > /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefile= s/rules.make:149: recipe for target 'ad_x86_64_gen.o' failed > gmake[6]: *** [ad_x86_64_gen.o] Error 1 > /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefile= s/rules.make:149: recipe for target 'ad_x86_64_misc.o' failed > gmake[6]: *** [ad_x86_64_misc.o] Error 1 > ../generated/adfiles/ad_x86_64_format.cpp:1: fatal error: had to reloca= te PCH > compilation terminated. > /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefile= s/rules.make:149: recipe for target 'ad_x86_64_format.o' failed > gmake[6]: *** [ad_x86_64_format.o] Error 1 > gmake[6]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/open= jdk/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product' > /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefile= s/top.make:128: recipe for target 'the_vm' failed > gmake[5]: *** [the_vm] Error 2 > gmake[5]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/open= jdk/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product' > /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/Makefile= :292: recipe for target 'product' failed > gmake[4]: *** [product] Error 2 > gmake[4]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/open= jdk/build/bsd-amd64/hotspot/outputdir' > Makefile:191: recipe for target 'generic_build2' failed > gmake[3]: *** [generic_build2] Error 2 > gmake[3]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/open= jdk/hotspot/make' > Makefile:151: recipe for target 'product' failed > gmake[2]: *** [product] Error 2 > gmake[2]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/open= jdk/hotspot/make' > make/hotspot-rules.gmk:111: recipe for target 'hotspot-build' failed > gmake[1]: *** [hotspot-build] Error 2 > gmake[1]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/open= jdk' > Makefile:251: recipe for target 'build_product_image' failed > gmake: *** [build_product_image] Error 2 > =3D=3D=3D> Compilation failed unexpectedly. >=20 > I was not seeing this problem on my older package builder running > 10.1-STABLE. Since this problem has not shown up on the FreeBSD packag= e > building cluster, I got suspicious that the change was quite recent. >=20 > This old gcc bug report: > led me to suspec= t > mmap(). >=20 > The old gcc source file /usr/src/contrib/gcc/ggc-common.c does a couple= > of mmap() calls. Tne first is in mmap_gt_pch_get_address() where a > NULL first argument is used. The address that gets returned is stashed= > away and the region is unmapped. Then a later call in > mmap_gt_pch_use_address() passes this saved address to mmap() as a > hint. It expects the mapped region to get mapped to the same base > address. If this does not happen, the above error is the result. I don't know what I'm talking about but that doesn't sound like a very safe assumption for the gcc code to make. >=20 > If I go back to kernel source r280326, which immediately preceeds the > above commit, I am able to successfully build openjdk7. >=20 > I recommend that any machines in the ports cluster being used to build > packages for FreeBSD 8 and 9 avoid upgrading past r280326 until this > issue is resolved. I have not observed any problems building packages > for FreeBSD 10 and 11. >=20 Is it 100% for you before and after? I've seen this error come up randomly where a rebuild will succeed. or fail. --=20 Regards, Bryan Drewery --9U3ngmVQRHrRd1wngbqhuv8MgLOFQaHQi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJVFuTqAAoJEDXXcbtuRpfPzgsIAMif2+GyWXX6xhsK+fWU7PGV yHJWEvIPtF+0V0xMjRaIuB4F5uppZs2Pg2DqRHg4xTejyN7l1W8dTj9KdSlpKf7T /CCV4r/lZLMR+/qYuTS16K5TZ5M4gGO7iSsrcCMnP/YyPDV2D32kle9fLTTi4lb2 oGvjoox9kA4xwHDgq6NeXNXB6snQfVBQDssrUtmYbxuJF5nV8Shs0nW6L9I7qaB0 InON+BE8wWJ69t8bF8EGrbjWJaffYeDcRwXxE4SKNEYYXkqpLcFQCJa2TDD2Fu8j wlb6qTbkO6NZ/p8qet7JpQ15QZ4sHWYlOrvqsrkMtdCjPfNNQe/jjB1u44C+Yl0= =xId4 -----END PGP SIGNATURE----- --9U3ngmVQRHrRd1wngbqhuv8MgLOFQaHQi-- From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 17:46:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5103528; Sat, 28 Mar 2015 17:46:00 +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 64932F3A; Sat, 28 Mar 2015 17:46:00 +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 B2F6D25D37D1; Sat, 28 Mar 2015 17:45:56 +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 D5E49C77058; Sat, 28 Mar 2015 17:45:55 +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 j_oOoFXc2a_T; Sat, 28 Mar 2015 17:45:54 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:b88f:8a06:70f:7ed3] (unknown [IPv6:fde9:577b:c1a9:4410:b88f:8a06:70f:7ed3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 0BBA7C7700C; Sat, 28 Mar 2015 17:45:52 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r280759 - head/sys/netinet From: "Bjoern A. Zeeb" In-Reply-To: <20150328172313.GC51048@funkthat.com> Date: Sat, 28 Mar 2015 17:45:20 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201503271326.t2RDQxd3056112@svn.freebsd.org> <20150328083443.GV64665@FreeBSD.org> <20150328172313.GC51048@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 17:46:00 -0000 > On 28 Mar 2015, at 17:23 , John-Mark Gurney wrote: >=20 > Gleb Smirnoff wrote this message on Sat, Mar 28, 2015 at 11:34 +0300: >> On Fri, Mar 27, 2015 at 01:26:59PM +0000, Fabien Thomas wrote: >> F> Author: fabient >> F> Date: Fri Mar 27 13:26:59 2015 >> F> New Revision: 280759 >> F> URL: https://svnweb.freebsd.org/changeset/base/280759 >> F>=20 >> F> Log: >> F> On multi CPU systems, we may emit successive packets with the = same id. >> F> Fix the race by using an atomic operation. >> F> =20 >> F> Differential Revision: https://reviews.freebsd.org/D2141 >> F> Obtained from: emeric.poupon@stormshield.eu >> F> MFC after: 1 week >> F> Sponsored by: Stormshield >>=20 >> The D2141 says that benchmarking were done in presence of IPSEC, = which >> of course is the bottleneck and performance of this instruction can't >> be benchmarked in its presence. Anyway, I believe that results of >> right benchmark would still show little difference between atomic and >> non-atomic increment of a shared value. >>=20 >> I think we can use per-cpu ID counters, each CPU incrementing its >> own. If we start with random values, then probability of two packets = with >> the same ID emitting at the allowed timeframe will be acceptably = small. >=20 > Please do not use per-cpu id counters.. That will just push the > duplicate ids to being more rare, but just as much of a problem... >=20 > Please read: > https://tools.ietf.org/html/rfc6864 >=20 > And then implement one hased upon source/dest/protocol=E2=80=A6 and if someone is interested in reviving this as well (read the old = thread from then on net@) https://people.freebsd.org/~bz/20110313-01-rfc6056.diff =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 17:56:12 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3CB5922; Sat, 28 Mar 2015 17:56:11 +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 B149F72; Sat, 28 Mar 2015 17:56:10 +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 t2SHq0m4018414; Sat, 28 Mar 2015 12:56:03 -0500 Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by pp2.rice.edu with ESMTP id 1tdas4rfy9-1; Sat, 28 Mar 2015 12:56:02 -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 F33164C01FE; Sat, 28 Mar 2015 12:56:01 -0500 (CDT) Message-ID: <5516EB31.7000309@rice.edu> Date: Sat, 28 Mar 2015 12:56:01 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Bryan Drewery , Don Lewis , alc@FreeBSD.org Subject: Re: svn commit: r280327 - in head/sys: kern vm References: <201503280241.t2S2fWcQ078499@gw.catspoiler.org> <5516E4EA.60201@FreeBSD.org> In-Reply-To: <5516E4EA.60201@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=1.8279923352793e-08 kscore.compositescore=4.63935834194018e-10 circleOfTrustscore=0 compositescore=0.605526357678523 suspectscore=3 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 rbsscore=0.605526357678523 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.0055263576785225 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1503280183 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, clusteradm@FreeBSD.org, portmgr@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 17:56:12 -0000 On 03/28/2015 12:29, Bryan Drewery wrote: > On 3/27/2015 9:41 PM, Don Lewis wrote: >> On 21 Mar, Alan Cox wrote: >>> Author: alc >>> Date: Sat Mar 21 17:56:55 2015 >>> New Revision: 280327 >>> URL: https://svnweb.freebsd.org/changeset/base/280327 >>> >>> Log: >>> Introduce vm_object_color() and use it in mmap(2) to set the color = of >>> named objects to zero before the virtual address is selected. Prev= iously, >>> the color setting was delayed until after the virtual address was >>> selected. In rtld, this delay effectively prevented the mapping of= a >>> shared library's code section using superpages. Now, for example, = we see >>> the first 1 MB of libc's code on armv6 mapped by a superpage after = we've >>> gotten through the initial cold misses that bring the first 1 MB of= code >>> into memory. (With the page clustering that we perform on read fau= lts, >>> this happens quickly.) >>> =20 >>> Differential Revision: https://reviews.freebsd.org/D2013 >>> Reviewed by: jhb, kib >>> Tested by: Svatopluk Kraus (armv6) >>> MFC after: 6 weeks >>> >>> Modified: >>> head/sys/kern/kern_exec.c >>> head/sys/vm/vm_fault.c >>> head/sys/vm/vm_mmap.c >>> head/sys/vm/vm_object.h >>> head/sys/vm/vnode_pager.c >> This change appears to have partially broken package building. >> >> I recently set up a package building machine running 11.0-CURRENT >> r280642 and found that it was unable to build openjdk7 packages inside= >> FreeBSD 8.4 and 9.3 poudriere jails, for both i386 and amd64. >> >> [snip] >> Compiling ../generated/adfiles/ad_x86_64_gen.cpp >> rm -f ad_x86_64_gen.o >> c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/us= r/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs/= usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr/= ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrkd= irs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdir= s/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/w= rkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrkd= irs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../gen= erated -DHOTSPOT_RELEASE_VERSION=3D"\"24.76-b04\"" -DHOTSPOT_BUILD_TARGET= =3D"\"product\"" -DHOTSPOT_BUILD_USER=3D"\"root\"" -DHOTSPOT_LIB_ARCH=3D\= "amd64\" -DHOTSPOT_VM_DISTRO=3D"\"OpenJDK\"" -O2 -pipe -fstack-protector = -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_AR= CH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_6= 4 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno! >> -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAM= ILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd= _x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 = -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pi= pe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=3D1 -fno-omit-fram= e-pointer -DINCLUDE_TRACE=3D1 -Wpointer-arith -Wconversion -Wsign-compar= e -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_form= at.o.d -o ad_x86_64_format.o ../generated/adfiles/ad_x86_64_format.cpp=20 >> c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/us= r/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs/= usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr/= ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrkd= irs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdir= s/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/w= rkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrkd= irs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../gen= erated -DHOTSPOT_RELEASE_VERSION=3D"\"24.76-b04\"" -DHOTSPOT_BUILD_TARGET= =3D"\"product\"" -DHOTSPOT_BUILD_USER=3D"\"root\"" -DHOTSPOT_LIB_ARCH=3D\= "amd64\" -DHOTSPOT_VM_DISTRO=3D"\"OpenJDK\"" -O2 -pipe -fstack-protector = -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_AR= CH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_6= 4 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno! >> -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAM= ILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd= _x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 = -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pi= pe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=3D1 -fno-omit-fram= e-pointer -DINCLUDE_TRACE=3D1 -Wpointer-arith -Wconversion -Wsign-compar= e -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_gen.= o.d -o ad_x86_64_gen.o ../generated/adfiles/ad_x86_64_gen.cpp=20 >> Compiling ../generated/adfiles/ad_x86_64_misc.cpp >> rm -f ad_x86_64_misc.o >> c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/us= r/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs/= usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr/= ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrkd= irs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdir= s/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/w= rkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrkd= irs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../gen= erated -DHOTSPOT_RELEASE_VERSION=3D"\"24.76-b04\"" -DHOTSPOT_BUILD_TARGET= =3D"\"product\"" -DHOTSPOT_BUILD_USER=3D"\"root\"" -DHOTSPOT_LIB_ARCH=3D\= "amd64\" -DHOTSPOT_VM_DISTRO=3D"\"OpenJDK\"" -O2 -pipe -fstack-protector = -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_AR= CH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_6= 4 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno! >> -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAM= ILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd= _x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 = -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pi= pe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=3D1 -fno-omit-fram= e-pointer -DINCLUDE_TRACE=3D1 -Wpointer-arith -Wconversion -Wsign-compar= e -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_misc= =2Eo.d -o ad_x86_64_misc.o ../generated/adfiles/ad_x86_64_misc.cpp=20 >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/com= piler/abstractCompiler.cpp:1: fatal error: had to relocate PCH >> compilation terminated. >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/uti= lities/accessFlags.cpp:1: fatal error: had to relocate PCH >> compilation terminated. >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefil= es/rules.make:149: recipe for target 'abstractCompiler.o' failed >> gmake[6]: *** [abstractCompiler.o] Error 1 >> gmake[6]: *** Waiting for unfinished jobs.... >> ../generated/adfiles/ad_x86_64.cpp:1: fatal error: had to relocate PCH= >> compilation terminated. > Are you using ccache? > >> ../generated/adfiles/ad_x86_64_clone.cpp:1: fatal error: had to reloca= te PCH >> compilation terminated. >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefil= es/rules.make:149: recipe for target 'accessFlags.o' failed >> gmake[6]: *** [accessFlags.o] Error 1 >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefil= es/rules.make:149: recipe for target 'ad_x86_64_clone.o' failed >> gmake[6]: *** [ad_x86_64_clone.o] Error 1 >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefil= es/rules.make:149: recipe for target 'ad_x86_64.o' failed >> gmake[6]: *** [ad_x86_64.o] Error 1 >> ../generated/adfiles/ad_x86_64_expand.cpp:1: fatal error: had to reloc= ate PCH >> compilation terminated. >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefil= es/rules.make:149: recipe for target 'ad_x86_64_expand.o' failed >> gmake[6]: *** [ad_x86_64_expand.o] Error 1 >> ../generated/adfiles/ad_x86_64_gen.cpp:1: fatal error: had to relocate= PCH >> compilation terminated. >> ../generated/adfiles/ad_x86_64_misc.cpp:1: fatal error: had to relocat= e PCH >> compilation terminated. >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefil= es/rules.make:149: recipe for target 'ad_x86_64_gen.o' failed >> gmake[6]: *** [ad_x86_64_gen.o] Error 1 >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefil= es/rules.make:149: recipe for target 'ad_x86_64_misc.o' failed >> gmake[6]: *** [ad_x86_64_misc.o] Error 1 >> ../generated/adfiles/ad_x86_64_format.cpp:1: fatal error: had to reloc= ate PCH >> compilation terminated. >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefil= es/rules.make:149: recipe for target 'ad_x86_64_format.o' failed >> gmake[6]: *** [ad_x86_64_format.o] Error 1 >> gmake[6]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/ope= njdk/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product' >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefil= es/top.make:128: recipe for target 'the_vm' failed >> gmake[5]: *** [the_vm] Error 2 >> gmake[5]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/ope= njdk/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product' >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/Makefil= e:292: recipe for target 'product' failed >> gmake[4]: *** [product] Error 2 >> gmake[4]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/ope= njdk/build/bsd-amd64/hotspot/outputdir' >> Makefile:191: recipe for target 'generic_build2' failed >> gmake[3]: *** [generic_build2] Error 2 >> gmake[3]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/ope= njdk/hotspot/make' >> Makefile:151: recipe for target 'product' failed >> gmake[2]: *** [product] Error 2 >> gmake[2]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/ope= njdk/hotspot/make' >> make/hotspot-rules.gmk:111: recipe for target 'hotspot-build' failed >> gmake[1]: *** [hotspot-build] Error 2 >> gmake[1]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/ope= njdk' >> Makefile:251: recipe for target 'build_product_image' failed >> gmake: *** [build_product_image] Error 2 >> =3D=3D=3D> Compilation failed unexpectedly. >> >> I was not seeing this problem on my older package builder running >> 10.1-STABLE. Since this problem has not shown up on the FreeBSD packa= ge >> building cluster, I got suspicious that the change was quite recent. >> >> This old gcc bug report: >> led me to suspe= ct >> mmap(). >> >> The old gcc source file /usr/src/contrib/gcc/ggc-common.c does a coupl= e >> of mmap() calls. Tne first is in mmap_gt_pch_get_address() where a >> NULL first argument is used. The address that gets returned is stashe= d >> away and the region is unmapped. Then a later call in >> mmap_gt_pch_use_address() passes this saved address to mmap() as a >> hint. It expects the mapped region to get mapped to the same base >> address. If this does not happen, the above error is the result. > I don't know what I'm talking about but that doesn't sound like a very > safe assumption for the gcc code to make. Your intuition is correct. It is not. And, in fact, under Solaris and Linux, gcc does not make this assumption. I suspect that the solution used by gcc under Solaris would work for us. However, that would entail modifying gcc in older branches. Is arm still using gcc as the default compiler on HEAD? >> If I go back to kernel source r280326, which immediately preceeds the >> above commit, I am able to successfully build openjdk7. >> >> I recommend that any machines in the ports cluster being used to build= >> packages for FreeBSD 8 and 9 avoid upgrading past r280326 until this >> issue is resolved. I have not observed any problems building packages= >> for FreeBSD 10 and 11. >> > Is it 100% for you before and after? I've seen this error come up > randomly where a rebuild will succeed. or fail. > > From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 18:03:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 795BCC0A; Sat, 28 Mar 2015 18:03:28 +0000 (UTC) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE82170; Sat, 28 Mar 2015 18:03:28 +0000 (UTC) Received: by igcau2 with SMTP id au2so49200039igc.1; Sat, 28 Mar 2015 11:03: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=iZk9clyMxPuZV3S/0VSmZdEvH5c4xF/DyqS05XW4WDk=; b=TNTj4Jg4+9zeeODpAHSFCWBWB6TwDro/8HMQo5ecHDobTsxP4pxjwed0oiFoiLMPy8 86XJlN1vZuzqSYC4L+KAZkducqVejOqoJcCuJgJnHu5ql3ooW4N3zTliVpOxiJmL/5qZ gxOBOpBrbohckY6St+I3Drbwd8BLAeajx2+dH0R5uZPav9l1/Quy6FbhjogjoRbKbmuz SxXdvKjgIQ/I7uKpL7lJW5oK2gyOUFDbu4ZX5jry5PBCrwR1NBdRRVu3f8ckcyovkv5r hgIojRo/6V8LbDjoE+Q5XK4OS13qVISlhVR/Oa2+rSzxZr2F7Tp27Oqym0TwwQr7UB3u Xieg== MIME-Version: 1.0 X-Received: by 10.42.41.200 with SMTP id q8mr47596757ice.61.1427565807773; Sat, 28 Mar 2015 11:03:27 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.194 with HTTP; Sat, 28 Mar 2015 11:03:27 -0700 (PDT) In-Reply-To: <5516EB31.7000309@rice.edu> References: <201503280241.t2S2fWcQ078499@gw.catspoiler.org> <5516E4EA.60201@FreeBSD.org> <5516EB31.7000309@rice.edu> Date: Sat, 28 Mar 2015 11:03:27 -0700 X-Google-Sender-Auth: CJ_Y3W_ummfH7O-mC4f08Vt88wk Message-ID: Subject: Re: svn commit: r280327 - in head/sys: kern vm From: Adrian Chadd To: Alan Cox Content-Type: text/plain; charset=UTF-8 Cc: "src-committers@freebsd.org" , Alan Cox , Don Lewis , Bryan Drewery , portmgr@freebsd.org, "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , clusteradm@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 18:03:28 -0000 Hm, at least MIPS is still using gcc-4.2. Shall we fix gcc in the tree to stop this from happening? I think that's the most sane thing to do, if a bit tedious. -adrian From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 18:04:26 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1F8FD82 for ; Sat, 28 Mar 2015 18:04: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 CF1A117D for ; Sat, 28 Mar 2015 18:04:26 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SI4QdL080781 for ; Sat, 28 Mar 2015 18:04:26 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t2SI4QKn080776 for svn-src-head@FreeBSD.org; Sat, 28 Mar 2015 18:04:26 GMT (envelope-from bdrewery) Received: (qmail 7759 invoked from network); 28 Mar 2015 13:04:22 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 28 Mar 2015 13:04:22 -0500 Message-ID: <5516ED2F.9050509@FreeBSD.org> Date: Sat, 28 Mar 2015 13:04:31 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Alan Cox , Don Lewis , alc@FreeBSD.org Subject: Re: svn commit: r280327 - in head/sys: kern vm References: <201503280241.t2S2fWcQ078499@gw.catspoiler.org> <5516E4EA.60201@FreeBSD.org> <5516EB31.7000309@rice.edu> In-Reply-To: <5516EB31.7000309@rice.edu> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="iVFgCRVrGl86UTRFEXrakgUNsTsWDsE6P" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, clusteradm@FreeBSD.org, portmgr@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 18:04:27 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iVFgCRVrGl86UTRFEXrakgUNsTsWDsE6P Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 3/28/2015 12:56 PM, Alan Cox wrote: > On 03/28/2015 12:29, Bryan Drewery wrote: >> On 3/27/2015 9:41 PM, Don Lewis wrote: >>> On 21 Mar, Alan Cox wrote: >>>> Author: alc >>>> Date: Sat Mar 21 17:56:55 2015 >>>> New Revision: 280327 >>>> URL: https://svnweb.freebsd.org/changeset/base/280327 >>>> >>>> Log: >>>> Introduce vm_object_color() and use it in mmap(2) to set the color= of >>>> named objects to zero before the virtual address is selected. Pre= viously, >>>> the color setting was delayed until after the virtual address was >>>> selected. In rtld, this delay effectively prevented the mapping o= f a >>>> shared library's code section using superpages. Now, for example,= we see >>>> the first 1 MB of libc's code on armv6 mapped by a superpage after= we've >>>> gotten through the initial cold misses that bring the first 1 MB o= f code >>>> into memory. (With the page clustering that we perform on read fa= ults, >>>> this happens quickly.) >>>> =20 >>>> Differential Revision: https://reviews.freebsd.org/D2013 >>>> Reviewed by: jhb, kib >>>> Tested by: Svatopluk Kraus (armv6) >>>> MFC after: 6 weeks >>>> >>>> Modified: >>>> head/sys/kern/kern_exec.c >>>> head/sys/vm/vm_fault.c >>>> head/sys/vm/vm_mmap.c >>>> head/sys/vm/vm_object.h >>>> head/sys/vm/vnode_pager.c >>> This change appears to have partially broken package building. >>> >>> I recently set up a package building machine running 11.0-CURRENT >>> r280642 and found that it was unable to build openjdk7 packages insid= e >>> FreeBSD 8.4 and 9.3 poudriere jails, for both i386 and amd64. >>> >>> [snip] >>> Compiling ../generated/adfiles/ad_x86_64_gen.cpp >>> rm -f ad_x86_64_gen.o >>> c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/u= sr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs= /usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr= /ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrk= dirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdi= rs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/= wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrk= dirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../ge= nerated -DHOTSPOT_RELEASE_VERSION=3D"\"24.76-b04\"" -DHOTSPOT_BUILD_TARGE= T=3D"\"product\"" -DHOTSPOT_BUILD_USER=3D"\"root\"" -DHOTSPOT_LIB_ARCH=3D= \"amd64\" -DHOTSPOT_VM_DISTRO=3D"\"OpenJDK\"" -O2 -pipe -fstack-protector= -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_A= RCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_= 64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno! >>> -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FA= MILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bs= d_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2= -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -p= ipe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=3D1 -fno-omit-fra= me-pointer -DINCLUDE_TRACE=3D1 -Wpointer-arith -Wconversion -Wsign-compa= re -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_for= mat.o.d -o ad_x86_64_format.o ../generated/adfiles/ad_x86_64_format.cpp=20 >>> c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/u= sr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs= /usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr= /ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrk= dirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdi= rs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/= wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrk= dirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../ge= nerated -DHOTSPOT_RELEASE_VERSION=3D"\"24.76-b04\"" -DHOTSPOT_BUILD_TARGE= T=3D"\"product\"" -DHOTSPOT_BUILD_USER=3D"\"root\"" -DHOTSPOT_LIB_ARCH=3D= \"amd64\" -DHOTSPOT_VM_DISTRO=3D"\"OpenJDK\"" -O2 -pipe -fstack-protector= -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_A= RCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_= 64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno! >>> -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FA= MILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bs= d_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2= -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -p= ipe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=3D1 -fno-omit-fra= me-pointer -DINCLUDE_TRACE=3D1 -Wpointer-arith -Wconversion -Wsign-compa= re -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_gen= =2Eo.d -o ad_x86_64_gen.o ../generated/adfiles/ad_x86_64_gen.cpp=20 >>> Compiling ../generated/adfiles/ad_x86_64_misc.cpp >>> rm -f ad_x86_64_misc.o >>> c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/u= sr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs= /usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr= /ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrk= dirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdi= rs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/= wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrk= dirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../ge= nerated -DHOTSPOT_RELEASE_VERSION=3D"\"24.76-b04\"" -DHOTSPOT_BUILD_TARGE= T=3D"\"product\"" -DHOTSPOT_BUILD_USER=3D"\"root\"" -DHOTSPOT_LIB_ARCH=3D= \"amd64\" -DHOTSPOT_VM_DISTRO=3D"\"OpenJDK\"" -O2 -pipe -fstack-protector= -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_A= RCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_= 64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fno! >>> -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FA= MILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bs= d_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2= -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -p= ipe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=3D1 -fno-omit-fra= me-pointer -DINCLUDE_TRACE=3D1 -Wpointer-arith -Wconversion -Wsign-compa= re -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_mis= c.o.d -o ad_x86_64_misc.o ../generated/adfiles/ad_x86_64_misc.cpp=20 >>> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/co= mpiler/abstractCompiler.cpp:1: fatal error: had to relocate PCH >>> compilation terminated. >>> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/ut= ilities/accessFlags.cpp:1: fatal error: had to relocate PCH >>> compilation terminated. >>> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefi= les/rules.make:149: recipe for target 'abstractCompiler.o' failed >>> gmake[6]: *** [abstractCompiler.o] Error 1 >>> gmake[6]: *** Waiting for unfinished jobs.... >>> ../generated/adfiles/ad_x86_64.cpp:1: fatal error: had to relocate PC= H >>> compilation terminated. >> Are you using ccache? >> >>> ../generated/adfiles/ad_x86_64_clone.cpp:1: fatal error: had to reloc= ate PCH >>> compilation terminated. >>> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefi= les/rules.make:149: recipe for target 'accessFlags.o' failed >>> gmake[6]: *** [accessFlags.o] Error 1 >>> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefi= les/rules.make:149: recipe for target 'ad_x86_64_clone.o' failed >>> gmake[6]: *** [ad_x86_64_clone.o] Error 1 >>> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefi= les/rules.make:149: recipe for target 'ad_x86_64.o' failed >>> gmake[6]: *** [ad_x86_64.o] Error 1 >>> ../generated/adfiles/ad_x86_64_expand.cpp:1: fatal error: had to relo= cate PCH >>> compilation terminated. >>> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefi= les/rules.make:149: recipe for target 'ad_x86_64_expand.o' failed >>> gmake[6]: *** [ad_x86_64_expand.o] Error 1 >>> ../generated/adfiles/ad_x86_64_gen.cpp:1: fatal error: had to relocat= e PCH >>> compilation terminated. >>> ../generated/adfiles/ad_x86_64_misc.cpp:1: fatal error: had to reloca= te PCH >>> compilation terminated. >>> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefi= les/rules.make:149: recipe for target 'ad_x86_64_gen.o' failed >>> gmake[6]: *** [ad_x86_64_gen.o] Error 1 >>> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefi= les/rules.make:149: recipe for target 'ad_x86_64_misc.o' failed >>> gmake[6]: *** [ad_x86_64_misc.o] Error 1 >>> ../generated/adfiles/ad_x86_64_format.cpp:1: fatal error: had to relo= cate PCH >>> compilation terminated. >>> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefi= les/rules.make:149: recipe for target 'ad_x86_64_format.o' failed >>> gmake[6]: *** [ad_x86_64_format.o] Error 1 >>> gmake[6]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/op= enjdk/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product' >>> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefi= les/top.make:128: recipe for target 'the_vm' failed >>> gmake[5]: *** [the_vm] Error 2 >>> gmake[5]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/op= enjdk/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product' >>> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/Makefi= le:292: recipe for target 'product' failed >>> gmake[4]: *** [product] Error 2 >>> gmake[4]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/op= enjdk/build/bsd-amd64/hotspot/outputdir' >>> Makefile:191: recipe for target 'generic_build2' failed >>> gmake[3]: *** [generic_build2] Error 2 >>> gmake[3]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/op= enjdk/hotspot/make' >>> Makefile:151: recipe for target 'product' failed >>> gmake[2]: *** [product] Error 2 >>> gmake[2]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/op= enjdk/hotspot/make' >>> make/hotspot-rules.gmk:111: recipe for target 'hotspot-build' failed >>> gmake[1]: *** [hotspot-build] Error 2 >>> gmake[1]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/op= enjdk' >>> Makefile:251: recipe for target 'build_product_image' failed >>> gmake: *** [build_product_image] Error 2 >>> =3D=3D=3D> Compilation failed unexpectedly. >>> >>> I was not seeing this problem on my older package builder running >>> 10.1-STABLE. Since this problem has not shown up on the FreeBSD pack= age >>> building cluster, I got suspicious that the change was quite recent. >>> >>> This old gcc bug report: >>> led me to susp= ect >>> mmap(). >>> >>> The old gcc source file /usr/src/contrib/gcc/ggc-common.c does a coup= le >>> of mmap() calls. Tne first is in mmap_gt_pch_get_address() where a >>> NULL first argument is used. The address that gets returned is stash= ed >>> away and the region is unmapped. Then a later call in >>> mmap_gt_pch_use_address() passes this saved address to mmap() as a >>> hint. It expects the mapped region to get mapped to the same base >>> address. If this does not happen, the above error is the result. >> I don't know what I'm talking about but that doesn't sound like a very= >> safe assumption for the gcc code to make. >=20 >=20 > Your intuition is correct. It is not. And, in fact, under Solaris and= > Linux, gcc does not make this assumption. >=20 > I suspect that the solution used by gcc under Solaris would work for > us. However, that would entail modifying gcc in older branches. We could probably just disable PCH usage in the build as well, at least when using GCC. --=20 Regards, Bryan Drewery --iVFgCRVrGl86UTRFEXrakgUNsTsWDsE6P Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJVFu0vAAoJEDXXcbtuRpfPV+cH/0LUVdJIxb41IWo0G9fsNACD 08wHdor1zPvQofLrSxo/SQM2XBTsyQDwKf70TPyvk9gFRsHp9AATR9TU7Uufv/YD WOQCta1oA2Tdbn9w5L40WUDJOOIMI8X8hNvcPrxVqv6/fr6SB9JvCOxWCmAbtVsK bz8jwR/pCVk9EPCjeZQ3hVO0Y+strNrti7UjC03BTZxDSKBxvjZ87v52itblXuaD iclp+JgdZh8JJH6JgxANNEL3p9Ao6HYJB700OjrTjFYtmozrXRQrKNFYV5z2tTB9 SUw8oQLCMUt/UGOJcdcdietptGBjhmwDHsuhQkBHUR2vb5TOcvAD78/m+mmj3B4= =vEXc -----END PGP SIGNATURE----- --iVFgCRVrGl86UTRFEXrakgUNsTsWDsE6P-- From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 18:18:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 813211F6; Sat, 28 Mar 2015 18:18:39 +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 DB57E2D5; Sat, 28 Mar 2015 18:18:37 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2SIIXkI031766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 28 Mar 2015 21:18:33 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2SIIXBB031765; Sat, 28 Mar 2015 21:18:33 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 28 Mar 2015 21:18:33 +0300 From: Gleb Smirnoff To: John-Mark Gurney Subject: Re: svn commit: r280759 - head/sys/netinet Message-ID: <20150328181833.GX64665@FreeBSD.org> References: <201503271326.t2RDQxd3056112@svn.freebsd.org> <20150328083443.GV64665@FreeBSD.org> <20150328172313.GC51048@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150328172313.GC51048@funkthat.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, Fabien Thomas X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 18:18:39 -0000 On Sat, Mar 28, 2015 at 10:23:13AM -0700, John-Mark Gurney wrote: J> > On Fri, Mar 27, 2015 at 01:26:59PM +0000, Fabien Thomas wrote: J> > F> Author: fabient J> > F> Date: Fri Mar 27 13:26:59 2015 J> > F> New Revision: 280759 J> > F> URL: https://svnweb.freebsd.org/changeset/base/280759 J> > F> J> > F> Log: J> > F> On multi CPU systems, we may emit successive packets with the same id. J> > F> Fix the race by using an atomic operation. J> > F> J> > F> Differential Revision: https://reviews.freebsd.org/D2141 J> > F> Obtained from: emeric.poupon@stormshield.eu J> > F> MFC after: 1 week J> > F> Sponsored by: Stormshield J> > J> > The D2141 says that benchmarking were done in presence of IPSEC, which J> > of course is the bottleneck and performance of this instruction can't J> > be benchmarked in its presence. Anyway, I believe that results of J> > right benchmark would still show little difference between atomic and J> > non-atomic increment of a shared value. J> > J> > I think we can use per-cpu ID counters, each CPU incrementing its J> > own. If we start with random values, then probability of two packets with J> > the same ID emitting at the allowed timeframe will be acceptably small. J> J> Please do not use per-cpu id counters.. That will just push the J> duplicate ids to being more rare, but just as much of a problem... J> J> Please read: J> https://tools.ietf.org/html/rfc6864 J> J> And then implement one hased upon source/dest/protocol... I know about this RFC, but using per-cpu ID counter if a low hanging fruit and is improvement. What is important not only improvement in terms of lowering probability of collision, but also easy improvement in performance, since now global ip_id increment is a cache line thrasher. So, I don't see how existense of the RFC blocks introducing an easy improvement. And if anyone works on implementing the RFC, he shouldn't care what is in head before his work, either global or per-cpu counter. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 18:22:38 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AD093D2; Sat, 28 Mar 2015 18:22:38 +0000 (UTC) Received: from gw.catspoiler.org (cl-1657.chi-02.us.sixxs.net [IPv6:2001:4978:f:678::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 DC1FD388; Sat, 28 Mar 2015 18:22:37 +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 t2SIMM1k081552; Sat, 28 Mar 2015 10:22:26 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201503281822.t2SIMM1k081552@gw.catspoiler.org> Date: Sat, 28 Mar 2015 11:22:22 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r280327 - in head/sys: kern vm To: bdrewery@FreeBSD.org In-Reply-To: <5516E4EA.60201@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: src-committers@FreeBSD.org, alc@FreeBSD.org, svn-src-all@FreeBSD.org, portmgr@FreeBSD.org, svn-src-head@FreeBSD.org, clusteradm@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 18:22:38 -0000 On 28 Mar, Bryan Drewery wrote: > On 3/27/2015 9:41 PM, Don Lewis wrote: >> On 21 Mar, Alan Cox wrote: >>> Author: alc >>> Date: Sat Mar 21 17:56:55 2015 >>> New Revision: 280327 >>> URL: https://svnweb.freebsd.org/changeset/base/280327 >>> >>> Log: >>> Introduce vm_object_color() and use it in mmap(2) to set the color of >>> named objects to zero before the virtual address is selected. Previously, >>> the color setting was delayed until after the virtual address was >>> selected. In rtld, this delay effectively prevented the mapping of a >>> shared library's code section using superpages. Now, for example, we see >>> the first 1 MB of libc's code on armv6 mapped by a superpage after we've >>> gotten through the initial cold misses that bring the first 1 MB of code >>> into memory. (With the page clustering that we perform on read faults, >>> this happens quickly.) >>> >>> Differential Revision: https://reviews.freebsd.org/D2013 >>> Reviewed by: jhb, kib >>> Tested by: Svatopluk Kraus (armv6) >>> MFC after: 6 weeks >>> >>> Modified: >>> head/sys/kern/kern_exec.c >>> head/sys/vm/vm_fault.c >>> head/sys/vm/vm_mmap.c >>> head/sys/vm/vm_object.h >>> head/sys/vm/vnode_pager.c >> >> This change appears to have partially broken package building. >> >> I recently set up a package building machine running 11.0-CURRENT >> r280642 and found that it was unable to build openjdk7 packages inside >> FreeBSD 8.4 and 9.3 poudriere jails, for both i386 and amd64. >> >> [snip] >> Compiling ../generated/adfiles/ad_x86_64_gen.cpp >> rm -f ad_x86_64_gen.o >> c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"24.76-b04\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"root\"" -DHOTSPOT_LIB_ARCH=\"amd64\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -O2 -pipe -fstack-protector -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -! fno! >> -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-omit-frame-pointer -DINCLUDE_TRACE=1 -Wpointer-arith -Wconversion -Wsign-compare -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_format.o.d -o ad_x86_64_format.o ../generated/adfiles/ad_x86_64_format.cpp >> c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"24.76-b04\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"root\"" -DHOTSPOT_LIB_ARCH=\"amd64\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -O2 -pipe -fstack-protector -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -! fno! >> -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-omit-frame-pointer -DINCLUDE_TRACE=1 -Wpointer-arith -Wconversion -Wsign-compare -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_gen.o.d -o ad_x86_64_gen.o ../generated/adfiles/ad_x86_64_gen.cpp >> Compiling ../generated/adfiles/ad_x86_64_misc.cpp >> rm -f ad_x86_64_misc.o >> c++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/prims -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/precompiled -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/cpu/x86/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os_cpu/bsd_x86/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/bsd/vm -I/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"24.76-b04\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"root\"" -DHOTSPOT_LIB_ARCH=\"amd64\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -O2 -pipe -fstack-protector -fno-strict-aliasing -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -! fno! >> -rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-omit-frame-pointer -DINCLUDE_TRACE=1 -Wpointer-arith -Wconversion -Wsign-compare -c -fpch-deps -MMD -MP -MF ../generated/dependencies/ad_x86_64_misc.o.d -o ad_x86_64_misc.o ../generated/adfiles/ad_x86_64_misc.cpp >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/compiler/abstractCompiler.cpp:1: fatal error: had to relocate PCH >> compilation terminated. >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/src/share/vm/utilities/accessFlags.cpp:1: fatal error: had to relocate PCH >> compilation terminated. >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'abstractCompiler.o' failed >> gmake[6]: *** [abstractCompiler.o] Error 1 >> gmake[6]: *** Waiting for unfinished jobs.... >> ../generated/adfiles/ad_x86_64.cpp:1: fatal error: had to relocate PCH >> compilation terminated. > > Are you using ccache? Nope. >> ../generated/adfiles/ad_x86_64_clone.cpp:1: fatal error: had to relocate PCH >> compilation terminated. >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'accessFlags.o' failed >> gmake[6]: *** [accessFlags.o] Error 1 >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'ad_x86_64_clone.o' failed >> gmake[6]: *** [ad_x86_64_clone.o] Error 1 >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'ad_x86_64.o' failed >> gmake[6]: *** [ad_x86_64.o] Error 1 >> ../generated/adfiles/ad_x86_64_expand.cpp:1: fatal error: had to relocate PCH >> compilation terminated. >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'ad_x86_64_expand.o' failed >> gmake[6]: *** [ad_x86_64_expand.o] Error 1 >> ../generated/adfiles/ad_x86_64_gen.cpp:1: fatal error: had to relocate PCH >> compilation terminated. >> ../generated/adfiles/ad_x86_64_misc.cpp:1: fatal error: had to relocate PCH >> compilation terminated. >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'ad_x86_64_gen.o' failed >> gmake[6]: *** [ad_x86_64_gen.o] Error 1 >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'ad_x86_64_misc.o' failed >> gmake[6]: *** [ad_x86_64_misc.o] Error 1 >> ../generated/adfiles/ad_x86_64_format.cpp:1: fatal error: had to relocate PCH >> compilation terminated. >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/rules.make:149: recipe for target 'ad_x86_64_format.o' failed >> gmake[6]: *** [ad_x86_64_format.o] Error 1 >> gmake[6]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/openjdk/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product' >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/makefiles/top.make:128: recipe for target 'the_vm' failed >> gmake[5]: *** [the_vm] Error 2 >> gmake[5]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/openjdk/build/bsd-amd64/hotspot/outputdir/bsd_amd64_compiler2/product' >> /wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make/bsd/Makefile:292: recipe for target 'product' failed >> gmake[4]: *** [product] Error 2 >> gmake[4]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/openjdk/build/bsd-amd64/hotspot/outputdir' >> Makefile:191: recipe for target 'generic_build2' failed >> gmake[3]: *** [generic_build2] Error 2 >> gmake[3]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make' >> Makefile:151: recipe for target 'product' failed >> gmake[2]: *** [product] Error 2 >> gmake[2]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/openjdk/hotspot/make' >> make/hotspot-rules.gmk:111: recipe for target 'hotspot-build' failed >> gmake[1]: *** [hotspot-build] Error 2 >> gmake[1]: Leaving directory '/wrkdirs/usr/ports/java/openjdk7/work/openjdk' >> Makefile:251: recipe for target 'build_product_image' failed >> gmake: *** [build_product_image] Error 2 >> ===> Compilation failed unexpectedly. >> >> I was not seeing this problem on my older package builder running >> 10.1-STABLE. Since this problem has not shown up on the FreeBSD package >> building cluster, I got suspicious that the change was quite recent. >> >> This old gcc bug report: >> led me to suspect >> mmap(). >> >> The old gcc source file /usr/src/contrib/gcc/ggc-common.c does a couple >> of mmap() calls. Tne first is in mmap_gt_pch_get_address() where a >> NULL first argument is used. The address that gets returned is stashed >> away and the region is unmapped. Then a later call in >> mmap_gt_pch_use_address() passes this saved address to mmap() as a >> hint. It expects the mapped region to get mapped to the same base >> address. If this does not happen, the above error is the result. > > I don't know what I'm talking about but that doesn't sound like a very > safe assumption for the gcc code to make. Yeah, I was pretty freaked out what I saw that. I'm not sure if it does this in one process or if it expects this to be repeatable between processes. I'm suspicious that it might be the latter. The first process would compile the headers and stash some of data structure in an mmap()ed file. The second process would then mmap() the file to use for compiling some code. If it landed at a different address the second time around, then all of the embedded pointers would be garbage. >> >> If I go back to kernel source r280326, which immediately preceeds the >> above commit, I am able to successfully build openjdk7. >> >> I recommend that any machines in the ports cluster being used to build >> packages for FreeBSD 8 and 9 avoid upgrading past r280326 until this >> issue is resolved. I have not observed any problems building packages >> for FreeBSD 10 and 11. >> > > Is it 100% for you before and after? I've seen this error come up > randomly where a rebuild will succeed. or fail. It's been 100% fatal for me when building openjdk7 in FreeBSD 8 and 9 jails. I've seen some other randomish-looking failures, but I didn't investigate whether they were the same, or just the usual random port breakage. If I can find some time, I'll go digging back through the logs. From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 18:26:13 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E25366D; Sat, 28 Mar 2015 18:26:13 +0000 (UTC) Received: from gw.catspoiler.org (cl-1657.chi-02.us.sixxs.net [IPv6:2001:4978:f:678::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 0104E3B0; Sat, 28 Mar 2015 18:26:12 +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 t2SIPi6d081565; Sat, 28 Mar 2015 10:25:48 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201503281825.t2SIPi6d081565@gw.catspoiler.org> Date: Sat, 28 Mar 2015 11:25:44 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r280327 - in head/sys: kern vm To: alc@rice.edu In-Reply-To: <5516EB31.7000309@rice.edu> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: src-committers@FreeBSD.org, alc@FreeBSD.org, svn-src-all@FreeBSD.org, bdrewery@FreeBSD.org, portmgr@FreeBSD.org, svn-src-head@FreeBSD.org, clusteradm@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 18:26:13 -0000 On 28 Mar, Alan Cox wrote: > On 03/28/2015 12:29, Bryan Drewery wrote: >> On 3/27/2015 9:41 PM, Don Lewis wrote: >>> I was not seeing this problem on my older package builder running >>> 10.1-STABLE. Since this problem has not shown up on the FreeBSD package >>> building cluster, I got suspicious that the change was quite recent. >>> >>> This old gcc bug report: >>> led me to suspect >>> mmap(). >>> >>> The old gcc source file /usr/src/contrib/gcc/ggc-common.c does a couple >>> of mmap() calls. Tne first is in mmap_gt_pch_get_address() where a >>> NULL first argument is used. The address that gets returned is stashed >>> away and the region is unmapped. Then a later call in >>> mmap_gt_pch_use_address() passes this saved address to mmap() as a >>> hint. It expects the mapped region to get mapped to the same base >>> address. If this does not happen, the above error is the result. >> I don't know what I'm talking about but that doesn't sound like a very >> safe assumption for the gcc code to make. > > > Your intuition is correct. It is not. And, in fact, under Solaris and > Linux, gcc does not make this assumption. > > I suspect that the solution used by gcc under Solaris would work for > us. However, that would entail modifying gcc in older branches. That's somewhat problematic because we use releases + official updates for package building. To continue doing this, we'd have to treat the gcc fix as an EN. From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 18:29:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98216845; Sat, 28 Mar 2015 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82D58400; Sat, 28 Mar 2015 18:29:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SITEJF081850; Sat, 28 Mar 2015 18:29:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SITErS081849; Sat, 28 Mar 2015 18:29:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503281829.t2SITErS081849@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 28 Mar 2015 18:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280789 - head/contrib/llvm/tools/lldb/source/Core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 18:29:14 -0000 Author: emaste Date: Sat Mar 28 18:29:13 2015 New Revision: 280789 URL: https://svnweb.freebsd.org/changeset/base/280789 Log: Import lldb r233478: Fix build failure on Freebsd with gcc 4.9. llvm.org/pr23051 Submitted by: rodrigc Modified: head/contrib/llvm/tools/lldb/source/Core/Mangled.cpp Modified: head/contrib/llvm/tools/lldb/source/Core/Mangled.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Core/Mangled.cpp Sat Mar 28 16:59:57 2015 (r280788) +++ head/contrib/llvm/tools/lldb/source/Core/Mangled.cpp Sat Mar 28 18:29:13 2015 (r280789) @@ -4886,7 +4886,7 @@ struct string_pair struct Db { - typedef String String; + typedef ::String String; typedef Vector sub_type; typedef Vector template_param_type; Vector names; From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 18:57:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A288465; Sat, 28 Mar 2015 18:57: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 64C0792B; Sat, 28 Mar 2015 18:57:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SIvFUM096551; Sat, 28 Mar 2015 18:57:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SIvErQ096549; Sat, 28 Mar 2015 18:57:14 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201503281857.t2SIvErQ096549@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 28 Mar 2015 18:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280790 - in head/sys: conf 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-1 Precedence: list List-Id: SVN 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 Mar 2015 18:57:15 -0000 Author: bz Date: Sat Mar 28 18:57:13 2015 New Revision: 280790 URL: https://svnweb.freebsd.org/changeset/base/280790 Log: Remove all the handcrafted assembly in hwpmc_armv7.c and use the common (autogenerated) versions. Removes extra vertical space, and makes it easier to grep for usage throughout the tree. Conditionally compile only for arm6 [1] (yes sounds odd but is right). Submitted by: andrew [1] Reviewed by: gnn, andrew (ian earlier version I think) Differential Revision: https://reviews.freebsd.org/D2159 Obtained from: Cambridge/L41 Sponsored by: DARPA, AFRL Modified: head/sys/conf/files.arm head/sys/dev/hwpmc/hwpmc_armv7.c Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Sat Mar 28 18:29:13 2015 (r280789) +++ head/sys/conf/files.arm Sat Mar 28 18:57:13 2015 (r280790) @@ -72,7 +72,7 @@ crypto/des/des_enc.c optional crypto | dev/fb/fb.c optional sc dev/fdt/fdt_arm_platform.c optional platform fdt dev/hwpmc/hwpmc_arm.c optional hwpmc -dev/hwpmc/hwpmc_armv7.c optional hwpmc +dev/hwpmc/hwpmc_armv7.c optional hwpmc armv6 dev/kbd/kbd.c optional sc | vt dev/syscons/scgfbrndr.c optional sc dev/syscons/scterm-teken.c optional sc Modified: head/sys/dev/hwpmc/hwpmc_armv7.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_armv7.c Sat Mar 28 18:29:13 2015 (r280789) +++ head/sys/dev/hwpmc/hwpmc_armv7.c Sat Mar 28 18:57:13 2015 (r280790) @@ -97,47 +97,6 @@ struct armv7_cpu { static struct armv7_cpu **armv7_pcpu; /* - * Performance Monitor Control Register - */ -static __inline uint32_t -armv7_pmnc_read(void) -{ - uint32_t reg; - - __asm __volatile("mrc p15, 0, %0, c9, c12, 0" : "=r" (reg)); - - return (reg); -} - -static __inline void -armv7_pmnc_write(uint32_t reg) -{ - - __asm __volatile("mcr p15, 0, %0, c9, c12, 0" : : "r" (reg)); -} - -/* - * Clock Counter Register (PMCCNTR) - * Counts processor clock cycles. - */ -static __inline uint32_t -armv7_ccnt_read(void) -{ - uint32_t reg; - - __asm __volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (reg)); - - return (reg); -} - -static __inline void -armv7_ccnt_write(uint32_t reg) -{ - - __asm __volatile("mcr p15, 0, %0, c9, c13, 0" : : "r" (reg)); -} - -/* * Interrupt Enable Set Register */ static __inline void @@ -146,8 +105,7 @@ armv7_interrupt_enable(uint32_t pmc) uint32_t reg; reg = (1 << pmc); - - __asm __volatile("mcr p15, 0, %0, c9, c14, 1" : : "r" (reg)); + cp15_pminten_set(reg); } /* @@ -159,48 +117,7 @@ armv7_interrupt_disable(uint32_t pmc) uint32_t reg; reg = (1 << pmc); - - __asm __volatile("mcr p15, 0, %0, c9, c14, 2" : : "r" (reg)); -} - -/* - * Overflow Flag Register - */ -static __inline uint32_t -armv7_flag_read(void) -{ - uint32_t reg; - - __asm __volatile("mrc p15, 0, %0, c9, c12, 3" : "=r" (reg)); - - return (reg); -} - -static __inline void -armv7_flag_write(uint32_t reg) -{ - - __asm __volatile("mcr p15, 0, %0, c9, c12, 3" : : "r" (reg)); -} - -/* - * Event Selection Register - */ -static __inline void -armv7_evtsel_write(uint32_t reg) -{ - - __asm __volatile("mcr p15, 0, %0, c9, c13, 1" : : "r" (reg)); -} - -/* - * PMSELR - */ -static __inline void -armv7_select_counter(unsigned int pmc) -{ - - __asm __volatile("mcr p15, 0, %0, c9, c12, 5" : : "r" (pmc)); + cp15_pminten_clr(reg); } /* @@ -212,8 +129,7 @@ armv7_counter_enable(unsigned int pmc) uint32_t reg; reg = (1 << pmc); - - __asm __volatile("mcr p15, 0, %0, c9, c12, 1" : : "r" (reg)); + cp15_pmcnten_set(reg); } /* @@ -225,8 +141,7 @@ armv7_counter_disable(unsigned int pmc) uint32_t reg; reg = (1 << pmc); - - __asm __volatile("mcr p15, 0, %0, c9, c12, 2" : : "r" (reg)); + cp15_pmcnten_clr(reg); } /* @@ -235,24 +150,21 @@ armv7_counter_disable(unsigned int pmc) static uint32_t armv7_pmcn_read(unsigned int pmc) { - uint32_t reg = 0; - - KASSERT(pmc < 4, ("[armv7,%d] illegal PMC number %d", __LINE__, pmc)); - armv7_select_counter(pmc); - __asm __volatile("mrc p15, 0, %0, c9, c13, 2" : "=r" (reg)); + KASSERT(pmc < armv7_npmcs, ("%s: illegal PMC number %d", __func__, pmc)); - return (reg); + cp15_pmselr_set(pmc); + return (cp15_pmxevcntr_get()); } static uint32_t armv7_pmcn_write(unsigned int pmc, uint32_t reg) { - KASSERT(pmc < 4, ("[armv7,%d] illegal PMC number %d", __LINE__, pmc)); + KASSERT(pmc < armv7_npmcs, ("%s: illegal PMC number %d", __func__, pmc)); - armv7_select_counter(pmc); - __asm __volatile("mcr p15, 0, %0, c9, c13, 2" : : "r" (reg)); + cp15_pmselr_set(pmc); + cp15_pmxevcntr_set(reg); return (reg); } @@ -309,7 +221,7 @@ armv7_read_pmc(int cpu, int ri, pmc_valu pm = armv7_pcpu[cpu]->pc_armv7pmcs[ri].phw_pmc; if (pm->pm_md.pm_armv7.pm_armv7_evsel == 0xFF) - tmp = armv7_ccnt_read(); + tmp = cp15_pmccntr_get(); else tmp = armv7_pmcn_read(ri); @@ -340,7 +252,7 @@ armv7_write_pmc(int cpu, int ri, pmc_val PMCDBG(MDP,WRI,1,"armv7-write cpu=%d ri=%d v=%jx", cpu, ri, v); if (pm->pm_md.pm_armv7.pm_armv7_evsel == 0xFF) - armv7_ccnt_write(v); + cp15_pmccntr_set(v); else armv7_pmcn_write(ri, v); @@ -384,8 +296,8 @@ armv7_start_pmc(int cpu, int ri) /* * Configure the event selection. */ - armv7_select_counter(ri); - armv7_evtsel_write(config); + cp15_pmselr_set(ri); + cp15_pmxevtyper_set(config); /* * Enable the PMC. @@ -459,12 +371,12 @@ armv7_intr(int cpu, struct trapframe *tf else reg = (1 << ri); - if ((armv7_flag_read() & reg) == 0) { + if ((cp15_pmovsr_get() & reg) == 0) { continue; } /* Clear Overflow Flag */ - armv7_flag_write(reg); + cp15_pmovsr_set(reg); retval = 1; /* Found an interrupting PMC. */ if (pm->pm_state != PMC_STATE_RUNNING) @@ -573,9 +485,9 @@ armv7_pcpu_init(struct pmc_mdep *md, int } /* Enable unit */ - pmnc = armv7_pmnc_read(); + pmnc = cp15_pmcr_get(); pmnc |= ARMV7_PMNC_ENABLE; - armv7_pmnc_write(pmnc); + cp15_pmcr_set(pmnc); return 0; } @@ -585,9 +497,9 @@ armv7_pcpu_fini(struct pmc_mdep *md, int { uint32_t pmnc; - pmnc = armv7_pmnc_read(); + pmnc = cp15_pmcr_get(); pmnc &= ~ARMV7_PMNC_ENABLE; - armv7_pmnc_write(pmnc); + cp15_pmcr_set(pmnc); return 0; } @@ -599,7 +511,7 @@ pmc_armv7_initialize() struct pmc_classdep *pcd; int reg; - reg = armv7_pmnc_read(); + reg = cp15_pmcr_get(); armv7_npmcs = (reg >> ARMV7_PMNC_N_SHIFT) & \ ARMV7_PMNC_N_MASK; From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 18:59:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F39805B9; Sat, 28 Mar 2015 18:59:11 +0000 (UTC) Received: from mail-la0-x22b.google.com (mail-la0-x22b.google.com [IPv6:2a00:1450:4010:c03::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 740B593C; Sat, 28 Mar 2015 18:59:11 +0000 (UTC) Received: by lagg8 with SMTP id g8so92085072lag.1; Sat, 28 Mar 2015 11:59: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=bH0+YS5ArTVXDQ4R/M7ak5e2a7oL4WoSvAZExMvLqgU=; b=HYiGEY0Upf8nGGX0i6fLtAJ9WaW5ALwQ9cbzJdL+iViqG0wQT7c0BZBcdjHffoTLr1 gSbPESf1LC6JbE1C8+dbrG+LBi1Yr08nFzHjWuC914TuHnlNJ432NxIaxHWcg8Gmk+r9 /O+dUnxUR9LDe20LlK4ZBU0KWMgQNVCAlc+Dj7o/KDetisJ522oo50wjiodOE8rILlpn By3clEKAoF3U+YxNMaudimf5a0ZQJpYX841hQ9URr6azNM6bB84N25A9pUAHBc0Bu8N/ b6csOR45UemvlDmB72i0cThwBZle53FkBMNCjz743ua8IUsfxYaISx9WeY3/GxqwA5NZ pUwA== MIME-Version: 1.0 X-Received: by 10.152.179.139 with SMTP id dg11mr22512627lac.28.1427569149130; Sat, 28 Mar 2015 11:59:09 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.25.66.3 with HTTP; Sat, 28 Mar 2015 11:59:09 -0700 (PDT) In-Reply-To: <201503281250.t2SCoOkt020297@svn.freebsd.org> References: <201503281250.t2SCoOkt020297@svn.freebsd.org> Date: Sat, 28 Mar 2015 11:59:09 -0700 X-Google-Sender-Auth: vLAy_MdoO7_bCV_zgzdiPIH9-z0 Message-ID: Subject: Re: svn commit: r280785 - in head/sys: kern netgraph/atm/sscop netgraph/atm/uni sys From: Davide Italiano To: Randall Stewart 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-1 Precedence: list List-Id: SVN 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 Mar 2015 18:59:12 -0000 On Sat, Mar 28, 2015 at 5:50 AM, Randall Stewart wrote: > Author: rrs > Date: Sat Mar 28 12:50:24 2015 > New Revision: 280785 > URL: https://svnweb.freebsd.org/changeset/base/280785 > > Log: > Change the callout to supply -1 to indicate we are not changing > CPU, also add protection against invalid CPU's as well as > split c_flags and c_iflags so that if a user plays with the active > flag (the one expected to be played with by callers in MPSAFE) without > a lock, it won't adversely affect the callout system by causing a corrupt > list. This also means that all callers need to use the macros and *not* > play with the falgs directly (like netgraph used to). > trim [...] > Modified: head/sys/sys/_callout.h > ============================================================================== > --- head/sys/sys/_callout.h Sat Mar 28 12:23:15 2015 (r280784) > +++ head/sys/sys/_callout.h Sat Mar 28 12:50:24 2015 (r280785) > @@ -57,7 +57,8 @@ struct callout { > void *c_arg; /* function argument */ > void (*c_func)(void *); /* function to call */ > struct lock_object *c_lock; /* lock to handle */ > - int c_flags; /* state of this entry */ > + int c_flags; /* User State */ > + int c_iflags; /* Internal State */ > volatile int c_cpu; /* CPU we're scheduled on */ > }; > I skimmed this quickly, and I'm afraid I think this breaks the KBI, increasing size of struct callout. That said, if it's true and you agree, you should at least bump FreeBSD version number. In an ideal world, you should avoid breaking for bugfixes and not architecural changes. -- Davide From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 19:01:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93DD571A; Sat, 28 Mar 2015 19:01:27 +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 45B489E1; Sat, 28 Mar 2015 19:01: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 27E1625D3A97; Sat, 28 Mar 2015 19:01:23 +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 BAA13C7707C; Sat, 28 Mar 2015 19:01:22 +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 0ScPqVeQqxDo; Sat, 28 Mar 2015 19:01:21 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f40b:6d60:9f0a:8c25] (unknown [IPv6:fde9:577b:c1a9:4410:f40b:6d60:9f0a:8c25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 1B867C7700C; Sat, 28 Mar 2015 19:01:20 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r280790 - in head/sys: conf dev/hwpmc From: "Bjoern A. Zeeb" In-Reply-To: <201503281857.t2SIvErQ096549@svn.freebsd.org> Date: Sat, 28 Mar 2015 19:01:20 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201503281857.t2SIvErQ096549@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.2070.6) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 19:01:27 -0000 > On 28 Mar 2015, at 18:57 , Bjoern A. Zeeb wrote: >=20 > Author: bz > Date: Sat Mar 28 18:57:13 2015 > New Revision: 280790 > URL: https://svnweb.freebsd.org/changeset/base/280790 >=20 > Log: > Remove all the handcrafted assembly in hwpmc_armv7.c and use the > common (autogenerated) versions. Removes extra vertical space, > and makes it easier to grep for usage throughout the tree. > Conditionally compile only for arm6 [1] (yes sounds odd but is = right). >=20 > Submitted by: andrew [1] > Reviewed by: gnn, andrew (ian earlier version I think) and ian (I missed the official review for the latest version; sorry) > Differential Revision: https://reviews.freebsd.org/D2159 > Obtained from: Cambridge/L41 > Sponsored by: DARPA, AFRL >=20 > Modified: > head/sys/conf/files.arm > head/sys/dev/hwpmc/hwpmc_armv7.c =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 19:16:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5DB0D70; Sat, 28 Mar 2015 19:16: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)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D66A4B60; Sat, 28 Mar 2015 19:16:31 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2SJGTVL032220 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 28 Mar 2015 22:16:29 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2SJGTJh032219; Sat, 28 Mar 2015 22:16:29 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 28 Mar 2015 22:16:29 +0300 From: Gleb Smirnoff To: Fabien Thomas Subject: Re: svn commit: r280759 - head/sys/netinet Message-ID: <20150328191629.GY64665@FreeBSD.org> References: <201503271326.t2RDQxd3056112@svn.freebsd.org> <20150328083443.GV64665@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="TBNym+cBXeFsS4Vs" Content-Disposition: inline In-Reply-To: <20150328083443.GV64665@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-1 Precedence: list List-Id: SVN 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 Mar 2015 19:16:32 -0000 --TBNym+cBXeFsS4Vs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Mar 28, 2015 at 11:34:43AM +0300, Gleb Smirnoff wrote: T> On Fri, Mar 27, 2015 at 01:26:59PM +0000, Fabien Thomas wrote: T> F> Author: fabient T> F> Date: Fri Mar 27 13:26:59 2015 T> F> New Revision: 280759 T> F> URL: https://svnweb.freebsd.org/changeset/base/280759 T> F> T> F> Log: T> F> On multi CPU systems, we may emit successive packets with the same id. T> F> Fix the race by using an atomic operation. T> F> T> F> Differential Revision: https://reviews.freebsd.org/D2141 T> F> Obtained from: emeric.poupon@stormshield.eu T> F> MFC after: 1 week T> F> Sponsored by: Stormshield T> T> The D2141 says that benchmarking were done in presence of IPSEC, which T> of course is the bottleneck and performance of this instruction can't T> be benchmarked in its presence. Anyway, I believe that results of T> right benchmark would still show little difference between atomic and T> non-atomic increment of a shared value. T> T> I think we can use per-cpu ID counters, each CPU incrementing its T> own. If we start with random values, then probability of two packets with T> the same ID emitting at the allowed timeframe will be acceptably small. Here I've made a patch. It will apply only to fresh head, though. To apply it to stable/10 you probably need to replay these two commits before: r280787, r280788. I'd appreciate if you test it in your environments, where you observed IP id collisions. -- Totus tuus, Glebius. --TBNym+cBXeFsS4Vs Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="ip_newid-pcpu.diff" Index: ip_id.c =================================================================== --- ip_id.c (revision 280788) +++ ip_id.c (working copy) @@ -74,9 +74,10 @@ * enabled. */ -#include +#include +#include +#include #include -#include #include #include #include @@ -83,7 +84,7 @@ #include #include #include -#include +#include #include #include @@ -92,8 +93,10 @@ #include #include +/* + * Random ID state engine. + */ static MALLOC_DEFINE(M_IPID, "ipid", "randomized ip id state"); - static VNET_DEFINE(uint16_t *, id_array); static VNET_DEFINE(bitstr_t *, id_bits); static VNET_DEFINE(int, array_ptr); @@ -109,6 +112,12 @@ #define V_random_id_total VNET(random_id_total) #define V_ip_id_mtx VNET(ip_id_mtx) +/* + * Non-random ID state engine is simply a per-cpu counter. + */ +static VNET_DEFINE(counter_u64_t, ip_id); +#define V_ip_id VNET(ip_id) + static void ip_initid(int); static int sysctl_ip_id_change(SYSCTL_HANDLER_ARGS); static void ipid_sysinit(void); @@ -191,6 +200,14 @@ return (new_id); } +uint16_t +ip_newid(void) +{ + + counter_u64_add(V_ip_id, 1); + return (htons((*(uint64_t *)zpcpu_get(V_ip_id)) & 0xffff)); +} + static void ipid_sysinit(void) { @@ -197,6 +214,9 @@ mtx_init(&V_ip_id_mtx, "ip_id_mtx", NULL, MTX_DEF); ip_initid(8192); + V_ip_id = counter_u64_alloc(M_WAITOK); + for (int i = 0; i < mp_ncpus; i++) + arc4rand(zpcpu_get_cpu(V_ip_id, i), sizeof(uint64_t), 0); } VNET_SYSINIT(ip_id, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, ipid_sysinit, NULL); @@ -207,5 +227,6 @@ mtx_destroy(&V_ip_id_mtx); free(V_id_array, M_IPID); free(V_id_bits, M_IPID); + counter_u64_free(V_ip_id); } VNET_SYSUNINIT(ip_id, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, ipid_sysuninit, NULL); Index: ip_input.c =================================================================== --- ip_input.c (revision 280779) +++ ip_input.c (working copy) @@ -331,8 +331,6 @@ struct protosw *pr; int i; - V_ip_id = time_second & 0xffff; - TAILQ_INIT(&V_in_ifaddrhead); V_in_ifaddrhashtbl = hashinit(INADDR_NHASH, M_IFADDR, &V_in_ifaddrhmask); Index: ip_output.c =================================================================== --- ip_output.c (revision 280779) +++ ip_output.c (working copy) @@ -91,8 +91,6 @@ #include -VNET_DEFINE(uint32_t, ip_id); - #ifdef MBUF_STRESS_TEST static int mbuf_frag_size = 0; SYSCTL_INT(_net_inet_ip, OID_AUTO, mbuf_frag_size, CTLFLAG_RW, Index: ip_var.h =================================================================== --- ip_var.h (revision 280779) +++ ip_var.h (working copy) @@ -174,7 +174,6 @@ struct route; struct sockopt; -VNET_DECLARE(uint32_t, ip_id); /* ip packet ctr, for ids */ VNET_DECLARE(int, ip_defttl); /* default IP ttl */ VNET_DECLARE(int, ipforwarding); /* ip forwarding */ #ifdef IPSTEALTH @@ -229,6 +228,7 @@ struct mbuf *); void ip_slowtimo(void); uint16_t ip_randomid(void); +uint16_t ip_newid(void); int rip_ctloutput(struct socket *, struct sockopt *); void rip_ctlinput(int, struct sockaddr *, void *); void rip_init(void); @@ -305,19 +305,7 @@ VNET_DECLARE(int, ip_do_randomid); #define V_ip_do_randomid VNET(ip_do_randomid) -static __inline uint16_t -ip_newid(void) -{ - uint16_t res; - if (V_ip_do_randomid != 0) - return (ip_randomid()); - else { - res = atomic_fetchadd_32(&V_ip_id, 1) & 0xFFFF; - return (htons(res)); - } -} - #endif /* _KERNEL */ #endif /* !_NETINET_IP_VAR_H_ */ --TBNym+cBXeFsS4Vs-- From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 19:34:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 953B04BF; Sat, 28 Mar 2015 19:34:01 +0000 (UTC) Received: from relay.mailchannels.net (aso-006-i440.relay.mailchannels.net [23.91.64.121]) by mx1.freebsd.org (Postfix) with ESMTP id 61CE4D4C; Sat, 28 Mar 2015 19:33:59 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp4.ore.mailhop.org (ip-10-33-12-218.us-west-2.compute.internal [10.33.12.218]) by relay.mailchannels.net (Postfix) with ESMTPA id 9F2F01205A7; Sat, 28 Mar 2015 19:33:52 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp4.ore.mailhop.org (smtp4.ore.mailhop.org [10.45.8.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Sat, 28 Mar 2015 19:33:52 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1427571232747:1848504596 X-MC-Ingress-Time: 1427571232747 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp4.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YbwUQ-0005Re-GI; Sat, 28 Mar 2015 19:33:50 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2SJXnTk052752; Sat, 28 Mar 2015 13:33:49 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX18b7Pz4VYq2PSkNzUaGWksy Message-ID: <1427571229.20823.1.camel@freebsd.org> Subject: Re: svn commit: r280790 - in head/sys: conf dev/hwpmc From: Ian Lepore To: "Bjoern A. Zeeb" Date: Sat, 28 Mar 2015 13:33:49 -0600 In-Reply-To: References: <201503281857.t2SIvErQ096549@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie Cc: svn-src-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-1 Precedence: list List-Id: SVN 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 Mar 2015 19:34:01 -0000 On Sat, 2015-03-28 at 19:01 +0000, Bjoern A. Zeeb wrote: > > On 28 Mar 2015, at 18:57 , Bjoern A. Zeeb wrote: > > > > Author: bz > > Date: Sat Mar 28 18:57:13 2015 > > New Revision: 280790 > > URL: https://svnweb.freebsd.org/changeset/base/280790 > > > > Log: > > Remove all the handcrafted assembly in hwpmc_armv7.c and use the > > common (autogenerated) versions. Removes extra vertical space, > > and makes it easier to grep for usage throughout the tree. > > Conditionally compile only for arm6 [1] (yes sounds odd but is right). > > > > Submitted by: andrew [1] > > Reviewed by: gnn, andrew (ian earlier version I think) > > and ian (I missed the official review for the latest version; sorry) > No problem. IMO, if a commit references a phab revision, there's no need to list individual reviewers as well, since the phab info already contains all that. -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 19:59:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EA18D1E; Sat, 28 Mar 2015 19: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEC95F85; Sat, 28 Mar 2015 19:59:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SJxYX2025687; Sat, 28 Mar 2015 19:59:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SJxYOW025686; Sat, 28 Mar 2015 19:59:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503281959.t2SJxYOW025686@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 28 Mar 2015 19:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280791 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 19:59:35 -0000 Author: adrian Date: Sat Mar 28 19:59:33 2015 New Revision: 280791 URL: https://svnweb.freebsd.org/changeset/base/280791 Log: Add the MAC address hints for arge0/arge1 on the CARAMBOLA2. Obtained from: Linux OpenWRT Modified: head/sys/mips/conf/CARAMBOLA2.hints Modified: head/sys/mips/conf/CARAMBOLA2.hints ============================================================================== --- head/sys/mips/conf/CARAMBOLA2.hints Sat Mar 28 18:57:13 2015 (r280790) +++ head/sys/mips/conf/CARAMBOLA2.hints Sat Mar 28 19:59:33 2015 (r280791) @@ -23,11 +23,13 @@ hint.arswitch.0.is_gmii=1 # arge1 <-> sw # arge0 - MII, autoneg, phy(4) hint.arge.0.phymask=0x10 # PHY4 hint.arge.0.mdio=mdioproxy1 # .. off of the switch mdiobus +hint.arge.0.eeprommac=0x1fff0000 # arge1 - GMII, 1000/full hint.arge.1.phymask=0x0 # No directly mapped PHYs hint.arge.1.media=1000 hint.arge.1.fduplex=1 +hint.arge.1.eeprommac=0x1fff0006 # Where the ART is - last 64k in the flash # 0x9fff1000 ? From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 20:43:35 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1906CB18; Sat, 28 Mar 2015 20:43:35 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E6BD7763; Sat, 28 Mar 2015 20:43:34 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t2SKhX9K040665 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Mar 2015 13:43:33 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t2SKhX48040664; Sat, 28 Mar 2015 13:43:33 -0700 (PDT) (envelope-from jmg) Date: Sat, 28 Mar 2015 13:43:33 -0700 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r280759 - head/sys/netinet Message-ID: <20150328204333.GF51048@funkthat.com> References: <201503271326.t2RDQxd3056112@svn.freebsd.org> <20150328083443.GV64665@FreeBSD.org> <20150328172313.GC51048@funkthat.com> <20150328181833.GX64665@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150328181833.GX64665@FreeBSD.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 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? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sat, 28 Mar 2015 13:43:34 -0700 (PDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Fabien Thomas X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 20:43:35 -0000 Gleb Smirnoff wrote this message on Sat, Mar 28, 2015 at 21:18 +0300: > On Sat, Mar 28, 2015 at 10:23:13AM -0700, John-Mark Gurney wrote: > J> > On Fri, Mar 27, 2015 at 01:26:59PM +0000, Fabien Thomas wrote: > J> > F> Author: fabient > J> > F> Date: Fri Mar 27 13:26:59 2015 > J> > F> New Revision: 280759 > J> > F> URL: https://svnweb.freebsd.org/changeset/base/280759 > J> > F> > J> > F> Log: > J> > F> On multi CPU systems, we may emit successive packets with the same id. > J> > F> Fix the race by using an atomic operation. > J> > F> > J> > F> Differential Revision: https://reviews.freebsd.org/D2141 > J> > F> Obtained from: emeric.poupon@stormshield.eu > J> > F> MFC after: 1 week > J> > F> Sponsored by: Stormshield > J> > > J> > The D2141 says that benchmarking were done in presence of IPSEC, which > J> > of course is the bottleneck and performance of this instruction can't > J> > be benchmarked in its presence. Anyway, I believe that results of > J> > right benchmark would still show little difference between atomic and > J> > non-atomic increment of a shared value. > J> > > J> > I think we can use per-cpu ID counters, each CPU incrementing its > J> > own. If we start with random values, then probability of two packets with > J> > the same ID emitting at the allowed timeframe will be acceptably small. > J> > J> Please do not use per-cpu id counters.. That will just push the > J> duplicate ids to being more rare, but just as much of a problem... > J> > J> Please read: > J> https://tools.ietf.org/html/rfc6864 > J> > J> And then implement one hased upon source/dest/protocol... > > I know about this RFC, but using per-cpu ID counter if a low hanging > fruit and is improvement. What is important not only improvement in > terms of lowering probability of collision, but also easy improvement in > performance, since now global ip_id increment is a cache line thrasher. > > So, I don't see how existense of the RFC blocks introducing an easy > improvement. And if anyone works on implementing the RFC, he shouldn't > care what is in head before his work, either global or per-cpu counter. Your comment: "fix the race", to me reads that it was a final solution, not simply a stop gap... If you had simply said that this is a stop gap till someone properly implements RFC6864, that would make it obvious that you were aware of it.. Nothing in your commit message said that you were aware that this wasn't the correct final solution... Information like that should be included in the commit message so people don't assume that this is the final solution... Anyways, are we really sending so many fragments that we are thrashing the cache line? I'd imagine a much lower hanging fruit is only provide ip_id when a non-atomic packet is being sent... -- 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 28 20:48:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7F2ED07; Sat, 28 Mar 2015 20:48:51 +0000 (UTC) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com [IPv6:2a00:1450:4010:c04::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56A1F7B5; Sat, 28 Mar 2015 20:48:51 +0000 (UTC) Received: by lbbug6 with SMTP id ug6so84387755lbb.3; Sat, 28 Mar 2015 13:48:49 -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=zvnTn6GEkzPXfpsdzeuvF1DDsoG08X3TNGhNuNcAVHM=; b=L4WlsnYt2PyNpusJCZncmGyUDhC8mD5W0I57zqvVlo+eI0Sb9MYTn85xwIyub2pruB FdvQ1z2GfGgCaivZQcVJZMudeSjnr/GjGQFuL9fn0LaUzc3rYoILinJW8W1NN5KK66GB FCXISJrZ6VLuJ5LSLPqi/X0MCxPJcrlVQchPvEQpMUCpS1dxkjWRX8eLQBbE0rDPTRW8 nvbP5psGyuY2uGAsU/IgkrsHmDeia7/J/JHR++/9t4nMmFa8HIknfM3zXrb7QYgjn4B/ YhPRnSSRY/KP/Vqk7p+ikNYniYugx7EnA8CJRxk4sMCB2THFlWmCDS2R1PlBCyUl8X+C 2pCg== MIME-Version: 1.0 X-Received: by 10.152.197.34 with SMTP id ir2mr22647768lac.36.1427575729402; Sat, 28 Mar 2015 13:48:49 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.25.66.3 with HTTP; Sat, 28 Mar 2015 13:48:49 -0700 (PDT) In-Reply-To: <4E7E0A0A-5125-4F3A-AC0C-D428A972C954@netflix.com> References: <201503281250.t2SCoOkt020297@svn.freebsd.org> <4E7E0A0A-5125-4F3A-AC0C-D428A972C954@netflix.com> Date: Sat, 28 Mar 2015 13:48:49 -0700 X-Google-Sender-Auth: 37bm3_91U9W0TZW_1SvKN9DesQA Message-ID: Subject: Re: svn commit: r280785 - in head/sys: kern netgraph/atm/sscop netgraph/atm/uni sys From: Davide Italiano To: Randall Stewart 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-1 Precedence: list List-Id: SVN 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 Mar 2015 20:48:52 -0000 On Sat, Mar 28, 2015 at 12:04 PM, Randall Stewart wrote: > Hmm does the KPI include the size of the callout structure (which is > private)? > It's KBI, not KPI. > If so I suppose we could change the c_flags/c_iflags to > ushort =E2=80=A6 > I'm not familiar with your changes enough to suggest/propose a fix. As I previously mentioned, this looks suspicious KBI-wise to me, and I reported to you. --=20 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 Sat Mar 28 21:21:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 264CA64D; Sat, 28 Mar 2015 21: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07ECFB8A; Sat, 28 Mar 2015 21:21:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SLLe82067874; Sat, 28 Mar 2015 21:21:40 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SLLeW8067873; Sat, 28 Mar 2015 21:21:40 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201503282121.t2SLLeW8067873@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 28 Mar 2015 21:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280792 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:21:41 -0000 Author: vangyzen Date: Sat Mar 28 21:21:40 2015 New Revision: 280792 URL: https://svnweb.freebsd.org/changeset/base/280792 Log: Clean up some cosmetic nits in kern_umtx.c, found during recent work in this area and by the Clang static analyzer. Remove some dead assignments. Fix a typo in a panic string. Use umtx_pi_disown() instead of duplicate code. Use an existing variable instead of curthread. Approved by: kib (mentor) MFC after: 3 days Sponsored by: Dell Inc Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Sat Mar 28 19:59:33 2015 (r280791) +++ head/sys/kern/kern_umtx.c Sat Mar 28 21:21:40 2015 (r280792) @@ -912,7 +912,7 @@ kern_umtx_wake(struct thread *td, void * is_private ? THREAD_SHARE : AUTO_SHARE, &key)) != 0) return (ret); umtxq_lock(&key); - ret = umtxq_signal(&key, n_wake); + umtxq_signal(&key, n_wake); umtxq_unlock(&key); umtx_key_release(&key); return (0); @@ -1440,7 +1440,7 @@ umtx_pi_setowner(struct umtx_pi *pi, str uq_owner = owner->td_umtxq; mtx_assert(&umtx_lock, MA_OWNED); if (pi->pi_owner != NULL) - panic("pi_ower != NULL"); + panic("pi_owner != NULL"); pi->pi_owner = owner; TAILQ_INSERT_TAIL(&uq_owner->uq_pi_contested, pi, pi_link); } @@ -1464,9 +1464,8 @@ umtx_pi_disown(struct umtx_pi *pi) static int umtx_pi_claim(struct umtx_pi *pi, struct thread *owner) { - struct umtx_q *uq, *uq_owner; + struct umtx_q *uq; - uq_owner = owner->td_umtxq; mtx_lock(&umtx_lock); if (pi->pi_owner == owner) { mtx_unlock(&umtx_lock); @@ -1612,11 +1611,8 @@ umtx_pi_unref(struct umtx_pi *pi) KASSERT(pi->pi_refcount > 0, ("invalid reference count")); if (--pi->pi_refcount == 0) { mtx_lock(&umtx_lock); - if (pi->pi_owner != NULL) { - TAILQ_REMOVE(&pi->pi_owner->td_umtxq->uq_pi_contested, - pi, pi_link); - pi->pi_owner = NULL; - } + if (pi->pi_owner != NULL) + umtx_pi_disown(pi); KASSERT(TAILQ_EMPTY(&pi->pi_blocked), ("blocked queue not empty")); mtx_unlock(&umtx_lock); @@ -1876,7 +1872,7 @@ do_unlock_pi(struct thread *td, struct u mtx_lock(&umtx_lock); pi = uq_first->uq_pi_blocked; KASSERT(pi != NULL, ("pi == NULL?")); - if (pi->pi_owner != curthread) { + if (pi->pi_owner != td) { mtx_unlock(&umtx_lock); umtxq_unbusy(&key); umtxq_unlock(&key); @@ -1884,7 +1880,7 @@ do_unlock_pi(struct thread *td, struct u /* userland messed the mutex */ return (EPERM); } - uq_me = curthread->td_umtxq; + uq_me = td->td_umtxq; umtx_pi_disown(pi); /* get highest priority thread which is still sleeping. */ uq_first = TAILQ_FIRST(&pi->pi_blocked); @@ -1900,9 +1896,9 @@ do_unlock_pi(struct thread *td, struct u pri = UPRI(uq_first2->uq_thread); } } - thread_lock(curthread); - sched_lend_user_prio(curthread, pri); - thread_unlock(curthread); + thread_lock(td); + sched_lend_user_prio(td, pri); + thread_unlock(td); mtx_unlock(&umtx_lock); if (uq_first) umtxq_signal_thread(uq_first); From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 21:28:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDC038C6; Sat, 28 Mar 2015 21: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 90CA6BC8; Sat, 28 Mar 2015 21:28:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SLSN36068873; Sat, 28 Mar 2015 21:28:23 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SLSNg3068870; Sat, 28 Mar 2015 21:28:23 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201503282128.t2SLSNg3068870@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 28 Mar 2015 21:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280793 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 21:28:23 -0000 Author: vangyzen Date: Sat Mar 28 21:28:22 2015 New Revision: 280793 URL: https://svnweb.freebsd.org/changeset/base/280793 Log: pmcstat.8: fix -a flag description; improve -m flag to match The -a flag reads a file saved by -O, not -o. The -m flag requires the -R flag. Copy that paragraph from -a. Reviewed by: adrian Approved by: kib (mentor) MFC after: 1 week Sponsored by: Dell Inc Modified: head/usr.sbin/pmcstat/pmcstat.8 head/usr.sbin/pmcstat/pmcstat.c Modified: head/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.8 Sat Mar 28 21:21:40 2015 (r280792) +++ head/usr.sbin/pmcstat/pmcstat.8 Sat Mar 28 21:28:22 2015 (r280793) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 27, 2014 +.Dd March 27, 2015 .Dt PMCSTAT 8 .Os .Sh NAME @@ -236,7 +236,7 @@ This option requires the .Fl R option to read in samples that were previously collected and saved with the -.Fl o +.Fl O option. .It Fl c Ar cpu-spec Set the cpus for subsequent system mode PMCs specified on the @@ -301,6 +301,12 @@ is a this information is sent to the output file specified by the .Fl o option. +This option requires the +.Fl R +option to read in samples that were previously collected and +saved with the +.Fl O +option. .It Fl n Ar rate Set the default sampling rate for subsequent sampling mode PMCs specified on the command line. Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Sat Mar 28 21:21:40 2015 (r280792) +++ head/usr.sbin/pmcstat/pmcstat.c Sat Mar 28 21:28:22 2015 (r280793) @@ -940,7 +940,7 @@ main(int argc, char **argv) errx(EX_USAGE, "ERROR: options -T and -l are mutually " "exclusive."); - /* -m option is allowed with -R only. */ + /* -a and -m require -R */ if (args.pa_flags & FLAG_DO_ANNOTATE && args.pa_inputpath == NULL) errx(EX_USAGE, "ERROR: option %s requires an input file", args.pa_plugin == PMCSTAT_PL_ANNOTATE ? "-m" : "-a"); From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 21:34:08 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47A66A4B; Sat, 28 Mar 2015 21:34:08 +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 F164CC79; Sat, 28 Mar 2015 21:34:07 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YbyMm-0002N8-2e; Sun, 29 Mar 2015 00:34:04 +0300 Date: Sun, 29 Mar 2015 00:34:04 +0300 From: Slawa Olhovchenkov To: John-Mark Gurney Subject: Re: svn commit: r280759 - head/sys/netinet Message-ID: <20150328213403.GB74532@zxy.spb.ru> References: <201503271326.t2RDQxd3056112@svn.freebsd.org> <20150328083443.GV64665@FreeBSD.org> <20150328172313.GC51048@funkthat.com> <20150328181833.GX64665@FreeBSD.org> <20150328204333.GF51048@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150328204333.GF51048@funkthat.com> User-Agent: Mutt/1.5.23 (2014-03-12) 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, Gleb Smirnoff , src-committers@FreeBSD.org, Fabien Thomas X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 21:34:08 -0000 On Sat, Mar 28, 2015 at 01:43:33PM -0700, John-Mark Gurney wrote: > Gleb Smirnoff wrote this message on Sat, Mar 28, 2015 at 21:18 +0300: > > On Sat, Mar 28, 2015 at 10:23:13AM -0700, John-Mark Gurney wrote: > > J> > On Fri, Mar 27, 2015 at 01:26:59PM +0000, Fabien Thomas wrote: > > J> > F> Author: fabient > > J> > F> Date: Fri Mar 27 13:26:59 2015 > > J> > F> New Revision: 280759 > > J> > F> URL: https://svnweb.freebsd.org/changeset/base/280759 > > J> > F> > > J> > F> Log: > > J> > F> On multi CPU systems, we may emit successive packets with the same id. > > J> > F> Fix the race by using an atomic operation. > > J> > F> > > J> > F> Differential Revision: https://reviews.freebsd.org/D2141 > > J> > F> Obtained from: emeric.poupon@stormshield.eu > > J> > F> MFC after: 1 week > > J> > F> Sponsored by: Stormshield > > J> > > > J> > The D2141 says that benchmarking were done in presence of IPSEC, which > > J> > of course is the bottleneck and performance of this instruction can't > > J> > be benchmarked in its presence. Anyway, I believe that results of > > J> > right benchmark would still show little difference between atomic and > > J> > non-atomic increment of a shared value. > > J> > > > J> > I think we can use per-cpu ID counters, each CPU incrementing its > > J> > own. If we start with random values, then probability of two packets with > > J> > the same ID emitting at the allowed timeframe will be acceptably small. > > J> > > J> Please do not use per-cpu id counters.. That will just push the > > J> duplicate ids to being more rare, but just as much of a problem... > > J> > > J> Please read: > > J> https://tools.ietf.org/html/rfc6864 > > J> > > J> And then implement one hased upon source/dest/protocol... > > > > I know about this RFC, but using per-cpu ID counter if a low hanging > > fruit and is improvement. What is important not only improvement in > > terms of lowering probability of collision, but also easy improvement in > > performance, since now global ip_id increment is a cache line thrasher. > > > > So, I don't see how existense of the RFC blocks introducing an easy > > improvement. And if anyone works on implementing the RFC, he shouldn't > > care what is in head before his work, either global or per-cpu counter. > > Your comment: "fix the race", to me reads that it was a final solution, > not simply a stop gap... > > If you had simply said that this is a stop gap till someone properly > implements RFC6864, that would make it obvious that you were aware of > it.. Nothing in your commit message said that you were aware that this > wasn't the correct final solution... Information like that should be > included in the commit message so people don't assume that this is the > final solution... > > Anyways, are we really sending so many fragments that we are thrashing > the cache line? I'd imagine a much lower hanging fruit is only provide > ip_id when a non-atomic packet is being sent... In this case may be do range allocation of ID (per-CPU)? For example, allocate 128 ID, not one ID? From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 21:39:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B51A2DBB; Sat, 28 Mar 2015 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 A0878CD4; Sat, 28 Mar 2015 21:39:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SLdhaU073691; Sat, 28 Mar 2015 21:39:43 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SLdhjw073690; Sat, 28 Mar 2015 21:39:43 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201503282139.t2SLdhjw073690@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 28 Mar 2015 21:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280794 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN 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 Mar 2015 21:39:43 -0000 Author: jhibbits Date: Sat Mar 28 21:39:42 2015 New Revision: 280794 URL: https://svnweb.freebsd.org/changeset/base/280794 Log: Wrap #ifdef guards around pmap_bootstrap ap. It's only used in SMP, and building without SMP causes a build failure. MFC after: 1 month Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Mar 28 21:28:22 2015 (r280793) +++ head/sys/powerpc/booke/pmap.c Sat Mar 28 21:39:42 2015 (r280794) @@ -262,7 +262,9 @@ static vm_offset_t ptbl_buf_pool_vabase; /* Pointer to ptbl_buf structures. */ static struct ptbl_buf *ptbl_bufs; +#ifdef SMP void pmap_bootstrap_ap(volatile uint32_t *); +#endif /* * Kernel MMU interface @@ -1329,6 +1331,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf("mmu_booke_bootstrap: exit\n"); } +#ifdef SMP void pmap_bootstrap_ap(volatile uint32_t *trcp __unused) { @@ -1349,6 +1352,7 @@ pmap_bootstrap_ap(volatile uint32_t *trc set_mas4_defaults(); } +#endif /* * Get the physical page address for the given pmap/virtual address. From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 23:02:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0E415BA; Sat, 28 Mar 2015 23: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 CC946817; Sat, 28 Mar 2015 23:02:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SN20Tp014997; Sat, 28 Mar 2015 23:02:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SN20Kd014996; Sat, 28 Mar 2015 23:02:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503282302.t2SN20Kd014996@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 28 Mar 2015 23:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280795 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:02:01 -0000 Author: adrian Date: Sat Mar 28 23:01:59 2015 New Revision: 280795 URL: https://svnweb.freebsd.org/changeset/base/280795 Log: Remove the second MODULES_OVERRIDE; add if_vlan to the list. Modified: head/sys/mips/conf/AR933X_BASE Modified: head/sys/mips/conf/AR933X_BASE ============================================================================== --- head/sys/mips/conf/AR933X_BASE Sat Mar 28 21:39:42 2015 (r280794) +++ head/sys/mips/conf/AR933X_BASE Sat Mar 28 23:01:59 2015 (r280795) @@ -20,8 +20,7 @@ files "../atheros/files.ar71xx" hints "AR933X_BASE.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr hwpmc ipfw" -makeoptions MODULES_OVERRIDE="" +makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_vlan if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr hwpmc ipfw" options DDB options KDB From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 23:20:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C2B8A8D; Sat, 28 Mar 2015 23:20: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 EB3F597F; Sat, 28 Mar 2015 23:20:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SNKljd022235; Sat, 28 Mar 2015 23:20:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SNKlPd022234; Sat, 28 Mar 2015 23:20:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503282320.t2SNKlPd022234@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 28 Mar 2015 23:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280796 - 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.18-1 Precedence: list List-Id: SVN 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 Mar 2015 23:20:48 -0000 Author: adrian Date: Sat Mar 28 23:20:46 2015 New Revision: 280796 URL: https://svnweb.freebsd.org/changeset/base/280796 Log: Turns out the AR933x looks like the AR7240/AR7241 switch as far as VLAN configuration is concerned. So, remove the now-erroneous comment. Tested: * AR9331 - Carambola2, with transmitting dot1q tagged packets around. Modified: head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_vlans.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Sat Mar 28 23:01:59 2015 (r280795) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Sat Mar 28 23:20:46 2015 (r280796) @@ -51,7 +51,6 @@ #include "etherswitch_if.h" /* - * XXX TODO: teach about the AR933x SoC switch * XXX TODO: teach about the AR934x SoC switch */ From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 23:30:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A560D89; Sat, 28 Mar 2015 23:30: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 56381B53; Sat, 28 Mar 2015 23:30:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SNUqvp027824; Sat, 28 Mar 2015 23:30:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SNUqkc027823; Sat, 28 Mar 2015 23:30:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503282330.t2SNUqkc027823@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 28 Mar 2015 23:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280797 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:30:52 -0000 Author: kib Date: Sat Mar 28 23:30:51 2015 New Revision: 280797 URL: https://svnweb.freebsd.org/changeset/base/280797 Log: Make debug.vmem_check a tunable. It is useful to set it early. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Sat Mar 28 23:20:46 2015 (r280796) +++ head/sys/kern/subr_vmem.c Sat Mar 28 23:30:51 2015 (r280797) @@ -172,7 +172,7 @@ struct vmem_btag { #if defined(DIAGNOSTIC) static int enable_vmem_check = 1; -SYSCTL_INT(_debug, OID_AUTO, vmem_check, CTLFLAG_RW, +SYSCTL_INT(_debug, OID_AUTO, vmem_check, CTLFLAG_RWTUN, &enable_vmem_check, 0, "Enable vmem check"); static void vmem_check(vmem_t *); #endif From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 23:40:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC7DEFCE; Sat, 28 Mar 2015 23: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 A60EFC3E; Sat, 28 Mar 2015 23:40:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SNeVHh031781; Sat, 28 Mar 2015 23:40:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SNeUXf031777; Sat, 28 Mar 2015 23:40:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503282340.t2SNeUXf031777@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 28 Mar 2015 23:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280798 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:40:31 -0000 Author: adrian Date: Sat Mar 28 23:40:29 2015 New Revision: 280798 URL: https://svnweb.freebsd.org/changeset/base/280798 Log: Begin moving support for board MAC addresses over to being explicitly defined. A lot of these dinky atheros based MIPS boards don't have a nice, well, anything consistent defining their MAC addresses for things. The Atheros reference design boards will happily put MAC addresses into the wifi module calibration data like they should, and individual ethernet MAC addresses into the calibration area in flash. That makes my life easy - "hint.arge.X.eeprommac=" reads from that flash address to extract a MAC, and everything works fine. However, aside from some very well behaved vendors (eg the Carambola 2 board), everyone else does something odd. eg: * a MAC address in the environment (eg ubiquiti routerstation/RSPRO) that you derive arge0/arge1 MAC addresses from. * a MAC address in flash that you derive arge0/arge1 MAC addresses from. * The wifi devices having their own MAC addresses in calibration data, like normal. * The wifi devices having a fixed, default or garbage value for a MAC address in calibration data, and it has to be derived from the system MAC. So to support this complete nonsense of a situation, there needs to be a few hacks: * The "board" MAC address needs to be derived from somewhere and squirreled away. For now it's either redboot or a MAC address stored in calibration flash. * Then, a "map" set of hints to populate kenv with some MAC addresses that are derived/local, based on the board address. Each board has a totally different idea of what you do to derive things, so each map entry has an "offset" (+ve or -ve) that's added to the board MAC address. * Then if_arge (and later, if_ath) should check kenv for said hint and if it's found, use that rather than the EEPROM MAC address - which may be totally garbage and not actually work right. In order to do this, I've undone some of the custom redboot expecting hacks in if_arge and the stuff that magically adds one to the MAC address supplied by the board - instead, as I continue to test this out on more hardware, I'll update the hints file with a map explaining (a) where the board MAC should come from, and (b) what offsets to use for each device. The aim is to have all of the tplink, dlink and other random hardware we run on have valid MAC addresses at boot, so (a) people don't get random B:S:D:x:x:x ethernet MACs, and (b) the wifi MAC is valid so it works rather than trying to use an invalid address that actually upsets systems (think: multicast bit set in BSSID.) Tested: * TP-Link TL_WDR3600 - subsequent commits will add the hints map and the if_ath support. TODO: * Since this is -HEAD, and I'm all for debugging, there's a lot of printf()s in here. They'll eventually go under bootverbose. * I'd like to turn the macaddr routines into something available to all drivers - too many places hand-roll random MAC addresses and parser stuff. I'd rather it just be shared code. However, that'll require more formal review. * More boards. Modified: head/sys/mips/atheros/ar71xx_macaddr.c head/sys/mips/atheros/ar71xx_macaddr.h head/sys/mips/atheros/ar71xx_machdep.c head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/ar71xx_macaddr.c ============================================================================== --- head/sys/mips/atheros/ar71xx_macaddr.c Sat Mar 28 23:30:51 2015 (r280797) +++ head/sys/mips/atheros/ar71xx_macaddr.c Sat Mar 28 23:40:29 2015 (r280798) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include /* @@ -40,6 +42,7 @@ __FBSDID("$FreeBSD$"); * device on-board, but instead need to derive them from a single MAC * address stored somewhere. */ +uint8_t ar71xx_board_mac_addr[ETHER_ADDR_LEN]; /* * Initialise a MAC address 'dst' from a MAC address 'src'. Modified: head/sys/mips/atheros/ar71xx_macaddr.h ============================================================================== --- head/sys/mips/atheros/ar71xx_macaddr.h Sat Mar 28 23:30:51 2015 (r280797) +++ head/sys/mips/atheros/ar71xx_macaddr.h Sat Mar 28 23:40:29 2015 (r280798) @@ -30,6 +30,8 @@ #ifndef __ATHEROS_AR71XX_MACADDR_H__ #define __ATHEROS_AR71XX_MACADDR_H__ +extern uint8_t ar71xx_board_mac_addr[ETHER_ADDR_LEN]; + extern int ar71xx_mac_addr_init(unsigned char *dst, const unsigned char *src, int offset, int is_local); extern int ar71xx_mac_addr_random_init(unsigned char *dst); Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Sat Mar 28 23:30:51 2015 (r280797) +++ head/sys/mips/atheros/ar71xx_machdep.c Sat Mar 28 23:40:29 2015 (r280798) @@ -56,12 +56,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include extern char edata[], end[]; -uint32_t ar711_base_mac[ETHER_ADDR_LEN]; /* 4KB static data aread to keep a copy of the bootload env until the dynamic kenv is setup */ char boot1_env[4096]; @@ -117,11 +117,13 @@ platform_reset(void) /* * Obtain the MAC address via the Redboot environment. */ -static void +static int ar71xx_redboot_get_macaddr(void) { char *var; - int count = 0; + int count = 0, i; + uint32_t macaddr[ETHER_ADDR_LEN]; + uint8_t tmpmac[ETHER_ADDR_LEN]; /* * "ethaddr" is passed via envp on RedBoot platforms @@ -130,14 +132,25 @@ ar71xx_redboot_get_macaddr(void) if ((var = kern_getenv("ethaddr")) != NULL || (var = kern_getenv("kmac")) != NULL) { count = sscanf(var, "%x%*c%x%*c%x%*c%x%*c%x%*c%x", - &ar711_base_mac[0], &ar711_base_mac[1], - &ar711_base_mac[2], &ar711_base_mac[3], - &ar711_base_mac[4], &ar711_base_mac[5]); - if (count < 6) - memset(ar711_base_mac, 0, - sizeof(ar711_base_mac)); + &macaddr[0], &macaddr[1], + &macaddr[2], &macaddr[3], + &macaddr[4], &macaddr[5]); + + if (count < 6) { + memset(macaddr, 0, + sizeof(macaddr)); + } else { + for (i = 0; i < ETHER_ADDR_LEN; i++) + tmpmac[i] = macaddr[i] & 0xff; + (void) ar71xx_mac_addr_init(ar71xx_board_mac_addr, + tmpmac, + 0, /* offset */ + 0); /* is_local */ + } freeenv(var); + return (0); } + return (-1); } #ifdef AR71XX_ENV_ROUTERBOOT @@ -168,6 +181,129 @@ ar71xx_routerboot_get_mem(int argc, char } #endif +/* + * Handle initialising the MAC address from a specific EEPROM + * offset. + * + * This is done during (very) early boot. + * + * hint.ar71xx.0.eeprom_mac_addr=
+ * hint.ar71xx.0.eeprom_mac_isascii=<0|1> + */ +static int +ar71xx_platform_read_eeprom_mac(void) +{ + long eeprom_mac_addr = 0; + const char *mac; + int i, readascii = 0; + uint8_t macaddr[ETHER_ADDR_LEN]; + + if (resource_long_value("ar71xx", 0, "eeprom_mac_addr", + &eeprom_mac_addr) != 0) + return (-1); + + /* get a pointer to the EEPROM MAC address */ + + mac = (const char *) MIPS_PHYS_TO_KSEG1(eeprom_mac_addr); + + /* Check if it's ASCII or not */ + if (resource_int_value("ar71xx", 0, "eeprom_mac_isascii", + &readascii) == 0 && readascii == 1) { + printf("ar71xx: Overriding MAC from EEPROM (ascii)\n"); + for (i = 0; i < 6; i++) { + macaddr[i] = strtol(&(mac[i*3]), NULL, 16); + } + } else { + printf("ar71xx: Overriding MAC from EEPROM\n"); + for (i = 0; i < 6; i++) { + macaddr[i] = mac[i]; + } + } + + /* Set the default board MAC */ + (void) ar71xx_mac_addr_init(ar71xx_board_mac_addr, + macaddr, + 0, /* offset */ + 0); /* is_local */ + printf("ar71xx: Board MAC: %6D\n", ar71xx_board_mac_addr, ":"); + return (0); +} + +/* + * Populate a kenv hint for the given device based on the given + * MAC address and offset. + * + * Returns 0 if ok, < 0 on error. + */ +static int +ar71xx_platform_set_mac_hint(const char *dev, int unit, + const uint8_t *macaddr, int offset, int islocal) +{ + char macstr[32]; + uint8_t lclmac[ETHER_ADDR_LEN]; + char devstr[32]; + + /* Initialise the MAC address, plus/minus the offset */ + if (ar71xx_mac_addr_init(lclmac, macaddr, offset, islocal) != 0) { + return (-1); + } + + /* Turn it into a string */ + snprintf(macstr, 32, "%6D", lclmac, ":"); + snprintf(devstr, 32, "hint.%s.%d.macaddr", dev, unit); + + printf(" %s => %s\n", devstr, macstr); + + /* Call setenv */ + if (kern_setenv(devstr, macstr) != 0) { + printf("%s: failed to set hint (%s => %s)\n", + __func__, + devstr, + macstr); + return (-1); + } + + return (0); +} + +/* + * Iterate through the list of boot time hints that populate + * a device MAC address hint based on the "board" MAC address. + * + * ar71xx_mac_map.X.devid= + * ar71xx_mac_map.X.unitid= + * ar71xx_mac_map.X.offset= + * ar71xx_mac_map.X.is_local=<1 or 0> + */ +static int +ar71xx_platform_check_mac_hints(void) +{ + int i; + const char *devid; + int offset, is_local, unitid; + + for (i = 0; i < 8; i++) { + if (resource_string_value("ar71xx_mac_map", i, "devid", + &devid) != 0) + break; + if (resource_int_value("ar71xx_mac_map", i, "unitid", + &unitid) != 0) + break; + if (resource_int_value("ar71xx_mac_map", i, "offset", + &offset) != 0) + break; + if (resource_int_value("ar71xx_mac_map", i, "is_local", + &is_local) != 0) + break; + printf("ar71xx: devid '%s.%d', MAC offset '%d'\n", + devid, unitid, offset); + (void) ar71xx_platform_set_mac_hint(devid, unitid, + ar71xx_board_mac_addr, offset, is_local); + } + + return (0); +} + void platform_start(__register_t a0 __unused, __register_t a1 __unused, __register_t a2 __unused, __register_t a3 __unused) @@ -208,8 +344,11 @@ platform_start(__register_t a0 __unused, for (i = 0; envp[i]; i += 2) { if (strcmp(envp[i], "memsize") == 0) realmem = btoc(strtoul(envp[i+1], NULL, 16)); + else if (strcmp(envp[i], "bootverbose") == 0) + bootverbose = btoc(strtoul(envp[i+1], NULL, 10)); } } + bootverbose = 1; #ifdef AR71XX_ENV_ROUTERBOOT /* @@ -302,9 +441,7 @@ platform_start(__register_t a0 __unused, else printf ("envp is invalid\n"); - /* Redboot if_arge MAC address is in the environment */ - ar71xx_redboot_get_macaddr(); - + /* Platform setup */ init_param2(physmem); mips_cpu_init(); pmap_bootstrap(); @@ -326,6 +463,15 @@ platform_start(__register_t a0 __unused, */ ar71xx_init_gmac(); + /* Redboot if_arge MAC address is in the environment */ + (void) ar71xx_redboot_get_macaddr(); + + /* Various other boards need things to come out of EEPROM */ + (void) ar71xx_platform_read_eeprom_mac(); + + /* Initialise the MAC address hint map */ + ar71xx_platform_check_mac_hints(); + kdb_init(); #ifdef KDB if (boothowto & RB_KDB) Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Sat Mar 28 23:30:51 2015 (r280797) +++ head/sys/mips/atheros/if_arge.c Sat Mar 28 23:40:29 2015 (r280798) @@ -90,6 +90,8 @@ MODULE_VERSION(arge, 1); #include "miibus_if.h" +#include + #include #include /* XXX tsk! */ #include /* XXX tsk! */ @@ -240,12 +242,6 @@ DRIVER_MODULE(argemdio, nexus, argemdio_ DRIVER_MODULE(mdio, argemdio, mdio_driver, mdio_devclass, 0, 0); #endif -/* - * RedBoot passes MAC address to entry point as environment - * variable. platfrom_start parses it and stores in this variable - */ -extern uint32_t ar711_base_mac[ETHER_ADDR_LEN]; - static struct mtx miibus_mtx; MTX_SYSINIT(miibus_mtx, &miibus_mtx, "arge mii lock", MTX_DEF); @@ -567,19 +563,57 @@ arge_attach(device_t dev) { struct ifnet *ifp; struct arge_softc *sc; - int error = 0, rid; - int is_base_mac_empty, i; + int error = 0, rid, i; uint32_t hint; long eeprom_mac_addr = 0; int miicfg = 0; int readascii = 0; int local_mac = 0; + uint8_t local_macaddr[ETHER_ADDR_LEN]; + char * local_macstr; + char devid_str[32]; + int count; sc = device_get_softc(dev); sc->arge_dev = dev; sc->arge_mac_unit = device_get_unit(dev); /* + * See if there's a "board" MAC address hint available for + * this particular device. + * + * This is in the environment - it'd be nice to use the resource_*() + * routines, but at the moment the system is booting, the resource hints + * are set to the 'static' map so they're not pulling from kenv. + */ + snprintf(devid_str, 32, "hint.%s.%d.macaddr", + device_get_name(dev), + device_get_unit(dev)); + if ((local_macstr = kern_getenv(devid_str)) != NULL) { + uint32_t tmpmac[ETHER_ADDR_LEN]; + + /* Have a MAC address; should use it */ + device_printf(dev, "Overriding MAC address from environment: '%s'\n", + local_macstr); + + /* Extract out the MAC address */ + /* XXX this should all be a generic method */ + count = sscanf(local_macstr, "%x%*c%x%*c%x%*c%x%*c%x%*c%x", + &tmpmac[0], &tmpmac[1], + &tmpmac[2], &tmpmac[3], + &tmpmac[4], &tmpmac[5]); + if (count == 6) { + /* Valid! */ + local_mac = 1; + for (i = 0; i < ETHER_ADDR_LEN; i++) + local_macaddr[i] = tmpmac[i]; + } + /* Done! */ + freeenv(local_macstr); + local_macstr = NULL; + } + + /* * Some units (eg the TP-Link WR-1043ND) do not have a convenient * EEPROM location to read the ethernet MAC address from. * OpenWRT simply snaffles it from a fixed location. @@ -593,8 +627,8 @@ arge_attach(device_t dev) * an array of numbers. Expose a hint to turn on this conversion * feature via strtol() */ - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "eeprommac", &eeprom_mac_addr) == 0) { + if (local_mac == 0 && resource_long_value(device_get_name(dev), + device_get_unit(dev), "eeprommac", &eeprom_mac_addr) == 0) { local_mac = 1; int i; const char *mac = @@ -604,11 +638,11 @@ arge_attach(device_t dev) "readascii", &readascii) == 0) { device_printf(dev, "Vendor stores MAC in ASCII format\n"); for (i = 0; i < 6; i++) { - ar711_base_mac[i] = strtol(&(mac[i*3]), NULL, 16); + local_macaddr[i] = strtol(&(mac[i*3]), NULL, 16); } } else { for (i = 0; i < 6; i++) { - ar711_base_mac[i] = mac[i]; + local_macaddr[i] = mac[i]; } } } @@ -732,14 +766,11 @@ arge_attach(device_t dev) ifp->if_capabilities |= IFCAP_POLLING; #endif - is_base_mac_empty = 1; - for (i = 0; i < ETHER_ADDR_LEN; i++) { - sc->arge_eaddr[i] = ar711_base_mac[i] & 0xff; - if (sc->arge_eaddr[i] != 0) - is_base_mac_empty = 0; - } - - if (is_base_mac_empty) { + /* If there's a local mac defined, copy that in */ + if (local_mac == 1) { + (void) ar71xx_mac_addr_init(sc->arge_eaddr, + local_macaddr, 0, 0); + } else { /* * No MAC address configured. Generate the random one. */ @@ -749,23 +780,6 @@ arge_attach(device_t dev) (void) ar71xx_mac_addr_random_init(sc->arge_eaddr); } - /* - * 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) { error = ENXIO; goto fail; From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 23:41:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A1DA26C; Sat, 28 Mar 2015 23:41: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 4CEB1C4B; Sat, 28 Mar 2015 23:41:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SNfOak032387; Sat, 28 Mar 2015 23:41:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SNfOZc032386; Sat, 28 Mar 2015 23:41:24 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503282341.t2SNfOZc032386@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 28 Mar 2015 23:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280799 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:41:24 -0000 Author: adrian Date: Sat Mar 28 23:41:23 2015 New Revision: 280799 URL: https://svnweb.freebsd.org/changeset/base/280799 Log: Update if_ath(4) to check for "hint.ath.X.macaddr" for an override MAC address. This is used by the AR71xx platform code to choose a local MAC based on the "board MAC address", versus whatever potentially invalid/garbage values are stored in the Atheros calibration data. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Mar 28 23:40:29 2015 (r280798) +++ head/sys/dev/ath/if_ath.c Sat Mar 28 23:41:23 2015 (r280799) @@ -510,6 +510,60 @@ ath_setup_hal_config(struct ath_softc *s } +/* + * Attempt to fetch the MAC address from the kernel environment. + * + * Returns 0, macaddr in macaddr if successful; -1 otherwise. + */ +static int +ath_fetch_mac_kenv(struct ath_softc *sc, uint8_t *macaddr) +{ + char devid_str[32]; + int local_mac = 0; + char *local_macstr; + + /* + * Fetch from the kenv rather than using hints. + * + * Hints would be nice but the transition to dynamic + * hints/kenv doesn't happen early enough for this + * to work reliably (eg on anything embedded.) + */ + snprintf(devid_str, 32, "hint.%s.%d.macaddr", + device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev)); + + if ((local_macstr = kern_getenv(devid_str)) != NULL) { + uint32_t tmpmac[ETHER_ADDR_LEN]; + int count; + int i; + + /* Have a MAC address; should use it */ + device_printf(sc->sc_dev, + "Overriding MAC address from environment: '%s'\n", + local_macstr); + + /* Extract out the MAC address */ + count = sscanf(local_macstr, "%x%*c%x%*c%x%*c%x%*c%x%*c%x", + &tmpmac[0], &tmpmac[1], + &tmpmac[2], &tmpmac[3], + &tmpmac[4], &tmpmac[5]); + if (count == 6) { + /* Valid! */ + local_mac = 1; + for (i = 0; i < ETHER_ADDR_LEN; i++) + macaddr[i] = tmpmac[i]; + } + /* Done! */ + freeenv(local_macstr); + local_macstr = NULL; + } + + if (local_mac) + return (0); + return (-1); +} + #define HAL_MODE_HT20 (HAL_MODE_11NG_HT20 | HAL_MODE_11NA_HT20) #define HAL_MODE_HT40 \ (HAL_MODE_11NG_HT40PLUS | HAL_MODE_11NG_HT40MINUS | \ @@ -1149,8 +1203,10 @@ ath_attach(u_int16_t devid, struct ath_s */ sc->sc_hasveol = ath_hal_hasveol(ah); - /* get mac address from hardware */ - ath_hal_getmac(ah, macaddr); + /* get mac address from kenv first, then hardware */ + if (ath_fetch_mac_kenv(sc, macaddr) < 0) + ath_hal_getmac(ah, macaddr); + if (sc->sc_hasbmask) ath_hal_getbssidmask(ah, sc->sc_hwbssidmask); From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 23:43:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9A1D3DD; Sat, 28 Mar 2015 23:43: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 D4997C65; Sat, 28 Mar 2015 23:43:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2SNh0ow033685; Sat, 28 Mar 2015 23:43:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2SNh0Xw033684; Sat, 28 Mar 2015 23:43:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503282343.t2SNh0Xw033684@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 28 Mar 2015 23:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280800 - 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:43:01 -0000 Author: adrian Date: Sat Mar 28 23:42:59 2015 New Revision: 280800 URL: https://svnweb.freebsd.org/changeset/base/280800 Log: Add hints to set the board MAC address and derived values for each interface. This allows the TL-WDR3600 to use the correct MAC address for ath0, ath1 and arge0. arge1 isn't used; until I disable it entirely it'll just show up with a randomly generated MAC. Modified: head/sys/mips/conf/TL-WDR4300.hints Modified: head/sys/mips/conf/TL-WDR4300.hints ============================================================================== --- head/sys/mips/conf/TL-WDR4300.hints Sat Mar 28 23:41:23 2015 (r280799) +++ head/sys/mips/conf/TL-WDR4300.hints Sat Mar 28 23:42:59 2015 (r280800) @@ -21,6 +21,29 @@ hint.argemdio.0.order=0 # + AR934X_ETH_CFG_RGMII_GMAC0 (1 << 0) hint.ar934x_gmac.0.gmac_cfg=0x1 +# Board mac address is at 0x1f01fc00. +# ath0: offset 0 +# ath1: offset -1 +# arge0: offset -2 +# arge1: not hooked up; doesn't matter +hint.ar71xx.0.eeprom_mac_addr=0x1f01fc00 +hint.ar71xx.0.eeprom_mac_isascii=0 + +hint.ar71xx_mac_map.0.devid=ath +hint.ar71xx_mac_map.0.unitid=0 +hint.ar71xx_mac_map.0.offset=0 +hint.ar71xx_mac_map.0.is_local=0 + +hint.ar71xx_mac_map.1.devid=ath +hint.ar71xx_mac_map.1.unitid=1 +hint.ar71xx_mac_map.1.offset=-1 +hint.ar71xx_mac_map.1.is_local=0 + +hint.ar71xx_mac_map.2.devid=arge +hint.ar71xx_mac_map.2.unitid=0 +hint.ar71xx_mac_map.2.offset=-2 +hint.ar71xx_mac_map.2.is_local=0 + # GMAC0 here - connected to an AR8327 hint.arswitch.0.at="mdio0" hint.arswitch.0.is_7240=0 @@ -63,9 +86,6 @@ 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=0x1f01fc00 - # mdiobus1 on arge1 hint.argemdio.1.at="nexus0" hint.argemdio.1.maddr=0x1a000000 From owner-svn-src-head@FreeBSD.ORG Sat Mar 28 23:53:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8381613; Sat, 28 Mar 2015 23:53:46 +0000 (UTC) Received: from mail-ig0-x234.google.com (mail-ig0-x234.google.com [IPv6:2607:f8b0:4001:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C8B1D53; Sat, 28 Mar 2015 23:53:46 +0000 (UTC) Received: by igcxg11 with SMTP id xg11so46569595igc.0; Sat, 28 Mar 2015 16:53: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=g0JK9t7p87KuCs/RpO5gQ2/2mmFBJrFMLQS6Yo0Z+eQ=; b=WReWrPUYDWgWVEOo9XzMEVaujAF8ialM37YD0FmvGfYbZUegG7jmDX+QnqBePXRaXq BrEo8eMtWpcM9u70V9kZMYGnXrHhhGALOrePKpNA3e3JqD27pCE4udtfmzmsDgECuQgy InvU5Yqajd5NrQPUCafZZYRmJAMqgHJGThaeIlGQGOWlDc8gi0aDIcxmWOCF2it0j9vf xRSp/sN8luvSHLK6qgXSes8uvgCF5r99h07ODjoKylgq/YTSbKgPhrrxqC+rZ9LJl5vR jdezZGJTvYpemouPkAkF4W9sN65dreJ2L7ghiSRXCQSV53Z3SvWHdeLD1hbr2g19pz47 DJeg== MIME-Version: 1.0 X-Received: by 10.107.5.131 with SMTP id 125mr38126464iof.88.1427586825639; Sat, 28 Mar 2015 16:53:45 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.194 with HTTP; Sat, 28 Mar 2015 16:53:45 -0700 (PDT) In-Reply-To: <201503281250.t2SCoOkt020297@svn.freebsd.org> References: <201503281250.t2SCoOkt020297@svn.freebsd.org> Date: Sat, 28 Mar 2015 16:53:45 -0700 X-Google-Sender-Auth: 63CBlDG9YRKydWpetGBVYl1xF90 Message-ID: Subject: Re: svn commit: r280785 - in head/sys: kern netgraph/atm/sscop netgraph/atm/uni sys From: Adrian Chadd To: Randall Stewart 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-1 Precedence: list List-Id: SVN 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 Mar 2015 23:53:46 -0000 Hi, There's been at least one report of a regression on -current. i haven't tried this on various MIPS hardware devices yet. -adrian