From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 00:13:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08266FB3; Sun, 28 Sep 2014 00:13:06 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 348385EC; Sun, 28 Sep 2014 00:13:05 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 37A92D6293D; Sun, 28 Sep 2014 09:55:36 +1000 (EST) Date: Sun, 28 Sep 2014 09:55:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Colin Percival Subject: Re: svn commit: r272207 - in head/games: factor primes In-Reply-To: <201409270900.s8R90dWl029070@svn.freebsd.org> Message-ID: <20140928071459.C927@besplex.bde.org> References: <201409270900.s8R90dWl029070@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=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6Wz-CoUn4gwvbWm69jgA: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, 28 Sep 2014 00:13:06 -0000 On Sat, 27 Sep 2014, Colin Percival wrote: > Log: > Switch primes(6) from using unsigned long to using uint64_t. This fixes > 'limited range of type' warnings about comparisons on 32-bit systems, and > allows 32-bit systems to compute the full range of primes. Since it no longer pretends to support up to the limit of the type, using the correct type of uintmax_t doesn't necessarily break anything immediately. However, blindly changing it gives bugs. Mostly style bugs like different error messages for different range errors. primes(6) already has mounds of similar source and output bugs. > Modified: head/games/primes/primes.c > ============================================================================== > --- head/games/primes/primes.c Sat Sep 27 08:59:43 2014 (r272206) > +++ head/games/primes/primes.c Sat Sep 27 09:00:38 2014 (r272207) > @@ -111,10 +112,10 @@ main(int argc, char *argv[]) > argv += optind; > > start = 0; > - stop = (sizeof(ubig) > 4) ? SPSPMAX : BIG; > + stop = SPSPMAX; > > /* > - * Convert low and high args. Strtoul(3) sets errno to > + * Convert low and high args. Strtoumax(3) sets errno to > * ERANGE if the number is too large, but, if there's > * a leading minus sign it returns the negation of the > * result of the conversion, which we'd rather disallow. Only some numbers that are too large are detected by strtoumax(). Since SIEVEMAX is now < the return value for a range error, there is no now need for checking ERANGE. > @@ -126,19 +127,19 @@ main(int argc, char *argv[]) > errx(1, "negative numbers aren't permitted."); > > errno = 0; > - start = strtoul(argv[0], &p, 0); > + start = strtoumax(argv[0], &p, 0); This now truncates the value from uintmax_t to typeof(ubig) == uint64_t (on unsupported arches with uintmax_t larger than uint64_t). This is broken (see below). Use uintmax_t for ubig to avoid complications. Or at least use it to check values before they are truncated. > if (errno) > err(1, "%s", argv[0]); This handles mainly the ERANGE error. Some out-of-range values are detected by this. The code is still essentially the same as in 4.4BSD. Then ERANGE was the only possible error (except preverse functions can set errno to anything nonzero). POSIX added "helpful" setting to EINVAL which is actually perverse since it changes the error handling of sloppy code like this. This code doesn't really expect EINVAL and should have been written as "if (errno == ERANGE)". This would also fix one of the style bugs in it (boolean check for non-boolean). Bugs like this only give minor differences in the error messages. There are many other style errors in the error messages. All the parsing and error handling bugs for numbers are quadruplicated, except for parsing numbers in a file, the bug of misdetecting negative numbers by checking only the first character in argv[n] is replaced by the bug of using isblank() on possibly-signed characters to skip whitespace. > - if ((uint64_t)stop > SPSPMAX) > + if (stop > SPSPMAX) > errx(1, "%s: stop value too large.", argv[1]); Numbers larger than UINTMAX_MAX are now detected as ERANGE errors and their error handling is err(1, "%s", argv[0]);. 'stop' numbers > SPSPAX and <= UINT64_MAX are detected here and their error handling is better. 'start' and numbers in these ranges are detected as ERANGE errors or later by comparing them with 'stop'. I'm not sure if their later error handling is as good (it is unlikely to be so). Detection of errors for numbers > UINT64_MAX and <= UINTMAX_MAX is broken by truncation. E.g., UINT64_MAX + (uintmax_t)2 is truncated to 1. > @@ -243,7 +244,7 @@ primes(ubig start, ubig stop) > for (p = &prime[0], factor = prime[0]; > factor < stop && p <= pr_limit; factor = *(++p)) { > if (factor >= start) { > - printf(hflag ? "0x%lx\n" : "%lu\n", factor); > + printf(hflag ? "%" PRIx64 "\n" : "%" PRIu64 "\n", factor); This adds 2 style bugs and 1 non-style bug: - it uses the PRI* mistake - as well as its own ugliness, blind use of PRI* expands the line beyond 80 columns - the use of PRI* isn't even blind. Blind use would have preserved the leading "lx" in the hex format. The PRI* mistake is so ugly that bugs like this might be hard to see. If the correct type (uintmax_t) were used throughout, then the change here would be simply to replace 'l' by 'j'. Otherwise, PRI* should never be used except possibly to micro-optimize for space on 8-bit systems. Instead, cast 'factor' to uintmax_t and use %j formats. This doesn't apply here for various reasons. Expansion of the main code to 64 bits might already be too much bloat for the 8-bit systems. If they don't mind that, then they shouldn't mind printing the 64-bit values. They can limit the bloat to 64 bits by not making uintmax_t larger than that. It should only be larger than that on 64-bit systems. > } > } > /* return early if we are done */ > @@ -306,11 +307,11 @@ primes(ubig start, ubig stop) > */ > for (q = table; q < tab_lim; ++q, start+=2) { > if (*q) { > - if ((uint64_t)start > SIEVEMAX) { > + if (start > SIEVEMAX) { Why compare with SIEVEMAX instead of 'stop'? 'start' should be <= 'stop', and I think there is an up-front check for 'stop'. > if (!isprime(start)) > continue; > } > - printf(hflag ? "0x%lx\n" : "%lu\n", start); > + printf(hflag ? "%" PRIx64 "\n" : "%" PRIu64 "\n", start); This set of bugs is only duplicated. > } > } > } > > Modified: head/games/primes/primes.h > ============================================================================== > --- head/games/primes/primes.h Sat Sep 27 08:59:43 2014 (r272206) > +++ head/games/primes/primes.h Sat Sep 27 09:00:38 2014 (r272207) > @@ -41,8 +41,10 @@ > * chongo /\oo/\ > */ > > +#include Style bug: nested include. > + > /* ubig is the type that holds a large unsigned value */ > -typedef unsigned long ubig; /* must be >=32 bit unsigned value */ > +typedef uint64_t ubig; /* must be >=32 bit unsigned value */ The comment is very wrong now. After the previous commit, 32 bits may have been sufficient but they gave annoying restrictions. Now, 32 bits isn't sufficient to give the documented limit. It might be correct to say "must be large enough to hold ". However, using PRI64 is more broken than first appeared. It hard-codes the assumption that ubig has type precisely uint64_t (like old code hard-coded the assumption that ubig has type unsigned long). So the only correct comment now is /* must be precisely what it is (duh) */. It was wrong originally, since >= 32 bits was too large for the algorithm and there was no range checking other that the ERANGE check related to the type. > #define BIG ULONG_MAX /* largest value will sieve */ This bug was pointed out in another reply. BIG might be unused, but its comment is wrong. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 00:57:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0350B807; Sun, 28 Sep 2014 00:57:48 +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 B6F1496E; Sun, 28 Sep 2014 00:57:47 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id BA848780FD8; Sun, 28 Sep 2014 10:30:40 +1000 (EST) Date: Sun, 28 Sep 2014 10:30:39 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sean Bruno Subject: Re: svn commit: r272210 - head/games/factor In-Reply-To: <201409271057.s8RAvYdF086338@svn.freebsd.org> Message-ID: <20140928101352.C927@besplex.bde.org> References: <201409271057.s8RAvYdF086338@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=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=FhmKRLTLOMscdICiqboA: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, 28 Sep 2014 00:57:48 -0000 On Sat, 27 Sep 2014, Sean Bruno wrote: > Log: > Update factor for changes to types in primes, which is a dependency. > > Fixes build-fail on mips32 introduced at 272207. > > Modified: > head/games/factor/factor.c > > Modified: head/games/factor/factor.c > ============================================================================== > --- head/games/factor/factor.c Sat Sep 27 09:57:34 2014 (r272209) > +++ head/games/factor/factor.c Sat Sep 27 10:57:34 2014 (r272210) > @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include Needed only for the style bugs below. > #include > #include > #include > @@ -227,7 +228,7 @@ pr_fact(BIGNUM *val) > > /* Divide factor out until none are left. */ > do { > - printf(hflag ? " 0x%lx" : " %lu", *fact); > + printf(hflag ? " 0x%" PRIx64 "" : " %" PRIu64 "", *fact); This has the same PRI* ugliness as primes.c, but doesn't break the output format for the hex case (it still has the "0x" prefix). > BN_div_word(val, (BN_ULONG)*fact); > } while (BN_mod_word(val, (BN_ULONG)*fact) == 0); However, it seems to need much larger changes to keep up. Its BN and BIGNUMS aren't actually (arbitrary-precision) bignums. BIGNUM is just ubig, which is now uint64_t. BN_ULONG is still just u_long. Parsing functions still use just strtoul() to create BIGNUMs. Now they can't even create the non-bignums given by BIGNUM == ubig on 32-bit systems. So if there are no other bugs, factor(6) is probably limited to UINT32_MAX on 32-bit system and to the new limit SIEVE_MAX on 64-bit systems (like the previous version of primes(6)). Its documentation doesn't seem to have been changed. Its old documentation gives the wrong limit of UINT64_MAX (expressed unreadably in decimal) on 64-bit systems. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 03:44:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 798E636F; Sun, 28 Sep 2014 03:44:02 +0000 (UTC) Date: Sun, 28 Sep 2014 03:44:02 +0000 From: Alexey Dokuchaev To: Alexander Kabaev Subject: Re: svn commit: r272214 - in head/sys: boot/i386/libfirewire dev/firewire Message-ID: <20140928034402.GA82578@FreeBSD.org> References: <201409271650.s8RGoLHS053554@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409271650.s8RGoLHS053554@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, 28 Sep 2014 03:44:02 -0000 On Sat, Sep 27, 2014 at 04:50:21PM +0000, Alexander Kabaev wrote: > New Revision: 272214 > URL: http://svnweb.freebsd.org/changeset/base/272214 > > Log: > Remove obsolete compatibility glue and improve firewire code readability. > > Commit my version of style(9) pass over the firewire code. Now that > other people have started changing the code carrying this is as a > local patch is not longer a viable option. Thank you. I've tried to work on this code a while ago, but was disgusted away by its lack of style. ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 05:28:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1C2BC5C; Sun, 28 Sep 2014 05:28:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDF38241; Sun, 28 Sep 2014 05:28: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 s8S5SBLu012766; Sun, 28 Sep 2014 05:28:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8S5SBm5012765; Sun, 28 Sep 2014 05:28:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409280528.s8S5SBm5012765@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 28 Sep 2014 05:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272237 - 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: Sun, 28 Sep 2014 05:28:12 -0000 Author: adrian Date: Sun Sep 28 05:28:11 2014 New Revision: 272237 URL: http://svnweb.freebsd.org/changeset/base/272237 Log: Fix the ar724x PCI config space register read. It was doing incorrect things with masks. This was fixed in the AR71xx codebase but it wasn't yet fixed in the AR724x code. This ended up having config space reads return larger/incorrect values in some situations. Tested: * AR7240 TODO: * test ar7241, AR7242, and AR934x. Modified: head/sys/mips/atheros/ar724x_pci.c Modified: head/sys/mips/atheros/ar724x_pci.c ============================================================================== --- head/sys/mips/atheros/ar724x_pci.c Sun Sep 28 01:53:02 2014 (r272236) +++ head/sys/mips/atheros/ar724x_pci.c Sun Sep 28 05:28:11 2014 (r272237) @@ -122,8 +122,12 @@ ar724x_pci_read_config(device_t dev, u_i /* Register access is 32-bit aligned */ shift = (reg & 3) * 8; - if (shift) - mask = (1 << shift) - 1; + + /* Create a mask based on the width, post-shift */ + if (bytes == 2) + mask = 0xffff; + else if (bytes == 1) + mask = 0xff; else mask = 0xffffffff; @@ -337,7 +341,6 @@ ar724x_pci_slot_fixup(device_t dev) return; } - device_printf(dev, "found EEPROM at 0x%lx on %d.%d.%d\n", flash_addr, 0, 0, 0); ar724x_pci_fixup(dev, flash_addr, size); @@ -486,7 +489,6 @@ ar724x_pci_alloc_resource(device_t bus, } } - return (rv); } From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 07:19:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7C1ED2F; Sun, 28 Sep 2014 07:19:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 948E5D1A; Sun, 28 Sep 2014 07:19: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 s8S7JXP0063907; Sun, 28 Sep 2014 07:19:33 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8S7JXhg063906; Sun, 28 Sep 2014 07:19:33 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409280719.s8S7JXhg063906@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 28 Sep 2014 07:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272238 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 28 Sep 2014 07:19:33 -0000 Author: glebius Date: Sun Sep 28 07:19:32 2014 New Revision: 272238 URL: http://svnweb.freebsd.org/changeset/base/272238 Log: Mechanically switch ixv(4) to if_inc_counter(). Modified: head/sys/dev/ixgbe/ixv.c Modified: head/sys/dev/ixgbe/ixv.c ============================================================================== --- head/sys/dev/ixgbe/ixv.c Sun Sep 28 05:28:11 2014 (r272237) +++ head/sys/dev/ixgbe/ixv.c Sun Sep 28 07:19:32 2014 (r272238) @@ -634,9 +634,9 @@ ixv_mq_start_locked(struct ifnet *ifp, s } drbr_advance(ifp, txr->br); enqueued++; - ifp->if_obytes += next->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_OBYTES, next->m_pkthdr.len); if (next->m_flags & M_MCAST) - ifp->if_omcasts++; + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) @@ -2651,7 +2651,7 @@ ixv_txeof(struct tx_ring *txr) tx_desc = (struct ixgbe_legacy_tx_desc *)&txr->tx_base[first]; } - ++ifp->if_opackets; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* See if there is more work now */ last = tx_buffer->eop_index; if (last != -1) { @@ -3341,7 +3341,7 @@ ixv_rxeof(struct ix_queue *que, int coun /* Make sure all parts of a bad packet are discarded */ if (((staterr & IXGBE_RXDADV_ERR_FRAME_ERR_MASK) != 0) || (rxr->discard)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); rxr->rx_discarded++; if (!eop) rxr->discard = TRUE; @@ -3455,7 +3455,7 @@ ixv_rxeof(struct ix_queue *que, int coun /* Sending this frame? */ if (eop) { sendmp->m_pkthdr.rcvif = ifp; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); rxr->rx_packets++; /* capture data for AIM */ rxr->bytes += sendmp->m_pkthdr.len; From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 07:27:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DBAAF57; Sun, 28 Sep 2014 07:27:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FF05DD6; Sun, 28 Sep 2014 07:27: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 s8S7Rx11068696; Sun, 28 Sep 2014 07:27:59 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8S7RxWP068695; Sun, 28 Sep 2014 07:27:59 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409280727.s8S7RxWP068695@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 28 Sep 2014 07:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272239 - 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: Sun, 28 Sep 2014 07:27:59 -0000 Author: adrian Date: Sun Sep 28 07:27:58 2014 New Revision: 272239 URL: http://svnweb.freebsd.org/changeset/base/272239 Log: Fix the AR724x PCIe glue to correctly probe the BAR on AR7240 devices. There's a bug in the AR7240 PCIe hardware where a correct BAR will end up having the device disappear. It turns out that for the device address it should be all 0's. However, this meant that the PCI probe code would try writing 0xffffffff in to see how big the window was, read back 0x0, and think the window was 32 bits. It then ended up calculating a resource size of 0 bytes, failed to find anything via an rman call, and this would fail to attach. I have quite absolutely no idea how in the various planes of existence this particular bit of code and how it worked with the PCI bus code ever worked. But, well, it did. Tested: * Atheros AP93 - AR7240 + AR9280 reference board Modified: head/sys/mips/atheros/ar724x_pci.c Modified: head/sys/mips/atheros/ar724x_pci.c ============================================================================== --- head/sys/mips/atheros/ar724x_pci.c Sun Sep 28 07:19:32 2014 (r272238) +++ head/sys/mips/atheros/ar724x_pci.c Sun Sep 28 07:27:58 2014 (r272239) @@ -159,10 +159,18 @@ ar724x_pci_write_config(device_t dev, u_ return; /* - * WAR for BAR issue on AR7240 - We are unable to access the PCI device - * space if we set the BAR with proper base address. + * WAR for BAR issue on AR7240 - We are unable to access the PCI + * device space if we set the BAR with proper base address. + * + * However, we _do_ want to allow programming in the probe value + * (0xffffffff) so the PCI code can find out how big the memory + * map is for this device. Without it, it'll think the memory + * map is 32 bits wide, the PCI code will then end up thinking + * the register window is '0' and fail to allocate resources. */ - if (reg == PCIR_BAR(0) && bytes == 4 && ar71xx_soc == AR71XX_SOC_AR7240) + if (reg == PCIR_BAR(0) && bytes == 4 + && ar71xx_soc == AR71XX_SOC_AR7240 + && data != 0xffffffff) ar724x_pci_write(AR724X_PCI_CFG_BASE, reg, 0xffff, bytes); else ar724x_pci_write(AR724X_PCI_CFG_BASE, reg, data, bytes); From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 07:29:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34B39133; Sun, 28 Sep 2014 07:29:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20B62DDE; Sun, 28 Sep 2014 07:29: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 s8S7TjLS068959; Sun, 28 Sep 2014 07:29:45 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8S7TjDQ068958; Sun, 28 Sep 2014 07:29:45 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409280729.s8S7TjDQ068958@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 28 Sep 2014 07:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272240 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 28 Sep 2014 07:29:46 -0000 Author: glebius Date: Sun Sep 28 07:29:45 2014 New Revision: 272240 URL: http://svnweb.freebsd.org/changeset/base/272240 Log: Convert to if_get_counter(). Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sun Sep 28 07:27:58 2014 (r272239) +++ head/sys/dev/ixgbe/ixgbe.c Sun Sep 28 07:29:45 2014 (r272240) @@ -120,6 +120,7 @@ static int ixgbe_ioctl(struct ifnet static void ixgbe_init(void *); static void ixgbe_init_locked(struct adapter *); static void ixgbe_stop(void *); +static uint64_t ixgbe_get_counter(struct ifnet *, ift_counter); static void ixgbe_media_status(struct ifnet *, struct ifmediareq *); static int ixgbe_media_change(struct ifnet *); static void ixgbe_identify_hardware(struct adapter *); @@ -2721,6 +2722,7 @@ ixgbe_setup_interface(device_t dev, stru ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixgbe_ioctl; + ifp->if_get_counter = ixgbe_get_counter; #ifndef IXGBE_LEGACY_TX ifp->if_transmit = ixgbe_mq_start; ifp->if_qflush = ixgbe_qflush; @@ -5364,10 +5366,8 @@ ixgbe_reinit_fdir(void *context, int pen static void ixgbe_update_stats_counters(struct adapter *adapter) { - struct ifnet *ifp = adapter->ifp; struct ixgbe_hw *hw = &adapter->hw; u32 missed_rx = 0, bprc, lxon, lxoff, total; - u64 total_missed_rx = 0; adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS); adapter->stats.illerrc += IXGBE_READ_REG(hw, IXGBE_ILLERRC); @@ -5386,8 +5386,6 @@ ixgbe_update_stats_counters(struct adapt missed_rx += mp; /* global total per queue */ adapter->stats.mpc[i] += mp; - /* Running comprehensive total for stats display */ - total_missed_rx += adapter->stats.mpc[i]; if (hw->mac.type == ixgbe_mac_82598EB) { adapter->stats.rnbc[i] += IXGBE_READ_REG(hw, IXGBE_RNBC(i)); @@ -5497,19 +5495,41 @@ ixgbe_update_stats_counters(struct adapt adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); } +} + +static uint64_t +ixgbe_get_counter(struct ifnet *ifp, ift_counter cnt) +{ + struct adapter *adapter; + uint64_t rv; - /* Fill out the OS statistics structure */ - ifp->if_ipackets = adapter->stats.gprc; - ifp->if_opackets = adapter->stats.gptc; - ifp->if_ibytes = adapter->stats.gorc; - ifp->if_obytes = adapter->stats.gotc; - ifp->if_imcasts = adapter->stats.mprc; - ifp->if_omcasts = adapter->stats.mptc; - ifp->if_collisions = 0; - - /* Rx Errors */ - ifp->if_iqdrops = total_missed_rx; - ifp->if_ierrors = adapter->stats.crcerrs + adapter->stats.rlec; + adapter = if_getsoftc(ifp); + + switch (cnt) { + case IFCOUNTER_IPACKETS: + return (adapter->stats.gprc); + case IFCOUNTER_OPACKETS: + return (adapter->stats.gptc); + case IFCOUNTER_IBYTES: + return (adapter->stats.gorc); + case IFCOUNTER_OBYTES: + return (adapter->stats.gotc); + case IFCOUNTER_IMCASTS: + return (adapter->stats.mprc); + case IFCOUNTER_OMCASTS: + return (adapter->stats.mptc); + case IFCOUNTER_COLLISIONS: + return (0); + case IFCOUNTER_IQDROPS: + rv = 0; + for (int i = 0; i < 8; i++) + rv += adapter->stats.mpc[i]; + return (rv); + case IFCOUNTER_IERRORS: + return (adapter->stats.crcerrs + adapter->stats.rlec); + default: + return (if_get_counter_default(ifp, cnt)); + } } /** ixgbe_sysctl_tdh_handler - Handler function From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 07:40:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92FAF456; Sun, 28 Sep 2014 07:40:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 748AAF30; Sun, 28 Sep 2014 07:40: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 s8S7eRhW073744; Sun, 28 Sep 2014 07:40:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8S7eRbF073742; Sun, 28 Sep 2014 07:40:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409280740.s8S7eRbF073742@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 28 Sep 2014 07:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272241 - head/sys/dev/ixgb X-SVN-Group: head MIME-Version: 1.0 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, 28 Sep 2014 07:40:27 -0000 Author: glebius Date: Sun Sep 28 07:40:26 2014 New Revision: 272241 URL: http://svnweb.freebsd.org/changeset/base/272241 Log: Provide ixgb_get_counter(). Modified: head/sys/dev/ixgb/if_ixgb.c Modified: head/sys/dev/ixgb/if_ixgb.c ============================================================================== --- head/sys/dev/ixgb/if_ixgb.c Sun Sep 28 07:29:45 2014 (r272240) +++ head/sys/dev/ixgb/if_ixgb.c Sun Sep 28 07:40:26 2014 (r272241) @@ -97,6 +97,7 @@ static void ixgb_intr(void *); static void ixgb_start(struct ifnet *); static void ixgb_start_locked(struct ifnet *); static int ixgb_ioctl(struct ifnet *, IOCTL_CMD_TYPE, caddr_t); +static uint64_t ixgb_get_counter(struct ifnet *, ift_counter); static void ixgb_watchdog(struct adapter *); static void ixgb_init(void *); static void ixgb_init_locked(struct adapter *); @@ -643,7 +644,7 @@ ixgb_watchdog(struct adapter *adapter) ixgb_init_locked(adapter); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return; } @@ -1355,6 +1356,7 @@ ixgb_setup_interface(device_t dev, struc ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixgb_ioctl; ifp->if_start = ixgb_start; + ifp->if_get_counter = ixgb_get_counter; ifp->if_snd.ifq_maxlen = adapter->num_tx_desc - 1; #if __FreeBSD_version < 500000 @@ -2326,7 +2328,6 @@ ixgb_write_pci_cfg(struct ixgb_hw * hw, static void ixgb_update_stats_counters(struct adapter * adapter) { - struct ifnet *ifp; adapter->stats.crcerrs += IXGB_READ_REG(&adapter->hw, CRCERRS); adapter->stats.gprcl += IXGB_READ_REG(&adapter->hw, GPRCL); @@ -2389,29 +2390,37 @@ ixgb_update_stats_counters(struct adapte adapter->stats.pfrc += IXGB_READ_REG(&adapter->hw, PFRC); adapter->stats.pftc += IXGB_READ_REG(&adapter->hw, PFTC); adapter->stats.mcfrc += IXGB_READ_REG(&adapter->hw, MCFRC); +} - ifp = adapter->ifp; - - /* Fill out the OS statistics structure */ - ifp->if_ipackets = adapter->stats.gprcl; - ifp->if_opackets = adapter->stats.gptcl; - ifp->if_ibytes = adapter->stats.gorcl; - ifp->if_obytes = adapter->stats.gotcl; - ifp->if_imcasts = adapter->stats.mprcl; - ifp->if_collisions = 0; - - /* Rx Errors */ - ifp->if_ierrors = - adapter->dropped_pkts + - adapter->stats.crcerrs + - adapter->stats.rnbc + - adapter->stats.mpc + - adapter->stats.rlec; +static uint64_t +ixgb_get_counter(struct ifnet *ifp, ift_counter cnt) +{ + struct adapter *adapter; + adapter = if_getsoftc(ifp); + switch (cnt) { + case IFCOUNTER_IPACKETS: + return (adapter->stats.gprcl); + case IFCOUNTER_OPACKETS: + return ( adapter->stats.gptcl); + case IFCOUNTER_IBYTES: + return (adapter->stats.gorcl); + case IFCOUNTER_OBYTES: + return (adapter->stats.gotcl); + case IFCOUNTER_IMCASTS: + return ( adapter->stats.mprcl); + case IFCOUNTER_COLLISIONS: + return (0); + case IFCOUNTER_IERRORS: + return (adapter->dropped_pkts + adapter->stats.crcerrs + + adapter->stats.rnbc + adapter->stats.mpc + + adapter->stats.rlec); + default: + return (if_get_counter_default(ifp, cnt)); + } } - /********************************************************************** * * This routine is called only when ixgb_display_debug_stats is enabled. From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 07:43:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38AD85D9; Sun, 28 Sep 2014 07:43:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25C42F4C; Sun, 28 Sep 2014 07:43: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 s8S7hdB9077483; Sun, 28 Sep 2014 07:43:39 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8S7hdXs077482; Sun, 28 Sep 2014 07:43:39 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409280743.s8S7hdXs077482@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 28 Sep 2014 07:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272242 - 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: Sun, 28 Sep 2014 07:43:39 -0000 Author: glebius Date: Sun Sep 28 07:43:38 2014 New Revision: 272242 URL: http://svnweb.freebsd.org/changeset/base/272242 Log: Convert to if_inc_counter() last remnantes of bare access to struct ifnet counters. Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Sun Sep 28 07:40:26 2014 (r272241) +++ head/sys/net/if_lagg.c Sun Sep 28 07:43:38 2014 (r272242) @@ -1485,7 +1485,7 @@ lagg_transmit(struct ifnet *ifp, struct if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) { LAGG_RUNLOCK(sc, &tracker); m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENXIO); } @@ -1495,7 +1495,7 @@ lagg_transmit(struct ifnet *ifp, struct LAGG_RUNLOCK(sc, &tracker); if (error != 0) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (error); } From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 08:23:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA742B97; Sun, 28 Sep 2014 08:23: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 D6ED1315; Sun, 28 Sep 2014 08:23: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 s8S8NQFV096369; Sun, 28 Sep 2014 08:23:26 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8S8NQe9096368; Sun, 28 Sep 2014 08:23:26 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201409280823.s8S8NQe9096368@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 28 Sep 2014 08:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272243 - head/sbin/fdisk_pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 28 Sep 2014 08:23:27 -0000 Author: nyan Date: Sun Sep 28 08:23:26 2014 New Revision: 272243 URL: http://svnweb.freebsd.org/changeset/base/272243 Log: Merged from r183296. Add missing library dependencies. Modified: head/sbin/fdisk_pc98/Makefile Modified: head/sbin/fdisk_pc98/Makefile ============================================================================== --- head/sbin/fdisk_pc98/Makefile Sun Sep 28 07:43:38 2014 (r272242) +++ head/sbin/fdisk_pc98/Makefile Sun Sep 28 08:23:26 2014 (r272243) @@ -7,7 +7,7 @@ MAN= fdisk.8 .PATH: ${.CURDIR}/../../sys/geom -DPADD += ${LIBGEOM} -LDADD += -lgeom +DPADD+= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} +LDADD+= -lgeom -lbsdxml -lsbuf .include From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 08:57:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66631336; Sun, 28 Sep 2014 08: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 51D9D7B4; Sun, 28 Sep 2014 08: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 s8S8v9sJ011123; Sun, 28 Sep 2014 08:57:09 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8S8v8cG011117; Sun, 28 Sep 2014 08:57:08 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409280857.s8S8v8cG011117@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 28 Sep 2014 08:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272244 - 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: Sun, 28 Sep 2014 08:57:09 -0000 Author: glebius Date: Sun Sep 28 08:57:07 2014 New Revision: 272244 URL: http://svnweb.freebsd.org/changeset/base/272244 Log: Finally, convert counters in struct ifnet to counter(9). Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h head/sys/net/if_var.h head/sys/net/ifq.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Sep 28 08:23:26 2014 (r272243) +++ head/sys/net/if.c Sun Sep 28 08:57:07 2014 (r272244) @@ -468,6 +468,10 @@ if_alloc(u_char type) refcount_init(&ifp->if_refcount, 1); /* Index reference. */ ifnet_setbyindex(ifp->if_index, ifp); + + for (int i = 0; i < IFCOUNTERS; i++) + ifp->if_counters[i] = counter_u64_alloc(M_WAITOK); + return (ifp); } @@ -495,6 +499,10 @@ if_free_internal(struct ifnet *ifp) IF_AFDATA_DESTROY(ifp); IF_ADDR_LOCK_DESTROY(ifp); ifq_delete(&ifp->if_snd); + + for (int i = 0; i < IFCOUNTERS; i++) + counter_u64_free(ifp->if_counters[i]); + free(ifp, M_IFNET); } @@ -1460,39 +1468,15 @@ if_rtdel(struct radix_node *rn, void *ar } /* - * Return counter values from old racy non-pcpu counters. + * Return counter values from counter(9)s stored in ifnet. */ uint64_t if_get_counter_default(struct ifnet *ifp, ift_counter cnt) { - switch (cnt) { - case IFCOUNTER_IPACKETS: - return (ifp->if_ipackets); - case IFCOUNTER_IERRORS: - return (ifp->if_ierrors); - case IFCOUNTER_OPACKETS: - return (ifp->if_opackets); - case IFCOUNTER_OERRORS: - return (ifp->if_oerrors); - case IFCOUNTER_COLLISIONS: - return (ifp->if_collisions); - case IFCOUNTER_IBYTES: - return (ifp->if_ibytes); - case IFCOUNTER_OBYTES: - return (ifp->if_obytes); - case IFCOUNTER_IMCASTS: - return (ifp->if_imcasts); - case IFCOUNTER_OMCASTS: - return (ifp->if_omcasts); - case IFCOUNTER_IQDROPS: - return (ifp->if_iqdrops); - case IFCOUNTER_OQDROPS: - return (ifp->if_oqdrops); - case IFCOUNTER_NOPROTO: - return (ifp->if_noproto); - } - panic("%s: unknown counter %d", __func__, cnt); + KASSERT(cnt < IFCOUNTERS, ("%s: invalid cnt %d", __func__, cnt)); + + return (counter_u64_fetch(ifp->if_counters[cnt])); } /* @@ -1503,46 +1487,9 @@ void if_inc_counter(struct ifnet *ifp, ift_counter cnt, int64_t inc) { - switch (cnt) { - case IFCOUNTER_IPACKETS: - ifp->if_ipackets += inc; - break; - case IFCOUNTER_IERRORS: - ifp->if_ierrors += inc; - break; - case IFCOUNTER_OPACKETS: - ifp->if_opackets += inc; - break; - case IFCOUNTER_OERRORS: - ifp->if_oerrors += inc; - break; - case IFCOUNTER_COLLISIONS: - ifp->if_collisions += inc; - break; - case IFCOUNTER_IBYTES: - ifp->if_ibytes += inc; - break; - case IFCOUNTER_OBYTES: - ifp->if_obytes += inc; - break; - case IFCOUNTER_IMCASTS: - ifp->if_imcasts += inc; - break; - case IFCOUNTER_OMCASTS: - ifp->if_omcasts += inc; - break; - case IFCOUNTER_IQDROPS: - ifp->if_iqdrops += inc; - break; - case IFCOUNTER_OQDROPS: - ifp->if_oqdrops += inc; - break; - case IFCOUNTER_NOPROTO: - ifp->if_noproto += inc; - break; - default: - panic("%s: unknown counter %d", __func__, cnt); - } + KASSERT(cnt < IFCOUNTERS, ("%s: invalid cnt %d", __func__, cnt)); + + counter_u64_add(ifp->if_counters[cnt], inc); } /* @@ -3596,14 +3543,14 @@ if_handoff(struct ifqueue *ifq, struct m IF_LOCK(ifq); if (_IF_QFULL(ifq)) { IF_UNLOCK(ifq); - ifp->if_oqdrops++; + if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); m_freem(m); return (0); } if (ifp != NULL) { - ifp->if_obytes += m->m_pkthdr.len + adjust; + if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len + adjust); if (m->m_flags & (M_BCAST|M_MCAST)) - ifp->if_omcasts++; + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); active = ifp->if_drv_flags & IFF_DRV_OACTIVE; } _IF_ENQUEUE(ifq, m); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Sun Sep 28 08:23:26 2014 (r272243) +++ head/sys/net/if_lagg.c Sun Sep 28 08:57:07 2014 (r272244) @@ -815,7 +815,7 @@ lagg_port_create(struct lagg_softc *sc, /* Read port counters */ pval = lp->port_counters.val; - for (i = IFCOUNTER_IPACKETS; i <= IFCOUNTER_LAST; i++, pval++) + for (i = 0; i < IFCOUNTERS; i++, pval++) *pval = ifp->if_get_counter(ifp, i); /* Add multicast addresses and interface flags to this port */ lagg_ether_cmdmulti(lp, 1); @@ -884,9 +884,9 @@ lagg_port_destroy(struct lagg_port *lp, /* Update detached port counters */ pval = lp->port_counters.val; - for (i = IFCOUNTER_IPACKETS; i <= IFCOUNTER_LAST; i++, pval++) { + for (i = 0; i <= IFCOUNTERS; i++, pval++) { vdiff = ifp->if_get_counter(ifp, i) - *pval; - sc->detached_counters.val[i - 1] += vdiff; + sc->detached_counters.val[i] += vdiff; } /* Finally, remove the port from the lagg */ @@ -1023,8 +1023,8 @@ lagg_get_counter(struct ifnet *ifp, ift_ struct rm_priotracker tracker; uint64_t newval, oldval, vsum; - if (cnt <= 0 || cnt > IFCOUNTER_LAST) - return (if_get_counter_default(ifp, cnt)); + /* Revise this when we've got non-generic counters. */ + KASSERT(cnt < IFCOUNTERS, ("%s: invalid cnt %d", __func__, cnt)); sc = (struct lagg_softc *)ifp->if_softc; LAGG_RLOCK(sc, &tracker); @@ -1032,7 +1032,7 @@ lagg_get_counter(struct ifnet *ifp, ift_ vsum = 0; SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { /* Saved attached value */ - oldval = lp->port_counters.val[cnt - 1]; + oldval = lp->port_counters.val[cnt]; /* current value */ lpifp = lp->lp_ifp; newval = lpifp->if_get_counter(lpifp, cnt); @@ -1049,7 +1049,7 @@ lagg_get_counter(struct ifnet *ifp, ift_ /* * Add counter data from detached ports counters */ - vsum += sc->detached_counters.val[cnt - 1]; + vsum += sc->detached_counters.val[cnt]; LAGG_RUNLOCK(sc, &tracker); Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Sun Sep 28 08:23:26 2014 (r272243) +++ head/sys/net/if_lagg.h Sun Sep 28 08:57:07 2014 (r272244) @@ -186,7 +186,7 @@ struct lagg_llq { }; struct lagg_counters { - uint64_t val[IFCOUNTER_LAST]; + uint64_t val[IFCOUNTERS]; }; struct lagg_softc { Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Sep 28 08:23:26 2014 (r272243) +++ head/sys/net/if_var.h Sun Sep 28 08:57:07 2014 (r272244) @@ -96,7 +96,7 @@ VNET_DECLARE(struct pfil_head, link_pfil #endif /* _KERNEL */ typedef enum { - IFCOUNTER_IPACKETS = 1, + IFCOUNTER_IPACKETS = 0, IFCOUNTER_IERRORS, IFCOUNTER_OPACKETS, IFCOUNTER_OERRORS, @@ -108,8 +108,8 @@ typedef enum { IFCOUNTER_IQDROPS, IFCOUNTER_OQDROPS, IFCOUNTER_NOPROTO, + IFCOUNTERS /* Array size. */ } ift_counter; -#define IFCOUNTER_LAST IFCOUNTER_NOPROTO typedef struct ifnet * if_t; @@ -228,28 +228,15 @@ struct ifnet { (struct ifnet *, struct vnet *, char *); if_get_counter_t if_get_counter; /* get counter values */ + /* Statistics. */ + counter_u64_t if_counters[IFCOUNTERS]; + /* Stuff that's only temporary and doesn't belong here. */ u_int if_hw_tsomax; /* TSO total burst length * limit in bytes. A value of * zero means no limit. Have * to find a better place for * it eventually. */ - /* - * Old, racy and expensive statistics, should not be used in - * new drivers. - */ - uint64_t if_ipackets; /* packets received on interface */ - uint64_t if_ierrors; /* input errors on interface */ - uint64_t if_opackets; /* packets sent on interface */ - uint64_t if_oerrors; /* output errors on interface */ - uint64_t if_collisions; /* collisions on csma interfaces */ - uint64_t if_ibytes; /* total number of octets received */ - uint64_t if_obytes; /* total number of octets sent */ - uint64_t if_imcasts; /* packets received via multicast */ - uint64_t if_omcasts; /* packets sent via multicast */ - uint64_t if_iqdrops; /* dropped on input */ - uint64_t if_oqdrops; /* dropped on output */ - uint64_t if_noproto; /* destined for unsupported protocol */ /* TSO fields for segment limits. If a field is zero below, there is no limit. */ u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */ Modified: head/sys/net/ifq.h ============================================================================== --- head/sys/net/ifq.h Sun Sep 28 08:23:26 2014 (r272243) +++ head/sys/net/ifq.h Sun Sep 28 08:57:07 2014 (r272244) @@ -41,7 +41,12 @@ #include /* XXX */ #include /* struct ifqueue */ +/* + * Couple of ugly extra definitions that are required since ifq.h + * is splitted from if_var.h. + */ #define IF_DUNIT_NONE -1 +void if_inc_counter(struct ifnet *, ift_counter, int64_t inc); #include @@ -245,13 +250,13 @@ do { \ mflags = (m)->m_flags; \ IFQ_ENQUEUE(&(ifp)->if_snd, m, err); \ if ((err) == 0) { \ - (ifp)->if_obytes += len + (adj); \ + if_inc_counter((ifp), IFCOUNTER_OBYTES, len + (adj)); \ if (mflags & M_MCAST) \ - (ifp)->if_omcasts++; \ + if_inc_counter((ifp), IFCOUNTER_OMCASTS, 1); \ if (((ifp)->if_drv_flags & IFF_DRV_OACTIVE) == 0) \ if_start(ifp); \ } else \ - ifp->if_oqdrops++; \ + if_inc_counter((ifp), IFCOUNTER_OQDROPS, 1); \ } while (0) #define IFQ_HANDOFF(ifp, m, err) \ @@ -318,7 +323,7 @@ drbr_enqueue(struct ifnet *ifp, struct b if (ALTQ_IS_ENABLED(&ifp->if_snd)) { IFQ_ENQUEUE(&ifp->if_snd, m, error); if (error) - ifp->if_oqdrops++; + if_inc_counter((ifp), IFCOUNTER_OQDROPS, 1); return (error); } #endif From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 08:59:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43E2E496; Sun, 28 Sep 2014 08:59:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3086E7C5; Sun, 28 Sep 2014 08:59: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 s8S8xdMw011447; Sun, 28 Sep 2014 08:59:39 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8S8xd2t011446; Sun, 28 Sep 2014 08:59:39 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201409280859.s8S8xd2t011446@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 28 Sep 2014 08:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272245 - head/rescue/rescue X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 28 Sep 2014 08:59:39 -0000 Author: nyan Date: Sun Sep 28 08:59:38 2014 New Revision: 272245 URL: http://svnweb.freebsd.org/changeset/base/272245 Log: Remove duplicate prog. Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Sun Sep 28 08:57:07 2014 (r272244) +++ head/rescue/rescue/Makefile Sun Sep 28 08:59:38 2014 (r272245) @@ -137,7 +137,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel .endif .if ${MACHINE} == "pc98" -CRUNCH_PROGS_sbin+= bsdlabel CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98 .endif From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 09:16:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 924D2843; Sun, 28 Sep 2014 09:16:30 +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 164D294D; Sun, 28 Sep 2014 09:16:28 +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 s8S9GPX3057815 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 28 Sep 2014 13:16:25 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8S9GPUO057814; Sun, 28 Sep 2014 13:16:25 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 28 Sep 2014 13:16:25 +0400 From: Gleb Smirnoff To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r272244 - head/sys/net Message-ID: <20140928091625.GU884@FreeBSD.org> References: <201409280857.s8S8v8cG011117@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409280857.s8S8v8cG011117@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 28 Sep 2014 09:16:30 -0000 On Sun, Sep 28, 2014 at 08:57:08AM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Sun Sep 28 08:57:07 2014 T> New Revision: 272244 T> URL: http://svnweb.freebsd.org/changeset/base/272244 T> T> Log: T> Finally, convert counters in struct ifnet to counter(9). T> T> Sponsored by: Netflix T> Sponsored by: Nginx, Inc. Now the network stack is 99% free of old style ++ on a global variable, that trashes cache line and is racy. The last remnant is queue drop counter in buf_ring(9), which would be probably addressed when interface queuing is generalized. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 11:10:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1B46A9; Sun, 28 Sep 2014 11:10: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 84B74335; Sun, 28 Sep 2014 11: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 s8SBAcZU072256; Sun, 28 Sep 2014 11:10:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SBAcEI072255; Sun, 28 Sep 2014 11:10:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409281110.s8SBAcEI072255@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 28 Sep 2014 11:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272247 - 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: Sun, 28 Sep 2014 11:10:38 -0000 Author: mav Date: Sun Sep 28 11:10:37 2014 New Revision: 272247 URL: http://svnweb.freebsd.org/changeset/base/272247 Log: Do not transfer unneeded training zero bytes in INQUIRY response. It is an addition to r269631. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Sep 28 11:08:32 2014 (r272246) +++ head/sys/cam/ctl/ctl.c Sun Sep 28 11:10:37 2014 (r272247) @@ -10480,7 +10480,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio struct ctl_softc *ctl_softc; struct ctl_lun *lun; char *val; - uint32_t alloc_len; + uint32_t alloc_len, data_len; ctl_port_type port_type; ctl_softc = control_softc; @@ -10504,16 +10504,17 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * in. If the user only asks for less, we'll give him * that much. */ - ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK | M_ZERO); + data_len = offsetof(struct scsi_inquiry_data, vendor_specific1); + ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); inq_ptr = (struct scsi_inquiry_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; - if (sizeof(*inq_ptr) < alloc_len) { - ctsio->residual = alloc_len - sizeof(*inq_ptr); - ctsio->kern_data_len = sizeof(*inq_ptr); - ctsio->kern_total_len = sizeof(*inq_ptr); + if (data_len < alloc_len) { + ctsio->residual = alloc_len - data_len; + ctsio->kern_data_len = data_len; + ctsio->kern_total_len = data_len; } else { ctsio->residual = 0; ctsio->kern_data_len = alloc_len; @@ -10593,8 +10594,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio */ inq_ptr->response_format = SID_HiSup | 2; - inq_ptr->additional_length = - offsetof(struct scsi_inquiry_data, vendor_specific1) - + inq_ptr->additional_length = data_len - (offsetof(struct scsi_inquiry_data, additional_length) + 1); CTL_DEBUG_PRINT(("additional_length = %d\n", inq_ptr->additional_length)); From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 11:32:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 464F7388; Sun, 28 Sep 2014 11:32:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32F827AC; Sun, 28 Sep 2014 11:32: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 s8SBWlv9085167; Sun, 28 Sep 2014 11:32:47 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SBWkmt085165; Sun, 28 Sep 2014 11:32:46 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201409281132.s8SBWkmt085165@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 28 Sep 2014 11:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272248 - in head: sys/sys usr.sbin/fdread X-SVN-Group: head MIME-Version: 1.0 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, 28 Sep 2014 11:32:47 -0000 Author: nyan Date: Sun Sep 28 11:32:46 2014 New Revision: 272248 URL: http://svnweb.freebsd.org/changeset/base/272248 Log: - Cleanups pc98 code. - Remove unworked formats. Modified: head/sys/sys/fdcio.h head/usr.sbin/fdread/fdutil.c Modified: head/sys/sys/fdcio.h ============================================================================== --- head/sys/sys/fdcio.h Sun Sep 28 11:10:37 2014 (r272247) +++ head/sys/sys/fdcio.h Sun Sep 28 11:32:46 2014 (r272248) @@ -181,27 +181,17 @@ enum fd_drivetype { * XXX: should have been done 20 years ago to make sense. */ #ifdef PC98 -#define FDF_3_1722 21,2,0xFF,0x04,82,0,2,2,0x0C,2,0,FL_MFM -#define FDF_3_1476 18,2,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1440 18,2,0xFF,0x1B,80,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_3_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_3_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_3_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_3_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1480 9,3,0xFF,0x35,82,0,0,2,0x47,1,0,FL_MFM -#define FDF_3_1640 10,3,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_5_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_5_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_5_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_5_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_5_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_5_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM #else /* PC98 */ #define FDF_3_2880 36,2,0xFF,0x1B,80,0,FDC_1MBPS,002,0x4C,1,1,FL_MFM|FL_PERPND #define FDF_3_1722 21,2,0xFF,0x04,82,0,FDC_500KBPS,2,0x0C,2,0,FL_MFM Modified: head/usr.sbin/fdread/fdutil.c ============================================================================== --- head/usr.sbin/fdread/fdutil.c Sun Sep 28 11:10:37 2014 (r272247) +++ head/usr.sbin/fdread/fdutil.c Sun Sep 28 11:32:46 2014 (r272248) @@ -92,6 +92,7 @@ static struct fd_type fd_types_auto[1] = static struct fd_type fd_types_288m[] = { +#ifndef PC98 #if 0 { FDF_3_2880 }, #endif @@ -102,30 +103,18 @@ static struct fd_type fd_types_288m[] = { FDF_3_820 }, { FDF_3_800 }, { FDF_3_720 }, +#endif /* !PC98 */ { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_144m[] = { #ifdef PC98 -#if 0 - { FDF_3_1722 }, - { FDF_3_1476 }, -#endif { FDF_3_1440 }, { FDF_3_1200 }, -#if 0 - { FDF_3_820 }, - { FDF_3_800 }, -#endif { FDF_3_720 }, { FDF_3_360 }, { FDF_3_640 }, { FDF_3_1230 }, -#if 0 - { FDF_3_1280 }, - { FDF_3_1480 }, - { FDF_3_1640 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_3_1722 }, @@ -142,17 +131,10 @@ static struct fd_type fd_types_144m[] = static struct fd_type fd_types_12m[] = { #ifdef PC98 { FDF_5_1200 }, -#if 0 - { FDF_5_820 }, - { FDF_5_800 }, -#endif { FDF_5_720 }, { FDF_5_360 }, { FDF_5_640 }, { FDF_5_1230 }, -#if 0 - { FDF_5_1280 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_5_1200 }, @@ -170,13 +152,17 @@ static struct fd_type fd_types_12m[] = { static struct fd_type fd_types_720k[] = { +#ifndef PC98 { FDF_3_720 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_360k[] = { +#ifndef PC98 { FDF_5_360 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 12:12:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86214A69; Sun, 28 Sep 2014 12:12: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 72013AFF; Sun, 28 Sep 2014 12:12: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 s8SCCt4v004229; Sun, 28 Sep 2014 12:12:55 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SCCtXg004228; Sun, 28 Sep 2014 12:12:55 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201409281212.s8SCCtXg004228@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 28 Sep 2014 12:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272249 - head/sys/boot/i386/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 28 Sep 2014 12:12:55 -0000 Author: nyan Date: Sun Sep 28 12:12:54 2014 New Revision: 272249 URL: http://svnweb.freebsd.org/changeset/base/272249 Log: Remove extra '\'. Modified: head/sys/boot/i386/boot2/Makefile Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Sun Sep 28 11:32:46 2014 (r272248) +++ head/sys/boot/i386/boot2/Makefile Sun Sep 28 12:12:54 2014 (r272249) @@ -37,7 +37,7 @@ CFLAGS= -Os \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline \ + -Winline CFLAGS.gcc+= -fno-guess-branch-probability \ -fno-unit-at-a-time \ From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 12:13:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 750A6BB3; Sun, 28 Sep 2014 12:13: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 60E58B08; Sun, 28 Sep 2014 12:13: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 s8SCDqgP004457; Sun, 28 Sep 2014 12:13:52 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SCDqsB004456; Sun, 28 Sep 2014 12:13:52 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201409281213.s8SCDqsB004456@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 28 Sep 2014 12:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272250 - head/sys/boot/pc98/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 28 Sep 2014 12:13:52 -0000 Author: nyan Date: Sun Sep 28 12:13:51 2014 New Revision: 272250 URL: http://svnweb.freebsd.org/changeset/base/272250 Log: Reduce diffs against i386. Modified: head/sys/boot/pc98/boot2/Makefile Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Sun Sep 28 12:12:54 2014 (r272249) +++ head/sys/boot/pc98/boot2/Makefile Sun Sep 28 12:13:51 2014 (r272250) @@ -2,10 +2,6 @@ .include -# XXX: clang can compile the boot code just fine, but boot2 gets too big -#CC:= gcc -#COMPILER_TYPE:= gcc - FILES= boot boot1 boot2 NM?= nm @@ -114,4 +110,5 @@ boot2.h: boot1.out .include # XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${CLANG_NO_IAS} +CFLAGS.boot1.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 12:25:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94A50F24; Sun, 28 Sep 2014 12:25:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8042CBFA; Sun, 28 Sep 2014 12:25: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 s8SCPSQg012517; Sun, 28 Sep 2014 12:25:28 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SCPSl2012516; Sun, 28 Sep 2014 12:25:28 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201409281225.s8SCPSl2012516@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 28 Sep 2014 12:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272252 - head/sys/boot/pc98/cdboot X-SVN-Group: head MIME-Version: 1.0 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, 28 Sep 2014 12:25:28 -0000 Author: nyan Date: Sun Sep 28 12:25:27 2014 New Revision: 272252 URL: http://svnweb.freebsd.org/changeset/base/272252 Log: MFi386: r261520 Drop the 3rd clause from all 3 clause BSD licenses. Modified: head/sys/boot/pc98/cdboot/cdboot.S Modified: head/sys/boot/pc98/cdboot/cdboot.S ============================================================================== --- head/sys/boot/pc98/cdboot/cdboot.S Sun Sep 28 12:18:21 2014 (r272251) +++ head/sys/boot/pc98/cdboot/cdboot.S Sun Sep 28 12:25:27 2014 (r272252) @@ -11,9 +11,6 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. Neither the name of the author nor the names of any co-contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 12:41:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF67B325; Sun, 28 Sep 2014 12:41: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 D0AA4D79; Sun, 28 Sep 2014 12:41: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 s8SCfmsi021521; Sun, 28 Sep 2014 12:41:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SCfmPK021520; Sun, 28 Sep 2014 12:41:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409281241.s8SCfmPK021520@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 28 Sep 2014 12:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272253 - head/etc/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 28 Sep 2014 12:41:49 -0000 Author: hselasky Date: Sun Sep 28 12:41:48 2014 New Revision: 272253 URL: http://svnweb.freebsd.org/changeset/base/272253 Log: Regenerate usb.conf MFC after: 3 days Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Sun Sep 28 12:25:27 2014 (r272252) +++ head/etc/devd/usb.conf Sun Sep 28 12:41:48 2014 (r272253) @@ -65,7 +65,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x03f0"; - match "product" "(0x2016|0x2116|0x2216|0x3016|0x3116)"; + match "product" "(0x2016|0x2116|0x2216)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x241d|0x251d)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x3016|0x3116)"; action "kldload -n uipaq"; }; @@ -129,7 +145,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0403"; - match "product" "(0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee18|0xeee 8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; + match "product" "(0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee1 8|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; action "kldload -n uftdi"; }; @@ -1057,7 +1073,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0586"; - match "product" "(0x3416|0x341a)"; + match "product" "(0x3416|0x341a|0x341e)"; action "kldload -n if_run"; }; @@ -1097,7 +1113,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05ac"; - match "product" "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c)"; + match "product" "(0x020d|0x020e|0x020f|0x0210|0x0214|0x0215|0x0216|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c)"; action "kldload -n atp"; }; @@ -2353,7 +2369,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0b05"; - match "product" "(0x17b5|0x17cb)"; + match "product" "0x17b5"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "0x17ba"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "0x17cb"; action "kldload -n ng_ubt"; }; @@ -2481,7 +2513,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "(0x018a|0x317f)"; + match "product" "(0x0179|0x018a|0x317f)"; action "kldload -n if_urtwn"; }; @@ -2513,7 +2545,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "(0x8176|0x8176|0x8177|0x8178|0x817a|0x817b|0x817c|0x817d|0x817e)"; + match "product" "(0x8176|0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0x817e)"; action "kldload -n if_urtwn"; }; @@ -2929,6 +2961,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0df6"; + match "product" "0x0072"; + action "kldload -n if_axge"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; match "product" "0x061c"; action "kldload -n if_axe"; }; @@ -3577,7 +3617,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x12d1"; - match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1464|0x1465|0x14ac|0x14c9|0x14d1|0x14fe|0x1505|0x1506|0x1520|0x1521|0x1803|0x1c05|0x1c0b)"; + match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1464|0x1465|0x14ac|0x14c9|0x14d1|0x14fe|0x1505|0x1506|0x1520|0x1521)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "product" "0x155b"; + action "kldload -n if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "product" "(0x1803|0x1c05|0x1c0b)"; action "kldload -n u3g"; }; @@ -3753,7 +3809,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1410"; - match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5020|0x5041|0x5100|0x6000|0x6002|0x7042)"; + match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5020|0x5041|0x5100|0x6000|0x6002|0x7001|0x7031|0x7042)"; action "kldload -n u3g"; }; @@ -4553,7 +4609,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1cf1"; - match "product" "(0x0001|0x0004)"; + match "product" "(0x0001|0x0004|0x0022)"; action "kldload -n uftdi"; }; @@ -4568,6 +4624,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1d34"; + match "product" "0x0004"; + action "kldload -n uled"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1d4d"; match "product" "(0x0002|0x000c|0x000e|0x0010)"; action "kldload -n if_run"; @@ -4633,7 +4697,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x3307|0x3308|0x3309|0x330a|0x330d)"; + match "product" "(0x3307|0x3308|0x3309|0x330a|0x330d|0x330f)"; action "kldload -n if_urtwn"; }; @@ -4665,7 +4729,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1a|0x3c1b|0x3c1f)"; + match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1a|0x3c1b|0x3c1f|0x3c20)"; action "kldload -n if_run"; }; @@ -4689,6 +4753,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; + match "product" "0x4a00"; + action "kldload -n if_axge"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; match "product" "(0x7e12|0xa805)"; action "kldload -n u3g"; }; @@ -5232,6 +5304,36 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; + match "intprotocol" "0x16"; + action "kldload -n if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; + match "intprotocol" "0x46"; + action "kldload -n if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "intclass" "0xff"; + match "intsubclass" "0x02"; + match "intprotocol" "0x76"; + action "kldload -n if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "intclass" "0x02"; match "intsubclass" "0x02"; match "intprotocol" "0x00"; @@ -5399,5 +5501,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2621 USB entries processed +# 2643 USB entries processed From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 12:55:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DF5E60C; Sun, 28 Sep 2014 12:55: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 590B7E59; Sun, 28 Sep 2014 12:55: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 s8SCtERh026693; Sun, 28 Sep 2014 12:55:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SCtDxH026691; Sun, 28 Sep 2014 12:55:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409281255.s8SCtDxH026691@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 28 Sep 2014 12:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272254 - 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: Sun, 28 Sep 2014 12:55:14 -0000 Author: hselasky Date: Sun Sep 28 12:55:13 2014 New Revision: 272254 URL: http://svnweb.freebsd.org/changeset/base/272254 Log: Instead of creating the full range of possible ports, try to figure out the actual number of so-called "embedded jacks" which are present when a USB MIDI device is attaching. MFC after: 3 days Modified: head/sys/dev/sound/usb/uaudio.c head/sys/dev/sound/usb/uaudioreg.h Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Sun Sep 28 12:41:48 2014 (r272253) +++ head/sys/dev/sound/usb/uaudio.c Sun Sep 28 12:55:13 2014 (r272254) @@ -232,7 +232,7 @@ struct uaudio_chan { #define UAUDIO_SYNC_LESS 2 }; -#define UMIDI_CABLES_MAX 16 /* units */ +#define UMIDI_EMB_JACK_MAX 16 /* units */ #define UMIDI_TX_FRAMES 256 /* units */ #define UMIDI_TX_BUFFER (UMIDI_TX_FRAMES * 4) /* bytes */ @@ -263,7 +263,7 @@ struct umidi_sub_chan { struct umidi_chan { - struct umidi_sub_chan sub[UMIDI_CABLES_MAX]; + struct umidi_sub_chan sub[UMIDI_EMB_JACK_MAX]; struct mtx mtx; struct usb_xfer *xfer[UMIDI_N_TRANSFER]; @@ -275,7 +275,7 @@ struct umidi_chan { uint8_t write_open_refcount; uint8_t curr_cable; - uint8_t max_cable; + uint8_t max_emb_jack; uint8_t valid; uint8_t single_command; }; @@ -1481,6 +1481,7 @@ uaudio_chan_fill_info_sub(struct uaudio_ union uaudio_asid asid = { NULL }; union uaudio_asf1d asf1d = { NULL }; union uaudio_sed sed = { NULL }; + struct usb_midi_streaming_endpoint_descriptor *msid = NULL; usb_endpoint_descriptor_audio_t *ed1 = NULL; const struct usb_audio_control_descriptor *acdp = NULL; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); @@ -1498,6 +1499,7 @@ uaudio_chan_fill_info_sub(struct uaudio_ uint8_t bChannels; uint8_t bBitResolution; uint8_t audio_if = 0; + uint8_t midi_if = 0; uint8_t uma_if_class; while ((desc = usb_desc_foreach(cd, desc))) { @@ -1533,7 +1535,8 @@ uaudio_chan_fill_info_sub(struct uaudio_ ((id->bInterfaceClass == UICLASS_VENDOR) && (sc->sc_uq_au_vendor_class != 0))); - if ((uma_if_class != 0) && (id->bInterfaceSubClass == UISUBCLASS_AUDIOSTREAM)) { + if ((uma_if_class != 0) && + (id->bInterfaceSubClass == UISUBCLASS_AUDIOSTREAM)) { audio_if = 1; } else { audio_if = 0; @@ -1545,13 +1548,16 @@ uaudio_chan_fill_info_sub(struct uaudio_ /* * XXX could allow multiple MIDI interfaces */ + midi_if = 1; if ((sc->sc_midi_chan.valid == 0) && - usbd_get_iface(udev, curidx)) { + (usbd_get_iface(udev, curidx) != NULL)) { sc->sc_midi_chan.iface_index = curidx; sc->sc_midi_chan.iface_alt_index = alt_index; sc->sc_midi_chan.valid = 1; } + } else { + midi_if = 0; } asid.v1 = NULL; asf1d.v1 = NULL; @@ -1560,14 +1566,25 @@ uaudio_chan_fill_info_sub(struct uaudio_ } if (audio_if == 0) { - if ((acdp == NULL) && - (desc->bDescriptorType == UDESC_CS_INTERFACE) && - (desc->bDescriptorSubtype == UDESCSUB_AC_HEADER) && - (desc->bLength >= sizeof(*acdp))) { - acdp = (void *)desc; - audio_rev = UGETW(acdp->bcdADC); - } + if (midi_if == 0) { + if ((acdp == NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && + (desc->bDescriptorSubtype == UDESCSUB_AC_HEADER) && + (desc->bLength >= sizeof(*acdp))) { + acdp = (void *)desc; + audio_rev = UGETW(acdp->bcdADC); + } + } else { + msid = (void *)desc; + /* get the maximum number of embedded jacks in use, if any */ + if (msid->bLength >= sizeof(*msid) && + msid->bDescriptorType == UDESC_CS_ENDPOINT && + msid->bDescriptorSubtype == MS_GENERAL && + msid->bNumEmbMIDIJack > sc->sc_midi_chan.max_emb_jack) { + sc->sc_midi_chan.max_emb_jack = msid->bNumEmbMIDIJack; + } + } /* * Don't collect any USB audio descriptors if * this is not an USB audio stream interface. @@ -5219,8 +5236,7 @@ umidi_bulk_read_callback(struct usb_xfer */ sub = &chan->sub[cn]; - if ((cmd_len != 0) && - (cn < chan->max_cable) && + if ((cmd_len != 0) && (cn < chan->max_emb_jack) && (sub->read_open != 0)) { /* Send data to the application */ @@ -5456,7 +5472,7 @@ tr_setup: } chan->curr_cable++; - if (chan->curr_cable >= chan->max_cable) + if (chan->curr_cable >= chan->max_emb_jack) chan->curr_cable = 0; if (chan->curr_cable == start_cable) { @@ -5493,7 +5509,7 @@ umidi_sub_by_fifo(struct usb_fifo *fifo) struct umidi_sub_chan *sub; uint32_t n; - for (n = 0; n < UMIDI_CABLES_MAX; n++) { + for (n = 0; n < UMIDI_EMB_JACK_MAX; n++) { sub = &chan->sub[n]; if ((sub->fifo.fp[USB_FIFO_RX] == fifo) || (sub->fifo.fp[USB_FIFO_TX] == fifo)) { @@ -5676,12 +5692,12 @@ umidi_probe(device_t dev) if (chan->single_command != 0) device_printf(dev, "Single command MIDI quirk enabled\n"); - if ((chan->max_cable > UMIDI_CABLES_MAX) || - (chan->max_cable == 0)) { - chan->max_cable = UMIDI_CABLES_MAX; + if ((chan->max_emb_jack == 0) || + (chan->max_emb_jack > UMIDI_EMB_JACK_MAX)) { + chan->max_emb_jack = UMIDI_EMB_JACK_MAX; } - for (n = 0; n < chan->max_cable; n++) { + for (n = 0; n < chan->max_emb_jack; n++) { sub = &chan->sub[n]; @@ -5719,9 +5735,8 @@ umidi_detach(device_t dev) struct umidi_chan *chan = &sc->sc_midi_chan; uint32_t n; - for (n = 0; n < UMIDI_CABLES_MAX; n++) { + for (n = 0; n < UMIDI_EMB_JACK_MAX; n++) usb_fifo_detach(&chan->sub[n].fifo); - } mtx_lock(&chan->mtx); Modified: head/sys/dev/sound/usb/uaudioreg.h ============================================================================== --- head/sys/dev/sound/usb/uaudioreg.h Sun Sep 28 12:41:48 2014 (r272253) +++ head/sys/dev/sound/usb/uaudioreg.h Sun Sep 28 12:55:13 2014 (r272254) @@ -119,6 +119,13 @@ struct usb_audio_streaming_endpoint_desc uWord wLockDelay; } __packed; +struct usb_midi_streaming_endpoint_descriptor { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bNumEmbMIDIJack; +} __packed; + struct usb_audio_streaming_type1_descriptor { uByte bLength; uByte bDescriptorType; @@ -378,6 +385,7 @@ struct usb_audio_extension_unit_1 { #define MASTER_CHAN 0 +#define MS_GENERAL 1 #define AS_GENERAL 1 #define FORMAT_TYPE 2 #define FORMAT_SPECIFIC 3 From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 13:13:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20239B5B; Sun, 28 Sep 2014 13:13:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BDEA1000; Sun, 28 Sep 2014 13:13: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 s8SDDIcq036214; Sun, 28 Sep 2014 13:13:18 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SDDIW0036213; Sun, 28 Sep 2014 13:13:18 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201409281313.s8SDDIW0036213@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 28 Sep 2014 13:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272255 - head/sys/boot/pc98/libpc98 X-SVN-Group: head MIME-Version: 1.0 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, 28 Sep 2014 13:13:19 -0000 Author: nyan Date: Sun Sep 28 13:13:18 2014 New Revision: 272255 URL: http://svnweb.freebsd.org/changeset/base/272255 Log: MFi386: r268974 Supress clang warning for FreeBSD printf %b and %D formats. Modified: head/sys/boot/pc98/libpc98/Makefile Modified: head/sys/boot/pc98/libpc98/Makefile ============================================================================== --- head/sys/boot/pc98/libpc98/Makefile Sun Sep 28 12:55:13 2014 (r272254) +++ head/sys/boot/pc98/libpc98/Makefile Sun Sep 28 13:13:18 2014 (r272255) @@ -44,4 +44,7 @@ CFLAGS+= -I${.CURDIR}/../../common \ # the location of libstand CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +# Suppress warning from clang for FreeBSD %b and %D formats +CFLAGS+= -fformat-extensions + .include From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 13:34:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D573AEEC; Sun, 28 Sep 2014 13:34:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C118F21B; Sun, 28 Sep 2014 13:34: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 s8SDYix4045811; Sun, 28 Sep 2014 13:34:44 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SDYiht045809; Sun, 28 Sep 2014 13:34:44 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201409281334.s8SDYiht045809@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 28 Sep 2014 13:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272256 - in head/sys/boot: . pc98/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 28 Sep 2014 13:34:44 -0000 Author: nyan Date: Sun Sep 28 13:34:43 2014 New Revision: 272256 URL: http://svnweb.freebsd.org/changeset/base/272256 Log: MFi386: r261567 Switch from lib/libstand to sys/boot/libstand32. Modified: head/sys/boot/Makefile.pc98 head/sys/boot/pc98/loader/Makefile Modified: head/sys/boot/Makefile.pc98 ============================================================================== --- head/sys/boot/Makefile.pc98 Sun Sep 28 13:13:18 2014 (r272255) +++ head/sys/boot/Makefile.pc98 Sun Sep 28 13:34:43 2014 (r272256) @@ -1,4 +1,3 @@ # $FreeBSD$ -# Blank, to override Makefile.i386 since Makefile.$MACHINE is included before -# Makefile.$MACHINE_ARCH +SUBDIR+= libstand32 Modified: head/sys/boot/pc98/loader/Makefile ============================================================================== --- head/sys/boot/pc98/loader/Makefile Sun Sep 28 13:13:18 2014 (r272255) +++ head/sys/boot/pc98/loader/Makefile Sun Sep 28 13:34:43 2014 (r272256) @@ -56,6 +56,8 @@ LDFLAGS= -static -Ttext 0x0 LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a CFLAGS+= -I${.CURDIR}/.. +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a + # BTX components CFLAGS+= -I${.CURDIR}/../btx/lib From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 14:05:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16CAE32B; Sun, 28 Sep 2014 14:05: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 015EF66A; Sun, 28 Sep 2014 14:05: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 s8SE5Kcm059810; Sun, 28 Sep 2014 14:05:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SE5IlR059799; Sun, 28 Sep 2014 14:05:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409281405.s8SE5IlR059799@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 28 Sep 2014 14:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272257 - in head/sys: dev/bge dev/e1000 dev/fxp dev/nfe kern net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 28 Sep 2014 14:05:21 -0000 Author: glebius Date: Sun Sep 28 14:05:18 2014 New Revision: 272257 URL: http://svnweb.freebsd.org/changeset/base/272257 Log: - Remove empty wrappers ether_poll_[de]register_drv(). [1] - Move polling(9) declarations out of ifq.h back to if_var.h they are absolutely unrelated to queues. Submitted by: Mikhail [1] Modified: head/sys/dev/bge/if_bge.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_lem.c head/sys/dev/fxp/if_fxp.c head/sys/dev/nfe/if_nfe.c head/sys/kern/kern_poll.c head/sys/net/if_var.h head/sys/net/ifq.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/dev/bge/if_bge.c Sun Sep 28 14:05:18 2014 (r272257) @@ -5828,7 +5828,7 @@ bge_ioctl(if_t ifp, u_long command, cadd #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { - error = ether_poll_register_drv(bge_poll, ifp); + error = ether_poll_register(bge_poll, ifp); if (error) return (error); BGE_LOCK(sc); Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/dev/e1000/if_em.c Sun Sep 28 14:05:18 2014 (r272257) @@ -307,7 +307,7 @@ static int em_sysctl_eee(SYSCTL_HANDLER_ static __inline void em_rx_discard(struct rx_ring *, int); #ifdef DEVICE_POLLING -static poll_handler_drv_t em_poll; +static poll_handler_t em_poll; #endif /* POLLING */ /********************************************************************* @@ -787,7 +787,7 @@ em_detach(device_t dev) #ifdef DEVICE_POLLING if (if_getcapenable(ifp) & IFCAP_POLLING) - ether_poll_deregister_drv(ifp); + ether_poll_deregister(ifp); #endif if (adapter->led_dev != NULL) @@ -1208,7 +1208,7 @@ em_ioctl(if_t ifp, u_long command, caddr #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { - error = ether_poll_register_drv(em_poll, ifp); + error = ether_poll_register(em_poll, ifp); if (error) return (error); EM_CORE_LOCK(adapter); @@ -1216,7 +1216,7 @@ em_ioctl(if_t ifp, u_long command, caddr if_setcapenablebit(ifp, IFCAP_POLLING, 0); EM_CORE_UNLOCK(adapter); } else { - error = ether_poll_deregister_drv(ifp); + error = ether_poll_deregister(ifp); /* Enable interrupt even in error case */ EM_CORE_LOCK(adapter); em_enable_intr(adapter); Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/dev/e1000/if_lem.c Sun Sep 28 14:05:18 2014 (r272257) @@ -260,7 +260,7 @@ static void lem_add_rx_process_limit(str const char *, int *, int); #ifdef DEVICE_POLLING -static poll_handler_drv_t lem_poll; +static poll_handler_t lem_poll; #endif /* POLLING */ /********************************************************************* @@ -789,7 +789,7 @@ lem_detach(device_t dev) #ifdef DEVICE_POLLING if (if_getcapenable(ifp) & IFCAP_POLLING) - ether_poll_deregister_drv(ifp); + ether_poll_deregister(ifp); #endif if (adapter->led_dev != NULL) @@ -1119,7 +1119,7 @@ lem_ioctl(if_t ifp, u_long command, cadd #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { - error = ether_poll_register_drv(lem_poll, ifp); + error = ether_poll_register(lem_poll, ifp); if (error) return (error); EM_CORE_LOCK(adapter); @@ -1127,7 +1127,7 @@ lem_ioctl(if_t ifp, u_long command, cadd if_setcapenablebit(ifp, IFCAP_POLLING, 0); EM_CORE_UNLOCK(adapter); } else { - error = ether_poll_deregister_drv(ifp); + error = ether_poll_deregister(ifp); /* Enable interrupt even in error case */ EM_CORE_LOCK(adapter); lem_enable_intr(adapter); Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/dev/fxp/if_fxp.c Sun Sep 28 14:05:18 2014 (r272257) @@ -1008,7 +1008,7 @@ fxp_detach(device_t dev) #ifdef DEVICE_POLLING if (if_getcapenable(sc->ifp) & IFCAP_POLLING) - ether_poll_deregister_drv(sc->ifp); + ether_poll_deregister(sc->ifp); #endif FXP_LOCK(sc); @@ -1670,7 +1670,7 @@ fxp_encap(struct fxp_softc *sc, struct m } #ifdef DEVICE_POLLING -static poll_handler_drv_t fxp_poll; +static poll_handler_t fxp_poll; static int fxp_poll(if_t ifp, enum poll_cmd cmd, int count) @@ -2890,7 +2890,7 @@ fxp_ioctl(if_t ifp, u_long command, cadd #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { - error = ether_poll_register_drv(fxp_poll, ifp); + error = ether_poll_register(fxp_poll, ifp); if (error) return(error); FXP_LOCK(sc); @@ -2899,7 +2899,7 @@ fxp_ioctl(if_t ifp, u_long command, cadd if_setcapenablebit(ifp, IFCAP_POLLING, 0); FXP_UNLOCK(sc); } else { - error = ether_poll_deregister_drv(ifp); + error = ether_poll_deregister(ifp); /* Enable interrupts in any case */ FXP_LOCK(sc); CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, 0); Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/dev/nfe/if_nfe.c Sun Sep 28 14:05:18 2014 (r272257) @@ -1630,7 +1630,7 @@ nfe_free_tx_ring(struct nfe_softc *sc, s } #ifdef DEVICE_POLLING -static poll_handler_drv_t nfe_poll; +static poll_handler_t nfe_poll; static int @@ -1782,7 +1782,7 @@ nfe_ioctl(if_t ifp, u_long cmd, caddr_t #ifdef DEVICE_POLLING if ((mask & IFCAP_POLLING) != 0) { if ((ifr->ifr_reqcap & IFCAP_POLLING) != 0) { - error = ether_poll_register_drv(nfe_poll, ifp); + error = ether_poll_register(nfe_poll, ifp); if (error) break; NFE_LOCK(sc); Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/kern/kern_poll.c Sun Sep 28 14:05:18 2014 (r272257) @@ -451,19 +451,6 @@ netisr_poll(void) mtx_unlock(&poll_mtx); } -/* The following should be temporary, till all drivers use the driver API */ -int -ether_poll_register_drv(poll_handler_drv_t *h, if_t ifh) -{ - return (ether_poll_register((poll_handler_t *)h, (struct ifnet *)ifh)); -} - -int -ether_poll_deregister_drv(if_t ifh) -{ - return (ether_poll_deregister((struct ifnet *)ifh)); -} - /* * Try to register routine for polling. Returns 0 if successful * (and polling should be enabled), error code otherwise. @@ -472,7 +459,7 @@ ether_poll_deregister_drv(if_t ifh) * This is called from within the *_ioctl() functions. */ int -ether_poll_register(poll_handler_t *h, struct ifnet *ifp) +ether_poll_register(poll_handler_t *h, if_t ifp) { int i; @@ -519,7 +506,7 @@ ether_poll_register(poll_handler_t *h, s * Remove interface from the polling list. Called from *_ioctl(), too. */ int -ether_poll_deregister(struct ifnet *ifp) +ether_poll_deregister(if_t ifp) { int i; Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/net/if_var.h Sun Sep 28 14:05:18 2014 (r272257) @@ -599,5 +599,13 @@ int drbr_enqueue_drv(if_t ifp, struct bu void if_hw_tsomax_common(if_t ifp, struct ifnet_hw_tsomax *); int if_hw_tsomax_update(if_t ifp, struct ifnet_hw_tsomax *); +#ifdef DEVICE_POLLING +enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS }; + +typedef int poll_handler_t(if_t ifp, enum poll_cmd cmd, int count); +int ether_poll_register(poll_handler_t *h, if_t ifp); +int ether_poll_deregister(if_t ifp); +#endif /* DEVICE_POLLING */ + #endif /* _KERNEL */ #endif /* !_NET_IF_VAR_H_ */ Modified: head/sys/net/ifq.h ============================================================================== --- head/sys/net/ifq.h Sun Sep 28 13:34:43 2014 (r272256) +++ head/sys/net/ifq.h Sun Sep 28 14:05:18 2014 (r272257) @@ -481,17 +481,5 @@ void if_qflush(struct ifnet *); void ifq_init(struct ifaltq *, struct ifnet *ifp); void ifq_delete(struct ifaltq *); -#ifdef DEVICE_POLLING -enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS }; - -typedef int poll_handler_t(struct ifnet *ifp, enum poll_cmd cmd, int count); -int ether_poll_register(poll_handler_t *h, struct ifnet *ifp); -int ether_poll_deregister(struct ifnet *ifp); -/* The following should be temporary, till all drivers use the driver API */ -typedef int poll_handler_drv_t(if_t ifh, enum poll_cmd cmd, int count); -int ether_poll_register_drv(poll_handler_drv_t *h, if_t ifh); -int ether_poll_deregister_drv(if_t ifh); -#endif /* DEVICE_POLLING */ - #endif /* _KERNEL */ #endif /* !_NET_IFQ_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 14:25:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F3878BE; Sun, 28 Sep 2014 14:25: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 5AF3E852; Sun, 28 Sep 2014 14:25: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 s8SEPlut069624; Sun, 28 Sep 2014 14:25:47 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SEPlHe069623; Sun, 28 Sep 2014 14:25:47 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201409281425.s8SEPlHe069623@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 28 Sep 2014 14:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272258 - head/sys/pc98/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, 28 Sep 2014 14:25:47 -0000 Author: nyan Date: Sun Sep 28 14:25:46 2014 New Revision: 272258 URL: http://svnweb.freebsd.org/changeset/base/272258 Log: - Cosmetic changes. - Reduce diffs against i386. Modified: head/sys/pc98/conf/GENERIC Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Sep 28 14:05:18 2014 (r272257) +++ head/sys/pc98/conf/GENERIC Sun Sep 28 14:25:46 2014 (r272258) @@ -66,9 +66,11 @@ options AUDIT # Security event auditi options CAPABILITY_MODE # Capsicum capability mode options CAPABILITIES # Capsicum capabilities options MAC # TrustedBSD MAC Framework -options INCLUDE_CONFIG_FILE # Include this file in kernel -options KDB # Kernel debugger related code -options KDB_TRACE # Print a stack trace for a panic +options INCLUDE_CONFIG_FILE # Include this file in kernel + +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +options KDB_TRACE # Print a stack trace for a panic. # To make an SMP kernel, the next two lines are needed #options SMP # Symmetric MultiProcessor Kernel @@ -81,47 +83,47 @@ device pci device fdc # ATA controllers -device ahci # AHCI-compatible SATA controllers -device ata # Legacy ATA/SATA controllers -options ATA_STATIC_ID # Static device numbering -device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA -device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_STATIC_ID # Static device numbering +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers -device adv # Advansys SCSI adapters -device ahc # AHA2940 and onboard AIC7xxx devices -device esp # AMD Am53C974 (Tekram DC-390(T)) -device isp # Qlogic family -#device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') - -device aic # PC-9801-100 -device ct # host adapter using WD33C93[ABC] chip (C bus) - -device ncv # NCR 53C500 -device nsp # Workbit Ninja SCSI-3 -device stg # TMC 18C30/18C50 +device ahc # AHA2940 and onboard AIC7xxx devices +device esp # AMD Am53C974 (Tekram DC-390(T)) +device isp # Qlogic family +#device ncr # NCR/Symbios Logic +device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') + +device adv # Advansys SCSI adapters +device aic # PC-9801-100 +device ct # host adapter using WD33C93[ABC] chip + +device ncv # NCR 53C500 +device nsp # Workbit Ninja SCSI-3 +device stg # TMC 18C30/18C50 # ATA/SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device ch # SCSI media changers -device da # Direct Access (disks) -device sa # Sequential Access (tape etc) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) -device ses # Enclosure Services (SES and SAF-TE) +device scbus # SCSI bus (required for ATA/SCSI) +device ch # SCSI media changers +device da # Direct Access (disks) +device sa # Sequential Access (tape etc) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) +device ses # Enclosure Services (SES and SAF-TE) # keyboard driver -device pckbd # PC98 keyboard +device pckbd # PC98 keyboard -device gdc # GDC screen +device gdc # GDC screen -device splash # Splash screen and screen saver support +device splash # Splash screen and screen saver support # syscons is the default console driver, resembling an SCO console device sc -#device agp # support several AGP chipsets +#device agp # support several AGP chipsets # Power management support (see NOTES for more options) #device apm @@ -133,114 +135,114 @@ device sc # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support -device cbb # cardbus (yenta) bridge -device pccard # PC Card (16-bit) bus -device cardbus # CardBus (32-bit) bus +device cbb # cardbus (yenta) bridge +device pccard # PC Card (16-bit) bus +device cardbus # CardBus (32-bit) bus # Serial (COM) ports #options COM_MULTIPORT -#options COM_ESP # ESP98 -#device sio # 8250, 16[45]50, 8251 based serial ports -device uart # Generic UART driver +#options COM_ESP # ESP98 +#device sio # 8250, 16[45]50, 8251 based serial ports +device uart # Generic UART driver device mse #device joy -# NEW Parallel port +# Parallel port device ppc -device ppbus # Parallel port bus (required) -device lpt # Printer -device ppi # Parallel port interface device -#device vpo # Requires scbus and da +device ppbus # Parallel port bus (required) +device lpt # Printer +device ppi # Parallel port interface device +#device vpo # Requires scbus and da # OLD Parallel port #device olpt # PCI Ethernet NICs. -device de # DEC/Intel DC21x4x (``Tulip'') -#device em # Intel PRO/1000 adapter Gigabit Ethernet Card -device le # AMD Am7900 LANCE and Am79C9xx PCnet -#device ti # Alteon Networks Tigon I/II gigabit Ethernet -device txp # 3Com 3cR990 (``Typhoon'') -device vx # 3Com 3c590, 3c595 (``Vortex'') +device de # DEC/Intel DC21x4x (``Tulip'') +#device em # Intel PRO/1000 Gigabit Ethernet Family +device le # AMD Am7900 LANCE and Am79C9xx PCnet +#device ti # Alteon Networks Tigon I/II gigabit Ethernet +device txp # 3Com 3cR990 (``Typhoon'') +device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! -device miibus # MII bus support -device bfe # Broadcom BCM440x 10/100 Ethernet -#device bge # Broadcom BCM570xx Gigabit Ethernet -device dc # DEC/Intel 21143 and various workalikes -device fxp # Intel EtherExpress PRO/100B (82557, 82558) -#device lge # Level 1 LXT1001 gigabit Ethernet -#device nge # NatSemi DP83820 gigabit Ethernet -device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') -device re # RealTek 8139C+/8169/8169S/8110S -device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') -device sis # Silicon Integrated Systems SiS 900/SiS 7016 -#device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet -device ste # Sundance ST201 (D-Link DFE-550TX) -device tl # Texas Instruments ThunderLAN -device tx # SMC EtherPower II (83c170 ``EPIC'') -#device vge # VIA VT612x gigabit Ethernet -device vr # VIA Rhine, Rhine II -device wb # Winbond W89C840F -device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') +device miibus # MII bus support +device bfe # Broadcom BCM440x 10/100 Ethernet +#device bge # Broadcom BCM570xx Gigabit Ethernet +device dc # DEC/Intel 21143 and various workalikes +device fxp # Intel EtherExpress PRO/100B (82557, 82558) +#device lge # Level 1 LXT1001 gigabit Ethernet +#device nge # NatSemi DP83820 gigabit Ethernet +device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') +device re # RealTek 8139C+/8169/8169S/8110S +device rl # RealTek 8129/8139 +device sf # Adaptec AIC-6915 (``Starfire'') +device sis # Silicon Integrated Systems SiS 900/SiS 7016 +#device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet +device ste # Sundance ST201 (D-Link DFE-550TX) +device tl # Texas Instruments ThunderLAN +device tx # SMC EtherPower II (83c170 ``EPIC'') +#device vge # VIA VT612x gigabit Ethernet +device vr # VIA Rhine, Rhine II +device wb # Winbond W89C840F +device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. # 'device ed' requires 'device miibus' -device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards -device ep # Etherlink III based cards -device fe # Fujitsu MB8696x based cards -device sn # SMC's 9000 series of Ethernet chips +device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards +device ep # Etherlink III based cards +device fe # Fujitsu MB8696x based cards +device sn # SMC's 9000 series of Ethernet chips device snc -device xe # Xircom pccard Ethernet +device xe # Xircom pccard Ethernet # Wireless NIC cards -#device wlan # 802.11 support -#options IEEE80211_DEBUG # enable debug msgs +#device wlan # 802.11 support +#options IEEE80211_DEBUG # enable debug msgs #options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support -#device wlan_wep # 802.11 WEP support -#device wlan_ccmp # 802.11 CCMP support -#device wlan_tkip # 802.11 TKIP support -#device wlan_amrr # AMRR transmit rate control algorithm -#device an # Aironet 4500/4800 802.11 wireless NICs. -#device ath # Atheros NICs -#device ath_pci # Atheros pci/cardbus glue -#device ath_hal # pci/cardbus chip support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_amrr # AMRR transmit rate control algorithm +#device an # Aironet 4500/4800 802.11 wireless NICs. +#device ath # Atheros NICs +#device ath_pci # Atheros pci/cardbus glue +#device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -#device ath_rate_sample # SampleRate tx rate control for ath -#device ral # Ralink Technology RT2500 wireless NICs. -#device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. -#device wl # Older non 802.11 Wavelan wireless NIC. +#device ath_rate_sample # SampleRate tx rate control for ath +#device ral # Ralink Technology RT2500 wireless NICs. +#device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. +#device wl # Older non 802.11 Wavelan wireless NIC. # Pseudo devices. -device loop # Network loopback -device random # Entropy device -device ether # Ethernet support -device vlan # 802.1Q VLAN support -device tun # Packet tunnel. -device md # Memory "disks" -device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) -device firmware # firmware assist module +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) +device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter +device bpf # Berkeley packet filter # USB support -#options USB_DEBUG # enable debug msgs -#device uhci # UHCI PCI->USB interface -#device ohci # OHCI PCI->USB interface -#device ehci # EHCI PCI->USB interface (USB 2.0) -#device usb # USB Bus (required) -#device ukbd # Keyboard -#device umass # Disks/Mass storage - Requires scbus and da +#options USB_DEBUG # enable debug msgs +#device uhci # UHCI PCI->USB interface +#device ohci # OHCI PCI->USB interface +#device ehci # EHCI PCI->USB interface (USB 2.0) +#device usb # USB Bus (required) +#device ukbd # Keyboard +#device umass # Disks/Mass storage - Requires scbus and da # Sound support -#device sound # Generic sound driver (required) -#device snd_mss # Microsoft Sound System -#device "snd_sb16" # Sound Blaster 16 -#device snd_sbc # Sound Blaster +#device sound # Generic sound driver (required) +#device snd_mss # Microsoft Sound System +#device "snd_sb16" # Sound Blaster 16 +#device snd_sbc # Sound Blaster From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 14:39:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DA3FAFA; Sun, 28 Sep 2014 14:39: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 1A4AE93D; Sun, 28 Sep 2014 14:39: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 s8SEdB0w074709; Sun, 28 Sep 2014 14:39:11 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SEdBMm074708; Sun, 28 Sep 2014 14:39:11 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201409281439.s8SEdBMm074708@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 28 Sep 2014 14:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272259 - head/sys/pc98/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, 28 Sep 2014 14:39:12 -0000 Author: nyan Date: Sun Sep 28 14:39:11 2014 New Revision: 272259 URL: http://svnweb.freebsd.org/changeset/base/272259 Log: MFi386: Enable QUOTA, PRINTF_BUFR_SIZE and puc. Modified: head/sys/pc98/conf/GENERIC Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Sep 28 14:25:46 2014 (r272258) +++ head/sys/pc98/conf/GENERIC Sun Sep 28 14:39:11 2014 (r272259) @@ -35,6 +35,7 @@ options SOFTUPDATES # Enable FFS soft options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS options MD_ROOT # MD is a potential root device options NFSCL # New Network Filesystem Client options NFSD # New Network Filesystem Server @@ -60,6 +61,7 @@ options SYSVSHM # SYSV-style shared m options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing @@ -112,6 +114,7 @@ device sa # Sequential Access (tape e device cd # CD device pass # Passthrough device (direct ATA/SCSI access) device ses # Enclosure Services (SES and SAF-TE) +#device ctl # CAM Target Layer # keyboard driver device pckbd # PC98 keyboard @@ -157,6 +160,8 @@ device ppi # Parallel port interface # OLD Parallel port #device olpt +device puc # Multi I/O cards and multi-channel UARTs + # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (``Tulip'') #device em # Intel PRO/1000 Gigabit Ethernet Family From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 15:38:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9361E43; Sun, 28 Sep 2014 15:38:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95C53223; Sun, 28 Sep 2014 15:38: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 s8SFcM3D003688; Sun, 28 Sep 2014 15:38:22 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SFcMFP003687; Sun, 28 Sep 2014 15:38:22 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409281538.s8SFcMFP003687@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 28 Sep 2014 15:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272260 - 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: Sun, 28 Sep 2014 15:38:22 -0000 Author: bz Date: Sun Sep 28 15:38:21 2014 New Revision: 272260 URL: http://svnweb.freebsd.org/changeset/base/272260 Log: Remove duplicate declaraton of the if_inc_counter() function after r272244. if_var.h has the expected on and if_var.h include ifq.h and thus we get duplicates. It seems only one cavium ethernet file actually includes ifq.h directly which might be another cleanup to be done but need to test first. Modified: head/sys/net/ifq.h Modified: head/sys/net/ifq.h ============================================================================== --- head/sys/net/ifq.h Sun Sep 28 14:39:11 2014 (r272259) +++ head/sys/net/ifq.h Sun Sep 28 15:38:21 2014 (r272260) @@ -46,7 +46,6 @@ * is splitted from if_var.h. */ #define IF_DUNIT_NONE -1 -void if_inc_counter(struct ifnet *, ift_counter, int64_t inc); #include From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 16:21:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38CA694D; Sun, 28 Sep 2014 16:21:43 +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 E0C84904; Sun, 28 Sep 2014 16:21:42 +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 A183F25D37C7; Sun, 28 Sep 2014 16:21:32 +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 C5B75C77074; Sun, 28 Sep 2014 16:21:31 +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 m2TERyM86mgr; Sun, 28 Sep 2014 16:21:30 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:659f:b2ef:1a54:d54] (unknown [IPv6:fde9:577b:c1a9:4410:659f:b2ef:1a54:d54]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 0CB18C77072; Sun, 28 Sep 2014 16:21:28 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r272260 - head/sys/net From: "Bjoern A. Zeeb" In-Reply-To: <201409281538.s8SFcMFP003687@svn.freebsd.org> Date: Sun, 28 Sep 2014 16:21:06 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <002DAFE6-C240-48E0-ACA9-5E47C011C817@FreeBSD.org> References: <201409281538.s8SFcMFP003687@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.1878.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: Sun, 28 Sep 2014 16:21:43 -0000 On 28 Sep 2014, at 15:38 , Bjoern A. Zeeb wrote: > Author: bz > Date: Sun Sep 28 15:38:21 2014 > New Revision: 272260 > URL: http://svnweb.freebsd.org/changeset/base/272260 >=20 > Log: > Remove duplicate declaraton of the if_inc_counter() function after = r272244. > if_var.h has the expected on and if_var.h include ifq.h and thus we = get > duplicates. It seems only one cavium ethernet file actually includes = ifq.h > directly which might be another cleanup to be done but need to test = first. Never mind; ifq.h is included too early in if_var.h; whoever thought = that separating these things that way was a good idea; sorry. I=92ll run a universe t make sure the next one works better. > Modified: > head/sys/net/ifq.h >=20 > Modified: head/sys/net/ifq.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/net/ifq.h Sun Sep 28 14:39:11 2014 = (r272259) > +++ head/sys/net/ifq.h Sun Sep 28 15:38:21 2014 = (r272260) > @@ -46,7 +46,6 @@ > * is splitted from if_var.h. > */ > #define IF_DUNIT_NONE -1 > -void if_inc_counter(struct ifnet *, ift_counter, int64_t inc); >=20 > #include >=20 >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 17:09:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DADA85BF; Sun, 28 Sep 2014 17:09: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 C7CFECDA; Sun, 28 Sep 2014 17:09: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 s8SH9eIV047461; Sun, 28 Sep 2014 17:09:40 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SH9e0Y047460; Sun, 28 Sep 2014 17:09:40 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409281709.s8SH9e0Y047460@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 28 Sep 2014 17:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272261 - 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: Sun, 28 Sep 2014 17:09:41 -0000 Author: bz Date: Sun Sep 28 17:09:40 2014 New Revision: 272261 URL: http://svnweb.freebsd.org/changeset/base/272261 Log: Move the unconditional #include of net/ifq.h to the very end of file. This seems to allow us to pass a universe with either clang or gcc after r272244 (and r272260) and probably makes it easier to untabgle these chained #includes in the future. Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Sep 28 15:38:21 2014 (r272260) +++ head/sys/net/if_var.h Sun Sep 28 17:09:40 2014 (r272261) @@ -249,8 +249,6 @@ struct ifnet { */ }; -#include /* XXXAO: temporary unconditional include */ - /* for compatibility with other BSDs */ #define if_addrlist if_addrhead #define if_list if_link @@ -608,4 +606,7 @@ int ether_poll_deregister(if_t ifp); #endif /* DEVICE_POLLING */ #endif /* _KERNEL */ + +#include /* XXXAO: temporary unconditional include */ + #endif /* !_NET_IF_VAR_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 17:22:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 436A385E; Sun, 28 Sep 2014 17:22: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 2FE0FE20; Sun, 28 Sep 2014 17:22: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 s8SHMkIV055989; Sun, 28 Sep 2014 17:22:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SHMkSt055988; Sun, 28 Sep 2014 17:22:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409281722.s8SHMkSt055988@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 28 Sep 2014 17:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272263 - 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: Sun, 28 Sep 2014 17:22:46 -0000 Author: tuexen Date: Sun Sep 28 17:22:45 2014 New Revision: 272263 URL: http://svnweb.freebsd.org/changeset/base/272263 Log: Checksum coverage values larger than 65535 for UDPLite are invalid. Check for this when the user calls setsockopt using UDPLITE_{SEND,RECV}CSCOV. Reviewed by: kevlo MFC after: 3 days Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Sun Sep 28 17:16:45 2014 (r272262) +++ head/sys/netinet/udp_usrreq.c Sun Sep 28 17:22:45 2014 (r272263) @@ -1017,7 +1017,7 @@ udp_ctloutput(struct socket *so, struct INP_WLOCK(inp); up = intoudpcb(inp); KASSERT(up != NULL, ("%s: up == NULL", __func__)); - if (optval != 0 && optval < 8) { + if ((optval != 0 && optval < 8) || (optval > 65535)) { INP_WUNLOCK(inp); error = EINVAL; break; From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 19:05:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFE36570; Sun, 28 Sep 2014 19:05:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B321A6B; Sun, 28 Sep 2014 19:05: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 s8SJ5OX7006232; Sun, 28 Sep 2014 19:05:24 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SJ5NPg006227; Sun, 28 Sep 2014 19:05:23 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201409281905.s8SJ5NPg006227@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 28 Sep 2014 19:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272266 - in head/sys/dev: ce cp ctau cx ie X-SVN-Group: head MIME-Version: 1.0 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, 28 Sep 2014 19:05:24 -0000 Author: melifaro Date: Sun Sep 28 19:05:22 2014 New Revision: 272266 URL: http://svnweb.freebsd.org/changeset/base/272266 Log: Convert most BPF_TAP users to BPF_MTAP. MFC after: 2 weeks Modified: head/sys/dev/ce/if_ce.c head/sys/dev/cp/if_cp.c head/sys/dev/ctau/if_ct.c head/sys/dev/cx/if_cx.c head/sys/dev/ie/if_ie.c Modified: head/sys/dev/ce/if_ce.c ============================================================================== --- head/sys/dev/ce/if_ce.c Sun Sep 28 18:34:20 2014 (r272265) +++ head/sys/dev/ce/if_ce.c Sun Sep 28 19:05:22 2014 (r272266) @@ -1133,12 +1133,7 @@ static void ce_receive (ce_chan_t *c, un m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ -#if __FreeBSD_version >= 500000 - BPF_TAP (d->ifp, data, len); -#else - if (d->ifp->if_bpf) - bpf_tap (d->ifp, data, len); -#endif + BPF_MTAP(d->ifp, m); IF_ENQUEUE(&d->rqueue, m); #endif } Modified: head/sys/dev/cp/if_cp.c ============================================================================== --- head/sys/dev/cp/if_cp.c Sun Sep 28 18:34:20 2014 (r272265) +++ head/sys/dev/cp/if_cp.c Sun Sep 28 19:05:22 2014 (r272266) @@ -902,7 +902,7 @@ static void cp_receive (cp_chan_t *c, un m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ - BPF_TAP (d->ifp, data, len); + BPF_MTAP(d->ifp, m); IF_ENQUEUE (&d->queue, m); #endif } Modified: head/sys/dev/ctau/if_ct.c ============================================================================== --- head/sys/dev/ctau/if_ct.c Sun Sep 28 18:34:20 2014 (r272265) +++ head/sys/dev/ctau/if_ct.c Sun Sep 28 19:05:22 2014 (r272266) @@ -1120,7 +1120,7 @@ static void ct_receive (ct_chan_t *c, ch m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ - BPF_TAP (d->ifp, data, len); + BPF_MTAP(d->ifp, m); IF_ENQUEUE (&d->queue, m); #endif } Modified: head/sys/dev/cx/if_cx.c ============================================================================== --- head/sys/dev/cx/if_cx.c Sun Sep 28 18:34:20 2014 (r272265) +++ head/sys/dev/cx/if_cx.c Sun Sep 28 19:05:22 2014 (r272266) @@ -1318,7 +1318,7 @@ static void cx_receive (cx_chan_t *c, ch m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ - BPF_TAP (d->ifp, data, len); + BPF_MTAP(d->ifp, m); IF_ENQUEUE (&d->queue, m); #endif } Modified: head/sys/dev/ie/if_ie.c ============================================================================== --- head/sys/dev/ie/if_ie.c Sun Sep 28 18:34:20 2014 (r272265) +++ head/sys/dev/ie/if_ie.c Sun Sep 28 19:05:22 2014 (r272266) @@ -949,6 +949,8 @@ iestart_locked(struct ifnet *ifp) if (!m) break; + BPF_MTAP(ifp, m); + buffer = sc->xmit_cbuffs[sc->xmit_count]; len = 0; @@ -961,13 +963,6 @@ iestart_locked(struct ifnet *ifp) m_freem(m0); len = max(len, ETHER_MIN_LEN); - /* - * See if bpf is listening on this interface, let it see the - * packet before we commit it to the wire. - */ - BPF_TAP(sc->ifp, - (void *)sc->xmit_cbuffs[sc->xmit_count], len); - sc->xmit_buffs[sc->xmit_count]->ie_xmit_flags = IE_XMIT_LAST|len; sc->xmit_buffs[sc->xmit_count]->ie_xmit_next = 0xffff; From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 21:12:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE047C4F; Sun, 28 Sep 2014 21:12: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 C0A578D9; Sun, 28 Sep 2014 21:12: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 s8SLCN4p067732; Sun, 28 Sep 2014 21:12:23 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SLCNuA067731; Sun, 28 Sep 2014 21:12:23 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201409282112.s8SLCNuA067731@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sun, 28 Sep 2014 21:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272270 - 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, 28 Sep 2014 21:12:24 -0000 Author: neel Date: Sun Sep 28 21:12:23 2014 New Revision: 272270 URL: http://svnweb.freebsd.org/changeset/base/272270 Log: tty_rel_free() can be called more than once for the same tty so make sure that the tty is dequeued from 'tty_list' only the first time. The panic below was seen when a revoke(2) was issued on an nmdm device. In this case there was also a thread that was blocked on a read(2) on the device. The revoke(2) woke up the blocked thread which would typically return an error to userspace. In this case the reader also held the last reference on the file descriptor so fdrop() ended up calling tty_rel_free() via ttydev_close(). tty_rel_free() then tried to dequeue 'tp' again which led to the panic. panic: Bad link elm 0xfffff80042602400 prev->next != elm cpuid = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00f9c90460 kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe00f9c90510 vpanic() at vpanic+0x189/frame 0xfffffe00f9c90590 panic() at panic+0x43/frame 0xfffffe00f9c905f0 tty_rel_free() at tty_rel_free+0x29b/frame 0xfffffe00f9c90640 ttydev_close() at ttydev_close+0x1f9/frame 0xfffffe00f9c90690 devfs_close() at devfs_close+0x298/frame 0xfffffe00f9c90720 VOP_CLOSE_APV() at VOP_CLOSE_APV+0x13c/frame 0xfffffe00f9c90770 vn_close() at vn_close+0x194/frame 0xfffffe00f9c90810 vn_closefile() at vn_closefile+0x48/frame 0xfffffe00f9c90890 devfs_close_f() at devfs_close_f+0x2c/frame 0xfffffe00f9c908c0 _fdrop() at _fdrop+0x29/frame 0xfffffe00f9c908e0 sys_read() at sys_read+0x63/frame 0xfffffe00f9c90980 amd64_syscall() at amd64_syscall+0x2b3/frame 0xfffffe00f9c90ab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe00f9c90ab0 --- syscall (3, FreeBSD ELF64, sys_read), rip = 0x800b78d8a, rsp = 0x7fffffbfdaf8, rbp = 0x7fffffbfdb30 --- CR: https://reviews.freebsd.org/D851 Reviewed by: glebius, ed Reported by: Leon Dang Sponsored by: Nahanni Systems MFC after: 1 week Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sun Sep 28 20:06:02 2014 (r272269) +++ head/sys/kern/tty.c Sun Sep 28 21:12:23 2014 (r272270) @@ -1055,13 +1055,13 @@ tty_rel_free(struct tty *tp) tp->t_dev = NULL; tty_unlock(tp); - sx_xlock(&tty_list_sx); - TAILQ_REMOVE(&tty_list, tp, t_list); - tty_list_count--; - sx_xunlock(&tty_list_sx); - - if (dev != NULL) + if (dev != NULL) { + sx_xlock(&tty_list_sx); + TAILQ_REMOVE(&tty_list, tp, t_list); + tty_list_count--; + sx_xunlock(&tty_list_sx); destroy_dev_sched_cb(dev, tty_dealloc, tp); + } } void From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 21:20:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40D6C3F5; Sun, 28 Sep 2014 21: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 2D29C9BA; Sun, 28 Sep 2014 21: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 s8SLKLFB070470; Sun, 28 Sep 2014 21:20:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SLKLJs070469; Sun, 28 Sep 2014 21:20:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409282120.s8SLKLJs070469@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 28 Sep 2014 21:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272273 - head/lib/libc/stdtime X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 28 Sep 2014 21:20:21 -0000 Author: pfg Date: Sun Sep 28 21:20:20 2014 New Revision: 272273 URL: http://svnweb.freebsd.org/changeset/base/272273 Log: Add strptime(3) support for %U and %W (take 2) Add support for the missing POSIX-2001 %U and %W features: the existing FreeBSD strptime code recognizes both directives and validates that the week number lies in the permitted range, but then simply discards the value. Initial support for the feature was written by Paul Green. David Carlier added the initial handling of tm_wday/tm_yday. Major credit goes to Andrey Chernov for detecting much of the brokenness, and rewriting/cleaning most of the code, making it much more robust. Tested independently with the strptime test from the GNU C library. PR: 137307 MFC after: 1 month Relnotes: yes Modified: head/lib/libc/stdtime/strptime.c Modified: head/lib/libc/stdtime/strptime.c ============================================================================== --- head/lib/libc/stdtime/strptime.c Sun Sep 28 21:15:30 2014 (r272272) +++ head/lib/libc/stdtime/strptime.c Sun Sep 28 21:20:20 2014 (r272273) @@ -55,10 +55,32 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" #include "timelocal.h" - +#include "tzfile.h" +#include static char * _strptime(const char *, const char *, struct tm *, int *, locale_t); -#define asizeof(a) (sizeof (a) / sizeof ((a)[0])) +#define asizeof(a) (sizeof(a) / sizeof((a)[0])) + +#define FLAG_NONE (1 << 0) +#define FLAG_YEAR (1 << 1) +#define FLAG_MONTH (1 << 2) +#define FLAG_YDAY (1 << 3) +#define FLAG_MDAY (1 << 4) +#define FLAG_WDAY (1 << 5) + +/* + * Calculate the week day of the first day of a year. Valid for + * the Gregorian calendar, which began Sept 14, 1752 in the UK + * and its colonies. Ref: + * http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week + */ + +static int +first_wday_of(int year) +{ + return (((2 * (3 - (year / 100) % 4)) + (year % 100) + + ((year % 100) / 4) + (isleap(year) ? 6 : 0) + 1) % 7); +} static char * _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp, @@ -66,9 +88,18 @@ _strptime(const char *buf, const char *f { char c; const char *ptr; + int day_offset = -1, wday_offset; + int week_offset; int i, len; + int flags; int Ealternative, Oalternative; - struct lc_time_T *tptr = __get_current_time_locale(locale); + const struct lc_time_T *tptr = __get_current_time_locale(locale); + static int start_of_month[2][13] = { + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, + {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366} + }; + + flags = FLAG_NONE; ptr = fmt; while (*ptr != 0) { @@ -102,6 +133,7 @@ label: buf = _strptime(buf, tptr->date_fmt, tm, GMTp, locale); if (buf == NULL) return (NULL); + flags |= FLAG_WDAY | FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; break; case 'C': @@ -119,19 +151,23 @@ label: if (i < 19) return (NULL); - tm->tm_year = i * 100 - 1900; + tm->tm_year = i * 100 - TM_YEAR_BASE; + flags |= FLAG_YEAR; + break; case 'c': buf = _strptime(buf, tptr->c_fmt, tm, GMTp, locale); if (buf == NULL) return (NULL); + flags |= FLAG_WDAY | FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; break; case 'D': buf = _strptime(buf, "%m/%d/%y", tm, GMTp, locale); if (buf == NULL) return (NULL); + flags |= FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; break; case 'E': @@ -150,6 +186,7 @@ label: buf = _strptime(buf, "%Y-%m-%d", tm, GMTp, locale); if (buf == NULL) return (NULL); + flags |= FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; break; case 'R': @@ -180,6 +217,7 @@ label: buf = _strptime(buf, tptr->x_fmt, tm, GMTp, locale); if (buf == NULL) return (NULL); + flags |= FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; break; case 'j': @@ -197,6 +235,8 @@ label: return (NULL); tm->tm_yday = i - 1; + flags |= FLAG_YDAY; + break; case 'M': @@ -303,7 +343,7 @@ label: return (NULL); tm->tm_wday = i; - buf += len; + flags |= FLAG_WDAY; break; case 'U': @@ -327,6 +367,14 @@ label: if (i > 53) return (NULL); + if (c == 'U') + day_offset = TM_SUNDAY; + else + day_offset = TM_MONDAY; + + + week_offset = i; + break; case 'w': @@ -338,6 +386,7 @@ label: return (NULL); tm->tm_wday = i; + flags |= FLAG_WDAY; break; @@ -374,6 +423,7 @@ label: return (NULL); tm->tm_mday = i; + flags |= FLAG_MDAY; break; @@ -413,6 +463,8 @@ label: tm->tm_mon = i; buf += len; + flags |= FLAG_MONTH; + break; case 'm': @@ -430,6 +482,7 @@ label: return (NULL); tm->tm_mon = i - 1; + flags |= FLAG_MONTH; break; @@ -471,13 +524,14 @@ label: len--; } if (c == 'Y') - i -= 1900; + i -= TM_YEAR_BASE; if (c == 'y' && i < 69) i += 100; if (i < 0) return (NULL); tm->tm_year = i; + flags |= FLAG_YEAR; break; @@ -543,10 +597,67 @@ label: break; } } + + if (!(flags & FLAG_YDAY) && (flags & FLAG_YEAR)) { + if ((flags & (FLAG_MONTH | FLAG_MDAY)) == + (FLAG_MONTH | FLAG_MDAY)) { + tm->tm_yday = start_of_month[isleap(tm->tm_year + + TM_YEAR_BASE)][tm->tm_mon] + (tm->tm_mday - 1); + flags |= FLAG_YDAY; + } else if (day_offset != -1) { + /* Set the date to the first Sunday (or Monday) + * of the specified week of the year. + */ + if (!(flags & FLAG_WDAY)) { + tm->tm_wday = day_offset; + flags |= FLAG_WDAY; + } + tm->tm_yday = (7 - + first_wday_of(tm->tm_year + TM_YEAR_BASE) + + day_offset) % 7 + (week_offset - 1) * 7 + + tm->tm_wday - day_offset; + flags |= FLAG_YDAY; + } + } + + if ((flags & (FLAG_YEAR | FLAG_YDAY)) == (FLAG_YEAR | FLAG_YDAY)) { + if (!(flags & FLAG_MONTH)) { + i = 0; + while (tm->tm_yday >= + start_of_month[isleap(tm->tm_year + + TM_YEAR_BASE)][i]) + i++; + if (i > 12) { + i = 1; + tm->tm_yday -= + start_of_month[isleap(tm->tm_year + + TM_YEAR_BASE)][12]; + tm->tm_year++; + } + tm->tm_mon = i - 1; + flags |= FLAG_MONTH; + } + if (!(flags & FLAG_MDAY)) { + tm->tm_mday = tm->tm_yday - + start_of_month[isleap(tm->tm_year + TM_YEAR_BASE)] + [tm->tm_mon] + 1; + flags |= FLAG_MDAY; + } + if (!(flags & FLAG_WDAY)) { + i = 0; + wday_offset = first_wday_of(tm->tm_year); + while (i++ <= tm->tm_yday) { + if (wday_offset++ >= 6) + wday_offset = 0; + } + tm->tm_wday = wday_offset; + flags |= FLAG_WDAY; + } + } + return ((char *)buf); } - char * strptime_l(const char * __restrict buf, const char * __restrict fmt, struct tm * __restrict tm, locale_t loc) @@ -564,6 +675,7 @@ strptime_l(const char * __restrict buf, return (ret); } + char * strptime(const char * __restrict buf, const char * __restrict fmt, struct tm * __restrict tm) From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 21:25:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8A1B5BD; Sun, 28 Sep 2014 21:25:59 +0000 (UTC) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D2E8AA7; Sun, 28 Sep 2014 21:25:59 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id ey11so4728673pad.13 for ; Sun, 28 Sep 2014 14:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=2n1NNx+I6SwVQeg3iqH9NvmekgrXszTQYzB8kZvRwtE=; b=cIqGEcO9sYMQ2VhYSUIAbpoeeU61rcqET0H2Unie4yMgDOzXngnlx5+6v92vB88I8y 2IfoN2WcPBuJQF9PkcNxXxYOW8qpbckzDHsx1a+UehXLGVZYOImdoc8geHh2ZcGbkf2f +JGpqej+/d1hAsybjQrp+MN7aFkW69hri1exvBpRWWbYT4mlzSKEu4932+zmoizJwfjl TzJ89YTZtz4bi5HEhpmN1jfW4cxBVCE3kMDB6aJHATWHHGg5kwntsqTyhdgWcLFrS8Yu /2RxieROcg2QfOyxcfO3sV0mbnxJmDQuC0tZX9PfpArOFBkUmHTe54J+ubh7EjvE93Hz l+bA== X-Received: by 10.68.197.65 with SMTP id is1mr53239109pbc.125.1411939559190; Sun, 28 Sep 2014 14:25:59 -0700 (PDT) Received: from [192.168.20.11] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id qs4sm10417079pbb.90.2014.09.28.14.25.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Sep 2014 14:25:58 -0700 (PDT) References: <201409282112.s8SLCNuA067731@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201409282112.s8SLCNuA067731@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (11D257) From: Garrett Cooper Subject: Re: svn commit: r272270 - head/sys/kern Date: Sun, 28 Sep 2014 14:25:56 -0700 To: Neel Natu Cc: "svn-src-head@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, 28 Sep 2014 21:25:59 -0000 Hi Neel! Thank you for fixing this. I think we've run into similar issues with cu= stomizations to the tty code at Isilon. I have one comment... Thanks! > On Sep 28, 2014, at 14:12, Neel Natu wrote: >=20 > Author: neel > Date: Sun Sep 28 21:12:23 2014 > New Revision: 272270 > URL: http://svnweb.freebsd.org/changeset/base/272270 >=20 > Log: > tty_rel_free() can be called more than once for the same tty so make sure= > that the tty is dequeued from 'tty_list' only the first time. >=20 > The panic below was seen when a revoke(2) was issued on an nmdm device. > In this case there was also a thread that was blocked on a read(2) on the= > device. The revoke(2) woke up the blocked thread which would typically > return an error to userspace. In this case the reader also held the last > reference on the file descriptor so fdrop() ended up calling tty_rel_free= () > via ttydev_close(). >=20 > tty_rel_free() then tried to dequeue 'tp' again which led to the panic. >=20 > panic: Bad link elm 0xfffff80042602400 prev->next !=3D elm > cpuid =3D 1 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00f9c= 90460 > kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe00f9c90510 > vpanic() at vpanic+0x189/frame 0xfffffe00f9c90590 > panic() at panic+0x43/frame 0xfffffe00f9c905f0 > tty_rel_free() at tty_rel_free+0x29b/frame 0xfffffe00f9c90640 > ttydev_close() at ttydev_close+0x1f9/frame 0xfffffe00f9c90690 > devfs_close() at devfs_close+0x298/frame 0xfffffe00f9c90720 > VOP_CLOSE_APV() at VOP_CLOSE_APV+0x13c/frame 0xfffffe00f9c90770 > vn_close() at vn_close+0x194/frame 0xfffffe00f9c90810 > vn_closefile() at vn_closefile+0x48/frame 0xfffffe00f9c90890 > devfs_close_f() at devfs_close_f+0x2c/frame 0xfffffe00f9c908c0 > _fdrop() at _fdrop+0x29/frame 0xfffffe00f9c908e0 > sys_read() at sys_read+0x63/frame 0xfffffe00f9c90980 > amd64_syscall() at amd64_syscall+0x2b3/frame 0xfffffe00f9c90ab0 > Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe00f9c90ab0 > --- syscall (3, FreeBSD ELF64, sys_read), rip =3D 0x800b78d8a, rsp =3D 0x= 7fffffbfdaf8, rbp =3D 0x7fffffbfdb30 --- >=20 > CR: https://reviews.freebsd.org/D851 > Reviewed by: glebius, ed > Reported by: Leon Dang > Sponsored by: Nahanni Systems > MFC after: 1 week >=20 > Modified: > head/sys/kern/tty.c >=20 > Modified: head/sys/kern/tty.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/tty.c Sun Sep 28 20:06:02 2014 (r272269) > +++ head/sys/kern/tty.c Sun Sep 28 21:12:23 2014 (r272270) > @@ -1055,13 +1055,13 @@ tty_rel_free(struct tty *tp) > tp->t_dev =3D NULL; > tty_unlock(tp); >=20 > - sx_xlock(&tty_list_sx); > - TAILQ_REMOVE(&tty_list, tp, t_list); > - tty_list_count--; > - sx_xunlock(&tty_list_sx); > - > - if (dev !=3D NULL) > + if (dev !=3D NULL) { if (dev =3D=3D NULL) return; Would be result in less change in an MFC. > + sx_xlock(&tty_list_sx); > + TAILQ_REMOVE(&tty_list, tp, t_list); > + tty_list_count--; > + sx_xunlock(&tty_list_sx); > destroy_dev_sched_cb(dev, tty_dealloc, tp); > + } > } >=20 > void From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 21:27:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00BFC6FE; Sun, 28 Sep 2014 21:27:43 +0000 (UTC) Received: from mail-pd0-x22c.google.com (mail-pd0-x22c.google.com [IPv6:2607:f8b0:400e:c02::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9C45AAF; Sun, 28 Sep 2014 21:27:43 +0000 (UTC) Received: by mail-pd0-f172.google.com with SMTP id g10so4093547pdj.17 for ; Sun, 28 Sep 2014 14:27:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=WGKfrGfI3g3TSpozrEOMQe+K1BEgfzJbg16kv3GrirI=; b=YMQHbwVtE9xzv2WViBK1o8U7ynl885wR1ZAmEXip63MpXM/yZkkfcG6/9h9Aeb4qOC AvDjPUf2kdxdDV7BL6beH4RBqjNf64a+rjHEK6/nBLCGg0JIl8nDp0Kkv7XpTaF9qdek cgTyU8MfTPG/FYJvMUS2RJfE5szvh6Z50wlN/NRv1oiKmjHCPexCGvXLGksfccx9xFpl ZIZEYy25gevo9pTvzXBtVUN7+uFwwEF2dDL5ClWDnxMUoiKXVLzyzztIK01d2fmxc2jU 8o2oGQoMIgajEjwtuUk0ItdG1DkayFTWeROFWSajNzbhv5mZ1+tPGakNNDv1fCjMs7Xg 1Yog== X-Received: by 10.70.119.105 with SMTP id kt9mr47810050pdb.7.1411939663191; Sun, 28 Sep 2014 14:27:43 -0700 (PDT) Received: from [192.168.20.11] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id rg1sm10507408pdb.14.2014.09.28.14.27.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Sep 2014 14:27:42 -0700 (PDT) References: <201409282120.s8SLKLJs070469@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201409282120.s8SLKLJs070469@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: X-Mailer: iPhone Mail (11D257) From: Garrett Cooper Subject: Re: svn commit: r272273 - head/lib/libc/stdtime Date: Sun, 28 Sep 2014 14:27:40 -0700 To: "Pedro F. Giffuni" Cc: "svn-src-head@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, 28 Sep 2014 21:27:44 -0000 > On Sep 28, 2014, at 14:20, "Pedro F. Giffuni" wrote: > > Author: pfg > Date: Sun Sep 28 21:20:20 2014 > New Revision: 272273 > URL: http://svnweb.freebsd.org/changeset/base/272273 > > Log: > Add strptime(3) support for %U and %W (take 2) > > Add support for the missing POSIX-2001 %U and %W features: the > existing FreeBSD strptime code recognizes both directives and > validates that the week number lies in the permitted range, > but then simply discards the value. > > Initial support for the feature was written by Paul Green. > David Carlier added the initial handling of tm_wday/tm_yday. > Major credit goes to Andrey Chernov for detecting much of the > brokenness, and rewriting/cleaning most of the code, making it > much more robust. > > Tested independently with the strptime test from the GNU C > library. I'll try the netbsd testcases as well. Thanks! From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 21:44:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A9A0CCD; Sun, 28 Sep 2014 21:44: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 36C4CC54; Sun, 28 Sep 2014 21:44: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 s8SLiOHb082039; Sun, 28 Sep 2014 21:44:24 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8SLiO6C082038; Sun, 28 Sep 2014 21:44:24 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201409282144.s8SLiO6C082038@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 28 Sep 2014 21:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272274 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 28 Sep 2014 21:44:24 -0000 Author: allanjude (doc committer) Date: Sun Sep 28 21:44:23 2014 New Revision: 272274 URL: http://svnweb.freebsd.org/changeset/base/272274 Log: Change the /var dataset in the default ZFS layout to have the ZFS property canmount=off so that /var/db/pkg and other such directories are part of the / dataset, and only /var/mail, /var/log, and /var/crash are excluded from the ZFS boot environment (beadm). PR: 193971 Approved by: jmg MFC after: ASAP Relnotes: yes Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sun Sep 28 21:20:20 2014 (r272273) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sun Sep 28 21:44:23 2014 (r272274) @@ -156,7 +156,7 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA /usr/src # Create /var and friends - /var mountpoint=/var + /var mountpoint=/var,canmount=off /var/crash exec=off,setuid=off /var/log exec=off,setuid=off /var/mail atime=on From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 21:47:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA796E5C for ; Sun, 28 Sep 2014 21:47:31 +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 7BC91C7D for ; Sun, 28 Sep 2014 21:47:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1411940844; bh=g+jjBEy2hLs762o1qE5jcmTuxZo5O0sceLVQOjTlNgQ=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:From:Subject; b=LulEXn5pCVMkLmyfnuefjCQxChp89kZjKlf9yyGgX/OY2l4A/HKSdBcXbrttItXiegxEGD908LZVu7/4FhgH4PPC8AkPHEDTgtFaLJ75jgzDJbzptR8myF7ZJ1L/mfzctHISylaSNYGZ3Mdq+DHUqfNA1uyrPzCNPBZQJWpyFm7/pdNlFSrYrX1RuNIrNDR0LN5s8e4EGbFaOcW8VJDG8NtYNPG+qVsGz2MFf0rWEfH0Y6Fizkk0I+6u678MBFbD/hZ9RP8Txgn4HkDfc03n/ProVS3IGTFw+npj49oBaMiwULYLWxvzNJByzg/aTXswz4dV94gGLexyd5wBe4lAdA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=FrY8GFkZFtrtpmVh+pINMFx9iVbjybSysIwLDwq+/VsleU1zzKS1duD+n2DSansiCZBVhO/eiXeYa5oq1oC6sxpxiCnddH0J3vBFv/EHt8UuDQpFTBuxqkRZfRVcCKROkcXFFswgwK+4cl+gam22bM0DWsgC5rqCh/x3+q5RSfIdA02J37C3LZolslKvrVC/ZVvEswT6l9odsQmiB/Y9f/+VgX3wUXYzM9lOVqnxkmzoN4ks3YX7dwAEK+DTDxHalalOhdBREnMxXEkyIisEdDK8CCDNKdNwFEt32r/jN7r3a+NUP45X928VO8POLUJigRspOp1jrOeYBqRijTEt8w==; Received: from [98.139.212.152] by nm24.bullet.mail.bf1.yahoo.com with NNFMP; 28 Sep 2014 21:47:24 -0000 Received: from [98.139.211.162] by tm9.bullet.mail.bf1.yahoo.com with NNFMP; 28 Sep 2014 21:47:24 -0000 Received: from [127.0.0.1] by smtp219.mail.bf1.yahoo.com with NNFMP; 28 Sep 2014 21:47:24 -0000 X-Yahoo-Newman-Id: 98092.50548.bm@smtp219.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: DYyrPi4VM1lLfBTBUuy9Mh0R8r5G72IvQs9vU8d0rj8fxHo MCnwhFXhxzusy4v5VScp5YOHY9iGWbZ1pfKc4M2SKy5W718p7KLPCDmL9YfZ 5CKFTD12GgAqLFRV5.WibDGO80Ygx2cT5KISIKP0wZI5Y82FC4amwGp75myk Kj4yDlRBiZPE9W2s87ZJTX0SDRchthxefA5pEpCZblDEHPa_h2cUwf34lRUj xR4yqnJ4atMOoHV1lEdWJs1ckQH1ePDMO_DYb7fzVIdcmlzDrrsbfEcWNHV3 L72VCuInMy9FZP8asrv7ezJALWszEw83UzxSzWU8JyKCiUCwEHgLkBFsXunC 73H3NQ5rOJG0rz9bgN9PzdG6fltQgDZmgRuNh89EzWoZPObGjum.fXHT8R5_ fA0Ff.q1ILesOVAEqtMfS1BTjIHu4ZaYaq7XafyQpL_qyFw2XZ5rmItIeSkY BnQoTkyVz48D0ccWcf6YbNH9a7gSq6IVyd7YI12Daoz.bs0GP_v7TRjpQEKh LAMqKiDXu_5mQXh9sFptbdUzTxcd1E2Y0ig-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <542881F2.2090000@freebsd.org> Date: Sun, 28 Sep 2014 16:47:30 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Garrett Cooper Subject: Re: svn commit: r272273 - head/lib/libc/stdtime References: <201409282120.s8SLKLJs070469@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 28 Sep 2014 21:47:32 -0000 On 09/28/14 16:27, Garrett Cooper wrote: >> On Sep 28, 2014, at 14:20, "Pedro F. Giffuni" wrote: >> >> Author: pfg >> Date: Sun Sep 28 21:20:20 2014 >> New Revision: 272273 >> URL: http://svnweb.freebsd.org/changeset/base/272273 >> >> Log: >> Add strptime(3) support for %U and %W (take 2) >> >> Add support for the missing POSIX-2001 %U and %W features: the >> existing FreeBSD strptime code recognizes both directives and >> validates that the week number lies in the permitted range, >> but then simply discards the value. >> >> Initial support for the feature was written by Paul Green. >> David Carlier added the initial handling of tm_wday/tm_yday. >> Major credit goes to Andrey Chernov for detecting much of the >> brokenness, and rewriting/cleaning most of the code, making it >> much more robust. >> >> Tested independently with the strptime test from the GNU C >> library. > I'll try the netbsd testcases as well. > Thanks! Great! It may be that NetBSD doesn't support %U %W. Still, it would be really interesting to run the NetBSD tests after applying the patch here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=93197 Regards, Pedro. From owner-svn-src-head@FreeBSD.ORG Sun Sep 28 21:49:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2C67FB1; Sun, 28 Sep 2014 21:49:05 +0000 (UTC) Received: from mail-qg0-x230.google.com (mail-qg0-x230.google.com [IPv6:2607:f8b0:400d:c04::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F185C8F; Sun, 28 Sep 2014 21:49:05 +0000 (UTC) Received: by mail-qg0-f48.google.com with SMTP id i50so1048770qgf.21 for ; Sun, 28 Sep 2014 14:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CFQRoNm59wG646LQiZIILY+/sB5D+wy0HnilXeBZU/k=; b=A0374GitBXdRc5slSF/iJEmiHhIOxFHpMiOPtIv/+EsnwcwW3Wv/k5eDkaS/JhgDcj wkyJWYFXzEMlrF5DjYCtK//Sk56f23abpk3ppQTyYuG1xihq4iYz4u+/yE6Dpfx+xY2i rq0+xsnneBopzJwVF9MUJb9esITJmHNyyIpHxC1GQZ2gZGtGUlHnWB0GZ+96uMIq9dDQ vpAdamsp3/NqAZwA28r+2xrUaPMg3qp88yFiRsUFu1GbUjow3HtUdP7Ududou7lA26Pe YKRdGgud8HiW3XGZqVf7+g7vcL0hj+dq7GdKQl5HDZ40kIXOyFQfllBFn5YeE0zvPa5h 9pAw== MIME-Version: 1.0 X-Received: by 10.140.28.8 with SMTP id 8mr55216837qgy.19.1411940944231; Sun, 28 Sep 2014 14:49:04 -0700 (PDT) Received: by 10.140.97.100 with HTTP; Sun, 28 Sep 2014 14:49:04 -0700 (PDT) In-Reply-To: References: <201409282112.s8SLCNuA067731@svn.freebsd.org> Date: Sun, 28 Sep 2014 14:49:04 -0700 Message-ID: Subject: Re: svn commit: r272270 - head/sys/kern From: Neel Natu To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 28 Sep 2014 21:49:05 -0000 Hi, On Sun, Sep 28, 2014 at 2:25 PM, Garrett Cooper wrote: > Hi Neel! > Thank you for fixing this. I think we've run into similar issues with customizations to the tty code at Isilon. I have one comment... > Thanks! > Happy to help. >> On Sep 28, 2014, at 14:12, Neel Natu wrote: >> >> Author: neel >> Date: Sun Sep 28 21:12:23 2014 >> New Revision: 272270 >> URL: http://svnweb.freebsd.org/changeset/base/272270 >> >> Log: >> tty_rel_free() can be called more than once for the same tty so make sure >> that the tty is dequeued from 'tty_list' only the first time. >> >> The panic below was seen when a revoke(2) was issued on an nmdm device. >> In this case there was also a thread that was blocked on a read(2) on the >> device. The revoke(2) woke up the blocked thread which would typically >> return an error to userspace. In this case the reader also held the last >> reference on the file descriptor so fdrop() ended up calling tty_rel_free() >> via ttydev_close(). >> >> tty_rel_free() then tried to dequeue 'tp' again which led to the panic. >> >> panic: Bad link elm 0xfffff80042602400 prev->next != elm >> cpuid = 1 >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00f9c90460 >> kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe00f9c90510 >> vpanic() at vpanic+0x189/frame 0xfffffe00f9c90590 >> panic() at panic+0x43/frame 0xfffffe00f9c905f0 >> tty_rel_free() at tty_rel_free+0x29b/frame 0xfffffe00f9c90640 >> ttydev_close() at ttydev_close+0x1f9/frame 0xfffffe00f9c90690 >> devfs_close() at devfs_close+0x298/frame 0xfffffe00f9c90720 >> VOP_CLOSE_APV() at VOP_CLOSE_APV+0x13c/frame 0xfffffe00f9c90770 >> vn_close() at vn_close+0x194/frame 0xfffffe00f9c90810 >> vn_closefile() at vn_closefile+0x48/frame 0xfffffe00f9c90890 >> devfs_close_f() at devfs_close_f+0x2c/frame 0xfffffe00f9c908c0 >> _fdrop() at _fdrop+0x29/frame 0xfffffe00f9c908e0 >> sys_read() at sys_read+0x63/frame 0xfffffe00f9c90980 >> amd64_syscall() at amd64_syscall+0x2b3/frame 0xfffffe00f9c90ab0 >> Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe00f9c90ab0 >> --- syscall (3, FreeBSD ELF64, sys_read), rip = 0x800b78d8a, rsp = 0x7fffffbfdaf8, rbp = 0x7fffffbfdb30 --- >> >> CR: https://reviews.freebsd.org/D851 >> Reviewed by: glebius, ed >> Reported by: Leon Dang >> Sponsored by: Nahanni Systems >> MFC after: 1 week >> >> Modified: >> head/sys/kern/tty.c >> >> Modified: head/sys/kern/tty.c >> ============================================================================== >> --- head/sys/kern/tty.c Sun Sep 28 20:06:02 2014 (r272269) >> +++ head/sys/kern/tty.c Sun Sep 28 21:12:23 2014 (r272270) >> @@ -1055,13 +1055,13 @@ tty_rel_free(struct tty *tp) >> tp->t_dev = NULL; >> tty_unlock(tp); >> >> - sx_xlock(&tty_list_sx); >> - TAILQ_REMOVE(&tty_list, tp, t_list); >> - tty_list_count--; >> - sx_xunlock(&tty_list_sx); >> - >> - if (dev != NULL) >> + if (dev != NULL) { > > if (dev == NULL) > return; > > Would be result in less change in an MFC. > Yes, indeed. I don't think it makes any difference in readability though. best Neel >> + sx_xlock(&tty_list_sx); >> + TAILQ_REMOVE(&tty_list, tp, t_list); >> + tty_list_count--; >> + sx_xunlock(&tty_list_sx); >> destroy_dev_sched_cb(dev, tty_dealloc, tp); >> + } >> } >> >> void From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 00:35:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CCF1D32; Mon, 29 Sep 2014 00:35: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 57A21CF9; Mon, 29 Sep 2014 00:35: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 s8T0ZDkq063903; Mon, 29 Sep 2014 00:35:13 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8T0ZC2I063901; Mon, 29 Sep 2014 00:35:12 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201409290035.s8T0ZC2I063901@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 29 Sep 2014 00:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272278 - in head/usr.sbin/bsdinstall: distextract distfetch X-SVN-Group: head MIME-Version: 1.0 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, 29 Sep 2014 00:35:13 -0000 Author: dteske Date: Mon Sep 29 00:35:12 2014 New Revision: 272278 URL: http://svnweb.freebsd.org/changeset/base/272278 Log: Use snprintf(3) in place of unbounded sprintf(3) (prevent buffer overflow). Use adequately sized buffer for error(s) (512 -> PATH_MAX + 512). Fix the following style(9) nits while here: - distfetch.c uses PATH_MAX while distextract.c uses MAXPATHLEN; standardize on one (PATH_MAX) - Move $FreeBSD$ from comment to __FBSDID() - Sort included headers (alphabetically, sys/* at top) - Add missing header includes (e.g., for getenv(3), calloc(3)/malloc(3)/free(3), and atoi(3); for strdup(3), strrchr(3), strsep(3), and strcmp(3); for isspace(3); and for chdir(2), etc.) - Remove rogue newline at end of distfetch.c - Don't declare variables in if-, while-, or other statement NB: To prevent masking of prior declarations atop function - Perform stack alignment for variable declarations - Add missing function prototype for count_files() in distextract.c - Break out single-line multivariable-declarations NB: Aligning similarly-named variables with one-char difference(s) NB: Minimizes diffs and makes future diffs more clear - Use err(3) family of functions (requires s/int err;/int retval;/g) Reviewed by: nwhitehorn, julian Modified: head/usr.sbin/bsdinstall/distextract/distextract.c head/usr.sbin/bsdinstall/distfetch/distfetch.c Modified: head/usr.sbin/bsdinstall/distextract/distextract.c ============================================================================== --- head/usr.sbin/bsdinstall/distextract/distextract.c Sun Sep 28 23:22:55 2014 (r272277) +++ head/usr.sbin/bsdinstall/distextract/distextract.c Mon Sep 29 00:35:12 2014 (r272278) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2011 Nathan Whitehorn + * Copyright (c) 2014 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,30 +23,38 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include -#include -#include -#include #include +#include #include +#include +#include +#include +#include +#include +#include +#include -static int extract_files(int nfiles, const char **files); +static int count_files(const char *file); +static int extract_files(int nfiles, const char **files); int main(void) { - char *diststring; const char **dists; - int i, retval, ndists = 0; + char *diststring; + int i; + int ndists = 0; + int retval; + char error[PATH_MAX + 512]; - if (getenv("DISTRIBUTIONS") == NULL) { - fprintf(stderr, "DISTRIBUTIONS variable is not set\n"); - return (1); - } + if (getenv("DISTRIBUTIONS") == NULL) + errx(EXIT_FAILURE, "DISTRIBUTIONS variable is not set"); diststring = strdup(getenv("DISTRIBUTIONS")); for (i = 0; diststring[i] != 0; i++) @@ -55,9 +64,8 @@ main(void) dists = calloc(ndists, sizeof(const char *)); if (dists == NULL) { - fprintf(stderr, "Out of memory!\n"); free(diststring); - return (1); + errx(EXIT_FAILURE, "Out of memory!"); } for (i = 0; i < ndists; i++) @@ -68,12 +76,12 @@ main(void) dlg_put_backtitle(); if (chdir(getenv("BSDINSTALL_CHROOT")) != 0) { - char error[512]; - sprintf(error, "Could could change to directory %s: %s\n", + snprintf(error, sizeof(error), + "Could could change to directory %s: %s\n", getenv("BSDINSTALL_DISTDIR"), strerror(errno)); dialog_msgbox("Error", error, 0, 0, TRUE); end_dialog(); - return (1); + return (EXIT_FAILURE); } retval = extract_files(ndists, dists); @@ -89,22 +97,24 @@ main(void) static int count_files(const char *file) { + static FILE *manifest = NULL; + char *tok1; + char *tok2; + int file_count; + int retval; struct archive *archive; struct archive_entry *entry; - static FILE *manifest = NULL; - char path[MAXPATHLEN]; - char errormsg[512]; - int file_count, err; + char line[512]; + char path[PATH_MAX]; + char errormsg[PATH_MAX + 512]; if (manifest == NULL) { - sprintf(path, "%s/MANIFEST", getenv("BSDINSTALL_DISTDIR")); + snprintf(path, sizeof(path), "%s/MANIFEST", + getenv("BSDINSTALL_DISTDIR")); manifest = fopen(path, "r"); } if (manifest != NULL) { - char line[512]; - char *tok1, *tok2; - rewind(manifest); while (fgets(line, sizeof(line), manifest) != NULL) { tok2 = line; @@ -127,9 +137,10 @@ count_files(const char *file) archive = archive_read_new(); archive_read_support_format_all(archive); archive_read_support_filter_all(archive); - sprintf(path, "%s/%s", getenv("BSDINSTALL_DISTDIR"), file); - err = archive_read_open_filename(archive, path, 4096); - if (err != ARCHIVE_OK) { + snprintf(path, sizeof(path), "%s/%s", getenv("BSDINSTALL_DISTDIR"), + file); + retval = archive_read_open_filename(archive, path, 4096); + if (retval != ARCHIVE_OK) { snprintf(errormsg, sizeof(errormsg), "Error while extracting %s: %s\n", file, archive_error_string(archive)); @@ -148,19 +159,21 @@ count_files(const char *file) static int extract_files(int nfiles, const char **files) { - const char *items[nfiles*2]; - char path[PATH_MAX]; + int archive_file; int archive_files[nfiles]; - int total_files, current_files, archive_file; + int current_files = 0; + int i; + int last_progress; + int progress = 0; + int retval; + int total_files = 0; struct archive *archive; struct archive_entry *entry; - char errormsg[512]; char status[8]; - int i, err, progress, last_progress; + char path[PATH_MAX]; + char errormsg[PATH_MAX + 512]; + const char *items[nfiles*2]; - err = 0; - progress = 0; - /* Make the transfer list for dialog */ for (i = 0; i < nfiles; i++) { items[i*2] = strrchr(files[i], '/'); @@ -175,7 +188,6 @@ extract_files(int nfiles, const char **f "Checking distribution archives.\nPlease wait...", 0, 0, FALSE); /* Count all the files */ - total_files = 0; for (i = 0; i < nfiles; i++) { archive_files[i] = count_files(files[i]); if (archive_files[i] < 0) @@ -183,24 +195,23 @@ extract_files(int nfiles, const char **f total_files += archive_files[i]; } - current_files = 0; - for (i = 0; i < nfiles; i++) { archive = archive_read_new(); archive_read_support_format_all(archive); archive_read_support_filter_all(archive); - sprintf(path, "%s/%s", getenv("BSDINSTALL_DISTDIR"), files[i]); - err = archive_read_open_filename(archive, path, 4096); + snprintf(path, sizeof(path), "%s/%s", + getenv("BSDINSTALL_DISTDIR"), files[i]); + retval = archive_read_open_filename(archive, path, 4096); items[i*2 + 1] = "In Progress"; archive_file = 0; - while ((err = archive_read_next_header(archive, &entry)) == + while ((retval = archive_read_next_header(archive, &entry)) == ARCHIVE_OK) { last_progress = progress; progress = (current_files*100)/total_files; - sprintf(status, "-%d", + snprintf(status, sizeof(status), "-%d", (archive_file*100)/archive_files[i]); items[i*2 + 1] = status; @@ -210,12 +221,12 @@ extract_files(int nfiles, const char **f progress, nfiles, __DECONST(char **, items)); - err = archive_read_extract(archive, entry, + retval = archive_read_extract(archive, entry, ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_OWNER | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL | ARCHIVE_EXTRACT_XATTR | ARCHIVE_EXTRACT_FFLAGS); - if (err != ARCHIVE_OK) + if (retval != ARCHIVE_OK) break; archive_file++; @@ -224,18 +235,18 @@ extract_files(int nfiles, const char **f items[i*2 + 1] = "Done"; - if (err != ARCHIVE_EOF) { + if (retval != ARCHIVE_EOF) { snprintf(errormsg, sizeof(errormsg), "Error while extracting %s: %s\n", items[i*2], archive_error_string(archive)); items[i*2 + 1] = "Failed"; dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE); - return (err); + return (retval); } archive_read_free(archive); } - return (0); + return (EXIT_SUCCESS); } Modified: head/usr.sbin/bsdinstall/distfetch/distfetch.c ============================================================================== --- head/usr.sbin/bsdinstall/distfetch/distfetch.c Sun Sep 28 23:22:55 2014 (r272277) +++ head/usr.sbin/bsdinstall/distfetch/distfetch.c Mon Sep 29 00:35:12 2014 (r272278) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2011 Nathan Whitehorn + * Copyright (c) 2014 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,15 +23,21 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include -#include +#include +#include +#include #include #include -#include +#include +#include +#include +#include static int fetch_files(int nfiles, char **urls); @@ -39,12 +46,13 @@ main(void) { char *diststring; char **urls; - int i, nfetched, ndists = 0; + int i; + int ndists = 0; + int nfetched; + char error[PATH_MAX + 512]; - if (getenv("DISTRIBUTIONS") == NULL) { - fprintf(stderr, "DISTRIBUTIONS variable is not set\n"); - return (1); - } + if (getenv("DISTRIBUTIONS") == NULL) + errx(EXIT_FAILURE, "DISTRIBUTIONS variable is not set"); diststring = strdup(getenv("DISTRIBUTIONS")); for (i = 0; diststring[i] != 0; i++) @@ -54,9 +62,8 @@ main(void) urls = calloc(ndists, sizeof(const char *)); if (urls == NULL) { - fprintf(stderr, "Out of memory!\n"); free(diststring); - return (1); + errx(EXIT_FAILURE, "Out of memory!"); } init_dialog(stdin, stdout); @@ -65,13 +72,13 @@ main(void) for (i = 0; i < ndists; i++) { urls[i] = malloc(PATH_MAX); - sprintf(urls[i], "%s/%s", getenv("BSDINSTALL_DISTSITE"), - strsep(&diststring, " \t")); + snprintf(urls[i], PATH_MAX, "%s/%s", + getenv("BSDINSTALL_DISTSITE"), strsep(&diststring, " \t")); } if (chdir(getenv("BSDINSTALL_DISTDIR")) != 0) { - char error[512]; - sprintf(error, "Could could change to directory %s: %s\n", + snprintf(error, sizeof(error), + "Could could change to directory %s: %s\n", getenv("BSDINSTALL_DISTDIR"), strerror(errno)); dialog_msgbox("Error", error, 0, 0, TRUE); end_dialog(); @@ -93,25 +100,26 @@ main(void) static int fetch_files(int nfiles, char **urls) { + FILE *fetch_out; + FILE *file_out; const char **items; - FILE *fetch_out, *file_out; - struct url_stat ustat; - off_t total_bytes, current_bytes, fsize; + int i; + int last_progress; + int nsuccess = 0; /* Number of files successfully downloaded */ + int progress = 0; + size_t chunk; + off_t current_bytes; + off_t fsize; + off_t total_bytes; char status[8]; - char errormsg[512]; + struct url_stat ustat; + char errormsg[PATH_MAX + 512]; uint8_t block[4096]; - size_t chunk; - int i, progress, last_progress; - int nsuccess = 0; /* Number of files successfully downloaded */ - progress = 0; - /* Make the transfer list for dialog */ items = calloc(sizeof(char *), nfiles * 2); - if (items == NULL) { - fprintf(stderr, "Out of memory!\n"); - return (-1); - } + if (items == NULL) + errx(EXIT_FAILURE, "Out of memory!"); for (i = 0; i < nfiles; i++) { items[i*2] = strrchr(urls[i], '/'); @@ -177,7 +185,8 @@ fetch_files(int nfiles, char **urls) } if (ustat.size > 0) { - sprintf(status, "-%jd", (fsize*100)/ustat.size); + snprintf(status, sizeof(status), "-%jd", + (fsize*100)/ustat.size); items[i*2 + 1] = status; } @@ -212,4 +221,3 @@ fetch_files(int nfiles, char **urls) free(items); return (nsuccess); } - From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 08:57:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFFFCFF2; Mon, 29 Sep 2014 08:57:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC7AD8BA; Mon, 29 Sep 2014 08:57: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 s8T8vaqk094032; Mon, 29 Sep 2014 08:57:36 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8T8vamj094031; Mon, 29 Sep 2014 08:57:36 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409290857.s8T8vamj094031@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 29 Sep 2014 08:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272280 - head/lib/libpam/modules/pam_login_access X-SVN-Group: head MIME-Version: 1.0 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, 29 Sep 2014 08:57:36 -0000 Author: des Date: Mon Sep 29 08:57:36 2014 New Revision: 272280 URL: http://svnweb.freebsd.org/changeset/base/272280 Log: Instead of failing when neither PAM_TTY nor PAM_RHOST are available, call login_access() with "**unknown**" as the second argument. This will allow "ALL" rules to match. Reported by: Tim Daneliuk Tested by: dim@ PR: 83099 193927 MFC after: 3 days Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c ============================================================================== --- head/lib/libpam/modules/pam_login_access/pam_login_access.c Mon Sep 29 01:17:42 2014 (r272279) +++ head/lib/libpam/modules/pam_login_access/pam_login_access.c Mon Sep 29 08:57:36 2014 (r272280) @@ -94,8 +94,10 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", user, tty); } else { - PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required"); - return (PAM_AUTHINFO_UNAVAIL); + PAM_LOG("Checking login.access for user %s", user); + if (login_access(user, "***unknown***") != 0) + return (PAM_SUCCESS); + PAM_VERBOSE_ERROR("%s is not allowed to log in", user); } return (PAM_AUTH_ERR); From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 09:14:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C50334CC; Mon, 29 Sep 2014 09:14:29 +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 77D70AA2; Mon, 29 Sep 2014 09:14:28 +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 B2B2E25D3A82; Mon, 29 Sep 2014 09:14:24 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id ACEC1C77108; Mon, 29 Sep 2014 09:14:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id ynSQorN8O8Dg; Mon, 29 Sep 2014 09:14:22 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:80e5:6a63:fe7c:9e54] (unknown [IPv6:fde9:577b:c1a9:4410:80e5:6a63:fe7c:9e54]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 8BC3AC77107; Mon, 29 Sep 2014 09:14:20 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r272280 - head/lib/libpam/modules/pam_login_access From: "Bjoern A. Zeeb" In-Reply-To: <201409290857.s8T8vamj094031@svn.freebsd.org> Date: Mon, 29 Sep 2014 09:13:59 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <4197A538-C42B-44DD-A20A-C4E900478D69@FreeBSD.org> References: <201409290857.s8T8vamj094031@svn.freebsd.org> To: =?windows-1252?Q?Dag-Erling_Sm=F8rgrav?= X-Mailer: Apple Mail (2.1878.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: Mon, 29 Sep 2014 09:14:30 -0000 On 29 Sep 2014, at 08:57 , Dag-Erling Sm=F8rgrav = wrote: > Author: des > Date: Mon Sep 29 08:57:36 2014 > New Revision: 272280 > URL: http://svnweb.freebsd.org/changeset/base/272280 >=20 > Log: > Instead of failing when neither PAM_TTY nor PAM_RHOST are available, = call > login_access() with "**unknown**" as the second argument. This will = allow > =93ALL" rules to match. >=20 = /scratch/tmp/bz/head.svn/lib/libpam/modules/pam_login_access/pam_login_acc= ess.c: In function 'pam_sm_acct_mgmt': = /scratch/tmp/bz/head.svn/lib/libpam/modules/pam_login_access/pam_login_acc= ess.c:97: warning: format '%s' expects type 'char *', but argument 4 has = type 'const void *' > Reported by: Tim Daneliuk > Tested by: dim@ > PR: 83099 193927 > MFC after: 3 days >=20 > Modified: > head/lib/libpam/modules/pam_login_access/pam_login_access.c >=20 > Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libpam/modules/pam_login_access/pam_login_access.c = Mon Sep 29 01:17:42 2014 (r272279) > +++ head/lib/libpam/modules/pam_login_access/pam_login_access.c = Mon Sep 29 08:57:36 2014 (r272280) > @@ -94,8 +94,10 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int > PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", > user, tty); > } else { > - PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required"); > - return (PAM_AUTHINFO_UNAVAIL); > + PAM_LOG("Checking login.access for user %s", user); > + if (login_access(user, "***unknown***") !=3D 0) > + return (PAM_SUCCESS); > + PAM_VERBOSE_ERROR("%s is not allowed to log in", user); > } >=20 > return (PAM_AUTH_ERR); >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 10:36:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B01D845; Mon, 29 Sep 2014 10:36: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 57B1D312; Mon, 29 Sep 2014 10:36: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 s8TAaFf6040311; Mon, 29 Sep 2014 10:36:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8TAaFUs040310; Mon, 29 Sep 2014 10:36:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409291036.s8TAaFUs040310@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 29 Sep 2014 10:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272281 - head/lib/libpam/modules/pam_login_access X-SVN-Group: head MIME-Version: 1.0 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, 29 Sep 2014 10:36:15 -0000 Author: bz Date: Mon Sep 29 10:36:14 2014 New Revision: 272281 URL: http://svnweb.freebsd.org/changeset/base/272281 Log: Hopefully fix build breakage with gcc passing void * instead of char * to "%s" format string after r272280. PR: 83099 193927 MFC after: 3 days X-MFC with: r272280 Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c ============================================================================== --- head/lib/libpam/modules/pam_login_access/pam_login_access.c Mon Sep 29 08:57:36 2014 (r272280) +++ head/lib/libpam/modules/pam_login_access/pam_login_access.c Mon Sep 29 10:36:14 2014 (r272281) @@ -94,7 +94,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", user, tty); } else { - PAM_LOG("Checking login.access for user %s", user); + PAM_LOG("Checking login.access for user %s", + (const char *)user); if (login_access(user, "***unknown***") != 0) return (PAM_SUCCESS); PAM_VERBOSE_ERROR("%s is not allowed to log in", user); From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 11:10:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65DAB2C4; Mon, 29 Sep 2014 11:10:34 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2317D8B5; Mon, 29 Sep 2014 11:10:33 +0000 (UTC) Received: from [192.168.2.2] (unknown [77.243.161.229]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4863FB80A; Mon, 29 Sep 2014 13:10:23 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_0F40BEA6-9BCE-433B-932A-5B2C79865E07"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r272281 - head/lib/libpam/modules/pam_login_access From: Dimitry Andric In-Reply-To: <201409291036.s8TAaFUs040310@svn.freebsd.org> Date: Mon, 29 Sep 2014 13:10:03 +0200 Message-Id: References: <201409291036.s8TAaFUs040310@svn.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.1878.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: Mon, 29 Sep 2014 11:10:34 -0000 --Apple-Mail=_0F40BEA6-9BCE-433B-932A-5B2C79865E07 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 29 Sep 2014, at 12:36, Bjoern A. Zeeb wrote: > Author: bz > Date: Mon Sep 29 10:36:14 2014 > New Revision: 272281 > URL: http://svnweb.freebsd.org/changeset/base/272281 >=20 > Log: > Hopefully fix build breakage with gcc passing void * instead of char = * > to "%s" format string after r272280. >=20 > PR: 83099 193927 > MFC after: 3 days > X-MFC with: r272280 >=20 > Modified: > head/lib/libpam/modules/pam_login_access/pam_login_access.c >=20 > Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libpam/modules/pam_login_access/pam_login_access.c = Mon Sep 29 08:57:36 2014 (r272280) > +++ head/lib/libpam/modules/pam_login_access/pam_login_access.c = Mon Sep 29 10:36:14 2014 (r272281) > @@ -94,7 +94,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int > PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", > user, tty); > } else { > - PAM_LOG("Checking login.access for user %s", user); > + PAM_LOG("Checking login.access for user %s", > + (const char *)user); > if (login_access(user, "***unknown***") !=3D 0) > return (PAM_SUCCESS); > PAM_VERBOSE_ERROR("%s is not allowed to log in", user); >=20 Just a few lines after the one you fixed it accesses the same variable again. Why doesn't it warn there? And why is 'user' not a char * to begin with? :) -Dimitry --Apple-Mail=_0F40BEA6-9BCE-433B-932A-5B2C79865E07 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlQpPhMACgkQsF6jCi4glqMoYgCglBL1qvCzvB7RQrk6+TeQPD5X QmYAoNqkqv091P3gB46nRccVyKQZ9EDh =oeTD -----END PGP SIGNATURE----- --Apple-Mail=_0F40BEA6-9BCE-433B-932A-5B2C79865E07-- From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 11:24:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEA54567; Mon, 29 Sep 2014 11:24:21 +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 AFA08A7A; Mon, 29 Sep 2014 11:23:43 +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 2DD4325D37C3; Mon, 29 Sep 2014 11:21:28 +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 ADCA9C77108; Mon, 29 Sep 2014 11:21:27 +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 kII1DuTQlS0F; Mon, 29 Sep 2014 11:21:26 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:80e5:6a63:fe7c:9e54] (unknown [IPv6:fde9:577b:c1a9:4410:80e5:6a63:fe7c:9e54]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 5AF6CC77107; Mon, 29 Sep 2014 11:21:23 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r272281 - head/lib/libpam/modules/pam_login_access From: "Bjoern A. Zeeb" In-Reply-To: Date: Mon, 29 Sep 2014 11:20:20 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <4929EC39-0862-4547-B044-44C396529F74@FreeBSD.org> References: <201409291036.s8TAaFUs040310@svn.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1878.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: Mon, 29 Sep 2014 11:24:22 -0000 On 29 Sep 2014, at 11:10 , Dimitry Andric wrote: > On 29 Sep 2014, at 12:36, Bjoern A. Zeeb wrote: >> Author: bz >> Date: Mon Sep 29 10:36:14 2014 >> New Revision: 272281 >> URL: http://svnweb.freebsd.org/changeset/base/272281 >>=20 >> Log: >> Hopefully fix build breakage with gcc passing void * instead of char = * >> to "%s" format string after r272280. >>=20 >> PR: 83099 193927 >> MFC after: 3 days >> X-MFC with: r272280 >>=20 >> Modified: >> head/lib/libpam/modules/pam_login_access/pam_login_access.c >>=20 >> Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/lib/libpam/modules/pam_login_access/pam_login_access.c = Mon Sep 29 08:57:36 2014 (r272280) >> +++ head/lib/libpam/modules/pam_login_access/pam_login_access.c = Mon Sep 29 10:36:14 2014 (r272281) >> @@ -94,7 +94,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int >> PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", >> user, tty); >> } else { >> - PAM_LOG("Checking login.access for user %s", user); >> + PAM_LOG("Checking login.access for user %s", >> + (const char *)user); >> if (login_access(user, "***unknown***") !=3D 0) >> return (PAM_SUCCESS); >> PAM_VERBOSE_ERROR("%s is not allowed to log in", user); >>=20 >=20 > Just a few lines after the one you fixed it accesses the same variable > again. Why doesn't it warn there? And why is 'user' not a char * to > begin with? :) For the latter ask des. the PAM_VERBOSE_ERROR goes into a function which (if remembering = correctly) does the va_start and asprintf rather than just being a macro = to printf. The arguments are not casted anywhere to that macro but I = am, again, sure des will have an opinion on it;-) =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 12:01:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C39B831F; Mon, 29 Sep 2014 12:01:51 +0000 (UTC) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 88C44E73; Mon, 29 Sep 2014 12:01:51 +0000 (UTC) Received: from localhost (unknown [95.87.192.86]) by mail.dawidek.net (Postfix) with ESMTPSA id 2EFA0615; Mon, 29 Sep 2014 14:01:49 +0200 (CEST) Date: Mon, 29 Sep 2014 14:03:36 +0200 From: Pawel Jakub Dawidek To: Garrett Cooper Subject: Re: svn commit: r271241 - head/lib/libnv Message-ID: <20140929120336.GB2194@garage.freebsd.pl> References: <201409072256.s87MuvIl059453@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409072256.s87MuvIl059453@svn.freebsd.org> X-OS: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 29 Sep 2014 12:01:51 -0000 On Sun, Sep 07, 2014 at 10:56:57PM +0000, Garrett Cooper wrote: > Author: ngie > Date: Sun Sep 7 22:56:57 2014 > New Revision: 271241 > URL: http://svnweb.freebsd.org/changeset/base/271241 > > Log: > Include src.opts.mk after SHLIBDIR has been defined so libnv is installed to > /lib , not /usr/lib Don't forget to add /usr/lib/libnv* to ObsoleteFiles.inc. -- Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 14:24:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1F3B4CB; Mon, 29 Sep 2014 14:24:31 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 81FFC145; Mon, 29 Sep 2014 14:24:30 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id C64391041BC3; Mon, 29 Sep 2014 23:57:04 +1000 (EST) Date: Mon, 29 Sep 2014 23:56:59 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Bjoern A. Zeeb" Subject: Re: svn commit: r272281 - head/lib/libpam/modules/pam_login_access In-Reply-To: <4929EC39-0862-4547-B044-44C396529F74@FreeBSD.org> Message-ID: <20140929233019.C2907@besplex.bde.org> References: <201409291036.s8TAaFUs040310@svn.freebsd.org> <4929EC39-0862-4547-B044-44C396529F74@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=AOuw8Gd4 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=MYfIN0nJ268ONEqtP8QA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 29 Sep 2014 14:24:31 -0000 On Mon, 29 Sep 2014, Bjoern A. Zeeb wrote: > > On 29 Sep 2014, at 11:10 , Dimitry Andric wrote: > >> On 29 Sep 2014, at 12:36, Bjoern A. Zeeb wrote: >>> ... >>> Log: >>> Hopefully fix build breakage with gcc passing void * instead of char * >>> to "%s" format string after r272280. >>> >>> Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c >>> ============================================================================== >>> --- head/lib/libpam/modules/pam_login_access/pam_login_access.c Mon Sep 29 08:57:36 2014 (r272280) >>> +++ head/lib/libpam/modules/pam_login_access/pam_login_access.c Mon Sep 29 10:36:14 2014 (r272281) >>> @@ -94,7 +94,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int >>> PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", >>> user, tty); >>> } else { >>> - PAM_LOG("Checking login.access for user %s", user); >>> + PAM_LOG("Checking login.access for user %s", >>> + (const char *)user); >>> if (login_access(user, "***unknown***") != 0) >>> return (PAM_SUCCESS); >>> PAM_VERBOSE_ERROR("%s is not allowed to log in", user); >>> >> >> Just a few lines after the one you fixed it accesses the same variable >> again. Why doesn't it warn there? And why is 'user' not a char * to >> begin with? :) > > For the latter ask des. > > the PAM_VERBOSE_ERROR goes into a function which (if remembering correctly) does the va_start and asprintf rather than just being a macro to printf. The arguments are not casted anywhere to that macro but I am, again, sure des will have an opinion on it;-) Just another bug. PAM_LOG() expands to a call to a function that is declared as __printflike() (but with a worse spelling). PAM_VERBOSE_ERROR() expands to a call to a function that is missing this declaration. Other bugs in PAM_VERBOSE_ERROR()'s function include not checking if asprintf() succeeded. malloc() failures can't happen, but it is bad to do dynamic allocation in an error-reporting routine. All uses of PAM_VERBOSE_ERROR() except 2 visible in the patch use a format with no args, so there aren't many print format errors to fix. asprintf() is a heavyweight method for constructing a format for printing these args (and some others that are automatically added). Bruce From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 15:05:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69457957; Mon, 29 Sep 2014 15:05:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B60B856; Mon, 29 Sep 2014 15:05: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 s8TF5OUi066887; Mon, 29 Sep 2014 15:05:24 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8TF5Nhh066884; Mon, 29 Sep 2014 15:05:23 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409291505.s8TF5Nhh066884@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Mon, 29 Sep 2014 15:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272282 - 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: Mon, 29 Sep 2014 15:05:24 -0000 Author: will Date: Mon Sep 29 15:05:23 2014 New Revision: 272282 URL: http://svnweb.freebsd.org/changeset/base/272282 Log: Search for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR. This will only take effect if PORTSDIR is not set, as previously supported. Use .if exists(), for four specific possibilities relative to .CURDIR: ., .., ../.., and ../../.. The fourth possibility is primarily in case ports ever grows a third level. If none of these paths exist, fall back to the old default of /usr/ports. This removes the need to set PORTSDIR explicitly (or via wrapper script) if one is running out of a ports tree that is not in /usr/ports, but in a home directory. Reviewed by: bapt, bdrewery (older version) CR: D799 MFC after: 1 week Sponsored by: Spectra Logic Modified: head/share/mk/bsd.port.mk head/share/mk/bsd.port.subdir.mk Modified: head/share/mk/bsd.port.mk ============================================================================== --- head/share/mk/bsd.port.mk Mon Sep 29 10:36:14 2014 (r272281) +++ head/share/mk/bsd.port.mk Mon Sep 29 15:05:23 2014 (r272282) @@ -1,6 +1,22 @@ # $FreeBSD$ -PORTSDIR?= /usr/ports +.if !defined(PORTSDIR) +# Autodetect if the command is being run in a ports tree that's not rooted +# in the default /usr/ports. The ../../.. case is in case ports ever grows +# a third level. +.if exists(${.CURDIR}/Mk/bsd.port.mk) +PORTSDIR= ${.CURDIR} +.elif exists(${.CURDIR}/../Mk/bsd.port.mk) +PORTSDIR= ${.CURDIR}/.. +.elif exists(${.CURDIR}/../../Mk/bsd.port.mk) +PORTSDIR= ${.CURDIR}/../.. +.elif exists(${.CURDIR}/../../../Mk/bsd.port.mk) +PORTSDIR= ${.CURDIR}/../../.. +.else +PORTSDIR= /usr/ports +.endif +.endif + BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk # Needed to keep bsd.own.mk from reading in /etc/src.conf Modified: head/share/mk/bsd.port.subdir.mk ============================================================================== --- head/share/mk/bsd.port.subdir.mk Mon Sep 29 10:36:14 2014 (r272281) +++ head/share/mk/bsd.port.subdir.mk Mon Sep 29 15:05:23 2014 (r272282) @@ -1,6 +1,22 @@ # $FreeBSD$ -PORTSDIR?= /usr/ports +.if !defined(PORTSDIR) +# Autodetect if the command is being run in a ports tree that's not rooted +# in the default /usr/ports. The ../../.. case is in case ports ever grows +# a third level. +.if exists(${.CURDIR}/Mk/bsd.port.mk) +PORTSDIR= ${.CURDIR} +.elif exists(${.CURDIR}/../Mk/bsd.port.mk) +PORTSDIR= ${.CURDIR}/.. +.elif exists(${.CURDIR}/../../Mk/bsd.port.mk) +PORTSDIR= ${.CURDIR}/../.. +.elif exists(${.CURDIR}/../../../Mk/bsd.port.mk) +PORTSDIR= ${.CURDIR}/../../.. +.else +PORTSDIR= /usr/ports +.endif +.endif + BSDPORTSUBDIRMK?= ${PORTSDIR}/Mk/bsd.port.subdir.mk .include "${BSDPORTSUBDIRMK}" From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 15:27:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E175EBA; Mon, 29 Sep 2014 15:27:55 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26B4EAA4; Mon, 29 Sep 2014 15:27:55 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2433AB939; Mon, 29 Sep 2014 11:27:54 -0400 (EDT) From: John Baldwin To: Colin Percival Subject: Re: svn commit: r272207 - in head/games: factor primes Date: Mon, 29 Sep 2014 10:30:14 -0400 Message-ID: <5561525.GofWoxIbJB@ralph.baldwin.cx> User-Agent: KMail/4.12.5 (FreeBSD/10.1-BETA2; KDE/4.12.5; amd64; ; ) In-Reply-To: <5426B4EC.9040102@freebsd.org> References: <201409270900.s8R90dWl029070@svn.freebsd.org> <1576403.4iOOFWFkUs@ralph.baldwin.cx> <5426B4EC.9040102@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 29 Sep 2014 11:27:54 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 29 Sep 2014 15:27:55 -0000 On Saturday, September 27, 2014 06:00:28 AM Colin Percival wrote: > On 09/27/14 05:52, John Baldwin wrote: > > On Saturday, September 27, 2014 09:00:39 AM Colin Percival wrote: > >> #define BIG ULONG_MAX /* largest value will sieve */ > > > > Should this be UINT64_MAX (or however that is spelled) instead of > > ULONG_MAX > > now? (or is it even still used? I know your change removed its use in at > > least one place.) > > It's not used any more. I was resisting the urge to spend time going > through and removing ancient history (which is why I kept ubig instead of > changing it to uint64_t everywhere). It's kind of misleading though as the value is wrong and the comment for it no longer applies. How about this: Index: primes.c =================================================================== --- primes.c (revision 272281) +++ primes.c (working copy) @@ -169,7 +169,7 @@ /* * read_num_buf -- - * This routine returns a number n, where 0 <= n && n <= BIG. + * This routine returns a non-negative number n */ static ubig read_num_buf(void) @@ -214,7 +214,7 @@ /* * A number of systems can not convert double values into unsigned * longs when the values are larger than the largest signed value. - * We don't have this problem, so we can go all the way to BIG. + * We don't have this problem, so we can go all the way. */ if (start < 3) { start = (ubig)2; Index: primes.h =================================================================== --- primes.h (revision 272281) +++ primes.h (working copy) @@ -45,7 +45,6 @@ /* ubig is the type that holds a large unsigned value */ typedef uint64_t ubig; /* must be >=32 bit unsigned value */ -#define BIG ULONG_MAX /* largest value will sieve */ /* bytes in sieve table (must be > 3*5*7*11) */ #define TABSIZE 256*1024 -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 16:44:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D56F1D3; Mon, 29 Sep 2014 16:44:06 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B5ACC374; Mon, 29 Sep 2014 16:44:04 +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 s8TGi1n4067660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 29 Sep 2014 20:44:01 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8TGi1Tk067659; Mon, 29 Sep 2014 20:44:01 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 29 Sep 2014 20:44:01 +0400 From: Gleb Smirnoff To: "Bjoern A. Zeeb" Subject: Re: svn commit: r272261 - head/sys/net Message-ID: <20140929164401.GC884@FreeBSD.org> References: <201409281709.s8SH9e0Y047460@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409281709.s8SH9e0Y047460@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: Mon, 29 Sep 2014 16:44:06 -0000 On Sun, Sep 28, 2014 at 05:09:40PM +0000, Bjoern A. Zeeb wrote: B> Author: bz B> Date: Sun Sep 28 17:09:40 2014 B> New Revision: 272261 B> URL: http://svnweb.freebsd.org/changeset/base/272261 B> B> Log: B> Move the unconditional #include of net/ifq.h to the very end of file. B> This seems to allow us to pass a universe with either clang or gcc B> after r272244 (and r272260) and probably makes it easier to untabgle B> these chained #includes in the future. Thanks, Bjoern. This is probably the least ugly solution. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 17:38:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70DC39FB; Mon, 29 Sep 2014 17:38: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 5C3D6B7F; Mon, 29 Sep 2014 17:38: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 s8THcpK8038997; Mon, 29 Sep 2014 17:38:51 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8THcpxo038996; Mon, 29 Sep 2014 17:38:51 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201409291738.s8THcpxo038996@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Mon, 29 Sep 2014 17:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272284 - head/usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 29 Sep 2014 17:38:51 -0000 Author: rstone Date: Mon Sep 29 17:38:50 2014 New Revision: 272284 URL: http://svnweb.freebsd.org/changeset/base/272284 Log: Fix integer truncation in affecting systat -ifstat The "systat -ifstat" command was using a u_int to store byte counters. With a 10Gbps or faster interface, this overflows within the default 5 second refresh period. Switch to using a uint64_t across the board, which matches the size used for all counters as of r263102. PR: 182448 MFC after: 1 week Sponsored by: Sandvine Inc Modified: head/usr.bin/systat/ifstat.c Modified: head/usr.bin/systat/ifstat.c ============================================================================== --- head/usr.bin/systat/ifstat.c Mon Sep 29 16:24:48 2014 (r272283) +++ head/usr.bin/systat/ifstat.c Mon Sep 29 17:38:50 2014 (r272284) @@ -68,14 +68,14 @@ struct if_stat { struct ifmibdata if_mib; struct timeval tv; struct timeval tv_lastchanged; - u_long if_in_curtraffic; - u_long if_out_curtraffic; - u_long if_in_traffic_peak; - u_long if_out_traffic_peak; - u_long if_in_curpps; - u_long if_out_curpps; - u_long if_in_pps_peak; - u_long if_out_pps_peak; + uint64_t if_in_curtraffic; + uint64_t if_out_curtraffic; + uint64_t if_in_traffic_peak; + uint64_t if_out_traffic_peak; + uint64_t if_in_curpps; + uint64_t if_out_curpps; + uint64_t if_in_pps_peak; + uint64_t if_out_pps_peak; u_int if_row; /* Index into ifmib sysctl */ int if_ypos; /* -1 if not being displayed */ u_int display; @@ -269,8 +269,8 @@ fetchifstat(void) struct if_stat *ifp = NULL; struct timeval tv, new_tv, old_tv; double elapsed = 0.0; - u_int new_inb, new_outb, old_inb, old_outb = 0; - u_int new_inp, new_outp, old_inp, old_outp = 0; + uint64_t new_inb, new_outb, old_inb, old_outb = 0; + uint64_t new_inp, new_outp, old_inp, old_outp = 0; SLIST_FOREACH(ifp, &curlist, link) { /* From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 17:51:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABA4A1BB; Mon, 29 Sep 2014 17:51:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C55ACA8; Mon, 29 Sep 2014 17:51: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 s8THpeXG047517; Mon, 29 Sep 2014 17:51:40 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8THpdho047514; Mon, 29 Sep 2014 17:51:39 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201409291751.s8THpdho047514@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Mon, 29 Sep 2014 17:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272285 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 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, 29 Sep 2014 17:51:40 -0000 Author: rstone Date: Mon Sep 29 17:51:39 2014 New Revision: 272285 URL: http://svnweb.freebsd.org/changeset/base/272285 Log: Ensure that ixl_flush() uses a defined register on VFs In some code that is shared between the ixl(4) and ixlv(4) drivers, a macro hard-coded a register offset that was not valid on ixlv devices. Fix this by having each driver define a variable that contains the correct offset. Reviewed by: Eric Joyner MFC after: 3 days Sponsored by: Sandvine Inc Modified: head/sys/dev/ixl/i40e_osdep.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c Modified: head/sys/dev/ixl/i40e_osdep.h ============================================================================== --- head/sys/dev/ixl/i40e_osdep.h Mon Sep 29 17:38:50 2014 (r272284) +++ head/sys/dev/ixl/i40e_osdep.h Mon Sep 29 17:51:39 2014 (r272285) @@ -152,6 +152,7 @@ struct i40e_osdep bus_space_tag_t mem_bus_space_tag; bus_space_handle_t mem_bus_space_handle; bus_size_t mem_bus_space_size; + uint32_t flush_reg; struct device *dev; }; @@ -208,6 +209,13 @@ wr32_osdep(struct i40e_osdep *osdep, uin osdep->mem_bus_space_handle, reg, value); } +static __inline void +ixl_flush_osdep(struct i40e_osdep *osdep) +{ + + rd32_osdep(osdep, osdep->flush_reg); +} + #define rd32(a, reg) rd32_osdep((a)->back, (reg)) #define wr32(a, reg, value) wr32_osdep((a)->back, (reg), (value)) @@ -221,9 +229,6 @@ wr32_osdep(struct i40e_osdep *osdep, uin ((struct i40e_osdep *)(a)->back)->mem_bus_space_handle, \ reg, value)) -#define ixl_flush(a) (\ - bus_space_read_4( ((struct i40e_osdep *)(a)->back)->mem_bus_space_tag, \ - ((struct i40e_osdep *)(a)->back)->mem_bus_space_handle, \ - I40E_GLGEN_STAT)) +#define ixl_flush(a) ixl_flush_osdep((a)->back) #endif /* _I40E_OSDEP_H_ */ Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Mon Sep 29 17:38:50 2014 (r272284) +++ head/sys/dev/ixl/if_ixl.c Mon Sep 29 17:51:39 2014 (r272285) @@ -2177,6 +2177,7 @@ ixl_allocate_pci_resources(struct ixl_pf pf->osdep.mem_bus_space_handle = rman_get_bushandle(pf->pci_mem); pf->osdep.mem_bus_space_size = rman_get_size(pf->pci_mem); + pf->osdep.flush_reg = I40E_GLGEN_STAT; pf->hw.hw_addr = (u8 *) &pf->osdep.mem_bus_space_handle; pf->hw.back = &pf->osdep; Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Mon Sep 29 17:38:50 2014 (r272284) +++ head/sys/dev/ixl/if_ixlv.c Mon Sep 29 17:51:39 2014 (r272285) @@ -1137,6 +1137,7 @@ ixlv_allocate_pci_resources(struct ixlv_ sc->osdep.mem_bus_space_handle = rman_get_bushandle(sc->pci_mem); sc->osdep.mem_bus_space_size = rman_get_size(sc->pci_mem); + sc->osdep.flush_reg = I40E_VFGEN_RSTAT; sc->hw.hw_addr = (u8 *) &sc->osdep.mem_bus_space_handle; sc->hw.back = &sc->osdep; From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 18:39:32 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7D99EFB; Mon, 29 Sep 2014 18:39:32 +0000 (UTC) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) (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 416CD2AE; Mon, 29 Sep 2014 18:39:31 +0000 (UTC) Received: from [192.168.225.11] (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id s8TIVaK4098317; Mon, 29 Sep 2014 20:31:39 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <5429A58E.2030508@FreeBSD.org> Date: Mon, 29 Sep 2014 20:31:42 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Andrew Turner , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r272209 - in head/sys/arm: arm include References: <201409270957.s8R9vYrw056987@svn.freebsd.org> In-Reply-To: <201409270957.s8R9vYrw056987@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 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, 29 Sep 2014 18:39:32 -0000 Hi Andrew, On 27.09.14 11:57, Andrew Turner wrote: > Author: andrew > Date: Sat Sep 27 09:57:34 2014 > New Revision: 272209 > URL: http://svnweb.freebsd.org/changeset/base/272209 > > Log: > Add machine/sysreg.h to simplify accessing the system control coprocessor > registers and use it in the ARMv7 CPU functions. > > The sysreg.h file has been checked by hand, however it may contain errors > with the comments on when a register was first introduced. The ARMv7 cpu > functions have been checked by compiling both the previous and this version > and comparing the md5 of the object files. > > Submitted by: Svatopluk Kraus > Submitted by: Michal Meloun > Reviewed by: ian, rpaulo > Differential Revision: https://reviews.freebsd.org/D795 > > Added: > head/sys/arm/include/sysreg.h (contents, props changed) This one breaks kernel build with gcc-4.2.1. __ARM_ARCH not defined. On gcc-4.2.1 there is no __ARM_ARCH builtin. Later gcc do have it. The include below fixes the build. Andreas Index: sys/arm/arm/cpufunc_asm_armv7.S =================================================================== --- sys/arm/arm/cpufunc_asm_armv7.S (revision 272282) +++ sys/arm/arm/cpufunc_asm_armv7.S (working copy) @@ -33,6 +33,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include .cpu cortex-a8 From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 21:45:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB559BFD; Mon, 29 Sep 2014 21:45:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7F36C47; Mon, 29 Sep 2014 21:45: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 s8TLjvHI059567; Mon, 29 Sep 2014 21:45:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8TLjvr5059566; Mon, 29 Sep 2014 21:45:57 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409292145.s8TLjvr5059566@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 29 Sep 2014 21:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272288 - head/usr.bin/at X-SVN-Group: head MIME-Version: 1.0 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, 29 Sep 2014 21:45:58 -0000 Author: delphij Date: Mon Sep 29 21:45:57 2014 New Revision: 272288 URL: http://svnweb.freebsd.org/changeset/base/272288 Log: When setting environment variables in the atrun script, use the "export foo=bar" form instead of "foo=bar; export foo" since the former allows the shell to catch variable names that are not valid shell identifiers. This will cause /bin/sh to exit with an error (which gets mailed to the at user) and it will not run the script. Obtained from: OpenBSD (r1.63 millert) MFC after: 3 days Modified: head/usr.bin/at/at.c Modified: head/usr.bin/at/at.c ============================================================================== --- head/usr.bin/at/at.c Mon Sep 29 19:54:17 2014 (r272287) +++ head/usr.bin/at/at.c Mon Sep 29 21:45:57 2014 (r272288) @@ -367,6 +367,7 @@ writefile(time_t runtimer, char queue) if (export) { + (void)fputs("export ", fp); fwrite(*atenv, sizeof(char), eqp-*atenv, fp); for(ap = eqp;*ap != '\0'; ap++) { @@ -389,7 +390,6 @@ writefile(time_t runtimer, char queue) fputc(*ap, fp); } } - fputs("; export ", fp); fwrite(*atenv, sizeof(char), eqp-*atenv -1, fp); fputc('\n', fp); From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 21:51:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E01A4DA7; Mon, 29 Sep 2014 21:51:49 +0000 (UTC) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D491C80; Mon, 29 Sep 2014 21:51:48 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id y10so1793820wgg.3 for ; Mon, 29 Sep 2014 14:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=4fUVDWlUlxLfA1kBRuDZ7MiKylzbbCF3k8nN7cLODww=; b=q13agHdjgDnPtI1vIA18Q7iqUgq3r5oTrs6pW1sOxNc2JWjNaCkUbWXeoz7Tmnjyvx wlpAD6FlcajaKm9V6IMl3WRVNJG3p8HIimYihkQYprQzhJApg0TgQcysW4fL+1Bk0maX 0eow3PGf/LF/2evCQe1v7Ihplgy7/qIfpvyzQ+m1T/V8/vnHfvkfkSNBuJhfairm29xl UXxQStW9VDbBK4wfRGtiGazpMQlDiPzORWSCpdCSJUeONi5qC6zYm/LDrDC/Qy81wQ6B nAG5NaPk2Ii8qPXzkZ3P3spJmt+vjps87/cokwher5OysJAa62SGm5o35rJV5z27NZJQ gAZA== X-Received: by 10.194.187.241 with SMTP id fv17mr48588923wjc.13.1412027507170; Mon, 29 Sep 2014 14:51:47 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id fv1sm17040929wjb.35.2014.09.29.14.51.46 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 29 Sep 2014 14:51:46 -0700 (PDT) Date: Mon, 29 Sep 2014 23:51:44 +0200 From: Mateusz Guzik To: Xin LI Subject: Re: svn commit: r272288 - head/usr.bin/at Message-ID: <20140929215143.GA17622@dft-labs.eu> References: <201409292145.s8TLjvr5059566@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201409292145.s8TLjvr5059566@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, 29 Sep 2014 21:51:50 -0000 On Mon, Sep 29, 2014 at 09:45:57PM +0000, Xin LI wrote: > Author: delphij > Date: Mon Sep 29 21:45:57 2014 > New Revision: 272288 > URL: http://svnweb.freebsd.org/changeset/base/272288 > > Log: > When setting environment variables in the atrun script, use the > "export foo=bar" form instead of "foo=bar; export foo" since the > former allows the shell to catch variable names that are not valid > shell identifiers. This will cause /bin/sh to exit with an error > (which gets mailed to the at user) and it will not run the script. > > Obtained from: OpenBSD (r1.63 millert) > MFC after: 3 days > > Modified: > head/usr.bin/at/at.c > > Modified: head/usr.bin/at/at.c > ============================================================================== > --- head/usr.bin/at/at.c Mon Sep 29 19:54:17 2014 (r272287) > +++ head/usr.bin/at/at.c Mon Sep 29 21:45:57 2014 (r272288) > @@ -367,6 +367,7 @@ writefile(time_t runtimer, char queue) > > if (export) > { > + (void)fputs("export ", fp); > fwrite(*atenv, sizeof(char), eqp-*atenv, fp); > for(ap = eqp;*ap != '\0'; ap++) > { > @@ -389,7 +390,6 @@ writefile(time_t runtimer, char queue) > fputc(*ap, fp); > } > } > - fputs("; export ", fp); > fwrite(*atenv, sizeof(char), eqp-*atenv -1, fp); Should not this line also be removed? > fputc('\n', fp); > > -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 21:54:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B1E6309; Mon, 29 Sep 2014 21:54: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 27D9DD34; Mon, 29 Sep 2014 21:54: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 s8TLsl4D064034; Mon, 29 Sep 2014 21:54:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8TLslLA064033; Mon, 29 Sep 2014 21:54:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409292154.s8TLslLA064033@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 29 Sep 2014 21:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272289 - head/usr.bin/at X-SVN-Group: head MIME-Version: 1.0 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, 29 Sep 2014 21:54:47 -0000 Author: delphij Date: Mon Sep 29 21:54:46 2014 New Revision: 272289 URL: http://svnweb.freebsd.org/changeset/base/272289 Log: Sigh, remove a line that needs to be removed along with previous commit. Submitted by: mjg MFC after: 3 days X-MFC-with: 272288 Modified: head/usr.bin/at/at.c Modified: head/usr.bin/at/at.c ============================================================================== --- head/usr.bin/at/at.c Mon Sep 29 21:45:57 2014 (r272288) +++ head/usr.bin/at/at.c Mon Sep 29 21:54:46 2014 (r272289) @@ -390,7 +390,6 @@ writefile(time_t runtimer, char queue) fputc(*ap, fp); } } - fwrite(*atenv, sizeof(char), eqp-*atenv -1, fp); fputc('\n', fp); } From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 23:59:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4765CBC7; Mon, 29 Sep 2014 23:59: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 346B0BE9; Mon, 29 Sep 2014 23:59: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 s8TNxKVg020427; Mon, 29 Sep 2014 23:59:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8TNxK1j020426; Mon, 29 Sep 2014 23:59:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201409292359.s8TNxK1j020426@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 29 Sep 2014 23:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272290 - 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: Mon, 29 Sep 2014 23:59:20 -0000 Author: mjg Date: Mon Sep 29 23:59:19 2014 New Revision: 272290 URL: http://svnweb.freebsd.org/changeset/base/272290 Log: Use bzero instead of explicitly zeroing stuff in do_execve. While strictly speaking this is not correct since some fields are pointers, it makes no difference on all supported archs and we already rely on it doing the right thing in other places. No functional changes. Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Mon Sep 29 21:54:46 2014 (r272289) +++ head/sys/kern/kern_exec.c Mon Sep 29 23:59:19 2014 (r272290) @@ -379,29 +379,10 @@ do_execve(td, args, mac_p) /* * Initialize part of the common data */ + bzero(imgp, sizeof(*imgp)); imgp->proc = p; - imgp->execlabel = NULL; imgp->attr = &attr; - imgp->entry_addr = 0; - imgp->reloc_base = 0; - imgp->vmspace_destroyed = 0; - imgp->interpreted = 0; - imgp->opened = 0; - imgp->interpreter_name = NULL; - imgp->auxargs = NULL; - imgp->vp = NULL; - imgp->object = NULL; - imgp->firstpage = NULL; - imgp->ps_strings = 0; - imgp->auxarg_size = 0; imgp->args = args; - imgp->execpath = imgp->freepath = NULL; - imgp->execpathp = 0; - imgp->canary = 0; - imgp->canarylen = 0; - imgp->pagesizes = 0; - imgp->pagesizeslen = 0; - imgp->stack_prot = 0; #ifdef MAC error = mac_execve_enter(imgp, mac_p); @@ -409,8 +390,6 @@ do_execve(td, args, mac_p) goto exec_fail; #endif - imgp->image_header = NULL; - /* * Translate the file name. namei() returns a vnode pointer * in ni_vp amoung other things. From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 00:06:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBD0FE74; Tue, 30 Sep 2014 00:06: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 B839ECF3; Tue, 30 Sep 2014 00:06: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 s8U06s2C025822; Tue, 30 Sep 2014 00:06:54 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8U06sGX025821; Tue, 30 Sep 2014 00:06:54 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201409300006.s8U06sGX025821@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 30 Sep 2014 00:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272291 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 00:06:54 -0000 Author: bdrewery Date: Tue Sep 30 00:06:53 2014 New Revision: 272291 URL: http://svnweb.freebsd.org/changeset/base/272291 Log: Document [EPERM] for UNIX sockets. MFC after: 2 weeks Modified: head/lib/libc/sys/connect.2 Modified: head/lib/libc/sys/connect.2 ============================================================================== --- head/lib/libc/sys/connect.2 Mon Sep 29 23:59:19 2014 (r272290) +++ head/lib/libc/sys/connect.2 Tue Sep 30 00:06:53 2014 (r272291) @@ -28,7 +28,7 @@ .\" @(#)connect.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 26, 2014 +.Dd September 29, 2014 .Dt CONNECT 2 .Os .Sh NAME @@ -160,6 +160,8 @@ Search permission is denied for a compon Write access to the named socket is denied. .It Bq Er ELOOP Too many symbolic links were encountered in translating the pathname. +.It Bq Er EPERM +Write access to the named socket is denied. .El .Sh SEE ALSO .Xr accept 2 , From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 03:19:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16CA7589; Tue, 30 Sep 2014 03:19:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB6AEE73; Tue, 30 Sep 2014 03:19: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 s8U3JZQo005441; Tue, 30 Sep 2014 03:19:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8U3JTkm005411; Tue, 30 Sep 2014 03:19:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409300319.s8U3JTkm005411@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 30 Sep 2014 03:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272292 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 03:19:36 -0000 Author: adrian Date: Tue Sep 30 03:19:29 2014 New Revision: 272292 URL: http://svnweb.freebsd.org/changeset/base/272292 Log: Add initial support for the AR9485 CUS198 / CUS230 variants. These variants have a few differences from the default AR9485 NIC, namely: * a non-default antenna switch config; * slightly different RX gain table setup; * an external XLNA hooked up to a GPIO pin; * (and not yet done) RSSI threshold differences when doing slow diversity. To make this possible: * Add the PCI device list from Linux ath9k, complete with vendor and sub-vendor IDs for various things to be enabled; * .. and until FreeBSD learns about a PCI device list like this, write a search function inspired by the USB device enumeration code; * add HAL_OPS_CONFIG to the HAL attach methods; the HAL can use this to initialise its local driver parameters upon attach; * copy these parameters over in the AR9300 HAL; * don't default to override the antenna switch - only do it for the chips that require it; * I brought over ar9300_attenuation_apply() from ath9k which is cleaner and easier to read for this particular NIC. This is a work in progress. I'm worried that there's some post-AR9380 NIC out there which doesn't work without the antenna override set as I currently haven't implemented bluetooth coexistence for the AR9380 and later HAL. But I'd rather have this code in the tree and fix it up before 11.0-RELEASE happens versus having a set of newer NICs in laptops be effectively RX deaf. Tested: * AR9380 (STA) * AR9485 CUS198 (STA) Obtained from: Qualcomm Atheros, Linux ath9k Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_lna_div.c head/sys/dev/ath/if_ath_pci.c head/sys/dev/ath/if_athvar.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Tue Sep 30 03:19:29 2014 (r272292) @@ -1181,10 +1181,11 @@ struct ath_hal; extern struct ath_hal_9300 * ar9300_new_state(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_OPS_CONFIG *ah_config, HAL_STATUS *status); extern struct ath_hal * ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, - HAL_STATUS *status); + HAL_OPS_CONFIG *ah_config, HAL_STATUS *status); extern void ar9300_detach(struct ath_hal *ah); extern void ar9300_read_revisions(struct ath_hal *ah); extern HAL_BOOL ar9300_chip_test(struct ath_hal *ah); Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Tue Sep 30 03:19:29 2014 (r272292) @@ -618,7 +618,8 @@ ar9300_read_revisions(struct ath_hal *ah */ struct ath_hal * ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, - HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_STATUS *status) + HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_OPS_CONFIG *ah_config, + HAL_STATUS *status) { struct ath_hal_9300 *ahp; struct ath_hal *ah; @@ -628,7 +629,7 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC HAL_NO_INTERSPERSED_READS; /* NB: memory is returned zero'd */ - ahp = ar9300_new_state(devid, sc, st, sh, eepromdata, status); + ahp = ar9300_new_state(devid, sc, st, sh, eepromdata, ah_config, status); if (ahp == AH_NULL) { return AH_NULL; } @@ -654,12 +655,6 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC /* XXX FreeBSD: enable RX mitigation */ ah->ah_config.ath_hal_intr_mitigation_rx = 1; - /* - * XXX what's this do? Check in the qcamain driver code - * as to what it does. - */ - ah->ah_config.ath_hal_ext_atten_margin_cfg = 0; - /* interrupt mitigation */ #ifdef AR5416_INT_MITIGATION if (ah->ah_config.ath_hal_intr_mitigation_rx != 0) { @@ -2378,7 +2373,9 @@ ar9300_detach(struct ath_hal *ah) struct ath_hal_9300 * ar9300_new_state(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, - uint16_t *eepromdata, HAL_STATUS *status) + uint16_t *eepromdata, + HAL_OPS_CONFIG *ah_config, + HAL_STATUS *status) { static const u_int8_t defbssidmask[IEEE80211_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; @@ -2430,7 +2427,7 @@ ar9300_new_state(u_int16_t devid, HAL_SO ** Initialize factory defaults in the private space */ // ath_hal_factory_defaults(AH_PRIVATE(ah), hal_conf_parm); - ar9300_config_defaults_freebsd(ah); + ar9300_config_defaults_freebsd(ah, ah_config); /* XXX FreeBSD: cal is always in EEPROM */ #if 0 @@ -2456,6 +2453,7 @@ ar9300_new_state(u_int16_t devid, HAL_SO AH_PRIVATE(ah)->ah_tpScale = HAL_TP_SCALE_MAX; /* no scaling */ ahp->ah_atim_window = 0; /* [0..1000] */ + ahp->ah_diversity_control = ah->ah_config.ath_hal_diversity_control; ahp->ah_antenna_switch_swap = @@ -3835,6 +3833,11 @@ ar9300_ant_div_comb_get_config(struct at } else { div_comb_conf->antdiv_configgroup = DEFAULT_ANTDIV_CONFIG_GROUP; } + + /* + * XXX TODO: allow the HAL to override the rssithres and fast_div_bias + * values (eg CUS198.) + */ } void Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Tue Sep 30 03:19:29 2014 (r272292) @@ -1606,6 +1606,7 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct at if ( AR_SREV_POSEIDON(ah) && (ahp->ah_lna_div_use_bt_ant_enable == TRUE) ) { value &= ~AR_SWITCH_TABLE_COM2_ALL; value |= ah->ah_config.ath_hal_ant_ctrl_comm2g_switch_enable; + HALDEBUG(ah, HAL_DEBUG_RESET, "%s: com2=0x%08x\n", __func__, value) } #endif /* ATH_ANT_DIV_COMB */ OS_REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM_2, AR_SWITCH_TABLE_COM2_ALL, value); @@ -1711,6 +1712,8 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct at /* For WB225, need to swith ANT2 from BT to Wifi * This will not affect HB125 LNA diversity feature. */ + HALDEBUG(ah, HAL_DEBUG_RESET, "%s: com2=0x%08x\n", __func__, + ah->ah_config.ath_hal_ant_ctrl_comm2g_switch_enable) OS_REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM_2, AR_SWITCH_TABLE_COM2_ALL, ah->ah_config.ath_hal_ant_ctrl_comm2g_switch_enable); break; @@ -1776,6 +1779,7 @@ ar9300_attenuation_margin_chain_get(stru return 0; } +#if 0 HAL_BOOL ar9300_attenuation_apply(struct ath_hal *ah, u_int16_t channel) { u_int32_t value; @@ -1814,6 +1818,75 @@ HAL_BOOL ar9300_attenuation_apply(struct } return 0; } +#endif +HAL_BOOL +ar9300_attenuation_apply(struct ath_hal *ah, u_int16_t channel) +{ + int i; + uint32_t value; + uint32_t ext_atten_reg[3] = { + AR_PHY_EXT_ATTEN_CTL_0, + AR_PHY_EXT_ATTEN_CTL_1, + AR_PHY_EXT_ATTEN_CTL_2 + }; + + /* + * If it's an AR9462 and we're receiving on the second + * chain only, set the chain 0 details from chain 1 + * calibration. + * + * This is from ath9k. + */ + if (AR_SREV_JUPITER(ah) && (AH9300(ah)->ah_rx_chainmask == 0x2)) { + value = ar9300_attenuation_chain_get(ah, 1, channel); + OS_REG_RMW_FIELD(ah, ext_atten_reg[0], + AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB, value); + value = ar9300_attenuation_margin_chain_get(ah, 1, channel); + OS_REG_RMW_FIELD(ah, ext_atten_reg[0], + AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN, value); + } + + /* + * Now, loop over the configured transmit chains and + * load in the attenuation/margin settings as appropriate. + */ + for (i = 0; i < 3; i++) { + if ((AH9300(ah)->ah_tx_chainmask & (1 << i)) == 0) + continue; + + value = ar9300_attenuation_chain_get(ah, i, channel); + OS_REG_RMW_FIELD(ah, ext_atten_reg[i], + AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB, + value); + + if (AR_SREV_POSEIDON(ah) && + (ar9300_rx_gain_index_get(ah) == 0) && + ah->ah_config.ath_hal_ext_atten_margin_cfg) { + value = 5; + } else { + value = ar9300_attenuation_margin_chain_get(ah, 0, + channel); + } + + /* + * I'm not sure why it's loading in this setting into + * the chain 0 margin regardless of the current chain. + */ + if (ah->ah_config.ath_hal_min_gainidx) + OS_REG_RMW_FIELD(ah, + AR_PHY_EXT_ATTEN_CTL_0, + AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN, + value); + + OS_REG_RMW_FIELD(ah, + ext_atten_reg[i], + AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN, + value); + } + + return (0); +} + static u_int16_t ar9300_quick_drop_get(struct ath_hal *ah, int chain, u_int16_t channel) Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Tue Sep 30 03:19:29 2014 (r272292) @@ -254,7 +254,27 @@ ar9300_attach_freebsd_ops(struct ath_hal ah->ah_divLnaConfSet = ar9300_ant_div_comb_set_config; /* Setup HAL configuration defaults */ + /* XXX cus198 defaults from ath9k */ + /* xlna_gpio = 9 */ + /* xatten_margin_cfg = true */ + /* alt_mingainidx = true */ + /* comm2g_switch_enable = 0x000bbb88 */ + /* ant_comb.low_rssi_thresh = 20 */ + /* ant_comb.fast_div_bias = 3 */ + +#if 0 + /* + * The HAL code treats this as a mask. + * The ath9k code above treats it as a bit offset. + * So it should be set to 0x200, not 0x9. + */ + ah->ah_config.ath_hal_ext_lna_ctl_gpio = 0x200; /* bit 9 */ + ah->ah_config.ath_hal_ext_atten_margin_cfg = AH_TRUE; + ah->ah_config.ath_hal_min_gainidx = AH_TRUE; ah->ah_config.ath_hal_ant_ctrl_comm2g_switch_enable = 0x000bbb88; + /* XXX low_rssi_thresh */ + /* XXX fast_div_bias */ +#endif } HAL_BOOL @@ -338,9 +358,11 @@ ar9300_ani_poll_freebsd(struct ath_hal * * wants. */ void -ar9300_config_defaults_freebsd(struct ath_hal *ah) +ar9300_config_defaults_freebsd(struct ath_hal *ah, HAL_OPS_CONFIG *ah_config) { + /* Until FreeBSD's HAL does this by default - just copy */ + OS_MEMCPY(&ah->ah_config, ah_config, sizeof(HAL_OPS_CONFIG)); ah->ah_config.ath_hal_enable_ani = AH_TRUE; } Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h Tue Sep 30 03:19:29 2014 (r272292) @@ -11,7 +11,8 @@ extern HAL_STATUS ar9300_eeprom_get_free extern HAL_BOOL ar9300_stop_tx_dma_freebsd(struct ath_hal *ah, u_int q); extern void ar9300_ani_poll_freebsd(struct ath_hal *ah, const struct ieee80211_channel *chan); -extern void ar9300_config_defaults_freebsd(struct ath_hal *ah); +extern void ar9300_config_defaults_freebsd(struct ath_hal *ah, + HAL_OPS_CONFIG *ah_config); extern HAL_BOOL ar9300_stop_dma_receive_freebsd(struct ath_hal *ah); extern HAL_BOOL ar9300_get_pending_interrupts_freebsd(struct ath_hal *ah, HAL_INT *masked); Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Tue Sep 30 03:19:29 2014 (r272292) @@ -6151,6 +6151,7 @@ ar9300_ant_ctrl_set_lna_div_use_bt_ant(s value &= ~AR_SWITCH_TABLE_COM2_ALL; value |= ah->ah_config.ath_hal_ant_ctrl_comm2g_switch_enable; } + HALDEBUG(ah, HAL_DEBUG_RESET, "%s: com2=0x%08x\n", __func__, value); OS_REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM_2, AR_SWITCH_TABLE_COM2_ALL, value); value = ar9300_eeprom_get(ahp, EEP_ANTDIV_control); Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ah.c Tue Sep 30 03:19:29 2014 (r272292) @@ -55,7 +55,9 @@ ath_hal_probe(uint16_t vendorid, uint16_ */ struct ath_hal* ath_hal_attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_STATUS *error) + HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_OPS_CONFIG *ah_config, + HAL_STATUS *error) { struct ath_hal_chip * const *pchip; @@ -66,7 +68,8 @@ ath_hal_attach(uint16_t devid, HAL_SOFTC /* XXX don't have vendorid, assume atheros one works */ if (chip->probe(ATHEROS_VENDOR_ID, devid) == AH_NULL) continue; - ah = chip->attach(devid, sc, st, sh, eepromdata, error); + ah = chip->attach(devid, sc, st, sh, eepromdata, ah_config, + error); if (ah != AH_NULL) { /* copy back private state to public area */ ah->ah_devid = AH_PRIVATE(ah)->ah_devid; Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ah.h Tue Sep 30 03:19:29 2014 (r272292) @@ -1264,6 +1264,7 @@ typedef struct int ath_hal_show_bb_panic; int ath_hal_ant_ctrl_comm2g_switch_enable; int ath_hal_ext_atten_margin_cfg; + int ath_hal_min_gainidx; int ath_hal_war70c; uint32_t ath_hal_mci_config; } HAL_OPS_CONFIG; @@ -1616,7 +1617,8 @@ extern const char *__ahdecl ath_hal_prob * be returned if the status parameter is non-zero. */ extern struct ath_hal * __ahdecl ath_hal_attach(uint16_t devid, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, uint16_t *eepromdata, HAL_STATUS* status); + HAL_BUS_TAG, HAL_BUS_HANDLE, uint16_t *eepromdata, + HAL_OPS_CONFIG *ah_config, HAL_STATUS* status); extern const char *ath_hal_mac_name(struct ath_hal *); extern const char *ath_hal_rf_name(struct ath_hal *); Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ah_internal.h Tue Sep 30 03:19:29 2014 (r272292) @@ -91,6 +91,7 @@ struct ath_hal_chip { const char *(*probe)(uint16_t vendorid, uint16_t devid); struct ath_hal *(*attach)(uint16_t devid, HAL_SOFTC, HAL_BUS_TAG, HAL_BUS_HANDLE, uint16_t *eepromdata, + HAL_OPS_CONFIG *ah, HAL_STATUS *error); }; #ifndef AH_CHIP Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Tue Sep 30 03:19:29 2014 (r272292) @@ -183,7 +183,7 @@ static HAL_BOOL ar5210FillCapabilityInfo */ static struct ath_hal * ar5210Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, - uint16_t *eepromdata, HAL_STATUS *status) + uint16_t *eepromdata, HAL_OPS_CONFIG *ah_config, HAL_STATUS *status) { #define N(a) (sizeof(a)/sizeof(a[0])) struct ath_hal_5210 *ahp; Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Tue Sep 30 03:19:29 2014 (r272292) @@ -203,7 +203,7 @@ ar5211GetRadioRev(struct ath_hal *ah) static struct ath_hal * ar5211Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, - HAL_STATUS *status) + HAL_OPS_CONFIG *ah_config, HAL_STATUS *status) { #define N(a) (sizeof(a)/sizeof(a[0])) struct ath_hal_5211 *ahp; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Tue Sep 30 03:19:29 2014 (r272292) @@ -317,7 +317,7 @@ ar5212IsMacSupported(uint8_t macVersion, static struct ath_hal * ar5212Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, - HAL_STATUS *status) + HAL_OPS_CONFIG *ah_config, HAL_STATUS *status) { #define AH_EEPROM_PROTECT(ah) \ (AH_PRIVATE(ah)->ah_ispcie)? AR_EEPROM_PROTECT_PCIE : AR_EEPROM_PROTECT) Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Tue Sep 30 03:19:29 2014 (r272292) @@ -62,7 +62,7 @@ ar5312AniSetup(struct ath_hal *ah) static struct ath_hal * ar5312Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, - HAL_STATUS *status) + HAL_OPS_CONFIG *ah_config, HAL_STATUS *status) { struct ath_hal_5212 *ahp = AH_NULL; struct ath_hal *ah; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Sep 30 03:19:29 2014 (r272292) @@ -297,7 +297,7 @@ ar5416GetRadioRev(struct ath_hal *ah) static struct ath_hal * ar5416Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, - HAL_STATUS *status) + HAL_OPS_CONFIG *ah_config, HAL_STATUS *status) { struct ath_hal_5416 *ahp5416; struct ath_hal_5212 *ahp; Modified: head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c Tue Sep 30 03:19:29 2014 (r272292) @@ -69,7 +69,9 @@ static HAL_BOOL ar9130FillCapabilityInfo */ static struct ath_hal * ar9130Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_STATUS *status) + HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_OPS_CONFIG *ah_config, + HAL_STATUS *status) { struct ath_hal_5416 *ahp5416; struct ath_hal_5212 *ahp; Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Tue Sep 30 03:19:29 2014 (r272292) @@ -114,6 +114,7 @@ ar9160InitPLL(struct ath_hal *ah, const static struct ath_hal * ar9160Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_OPS_CONFIG *ah_config, HAL_STATUS *status) { struct ath_hal_5416 *ahp5416; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Sep 30 03:19:29 2014 (r272292) @@ -148,6 +148,7 @@ ar9280InitPLL(struct ath_hal *ah, const static struct ath_hal * ar9280Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_OPS_CONFIG *ah_config, HAL_STATUS *status) { struct ath_hal_9280 *ahp9280; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Tue Sep 30 03:19:29 2014 (r272292) @@ -133,6 +133,7 @@ ar9285_eeprom_print_diversity_settings(s static struct ath_hal * ar9285Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_OPS_CONFIG *ah_config, HAL_STATUS *status) { struct ath_hal_9285 *ahp9285; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Tue Sep 30 03:19:29 2014 (r272292) @@ -111,6 +111,7 @@ ar9287AniSetup(struct ath_hal *ah) static struct ath_hal * ar9287Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_OPS_CONFIG *ah_config, HAL_STATUS *status) { struct ath_hal_9287 *ahp9287; Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/if_ath.c Tue Sep 30 03:19:29 2014 (r272292) @@ -435,6 +435,81 @@ _ath_power_restore_power_state(struct at } +/* + * Configure the initial HAL configuration values based on bus + * specific parameters. + * + * Some PCI IDs and other information may need tweaking. + * + * XXX TODO: ath9k and the Atheros HAL only program comm2g_switch_enable + * if BT antenna diversity isn't enabled. + * + * So, let's also figure out how to enable BT diversity for AR9485. + */ +static void +ath_setup_hal_config(struct ath_softc *sc, HAL_OPS_CONFIG *ah_config) +{ + /* XXX TODO: only for PCI devices? */ + + if (sc->sc_pci_devinfo & (ATH_PCI_CUS198 | ATH_PCI_CUS230)) { + ah_config->ath_hal_ext_lna_ctl_gpio = 0x200; /* bit 9 */ + ah_config->ath_hal_ext_atten_margin_cfg = AH_TRUE; + ah_config->ath_hal_min_gainidx = AH_TRUE; + ah_config->ath_hal_ant_ctrl_comm2g_switch_enable = 0x000bbb88; + /* XXX low_rssi_thresh */ + /* XXX fast_div_bias */ + device_printf(sc->sc_dev, "configuring for %s\n", + (sc->sc_pci_devinfo & ATH_PCI_CUS198) ? + "CUS198" : "CUS230"); + } + + if (sc->sc_pci_devinfo & ATH_PCI_CUS217) + device_printf(sc->sc_dev, "CUS217 card detected\n"); + + if (sc->sc_pci_devinfo & ATH_PCI_CUS252) + device_printf(sc->sc_dev, "CUS252 card detected\n"); + + if (sc->sc_pci_devinfo & ATH_PCI_AR9565_1ANT) + device_printf(sc->sc_dev, "WB335 1-ANT card detected\n"); + + if (sc->sc_pci_devinfo & ATH_PCI_AR9565_2ANT) + device_printf(sc->sc_dev, "WB335 2-ANT card detected\n"); + + if (sc->sc_pci_devinfo & ATH_PCI_KILLER) + device_printf(sc->sc_dev, "Killer Wireless card detected\n"); + +#if 0 + /* + * Some WB335 cards do not support antenna diversity. Since + * we use a hardcoded value for AR9565 instead of using the + * EEPROM/OTP data, remove the combining feature from + * the HW capabilities bitmap. + */ + if (sc->sc_pci_devinfo & (ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_AR9565_2ANT)) { + if (!(sc->sc_pci_devinfo & ATH9K_PCI_BT_ANT_DIV)) + pCap->hw_caps &= ~ATH9K_HW_CAP_ANT_DIV_COMB; + } + + if (sc->sc_pci_devinfo & ATH9K_PCI_BT_ANT_DIV) { + pCap->hw_caps |= ATH9K_HW_CAP_BT_ANT_DIV; + device_printf(sc->sc_dev, "Set BT/WLAN RX diversity capability\n"); + } +#endif + + if (sc->sc_pci_devinfo & ATH_PCI_D3_L1_WAR) { + ah_config->ath_hal_pcie_waen = 0x0040473b; + device_printf(sc->sc_dev, "Enable WAR for ASPM D3/L1\n"); + } + +#if 0 + if (sc->sc_pci_devinfo & ATH9K_PCI_NO_PLL_PWRSAVE) { + ah->config.no_pll_pwrsave = true; + device_printf(sc->sc_dev, "Disable PLL PowerSave\n"); + } +#endif + +} + #define HAL_MODE_HT20 (HAL_MODE_11NG_HT20 | HAL_MODE_11NA_HT20) #define HAL_MODE_HT40 \ (HAL_MODE_11NG_HT40PLUS | HAL_MODE_11NG_HT40MINUS | \ @@ -450,6 +525,7 @@ ath_attach(u_int16_t devid, struct ath_s u_int wmodes; uint8_t macaddr[IEEE80211_ADDR_LEN]; int rx_chainmask, tx_chainmask; + HAL_OPS_CONFIG ah_config; DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); @@ -468,8 +544,17 @@ ath_attach(u_int16_t devid, struct ath_s device_get_unit(sc->sc_dev)); CURVNET_RESTORE(); + /* + * Configure the initial configuration data. + * + * This is stuff that may be needed early during attach + * rather than done via configuration calls later. + */ + bzero(&ah_config, sizeof(ah_config)); + ath_setup_hal_config(sc, &ah_config); + ah = ath_hal_attach(devid, sc, sc->sc_st, sc->sc_sh, - sc->sc_eepromdata, &status); + sc->sc_eepromdata, &ah_config, &status); if (ah == NULL) { if_printf(ifp, "unable to attach hardware; HAL status %u\n", status); @@ -7101,6 +7186,6 @@ ath_node_recv_pspoll(struct ieee80211_no MODULE_VERSION(if_ath, 1); MODULE_DEPEND(if_ath, wlan, 1, 1, 1); /* 802.11 media layer */ -#if defined(IEEE80211_ALQ) || defined(AH_DEBUG_ALQ) +#if defined(IEEE80211_ALQ) || defined(AH_DEBUG_ALQ) || defined(ATH_DEBUG_ALQ) MODULE_DEPEND(if_ath, alq, 1, 1, 1); #endif Modified: head/sys/dev/ath/if_ath_lna_div.c ============================================================================== --- head/sys/dev/ath/if_ath_lna_div.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/if_ath_lna_div.c Tue Sep 30 03:19:29 2014 (r272292) @@ -209,6 +209,10 @@ bad: return (error); } +/* + * XXX need to low_rssi_thresh config from ath9k, to support CUS198 + * antenna diversity correctly. + */ static HAL_BOOL ath_is_alt_ant_ratio_better(int alt_ratio, int maxdelta, int mindelta, int main_rssi_avg, int alt_rssi_avg, int pkt_count) Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/if_ath_pci.c Tue Sep 30 03:19:29 2014 (r272292) @@ -80,6 +80,98 @@ struct ath_pci_softc { void *sc_ih; /* interrupt handler */ }; +/* + * XXX eventually this should be some system level definition + * so modules will hvae probe/attach information like USB. + * But for now.. + */ +struct pci_device_id { + int vendor_id; + int device_id; + + int sub_vendor_id; + int sub_device_id; + + int driver_data; + + int match_populated:1; + int match_vendor_id:1; + int match_device_id:1; + int match_sub_vendor_id:1; + int match_sub_device_id:1; +}; + +#define PCI_VDEVICE(v, s) \ + .vendor_id = (v), \ + .device_id = (s), \ + .match_populated = 1, \ + .match_vendor_id = 1, \ + .match_device_id = 1 + +#define PCI_DEVICE_SUB(v, d, dv, ds) \ + .match_populated = 1, \ + .vendor_id = (v), .match_vendor_id = 1, \ + .device_id = (d), .match_device_id = 1, \ + .sub_vendor_id = (dv), .match_sub_vendor_id = 1, \ + .sub_device_id = (ds), .match_sub_device_id = 1 + +#define PCI_VENDOR_ID_ATHEROS 0x168c +#define PCI_VENDOR_ID_SAMSUNG 0x144d +#define PCI_VENDOR_ID_AZWAVE 0x1a3b +#define PCI_VENDOR_ID_FOXCONN 0x105b +#define PCI_VENDOR_ID_ATTANSIC 0x1969 +#define PCI_VENDOR_ID_ASUSTEK 0x1043 +#define PCI_VENDOR_ID_DELL 0x1028 +#define PCI_VENDOR_ID_QMI 0x1a32 +#define PCI_VENDOR_ID_LENOVO 0x17aa +#define PCI_VENDOR_ID_HP 0x103c + +#include "if_ath_pci_devlist.h" + +/* + * Attempt to find a match for the given device in + * the given device table. + * + * Returns the device structure or NULL if no matching + * PCI device is found. + */ +static const struct pci_device_id * +ath_pci_probe_device(device_t dev, const struct pci_device_id *dev_table, int nentries) +{ + int i; + int vendor_id, device_id; + int sub_vendor_id, sub_device_id; + + vendor_id = pci_get_vendor(dev); + device_id = pci_get_device(dev); + sub_vendor_id = pci_get_subvendor(dev); + sub_device_id = pci_get_subdevice(dev); + + for (i = 0; i < nentries; i++) { + /* Don't match on non-populated (eg empty) entries */ + if (! dev_table[i].match_populated) + continue; + + if (dev_table[i].match_vendor_id && + (dev_table[i].vendor_id != vendor_id)) + continue; + if (dev_table[i].match_device_id && + (dev_table[i].device_id != device_id)) + continue; + if (dev_table[i].match_sub_vendor_id && + (dev_table[i].sub_vendor_id != sub_vendor_id)) + continue; + if (dev_table[i].match_sub_device_id && + (dev_table[i].sub_device_id != sub_device_id)) + continue; + + /* Match */ + return (&dev_table[i]); + } + + return (NULL); +} + #define BS_BAR 0x10 #define PCIR_RETRY_TIMEOUT 0x41 #define PCIR_CFG_PMCSR 0x48 @@ -150,9 +242,15 @@ ath_pci_attach(device_t dev) const struct firmware *fw = NULL; const char *buf; #endif + const struct pci_device_id *pd; sc->sc_dev = dev; + /* Do this lookup anyway; figure out what to do with it later */ + pd = ath_pci_probe_device(dev, ath_pci_id_table, nitems(ath_pci_id_table)); + if (pd) + sc->sc_pci_devinfo = pd->driver_data; + /* * Enable bus mastering. */ Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Sep 30 00:06:53 2014 (r272291) +++ head/sys/dev/ath/if_athvar.h Tue Sep 30 03:19:29 2014 (r272292) @@ -82,6 +82,25 @@ #define ATH_BEACON_CWMAX_DEFAULT 0 /* default cwmax for ap beacon q */ /* + * The following bits can be set during the PCI (and perhaps non-PCI + * later) device probe path. + * + * It controls some of the driver and HAL behaviour. + */ + +#define ATH_PCI_CUS198 0x0001 +#define ATH_PCI_CUS230 0x0002 +#define ATH_PCI_CUS217 0x0004 +#define ATH_PCI_CUS252 0x0008 +#define ATH_PCI_WOW 0x0010 +#define ATH_PCI_BT_ANT_DIV 0x0020 +#define ATH_PCI_D3_L1_WAR 0x0040 +#define ATH_PCI_AR9565_1ANT 0x0080 +#define ATH_PCI_AR9565_2ANT 0x0100 +#define ATH_PCI_NO_PLL_PWRSAVE 0x0200 +#define ATH_PCI_KILLER 0x0400 + +/* * The key cache is used for h/w cipher state and also for * tracking station state such as the current tx antenna. * We also setup a mapping table between key cache slot indices @@ -884,6 +903,9 @@ struct ath_softc { HAL_POWER_MODE sc_cur_powerstate; int sc_powersave_refcnt; + + /* ATH_PCI_* flags */ + uint32_t sc_pci_devinfo; }; #define ATH_LOCK_INIT(_sc) \ From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 03:29:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0E94793; Tue, 30 Sep 2014 03:29:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD281F43; Tue, 30 Sep 2014 03:29: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 s8U3Tk6p010077; Tue, 30 Sep 2014 03:29:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8U3TkaQ010076; Tue, 30 Sep 2014 03:29:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409300329.s8U3TkaQ010076@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 30 Sep 2014 03:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272293 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 30 Sep 2014 03:29:47 -0000 Author: adrian Date: Tue Sep 30 03:29:46 2014 New Revision: 272293 URL: http://svnweb.freebsd.org/changeset/base/272293 Log: Remove this stuff - it's no longer needed here. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Tue Sep 30 03:19:29 2014 (r272292) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Tue Sep 30 03:29:46 2014 (r272293) @@ -252,29 +252,6 @@ ar9300_attach_freebsd_ops(struct ath_hal /* LNA diversity functions */ ah->ah_divLnaConfGet = ar9300_ant_div_comb_get_config; ah->ah_divLnaConfSet = ar9300_ant_div_comb_set_config; - - /* Setup HAL configuration defaults */ - /* XXX cus198 defaults from ath9k */ - /* xlna_gpio = 9 */ - /* xatten_margin_cfg = true */ - /* alt_mingainidx = true */ - /* comm2g_switch_enable = 0x000bbb88 */ - /* ant_comb.low_rssi_thresh = 20 */ - /* ant_comb.fast_div_bias = 3 */ - -#if 0 - /* - * The HAL code treats this as a mask. - * The ath9k code above treats it as a bit offset. - * So it should be set to 0x200, not 0x9. - */ - ah->ah_config.ath_hal_ext_lna_ctl_gpio = 0x200; /* bit 9 */ - ah->ah_config.ath_hal_ext_atten_margin_cfg = AH_TRUE; - ah->ah_config.ath_hal_min_gainidx = AH_TRUE; - ah->ah_config.ath_hal_ant_ctrl_comm2g_switch_enable = 0x000bbb88; - /* XXX low_rssi_thresh */ - /* XXX fast_div_bias */ -#endif } HAL_BOOL From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 05:36:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0906BA05; Tue, 30 Sep 2014 05:36:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF80CCFC; Tue, 30 Sep 2014 05:36: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 s8U5aGZD069799; Tue, 30 Sep 2014 05:36:16 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8U5aG7U069798; Tue, 30 Sep 2014 05:36:16 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201409300536.s8U5aG7U069798@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Tue, 30 Sep 2014 05:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272294 - 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, 30 Sep 2014 05:36:17 -0000 Author: gavin Date: Tue Sep 30 05:36:16 2014 New Revision: 272294 URL: http://svnweb.freebsd.org/changeset/base/272294 Log: Make clear in the ipheth(4) hardware notes that this driver is for the tethering functionality only. Add a "bugs" section to give a pointer to usbconfig set_config if the device isn't automatically detected. MFC after: 3 days Modified: head/share/man/man4/ipheth.4 Modified: head/share/man/man4/ipheth.4 ============================================================================== --- head/share/man/man4/ipheth.4 Tue Sep 30 03:29:46 2014 (r272293) +++ head/share/man/man4/ipheth.4 Tue Sep 30 05:36:16 2014 (r272294) @@ -27,12 +27,12 @@ .\" .\" $FreeBSD$ .\" -.Dd September 25, 2014 +.Dd September 30, 2014 .Dt IPHETH 4 .Os .Sh NAME .Nm ipheth -.Nd "USB Apple iPhone/iPad Ethernet driver" +.Nd "USB Apple iPhone/iPad tethered Ethernet driver" .Sh SYNOPSIS To load the driver as a module at boot time, place the following line in @@ -61,6 +61,7 @@ In most cases this must be explicitly en .Pp For more information on configuring this device, see .Xr ifconfig 8 . +The device does not support different media types or options. .Sh HARDWARE The following devices are supported by the .Nm @@ -68,9 +69,9 @@ driver: .Pp .Bl -bullet -compact .It -Apple iPhone (all models) +Apple iPhone tethering (all models) .It -Apple iPad (all models) +Apple iPad tethering (all models) .El .Sh SEE ALSO .Xr arp 4 , @@ -80,6 +81,7 @@ Apple iPad (all models) .Xr urndis 4 , .Xr usb 4 , .Xr ifconfig 8 +.Xr usbconfig 8 .Sh HISTORY The .Nm @@ -91,3 +93,14 @@ The .Nm driver was written by .An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org . +.Sh BUGS +Some devices may need to be manually configured to use an alternative +configuration with the +.Xr usbconfig 8 +utility. +A command similar to +.Dl usbconfig -u 1 -a 2 set_config 3 +may be required if the device is not recognised automatically by +.Nm +after it is connected. + From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 05:50:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FB1DD80; Tue, 30 Sep 2014 05:50:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70B6EDF3; Tue, 30 Sep 2014 05:50: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 s8U5oZnv075369; Tue, 30 Sep 2014 05:50:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8U5oZXn075368; Tue, 30 Sep 2014 05:50:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409300550.s8U5oZXn075368@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 30 Sep 2014 05:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272295 - 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: Tue, 30 Sep 2014 05:50:35 -0000 Author: adrian Date: Tue Sep 30 05:50:34 2014 New Revision: 272295 URL: http://svnweb.freebsd.org/changeset/base/272295 Log: Add a missing file from the last commit. Noticed by: jhibbits Added: head/sys/dev/ath/if_ath_pci_devlist.h (contents, props changed) Added: head/sys/dev/ath/if_ath_pci_devlist.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_pci_devlist.h Tue Sep 30 05:50:34 2014 (r272295) @@ -0,0 +1,669 @@ +/*- + * Copyright (c) 2014 Qualcomm Atheros. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +static const struct pci_device_id ath_pci_id_table[] = { + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0023) }, /* PCI */ + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0024) }, /* PCI-E */ + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0027) }, /* PCI */ + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0029) }, /* PCI */ + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x002A) }, /* PCI-E */ + + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x002A, + PCI_VENDOR_ID_AZWAVE, + 0x1C71), + .driver_data = ATH_PCI_D3_L1_WAR }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x002A, + PCI_VENDOR_ID_FOXCONN, + 0xE01F), + .driver_data = ATH_PCI_D3_L1_WAR }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x002A, + 0x11AD, /* LITEON */ + 0x6632), + .driver_data = ATH_PCI_D3_L1_WAR }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x002A, + 0x11AD, /* LITEON */ + 0x6642), + .driver_data = ATH_PCI_D3_L1_WAR }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x002A, + PCI_VENDOR_ID_QMI, + 0x0306), + .driver_data = ATH_PCI_D3_L1_WAR }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x002A, + 0x185F, /* WNC */ + 0x309D), + .driver_data = ATH_PCI_D3_L1_WAR }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x002A, + 0x10CF, /* Fujitsu */ + 0x147C), + .driver_data = ATH_PCI_D3_L1_WAR }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x002A, + 0x10CF, /* Fujitsu */ + 0x147D), + .driver_data = ATH_PCI_D3_L1_WAR }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x002A, + 0x10CF, /* Fujitsu */ + 0x1536), + .driver_data = ATH_PCI_D3_L1_WAR }, + + /* AR9285 card for Asus */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x002B, + PCI_VENDOR_ID_AZWAVE, + 0x2C37), + .driver_data = ATH_PCI_BT_ANT_DIV }, + + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x002B) }, /* PCI-E */ + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */ + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x002D) }, /* PCI */ + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x002E) }, /* PCI-E */ + + /* Killer Wireless (3x3) */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0030, + 0x1A56, + 0x2000), + .driver_data = ATH_PCI_KILLER }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0030, + 0x1A56, + 0x2001), + .driver_data = ATH_PCI_KILLER }, + + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0030) }, /* PCI-E AR9300 */ + + /* PCI-E CUS198 */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_AZWAVE, + 0x2086), + .driver_data = ATH_PCI_CUS198 | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_AZWAVE, + 0x1237), + .driver_data = ATH_PCI_CUS198 | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_AZWAVE, + 0x2126), + .driver_data = ATH_PCI_CUS198 | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_AZWAVE, + 0x126A), + .driver_data = ATH_PCI_CUS198 | ATH_PCI_BT_ANT_DIV }, + + /* PCI-E CUS230 */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_AZWAVE, + 0x2152), + .driver_data = ATH_PCI_CUS230 | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_FOXCONN, + 0xE075), + .driver_data = ATH_PCI_CUS230 | ATH_PCI_BT_ANT_DIV }, + + /* WB225 */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_ATHEROS, + 0x3119), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_ATHEROS, + 0x3122), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + 0x185F, /* WNC */ + 0x3119), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + 0x185F, /* WNC */ + 0x3027), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_SAMSUNG, + 0x4105), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_SAMSUNG, + 0x4106), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_SAMSUNG, + 0x410D), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_SAMSUNG, + 0x410E), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_SAMSUNG, + 0x410F), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_SAMSUNG, + 0xC706), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_SAMSUNG, + 0xC680), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_SAMSUNG, + 0xC708), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_LENOVO, + 0x3218), + .driver_data = ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_LENOVO, + 0x3219), + .driver_data = ATH_PCI_BT_ANT_DIV }, + + /* AR9485 cards with PLL power-save disabled by default. */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_AZWAVE, + 0x2C97), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_AZWAVE, + 0x2100), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + 0x1C56, /* ASKEY */ + 0x4001), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + 0x11AD, /* LITEON */ + 0x6627), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + 0x11AD, /* LITEON */ + 0x6628), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_FOXCONN, + 0xE04E), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_FOXCONN, + 0xE04F), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + 0x144F, /* ASKEY */ + 0x7197), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + 0x1B9A, /* XAVI */ + 0x2000), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + 0x1B9A, /* XAVI */ + 0x2001), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_AZWAVE, + 0x1186), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_AZWAVE, + 0x1F86), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_AZWAVE, + 0x1195), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_AZWAVE, + 0x1F95), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + 0x1B9A, /* XAVI */ + 0x1C00), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + 0x1B9A, /* XAVI */ + 0x1C01), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0032, + PCI_VENDOR_ID_ASUSTEK, + 0x850D), + .driver_data = ATH_PCI_NO_PLL_PWRSAVE }, + + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0032) }, /* PCI-E AR9485 */ + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0033) }, /* PCI-E AR9580 */ + + /* PCI-E CUS217 */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + PCI_VENDOR_ID_AZWAVE, + 0x2116), + .driver_data = ATH_PCI_CUS217 }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + 0x11AD, /* LITEON */ + 0x6661), + .driver_data = ATH_PCI_CUS217 }, + + /* AR9462 with WoW support */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + PCI_VENDOR_ID_ATHEROS, + 0x3117), + .driver_data = ATH_PCI_WOW }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + PCI_VENDOR_ID_LENOVO, + 0x3214), + .driver_data = ATH_PCI_WOW }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + PCI_VENDOR_ID_ATTANSIC, + 0x0091), + .driver_data = ATH_PCI_WOW }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + PCI_VENDOR_ID_AZWAVE, + 0x2110), + .driver_data = ATH_PCI_WOW }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + PCI_VENDOR_ID_ASUSTEK, + 0x850E), + .driver_data = ATH_PCI_WOW }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + 0x11AD, /* LITEON */ + 0x6631), + .driver_data = ATH_PCI_WOW }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + 0x11AD, /* LITEON */ + 0x6641), + .driver_data = ATH_PCI_WOW }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + PCI_VENDOR_ID_HP, + 0x1864), + .driver_data = ATH_PCI_WOW }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + 0x14CD, /* USI */ + 0x0063), + .driver_data = ATH_PCI_WOW }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + 0x14CD, /* USI */ + 0x0064), + .driver_data = ATH_PCI_WOW }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0034, + 0x10CF, /* Fujitsu */ + 0x1783), + .driver_data = ATH_PCI_WOW }, + + /* Killer Wireless (2x2) */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0030, + 0x1A56, + 0x2003), + .driver_data = ATH_PCI_KILLER }, + + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0034) }, /* PCI-E AR9462 */ + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0037) }, /* PCI-E AR1111/AR9485 */ + + /* CUS252 */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_ATHEROS, + 0x3028), + .driver_data = ATH_PCI_CUS252 | + ATH_PCI_AR9565_2ANT | + ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_AZWAVE, + 0x2176), + .driver_data = ATH_PCI_CUS252 | + ATH_PCI_AR9565_2ANT | + ATH_PCI_BT_ANT_DIV }, + + /* WB335 1-ANT */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_FOXCONN, + 0xE068), + .driver_data = ATH_PCI_AR9565_1ANT }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x185F, /* WNC */ + 0xA119), + .driver_data = ATH_PCI_AR9565_1ANT }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x0632), + .driver_data = ATH_PCI_AR9565_1ANT }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x06B2), + .driver_data = ATH_PCI_AR9565_1ANT }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x0842), + .driver_data = ATH_PCI_AR9565_1ANT }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x6671), + .driver_data = ATH_PCI_AR9565_1ANT }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x1B9A, /* XAVI */ + 0x2811), + .driver_data = ATH_PCI_AR9565_1ANT }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x1B9A, /* XAVI */ + 0x2812), + .driver_data = ATH_PCI_AR9565_1ANT }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x1B9A, /* XAVI */ + 0x28A1), + .driver_data = ATH_PCI_AR9565_1ANT }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_AZWAVE, + 0x218A), + .driver_data = ATH_PCI_AR9565_1ANT }, + + /* WB335 1-ANT / Antenna Diversity */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_ATHEROS, + 0x3025), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_ATHEROS, + 0x3026), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_ATHEROS, + 0x302B), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_FOXCONN, + 0xE069), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x185F, /* WNC */ + 0x3028), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x0622), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x0672), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x0662), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x06A2), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x0682), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_AZWAVE, + 0x213A), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_HP, + 0x18E3), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_HP, + 0x217F), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_HP, + 0x2005), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_DELL, + 0x020C), + .driver_data = ATH_PCI_AR9565_1ANT | ATH_PCI_BT_ANT_DIV }, + + /* WB335 2-ANT / Antenna-Diversity */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_SAMSUNG, + 0x411A), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_SAMSUNG, + 0x411B), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_SAMSUNG, + 0x411C), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_SAMSUNG, + 0x411D), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_SAMSUNG, + 0x411E), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_ATHEROS, + 0x3027), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_ATHEROS, + 0x302C), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x0642), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x0652), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x0612), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x0832), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x11AD, /* LITEON */ + 0x0692), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_AZWAVE, + 0x2130), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_AZWAVE, + 0x213B), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_AZWAVE, + 0x2182), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x144F, /* ASKEY */ + 0x7202), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x1B9A, /* XAVI */ + 0x2810), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x1B9A, /* XAVI */ + 0x28A2), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x185F, /* WNC */ + 0x3027), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + 0x185F, /* WNC */ + 0xA120), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_FOXCONN, + 0xE07F), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_FOXCONN, + 0xE081), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_LENOVO, + 0x3026), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_LENOVO, + 0x4026), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_ASUSTEK, + 0x85F2), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, + 0x0036, + PCI_VENDOR_ID_DELL, + 0x020E), + .driver_data = ATH_PCI_AR9565_2ANT | ATH_PCI_BT_ANT_DIV }, + + /* PCI-E AR9565 (WB335) */ + { PCI_VDEVICE(PCI_VENDOR_ID_ATHEROS, 0x0036), + .driver_data = ATH_PCI_BT_ANT_DIV }, + + { 0 } +}; + From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 07:28:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE2E1397; Tue, 30 Sep 2014 07:28:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB632AC3; Tue, 30 Sep 2014 07:28: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 s8U7SVso020884; Tue, 30 Sep 2014 07:28:31 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8U7SVd8020883; Tue, 30 Sep 2014 07:28:31 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201409300728.s8U7SVd8020883@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 30 Sep 2014 07:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272296 - 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, 30 Sep 2014 07:28:32 -0000 Author: kevlo Date: Tue Sep 30 07:28:31 2014 New Revision: 272296 URL: http://svnweb.freebsd.org/changeset/base/272296 Log: When plen != ulen, it should only be checked when this is UDP. Spotted by: bryanv Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Tue Sep 30 05:50:34 2014 (r272295) +++ head/sys/netinet6/udp6_usrreq.c Tue Sep 30 07:28:31 2014 (r272296) @@ -232,7 +232,7 @@ udp6_input(struct mbuf **mp, int *offp, ulen = plen; cscov_partial = 0; } - if (plen != ulen) { + if (nxt == IPPROTO_UDP && plen != ulen) { UDPSTAT_INC(udps_badlen); goto badunlocked; } From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 09:41:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3A3C593; Tue, 30 Sep 2014 09:41:15 +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 20B28CDB; Tue, 30 Sep 2014 09:41:15 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 07BF9789B8D; Tue, 30 Sep 2014 17:18:45 +1000 (EST) Date: Tue, 30 Sep 2014 17:18:45 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin Subject: Re: svn commit: r272207 - in head/games: factor primes In-Reply-To: <5561525.GofWoxIbJB@ralph.baldwin.cx> Message-ID: <20140930161447.S1804@besplex.bde.org> References: <201409270900.s8R90dWl029070@svn.freebsd.org> <1576403.4iOOFWFkUs@ralph.baldwin.cx> <5426B4EC.9040102@freebsd.org> <5561525.GofWoxIbJB@ralph.baldwin.cx> 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=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=M6_0HiynEphOaEauVIcA:9 a=YkOdBkwIIxu9_-Dj:21 a=syUD13BPXRGfbw91:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival 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, 30 Sep 2014 09:41:16 -0000 On Mon, 29 Sep 2014, John Baldwin wrote: > On Saturday, September 27, 2014 06:00:28 AM Colin Percival wrote: >> On 09/27/14 05:52, John Baldwin wrote: >>> On Saturday, September 27, 2014 09:00:39 AM Colin Percival wrote: >>>> #define BIG ULONG_MAX /* largest value will sieve */ >>> >>> Should this be UINT64_MAX (or however that is spelled) instead of >>> ULONG_MAX >>> now? (or is it even still used? I know your change removed its use in at >>> least one place.) >> >> It's not used any more. I was resisting the urge to spend time going >> through and removing ancient history (which is why I kept ubig instead of >> changing it to uint64_t everywhere). > > It's kind of misleading though as the value is wrong and the comment for it no > longer applies. How about this: > > Index: primes.c > =================================================================== > --- primes.c (revision 272281) > +++ primes.c (working copy) > @@ -169,7 +169,7 @@ > > /* > * read_num_buf -- > - * This routine returns a number n, where 0 <= n && n <= BIG. > + * This routine returns a non-negative number n > */ Syntax error (lost punctuation). > static ubig > read_num_buf(void) The comment is almost completely useless now. It is fairly obvious that the function returns a non-negative number. It cannot return anything else, since its return type is an unsigned integer type. The main action of this function is not commented on. It reads a number from stdin. The '_buf' in the name of this function is garbage. The only buffers involved are a local buffer in the function and any buffer for stdin. These are implementation details. It looks like an old version did the reading from stdin and passed the buffer as an arg. 'n' in the description is unused now. > @@ -214,7 +214,7 @@ > /* > * A number of systems can not convert double values into unsigned > * longs when the values are larger than the largest signed value. > - * We don't have this problem, so we can go all the way to BIG. > + * We don't have this problem, so we can go all the way. > */ > if (start < 3) { > start = (ubig)2; All the way where? This comment, and the code, is much more broken than the above. First, it is machine-dependent. Some systems, including ones supported by FreeBSD but probably not ones supported by 4.4BSD when the comment was written, do have a problem. Second, the problem is with conversion in the opposite direction. When this comment was written, most systems has only 32-bit unsigned longs and it was just impossible to convert large 53-bit doubles values to them without producing garbage. (I think the behaviour is on overflow of such conversions is undefined. gcc at least used to produce very machine-dependent garbage.) However, this program only supports numbers up to ULONG_MAX. It converts these to doubles and adds a few, and needs these calculations to be exact. Since 53 is much larger than 32, they used to be exact. It never converts in the opposite direction. So the comment was sort of backwards. After fixing only the backwardness, the comment remains machine-dependent. It became false with 64-bit ulongs (since 64 > 53). However, the limit is now SIEVE_MAX (or something near the square of this?), not UBIG = UINT64_MAX. Provided SIEVE_MAX (squared?) fits in strictly less than 53 bits, the comment corrected to give the limit of SIEVE_MAX (squared?) becomes correct again, and also not machine-dependent, provided no one expands SIEVE_MAX. Here is some (all?) of the buggy code that uses doubles: very old version: % /* % * sieve for primes 17 and higher % */ % /* note highest useful factor and sieve spot */ % if (stop-start > TABSIZE+TABSIZE) { % tab_lim = &table[TABSIZE]; /* sieve it all */ % fact_lim = (int)sqrt( % (double)(start)+TABSIZE+TABSIZE+1.0); % } else { % tab_lim = &table[(stop-start)/2]; /* partial sieve */ % fact_lim = (int)sqrt((double)(stop)+1.0); % } This has excessive casts and other style bugs, but the casts to double make it clear where the doubles are. When 'start' is larger than 2**53, converting it to double loses precision and adding TABSIZE, etc., to it might have no effect. Thus the value of sqrt() might be wrong. Casting this value to signed int is unecessarily broken, but works in most cases where the double calculation isn't already broken (the int cast breaks at 2**31, but the sqrt() calculation breaks at 2**26.5). Similarly for 'stop', except only 1 is added so the addition is even more likely to have no effect. The previous version has the bogus casts removed and some line-splitting style bugs fixed. It still has the precision bugs and no spaces around binary operators: % /* % * sieve for primes 17 and higher % */ % /* note highest useful factor and sieve spot */ % if (stop-start > TABSIZE+TABSIZE) { % tab_lim = &table[TABSIZE]; /* sieve it all */ % fact_lim = sqrt(start+1.0+TABSIZE+TABSIZE); % } else { % tab_lim = &table[(stop-start)/2]; /* partial sieve */ % fact_lim = sqrt(stop+1.0); % } I don't have the latest version to quote. Perhaps it modified these sqrt() calculations. Using floating point is still the easiest way to determine the limit. To actually find the correct limit for 64-bit numbers, this could use sqrt() and then add a few for safety, or square the approximate square root and increase it by 1 at a time until it is large enough. > Index: primes.h > =================================================================== > --- primes.h (revision 272281) > +++ primes.h (working copy) > @@ -45,7 +45,6 @@ > > /* ubig is the type that holds a large unsigned value */ It would be more useful to say that it holds the largest supported unsigned value, not just 1 large value. > typedef uint64_t ubig; /* must be >=32 bit unsigned value */ This comment was last correct when no machine had 64-bit longs. Except it was nonsense then too (ubig is a type, not a value). The previous comment says the same thing more clearly and without any machine-dependent limites, unless there is some magic requiring the type being at least 32 bits even when "a large unsigned value" takes less than 32 bits. > -#define BIG ULONG_MAX /* largest value will sieve */ > > /* bytes in sieve table (must be > 3*5*7*11) */ > #define TABSIZE 256*1024 Bruce From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 09:45:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B97A27D2; Tue, 30 Sep 2014 09:45:51 +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 40022D1F; Tue, 30 Sep 2014 09:45:50 +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 s8U9jk0N073575 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 30 Sep 2014 13:45:46 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8U9jkD1073574; Tue, 30 Sep 2014 13:45:46 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 30 Sep 2014 13:45:46 +0400 From: Gleb Smirnoff To: Ryan Stone Subject: Re: svn commit: r272284 - head/usr.bin/systat Message-ID: <20140930094546.GA73266@FreeBSD.org> References: <201409291738.s8THcpxo038996@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409291738.s8THcpxo038996@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, 30 Sep 2014 09:45:51 -0000 On Mon, Sep 29, 2014 at 05:38:51PM +0000, Ryan Stone wrote: R> Author: rstone R> Date: Mon Sep 29 17:38:50 2014 R> New Revision: 272284 R> URL: http://svnweb.freebsd.org/changeset/base/272284 R> R> Log: R> Fix integer truncation in affecting systat -ifstat R> R> The "systat -ifstat" command was using a u_int to store byte counters. R> With a 10Gbps or faster interface, this overflows within the default R> 5 second refresh period. Switch to using a uint64_t across the board, R> which matches the size used for all counters as of r263102. R> R> PR: 182448 R> MFC after: 1 week R> Sponsored by: Sandvine Inc Thanks, Ryan. I'm always surprised finding people using systat(1) for anything instead of netstat, top, vmstat and the rest. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 11:51:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 593FB5E7; Tue, 30 Sep 2014 11:51:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C154CF6; Tue, 30 Sep 2014 11:51: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 s8UBpXXs043909; Tue, 30 Sep 2014 11:51:33 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UBpXYo043908; Tue, 30 Sep 2014 11:51:33 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409301151.s8UBpXYo043908@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 30 Sep 2014 11:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272297 - 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: Tue, 30 Sep 2014 11:51:33 -0000 Author: pjd Date: Tue Sep 30 11:51:32 2014 New Revision: 272297 URL: http://svnweb.freebsd.org/changeset/base/272297 Log: Style fixes. Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Tue Sep 30 07:28:31 2014 (r272296) +++ head/sys/geom/geom_dev.c Tue Sep 30 11:51:32 2014 (r272297) @@ -281,7 +281,7 @@ g_dev_open(struct cdev *dev, int flags, cp = dev->si_drv2; if (cp == NULL) - return(ENXIO); /* g_dev_taste() not done yet */ + return (ENXIO); /* g_dev_taste() not done yet */ g_trace(G_T_ACCESS, "g_dev_open(%s, %d, %d, %p)", cp->geom->name, flags, fmt, td); @@ -312,7 +312,7 @@ g_dev_open(struct cdev *dev, int flags, sc->sc_open += r + w + e; mtx_unlock(&sc->sc_mtx); } - return(error); + return (error); } static int @@ -324,10 +324,10 @@ g_dev_close(struct cdev *dev, int flags, cp = dev->si_drv2; if (cp == NULL) - return(ENXIO); + return (ENXIO); g_trace(G_T_ACCESS, "g_dev_close(%s, %d, %d, %p)", cp->geom->name, flags, fmt, td); - + r = flags & FREAD ? -1 : 0; w = flags & FWRITE ? -1 : 0; #ifdef notyet @@ -361,7 +361,6 @@ g_dev_ioctl(struct cdev *dev, u_long cmd struct g_kerneldump kd; off_t offset, length, chunk; int i, error; - u_int u; cp = dev->si_drv2; pp = cp->provider; @@ -396,8 +395,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd error = g_io_getattr("GEOM::frontstuff", cp, &i, data); break; case DIOCSKERNELDUMP: - u = *((u_int *)data); - if (!u) { + if (*(u_int *)data != 0) { set_dumper(NULL, NULL); error = 0; break; @@ -406,9 +404,9 @@ g_dev_ioctl(struct cdev *dev, u_long cmd kd.length = OFF_MAX; i = sizeof kd; error = g_io_getattr("GEOM::kerneldump", cp, &i, &kd); - if (!error) { + if (error == 0) { error = set_dumper(&kd.di, devtoname(dev)); - if (!error) + if (error == 0) dev->si_flags |= SI_DUMPDEV; } break; @@ -425,7 +423,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd error = EINVAL; break; } - while (length > 0) { + while (length > 0) { chunk = length; if (g_dev_del_max_sectors != 0 && chunk > g_dev_del_max_sectors * cp->provider->sectorsize) { From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 12:00:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BDBBAAA; Tue, 30 Sep 2014 12:00:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 289C1EA7; Tue, 30 Sep 2014 12:00: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 s8UC0pss047145; Tue, 30 Sep 2014 12:00:51 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UC0p7Q047144; Tue, 30 Sep 2014 12:00:51 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409301200.s8UC0p7Q047144@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 30 Sep 2014 12:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272298 - 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: Tue, 30 Sep 2014 12:00:51 -0000 Author: pjd Date: Tue Sep 30 12:00:50 2014 New Revision: 272298 URL: http://svnweb.freebsd.org/changeset/base/272298 Log: Be prepared that set_dumper() might fail even when resetting it or prefix the call with (void) to document that we intentionally ignore the return value - no way to handle an error in case of device disappearing. Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Tue Sep 30 11:51:32 2014 (r272297) +++ head/sys/geom/geom_dev.c Tue Sep 30 12:00:50 2014 (r272298) @@ -396,8 +396,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd break; case DIOCSKERNELDUMP: if (*(u_int *)data != 0) { - set_dumper(NULL, NULL); - error = 0; + error = set_dumper(NULL, NULL); break; } kd.offset = 0; @@ -616,7 +615,7 @@ g_dev_orphan(struct g_consumer *cp) /* Reset any dump-area set on this device */ if (dev->si_flags & SI_DUMPDEV) - set_dumper(NULL, NULL); + (void)set_dumper(NULL, NULL); /* Destroy the struct cdev *so we get no more requests */ destroy_dev_sched_cb(dev, g_dev_callback, cp); From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 13:15:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BA7860E; Tue, 30 Sep 2014 13:15:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC1A29B0; Tue, 30 Sep 2014 13: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 s8UDFJ6S085507; Tue, 30 Sep 2014 13:15:19 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UDFJrQ085506; Tue, 30 Sep 2014 13:15:19 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201409301315.s8UDFJrQ085506@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 30 Sep 2014 13:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272299 - 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, 30 Sep 2014 13:15:20 -0000 Author: ae Date: Tue Sep 30 13:15:19 2014 New Revision: 272299 URL: http://svnweb.freebsd.org/changeset/base/272299 Log: Remove redundant call to ipsec_getpolicybyaddr(). ipsec_hdrsiz() will call it internally. Sponsored by: Yandex LLC Modified: head/sys/netinet6/ip6_forward.c Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Tue Sep 30 12:00:50 2014 (r272298) +++ head/sys/netinet6/ip6_forward.c Tue Sep 30 13:15:19 2014 (r272299) @@ -422,8 +422,6 @@ again2: if (mcopy) { u_long mtu; #ifdef IPSEC - struct secpolicy *sp; - int ipsecerror; size_t ipsechdrsiz; #endif /* IPSEC */ @@ -436,15 +434,10 @@ again2: * case, as we have the outgoing interface for * encapsulated packet as "rt->rt_ifp". */ - sp = ipsec_getpolicybyaddr(mcopy, IPSEC_DIR_OUTBOUND, - IP_FORWARDING, &ipsecerror); - if (sp) { - ipsechdrsiz = ipsec_hdrsiz(mcopy, - IPSEC_DIR_OUTBOUND, NULL); - if (ipsechdrsiz < mtu) - mtu -= ipsechdrsiz; - } - + ipsechdrsiz = ipsec_hdrsiz(mcopy, IPSEC_DIR_OUTBOUND, + NULL); + if (ipsechdrsiz < mtu) + mtu -= ipsechdrsiz; /* * if mtu becomes less than minimum MTU, * tell minimum MTU (and I'll need to fragment it). From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 13:32:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1707C53; Tue, 30 Sep 2014 13:32:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D88AC09; Tue, 30 Sep 2014 13:32: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 s8UDWk0H095221; Tue, 30 Sep 2014 13:32:46 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UDWkjD095220; Tue, 30 Sep 2014 13:32:46 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201409301332.s8UDWkjD095220@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 30 Sep 2014 13:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272300 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 13:32:46 -0000 Author: andrew Date: Tue Sep 30 13:32:45 2014 New Revision: 272300 URL: http://svnweb.freebsd.org/changeset/base/272300 Log: Make sure __ARM_ARCH is defined in sysreg.h by including acle-compat.h Modified: head/sys/arm/include/sysreg.h Modified: head/sys/arm/include/sysreg.h ============================================================================== --- head/sys/arm/include/sysreg.h Tue Sep 30 13:15:19 2014 (r272299) +++ head/sys/arm/include/sysreg.h Tue Sep 30 13:32:45 2014 (r272300) @@ -34,6 +34,8 @@ #ifndef MACHINE_SYSREG_H #define MACHINE_SYSREG_H +#include + /* * CP15 C0 registers */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 13:45:21 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3597425E; Tue, 30 Sep 2014 13:45:21 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 17DBFD3B; Tue, 30 Sep 2014 13:45:21 +0000 (UTC) Received: from bender.lan (97e07ab1.skybroadband.com [151.224.122.177]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id B16555CF66; Tue, 30 Sep 2014 13:38:07 +0000 (UTC) Date: Tue, 30 Sep 2014 14:37:58 +0100 From: Andrew Turner To: Andreas Tobler Subject: Re: svn commit: r272209 - in head/sys/arm: arm include Message-ID: <20140930143758.27d26ab9@bender.lan> In-Reply-To: <5429A58E.2030508@FreeBSD.org> References: <201409270957.s8R9vYrw056987@svn.freebsd.org> <5429A58E.2030508@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Andrew Turner , svn-src-head@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, 30 Sep 2014 13:45:21 -0000 On Mon, 29 Sep 2014 20:31:42 +0200 Andreas Tobler wrote: > Hi Andrew, > > On 27.09.14 11:57, Andrew Turner wrote: > > Author: andrew > > Date: Sat Sep 27 09:57:34 2014 > > New Revision: 272209 > > URL: http://svnweb.freebsd.org/changeset/base/272209 > > > > Log: > > Add machine/sysreg.h to simplify accessing the system control > > coprocessor registers and use it in the ARMv7 CPU functions. > > > > The sysreg.h file has been checked by hand, however it may > > contain errors with the comments on when a register was first > > introduced. The ARMv7 cpu functions have been checked by compiling > > both the previous and this version and comparing the md5 of the > > object files. > > > > Submitted by: Svatopluk Kraus > > Submitted by: Michal Meloun > > Reviewed by: ian, rpaulo > > Differential Revision: https://reviews.freebsd.org/D795 > > > > Added: > > head/sys/arm/include/sysreg.h (contents, props changed) > > This one breaks kernel build with gcc-4.2.1. > > __ARM_ARCH not defined. On gcc-4.2.1 there is no __ARM_ARCH builtin. > Later gcc do have it. > > The include below fixes the build. Fixed in r272300. Andrew From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 15:27:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4949F9BA; Tue, 30 Sep 2014 15:27:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A682C24; Tue, 30 Sep 2014 15:27: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 s8UFRort054124; Tue, 30 Sep 2014 15:27:50 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UFRnRY054122; Tue, 30 Sep 2014 15:27:49 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201409301527.s8UFRnRY054122@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Tue, 30 Sep 2014 15:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272305 - head/bin/pkill/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 15:27:50 -0000 Author: rodrigc Date: Tue Sep 30 15:27:49 2014 New Revision: 272305 URL: http://svnweb.freebsd.org/changeset/base/272305 Log: Fix pkill unit tests. - use daemon(8) to write out a pid file for processes, and check for for the existence of that file after killing processes - use explict named parameters to jail(8) Modified: head/bin/pkill/tests/pgrep-j_test.sh head/bin/pkill/tests/pkill-j_test.sh Modified: head/bin/pkill/tests/pgrep-j_test.sh ============================================================================== --- head/bin/pkill/tests/pgrep-j_test.sh Tue Sep 30 15:10:40 2014 (r272304) +++ head/bin/pkill/tests/pgrep-j_test.sh Tue Sep 30 15:27:49 2014 (r272305) @@ -1,7 +1,23 @@ #!/bin/sh # $FreeBSD$ -base=`basename $0` +jail_name_to_jid() +{ + local check_name="$1" + ( + line="$(jls -n 2> /dev/null | grep name=$check_name )" + for nv in $line; do + local name="${nv%=*}" + if [ "${name}" = "jid" ]; then + eval $nv + echo $jid + break + fi + done + ) +} + +base=pgrep_j_test echo "1..3" @@ -9,21 +25,25 @@ name="pgrep -j " if [ `id -u` -eq 0 ]; then sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep - jail / $base-1 127.0.0.1 $sleep 5 & - chpid=$! - jail / $base-2 127.0.0.1 $sleep 5 & - chpid2=$! - $sleep 5 & - chpid3=$! - sleep 0.5 - jid=`jls | awk "/127\\.0\\.0\\.1.*${base}-1/ {print \$1}"` - pid=`pgrep -f -j $jid $sleep` - if [ "$pid" = "$chpid" ]; then + jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_1_1.pid $sleep 5 & + + jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_1_2.pid $sleep 5 & + + jid1=$(jail_name_to_jid ${base}_1_1) + jid2=$(jail_name_to_jid ${base}_1_2) + jid="${jid1},${jid2}" + pid1="$(pgrep -f -x -j $jid "$sleep 5" | sort)" + pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_1_1.pid)" \ + $(cat ${PWD}/${base}_1_2.pid) | sort) + if [ "$pid1" = "$pid2" ]; then echo "ok 1 - $name" else echo "not ok 1 - $name" fi - kill $chpid $chpid2 $chpid3 + [ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid) + [ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) rm -f $sleep else echo "ok 1 - $name # skip Test needs uid 0." @@ -33,21 +53,23 @@ name="pgrep -j any" if [ `id -u` -eq 0 ]; then sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep - jail / $base-1 127.0.0.1 $sleep 5 & - chpid=$! - jail / $base-2 127.0.0.1 $sleep 5 & - chpid2=$! - $sleep 5 & - chpid3=$! - sleep 0.5 - pids=`pgrep -f -j any $sleep | sort` - refpids=`{ echo $chpid; echo $chpid2; } | sort` - if [ "$pids" = "$refpids" ]; then + jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_2_1.pid $sleep 5 & + + jail -c path=/ name=${base}_2_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_2_2.pid $sleep 5 & + + sleep 2 + pid1="$(pgrep -f -x -j any "$sleep 5" | sort)" + pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_2_1.pid)" \ + $(cat ${PWD}/${base}_2_2.pid) | sort) + if [ "$pid1" = "$pid2" ]; then echo "ok 2 - $name" else echo "not ok 2 - $name" fi - kill $chpid $chpid2 $chpid3 + [ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid) + [ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid) rm -f $sleep else echo "ok 2 - $name # skip Test needs uid 0." @@ -57,19 +79,19 @@ name="pgrep -j none" if [ `id -u` -eq 0 ]; then sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep - $sleep 5 & - chpid=$! - jail / $base 127.0.0.1 $sleep 5 & - chpid2=$! - sleep 0.5 - pid=`pgrep -f -j none $sleep` - if [ "$pid" = "$chpid" ]; then + daemon -p ${PWD}/${base}_3_1.pid $sleep 5 & + jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_3_2.pid $sleep 5 & + sleep 2 + pid="$(pgrep -f -x -j none "$sleep 5")" + if [ "$pid" = "$(cat ${PWD}/${base}_3_1.pid)" ]; then echo "ok 3 - $name" else echo "not ok 3 - $name" fi - kill $chpid $chpid2 rm -f $sleep + [ -f ${PWD}/${base}_3_1.pid ] && kill $(cat $PWD/${base}_3_1.pid) + [ -f ${PWD}/${base}_3_2.pid ] && kill $(cat $PWD/${base}_3_2.pid) else echo "ok 3 - $name # skip Test needs uid 0." fi Modified: head/bin/pkill/tests/pkill-j_test.sh ============================================================================== --- head/bin/pkill/tests/pkill-j_test.sh Tue Sep 30 15:10:40 2014 (r272304) +++ head/bin/pkill/tests/pkill-j_test.sh Tue Sep 30 15:27:49 2014 (r272305) @@ -1,7 +1,23 @@ #!/bin/sh # $FreeBSD$ -base=`basename $0` +jail_name_to_jid() +{ + local check_name="$1" + ( + line="$(jls -n 2> /dev/null | grep name=$check_name )" + for nv in $line; do + local name="${nv%=*}" + if [ "${name}" = "jid" ]; then + eval $nv + echo $jid + break + fi + done + ) +} + +base=pkill_j_test echo "1..3" @@ -9,21 +25,28 @@ name="pkill -j " if [ `id -u` -eq 0 ]; then sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep - jail / $base-1 127.0.0.1 $sleep 5 & - chpid=$! - jail / $base-2 127.0.0.1 $sleep 5 & - chpid2=$! + jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_1_1.pid $sleep 5 & + + jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_1_2.pid $sleep 5 & + $sleep 5 & - chpid3=$! sleep 0.5 - jid=`jls | awk "/127\\.0\\.0\\.1.*${base}-1/ {print \$1}"` - if pkill -f -j $jid $sleep && sleep 0.5 && - ! kill $chpid && kill $chpid2 $chpid3; then + jid1=$(jail_name_to_jid ${base}_1_1) + jid2=$(jail_name_to_jid ${base}_1_2) + jid="${jid1},${jid2}" + if pkill -f -j "$jid" $sleep && sleep 0.5 && + ! -f ${PWD}/${base}_1_1.pid && + ! -f ${PWD}/${base}_1_2.pid ; then echo "ok 1 - $name" else echo "not ok 1 - $name" fi 2>/dev/null rm -f $sleep + [ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid) + [ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) + wait else echo "ok 1 - $name # skip Test needs uid 0." fi @@ -32,20 +55,26 @@ name="pkill -j any" if [ `id -u` -eq 0 ]; then sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep - jail / $base-1 127.0.0.1 $sleep 5 & - chpid=$! - jail / $base-2 127.0.0.1 $sleep 5 & - chpid2=$! + jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_2_1.pid $sleep 5 & + + jail -c path=/ name=${base}_2_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_2_2.pid $sleep 5 & + $sleep 5 & - chpid3=$! sleep 0.5 + chpid3=$! if pkill -f -j any $sleep && sleep 0.5 && - ! kill $chpid && ! kill $chpid2 && kill $chpid3; then + [ ! -f ${PWD}/${base}_2_1.pid -a + ! -f ${PWD}/${base}_2_2.pid ] && kill $chpid3; then echo "ok 2 - $name" else echo "not ok 2 - $name" fi 2>/dev/null rm -f $sleep + [ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid) + [ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid) + wait else echo "ok 2 - $name # skip Test needs uid 0." fi @@ -54,18 +83,20 @@ name="pkill -j none" if [ `id -u` -eq 0 ]; then sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep - $sleep 5 & - chpid=$! - jail / $base 127.0.0.1 $sleep 5 & - chpid2=$! - sleep 0.5 - if pkill -f -j none $sleep && sleep 0.5 && - ! kill $chpid && kill $chpid2; then + daemon -p ${PWD}/${base}_3_1.pid $sleep 5 + jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_3_2.pid $sleep 5 & + sleep 1 + if pkill -f -j none "$sleep 5" && sleep 1 && + [ ! -f ${PWD}/${base}_3_1.pid -a -f ${PWD}/${base}_3_2.pid ] ; then echo "ok 3 - $name" else + ls ${PWD}/*.pid echo "not ok 3 - $name" fi 2>/dev/null rm -f $sleep + [ -f ${PWD}/${base}_3_1.pid ] && kill $(cat ${base}_3_1.pid) + [ -f ${PWD}/${base}_3_2.pid ] && kill $(cat ${base}_3_2.pid) else echo "ok 3 - $name # skip Test needs uid 0." fi From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 16:17:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A835DB70; Tue, 30 Sep 2014 16:17: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 7AF7520C; Tue, 30 Sep 2014 16:17: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 s8UGHDTW078247; Tue, 30 Sep 2014 16:17:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UGHDxK078246; Tue, 30 Sep 2014 16:17:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409301617.s8UGHDxK078246@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 30 Sep 2014 16:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272308 - head/sys/dev/iscsi_initiator X-SVN-Group: head MIME-Version: 1.0 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, 30 Sep 2014 16:17:13 -0000 Author: mav Date: Tue Sep 30 16:17:12 2014 New Revision: 272308 URL: http://svnweb.freebsd.org/changeset/base/272308 Log: Fix old iSCSI initiator to work with new CAM locking. This switches code to using xpt_scan() routine, irrelevant to locking. Using xpt_action() directly requires knowledge about higher level locks, that SIM does not need to have. This code is obsoleted, but that is not a reason to crash. MFC after: 3 days Modified: head/sys/dev/iscsi_initiator/isc_cam.c Modified: head/sys/dev/iscsi_initiator/isc_cam.c ============================================================================== --- head/sys/dev/iscsi_initiator/isc_cam.c Tue Sep 30 16:14:02 2014 (r272307) +++ head/sys/dev/iscsi_initiator/isc_cam.c Tue Sep 30 16:17:12 2014 (r272308) @@ -125,7 +125,7 @@ scan_callback(struct cam_periph *periph, debug_called(8); - free(ccb, M_TEMP); + xpt_free_ccb(ccb); if(sp->flags & ISC_SCANWAIT) { sp->flags &= ~ISC_SCANWAIT; @@ -141,30 +141,15 @@ ic_scan(isc_session_t *sp) debug_called(8); sdebug(2, "scanning sid=%d", sp->sid); - if((ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK | M_ZERO)) == NULL) { - xdebug("scan failed (can't allocate CCB)"); - return ENOMEM; // XXX - } - sp->flags &= ~ISC_CAMDEVS; sp->flags |= ISC_SCANWAIT; - CAM_LOCK(sp); - if(xpt_create_path(&sp->cam_path, NULL, cam_sim_path(sp->cam_sim), - 0, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - xdebug("can't create cam path"); - CAM_UNLOCK(sp); - free(ccb, M_TEMP); - return ENODEV; // XXX - } - xpt_setup_ccb(&ccb->ccb_h, sp->cam_path, 5/*priority (low)*/); - ccb->ccb_h.func_code = XPT_SCAN_BUS; + ccb = xpt_alloc_ccb(); + ccb->ccb_h.path = sp->cam_path; ccb->ccb_h.cbfcnp = scan_callback; - ccb->crcn.flags = CAM_FLAG_NONE; ccb->ccb_h.spriv_ptr0 = sp; - xpt_action(ccb); - CAM_UNLOCK(sp); + xpt_rescan(ccb); while(sp->flags & ISC_SCANWAIT) tsleep(sp, PRIBIO, "ffp", 5*hz); // the timeout time should @@ -374,6 +359,16 @@ ic_init(isc_session_t *sp) return ENXIO; } sp->cam_sim = sim; + if(xpt_create_path(&sp->cam_path, NULL, cam_sim_path(sp->cam_sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + xpt_bus_deregister(cam_sim_path(sp->cam_sim)); + cam_sim_free(sim, /*free_devq*/TRUE); + CAM_UNLOCK(sp); +#if __FreeBSD_version >= 700000 + mtx_destroy(&sp->cam_mtx); +#endif + return ENXIO; + } CAM_UNLOCK(sp); sdebug(1, "cam subsystem initialized"); From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 16:46:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F0B4957; Tue, 30 Sep 2014 16:46: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 18A36819; Tue, 30 Sep 2014 16:46: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 s8UGkoVF092624; Tue, 30 Sep 2014 16:46:50 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UGkkNZ092605; Tue, 30 Sep 2014 16:46:46 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409301646.s8UGkkNZ092605@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 30 Sep 2014 16:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272310 - in head/sys: amd64/amd64 conf dev/acpica i386/i386 x86/include x86/x86 x86/xen xen xen/interface X-SVN-Group: head MIME-Version: 1.0 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, 30 Sep 2014 16:46:50 -0000 Author: royger Date: Tue Sep 30 16:46:45 2014 New Revision: 272310 URL: http://svnweb.freebsd.org/changeset/base/272310 Log: msi: add Xen MSI implementation This patch adds support for MSI interrupts when running on Xen. Apart from adding the Xen related code needed in order to register MSI interrupts this patch also makes the msi_init function a hook in init_ops, so different MSI implementations can have different initialization functions. Sponsored by: Citrix Systems R&D xen/interface/physdev.h: - Add the MAP_PIRQ_TYPE_MULTI_MSI to map multi-vector MSI to the Xen public interface. x86/include/init.h: - Add a hook for setting custom msi_init methods. amd64/amd64/machdep.c: i386/i386/machdep.c: - Set the default msi_init hook to point to the native MSI initialization method. x86/xen/pv.c: - Set the Xen MSI init hook when running as a Xen guest. x86/x86/local_apic.c: - Call the msi_init hook instead of directly calling msi_init. xen/xen_intr.h: x86/xen/xen_intr.c: - Introduce support for registering/releasing MSI interrupts with Xen. - The MSI interrupts will use the same PIC as the IO APIC interrupts. xen/xen_msi.h: x86/xen/xen_msi.c: - Introduce a Xen MSI implementation. x86/xen/xen_nexus.c: - Overwrite the default MSI hooks in the Xen Nexus to use the Xen MSI implementation. x86/xen/xen_pci.c: - Introduce a Xen specific PCI bus that inherits from the ACPI PCI bus and overwrites the native MSI methods. - This is needed because when running under Xen the MSI messages used to configure MSI interrupts on PCI devices are written by Xen itself. dev/acpica/acpi_pci.c: - Lower the quality of the ACPI PCI bus so the newly introduced Xen PCI bus can take over when needed. conf/files.i386: conf/files.amd64: - Add the newly created files to the build process. Added: head/sys/x86/xen/xen_msi.c (contents, props changed) head/sys/x86/xen/xen_pci.c (contents, props changed) head/sys/xen/xen_msi.h (contents, props changed) Modified: head/sys/amd64/amd64/machdep.c head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/acpica/acpi_pci.c head/sys/i386/i386/machdep.c head/sys/x86/include/init.h head/sys/x86/x86/local_apic.c head/sys/x86/xen/pv.c head/sys/x86/xen/xen_intr.c head/sys/x86/xen/xen_nexus.c head/sys/xen/interface/physdev.h head/sys/xen/xen_intr.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Sep 30 16:36:50 2014 (r272309) +++ head/sys/amd64/amd64/machdep.c Tue Sep 30 16:46:45 2014 (r272310) @@ -177,6 +177,7 @@ struct init_ops init_ops = { .mp_bootaddress = mp_bootaddress, .start_all_aps = native_start_all_aps, #endif + .msi_init = msi_init, }; /* Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Sep 30 16:36:50 2014 (r272309) +++ head/sys/conf/files.amd64 Tue Sep 30 16:46:45 2014 (r272310) @@ -582,3 +582,5 @@ x86/xen/pvcpu_enum.c optional xenhvm x86/xen/xen_apic.c optional xenhvm x86/xen/xenpv.c optional xenhvm x86/xen/xen_nexus.c optional xenhvm +x86/xen/xen_msi.c optional xenhvm +x86/xen/xen_pci.c optional xenhvm Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Sep 30 16:36:50 2014 (r272309) +++ head/sys/conf/files.i386 Tue Sep 30 16:46:45 2014 (r272310) @@ -599,3 +599,4 @@ x86/xen/xen_intr.c optional xen | xenhv x86/xen/xen_apic.c optional xenhvm x86/xen/xenpv.c optional xen | xenhvm x86/xen/xen_nexus.c optional xen | xenhvm +x86/xen/xen_msi.c optional xen | xenhvm Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Tue Sep 30 16:36:50 2014 (r272309) +++ head/sys/dev/acpica/acpi_pci.c Tue Sep 30 16:46:45 2014 (r272310) @@ -282,7 +282,7 @@ acpi_pci_probe(device_t dev) if (acpi_get_handle(dev) == NULL) return (ENXIO); device_set_desc(dev, "ACPI PCI bus"); - return (0); + return (BUS_PROBE_DEFAULT); } static int Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Sep 30 16:36:50 2014 (r272309) +++ head/sys/i386/i386/machdep.c Tue Sep 30 16:46:45 2014 (r272310) @@ -248,6 +248,9 @@ struct mem_range_softc mem_range_softc; struct init_ops init_ops = { .early_clock_source_init = i8254_init, .early_delay = i8254_delay, +#ifdef DEV_APIC + .msi_init = msi_init, +#endif }; static void Modified: head/sys/x86/include/init.h ============================================================================== --- head/sys/x86/include/init.h Tue Sep 30 16:36:50 2014 (r272309) +++ head/sys/x86/include/init.h Tue Sep 30 16:46:45 2014 (r272310) @@ -41,6 +41,7 @@ struct init_ops { void (*parse_memmap)(caddr_t, vm_paddr_t *, int *); u_int (*mp_bootaddress)(u_int); int (*start_all_aps)(void); + void (*msi_init)(void); }; extern struct init_ops init_ops; Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Tue Sep 30 16:36:50 2014 (r272309) +++ head/sys/x86/x86/local_apic.c Tue Sep 30 16:46:45 2014 (r272310) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef DDB #include @@ -1438,7 +1439,7 @@ apic_setup_io(void *dummy __unused) lapic_dump("BSP"); /* Enable the MSI "pic". */ - msi_init(); + init_ops.msi_init(); } SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_THIRD, apic_setup_io, NULL); Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Tue Sep 30 16:36:50 2014 (r272309) +++ head/sys/x86/xen/pv.c Tue Sep 30 16:46:45 2014 (r272310) @@ -60,11 +60,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include @@ -117,6 +119,7 @@ struct init_ops xen_init_ops = { #ifdef SMP .start_all_aps = xen_pv_start_all_aps, #endif + .msi_init = xen_msi_init, }; static struct bios_smap xen_smap[MAX_E820_ENTRIES]; Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Tue Sep 30 16:36:50 2014 (r272309) +++ head/sys/x86/xen/xen_intr.c Tue Sep 30 16:46:45 2014 (r272310) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -63,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef DDB #include @@ -1373,6 +1375,64 @@ xen_register_pirq(int vector, enum intr_ } int +xen_register_msi(device_t dev, int vector, int count) +{ + struct physdev_map_pirq msi_irq; + struct xenisrc *isrc; + int ret; + + memset(&msi_irq, 0, sizeof(msi_irq)); + msi_irq.domid = DOMID_SELF; + msi_irq.type = count == 1 ? + MAP_PIRQ_TYPE_MSI_SEG : MAP_PIRQ_TYPE_MULTI_MSI; + msi_irq.index = -1; + msi_irq.pirq = -1; + msi_irq.bus = pci_get_bus(dev) | (pci_get_domain(dev) << 16); + msi_irq.devfn = (pci_get_slot(dev) << 3) | pci_get_function(dev); + msi_irq.entry_nr = count; + + ret = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &msi_irq); + if (ret != 0) + return (ret); + if (count != msi_irq.entry_nr) { + panic("unable to setup all requested MSI vectors " + "(expected %d got %d)", count, msi_irq.entry_nr); + } + + mtx_lock(&xen_intr_isrc_lock); + for (int i = 0; i < count; i++) { + isrc = xen_intr_alloc_isrc(EVTCHN_TYPE_PIRQ, vector + i); + KASSERT(isrc != NULL, + ("xen: unable to allocate isrc for interrupt")); + isrc->xi_pirq = msi_irq.pirq + i; + } + mtx_unlock(&xen_intr_isrc_lock); + + return (0); +} + +int +xen_release_msi(int vector) +{ + struct physdev_unmap_pirq unmap; + struct xenisrc *isrc; + int ret; + + isrc = (struct xenisrc *)intr_lookup_source(vector); + if (isrc == NULL) + return (ENXIO); + + unmap.pirq = isrc->xi_pirq; + ret = HYPERVISOR_physdev_op(PHYSDEVOP_unmap_pirq, &unmap); + if (ret != 0) + return (ret); + + xen_intr_release_isrc(isrc); + + return (0); +} + +int xen_intr_describe(xen_intr_handle_t port_handle, const char *fmt, ...) { char descr[MAXCOMLEN + 1]; Added: head/sys/x86/xen/xen_msi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/xen/xen_msi.c Tue Sep 30 16:46:45 2014 (r272310) @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2014 Roger Pau Monné + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +static struct mtx msi_lock; +static int msi_last_irq; + +void +xen_msi_init(void) +{ + + mtx_init(&msi_lock, "msi", NULL, MTX_DEF); +} + +/* + * Try to allocate 'count' interrupt sources with contiguous IDT values. + */ +int +xen_msi_alloc(device_t dev, int count, int maxcount, int *irqs) +{ + int i, ret = 0; + + mtx_lock(&msi_lock); + + /* If we would exceed the max, give up. */ + if ((msi_last_irq + count) > NUM_MSI_INTS) { + mtx_unlock(&msi_lock); + return (ENXIO); + } + + /* Allocate MSI vectors */ + for (i = 0; i < count; i++) + irqs[i] = FIRST_MSI_INT + msi_last_irq++; + + mtx_unlock(&msi_lock); + + ret = xen_register_msi(dev, irqs[0], count); + if (ret != 0) + return (ret); + + for (i = 0; i < count; i++) + nexus_add_irq(irqs[i]); + + return (0); +} + +int +xen_msi_release(int *irqs, int count) +{ + int i, ret; + + for (i = 0; i < count; i++) { + ret = xen_release_msi(irqs[i]); + if (ret != 0) + return (ret); + } + + return (0); +} + +int +xen_msi_map(int irq, uint64_t *addr, uint32_t *data) +{ + + return (0); +} + +int +xen_msix_alloc(device_t dev, int *irq) +{ + + return (ENXIO); +} + +int +xen_msix_release(int irq) +{ + + return (ENOENT); +} Modified: head/sys/x86/xen/xen_nexus.c ============================================================================== --- head/sys/x86/xen/xen_nexus.c Tue Sep 30 16:36:50 2014 (r272309) +++ head/sys/x86/xen/xen_nexus.c Tue Sep 30 16:46:45 2014 (r272310) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include "pcib_if.h" /* * Xen nexus(4) driver. @@ -111,6 +114,41 @@ nexus_xen_config_intr(device_t dev, int return (intr_config_intr(irq, trig, pol)); } +static int +nexus_xen_alloc_msix(device_t pcib, device_t dev, int *irq) +{ + + return (xen_msix_alloc(dev, irq)); +} + +static int +nexus_xen_release_msix(device_t pcib, device_t dev, int irq) +{ + + return (xen_msix_release(irq)); +} + +static int +nexus_xen_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs) +{ + + return (xen_msi_alloc(dev, count, maxcount, irqs)); +} + +static int +nexus_xen_release_msi(device_t pcib, device_t dev, int count, int *irqs) +{ + + return (xen_msi_release(irqs, count)); +} + +static int +nexus_xen_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data) +{ + + return (xen_msi_map(irq, addr, data)); +} + static device_method_t nexus_xen_methods[] = { /* Device interface */ DEVMETHOD(device_probe, nexus_xen_probe), @@ -119,6 +157,13 @@ static device_method_t nexus_xen_methods /* INTR */ DEVMETHOD(bus_config_intr, nexus_xen_config_intr), + /* MSI */ + DEVMETHOD(pcib_alloc_msi, nexus_xen_alloc_msi), + DEVMETHOD(pcib_release_msi, nexus_xen_release_msi), + DEVMETHOD(pcib_alloc_msix, nexus_xen_alloc_msix), + DEVMETHOD(pcib_release_msix, nexus_xen_release_msix), + DEVMETHOD(pcib_map_msi, nexus_xen_map_msi), + { 0, 0 } }; Added: head/sys/x86/xen/xen_pci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/xen/xen_pci.c Tue Sep 30 16:46:45 2014 (r272310) @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2014 Roger Pau Monné + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "pcib_if.h" +#include "pci_if.h" + +static int xen_pci_probe(device_t dev); + +static void xen_pci_enable_msi_method(device_t dev, device_t child, + uint64_t address, uint16_t data); +static void xen_pci_disable_msi_method(device_t dev, device_t child); + +static device_method_t xen_pci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, xen_pci_probe), + + /* PCI interface overwrites */ + DEVMETHOD(pci_enable_msi, xen_pci_enable_msi_method), + DEVMETHOD(pci_disable_msi, xen_pci_disable_msi_method), + + DEVMETHOD_END +}; + +static devclass_t pci_devclass; + +DECLARE_CLASS(acpi_pci_driver); +DEFINE_CLASS_1(pci, xen_pci_driver, xen_pci_methods, sizeof(struct pci_softc), + acpi_pci_driver); +DRIVER_MODULE(xen_pci, pcib, xen_pci_driver, pci_devclass, 0, 0); +MODULE_DEPEND(xen_pci, pci, 1, 1, 1); +MODULE_DEPEND(xen_pci, acpi, 1, 1, 1); +MODULE_VERSION(xen_pci, 1); + +static int +xen_pci_probe(device_t dev) +{ + + device_set_desc(dev, "Xen PCI bus"); + + if (!xen_pv_domain()) + return (ENXIO); + + return (BUS_PROBE_SPECIFIC); +} + +static void +xen_pci_enable_msi_method(device_t dev, device_t child, uint64_t address, + uint16_t data) +{ + struct pci_devinfo *dinfo = device_get_ivars(child); + struct pcicfg_msi *msi = &dinfo->cfg.msi; + + /* Enable MSI in the control register. */ + msi->msi_ctrl |= PCIM_MSICTRL_MSI_ENABLE; + pci_write_config(child, msi->msi_location + PCIR_MSI_CTRL, + msi->msi_ctrl, 2); +} + +static void +xen_pci_disable_msi_method(device_t dev, device_t child) +{ + struct pci_devinfo *dinfo = device_get_ivars(child); + struct pcicfg_msi *msi = &dinfo->cfg.msi; + + msi->msi_ctrl &= ~PCIM_MSICTRL_MSI_ENABLE; + pci_write_config(child, msi->msi_location + PCIR_MSI_CTRL, + msi->msi_ctrl, 2); +} Modified: head/sys/xen/interface/physdev.h ============================================================================== --- head/sys/xen/interface/physdev.h Tue Sep 30 16:36:50 2014 (r272309) +++ head/sys/xen/interface/physdev.h Tue Sep 30 16:46:45 2014 (r272310) @@ -151,6 +151,7 @@ DEFINE_XEN_GUEST_HANDLE(physdev_irq_t); #define MAP_PIRQ_TYPE_GSI 0x1 #define MAP_PIRQ_TYPE_UNKNOWN 0x2 #define MAP_PIRQ_TYPE_MSI_SEG 0x3 +#define MAP_PIRQ_TYPE_MULTI_MSI 0x4 #define PHYSDEVOP_map_pirq 13 struct physdev_map_pirq { Modified: head/sys/xen/xen_intr.h ============================================================================== --- head/sys/xen/xen_intr.h Tue Sep 30 16:36:50 2014 (r272309) +++ head/sys/xen/xen_intr.h Tue Sep 30 16:46:45 2014 (r272310) @@ -224,4 +224,26 @@ void xen_intr_signal(xen_intr_handle_t h */ evtchn_port_t xen_intr_port(xen_intr_handle_t handle); +/** + * Setup MSI vector interrupt(s). + * + * \param dev The device that requests the binding. + * + * \param vector Requested initial vector to bind the MSI interrupt(s) to. + * + * \param count Number of vectors to allocate. + * + * \returns 0 on success, otherwise an errno. + */ +int xen_register_msi(device_t dev, int vector, int count); + +/** + * Teardown a MSI vector interrupt. + * + * \param vector Requested vector to release. + * + * \returns 0 on success, otherwise an errno. + */ +int xen_release_msi(int vector); + #endif /* _XEN_INTR_H_ */ Added: head/sys/xen/xen_msi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/xen/xen_msi.h Tue Sep 30 16:46:45 2014 (r272310) @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014 Roger Pau Monné + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __XEN_MSI_H__ +#define __XEN_MSI_H__ + +void xen_msi_init(void); +int xen_msi_map(int irq, uint64_t *addr, uint32_t *data); +int xen_msi_alloc(device_t dev, int count, int maxcount, int *irqs); +int xen_msi_release(int *irqs, int count); +int xen_msix_alloc(device_t dev, int *irq); +int xen_msix_release(int irq); + +#endif /* !__XEN_MSI_H__ */ \ No newline at end of file From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 16:49:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F9E7BA2; Tue, 30 Sep 2014 16:49: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 73DA9831; Tue, 30 Sep 2014 16:49: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 s8UGnIXS093129; Tue, 30 Sep 2014 16:49:18 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UGnIlO093128; Tue, 30 Sep 2014 16:49:18 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409301649.s8UGnIlO093128@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 30 Sep 2014 16:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272311 - head/sys/x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 16:49:18 -0000 Author: royger Date: Tue Sep 30 16:49:17 2014 New Revision: 272311 URL: http://svnweb.freebsd.org/changeset/base/272311 Log: xen: add the Xen implementation of pci_child_added method Add the Xen specific implementation of pci_child_added to the Xen PCI bus. This is needed so FreeBSD can register the devices it finds with the hypervisor. Sponsored by: Citrix Systems R&D x86/xen/xen_pci.c: - Add the Xen pci_child_added method. Modified: head/sys/x86/xen/xen_pci.c Modified: head/sys/x86/xen/xen_pci.c ============================================================================== --- head/sys/x86/xen/xen_pci.c Tue Sep 30 16:46:45 2014 (r272310) +++ head/sys/x86/xen/xen_pci.c Tue Sep 30 16:49:17 2014 (r272311) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "pcib_if.h" #include "pci_if.h" @@ -49,6 +50,7 @@ static int xen_pci_probe(device_t dev); static void xen_pci_enable_msi_method(device_t dev, device_t child, uint64_t address, uint16_t data); static void xen_pci_disable_msi_method(device_t dev, device_t child); +static void xen_pci_child_added_method(device_t dev, device_t child); static device_method_t xen_pci_methods[] = { /* Device interface */ @@ -57,6 +59,7 @@ static device_method_t xen_pci_methods[] /* PCI interface overwrites */ DEVMETHOD(pci_enable_msi, xen_pci_enable_msi_method), DEVMETHOD(pci_disable_msi, xen_pci_disable_msi_method), + DEVMETHOD(pci_child_added, xen_pci_child_added_method), DEVMETHOD_END }; @@ -106,3 +109,24 @@ xen_pci_disable_msi_method(device_t dev, pci_write_config(child, msi->msi_location + PCIR_MSI_CTRL, msi->msi_ctrl, 2); } + +static void +xen_pci_child_added_method(device_t dev, device_t child) +{ + struct pci_devinfo *dinfo; + struct physdev_pci_device_add add_pci; + int error; + + dinfo = device_get_ivars(child); + KASSERT((dinfo != NULL), + ("xen_pci_add_child_method called with NULL dinfo")); + + bzero(&add_pci, sizeof(add_pci)); + add_pci.seg = dinfo->cfg.domain; + add_pci.bus = dinfo->cfg.bus; + add_pci.devfn = (dinfo->cfg.slot << 3) | dinfo->cfg.func; + error = HYPERVISOR_physdev_op(PHYSDEVOP_pci_device_add, &add_pci); + if (error) + panic("unable to add device bus %u devfn %u error: %d\n", + add_pci.bus, add_pci.devfn, error); +} From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 16:53:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0052FAF; Tue, 30 Sep 2014 16:53:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C01F90F; Tue, 30 Sep 2014 16:53: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 s8UGr9Y2097237; Tue, 30 Sep 2014 16:53:09 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UGr9MP097236; Tue, 30 Sep 2014 16:53:09 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409301653.s8UGr9MP097236@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 30 Sep 2014 16:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272312 - head/sys/dev/xen/balloon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 16:53:09 -0000 Author: royger Date: Tue Sep 30 16:53:08 2014 New Revision: 272312 URL: http://svnweb.freebsd.org/changeset/base/272312 Log: xen: make xen balloon a driver that depends on xenstore This is done so we can prevent the Xen Balloon driver from attaching before xenstore is setup. Sponsored by: Citrix Systems R&D dev/xen/balloon/balloon.c: - Make xen balloon a driver that depends on xenstore. Modified: head/sys/dev/xen/balloon/balloon.c Modified: head/sys/dev/xen/balloon/balloon.c ============================================================================== --- head/sys/dev/xen/balloon/balloon.c Tue Sep 30 16:49:17 2014 (r272311) +++ head/sys/dev/xen/balloon/balloon.c Tue Sep 30 16:53:08 2014 (r272312) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -348,25 +349,50 @@ watch_target(struct xs_watch *watch, set_new_target(new_target >> KB_TO_PAGE_SHIFT); } -static void -balloon_init_watcher(void *arg) +/*------------------ Private Device Attachment Functions --------------------*/ +/** + * \brief Identify instances of this device type in the system. + * + * \param driver The driver performing this identify action. + * \param parent The NewBus parent device for any devices this method adds. + */ +static void +xenballoon_identify(driver_t *driver __unused, device_t parent) { - int err; - - if (!is_running_on_xen()) - return; + /* + * A single device instance for our driver is always present + * in a system operating under Xen. + */ + BUS_ADD_CHILD(parent, 0, driver->name, 0); +} - err = xs_register_watch(&target_watch); - if (err) - printf("Failed to set balloon watcher\n"); +/** + * \brief Probe for the existance of the Xen Balloon device + * + * \param dev NewBus device_t for this Xen control instance. + * + * \return Always returns 0 indicating success. + */ +static int +xenballoon_probe(device_t dev) +{ + device_set_desc(dev, "Xen Balloon Device"); + return (0); } -SYSINIT(balloon_init_watcher, SI_SUB_PSEUDO, SI_ORDER_ANY, - balloon_init_watcher, NULL); -static void -balloon_init(void *arg) +/** + * \brief Attach the Xen Balloon device. + * + * \param dev NewBus device_t for this Xen control instance. + * + * \return On success, 0. Otherwise an errno value indicating the + * type of failure. + */ +static int +xenballoon_attach(device_t dev) { + int err; #ifndef XENHVM vm_page_t page; unsigned long pfn; @@ -374,9 +400,6 @@ balloon_init(void *arg) #define max_pfn HYPERVISOR_shared_info->arch.max_pfn #endif - if (!is_running_on_xen()) - return; - mtx_init(&balloon_mutex, "balloon_mutex", NULL, MTX_DEF); #ifndef XENHVM @@ -403,17 +426,27 @@ balloon_init(void *arg) #endif target_watch.callback = watch_target; - - return; -} -SYSINIT(balloon_init, SI_SUB_PSEUDO, SI_ORDER_ANY, balloon_init, NULL); -void balloon_update_driver_allowance(long delta); + err = xs_register_watch(&target_watch); + if (err) + device_printf(dev, + "xenballon: failed to set balloon watcher\n"); -void -balloon_update_driver_allowance(long delta) -{ - mtx_lock(&balloon_mutex); - bs.driver_pages += delta; - mtx_unlock(&balloon_mutex); + return (err); } + +/*-------------------- Private Device Attachment Data -----------------------*/ +static device_method_t xenballoon_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, xenballoon_identify), + DEVMETHOD(device_probe, xenballoon_probe), + DEVMETHOD(device_attach, xenballoon_attach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(xenballoon, xenballoon_driver, xenballoon_methods, 0); +devclass_t xenballoon_devclass; + +DRIVER_MODULE(xenballoon, xenstore, xenballoon_driver, xenballoon_devclass, + NULL, NULL); From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 17:14:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07DB7B2; Tue, 30 Sep 2014 17:14: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 DD01BC0D; Tue, 30 Sep 2014 17:14: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 s8UHECd3007293; Tue, 30 Sep 2014 17:14:12 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UHECCa007289; Tue, 30 Sep 2014 17:14:12 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409301714.s8UHECCa007289@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 30 Sep 2014 17:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272314 - in head/sys: conf dev/xen/xenstore xen/xenstore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 17:14:13 -0000 Author: royger Date: Tue Sep 30 17:14:11 2014 New Revision: 272314 URL: http://svnweb.freebsd.org/changeset/base/272314 Log: xen: move xenstore devices Move xenstore related devices (xenstore.c and xenstore_dev.c) from xen/xenstore to dev/xen/xenstore. This is just code motion, no functional changes. Sponsored by: Citrix Systems R&D Added: head/sys/dev/xen/xenstore/ head/sys/dev/xen/xenstore/xenstore.c - copied unchanged from r272308, head/sys/xen/xenstore/xenstore.c head/sys/dev/xen/xenstore/xenstore_dev.c - copied unchanged from r272308, head/sys/xen/xenstore/xenstore_dev.c Deleted: head/sys/xen/xenstore/xenstore.c head/sys/xen/xenstore/xenstore_dev.c Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 30 16:55:19 2014 (r272313) +++ head/sys/conf/files Tue Sep 30 17:14:11 2014 (r272314) @@ -2638,6 +2638,8 @@ dev/xen/netfront/netfront.c optional xen dev/xen/xenpci/xenpci.c optional xenpci dev/xen/timer/timer.c optional xen | xenhvm dev/xen/pvcpu/pvcpu.c optional xen | xenhvm +dev/xen/xenstore/xenstore.c optional xen | xenhvm +dev/xen/xenstore/xenstore_dev.c optional xen | xenhvm dev/xl/if_xl.c optional xl pci dev/xl/xlphy.c optional xl pci fs/autofs/autofs.c optional autofs @@ -3976,8 +3978,6 @@ xen/xenbus/xenbusb_if.m optional xen | xen/xenbus/xenbusb.c optional xen | xenhvm xen/xenbus/xenbusb_front.c optional xen | xenhvm xen/xenbus/xenbusb_back.c optional xen | xenhvm -xen/xenstore/xenstore.c optional xen | xenhvm -xen/xenstore/xenstore_dev.c optional xen | xenhvm xdr/xdr.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd xdr/xdr_array.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd xdr/xdr_mbuf.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd Copied: head/sys/dev/xen/xenstore/xenstore.c (from r272308, head/sys/xen/xenstore/xenstore.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xen/xenstore/xenstore.c Tue Sep 30 17:14:11 2014 (r272314, copy of r272308, head/sys/xen/xenstore/xenstore.c) @@ -0,0 +1,1640 @@ +/****************************************************************************** + * xenstore.c + * + * Low-level kernel interface to the XenStore. + * + * Copyright (C) 2005 Rusty Russell, IBM Corporation + * Copyright (C) 2009,2010 Spectra Logic Corporation + * + * This file may be distributed separately from the Linux kernel, or + * incorporated into other software packages, subject to the following license: + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this source file (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, modify, + * merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +/** + * \file xenstore.c + * \brief XenStore interface + * + * The XenStore interface is a simple storage system that is a means of + * communicating state and configuration data between the Xen Domain 0 + * and the various guest domains. All configuration data other than + * a small amount of essential information required during the early + * boot process of launching a Xen aware guest, is managed using the + * XenStore. + * + * The XenStore is ASCII string based, and has a structure and semantics + * similar to a filesystem. There are files and directories, the directories + * able to contain files or other directories. The depth of the hierachy + * is only limited by the XenStore's maximum path length. + * + * The communication channel between the XenStore service and other + * domains is via two, guest specific, ring buffers in a shared memory + * area. One ring buffer is used for communicating in each direction. + * The grant table references for this shared memory are given to the + * guest either via the xen_start_info structure for a fully para- + * virtualized guest, or via HVM hypercalls for a hardware virtualized + * guest. + * + * The XenStore communication relies on an event channel and thus + * interrupts. For this reason, the attachment of the XenStore + * relies on an interrupt driven configuration hook to hold off + * boot processing until communication with the XenStore service + * can be established. + * + * Several Xen services depend on the XenStore, most notably the + * XenBus used to discover and manage Xen devices. These services + * are implemented as NewBus child attachments to a bus exported + * by this XenStore driver. + */ + +static struct xs_watch *find_watch(const char *token); + +MALLOC_DEFINE(M_XENSTORE, "xenstore", "XenStore data and results"); + +/** + * Pointer to shared memory communication structures allowing us + * to communicate with the XenStore service. + * + * When operating in full PV mode, this pointer is set early in kernel + * startup from within xen_machdep.c. In HVM mode, we use hypercalls + * to get the guest frame number for the shared page and then map it + * into kva. See xs_init() for details. + */ +struct xenstore_domain_interface *xen_store; + +/*-------------------------- Private Data Structures ------------------------*/ + +/** + * Structure capturing messages received from the XenStore service. + */ +struct xs_stored_msg { + TAILQ_ENTRY(xs_stored_msg) list; + + struct xsd_sockmsg hdr; + + union { + /* Queued replies. */ + struct { + char *body; + } reply; + + /* Queued watch events. */ + struct { + struct xs_watch *handle; + const char **vec; + u_int vec_size; + } watch; + } u; +}; +TAILQ_HEAD(xs_stored_msg_list, xs_stored_msg); + +/** + * Container for all XenStore related state. + */ +struct xs_softc { + /** Newbus device for the XenStore. */ + device_t xs_dev; + + /** + * Lock serializing access to ring producer/consumer + * indexes. Use of this lock guarantees that wakeups + * of blocking readers/writers are not missed due to + * races with the XenStore service. + */ + struct mtx ring_lock; + + /* + * Mutex used to insure exclusive access to the outgoing + * communication ring. We use a lock type that can be + * held while sleeping so that xs_write() can block waiting + * for space in the ring to free up, without allowing another + * writer to come in and corrupt a partial message write. + */ + struct sx request_mutex; + + /** + * A list of replies to our requests. + * + * The reply list is filled by xs_rcv_thread(). It + * is consumed by the context that issued the request + * to which a reply is made. The requester blocks in + * xs_read_reply(). + * + * /note Only one requesting context can be active at a time. + * This is guaranteed by the request_mutex and insures + * that the requester sees replies matching the order + * of its requests. + */ + struct xs_stored_msg_list reply_list; + + /** Lock protecting the reply list. */ + struct mtx reply_lock; + + /** + * List of registered watches. + */ + struct xs_watch_list registered_watches; + + /** Lock protecting the registered watches list. */ + struct mtx registered_watches_lock; + + /** + * List of pending watch callback events. + */ + struct xs_stored_msg_list watch_events; + + /** Lock protecting the watch calback list. */ + struct mtx watch_events_lock; + + /** + * Sleepable lock used to prevent VM suspension while a + * xenstore transaction is outstanding. + * + * Each active transaction holds a shared lock on the + * suspend mutex. Our suspend method blocks waiting + * to acquire an exclusive lock. This guarantees that + * suspend processing will only proceed once all active + * transactions have been retired. + */ + struct sx suspend_mutex; + + /** + * The processid of the xenwatch thread. + */ + pid_t xenwatch_pid; + + /** + * Sleepable mutex used to gate the execution of XenStore + * watch event callbacks. + * + * xenwatch_thread holds an exclusive lock on this mutex + * while delivering event callbacks, and xenstore_unregister_watch() + * uses an exclusive lock of this mutex to guarantee that no + * callbacks of the just unregistered watch are pending + * before returning to its caller. + */ + struct sx xenwatch_mutex; + + /** + * The HVM guest pseudo-physical frame number. This is Xen's mapping + * of the true machine frame number into our "physical address space". + */ + unsigned long gpfn; + + /** + * The event channel for communicating with the + * XenStore service. + */ + int evtchn; + + /** Handle for XenStore interrupts. */ + xen_intr_handle_t xen_intr_handle; + + /** + * Interrupt driven config hook allowing us to defer + * attaching children until interrupts (and thus communication + * with the XenStore service) are available. + */ + struct intr_config_hook xs_attachcb; +}; + +/*-------------------------------- Global Data ------------------------------*/ +static struct xs_softc xs; + +/*------------------------- Private Utility Functions -----------------------*/ + +/** + * Count and optionally record pointers to a number of NUL terminated + * strings in a buffer. + * + * \param strings A pointer to a contiguous buffer of NUL terminated strings. + * \param dest An array to store pointers to each string found in strings. + * \param len The length of the buffer pointed to by strings. + * + * \return A count of the number of strings found. + */ +static u_int +extract_strings(const char *strings, const char **dest, u_int len) +{ + u_int num; + const char *p; + + for (p = strings, num = 0; p < strings + len; p += strlen(p) + 1) { + if (dest != NULL) + *dest++ = p; + num++; + } + + return (num); +} + +/** + * Convert a contiguous buffer containing a series of NUL terminated + * strings into an array of pointers to strings. + * + * The returned pointer references the array of string pointers which + * is followed by the storage for the string data. It is the client's + * responsibility to free this storage. + * + * The storage addressed by strings is free'd prior to split returning. + * + * \param strings A pointer to a contiguous buffer of NUL terminated strings. + * \param len The length of the buffer pointed to by strings. + * \param num The number of strings found and returned in the strings + * array. + * + * \return An array of pointers to the strings found in the input buffer. + */ +static const char ** +split(char *strings, u_int len, u_int *num) +{ + const char **ret; + + /* Protect against unterminated buffers. */ + if (len > 0) + strings[len - 1] = '\0'; + + /* Count the strings. */ + *num = extract_strings(strings, /*dest*/NULL, len); + + /* Transfer to one big alloc for easy freeing by the caller. */ + ret = malloc(*num * sizeof(char *) + len, M_XENSTORE, M_WAITOK); + memcpy(&ret[*num], strings, len); + free(strings, M_XENSTORE); + + /* Extract pointers to newly allocated array. */ + strings = (char *)&ret[*num]; + (void)extract_strings(strings, /*dest*/ret, len); + + return (ret); +} + +/*------------------------- Public Utility Functions -------------------------*/ +/*------- API comments for these methods can be found in xenstorevar.h -------*/ +struct sbuf * +xs_join(const char *dir, const char *name) +{ + struct sbuf *sb; + + sb = sbuf_new_auto(); + sbuf_cat(sb, dir); + if (name[0] != '\0') { + sbuf_putc(sb, '/'); + sbuf_cat(sb, name); + } + sbuf_finish(sb); + + return (sb); +} + +/*-------------------- Low Level Communication Management --------------------*/ +/** + * Interrupt handler for the XenStore event channel. + * + * XenStore reads and writes block on "xen_store" for buffer + * space. Wakeup any blocking operations when the XenStore + * service has modified the queues. + */ +static void +xs_intr(void * arg __unused /*__attribute__((unused))*/) +{ + + /* + * Hold ring lock across wakeup so that clients + * cannot miss a wakeup. + */ + mtx_lock(&xs.ring_lock); + wakeup(xen_store); + mtx_unlock(&xs.ring_lock); +} + +/** + * Verify that the indexes for a ring are valid. + * + * The difference between the producer and consumer cannot + * exceed the size of the ring. + * + * \param cons The consumer index for the ring to test. + * \param prod The producer index for the ring to test. + * + * \retval 1 If indexes are in range. + * \retval 0 If the indexes are out of range. + */ +static int +xs_check_indexes(XENSTORE_RING_IDX cons, XENSTORE_RING_IDX prod) +{ + + return ((prod - cons) <= XENSTORE_RING_SIZE); +} + +/** + * Return a pointer to, and the length of, the contiguous + * free region available for output in a ring buffer. + * + * \param cons The consumer index for the ring. + * \param prod The producer index for the ring. + * \param buf The base address of the ring's storage. + * \param len The amount of contiguous storage available. + * + * \return A pointer to the start location of the free region. + */ +static void * +xs_get_output_chunk(XENSTORE_RING_IDX cons, XENSTORE_RING_IDX prod, + char *buf, uint32_t *len) +{ + + *len = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod); + if ((XENSTORE_RING_SIZE - (prod - cons)) < *len) + *len = XENSTORE_RING_SIZE - (prod - cons); + return (buf + MASK_XENSTORE_IDX(prod)); +} + +/** + * Return a pointer to, and the length of, the contiguous + * data available to read from a ring buffer. + * + * \param cons The consumer index for the ring. + * \param prod The producer index for the ring. + * \param buf The base address of the ring's storage. + * \param len The amount of contiguous data available to read. + * + * \return A pointer to the start location of the available data. + */ +static const void * +xs_get_input_chunk(XENSTORE_RING_IDX cons, XENSTORE_RING_IDX prod, + const char *buf, uint32_t *len) +{ + + *len = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(cons); + if ((prod - cons) < *len) + *len = prod - cons; + return (buf + MASK_XENSTORE_IDX(cons)); +} + +/** + * Transmit data to the XenStore service. + * + * \param tdata A pointer to the contiguous data to send. + * \param len The amount of data to send. + * + * \return On success 0, otherwise an errno value indicating the + * cause of failure. + * + * \invariant Called from thread context. + * \invariant The buffer pointed to by tdata is at least len bytes + * in length. + * \invariant xs.request_mutex exclusively locked. + */ +static int +xs_write_store(const void *tdata, unsigned len) +{ + XENSTORE_RING_IDX cons, prod; + const char *data = (const char *)tdata; + int error; + + sx_assert(&xs.request_mutex, SX_XLOCKED); + while (len != 0) { + void *dst; + u_int avail; + + /* Hold lock so we can't miss wakeups should we block. */ + mtx_lock(&xs.ring_lock); + cons = xen_store->req_cons; + prod = xen_store->req_prod; + if ((prod - cons) == XENSTORE_RING_SIZE) { + /* + * Output ring is full. Wait for a ring event. + * + * Note that the events from both queues + * are combined, so being woken does not + * guarantee that data exist in the read + * ring. + * + * To simplify error recovery and the retry, + * we specify PDROP so our lock is *not* held + * when msleep returns. + */ + error = msleep(xen_store, &xs.ring_lock, PCATCH|PDROP, + "xbwrite", /*timeout*/0); + if (error && error != EWOULDBLOCK) + return (error); + + /* Try again. */ + continue; + } + mtx_unlock(&xs.ring_lock); + + /* Verify queue sanity. */ + if (!xs_check_indexes(cons, prod)) { + xen_store->req_cons = xen_store->req_prod = 0; + return (EIO); + } + + dst = xs_get_output_chunk(cons, prod, xen_store->req, &avail); + if (avail > len) + avail = len; + + memcpy(dst, data, avail); + data += avail; + len -= avail; + + /* + * The store to the producer index, which indicates + * to the other side that new data has arrived, must + * be visible only after our copy of the data into the + * ring has completed. + */ + wmb(); + xen_store->req_prod += avail; + + /* + * xen_intr_signal() implies mb(). The other side will see + * the change to req_prod at the time of the interrupt. + */ + xen_intr_signal(xs.xen_intr_handle); + } + + return (0); +} + +/** + * Receive data from the XenStore service. + * + * \param tdata A pointer to the contiguous buffer to receive the data. + * \param len The amount of data to receive. + * + * \return On success 0, otherwise an errno value indicating the + * cause of failure. + * + * \invariant Called from thread context. + * \invariant The buffer pointed to by tdata is at least len bytes + * in length. + * + * \note xs_read does not perform any internal locking to guarantee + * serial access to the incoming ring buffer. However, there + * is only one context processing reads: xs_rcv_thread(). + */ +static int +xs_read_store(void *tdata, unsigned len) +{ + XENSTORE_RING_IDX cons, prod; + char *data = (char *)tdata; + int error; + + while (len != 0) { + u_int avail; + const char *src; + + /* Hold lock so we can't miss wakeups should we block. */ + mtx_lock(&xs.ring_lock); + cons = xen_store->rsp_cons; + prod = xen_store->rsp_prod; + if (cons == prod) { + /* + * Nothing to read. Wait for a ring event. + * + * Note that the events from both queues + * are combined, so being woken does not + * guarantee that data exist in the read + * ring. + * + * To simplify error recovery and the retry, + * we specify PDROP so our lock is *not* held + * when msleep returns. + */ + error = msleep(xen_store, &xs.ring_lock, PCATCH|PDROP, + "xbread", /*timeout*/0); + if (error && error != EWOULDBLOCK) + return (error); + continue; + } + mtx_unlock(&xs.ring_lock); + + /* Verify queue sanity. */ + if (!xs_check_indexes(cons, prod)) { + xen_store->rsp_cons = xen_store->rsp_prod = 0; + return (EIO); + } + + src = xs_get_input_chunk(cons, prod, xen_store->rsp, &avail); + if (avail > len) + avail = len; + + /* + * Insure the data we read is related to the indexes + * we read above. + */ + rmb(); + + memcpy(data, src, avail); + data += avail; + len -= avail; + + /* + * Insure that the producer of this ring does not see + * the ring space as free until after we have copied it + * out. + */ + mb(); + xen_store->rsp_cons += avail; + + /* + * xen_intr_signal() implies mb(). The producer will see + * the updated consumer index when the event is delivered. + */ + xen_intr_signal(xs.xen_intr_handle); + } + + return (0); +} + +/*----------------------- Received Message Processing ------------------------*/ +/** + * Block reading the next message from the XenStore service and + * process the result. + * + * \param type The returned type of the XenStore message received. + * + * \return 0 on success. Otherwise an errno value indicating the + * type of failure encountered. + */ +static int +xs_process_msg(enum xsd_sockmsg_type *type) +{ + struct xs_stored_msg *msg; + char *body; + int error; + + msg = malloc(sizeof(*msg), M_XENSTORE, M_WAITOK); + error = xs_read_store(&msg->hdr, sizeof(msg->hdr)); + if (error) { + free(msg, M_XENSTORE); + return (error); + } + + body = malloc(msg->hdr.len + 1, M_XENSTORE, M_WAITOK); + error = xs_read_store(body, msg->hdr.len); + if (error) { + free(body, M_XENSTORE); + free(msg, M_XENSTORE); + return (error); + } + body[msg->hdr.len] = '\0'; + + *type = msg->hdr.type; + if (msg->hdr.type == XS_WATCH_EVENT) { + msg->u.watch.vec = split(body, msg->hdr.len, + &msg->u.watch.vec_size); + + mtx_lock(&xs.registered_watches_lock); + msg->u.watch.handle = find_watch( + msg->u.watch.vec[XS_WATCH_TOKEN]); + if (msg->u.watch.handle != NULL) { + mtx_lock(&xs.watch_events_lock); + TAILQ_INSERT_TAIL(&xs.watch_events, msg, list); + wakeup(&xs.watch_events); + mtx_unlock(&xs.watch_events_lock); + } else { + free(msg->u.watch.vec, M_XENSTORE); + free(msg, M_XENSTORE); + } + mtx_unlock(&xs.registered_watches_lock); + } else { + msg->u.reply.body = body; + mtx_lock(&xs.reply_lock); + TAILQ_INSERT_TAIL(&xs.reply_list, msg, list); + wakeup(&xs.reply_list); + mtx_unlock(&xs.reply_lock); + } + + return (0); +} + +/** + * Thread body of the XenStore receive thread. + * + * This thread blocks waiting for data from the XenStore service + * and processes and received messages. + */ +static void +xs_rcv_thread(void *arg __unused) +{ + int error; + enum xsd_sockmsg_type type; + + for (;;) { + error = xs_process_msg(&type); + if (error) + printf("XENSTORE error %d while reading message\n", + error); + } +} + +/*---------------- XenStore Message Request/Reply Processing -----------------*/ +/** + * Filter invoked before transmitting any message to the XenStore service. + * + * The role of the filter may expand, but currently serves to manage + * the interactions of messages with transaction state. + * + * \param request_msg_type The message type for the request. + */ +static inline void +xs_request_filter(uint32_t request_msg_type) +{ + if (request_msg_type == XS_TRANSACTION_START) + sx_slock(&xs.suspend_mutex); +} + +/** + * Filter invoked after transmitting any message to the XenStore service. + * + * The role of the filter may expand, but currently serves to manage + * the interactions of messages with transaction state. + * + * \param request_msg_type The message type for the original request. + * \param reply_msg_type The message type for any received reply. + * \param request_reply_error The error status from the attempt to send + * the request or retrieve the reply. + */ +static inline void +xs_reply_filter(uint32_t request_msg_type, + uint32_t reply_msg_type, int request_reply_error) +{ + /* + * The count of transactions drops if we attempted + * to end a transaction (even if that attempt fails + * in error), we receive a transaction end acknowledgement, + * or if our attempt to begin a transaction fails. + */ + if (request_msg_type == XS_TRANSACTION_END + || (request_reply_error == 0 && reply_msg_type == XS_TRANSACTION_END) + || (request_msg_type == XS_TRANSACTION_START + && (request_reply_error != 0 || reply_msg_type == XS_ERROR))) + sx_sunlock(&xs.suspend_mutex); + +} + +#define xsd_error_count (sizeof(xsd_errors) / sizeof(xsd_errors[0])) + +/** + * Convert a XenStore error string into an errno number. + * + * \param errorstring The error string to convert. + * + * \return The errno best matching the input string. + * + * \note Unknown error strings are converted to EINVAL. + */ +static int +xs_get_error(const char *errorstring) +{ + u_int i; + + for (i = 0; i < xsd_error_count; i++) { + if (!strcmp(errorstring, xsd_errors[i].errstring)) + return (xsd_errors[i].errnum); + } + log(LOG_WARNING, "XENSTORE xen store gave: unknown error %s", + errorstring); + return (EINVAL); +} + +/** + * Block waiting for a reply to a message request. + * + * \param type The returned type of the reply. + * \param len The returned body length of the reply. + * \param result The returned body of the reply. + * + * \return 0 on success. Otherwise an errno indicating the + * cause of failure. + */ +static int +xs_read_reply(enum xsd_sockmsg_type *type, u_int *len, void **result) +{ + struct xs_stored_msg *msg; + char *body; + int error; + + mtx_lock(&xs.reply_lock); + while (TAILQ_EMPTY(&xs.reply_list)) { + error = mtx_sleep(&xs.reply_list, &xs.reply_lock, + PCATCH, "xswait", hz/10); + if (error && error != EWOULDBLOCK) { + mtx_unlock(&xs.reply_lock); + return (error); + } + } + msg = TAILQ_FIRST(&xs.reply_list); + TAILQ_REMOVE(&xs.reply_list, msg, list); + mtx_unlock(&xs.reply_lock); + + *type = msg->hdr.type; + if (len) + *len = msg->hdr.len; + body = msg->u.reply.body; + + free(msg, M_XENSTORE); + *result = body; + return (0); +} + +/** + * Pass-thru interface for XenStore access by userland processes + * via the XenStore device. + * + * Reply type and length data are returned by overwriting these + * fields in the passed in request message. + * + * \param msg A properly formatted message to transmit to + * the XenStore service. + * \param result The returned body of the reply. + * + * \return 0 on success. Otherwise an errno indicating the cause + * of failure. + * + * \note The returned result is provided in malloced storage and thus + * must be free'd by the caller with 'free(result, M_XENSTORE); + */ +int +xs_dev_request_and_reply(struct xsd_sockmsg *msg, void **result) +{ + uint32_t request_type; + int error; + + request_type = msg->type; + xs_request_filter(request_type); + + sx_xlock(&xs.request_mutex); + if ((error = xs_write_store(msg, sizeof(*msg) + msg->len)) == 0) + error = xs_read_reply(&msg->type, &msg->len, result); + sx_xunlock(&xs.request_mutex); + + xs_reply_filter(request_type, msg->type, error); + + return (error); +} + +/** + * Send a message with an optionally muti-part body to the XenStore service. + * + * \param t The transaction to use for this request. + * \param request_type The type of message to send. + * \param iovec Pointers to the body sections of the request. + * \param num_vecs The number of body sections in the request. + * \param len The returned length of the reply. + * \param result The returned body of the reply. + * + * \return 0 on success. Otherwise an errno indicating + * the cause of failure. + * + * \note The returned result is provided in malloced storage and thus + * must be free'd by the caller with 'free(*result, M_XENSTORE); + */ +static int +xs_talkv(struct xs_transaction t, enum xsd_sockmsg_type request_type, + const struct iovec *iovec, u_int num_vecs, u_int *len, void **result) +{ + struct xsd_sockmsg msg; + void *ret = NULL; + u_int i; + int error; + + msg.tx_id = t.id; + msg.req_id = 0; + msg.type = request_type; + msg.len = 0; + for (i = 0; i < num_vecs; i++) + msg.len += iovec[i].iov_len; + + xs_request_filter(request_type); + + sx_xlock(&xs.request_mutex); + error = xs_write_store(&msg, sizeof(msg)); + if (error) { + printf("xs_talkv failed %d\n", error); + goto error_lock_held; + } + + for (i = 0; i < num_vecs; i++) { + error = xs_write_store(iovec[i].iov_base, iovec[i].iov_len); + if (error) { + printf("xs_talkv failed %d\n", error); + goto error_lock_held; + } + } + + error = xs_read_reply(&msg.type, len, &ret); + +error_lock_held: + sx_xunlock(&xs.request_mutex); + xs_reply_filter(request_type, msg.type, error); + if (error) + return (error); + + if (msg.type == XS_ERROR) { + error = xs_get_error(ret); + free(ret, M_XENSTORE); + return (error); + } + + /* Reply is either error or an echo of our request message type. */ + KASSERT(msg.type == request_type, ("bad xenstore message type")); + + if (result) + *result = ret; + else + free(ret, M_XENSTORE); + + return (0); +} + +/** + * Wrapper for xs_talkv allowing easy transmission of a message with + * a single, contiguous, message body. + * + * \param t The transaction to use for this request. + * \param request_type The type of message to send. + * \param body The body of the request. + * \param len The returned length of the reply. + * \param result The returned body of the reply. + * + * \return 0 on success. Otherwise an errno indicating + * the cause of failure. + * + * \note The returned result is provided in malloced storage and thus + * must be free'd by the caller with 'free(*result, M_XENSTORE); + */ +static int +xs_single(struct xs_transaction t, enum xsd_sockmsg_type request_type, + const char *body, u_int *len, void **result) +{ + struct iovec iovec; + + iovec.iov_base = (void *)(uintptr_t)body; + iovec.iov_len = strlen(body) + 1; + + return (xs_talkv(t, request_type, &iovec, 1, len, result)); +} + +/*------------------------- XenStore Watch Support ---------------------------*/ +/** + * Transmit a watch request to the XenStore service. + * + * \param path The path in the XenStore to watch. + * \param tocken A unique identifier for this watch. + * + * \return 0 on success. Otherwise an errno indicating the + * cause of failure. + */ +static int +xs_watch(const char *path, const char *token) +{ + struct iovec iov[2]; + + iov[0].iov_base = (void *)(uintptr_t) path; + iov[0].iov_len = strlen(path) + 1; + iov[1].iov_base = (void *)(uintptr_t) token; + iov[1].iov_len = strlen(token) + 1; + + return (xs_talkv(XST_NIL, XS_WATCH, iov, 2, NULL, NULL)); +} + +/** + * Transmit an uwatch request to the XenStore service. + * + * \param path The path in the XenStore to watch. + * \param tocken A unique identifier for this watch. + * + * \return 0 on success. Otherwise an errno indicating the + * cause of failure. + */ +static int +xs_unwatch(const char *path, const char *token) +{ + struct iovec iov[2]; + + iov[0].iov_base = (void *)(uintptr_t) path; + iov[0].iov_len = strlen(path) + 1; + iov[1].iov_base = (void *)(uintptr_t) token; + iov[1].iov_len = strlen(token) + 1; + + return (xs_talkv(XST_NIL, XS_UNWATCH, iov, 2, NULL, NULL)); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 17:19:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1237835F; Tue, 30 Sep 2014 17:19: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 F37DAC52; Tue, 30 Sep 2014 17:19: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 s8UHJ75s007936; Tue, 30 Sep 2014 17:19:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UHJ7cw007935; Tue, 30 Sep 2014 17:19:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409301719.s8UHJ7cw007935@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 30 Sep 2014 17:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272315 - head/tools/sched X-SVN-Group: head MIME-Version: 1.0 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, 30 Sep 2014 17:19:08 -0000 Author: jhb Date: Tue Sep 30 17:19:07 2014 New Revision: 272315 URL: http://svnweb.freebsd.org/changeset/base/272315 Log: Explicitly return None for negative event indices. Prior to this, eventat(-1) would return the next-to-last event causing the back button to cycle back to the end of an event source instead of stopping at the start. Modified: head/tools/sched/schedgraph.py Modified: head/tools/sched/schedgraph.py ============================================================================== --- head/tools/sched/schedgraph.py Tue Sep 30 17:14:11 2014 (r272314) +++ head/tools/sched/schedgraph.py Tue Sep 30 17:19:07 2014 (r272315) @@ -856,7 +856,7 @@ class EventSource: return (Y_EVENTSOURCE) def eventat(self, i): - if (i >= len(self.events)): + if (i >= len(self.events) or i < 0): return (None) event = self.events[i] return (event) From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 17:26:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07CD67B2; Tue, 30 Sep 2014 17:26: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 E895AD60; Tue, 30 Sep 2014 17:26: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 s8UHQYfL012274; Tue, 30 Sep 2014 17:26:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UHQYAm012273; Tue, 30 Sep 2014 17:26:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409301726.s8UHQYAm012273@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 30 Sep 2014 17:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272316 - 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, 30 Sep 2014 17:26:35 -0000 Author: jhb Date: Tue Sep 30 17:26:34 2014 New Revision: 272316 URL: http://svnweb.freebsd.org/changeset/base/272316 Log: Only define the full inm_print() if KTR_IGMPV3 is enabled at compile time. Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Tue Sep 30 17:19:07 2014 (r272315) +++ head/sys/netinet/in_mcast.c Tue Sep 30 17:26:34 2014 (r272316) @@ -2928,7 +2928,7 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A return (retval); } -#ifdef KTR +#if defined(KTR) && (KTR_COMPILE & KTR_IGMPV3) static const char *inm_modestrs[] = { "un", "in", "ex" }; @@ -3000,7 +3000,7 @@ inm_print(const struct in_multi *inm) printf("%s: --- end inm %p ---\n", __func__, inm); } -#else /* !KTR */ +#else /* !KTR || !(KTR_COMPILE & KTR_IGMPV3) */ void inm_print(const struct in_multi *inm) @@ -3008,6 +3008,6 @@ inm_print(const struct in_multi *inm) } -#endif /* KTR */ +#endif /* KTR && (KTR_COMPILE & KTR_IGMPV3) */ RB_GENERATE(ip_msource_tree, ip_msource, ims_link, ip_msource_cmp); From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 17:27:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F23293B; Tue, 30 Sep 2014 17:27:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B196D79; Tue, 30 Sep 2014 17:27: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 s8UHRvjD012478; Tue, 30 Sep 2014 17:27:57 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UHRvQu012477; Tue, 30 Sep 2014 17:27:57 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409301727.s8UHRvQu012477@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 30 Sep 2014 17:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272317 - head/sys/dev/xen/xenstore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 17:27:57 -0000 Author: royger Date: Tue Sep 30 17:27:56 2014 New Revision: 272317 URL: http://svnweb.freebsd.org/changeset/base/272317 Log: xen: defer xenstore initialization until xenstored is started The xenstore related devices in the kernel cannot be started until xenstored is running, which will happen later in the Dom0 case. If start_info_t doesn't contain a valid xenstore event channel, defer all xenstore related devices attachment to later. Sponsored by: Citrix Systems R&D dev/xen/xenstore/xenstore.c: - Prevent xenstore from trying to attach it's descendant devices if xenstore is not initialized. - Add a callback in the xenstore interrupt filter that will trigger the plug of xenstore descendant devices on the first received interrupt. This interrupt is generated when xenstored attaches to the event channel, and serves as a notification that xenstored is running. Modified: head/sys/dev/xen/xenstore/xenstore.c Modified: head/sys/dev/xen/xenstore/xenstore.c ============================================================================== --- head/sys/dev/xen/xenstore/xenstore.c Tue Sep 30 17:26:34 2014 (r272316) +++ head/sys/dev/xen/xenstore/xenstore.c Tue Sep 30 17:27:56 2014 (r272317) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include @@ -249,6 +251,20 @@ struct xs_softc { * with the XenStore service) are available. */ struct intr_config_hook xs_attachcb; + + /** + * Xenstore is a user-space process that usually runs in Dom0, + * so if this domain is booting as Dom0, xenstore wont we accessible, + * and we have to defer the initialization of xenstore related + * devices to later (when xenstore is started). + */ + bool initialized; + + /** + * Task to run when xenstore is initialized (Dom0 only), will + * take care of attaching xenstore related devices. + */ + struct task xs_late_init; }; /*-------------------------------- Global Data ------------------------------*/ @@ -352,6 +368,16 @@ static void xs_intr(void * arg __unused /*__attribute__((unused))*/) { + /* If xenstore has not been initialized, initialize it now */ + if (!xs.initialized) { + xs.initialized = true; + /* + * Since this task is probing and attaching devices we + * have to hold the Giant lock. + */ + taskqueue_enqueue(taskqueue_swi_giant, &xs.xs_late_init); + } + /* * Hold ring lock across wakeup so that clients * cannot miss a wakeup. @@ -1112,6 +1138,15 @@ xs_attach_deferred(void *arg) config_intrhook_disestablish(&xs.xs_attachcb); } +static void +xs_attach_late(void *arg, int pending) +{ + + KASSERT((pending == 1), ("xs late attach queued several times")); + bus_generic_probe(xs.xs_dev); + bus_generic_attach(xs.xs_dev); +} + /** * Attach to the XenStore. * @@ -1130,12 +1165,37 @@ xs_attach(device_t dev) /* Initialize the interface to xenstore. */ struct proc *p; + xs.initialized = false; if (xen_hvm_domain()) { xs.evtchn = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN); xs.gpfn = hvm_get_parameter(HVM_PARAM_STORE_PFN); xen_store = pmap_mapdev(xs.gpfn * PAGE_SIZE, PAGE_SIZE); + xs.initialized = true; } else if (xen_pv_domain()) { - xs.evtchn = HYPERVISOR_start_info->store_evtchn; + if (HYPERVISOR_start_info->store_evtchn == 0) { + struct evtchn_alloc_unbound alloc_unbound; + + /* Allocate a local event channel for xenstore */ + alloc_unbound.dom = DOMID_SELF; + alloc_unbound.remote_dom = DOMID_SELF; + error = HYPERVISOR_event_channel_op( + EVTCHNOP_alloc_unbound, &alloc_unbound); + if (error != 0) + panic( + "unable to alloc event channel for Dom0: %d", + error); + + HYPERVISOR_start_info->store_evtchn = + alloc_unbound.port; + xs.evtchn = alloc_unbound.port; + + /* Allocate memory for the xs shared ring */ + xen_store = malloc(PAGE_SIZE, M_XENSTORE, + M_WAITOK | M_ZERO); + } else { + xs.evtchn = HYPERVISOR_start_info->store_evtchn; + xs.initialized = true; + } } else { panic("Unknown domain type, cannot initialize xenstore."); } @@ -1167,7 +1227,11 @@ xs_attach(device_t dev) xs.xs_attachcb.ich_func = xs_attach_deferred; xs.xs_attachcb.ich_arg = NULL; - config_intrhook_establish(&xs.xs_attachcb); + if (xs.initialized) { + config_intrhook_establish(&xs.xs_attachcb); + } else { + TASK_INIT(&xs.xs_late_init, 0, xs_attach_late, NULL); + } return (error); } From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 17:31:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76708B55; Tue, 30 Sep 2014 17: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 6243DE2C; Tue, 30 Sep 2014 17: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 s8UHV5lR015777; Tue, 30 Sep 2014 17:31:05 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UHV4oQ015773; Tue, 30 Sep 2014 17:31:04 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409301731.s8UHV4oQ015773@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 30 Sep 2014 17:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272318 - in head/sys: dev/xen/xenstore xen/xenstore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 17:31:05 -0000 Author: royger Date: Tue Sep 30 17:31:04 2014 New Revision: 272318 URL: http://svnweb.freebsd.org/changeset/base/272318 Log: xen: convert the xenstore user-space char device to a newbus device Convert the xenstore user-space device (/dev/xen/xenstore) to a device using the newbus interface. This allows us to make the device initialization dependant on the initialization of xenstore itself in the kernel. Sponsored by: Citrix Systems R&D dev/xen/xenstore/xenstore.c: - Convert to a newbus device, this removes the xs_dev_init function. xen/xenstore/xenstore_internal.h: - Remove xs_dev_init prototype. dev/xen/xenstore/xenstore.c: - Don't call xs_dev_init anymore, the device will attach itself when xenstore is started. Modified: head/sys/dev/xen/xenstore/xenstore.c head/sys/dev/xen/xenstore/xenstore_dev.c head/sys/xen/xenstore/xenstore_internal.h Modified: head/sys/dev/xen/xenstore/xenstore.c ============================================================================== --- head/sys/dev/xen/xenstore/xenstore.c Tue Sep 30 17:27:56 2014 (r272317) +++ head/sys/dev/xen/xenstore/xenstore.c Tue Sep 30 17:31:04 2014 (r272318) @@ -1130,7 +1130,6 @@ xs_probe(device_t dev) static void xs_attach_deferred(void *arg) { - xs_dev_init(); bus_generic_probe(xs.xs_dev); bus_generic_attach(xs.xs_dev); Modified: head/sys/dev/xen/xenstore/xenstore_dev.c ============================================================================== --- head/sys/dev/xen/xenstore/xenstore_dev.c Tue Sep 30 17:27:56 2014 (r272317) +++ head/sys/dev/xen/xenstore/xenstore_dev.c Tue Sep 30 17:31:04 2014 (r272318) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -216,9 +217,71 @@ static struct cdevsw xs_dev_cdevsw = { .d_name = "xs_dev", }; -void -xs_dev_init() +/*------------------ Private Device Attachment Functions --------------------*/ +/** + * \brief Identify instances of this device type in the system. + * + * \param driver The driver performing this identify action. + * \param parent The NewBus parent device for any devices this method adds. + */ +static void +xs_dev_identify(driver_t *driver __unused, device_t parent) +{ + /* + * A single device instance for our driver is always present + * in a system operating under Xen. + */ + BUS_ADD_CHILD(parent, 0, driver->name, 0); +} + +/** + * \brief Probe for the existance of the Xenstore device + * + * \param dev NewBus device_t for this instance. + * + * \return Always returns 0 indicating success. + */ +static int +xs_dev_probe(device_t dev) +{ + + device_set_desc(dev, "Xenstore user-space device"); + return (0); +} + +/** + * \brief Attach the Xenstore device. + * + * \param dev NewBus device_t for this instance. + * + * \return On success, 0. Otherwise an errno value indicating the + * type of failure. + */ +static int +xs_dev_attach(device_t dev) { - make_dev(&xs_dev_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400, + struct cdev *xs_cdev; + + xs_cdev = make_dev(&xs_dev_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400, "xen/xenstore"); + if (xs_cdev == NULL) + return (EINVAL); + + return (0); } + +/*-------------------- Private Device Attachment Data -----------------------*/ +static device_method_t xs_dev_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, xs_dev_identify), + DEVMETHOD(device_probe, xs_dev_probe), + DEVMETHOD(device_attach, xs_dev_attach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(xs_dev, xs_dev_driver, xs_dev_methods, 0); +devclass_t xs_dev_devclass; + +DRIVER_MODULE(xs_dev, xenstore, xs_dev_driver, xs_dev_devclass, + NULL, NULL); Modified: head/sys/xen/xenstore/xenstore_internal.h ============================================================================== --- head/sys/xen/xenstore/xenstore_internal.h Tue Sep 30 17:27:56 2014 (r272317) +++ head/sys/xen/xenstore/xenstore_internal.h Tue Sep 30 17:31:04 2014 (r272318) @@ -32,8 +32,5 @@ * $FreeBSD$ */ -/* Initialize support for userspace access to the XenStore. */ -void xs_dev_init(void); - /* Used by the XenStore character device to borrow kernel's store connection. */ int xs_dev_request_and_reply(struct xsd_sockmsg *msg, void **result); From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 17:37:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DCE1E37; Tue, 30 Sep 2014 17:37:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 296B6E80; Tue, 30 Sep 2014 17:37: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 s8UHbQL9017192; Tue, 30 Sep 2014 17:37:26 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UHbQXL017190; Tue, 30 Sep 2014 17:37:26 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409301737.s8UHbQXL017190@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 30 Sep 2014 17:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272319 - in head/sys: conf dev/xen/xenstore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 17:37:27 -0000 Author: royger Date: Tue Sep 30 17:37:26 2014 New Revision: 272319 URL: http://svnweb.freebsd.org/changeset/base/272319 Log: xen: add xenstored user-space device This device is used by the user-space daemon that runs xenstore (xenstored). It allows xenstored to map the xenstore memory page, and reports the event channel xenstore is using. Sponsored by: Citrix Systems R&D dev/xen/xenstore/xenstored_dev.c: - Add the xenstored character device that's used to map the xenstore memory into user-space, and to report the event channel used by xenstore. conf/files: - Add the device to the build process. Added: head/sys/dev/xen/xenstore/xenstored_dev.c (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 30 17:31:04 2014 (r272318) +++ head/sys/conf/files Tue Sep 30 17:37:26 2014 (r272319) @@ -2640,6 +2640,7 @@ dev/xen/timer/timer.c optional xen | xe dev/xen/pvcpu/pvcpu.c optional xen | xenhvm dev/xen/xenstore/xenstore.c optional xen | xenhvm dev/xen/xenstore/xenstore_dev.c optional xen | xenhvm +dev/xen/xenstore/xenstored_dev.c optional xen | xenhvm dev/xl/if_xl.c optional xl pci dev/xl/xlphy.c optional xl pci fs/autofs/autofs.c optional autofs Added: head/sys/dev/xen/xenstore/xenstored_dev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xen/xenstore/xenstored_dev.c Tue Sep 30 17:37:26 2014 (r272319) @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2014 Roger Pau Monné + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include + +#define XSD_READ_SIZE 20 + +static int xsd_dev_read(struct cdev *dev, struct uio *uio, int ioflag); +static int xsd_dev_mmap(struct cdev *dev, vm_ooffset_t offset, + vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr); + + +static struct cdevsw xsd_dev_cdevsw = { + .d_version = D_VERSION, + .d_read = xsd_dev_read, + .d_mmap = xsd_dev_mmap, + .d_name = "xsd_dev", +}; + +static int +xsd_dev_read(struct cdev *dev, struct uio *uio, int ioflag) +{ + char evtchn[XSD_READ_SIZE]; + int error, len; + + len = snprintf(evtchn, sizeof(evtchn), "%u", + HYPERVISOR_start_info->store_evtchn); + if (len < 0 || len > uio->uio_resid) + return (EINVAL); + + error = uiomove(evtchn, len, uio); + if (error) + return (error); + + return (0); +} + +static int +xsd_dev_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) +{ + + if (offset != 0) + return (EINVAL); + + *paddr = pmap_kextract((vm_offset_t)xen_store); + + return (0); +} + +/*------------------ Private Device Attachment Functions --------------------*/ +/** + * \brief Identify instances of this device type in the system. + * + * \param driver The driver performing this identify action. + * \param parent The NewBus parent device for any devices this method adds. + */ +static void +xsd_dev_identify(driver_t *driver __unused, device_t parent) +{ + + if (!xen_pv_domain()) + return; + if (HYPERVISOR_start_info->store_mfn != 0) + return; + + /* + * Only attach if xenstore is not available, because we are the + * domain that's supposed to run it. + */ + BUS_ADD_CHILD(parent, 0, driver->name, 0); +} + +/** + * \brief Probe for the existence of the Xenstored device + * + * \param dev NewBus device_t for this instance. + * + * \return Always returns 0 indicating success. + */ +static int +xsd_dev_probe(device_t dev) +{ + + device_set_desc(dev, "Xenstored user-space device"); + return (BUS_PROBE_NOWILDCARD); +} + +/** + * \brief Attach the Xenstored device. + * + * \param dev NewBus device_t for this instance. + * + * \return On success, 0. Otherwise an errno value indicating the + * type of failure. + */ +static int +xsd_dev_attach(device_t dev) +{ + struct cdev *xsd_cdev; + + xsd_cdev = make_dev(&xsd_dev_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400, + "xen/xenstored"); + if (xsd_cdev == NULL) + return (EINVAL); + + return (0); +} + +/*-------------------- Private Device Attachment Data -----------------------*/ +static device_method_t xsd_dev_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, xsd_dev_identify), + DEVMETHOD(device_probe, xsd_dev_probe), + DEVMETHOD(device_attach, xsd_dev_attach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(xsd_dev, xsd_dev_driver, xsd_dev_methods, 0); +devclass_t xsd_dev_devclass; + +DRIVER_MODULE(xsd_dev, xenpv, xsd_dev_driver, xsd_dev_devclass, + NULL, NULL); From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 17:38:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B0DAF81; Tue, 30 Sep 2014 17:38:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27CDBE89; Tue, 30 Sep 2014 17:38: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 s8UHcM6Y017353; Tue, 30 Sep 2014 17:38:22 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UHcMmB017352; Tue, 30 Sep 2014 17:38:22 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409301738.s8UHcMmB017352@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 30 Sep 2014 17:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272320 - head/sys/dev/xen/balloon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 17:38:22 -0000 Author: royger Date: Tue Sep 30 17:38:21 2014 New Revision: 272320 URL: http://svnweb.freebsd.org/changeset/base/272320 Log: xen/balloon: fix accounting of current memory pages on PVH Using realmem on PVH is not realiable, since in this case the realmem value is computed from Maxmem, which contains the higher memory address found. Use HYPERVISOR_start_info->nr_pages instead, which is set by the hypervisor and contains the exact number of memory pages assigned to the domain. Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/balloon/balloon.c Modified: head/sys/dev/xen/balloon/balloon.c ============================================================================== --- head/sys/dev/xen/balloon/balloon.c Tue Sep 30 17:37:26 2014 (r272319) +++ head/sys/dev/xen/balloon/balloon.c Tue Sep 30 17:38:21 2014 (r272320) @@ -405,7 +405,8 @@ xenballoon_attach(device_t dev) #ifndef XENHVM bs.current_pages = min(xen_start_info->nr_pages, max_pfn); #else - bs.current_pages = realmem; + bs.current_pages = xen_pv_domain() ? + HYPERVISOR_start_info->nr_pages : realmem; #endif bs.target_pages = bs.current_pages; bs.balloon_low = 0; From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 17:41:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46243295; Tue, 30 Sep 2014 17:41:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31939EAD; Tue, 30 Sep 2014 17:41: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 s8UHfGNo018811; Tue, 30 Sep 2014 17:41:16 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UHfG6k018810; Tue, 30 Sep 2014 17:41:16 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409301741.s8UHfG6k018810@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 30 Sep 2014 17:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272321 - head/sys/dev/xen/blkback X-SVN-Group: head MIME-Version: 1.0 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, 30 Sep 2014 17:41:17 -0000 Author: royger Date: Tue Sep 30 17:41:16 2014 New Revision: 272321 URL: http://svnweb.freebsd.org/changeset/base/272321 Log: xen: fix blkback pushing responses before releasing internal resources Fix a problem where the blockback driver could run out of requests, despite the fact that we allocate enough request and reqlist structures to satisfy the maximum possible number of requests. The problem was that we were sending responses back to the other end (blockfront) before freeing resources. The Citrix Windows driver is pretty agressive about queueing, and would queue more I/O to us immediately after we sent responses to it. We would run into a resource shortage and stall out I/O until we freed resources. It isn't clear whether the request shortage condition was an indirect cause of the I/O hangs we've been seeing between Windows with the Citrix PV drivers and FreeBSD's blockback, but the above problem is certainly a bug. Sponsored by: Spectra Logic Submitted by: ken Reviewed by: royger dev/xen/blkback/blkback.c: - Break xbb_send_response() into two sub-functions, xbb_queue_response() and xbb_push_responses(). Remove xbb_send_response(), because it is no longer used. - Adjust xbb_complete_reqlist() so that it calls the two new functions, and holds the mutex around both calls. The mutex insures that another context can't come along and push responses before we've freed our resources. - Change xbb_release_reqlist() so that it requires the mutex to be held instead of acquiring the mutex itself. Both callers could easily hold the mutex while calling it, and one really needs to hold the mutex during the call. - Add two new counters, accessible via sysctl variables. The first one counts the number of I/Os that are queued and waiting to be pushed (reqs_queued_for_completion). The second one (reqs_completed_with_error) counts the number of requests we've completed with an error status. Modified: head/sys/dev/xen/blkback/blkback.c Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Tue Sep 30 17:38:21 2014 (r272320) +++ head/sys/dev/xen/blkback/blkback.c Tue Sep 30 17:41:16 2014 (r272321) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2011 Spectra Logic Corporation + * Copyright (c) 2009-2012 Spectra Logic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -784,6 +784,12 @@ struct xbb_softc { /** Number of requests we have completed*/ uint64_t reqs_completed; + /** Number of requests we queued but not pushed*/ + uint64_t reqs_queued_for_completion; + + /** Number of requests we completed with an error status*/ + uint64_t reqs_completed_with_error; + /** How many forced dispatches (i.e. without coalescing) have happend */ uint64_t forced_dispatch; @@ -1143,7 +1149,7 @@ xbb_release_reqlist(struct xbb_softc *xb int wakeup) { - mtx_lock(&xbb->lock); + mtx_assert(&xbb->lock, MA_OWNED); if (wakeup) { wakeup = xbb->flags & XBBF_RESOURCE_SHORTAGE; @@ -1167,8 +1173,6 @@ xbb_release_reqlist(struct xbb_softc *xb xbb_shutdown(xbb); } - mtx_unlock(&xbb->lock); - if (wakeup != 0) taskqueue_enqueue(xbb->io_taskqueue, &xbb->io_task); } @@ -1261,16 +1265,16 @@ bailout_error: if (nreq != NULL) xbb_release_req(xbb, nreq); - mtx_unlock(&xbb->lock); - if (nreqlist != NULL) xbb_release_reqlist(xbb, nreqlist, /*wakeup*/ 0); + mtx_unlock(&xbb->lock); + return (1); } /** - * Create and transmit a response to a blkif request. + * Create and queue a response to a blkif request. * * \param xbb Per-instance xbb configuration structure. * \param req The request structure to which to respond. @@ -1278,20 +1282,28 @@ bailout_error: * in sys/xen/interface/io/blkif.h. */ static void -xbb_send_response(struct xbb_softc *xbb, struct xbb_xen_req *req, int status) +xbb_queue_response(struct xbb_softc *xbb, struct xbb_xen_req *req, int status) { blkif_response_t *resp; - int more_to_do; - int notify; - more_to_do = 0; + /* + * The mutex is required here, and should be held across this call + * until after the subsequent call to xbb_push_responses(). This + * is to guarantee that another context won't queue responses and + * push them while we're active. + * + * That could lead to the other end being notified of responses + * before the resources have been freed on this end. The other end + * would then be able to queue additional I/O, and we may run out + * of resources because we haven't freed them all yet. + */ + mtx_assert(&xbb->lock, MA_OWNED); /* * Place on the response ring for the relevant domain. * For now, only the spacing between entries is different * in the different ABIs, not the response entry layout. */ - mtx_lock(&xbb->lock); switch (xbb->abi) { case BLKIF_PROTOCOL_NATIVE: resp = RING_GET_RESPONSE(&xbb->rings.native, @@ -1315,8 +1327,38 @@ xbb_send_response(struct xbb_softc *xbb, resp->operation = req->operation; resp->status = status; + if (status != BLKIF_RSP_OKAY) + xbb->reqs_completed_with_error++; + xbb->rings.common.rsp_prod_pvt += BLKIF_SEGS_TO_BLOCKS(req->nr_pages); - RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&xbb->rings.common, notify); + + xbb->reqs_queued_for_completion++; + +} + +/** + * Send queued responses to blkif requests. + * + * \param xbb Per-instance xbb configuration structure. + * \param run_taskqueue Flag that is set to 1 if the taskqueue + * should be run, 0 if it does not need to be run. + * \param notify Flag that is set to 1 if the other end should be + * notified via irq, 0 if the other end should not be + * notified. + */ +static void +xbb_push_responses(struct xbb_softc *xbb, int *run_taskqueue, int *notify) +{ + int more_to_do; + + /* + * The mutex is required here. + */ + mtx_assert(&xbb->lock, MA_OWNED); + + more_to_do = 0; + + RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&xbb->rings.common, *notify); if (xbb->rings.common.rsp_prod_pvt == xbb->rings.common.req_cons) { @@ -1331,15 +1373,10 @@ xbb_send_response(struct xbb_softc *xbb, more_to_do = 1; } - xbb->reqs_completed++; + xbb->reqs_completed += xbb->reqs_queued_for_completion; + xbb->reqs_queued_for_completion = 0; - mtx_unlock(&xbb->lock); - - if (more_to_do) - taskqueue_enqueue(xbb->io_taskqueue, &xbb->io_task); - - if (notify) - xen_intr_signal(xbb->xen_intr_handle); + *run_taskqueue = more_to_do; } /** @@ -1353,23 +1390,29 @@ xbb_complete_reqlist(struct xbb_softc *x { struct xbb_xen_req *nreq; off_t sectors_sent; + int notify, run_taskqueue; sectors_sent = 0; if (reqlist->flags & XBB_REQLIST_MAPPED) xbb_unmap_reqlist(reqlist); + mtx_lock(&xbb->lock); + /* - * All I/O is done, send the response. A lock should not be - * necessary here because the request list is complete, and - * therefore this is the only context accessing this request - * right now. The functions we call do their own locking if - * necessary. + * All I/O is done, send the response. A lock is not necessary + * to protect the request list, because all requests have + * completed. Therefore this is the only context accessing this + * reqlist right now. However, in order to make sure that no one + * else queues responses onto the queue or pushes them to the other + * side while we're active, we need to hold the lock across the + * calls to xbb_queue_response() and xbb_push_responses(). */ STAILQ_FOREACH(nreq, &reqlist->contig_req_list, links) { off_t cur_sectors_sent; - xbb_send_response(xbb, nreq, reqlist->status); + /* Put this response on the ring, but don't push yet */ + xbb_queue_response(xbb, nreq, reqlist->status); /* We don't report bytes sent if there is an error. */ if (reqlist->status == BLKIF_RSP_OKAY) @@ -1404,6 +1447,16 @@ xbb_complete_reqlist(struct xbb_softc *x /*then*/&reqlist->ds_t0); xbb_release_reqlist(xbb, reqlist, /*wakeup*/ 1); + + xbb_push_responses(xbb, &run_taskqueue, ¬ify); + + mtx_unlock(&xbb->lock); + + if (run_taskqueue) + taskqueue_enqueue(xbb->io_taskqueue, &xbb->io_task); + + if (notify) + xen_intr_signal(xbb->xen_intr_handle); } /** @@ -3589,6 +3642,16 @@ xbb_setup_sysctl(struct xbb_softc *xbb) "how many I/O requests have been completed"); SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "reqs_queued_for_completion", CTLFLAG_RW, + &xbb->reqs_queued_for_completion, + "how many I/O requests queued but not yet pushed"); + + SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "reqs_completed_with_error", CTLFLAG_RW, + &xbb->reqs_completed_with_error, + "how many I/O requests completed with error status"); + + SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "forced_dispatch", CTLFLAG_RW, &xbb->forced_dispatch, "how many I/O dispatches were forced"); From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 18:17:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D59561F7; Tue, 30 Sep 2014 18:17: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 C209F385; Tue, 30 Sep 2014 18:17: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 s8UIHTgR036421; Tue, 30 Sep 2014 18:17:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UIHTAf036419; Tue, 30 Sep 2014 18:17:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409301817.s8UIHTAf036419@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 30 Sep 2014 18:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272323 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 30 Sep 2014 18:17:29 -0000 Author: tuexen Date: Tue Sep 30 18:17:28 2014 New Revision: 272323 URL: http://svnweb.freebsd.org/changeset/base/272323 Log: If the checksum coverage field in the UDPLITE header is the length of the complete UDPLITE packet, the packet has full checksum coverage. SO fix the condition. Reviewed by: kevlo MFC after: 3 days Modified: head/sys/netinet/udp_usrreq.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue Sep 30 17:54:57 2014 (r272322) +++ head/sys/netinet/udp_usrreq.c Tue Sep 30 18:17:28 2014 (r272323) @@ -444,9 +444,10 @@ udp_input(struct mbuf **mp, int *offp, i */ len = ntohs((u_short)uh->uh_ulen); ip_len = ntohs(ip->ip_len) - iphlen; - if (proto == IPPROTO_UDPLITE && len == 0) { + if (proto == IPPROTO_UDPLITE && (len == 0 || len == ip_len)) { /* Zero means checksum over the complete packet. */ - len = ip_len; + if (len == 0) + len = ip_len; cscov_partial = 0; } if (ip_len != len) { Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Tue Sep 30 17:54:57 2014 (r272322) +++ head/sys/netinet6/udp6_usrreq.c Tue Sep 30 18:17:28 2014 (r272323) @@ -227,9 +227,10 @@ udp6_input(struct mbuf **mp, int *offp, nxt = ip6->ip6_nxt; cscov_partial = (nxt == IPPROTO_UDPLITE) ? 1 : 0; - if (nxt == IPPROTO_UDPLITE && ulen == 0) { + if (nxt == IPPROTO_UDPLITE && (ulen == 0 || ulen == plen)) { /* Zero means checksum over the complete packet. */ - ulen = plen; + if (ulen == 0) + ulen = plen; cscov_partial = 0; } if (nxt == IPPROTO_UDP && plen != ulen) { From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 18:50:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 736D1D1C; Tue, 30 Sep 2014 18:50: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 5F6429B0; Tue, 30 Sep 2014 18:50: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 s8UIokk4051152; Tue, 30 Sep 2014 18:50:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UIokXo051151; Tue, 30 Sep 2014 18:50:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409301850.s8UIokXo051151@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 30 Sep 2014 18:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272324 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 18:50:46 -0000 Author: delphij Date: Tue Sep 30 18:50:45 2014 New Revision: 272324 URL: http://svnweb.freebsd.org/changeset/base/272324 Log: Fix a mismerge in r260183 which prevents snapshot zvol devices being removed and re-instate the fix in r242862. Reported by: Leon Dang , smh MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 30 18:17:28 2014 (r272323) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 30 18:50:45 2014 (r272324) @@ -3550,7 +3550,12 @@ zfs_ioc_destroy_snaps(const char *poolna for (pair = nvlist_next_nvpair(snaps, NULL); pair != NULL; pair = nvlist_next_nvpair(snaps, pair)) { - (void) zfs_unmount_snap(nvpair_name(pair)); + const char *name = nvpair_name(pair); + + (void) zfs_unmount_snap(name); +#if defined(__FreeBSD__) + (void) zvol_remove_minor(name); +#endif } return (dsl_destroy_snapshots_nvl(snaps, defer, outnvl)); @@ -3644,7 +3649,6 @@ zfs_ioc_destroy_bookmarks(const char *po if (strncmp(name, poolname, poollen) != 0 || (name[poollen] != '/' && name[poollen] != '#')) return (SET_ERROR(EXDEV)); - (void) zvol_remove_minor(name); } error = dsl_bookmark_destroy(innvl, outnvl); From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 20:18:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57A2BE99; Tue, 30 Sep 2014 20:18: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 43679785; Tue, 30 Sep 2014 20:18: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 s8UKIDMR093734; Tue, 30 Sep 2014 20:18:13 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UKIA8W093720; Tue, 30 Sep 2014 20:18:10 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201409302018.s8UKIA8W093720@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 30 Sep 2014 20:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272325 - in head/sys/dev/sfxge: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 30 Sep 2014 20:18:13 -0000 Author: gnn Date: Tue Sep 30 20:18:10 2014 New Revision: 272325 URL: http://svnweb.freebsd.org/changeset/base/272325 Log: cleanup: code style fixes Remove trailing whitespaces and tabs. Enclose value in return statements in parentheses. Use tabs after #define. Do not skip comparison with 0/NULL in boolean expressions. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/sfxge.c head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_dma.c head/sys/dev/sfxge/sfxge_ev.c head/sys/dev/sfxge/sfxge_intr.c head/sys/dev/sfxge/sfxge_port.c head/sys/dev/sfxge/sfxge_rx.c head/sys/dev/sfxge/sfxge_rx.h head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/sfxge/sfxge_tx.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Tue Sep 30 18:50:45 2014 (r272324) +++ head/sys/dev/sfxge/common/efsys.h Tue Sep 30 20:18:10 2014 (r272325) @@ -53,44 +53,44 @@ extern "C" { #define EFSYS_HAS_UINT64 1 #define EFSYS_USE_UINT64 0 #if _BYTE_ORDER == _BIG_ENDIAN -#define EFSYS_IS_BIG_ENDIAN 1 -#define EFSYS_IS_LITTLE_ENDIAN 0 +#define EFSYS_IS_BIG_ENDIAN 1 +#define EFSYS_IS_LITTLE_ENDIAN 0 #elif _BYTE_ORDER == _LITTLE_ENDIAN -#define EFSYS_IS_BIG_ENDIAN 0 -#define EFSYS_IS_LITTLE_ENDIAN 1 +#define EFSYS_IS_BIG_ENDIAN 0 +#define EFSYS_IS_LITTLE_ENDIAN 1 #endif #include "efx_types.h" /* Common code requires this */ #if __FreeBSD_version < 800068 -#define memmove(d, s, l) bcopy(s, d, l) +#define memmove(d, s, l) bcopy(s, d, l) #endif - + /* FreeBSD equivalents of Solaris things */ #ifndef _NOTE -#define _NOTE(s) +#define _NOTE(s) #endif #ifndef B_FALSE -#define B_FALSE FALSE +#define B_FALSE FALSE #endif #ifndef B_TRUE -#define B_TRUE TRUE +#define B_TRUE TRUE #endif #ifndef IS_P2ALIGNED -#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0) +#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0) #endif #ifndef P2ROUNDUP -#define P2ROUNDUP(x, align) (-(-(x) & -(align))) +#define P2ROUNDUP(x, align) (-(-(x) & -(align))) #endif #ifndef IS2P -#define ISP2(x) (((x) & ((x) - 1)) == 0) +#define ISP2(x) (((x) & ((x) - 1)) == 0) #endif -#define ENOTACTIVE EINVAL +#define ENOTACTIVE EINVAL /* Memory type to use on FreeBSD */ MALLOC_DECLARE(M_SFXGE); @@ -242,7 +242,7 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_PHY_PROPS 0 #define EFSYS_OPT_PHY_BIST 1 #define EFSYS_OPT_PHY_LED_CONTROL 1 -#define EFSYS_OPT_PHY_FLAGS 0 +#define EFSYS_OPT_PHY_FLAGS 0 #define EFSYS_OPT_VPD 1 #define EFSYS_OPT_NVRAM 1 @@ -256,8 +256,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_WOL 1 #define EFSYS_OPT_RX_SCALE 1 #define EFSYS_OPT_QSTATS 1 -#define EFSYS_OPT_FILTER 0 -#define EFSYS_OPT_RX_SCATTER 0 +#define EFSYS_OPT_FILTER 0 +#define EFSYS_OPT_RX_SCATTER 0 #define EFSYS_OPT_RX_HDR_SPLIT 0 #define EFSYS_OPT_EV_PREFETCH 0 @@ -272,7 +272,7 @@ typedef struct __efsys_identifier_s efsy #ifndef DTRACE_PROBE -#define EFSYS_PROBE(_name) +#define EFSYS_PROBE(_name) #define EFSYS_PROBE1(_name, _type1, _arg1) @@ -815,16 +815,16 @@ extern void sfxge_err(efsys_identifier_t panic(#_exp); \ } while (0) -#define EFSYS_ASSERT3(_x, _op, _y, _t) do { \ +#define EFSYS_ASSERT3(_x, _op, _y, _t) do { \ const _t __x = (_t)(_x); \ const _t __y = (_t)(_y); \ if (!(__x _op __y)) \ - panic("assertion failed at %s:%u", __FILE__, __LINE__); \ + panic("assertion failed at %s:%u", __FILE__, __LINE__); \ } while(0) -#define EFSYS_ASSERT3U(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uint64_t) -#define EFSYS_ASSERT3S(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, int64_t) -#define EFSYS_ASSERT3P(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uintptr_t) +#define EFSYS_ASSERT3U(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uint64_t) +#define EFSYS_ASSERT3S(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, int64_t) +#define EFSYS_ASSERT3P(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uintptr_t) #ifdef __cplusplus } Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Tue Sep 30 18:50:45 2014 (r272324) +++ head/sys/dev/sfxge/sfxge.c Tue Sep 30 20:18:10 2014 (r272325) @@ -57,12 +57,12 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" #include "sfxge_rx.h" -#define SFXGE_CAP (IFCAP_VLAN_MTU | \ +#define SFXGE_CAP (IFCAP_VLAN_MTU | \ IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | \ IFCAP_JUMBO_MTU | IFCAP_LRO | \ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE) -#define SFXGE_CAP_ENABLE SFXGE_CAP -#define SFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | \ +#define SFXGE_CAP_ENABLE SFXGE_CAP +#define SFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | \ IFCAP_JUMBO_MTU | IFCAP_LINKSTATE) MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver"); @@ -78,7 +78,7 @@ sfxge_start(struct sfxge_softc *sc) sx_assert(&sc->softc_lock, LA_XLOCKED); if (sc->init_state == SFXGE_STARTED) - return 0; + return (0); if (sc->init_state != SFXGE_REGISTERED) { rc = EINVAL; @@ -223,7 +223,7 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign ifp->if_mtu = ifr->ifr_mtu; error = sfxge_start(sc); sx_xunlock(&sc->softc_lock); - if (error) { + if (error != 0) { ifp->if_flags &= ~IFF_UP; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; if_down(ifp); @@ -287,7 +287,7 @@ sfxge_ifnet_fini(struct ifnet *ifp) if_free(ifp); } -static int +static int sfxge_ifnet_init(struct ifnet *ifp, struct sfxge_softc *sc) { const efx_nic_cfg_t *encp = efx_nic_cfg_get(sc->enp); @@ -324,11 +324,11 @@ sfxge_ifnet_init(struct ifnet *ifp, stru if ((rc = sfxge_port_ifmedia_init(sc)) != 0) goto fail; - return 0; + return (0); fail: ether_ifdetach(sc->ifnet); - return rc; + return (rc); } void @@ -347,7 +347,7 @@ sfxge_bar_init(struct sfxge_softc *sc) { efsys_bar_t *esbp = &sc->bar; - esbp->esb_rid = PCIR_BAR(EFX_MEM_BAR); + esbp->esb_rid = PCIR_BAR(EFX_MEM_BAR); if ((esbp->esb_res = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &esbp->esb_rid, RF_ACTIVE)) == NULL) { device_printf(sc->dev, "Cannot allocate BAR region %d\n", @@ -386,7 +386,7 @@ sfxge_create(struct sfxge_softc *sc) device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "stats", CTLFLAG_RD, NULL, "Statistics"); - if (!sc->stats_node) { + if (sc->stats_node == NULL) { error = ENOMEM; goto fail; } @@ -554,14 +554,14 @@ sfxge_vpd_handler(SYSCTL_HANDLER_ARGS) struct sfxge_softc *sc = arg1; efx_vpd_value_t value; int rc; - + value.evv_tag = arg2 >> 16; value.evv_keyword = arg2 & 0xffff; if ((rc = efx_vpd_get(sc->enp, sc->vpd_data, sc->vpd_size, &value)) != 0) - return rc; + return (rc); - return SYSCTL_OUT(req, value.evv_value, value.evv_length); + return (SYSCTL_OUT(req, value.evv_value, value.evv_length)); } static void @@ -623,12 +623,12 @@ sfxge_vpd_init(struct sfxge_softc *sc) for (keyword[1] = 'A'; keyword[1] <= 'Z'; keyword[1]++) sfxge_vpd_try_add(sc, vpd_list, EFX_VPD_RO, keyword); - return 0; - + return (0); + fail2: free(sc->vpd_data, M_SFXGE); fail: - return rc; + return (rc); } static void @@ -745,12 +745,12 @@ sfxge_probe(device_t dev) pci_device_id = pci_get_device(dev); rc = efx_family(pci_vendor_id, pci_device_id, &family); - if (rc) - return ENXIO; + if (rc != 0) + return (ENXIO); KASSERT(family == EFX_FAMILY_SIENA, ("impossible controller family")); device_set_desc(dev, "Solarflare SFC9000 family"); - return 0; + return (0); } static device_method_t sfxge_methods[] = { Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Tue Sep 30 18:50:45 2014 (r272324) +++ head/sys/dev/sfxge/sfxge.h Tue Sep 30 20:18:10 2014 (r272325) @@ -30,7 +30,7 @@ */ #ifndef _SFXGE_H -#define _SFXGE_H +#define _SFXGE_H #include #include @@ -53,43 +53,43 @@ /* This should be right on most machines the driver will be used on, and * we needn't care too much about wasting a few KB per interface. */ -#define CACHE_LINE_SIZE 128 +#define CACHE_LINE_SIZE 128 #endif #ifndef IFCAP_LINKSTATE -#define IFCAP_LINKSTATE 0 +#define IFCAP_LINKSTATE 0 #endif #ifndef IFCAP_VLAN_HWTSO -#define IFCAP_VLAN_HWTSO 0 +#define IFCAP_VLAN_HWTSO 0 #endif #ifndef IFM_10G_T -#define IFM_10G_T IFM_UNKNOWN +#define IFM_10G_T IFM_UNKNOWN #endif #ifndef IFM_10G_KX4 -#define IFM_10G_KX4 IFM_10G_CX4 +#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 +#define SFXGE_HAVE_MQ #endif #if (__FreeBSD_version >= 800501 && __FreeBSD_version < 900000) || \ __FreeBSD_version >= 900003 -#define SFXGE_HAVE_DESCRIBE_INTR +#define SFXGE_HAVE_DESCRIBE_INTR #endif #ifdef IFM_ETH_RXPAUSE -#define SFXGE_HAVE_PAUSE_MEDIAOPTS +#define SFXGE_HAVE_PAUSE_MEDIAOPTS #endif #ifndef CTLTYPE_U64 -#define CTLTYPE_U64 CTLTYPE_QUAD +#define CTLTYPE_U64 CTLTYPE_QUAD #endif #include "sfxge_rx.h" #include "sfxge_tx.h" -#define SFXGE_IP_ALIGN 2 +#define SFXGE_IP_ALIGN 2 -#define SFXGE_ETHERTYPE_LOOPBACK 0x9000 /* Xerox loopback */ +#define SFXGE_ETHERTYPE_LOOPBACK 0x9000 /* Xerox loopback */ enum sfxge_evq_state { SFXGE_EVQ_UNINITIALIZED = 0, @@ -133,9 +133,9 @@ enum sfxge_intr_state { }; struct sfxge_intr_hdl { - int eih_rid; - void *eih_tag; - struct resource *eih_res; + int eih_rid; + void *eih_tag; + struct resource *eih_res; }; struct sfxge_intr { @@ -197,7 +197,7 @@ struct sfxge_softc { device_t dev; struct sx softc_lock; enum sfxge_softc_state init_state; - struct ifnet *ifnet; + struct ifnet *ifnet; unsigned int if_flags; struct sysctl_oid *stats_node; @@ -209,7 +209,7 @@ struct sfxge_softc { efx_nic_t *enp; struct mtx enp_lock; - bus_dma_tag_t parent_dma_tag; + bus_dma_tag_t parent_dma_tag; efsys_bar_t bar; struct sfxge_intr intr; @@ -243,8 +243,8 @@ struct sfxge_softc { #endif }; -#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN) -#define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING) +#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN) +#define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING) /* * From sfxge.c. @@ -299,6 +299,6 @@ extern void sfxge_mac_link_update(struct extern int sfxge_mac_filter_set(struct sfxge_softc *sc); extern int sfxge_port_ifmedia_init(struct sfxge_softc *sc); -#define SFXGE_MAX_MTU (9 * 1024) +#define SFXGE_MAX_MTU (9 * 1024) #endif /* _SFXGE_H */ Modified: head/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- head/sys/dev/sfxge/sfxge_dma.c Tue Sep 30 18:50:45 2014 (r272324) +++ head/sys/dev/sfxge/sfxge_dma.c Tue Sep 30 20:18:10 2014 (r272325) @@ -50,7 +50,7 @@ sfxge_dma_cb(void *arg, bus_dma_segment_ addr = arg; - if (error) { + if (error != 0) { *addr = 0; return; } @@ -82,7 +82,7 @@ retry: return (0); } #if defined(__i386__) || defined(__amd64__) - while (m && seg_count < maxsegs) { + while (m != NULL && seg_count < maxsegs) { /* * firmware doesn't like empty segments */ @@ -197,7 +197,7 @@ sfxge_dma_init(struct sfxge_softc *sc) BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lock, lockarg */ - &sc->parent_dma_tag)) { + &sc->parent_dma_tag) != 0) { device_printf(sc->dev, "Cannot allocate parent DMA tag\n"); return (ENOMEM); } Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Tue Sep 30 18:50:45 2014 (r272324) +++ head/sys/dev/sfxge/sfxge_ev.c Tue Sep 30 20:18:10 2014 (r272325) @@ -226,7 +226,7 @@ sfxge_get_txq_by_label(struct sfxge_evq KASSERT((evq->index == 0 && label < SFXGE_TXQ_NTYPES) || (label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label")); index = (evq->index == 0) ? label : (evq->index - 1 + SFXGE_TXQ_NTYPES); - return evq->sc->txq[index]; + return (evq->sc->txq[index]); } static boolean_t @@ -443,7 +443,7 @@ sfxge_ev_stat_handler(SYSCTL_HANDLER_ARG sfxge_ev_stat_update(sc); - return SYSCTL_OUT(req, &sc->ev_stats[id], sizeof(sc->ev_stats[id])); + return (SYSCTL_OUT(req, &sc->ev_stats[id], sizeof(sc->ev_stats[id]))); } static void @@ -493,7 +493,7 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARG sx_xlock(&sc->softc_lock); - if (req->newptr) { + if (req->newptr != NULL) { if ((error = SYSCTL_IN(req, &moderation, sizeof(moderation))) != 0) goto out; @@ -520,14 +520,14 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARG out: sx_xunlock(&sc->softc_lock); - return error; + return (error); } static boolean_t sfxge_ev_initialized(void *arg) { struct sfxge_evq *evq; - + evq = (struct sfxge_evq *)arg; KASSERT(evq->init_state == SFXGE_EVQ_STARTING, @@ -746,7 +746,7 @@ sfxge_ev_start(struct sfxge_softc *sc) /* Initialize the event module */ if ((rc = efx_ev_init(sc->enp)) != 0) - return rc; + return (rc); /* Start the event queues */ for (index = 0; index < intr->n_alloc; index++) { Modified: head/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- head/sys/dev/sfxge/sfxge_intr.c Tue Sep 30 18:50:45 2014 (r272324) +++ head/sys/dev/sfxge/sfxge_intr.c Tue Sep 30 20:18:10 2014 (r272325) @@ -70,19 +70,19 @@ sfxge_intr_line_filter(void *arg) ("intr->type != EFX_INTR_LINE")); if (intr->state != SFXGE_INTR_STARTED) - return FILTER_STRAY; + return (FILTER_STRAY); (void)efx_intr_status_line(enp, &fatal, &qmask); if (fatal) { (void) efx_intr_disable(enp); (void) efx_intr_fatal(enp); - return FILTER_HANDLED; + return (FILTER_HANDLED); } if (qmask != 0) { intr->zero_count = 0; - return FILTER_SCHEDULE_THREAD; + return (FILTER_SCHEDULE_THREAD); } /* SF bug 15783: If the function is not asserting its IRQ and @@ -97,13 +97,13 @@ sfxge_intr_line_filter(void *arg) if (intr->zero_count++ == 0) { if (evq->init_state == SFXGE_EVQ_STARTED) { if (efx_ev_qpending(evq->common, evq->read_ptr)) - return FILTER_SCHEDULE_THREAD; + return (FILTER_SCHEDULE_THREAD); efx_ev_qprime(evq->common, evq->read_ptr); - return FILTER_HANDLED; + return (FILTER_HANDLED); } } - return FILTER_STRAY; + return (FILTER_STRAY); } static void @@ -175,7 +175,7 @@ sfxge_intr_bus_enable(struct sfxge_softc default: KASSERT(0, ("Invalid interrupt type")); - return EINVAL; + return (EINVAL); } /* Try to add the handlers */ @@ -254,7 +254,7 @@ sfxge_intr_alloc(struct sfxge_softc *sc, table[i].eih_res = res; } - if (error) { + if (error != 0) { count = i - 1; for (i = 0; i < count; i++) bus_release_resource(dev, SYS_RES_IRQ, @@ -349,7 +349,7 @@ sfxge_intr_setup_msi(struct sfxge_softc if (count == 0) return (EINVAL); - if ((error = pci_alloc_msi(dev, &count)) != 0) + if ((error = pci_alloc_msi(dev, &count)) != 0) return (ENOMEM); /* Allocate interrupt handler. */ @@ -424,7 +424,7 @@ void sfxge_intr_stop(struct sfxge_softc *sc) { struct sfxge_intr *intr; - + intr = &sc->intr; KASSERT(intr->state == SFXGE_INTR_STARTED, Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Tue Sep 30 18:50:45 2014 (r272324) +++ head/sys/dev/sfxge/sfxge_port.c Tue Sep 30 20:18:10 2014 (r272325) @@ -74,7 +74,7 @@ sfxge_mac_stat_update(struct sfxge_softc /* Try to update the cached counters */ if ((rc = efx_mac_stats_update(sc->enp, esmp, - port->mac_stats.decode_buf, NULL)) != EAGAIN) + port->mac_stats.decode_buf, NULL)) != EAGAIN) goto out; DELAY(100); @@ -83,7 +83,7 @@ sfxge_mac_stat_update(struct sfxge_softc rc = ETIMEDOUT; out: mtx_unlock(&port->lock); - return rc; + return (rc); } static int @@ -94,11 +94,11 @@ sfxge_mac_stat_handler(SYSCTL_HANDLER_AR int rc; if ((rc = sfxge_mac_stat_update(sc)) != 0) - return rc; + return (rc); - return SYSCTL_OUT(req, + return (SYSCTL_OUT(req, (uint64_t *)sc->port.mac_stats.decode_buf + id, - sizeof(uint64_t)); + sizeof(uint64_t))); } static void @@ -130,9 +130,9 @@ sfxge_port_wanted_fc(struct sfxge_softc struct ifmedia_entry *ifm = sc->media.ifm_cur; if (ifm->ifm_media == (IFM_ETHER | IFM_AUTO)) - return EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE; - return ((ifm->ifm_media & IFM_ETH_RXPAUSE) ? EFX_FCNTL_RESPOND : 0) | - ((ifm->ifm_media & IFM_ETH_TXPAUSE) ? EFX_FCNTL_GENERATE : 0); + return (EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE); + return (((ifm->ifm_media & IFM_ETH_RXPAUSE) ? EFX_FCNTL_RESPOND : 0) | + ((ifm->ifm_media & IFM_ETH_TXPAUSE) ? EFX_FCNTL_GENERATE : 0)); } static unsigned int @@ -150,13 +150,13 @@ sfxge_port_link_fc_ifm(struct sfxge_soft static unsigned int sfxge_port_wanted_fc(struct sfxge_softc *sc) { - return sc->port.wanted_fc; + return (sc->port.wanted_fc); } static unsigned int sfxge_port_link_fc_ifm(struct sfxge_softc *sc) { - return 0; + return (0); } static int @@ -172,7 +172,7 @@ sfxge_port_wanted_fc_handler(SYSCTL_HAND mtx_lock(&port->lock); - if (req->newptr) { + if (req->newptr != NULL) { if ((error = SYSCTL_IN(req, &fcntl, sizeof(fcntl))) != 0) goto out; @@ -235,7 +235,7 @@ sfxge_mac_link_update(struct sfxge_softc { struct sfxge_port *port; int link_state; - + port = &sc->port; if (port->link_mode == mode) @@ -289,7 +289,7 @@ sfxge_mac_filter_set_locked(struct sfxge /* Set promisc-unicast and broadcast filter bits */ if ((rc = efx_mac_filter_set(enp, !!(ifp->if_flags & IFF_PROMISC), B_TRUE)) != 0) - return rc; + return (rc); /* Set multicast hash filter */ if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) { @@ -311,7 +311,7 @@ sfxge_mac_filter_set_locked(struct sfxge } if_maddr_runlock(ifp); } - return efx_mac_hash_set(enp, bucket); + return (efx_mac_hash_set(enp, bucket)); } int @@ -336,7 +336,7 @@ sfxge_mac_filter_set(struct sfxge_softc else rc = 0; mtx_unlock(&port->lock); - return rc; + return (rc); } void @@ -413,7 +413,7 @@ sfxge_port_start(struct sfxge_softc *sc) /* Update MAC stats by DMA every second */ if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, - 1000, B_FALSE)) != 0) + 1000, B_FALSE)) != 0) goto fail2; if ((rc = efx_mac_drain(enp, B_FALSE)) != 0) @@ -435,7 +435,7 @@ fail4: (void)efx_mac_drain(enp, B_TRUE); fail3: (void)efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, - 0, B_FALSE); + 0, B_FALSE); fail2: efx_port_fini(sc->enp); fail: @@ -488,7 +488,7 @@ sfxge_phy_stat_update(struct sfxge_softc rc = ETIMEDOUT; out: mtx_unlock(&port->lock); - return rc; + return (rc); } static int @@ -499,11 +499,11 @@ sfxge_phy_stat_handler(SYSCTL_HANDLER_AR int rc; if ((rc = sfxge_phy_stat_update(sc)) != 0) - return rc; + return (rc); - return SYSCTL_OUT(req, + return (SYSCTL_OUT(req, (uint32_t *)sc->port.phy_stats.decode_buf + id, - sizeof(uint32_t)); + sizeof(uint32_t))); } static void @@ -619,7 +619,7 @@ fail: free(port->phy_stats.decode_buf, M_SFXGE); (void)mtx_destroy(&port->lock); port->sc = NULL; - return rc; + return (rc); } static int sfxge_link_mode[EFX_PHY_MEDIA_NTYPES][EFX_LINK_NMODES] = { @@ -697,9 +697,9 @@ sfxge_media_change(struct ifnet *ifp) rc = efx_phy_adv_cap_set(sc->enp, ifm->ifm_data); out: - sx_xunlock(&sc->softc_lock); + sx_xunlock(&sc->softc_lock); - return rc; + return (rc); } int sfxge_port_ifmedia_init(struct sfxge_softc *sc) @@ -788,7 +788,7 @@ int sfxge_port_ifmedia_init(struct sfxge best_mode_ifm = mode_ifm; } - if (best_mode_ifm) + if (best_mode_ifm != 0) ifmedia_set(&sc->media, best_mode_ifm); /* Now discard port state until interface is started. */ @@ -796,5 +796,5 @@ int sfxge_port_ifmedia_init(struct sfxge out2: efx_nic_fini(sc->enp); out: - return rc; + return (rc); } Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Tue Sep 30 18:50:45 2014 (r272324) +++ head/sys/dev/sfxge/sfxge_rx.c Tue Sep 30 20:18:10 2014 (r272325) @@ -54,8 +54,8 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" #include "sfxge_rx.h" -#define RX_REFILL_THRESHOLD (EFX_RXQ_LIMIT(SFXGE_NDESCS) * 9 / 10) -#define RX_REFILL_THRESHOLD_2 (RX_REFILL_THRESHOLD / 2) +#define RX_REFILL_THRESHOLD (EFX_RXQ_LIMIT(SFXGE_NDESCS) * 9 / 10) +#define RX_REFILL_THRESHOLD_2 (RX_REFILL_THRESHOLD / 2) /* Size of the LRO hash table. Must be a power of 2. A larger table * means we can accelerate a larger number of streams. @@ -87,10 +87,10 @@ static int lro_slow_start_packets = 2000 static int lro_loss_packets = 20; /* Flags for sfxge_lro_conn::l2_id; must not collide with EVL_VLID_MASK */ -#define SFXGE_LRO_L2_ID_VLAN 0x4000 -#define SFXGE_LRO_L2_ID_IPV6 0x8000 -#define SFXGE_LRO_CONN_IS_VLAN_ENCAP(c) ((c)->l2_id & SFXGE_LRO_L2_ID_VLAN) -#define SFXGE_LRO_CONN_IS_TCPIPV4(c) (!((c)->l2_id & SFXGE_LRO_L2_ID_IPV6)) +#define SFXGE_LRO_L2_ID_VLAN 0x4000 +#define SFXGE_LRO_L2_ID_IPV6 0x8000 +#define SFXGE_LRO_CONN_IS_VLAN_ENCAP(c) ((c)->l2_id & SFXGE_LRO_L2_ID_VLAN) +#define SFXGE_LRO_CONN_IS_TCPIPV4(c) (!((c)->l2_id & SFXGE_LRO_L2_ID_IPV6)) /* Compare IPv6 addresses, avoiding conditional branches */ static __inline unsigned long ipv6_addr_cmp(const struct in6_addr *left, @@ -179,12 +179,12 @@ static inline struct mbuf *sfxge_rx_allo m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, &args, M_NOWAIT); /* Allocate (and attach) packet buffer */ - if (m && !uma_zalloc_arg(sc->rx_buffer_zone, m, M_NOWAIT)) { + if (m != NULL && !uma_zalloc_arg(sc->rx_buffer_zone, m, M_NOWAIT)) { uma_zfree(zone_mbuf, m); m = NULL; } - return m; + return (m); } #define SFXGE_REFILL_BATCH 64 @@ -370,7 +370,7 @@ static void sfxge_lro_drop(struct sfxge_ KASSERT(!c->mbuf, ("found orphaned mbuf")); - if (c->next_buf.mbuf) { + if (c->next_buf.mbuf != NULL) { sfxge_rx_deliver(rxq->sc, &c->next_buf); LIST_REMOVE(c, active_link); } @@ -510,7 +510,7 @@ sfxge_lro_try_merge(struct sfxge_rxq *rx if (__predict_false(th_seq != c->next_seq)) { /* Out-of-order, so start counting again. */ - if (c->mbuf) + if (c->mbuf != NULL) sfxge_lro_deliver(&rxq->lro, c); c->n_in_order_pkts -= lro_loss_packets; c->next_seq = th_seq + data_length; @@ -522,10 +522,10 @@ sfxge_lro_try_merge(struct sfxge_rxq *rx now = ticks; if (now - c->last_pkt_ticks > lro_idle_ticks) { ++rxq->lro.n_drop_idle; - if (c->mbuf) + if (c->mbuf != NULL) sfxge_lro_deliver(&rxq->lro, c); sfxge_lro_drop(rxq, c); - return 0; + return (0); } c->last_pkt_ticks = ticks; @@ -537,12 +537,12 @@ sfxge_lro_try_merge(struct sfxge_rxq *rx } if (__predict_false(dont_merge)) { - if (c->mbuf) + if (c->mbuf != NULL) sfxge_lro_deliver(&rxq->lro, c); if (th->th_flags & (TH_FIN | TH_RST)) { ++rxq->lro.n_drop_closed; sfxge_lro_drop(rxq, c); - return 0; + return (0); } goto deliver_buf_out; } @@ -563,11 +563,11 @@ sfxge_lro_try_merge(struct sfxge_rxq *rx } rx_buf->mbuf = NULL; - return 1; + return (1); deliver_buf_out: sfxge_rx_deliver(rxq->sc, rx_buf); - return 1; + return (1); } static void sfxge_lro_new_conn(struct sfxge_lro_state *st, uint32_t conn_hash, @@ -621,7 +621,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct struct sfxge_lro_conn *c; uint16_t l2_id; uint16_t l3_proto; - void *nh; + void *nh; struct tcphdr *th; uint32_t conn_hash; unsigned bucket; @@ -671,7 +671,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct continue; if ((c->source - th->th_sport) | (c->dest - th->th_dport)) continue; - if (c->mbuf) { + if (c->mbuf != NULL) { if (SFXGE_LRO_CONN_IS_TCPIPV4(c)) { struct ip *c_iph, *iph = nh; c_iph = c->nh; @@ -691,7 +691,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct TAILQ_REMOVE(&rxq->lro.conns[bucket], c, link); TAILQ_INSERT_HEAD(&rxq->lro.conns[bucket], c, link); - if (c->next_buf.mbuf) { + if (c->next_buf.mbuf != NULL) { if (!sfxge_lro_try_merge(rxq, c)) goto deliver_now; } else { @@ -720,10 +720,10 @@ static void sfxge_lro_end_of_burst(struc while (!LIST_EMPTY(&st->active_conns)) { c = LIST_FIRST(&st->active_conns); - if (!c->delivered && c->mbuf) + if (!c->delivered && c->mbuf != NULL) sfxge_lro_deliver(st, c); if (sfxge_lro_try_merge(rxq, c)) { - if (c->mbuf) + if (c->mbuf != NULL) sfxge_lro_deliver(st, c); LIST_REMOVE(c, active_link); } @@ -836,7 +836,7 @@ sfxge_rx_qstop(struct sfxge_softc *sc, u evq = sc->evq[index]; mtx_lock(&evq->lock); - + KASSERT(rxq->init_state == SFXGE_RXQ_STARTED, ("rxq not started")); @@ -881,7 +881,7 @@ again: rxq->loopback = 0; /* Destroy the common code receive queue. */ - efx_rx_qdestroy(rxq->common); + efx_rx_qdestroy(rxq->common); efx_sram_buf_tbl_clear(sc->enp, rxq->buf_base_id, EFX_RXQ_NBUFS(SFXGE_NDESCS)); @@ -1136,7 +1136,7 @@ static const struct { const char *name; size_t offset; } sfxge_rx_stats[] = { -#define SFXGE_RX_STAT(name, member) \ +#define SFXGE_RX_STAT(name, member) \ { #name, offsetof(struct sfxge_rxq, member) } SFXGE_RX_STAT(lro_merges, lro.n_merges), SFXGE_RX_STAT(lro_bursts, lro.n_bursts), @@ -1161,7 +1161,7 @@ sfxge_rx_stat_handler(SYSCTL_HANDLER_ARG sum += *(unsigned int *)((caddr_t)sc->rxq[index] + sfxge_rx_stats[id].offset); - return SYSCTL_OUT(req, &sum, sizeof(sum)); + return (SYSCTL_OUT(req, &sum, sizeof(sum))); } static void Modified: head/sys/dev/sfxge/sfxge_rx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.h Tue Sep 30 18:50:45 2014 (r272324) +++ head/sys/dev/sfxge/sfxge_rx.h Tue Sep 30 20:18:10 2014 (r272325) @@ -30,25 +30,25 @@ */ #ifndef _SFXGE_RX_H -#define _SFXGE_RX_H +#define _SFXGE_RX_H -#define SFXGE_MAGIC_RESERVED 0x8000 +#define SFXGE_MAGIC_RESERVED 0x8000 -#define SFXGE_MAGIC_DMAQ_LABEL_WIDTH 6 -#define SFXGE_MAGIC_DMAQ_LABEL_MASK \ - ((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1) +#define SFXGE_MAGIC_DMAQ_LABEL_WIDTH 6 +#define SFXGE_MAGIC_DMAQ_LABEL_MASK \ + ((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1) -#define SFXGE_MAGIC_RX_QFLUSH_DONE \ - (SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) +#define SFXGE_MAGIC_RX_QFLUSH_DONE \ + (SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) -#define SFXGE_MAGIC_RX_QFLUSH_FAILED \ - (SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) +#define SFXGE_MAGIC_RX_QFLUSH_FAILED \ + (SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) -#define SFXGE_MAGIC_RX_QREFILL \ - (SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) +#define SFXGE_MAGIC_RX_QREFILL \ + (SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) -#define SFXGE_MAGIC_TX_QFLUSH_DONE \ - (SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) +#define SFXGE_MAGIC_TX_QFLUSH_DONE \ + (SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH)) #define SFXGE_RX_SCALE_MAX EFX_MAXRSS Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Tue Sep 30 18:50:45 2014 (r272324) +++ head/sys/dev/sfxge/sfxge_tx.c Tue Sep 30 20:18:10 2014 (r272325) @@ -74,8 +74,8 @@ __FBSDID("$FreeBSD$"); * the output at a packet boundary. Allow for a reasonable * minimum MSS of 512. */ -#define SFXGE_TSO_MAX_DESC ((65535 / 512) * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) -#define SFXGE_TXQ_BLOCK_LEVEL (SFXGE_NDESCS - SFXGE_TSO_MAX_DESC) +#define SFXGE_TSO_MAX_DESC ((65535 / 512) * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) +#define SFXGE_TXQ_BLOCK_LEVEL (SFXGE_NDESCS - SFXGE_TSO_MAX_DESC) /* Forward declarations. */ static inline void sfxge_tx_qdpl_service(struct sfxge_txq *txq); @@ -343,7 +343,7 @@ static int sfxge_tx_queue_mbuf(struct sf /* Post the fragment list. */ sfxge_tx_qlist_post(txq); - return 0; + return (0); reject_mapped: bus_dmamap_unload(txq->packet_dma_tag, *used_map); @@ -352,7 +352,7 @@ reject: m_freem(mbuf); ++txq->drops; - return rc; + return (rc); } #ifdef SFXGE_HAVE_MQ @@ -426,8 +426,8 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx ("queue unblocked but count is non-zero")); } -#define SFXGE_TX_QDPL_PENDING(_txq) \ - ((_txq)->dpl.std_put != 0) +#define SFXGE_TX_QDPL_PENDING(_txq) \ + ((_txq)->dpl.std_put != 0) /* * Service the deferred packet list. @@ -493,7 +493,7 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, do { old = *putp; - if (old) { + if (old != 0) { struct mbuf *mp = (struct mbuf *)old; old_len = mp->m_pkthdr.csum_data; } else @@ -559,7 +559,6 @@ fail: m_freem(m); atomic_add_long(&txq->early_drops, 1); return (rc); - } static void @@ -577,7 +576,7 @@ sfxge_tx_qdpl_flush(struct sfxge_txq *tx } stdp->std_get = NULL; stdp->std_count = 0; - stdp->std_getp = &stdp->std_get; + stdp->std_getp = &stdp->std_get; mtx_unlock(&txq->lock); } @@ -599,7 +598,7 @@ sfxge_if_qflush(struct ifnet *ifp) */ int sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m) -{ +{ struct sfxge_softc *sc; struct sfxge_txq *txq; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 20:29:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93091479; Tue, 30 Sep 2014 20:29:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FB58904; Tue, 30 Sep 2014 20:29: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 s8UKTxiI098654; Tue, 30 Sep 2014 20:29:59 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UKTx0e098653; Tue, 30 Sep 2014 20:29:59 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409302029.s8UKTx0e098653@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 30 Sep 2014 20:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272326 - 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, 30 Sep 2014 20:29:59 -0000 Author: tuexen Date: Tue Sep 30 20:29:58 2014 New Revision: 272326 URL: http://svnweb.freebsd.org/changeset/base/272326 Log: UDPLite requires a checksum. Therefore, discard a received packet if the checksum is 0. MFC after: 3 days Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue Sep 30 20:18:10 2014 (r272325) +++ head/sys/netinet/udp_usrreq.c Tue Sep 30 20:29:58 2014 (r272326) @@ -498,8 +498,16 @@ udp_input(struct mbuf **mp, int *offp, i m_freem(m); return (IPPROTO_DONE); } - } else - UDPSTAT_INC(udps_nosum); + } else { + if (proto == IPPROTO_UDP) { + UDPSTAT_INC(udps_nosum); + } else { + /* UDPLite requires a checksum */ + /* XXX: What is the right UDPLite MIB counter here? */ + m_freem(m); + return (IPPROTO_DONE); + } + } pcbinfo = get_inpcbinfo(proto); if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 20:36:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B20947C3; Tue, 30 Sep 2014 20:36:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D8EF9F1; Tue, 30 Sep 2014 20:36: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 s8UKa9rG003211; Tue, 30 Sep 2014 20:36:09 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UKa7oi003202; Tue, 30 Sep 2014 20:36:07 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201409302036.s8UKa7oi003202@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 30 Sep 2014 20:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272328 - 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, 30 Sep 2014 20:36:09 -0000 Author: gnn Date: Tue Sep 30 20:36:07 2014 New Revision: 272328 URL: http://svnweb.freebsd.org/changeset/base/272328 Log: Make size of Tx and Rx rings configurable Required size of event queue is calculated now. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: head/sys/dev/sfxge/sfxge.c head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_ev.c head/sys/dev/sfxge/sfxge_rx.c head/sys/dev/sfxge/sfxge_rx.h 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 Tue Sep 30 20:32:27 2014 (r272327) +++ head/sys/dev/sfxge/sfxge.c Tue Sep 30 20:36:07 2014 (r272328) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -67,6 +68,25 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver"); + +SYSCTL_NODE(_hw, OID_AUTO, sfxge, CTLFLAG_RD, 0, + "SFXGE driver parameters"); + +#define SFXGE_PARAM_RX_RING SFXGE_PARAM(rx_ring) +static int sfxge_rx_ring_entries = SFXGE_NDESCS; +TUNABLE_INT(SFXGE_PARAM_RX_RING, &sfxge_rx_ring_entries); +SYSCTL_INT(_hw_sfxge, OID_AUTO, rx_ring, CTLFLAG_RDTUN, + &sfxge_rx_ring_entries, 0, + "Maximum number of descriptors in a receive ring"); + +#define SFXGE_PARAM_TX_RING SFXGE_PARAM(tx_ring) +static int sfxge_tx_ring_entries = SFXGE_NDESCS; +TUNABLE_INT(SFXGE_PARAM_TX_RING, &sfxge_tx_ring_entries); +SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_ring, CTLFLAG_RDTUN, + &sfxge_tx_ring_entries, 0, + "Maximum number of descriptors in a transmit ring"); + + static void sfxge_reset(void *arg, int npending); @@ -314,8 +334,8 @@ sfxge_ifnet_init(struct ifnet *ifp, stru ifp->if_qflush = sfxge_if_qflush; #else ifp->if_start = sfxge_if_start; - IFQ_SET_MAXLEN(&ifp->if_snd, SFXGE_NDESCS - 1); - ifp->if_snd.ifq_drv_maxlen = SFXGE_NDESCS - 1; + 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); mtx_init(&sc->tx_lock, "txq", NULL, MTX_DEF); @@ -414,6 +434,26 @@ sfxge_create(struct sfxge_softc *sc) goto fail3; sc->enp = enp; + if (!ISP2(sfxge_rx_ring_entries) || + !(sfxge_rx_ring_entries & EFX_RXQ_NDESCS_MASK)) { + log(LOG_ERR, "%s=%d must be power of 2 from %u to %u", + SFXGE_PARAM_RX_RING, sfxge_rx_ring_entries, + EFX_RXQ_MINNDESCS, EFX_RXQ_MAXNDESCS); + error = EINVAL; + goto fail_rx_ring_entries; + } + sc->rxq_entries = sfxge_rx_ring_entries; + + if (!ISP2(sfxge_tx_ring_entries) || + !(sfxge_tx_ring_entries & EFX_TXQ_NDESCS_MASK)) { + log(LOG_ERR, "%s=%d must be power of 2 from %u to %u", + SFXGE_PARAM_TX_RING, sfxge_tx_ring_entries, + EFX_TXQ_MINNDESCS, EFX_TXQ_MAXNDESCS); + error = EINVAL; + goto fail_tx_ring_entries; + } + sc->txq_entries = sfxge_tx_ring_entries; + /* Initialize MCDI to talk to the microcontroller. */ if ((error = sfxge_mcdi_init(sc)) != 0) goto fail4; @@ -486,6 +526,8 @@ fail5: sfxge_mcdi_fini(sc); fail4: +fail_tx_ring_entries: +fail_rx_ring_entries: sc->enp = NULL; efx_nic_destroy(enp); mtx_destroy(&sc->enp_lock); Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Tue Sep 30 20:32:27 2014 (r272327) +++ head/sys/dev/sfxge/sfxge.h Tue Sep 30 20:36:07 2014 (r272328) @@ -87,6 +87,8 @@ #include "sfxge_rx.h" #include "sfxge_tx.h" +#define ROUNDUP_POW_OF_TWO(_n) (1ULL << flsl((_n) - 1)) + #define SFXGE_IP_ALIGN 2 #define SFXGE_ETHERTYPE_LOOPBACK 0x9000 /* Xerox loopback */ @@ -106,6 +108,7 @@ struct sfxge_evq { enum sfxge_evq_state init_state; unsigned int index; + unsigned int entries; efsys_mem_t mem; unsigned int buf_base_id; @@ -121,7 +124,6 @@ struct sfxge_evq { struct sfxge_txq **txqs; }; -#define SFXGE_NEVS 4096 #define SFXGE_NDESCS 1024 #define SFXGE_MODERATION 30 @@ -209,6 +211,9 @@ struct sfxge_softc { efx_nic_t *enp; struct mtx enp_lock; + unsigned int rxq_entries; + unsigned int txq_entries; + bus_dma_tag_t parent_dma_tag; efsys_bar_t bar; @@ -246,6 +251,10 @@ struct sfxge_softc { #define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN) #define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING) +#define SFXGE_PARAM(_name) "hw.sfxge." #_name + +SYSCTL_DECL(_hw_sfxge); + /* * From sfxge.c. */ Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Tue Sep 30 20:32:27 2014 (r272327) +++ head/sys/dev/sfxge/sfxge_ev.c Tue Sep 30 20:36:07 2014 (r272328) @@ -102,7 +102,7 @@ sfxge_ev_rx(void *arg, uint32_t label, u if (rxq->init_state != SFXGE_RXQ_STARTED) goto done; - expected = rxq->pending++ & (SFXGE_NDESCS - 1); + expected = rxq->pending++ & rxq->ptr_mask; if (id != expected) { evq->exception = B_TRUE; @@ -247,10 +247,10 @@ sfxge_ev_tx(void *arg, uint32_t label, u if (txq->init_state != SFXGE_TXQ_STARTED) goto done; - stop = (id + 1) & (SFXGE_NDESCS - 1); - id = txq->pending & (SFXGE_NDESCS - 1); + stop = (id + 1) & txq->ptr_mask; + id = txq->pending & txq->ptr_mask; - delta = (stop >= id) ? (stop - id) : (SFXGE_NDESCS - id + stop); + delta = (stop >= id) ? (stop - id) : (txq->entries - id + stop); txq->pending += delta; evq->tx_done++; @@ -635,7 +635,7 @@ sfxge_ev_qstop(struct sfxge_softc *sc, u efx_ev_qdestroy(evq->common); efx_sram_buf_tbl_clear(sc->enp, evq->buf_base_id, - EFX_EVQ_NBUFS(SFXGE_NEVS)); + EFX_EVQ_NBUFS(evq->entries)); mtx_unlock(&evq->lock); } @@ -654,15 +654,15 @@ sfxge_ev_qstart(struct sfxge_softc *sc, ("evq->init_state != SFXGE_EVQ_INITIALIZED")); /* Clear all events. */ - (void)memset(esmp->esm_base, 0xff, EFX_EVQ_SIZE(SFXGE_NEVS)); + (void)memset(esmp->esm_base, 0xff, EFX_EVQ_SIZE(evq->entries)); /* Program the buffer table. */ if ((rc = efx_sram_buf_tbl_set(sc->enp, evq->buf_base_id, esmp, - EFX_EVQ_NBUFS(SFXGE_NEVS))) != 0) - return rc; + EFX_EVQ_NBUFS(evq->entries))) != 0) + return (rc); /* Create the common code event queue. */ - if ((rc = efx_ev_qcreate(sc->enp, index, esmp, SFXGE_NEVS, + if ((rc = efx_ev_qcreate(sc->enp, index, esmp, evq->entries, evq->buf_base_id, &evq->common)) != 0) goto fail; @@ -705,7 +705,7 @@ fail2: efx_ev_qdestroy(evq->common); fail: efx_sram_buf_tbl_clear(sc->enp, evq->buf_base_id, - EFX_EVQ_NBUFS(SFXGE_NEVS)); + EFX_EVQ_NBUFS(evq->entries)); return (rc); } @@ -802,15 +802,31 @@ sfxge_ev_qinit(struct sfxge_softc *sc, u sc->evq[index] = evq; esmp = &evq->mem; + /* Build an event queue with room for one event per tx and rx buffer, + * plus some extra for link state events and MCDI completions. + * There are three tx queues in the first event queue and one in + * other. + */ + if (index == 0) + evq->entries = + ROUNDUP_POW_OF_TWO(sc->rxq_entries + + 3 * sc->txq_entries + + 128); + else + evq->entries = + ROUNDUP_POW_OF_TWO(sc->rxq_entries + + sc->txq_entries + + 128); + /* Initialise TX completion list */ evq->txqs = &evq->txq; /* Allocate DMA space. */ - if ((rc = sfxge_dma_alloc(sc, EFX_EVQ_SIZE(SFXGE_NEVS), esmp)) != 0) + if ((rc = sfxge_dma_alloc(sc, EFX_EVQ_SIZE(evq->entries), esmp)) != 0) return (rc); /* Allocate buffer table entries. */ - sfxge_sram_buf_tbl_alloc(sc, EFX_EVQ_NBUFS(SFXGE_NEVS), + sfxge_sram_buf_tbl_alloc(sc, EFX_EVQ_NBUFS(evq->entries), &evq->buf_base_id); mtx_init(&evq->lock, "evq", NULL, MTX_DEF); Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Tue Sep 30 20:32:27 2014 (r272327) +++ head/sys/dev/sfxge/sfxge_rx.c Tue Sep 30 20:36:07 2014 (r272328) @@ -54,8 +54,7 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" #include "sfxge_rx.h" -#define RX_REFILL_THRESHOLD (EFX_RXQ_LIMIT(SFXGE_NDESCS) * 9 / 10) -#define RX_REFILL_THRESHOLD_2 (RX_REFILL_THRESHOLD / 2) +#define RX_REFILL_THRESHOLD(_entries) (EFX_RXQ_LIMIT(_entries) * 9 / 10) /* Size of the LRO hash table. Must be a power of 2. A larger table * means we can accelerate a larger number of streams. @@ -214,11 +213,11 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, un return; rxfill = rxq->added - rxq->completed; - KASSERT(rxfill <= EFX_RXQ_LIMIT(SFXGE_NDESCS), - ("rxfill > EFX_RXQ_LIMIT(SFXGE_NDESCS)")); - ntodo = min(EFX_RXQ_LIMIT(SFXGE_NDESCS) - rxfill, target); - KASSERT(ntodo <= EFX_RXQ_LIMIT(SFXGE_NDESCS), - ("ntodo > EFX_RQX_LIMIT(SFXGE_NDESCS)")); + KASSERT(rxfill <= EFX_RXQ_LIMIT(rxq->entries), + ("rxfill > EFX_RXQ_LIMIT(rxq->entries)")); + ntodo = min(EFX_RXQ_LIMIT(rxq->entries) - rxfill, target); + KASSERT(ntodo <= EFX_RXQ_LIMIT(rxq->entries), + ("ntodo > EFX_RQX_LIMIT(rxq->entries)")); if (ntodo == 0) return; @@ -231,7 +230,7 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, un bus_dma_segment_t seg; struct mbuf *m; - id = (rxq->added + batch) & (SFXGE_NDESCS - 1); + id = (rxq->added + batch) & rxq->ptr_mask; rx_desc = &rxq->queue[id]; KASSERT(rx_desc->mbuf == NULL, ("rx_desc->mbuf != NULL")); @@ -274,7 +273,7 @@ sfxge_rx_qrefill(struct sfxge_rxq *rxq) return; /* Make sure the queue is full */ - sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(SFXGE_NDESCS), B_TRUE); + sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(rxq->entries), B_TRUE); } static void __sfxge_rx_deliver(struct sfxge_softc *sc, struct mbuf *m) @@ -757,7 +756,7 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq unsigned int id; struct sfxge_rx_sw_desc *rx_desc; - id = completed++ & (SFXGE_NDESCS - 1); + id = completed++ & rxq->ptr_mask; rx_desc = &rxq->queue[id]; m = rx_desc->mbuf; @@ -821,8 +820,8 @@ discard: sfxge_lro_end_of_burst(rxq); /* Top up the queue if necessary */ - if (level < RX_REFILL_THRESHOLD) - sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(SFXGE_NDESCS), B_FALSE); + if (level < rxq->refill_threshold) + sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(rxq->entries), B_FALSE); } static void @@ -884,7 +883,7 @@ again: efx_rx_qdestroy(rxq->common); efx_sram_buf_tbl_clear(sc->enp, rxq->buf_base_id, - EFX_RXQ_NBUFS(SFXGE_NDESCS)); + EFX_RXQ_NBUFS(sc->rxq_entries)); mtx_unlock(&evq->lock); } @@ -908,12 +907,12 @@ sfxge_rx_qstart(struct sfxge_softc *sc, /* Program the buffer table. */ if ((rc = efx_sram_buf_tbl_set(sc->enp, rxq->buf_base_id, esmp, - EFX_RXQ_NBUFS(SFXGE_NDESCS))) != 0) - return rc; + EFX_RXQ_NBUFS(sc->rxq_entries))) != 0) + return (rc); /* Create the common code receive queue. */ if ((rc = efx_rx_qcreate(sc->enp, index, index, EFX_RXQ_TYPE_DEFAULT, - esmp, SFXGE_NDESCS, rxq->buf_base_id, evq->common, + esmp, sc->rxq_entries, rxq->buf_base_id, evq->common, &rxq->common)) != 0) goto fail; @@ -925,7 +924,7 @@ sfxge_rx_qstart(struct sfxge_softc *sc, rxq->init_state = SFXGE_RXQ_STARTED; /* Try to fill the queue from the pool. */ - sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(SFXGE_NDESCS), B_FALSE); + sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(sc->rxq_entries), B_FALSE); mtx_unlock(&evq->lock); @@ -933,8 +932,8 @@ sfxge_rx_qstart(struct sfxge_softc *sc, fail: efx_sram_buf_tbl_clear(sc->enp, rxq->buf_base_id, - EFX_RXQ_NBUFS(SFXGE_NDESCS)); - return rc; + EFX_RXQ_NBUFS(sc->rxq_entries)); + return (rc); } void @@ -1105,6 +1104,9 @@ sfxge_rx_qinit(struct sfxge_softc *sc, u rxq = malloc(sizeof(struct sfxge_rxq), M_SFXGE, M_ZERO | M_WAITOK); rxq->sc = sc; rxq->index = index; + rxq->entries = sc->rxq_entries; + rxq->ptr_mask = rxq->entries - 1; + rxq->refill_threshold = RX_REFILL_THRESHOLD(rxq->entries); sc->rxq[index] = rxq; esmp = &rxq->mem; @@ -1112,16 +1114,16 @@ sfxge_rx_qinit(struct sfxge_softc *sc, u evq = sc->evq[index]; /* Allocate and zero DMA space. */ - if ((rc = sfxge_dma_alloc(sc, EFX_RXQ_SIZE(SFXGE_NDESCS), esmp)) != 0) + if ((rc = sfxge_dma_alloc(sc, EFX_RXQ_SIZE(sc->rxq_entries), esmp)) != 0) return (rc); - (void)memset(esmp->esm_base, 0, EFX_RXQ_SIZE(SFXGE_NDESCS)); + (void)memset(esmp->esm_base, 0, EFX_RXQ_SIZE(sc->rxq_entries)); /* Allocate buffer table entries. */ - sfxge_sram_buf_tbl_alloc(sc, EFX_RXQ_NBUFS(SFXGE_NDESCS), + sfxge_sram_buf_tbl_alloc(sc, EFX_RXQ_NBUFS(sc->rxq_entries), &rxq->buf_base_id); /* Allocate the context array and the flow table. */ - rxq->queue = malloc(sizeof(struct sfxge_rx_sw_desc) * SFXGE_NDESCS, + rxq->queue = malloc(sizeof(struct sfxge_rx_sw_desc) * sc->rxq_entries, M_SFXGE, M_WAITOK | M_ZERO); sfxge_lro_init(rxq); Modified: head/sys/dev/sfxge/sfxge_rx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.h Tue Sep 30 20:32:27 2014 (r272327) +++ head/sys/dev/sfxge/sfxge_rx.h Tue Sep 30 20:36:07 2014 (r272328) @@ -159,6 +159,8 @@ struct sfxge_rxq { efsys_mem_t mem; unsigned int buf_base_id; enum sfxge_rxq_state init_state; + unsigned int entries; + unsigned int ptr_mask; struct sfxge_rx_sw_desc *queue __aligned(CACHE_LINE_SIZE); unsigned int added; @@ -166,6 +168,7 @@ struct sfxge_rxq { unsigned int completed; unsigned int loopback; struct sfxge_lro_state lro; + unsigned int refill_threshold; struct callout refill_callout; unsigned int refill_delay; Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Tue Sep 30 20:32:27 2014 (r272327) +++ head/sys/dev/sfxge/sfxge_tx.c Tue Sep 30 20:36:07 2014 (r272328) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); * minimum MSS of 512. */ #define SFXGE_TSO_MAX_DESC ((65535 / 512) * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) -#define SFXGE_TXQ_BLOCK_LEVEL (SFXGE_NDESCS - SFXGE_TSO_MAX_DESC) +#define SFXGE_TXQ_BLOCK_LEVEL(_entries) ((_entries) - SFXGE_TSO_MAX_DESC) /* Forward declarations. */ static inline void sfxge_tx_qdpl_service(struct sfxge_txq *txq); @@ -101,7 +101,7 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq struct sfxge_tx_mapping *stmp; unsigned int id; - id = completed++ & (SFXGE_NDESCS - 1); + id = completed++ & txq->ptr_mask; stmp = &txq->stmp[id]; if (stmp->flags & TX_BUF_UNMAP) { @@ -125,7 +125,7 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq unsigned int level; level = txq->added - txq->completed; - if (level <= SFXGE_TXQ_UNBLOCK_LEVEL) + if (level <= SFXGE_TXQ_UNBLOCK_LEVEL(txq->entries)) sfxge_tx_qunblock(txq); } } @@ -218,19 +218,19 @@ sfxge_tx_qlist_post(struct sfxge_txq *tx ("efx_tx_qpost() refragmented descriptors")); level = txq->added - txq->reaped; - KASSERT(level <= SFXGE_NDESCS, ("overfilled TX queue")); + KASSERT(level <= txq->entries, ("overfilled TX queue")); /* Clear the fragment list. */ txq->n_pend_desc = 0; /* Have we reached the block level? */ - if (level < SFXGE_TXQ_BLOCK_LEVEL) + if (level < SFXGE_TXQ_BLOCK_LEVEL(txq->entries)) return; /* Reap, and check again */ sfxge_tx_qreap(txq); level = txq->added - txq->reaped; - if (level < SFXGE_TXQ_BLOCK_LEVEL) + if (level < SFXGE_TXQ_BLOCK_LEVEL(txq->entries)) return; txq->blocked = 1; @@ -242,7 +242,7 @@ sfxge_tx_qlist_post(struct sfxge_txq *tx mb(); sfxge_tx_qreap(txq); level = txq->added - txq->reaped; - if (level < SFXGE_TXQ_BLOCK_LEVEL) { + if (level < SFXGE_TXQ_BLOCK_LEVEL(txq->entries)) { mb(); txq->blocked = 0; } @@ -271,7 +271,7 @@ static int sfxge_tx_queue_mbuf(struct sf } /* Load the packet for DMA. */ - id = txq->added & (SFXGE_NDESCS - 1); + id = txq->added & txq->ptr_mask; stmp = &txq->stmp[id]; rc = bus_dmamap_load_mbuf_sg(txq->packet_dma_tag, stmp->map, mbuf, dma_seg, &n_dma_seg, 0); @@ -318,7 +318,7 @@ static int sfxge_tx_queue_mbuf(struct sf stmp->flags = 0; if (__predict_false(stmp == - &txq->stmp[SFXGE_NDESCS - 1])) + &txq->stmp[txq->ptr_mask])) stmp = &txq->stmp[0]; else stmp++; @@ -762,20 +762,22 @@ static inline const struct tcphdr *tso_t * a TSO header buffer, since they must always be followed by a * payload descriptor referring to an mbuf. */ -#define TSOH_COUNT (SFXGE_NDESCS / 2u) +#define TSOH_COUNT(_txq_entries) ((_txq_entries) / 2u) #define TSOH_PER_PAGE (PAGE_SIZE / TSOH_STD_SIZE) -#define TSOH_PAGE_COUNT ((TSOH_COUNT + TSOH_PER_PAGE - 1) / TSOH_PER_PAGE) +#define TSOH_PAGE_COUNT(_txq_entries) \ + ((TSOH_COUNT(_txq_entries) + TSOH_PER_PAGE - 1) / TSOH_PER_PAGE) static int tso_init(struct sfxge_txq *txq) { struct sfxge_softc *sc = txq->sc; + unsigned int tsoh_page_count = TSOH_PAGE_COUNT(sc->txq_entries); int i, rc; /* Allocate TSO header buffers */ - txq->tsoh_buffer = malloc(TSOH_PAGE_COUNT * sizeof(txq->tsoh_buffer[0]), + txq->tsoh_buffer = malloc(tsoh_page_count * sizeof(txq->tsoh_buffer[0]), M_SFXGE, M_WAITOK); - for (i = 0; i < TSOH_PAGE_COUNT; i++) { + for (i = 0; i < tsoh_page_count; i++) { rc = sfxge_dma_alloc(sc, PAGE_SIZE, &txq->tsoh_buffer[i]); if (rc != 0) goto fail; @@ -796,7 +798,7 @@ static void tso_fini(struct sfxge_txq *t int i; if (txq->tsoh_buffer != NULL) { - for (i = 0; i < TSOH_PAGE_COUNT; i++) + for (i = 0; i < TSOH_PAGE_COUNT(txq->sc->txq_entries); i++) sfxge_dma_free(&txq->tsoh_buffer[i]); free(txq->tsoh_buffer, M_SFXGE); } @@ -1010,12 +1012,12 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq tso.dma_addr = dma_seg->ds_addr + tso.header_len; } - id = txq->added & (SFXGE_NDESCS - 1); + id = txq->added & txq->ptr_mask; if (__predict_false(tso_start_new_packet(txq, &tso, id))) - return -1; + return (-1); while (1) { - id = (id + 1) & (SFXGE_NDESCS - 1); + id = (id + 1) & txq->ptr_mask; tso_fill_packet_with_fragment(txq, &tso); /* Move onto the next fragment? */ @@ -1038,7 +1040,7 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq if (txq->n_pend_desc > SFXGE_TSO_MAX_DESC - (1 + SFXGE_TX_MAPPING_MAX_SEG)) break; - next_id = (id + 1) & (SFXGE_NDESCS - 1); + next_id = (id + 1) & txq->ptr_mask; if (__predict_false(tso_start_new_packet(txq, &tso, next_id))) break; @@ -1070,7 +1072,7 @@ sfxge_tx_qunblock(struct sfxge_txq *txq) unsigned int level; level = txq->added - txq->completed; - if (level <= SFXGE_TXQ_UNBLOCK_LEVEL) + if (level <= SFXGE_TXQ_UNBLOCK_LEVEL(txq->entries)) txq->blocked = 0; } @@ -1146,7 +1148,7 @@ sfxge_tx_qstop(struct sfxge_softc *sc, u txq->common = NULL; efx_sram_buf_tbl_clear(sc->enp, txq->buf_base_id, - EFX_TXQ_NBUFS(SFXGE_NDESCS)); + EFX_TXQ_NBUFS(sc->txq_entries)); mtx_unlock(&evq->lock); mtx_unlock(SFXGE_TXQ_LOCK(txq)); @@ -1172,8 +1174,8 @@ sfxge_tx_qstart(struct sfxge_softc *sc, /* Program the buffer table. */ if ((rc = efx_sram_buf_tbl_set(sc->enp, txq->buf_base_id, esmp, - EFX_TXQ_NBUFS(SFXGE_NDESCS))) != 0) - return rc; + EFX_TXQ_NBUFS(sc->txq_entries))) != 0) + return (rc); /* Determine the kind of queue we are creating. */ switch (txq->type) { @@ -1194,7 +1196,7 @@ sfxge_tx_qstart(struct sfxge_softc *sc, /* Create the common code transmit queue. */ if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp, - SFXGE_NDESCS, txq->buf_base_id, flags, evq->common, + sc->txq_entries, txq->buf_base_id, flags, evq->common, &txq->common)) != 0) goto fail; @@ -1211,8 +1213,8 @@ sfxge_tx_qstart(struct sfxge_softc *sc, fail: efx_sram_buf_tbl_clear(sc->enp, txq->buf_base_id, - EFX_TXQ_NBUFS(SFXGE_NDESCS)); - return rc; + EFX_TXQ_NBUFS(sc->txq_entries)); + return (rc); } void @@ -1280,7 +1282,7 @@ static void sfxge_tx_qfini(struct sfxge_softc *sc, unsigned int index) { struct sfxge_txq *txq; - unsigned int nmaps = SFXGE_NDESCS; + unsigned int nmaps; txq = sc->txq[index]; @@ -1292,6 +1294,7 @@ sfxge_tx_qfini(struct sfxge_softc *sc, u /* Free the context arrays. */ free(txq->pend_desc, M_SFXGE); + nmaps = sc->txq_entries; while (nmaps-- != 0) bus_dmamap_destroy(txq->packet_dma_tag, txq->stmp[nmaps].map); free(txq->stmp, M_SFXGE); @@ -1323,6 +1326,8 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u txq = malloc(sizeof(struct sfxge_txq), M_SFXGE, M_ZERO | M_WAITOK); txq->sc = sc; + txq->entries = sc->txq_entries; + txq->ptr_mask = txq->entries - 1; sc->txq[txq_index] = txq; esmp = &txq->mem; @@ -1330,12 +1335,12 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u evq = sc->evq[evq_index]; /* Allocate and zero DMA space for the descriptor ring. */ - if ((rc = sfxge_dma_alloc(sc, EFX_TXQ_SIZE(SFXGE_NDESCS), esmp)) != 0) + if ((rc = sfxge_dma_alloc(sc, EFX_TXQ_SIZE(sc->txq_entries), esmp)) != 0) return (rc); - (void)memset(esmp->esm_base, 0, EFX_TXQ_SIZE(SFXGE_NDESCS)); + (void)memset(esmp->esm_base, 0, EFX_TXQ_SIZE(sc->txq_entries)); /* Allocate buffer table entries. */ - sfxge_sram_buf_tbl_alloc(sc, EFX_TXQ_NBUFS(SFXGE_NDESCS), + sfxge_sram_buf_tbl_alloc(sc, EFX_TXQ_NBUFS(sc->txq_entries), &txq->buf_base_id); /* Create a DMA tag for packet mappings. */ @@ -1349,13 +1354,13 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u } /* Allocate pending descriptor array for batching writes. */ - txq->pend_desc = malloc(sizeof(efx_buffer_t) * SFXGE_NDESCS, + txq->pend_desc = malloc(sizeof(efx_buffer_t) * sc->txq_entries, M_SFXGE, M_ZERO | M_WAITOK); /* Allocate and initialise mbuf DMA mapping array. */ - txq->stmp = malloc(sizeof(struct sfxge_tx_mapping) * SFXGE_NDESCS, + txq->stmp = malloc(sizeof(struct sfxge_tx_mapping) * sc->txq_entries, M_SFXGE, M_ZERO | M_WAITOK); - for (nmaps = 0; nmaps < SFXGE_NDESCS; nmaps++) { + for (nmaps = 0; nmaps < sc->txq_entries; nmaps++) { rc = bus_dmamap_create(txq->packet_dma_tag, 0, &txq->stmp[nmaps].map); if (rc != 0) Modified: head/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.h Tue Sep 30 20:32:27 2014 (r272327) +++ head/sys/dev/sfxge/sfxge_tx.h Tue Sep 30 20:36:07 2014 (r272328) @@ -106,7 +106,7 @@ enum sfxge_txq_type { SFXGE_TXQ_NTYPES }; -#define SFXGE_TXQ_UNBLOCK_LEVEL (EFX_TXQ_LIMIT(SFXGE_NDESCS) / 4) +#define SFXGE_TXQ_UNBLOCK_LEVEL(_entries) (EFX_TXQ_LIMIT(_entries) / 4) #define SFXGE_TX_BATCH 64 @@ -128,6 +128,8 @@ struct sfxge_txq { unsigned int evq_index; efsys_mem_t mem; unsigned int buf_base_id; + unsigned int entries; + unsigned int ptr_mask; struct sfxge_tx_mapping *stmp; /* Packets in flight. */ bus_dma_tag_t packet_dma_tag; From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 20:38:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AD81BC1; Tue, 30 Sep 2014 20:38: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 370F8A67; Tue, 30 Sep 2014 20:38: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 s8UKcbY0003654; Tue, 30 Sep 2014 20:38:37 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UKcbTn003653; Tue, 30 Sep 2014 20:38:37 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201409302038.s8UKcbTn003653@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 30 Sep 2014 20:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272329 - 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, 30 Sep 2014 20:38:37 -0000 Author: gnn Date: Tue Sep 30 20:38:36 2014 New Revision: 272329 URL: http://svnweb.freebsd.org/changeset/base/272329 Log: Update SolarFlare driver manual page with new tunables. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: head/share/man/man4/sfxge.4 Modified: head/share/man/man4/sfxge.4 ============================================================================== --- head/share/man/man4/sfxge.4 Tue Sep 30 20:36:07 2014 (r272328) +++ head/share/man/man4/sfxge.4 Tue Sep 30 20:38:36 2014 (r272329) @@ -76,6 +76,32 @@ The .Nm driver supports all 10Gb Ethernet adapters based on Solarflare SFC9000 family controllers. +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +Actual values can be obtained using +.Xr sysctl 8 . +.Bl -tag -width indent +.It Va hw.sfxge.rx_ring +Maximum number of descriptors in a receive queue ring. +Supported values are: 512, 1024, 2048 and 4096. +.It Va hw.sfxge.tx_ring +Maximum number of descriptors in a transmit queue ring. +Supported values are: 512, 1024, 2048 and 4096. +.It Va hw.sfxge.tx_dpl_get_max +The maximum length of the deferred packet 'get-list' for queued transmit +packets, used only if the transmit queue lock can be acquired. +If packet is dropped, \fItx_early_drops\fR counter grows and local sender +gets ENOBUFS error. +Value must be greater than 0. +.It Va hw.sfxge.tx_dpl_put_max +The maximum length of the deferred packet 'put-list' for queued transmit +packets, used if the transmit queue lock cannot be acquired. +If packet is dropped, \fItx_early_drops\fR counter grows and local sender +gets ENOBUFS error. +Value must be greater or equal to 0. .Sh SUPPORT For general information and support, go to the Solarflare support website at: From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 20:43:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACDC5DDA; Tue, 30 Sep 2014 20:43:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FEF2B31; Tue, 30 Sep 2014 20:43: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 s8UKhMYb007669; Tue, 30 Sep 2014 20:43:22 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UKhLow007666; Tue, 30 Sep 2014 20:43:21 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201409302043.s8UKhLow007666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 30 Sep 2014 20:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272330 - 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, 30 Sep 2014 20:43:22 -0000 Author: gnn Date: Tue Sep 30 20:43:21 2014 New Revision: 272330 URL: http://svnweb.freebsd.org/changeset/base/272330 Log: The patch allows to check state of the software Tx queues at run time. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/sfxge/sfxge_tx.h Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Tue Sep 30 20:38:36 2014 (r272329) +++ head/sys/dev/sfxge/sfxge.h Tue Sep 30 20:43:21 2014 (r272330) @@ -202,6 +202,7 @@ struct sfxge_softc { struct ifnet *ifnet; unsigned int if_flags; struct sysctl_oid *stats_node; + struct sysctl_oid *txqs_node; struct task task_reset; Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Tue Sep 30 20:38:36 2014 (r272329) +++ head/sys/dev/sfxge/sfxge_tx.c Tue Sep 30 20:43:21 2014 (r272330) @@ -176,7 +176,7 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq * KASSERT(*get_tailp == NULL, ("*get_tailp != NULL")); *stdp->std_getp = get_next; stdp->std_getp = get_tailp; - stdp->std_count += count; + stdp->std_get_count += count; } #endif /* SFXGE_HAVE_MQ */ @@ -380,7 +380,7 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx prefetch_read_many(txq->common); mbuf = stdp->std_get; - count = stdp->std_count; + count = stdp->std_get_count; while (count != 0) { KASSERT(mbuf != NULL, ("mbuf == NULL")); @@ -412,17 +412,17 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx if (count == 0) { KASSERT(mbuf == NULL, ("mbuf != NULL")); stdp->std_get = NULL; - stdp->std_count = 0; + stdp->std_get_count = 0; stdp->std_getp = &stdp->std_get; } else { stdp->std_get = mbuf; - stdp->std_count = count; + stdp->std_get_count = count; } if (txq->added != pushed) efx_tx_qpush(txq->common, txq->added); - KASSERT(txq->blocked || stdp->std_count == 0, + KASSERT(txq->blocked || stdp->std_get_count == 0, ("queue unblocked but count is non-zero")); } @@ -476,12 +476,12 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, sfxge_tx_qdpl_swizzle(txq); - if (stdp->std_count >= SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT) + if (stdp->std_get_count >= SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT) return (ENOBUFS); *(stdp->std_getp) = mbuf; stdp->std_getp = &mbuf->m_nextpkt; - stdp->std_count++; + stdp->std_get_count++; } else { volatile uintptr_t *putp; uintptr_t old; @@ -575,7 +575,7 @@ sfxge_tx_qdpl_flush(struct sfxge_txq *tx m_freem(mbuf); } stdp->std_get = NULL; - stdp->std_count = 0; + stdp->std_get_count = 0; stdp->std_getp = &stdp->std_get; mtx_unlock(&txq->lock); @@ -1315,6 +1315,8 @@ static int sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index, enum sfxge_txq_type type, unsigned int evq_index) { + char name[16]; + struct sysctl_oid *txq_node; struct sfxge_txq *txq; struct sfxge_evq *evq; #ifdef SFXGE_HAVE_MQ @@ -1367,6 +1369,16 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u goto fail2; } + snprintf(name, sizeof(name), "%u", txq_index); + txq_node = SYSCTL_ADD_NODE( + device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(sc->txqs_node), + OID_AUTO, name, CTLFLAG_RD, NULL, ""); + if (txq_node == NULL) { + rc = ENOMEM; + goto fail_txq_node; + } + if (type == SFXGE_TXQ_IP_TCP_UDP_CKSUM && (rc = tso_init(txq)) != 0) goto fail3; @@ -1377,6 +1389,11 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u stdp->std_getp = &stdp->std_get; mtx_init(&txq->lock, "txq", NULL, MTX_DEF); + + SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(txq_node), OID_AUTO, + "dpl_get_count", CTLFLAG_RD | CTLFLAG_STATS, + &stdp->std_get_count, 0, ""); #endif txq->type = type; @@ -1387,6 +1404,7 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u return (0); fail3: +fail_txq_node: free(txq->pend_desc, M_SFXGE); fail2: while (nmaps-- != 0) @@ -1480,6 +1498,15 @@ sfxge_tx_init(struct sfxge_softc *sc) KASSERT(intr->state == SFXGE_INTR_INITIALIZED, ("intr->state != SFXGE_INTR_INITIALIZED")); + sc->txqs_node = SYSCTL_ADD_NODE( + device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + OID_AUTO, "txq", CTLFLAG_RD, NULL, "Tx queues"); + if (sc->txqs_node == NULL) { + rc = ENOMEM; + goto fail_txq_node; + } + /* Initialize the transmit queues */ if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_NON_CKSUM, SFXGE_TXQ_NON_CKSUM, 0)) != 0) @@ -1509,5 +1536,6 @@ fail2: sfxge_tx_qfini(sc, SFXGE_TXQ_NON_CKSUM); fail: +fail_txq_node: return (rc); } Modified: head/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.h Tue Sep 30 20:38:36 2014 (r272329) +++ head/sys/dev/sfxge/sfxge_tx.h Tue Sep 30 20:43:21 2014 (r272330) @@ -82,10 +82,10 @@ struct sfxge_tx_mapping { * Deferred packet list. */ struct sfxge_tx_dpl { - uintptr_t std_put; /* Head of put list. */ - struct mbuf *std_get; /* Head of get list. */ - struct mbuf **std_getp; /* Tail of get list. */ - unsigned int std_count; /* Count of packets. */ + uintptr_t std_put; /* Head of put list. */ + struct mbuf *std_get; /* Head of get list. */ + struct mbuf **std_getp; /* Tail of get list. */ + unsigned int std_get_count; /* Packets in get list. */ }; From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 20:47:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73E02148; Tue, 30 Sep 2014 20:47:37 +0000 (UTC) Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93D6EB85; Tue, 30 Sep 2014 20:47:36 +0000 (UTC) Received: by mail-wg0-f48.google.com with SMTP id l18so3486996wgh.31 for ; Tue, 30 Sep 2014 13:47:35 -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=hMOYhXI3VjgKzPa7pzwjjQv7xlvHyLerV3DO3S6V16I=; b=XrOKpSS3HTE8EvAyX2mwMfIa5sUL3vX2CQCZLocek+GgDemBGJa5Joe504/NK6+fTR RhwBjbKbidrFKW7T1pAivNWbgmOtYJwZgpmHFH+tTpq8pxhzU5ch6LRk0Bhg/8kMhnmJ niU4E+ywB6Q7Tr1+Mk7qqFjBQ6KeWJ8Or2C84/9GvPfICwCM6p+8Tb9TCdoUMimsbA3u dO9ClwBg34L6Pd1VZbnhV5Gy5HNKm5NPhtSbYg6L+q0M4dJbtgIdjPP010kcpsPBxcim jMq+k1M1iAK+UKECIgYPgfYvsxnSm14HXDFYelpfF4Y/fc6PTK7sYsCSrpRQAjXH1U7H fwGA== MIME-Version: 1.0 X-Received: by 10.180.74.203 with SMTP id w11mr8709218wiv.26.1412110054929; Tue, 30 Sep 2014 13:47:34 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Tue, 30 Sep 2014 13:47:34 -0700 (PDT) In-Reply-To: <201409302029.s8UKTx0e098653@svn.freebsd.org> References: <201409302029.s8UKTx0e098653@svn.freebsd.org> Date: Tue, 30 Sep 2014 13:47:34 -0700 X-Google-Sender-Auth: RdEtaBpv-AzisyBpzQYXvi39vjU Message-ID: Subject: Re: svn commit: r272326 - head/sys/netinet From: Adrian Chadd To: Michael Tuexen 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: Tue, 30 Sep 2014 20:47:37 -0000 Hi, I think you should consider adding a new set of protocol counters for UDPLITE. :) -a On 30 September 2014 13:29, Michael Tuexen wrote: > Author: tuexen > Date: Tue Sep 30 20:29:58 2014 > New Revision: 272326 > URL: http://svnweb.freebsd.org/changeset/base/272326 > > Log: > UDPLite requires a checksum. Therefore, discard a received packet if > the checksum is 0. > > MFC after: 3 days > > Modified: > head/sys/netinet/udp_usrreq.c > > Modified: head/sys/netinet/udp_usrreq.c > ============================================================================== > --- head/sys/netinet/udp_usrreq.c Tue Sep 30 20:18:10 2014 (r272325) > +++ head/sys/netinet/udp_usrreq.c Tue Sep 30 20:29:58 2014 (r272326) > @@ -498,8 +498,16 @@ udp_input(struct mbuf **mp, int *offp, i > m_freem(m); > return (IPPROTO_DONE); > } > - } else > - UDPSTAT_INC(udps_nosum); > + } else { > + if (proto == IPPROTO_UDP) { > + UDPSTAT_INC(udps_nosum); > + } else { > + /* UDPLite requires a checksum */ > + /* XXX: What is the right UDPLite MIB counter here? */ > + m_freem(m); > + return (IPPROTO_DONE); > + } > + } > > pcbinfo = get_inpcbinfo(proto); > if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || > From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 20:57:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2824560B; Tue, 30 Sep 2014 20:57:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 143B8CAB; Tue, 30 Sep 2014 20:57: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 s8UKvPLR013019; Tue, 30 Sep 2014 20:57:25 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UKvP4W013017; Tue, 30 Sep 2014 20:57:25 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201409302057.s8UKvP4W013017@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 30 Sep 2014 20:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272331 - 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, 30 Sep 2014 20:57:26 -0000 Author: gnn Date: Tue Sep 30 20:57:25 2014 New Revision: 272331 URL: http://svnweb.freebsd.org/changeset/base/272331 Log: Support tunable to control Tx deferred packet list limits Also increase default for Tx queue get-list limit. Too small limit results in TCP packets drops especiall when many streams are running simultaneously. Put list may be kept small enough since it is just a temporary location if transmit function can't get Tx queue lock. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/sfxge/sfxge_tx.h Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Tue Sep 30 20:43:21 2014 (r272330) +++ head/sys/dev/sfxge/sfxge_tx.c Tue Sep 30 20:57:25 2014 (r272331) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -77,6 +78,25 @@ __FBSDID("$FreeBSD$"); #define SFXGE_TSO_MAX_DESC ((65535 / 512) * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) #define SFXGE_TXQ_BLOCK_LEVEL(_entries) ((_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; +TUNABLE_INT(SFXGE_PARAM_TX_DPL_GET_MAX, &sfxge_tx_dpl_get_max); +SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_get_max, CTLFLAG_RDTUN, + &sfxge_tx_dpl_get_max, 0, + "Maximum number of packets in deferred packet get-list"); + +#define SFXGE_PARAM_TX_DPL_PUT_MAX SFXGE_PARAM(tx_dpl_put_max) +static int sfxge_tx_dpl_put_max = SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT; +TUNABLE_INT(SFXGE_PARAM_TX_DPL_PUT_MAX, &sfxge_tx_dpl_put_max); +SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_put_max, CTLFLAG_RDTUN, + &sfxge_tx_dpl_put_max, 0, + "Maximum number of packets in deferred packet put-list"); + +#endif + + /* Forward declarations. */ static inline void sfxge_tx_qdpl_service(struct sfxge_txq *txq); static void sfxge_tx_qlist_post(struct sfxge_txq *txq); @@ -476,7 +496,7 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, sfxge_tx_qdpl_swizzle(txq); - if (stdp->std_get_count >= SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT) + if (stdp->std_get_count >= stdp->std_get_max) return (ENOBUFS); *(stdp->std_getp) = mbuf; @@ -498,7 +518,7 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, old_len = mp->m_pkthdr.csum_data; } else old_len = 0; - if (old_len >= SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT) + if (old_len >= stdp->std_put_max) return (ENOBUFS); mbuf->m_pkthdr.csum_data = old_len + 1; mbuf->m_nextpkt = (void *)old; @@ -1384,8 +1404,23 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u 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); + rc = EINVAL; + goto fail_tx_dpl_get_max; + } + if (sfxge_tx_dpl_put_max < 0) { + log(LOG_ERR, "%s=%d must be greater or equal to 0", + SFXGE_PARAM_TX_DPL_PUT_MAX, sfxge_tx_dpl_put_max); + rc = EINVAL; + goto fail_tx_dpl_put_max; + } + /* Initialize the deferred packet list. */ stdp = &txq->dpl; + stdp->std_put_max = sfxge_tx_dpl_put_max; + stdp->std_get_max = sfxge_tx_dpl_get_max; stdp->std_getp = &stdp->std_get; mtx_init(&txq->lock, "txq", NULL, MTX_DEF); @@ -1403,6 +1438,8 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u return (0); +fail_tx_dpl_put_max: +fail_tx_dpl_get_max: fail3: fail_txq_node: free(txq->pend_desc, M_SFXGE); Modified: head/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.h Tue Sep 30 20:43:21 2014 (r272330) +++ head/sys/dev/sfxge/sfxge_tx.h Tue Sep 30 20:57:25 2014 (r272331) @@ -75,13 +75,17 @@ struct sfxge_tx_mapping { enum sfxge_tx_buf_flags flags; }; -#define SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT 64 +#define SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT 1024 #define SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT 64 /* * Deferred packet list. */ struct sfxge_tx_dpl { + unsigned int std_get_max; /* Maximum number of packets + * in get list */ + unsigned int std_put_max; /* Maximum number of packets + * in put list */ uintptr_t std_put; /* Head of put list. */ struct mbuf *std_get; /* Head of get list. */ struct mbuf **std_getp; /* Tail of get list. */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 21:04:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AC3CA2C; Tue, 30 Sep 2014 21:04:03 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED940D90; Tue, 30 Sep 2014 21:04:02 +0000 (UTC) Received: from [192.168.1.102] (p508F16E6.dip0.t-ipconnect.de [80.143.22.230]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id C387A1C104FDB; Tue, 30 Sep 2014 23:03:58 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r272326 - head/sys/netinet From: Michael Tuexen In-Reply-To: Date: Tue, 30 Sep 2014 23:03:56 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <4A8FE3A2-B085-4EBC-8E3E-F5A91129EEDE@freebsd.org> References: <201409302029.s8UKTx0e098653@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1878.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: Tue, 30 Sep 2014 21:04:03 -0000 On 30 Sep 2014, at 22:47, Adrian Chadd wrote: > Hi, >=20 > I think you should consider adding a new set of protocol counters for > UDPLITE. :) Yepp. There is http://tools.ietf.org/html/rfc5097 which needs to be implemented. Best regards Michael >=20 >=20 >=20 > -a >=20 > On 30 September 2014 13:29, Michael Tuexen wrote: >> Author: tuexen >> Date: Tue Sep 30 20:29:58 2014 >> New Revision: 272326 >> URL: http://svnweb.freebsd.org/changeset/base/272326 >>=20 >> Log: >> UDPLite requires a checksum. Therefore, discard a received packet if >> the checksum is 0. >>=20 >> MFC after: 3 days >>=20 >> Modified: >> head/sys/netinet/udp_usrreq.c >>=20 >> Modified: head/sys/netinet/udp_usrreq.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/udp_usrreq.c Tue Sep 30 20:18:10 2014 = (r272325) >> +++ head/sys/netinet/udp_usrreq.c Tue Sep 30 20:29:58 2014 = (r272326) >> @@ -498,8 +498,16 @@ udp_input(struct mbuf **mp, int *offp, i >> m_freem(m); >> return (IPPROTO_DONE); >> } >> - } else >> - UDPSTAT_INC(udps_nosum); >> + } else { >> + if (proto =3D=3D IPPROTO_UDP) { >> + UDPSTAT_INC(udps_nosum); >> + } else { >> + /* UDPLite requires a checksum */ >> + /* XXX: What is the right UDPLite MIB counter = here? */ >> + m_freem(m); >> + return (IPPROTO_DONE); >> + } >> + } >>=20 >> pcbinfo =3D get_inpcbinfo(proto); >> if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || >>=20 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 21:28:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D42CC495; Tue, 30 Sep 2014 21:28:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFA9AD3; Tue, 30 Sep 2014 21:28: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 s8ULS55D027915; Tue, 30 Sep 2014 21:28:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ULS5je027914; Tue, 30 Sep 2014 21:28:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409302128.s8ULS5je027914@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 30 Sep 2014 21:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272333 - 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: Tue, 30 Sep 2014 21:28:05 -0000 Author: ian Date: Tue Sep 30 21:28:05 2014 New Revision: 272333 URL: http://svnweb.freebsd.org/changeset/base/272333 Log: When building the lists of available memory, actually honor the exclusion flags, like the comment says it does. Pointy hat: ian Submitted by: Svatopluk Kraus Modified: head/sys/arm/arm/physmem.c Modified: head/sys/arm/arm/physmem.c ============================================================================== --- head/sys/arm/arm/physmem.c Tue Sep 30 21:03:17 2014 (r272332) +++ head/sys/arm/arm/physmem.c Tue Sep 30 21:28:05 2014 (r272333) @@ -168,6 +168,12 @@ regions_to_avail(vm_paddr_t *avail, uint end = hwp->size + start; realmem += arm32_btop(end - start); for (exi = 0, exp = exregions; exi < excnt; ++exi, ++exp) { + /* + * If the excluded region does not match given flags, + * continue checking with the next excluded region. + */ + if ((exp->flags & exflags) == 0) + continue; xstart = exp->addr; xend = exp->size + xstart; /* From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 22:19:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 820428F2; Tue, 30 Sep 2014 22:19:55 +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 E6DE0C15; Tue, 30 Sep 2014 22:19:54 +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 D7A1425D387C; Tue, 30 Sep 2014 22:19:50 +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 033E4C7709A; Tue, 30 Sep 2014 22:19:50 +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 TpeX8bt8Ohkt; Tue, 30 Sep 2014 22:19:48 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f0c1:ca19:2fb1:f851] (unknown [IPv6:fde9:577b:c1a9:4410:f0c1:ca19:2fb1:f851]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 29546C77087; Tue, 30 Sep 2014 22:19:46 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r272329 - head/share/man/man4 From: "Bjoern A. Zeeb" In-Reply-To: <201409302038.s8UKcbTn003653@svn.freebsd.org> Date: Tue, 30 Sep 2014 22:19:40 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201409302038.s8UKcbTn003653@svn.freebsd.org> To: "George V. Neville-Neil" X-Mailer: Apple Mail (2.1878.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: Tue, 30 Sep 2014 22:19:55 -0000 On 30 Sep 2014, at 20:38 , George V. Neville-Neil = wrote: > Author: gnn > Date: Tue Sep 30 20:38:36 2014 > New Revision: 272329 > URL: http://svnweb.freebsd.org/changeset/base/272329 >=20 > Log: > Update SolarFlare driver manual page with new tunables. >=20 > Submitted by: Andrew Rybchenko > Sponsored by: Solarflare Communications, Inc. >=20 You should bump .Dd > Modified: > head/share/man/man4/sfxge.4 >=20 > Modified: head/share/man/man4/sfxge.4 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/man/man4/sfxge.4 Tue Sep 30 20:36:07 2014 = (r272328) > +++ head/share/man/man4/sfxge.4 Tue Sep 30 20:38:36 2014 = (r272329) > @@ -76,6 +76,32 @@ The > .Nm > driver supports all 10Gb Ethernet adapters based on Solarflare SFC9000 > family controllers. > +.Sh LOADER TUNABLES > +Tunables can be set at the > +.Xr loader 8 > +prompt before booting the kernel or stored in > +.Xr loader.conf 5 . > +Actual values can be obtained using > +.Xr sysctl 8 . > +.Bl -tag -width indent > +.It Va hw.sfxge.rx_ring > +Maximum number of descriptors in a receive queue ring. > +Supported values are: 512, 1024, 2048 and 4096. > +.It Va hw.sfxge.tx_ring > +Maximum number of descriptors in a transmit queue ring. > +Supported values are: 512, 1024, 2048 and 4096. > +.It Va hw.sfxge.tx_dpl_get_max > +The maximum length of the deferred packet 'get-list' for queued = transmit > +packets, used only if the transmit queue lock can be acquired. > +If packet is dropped, \fItx_early_drops\fR counter grows and local = sender > +gets ENOBUFS error. > +Value must be greater than 0. > +.It Va hw.sfxge.tx_dpl_put_max > +The maximum length of the deferred packet 'put-list' for queued = transmit > +packets, used if the transmit queue lock cannot be acquired. > +If packet is dropped, \fItx_early_drops\fR counter grows and local = sender > +gets ENOBUFS error. > +Value must be greater or equal to 0. > .Sh SUPPORT > For general information and support, > go to the Solarflare support website at: >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 23:01:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8204F3CD; Tue, 30 Sep 2014 23:01: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 55C6812E; Tue, 30 Sep 2014 23:01: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 s8UN1CnO075265; Tue, 30 Sep 2014 23:01:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UN1CIu075264; Tue, 30 Sep 2014 23:01:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409302301.s8UN1CIu075264@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 30 Sep 2014 23:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272334 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 30 Sep 2014 23:01:12 -0000 Author: ian Date: Tue Sep 30 23:01:11 2014 New Revision: 272334 URL: http://svnweb.freebsd.org/changeset/base/272334 Log: Return the actual baud rate programmed in the hardware rather than 115200. This allows the "3wire" entry in /etc/ttys (with no speed specified) to work. Modified: head/sys/dev/uart/uart_dev_imx.c Modified: head/sys/dev/uart/uart_dev_imx.c ============================================================================== --- head/sys/dev/uart/uart_dev_imx.c Tue Sep 30 21:28:05 2014 (r272333) +++ head/sys/dev/uart/uart_dev_imx.c Tue Sep 30 23:01:11 2014 (r272334) @@ -90,6 +90,45 @@ imx_uart_probe(struct uart_bas *bas) return (0); } +static u_int +imx_uart_getbaud(struct uart_bas *bas) +{ + uint32_t rate, ubir, ubmr; + u_int baud, blo, bhi, i; + static const u_int predivs[] = {6, 5, 4, 3, 2, 1, 7, 1}; + static const u_int std_rates[] = { + 9600, 14400, 19200, 38400, 57600, 115200, 230400, 460800, 921600 + }; + + /* + * Get the baud rate the hardware is programmed for, then search the + * table of standard baud rates for a number that's within 3% of the + * actual rate the hardware is programmed for. It's more comforting to + * see that your console is running at 115200 than 114942. Note that + * here we cannot make a simplifying assumption that the predivider and + * numerator are 1 (like we do when setting the baud rate), because we + * don't know what u-boot might have set up. + */ + i = (GETREG(bas, REG(UFCR)) & IMXUART_UFCR_RFDIV_MASK) >> + IMXUART_UFCR_RFDIV_SHIFT; + rate = imx_ccm_uart_hz() / predivs[i]; + ubir = GETREG(bas, REG(UBIR)) + 1; + ubmr = GETREG(bas, REG(UBMR)) + 1; + baud = ((rate / 16 ) * ubir) / ubmr; + + blo = (baud * 100) / 103; + bhi = (baud * 100) / 97; + for (i = 0; i < nitems(std_rates); i++) { + rate = std_rates[i]; + if (rate >= blo && rate <= bhi) { + baud = rate; + break; + } + } + + return (baud); +} + static void imx_uart_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) @@ -348,8 +387,7 @@ imx_uart_bus_ioctl(struct uart_softc *sc /* TODO */ break; case UART_IOCTL_BAUD: - /* TODO */ - *(int*)data = 115200; + *(u_int*)data = imx_uart_getbaud(bas); break; default: error = EINVAL; From owner-svn-src-head@FreeBSD.ORG Tue Sep 30 23:16:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 945138E7; Tue, 30 Sep 2014 23:16:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8079A260; Tue, 30 Sep 2014 23:16: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 s8UNGRAh082396; Tue, 30 Sep 2014 23:16:27 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UNGRLf082395; Tue, 30 Sep 2014 23:16:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201409302316.s8UNGRLf082395@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Sep 2014 23:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272336 - 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, 30 Sep 2014 23:16:27 -0000 Author: np Date: Tue Sep 30 23:16:26 2014 New Revision: 272336 URL: http://svnweb.freebsd.org/changeset/base/272336 Log: Test for absence of M_NOFREE before attempting to purge the mbuf's tags. This will leave more state intact should the assertion go off. MFC after: 1 month Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Tue Sep 30 23:16:03 2014 (r272335) +++ head/sys/kern/kern_mbuf.c Tue Sep 30 23:16:26 2014 (r272336) @@ -447,9 +447,9 @@ mb_dtor_mbuf(void *mem, int size, void * m = (struct mbuf *)mem; flags = (unsigned long)arg; + KASSERT((m->m_flags & M_NOFREE) == 0, ("%s: M_NOFREE set", __func__)); if ((m->m_flags & M_PKTHDR) && !SLIST_EMPTY(&m->m_pkthdr.tags)) m_tag_delete_chain(m, NULL); - KASSERT((m->m_flags & M_NOFREE) == 0, ("%s: M_NOFREE set", __func__)); #ifdef INVARIANTS trash_dtor(mem, size, arg); #endif From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 01:56:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96141641; Wed, 1 Oct 2014 01:56: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 82FE65EF; Wed, 1 Oct 2014 01:56: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 s911uq3m058575; Wed, 1 Oct 2014 01:56:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s911uqmE058574; Wed, 1 Oct 2014 01:56:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201410010156.s911uqmE058574@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 1 Oct 2014 01:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272340 - 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, 01 Oct 2014 01:56:52 -0000 Author: ngie Date: Wed Oct 1 01:56:51 2014 New Revision: 272340 URL: http://svnweb.freebsd.org/changeset/base/272340 Log: Add ObsoleteFiles.inc OLD_FILES entries for libnv X-MFC with: r271241 Submitted by: pjd Pointyhat to: ngie Sponsored by: EMC / Isilon Storage Division Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Oct 1 01:50:23 2014 (r272339) +++ head/ObsoleteFiles.inc Wed Oct 1 01:56:51 2014 (r272340) @@ -43,6 +43,9 @@ OLD_FILES+=usr/share/man/man9/sleepq_cal OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz # 20140917: hv_kvpd rc.d script removed in favor of devd configuration OLD_FILES+=etc/rc.d/hv_kvpd +# 20140917: libnv was accidentally being installed to /usr/lib instead of /lib +OLD_LIBS+=usr/lib/libnv.a +OLD_LIBS+=usr/lib/libnv.so.0 # 20140814: libopie version bump OLD_LIBS+=usr/lib/libopie.so.7 OLD_LIBS+=usr/lib32/libopie.so.7 From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 01:57:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7954778C; Wed, 1 Oct 2014 01:57:27 +0000 (UTC) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34CCD5F5; Wed, 1 Oct 2014 01:57:27 +0000 (UTC) Received: by mail-pa0-f47.google.com with SMTP id rd3so205776pab.34 for ; Tue, 30 Sep 2014 18:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=T2ZktMgBQI2Vbnb5VwskOS5qA3qyjqhhECcHtpWqhug=; b=VxoD7I1uf0/GeuJvNkbFVbQsatGTu+qOvDbQZeaxGld2r9xYj0YM0ULnvTwD/trF9M vUawCloJCC865qWp7MJGoXZOsILh76UK6TLKXT4PlNrEexvFBef4M3YmY/hsOp6Z92Nu XN4mdAQcdKSbk781YEZp92SMB0gCGw/7zn6SW5S44QESNcdnt3pZ428tycuwB0SnD+QE aJJ1Q2Jid/wUqjnhm2n4pL4Mm1HIUNDho0iJOvzQh9R3owucD4fMp7pM0aV2f0Hp8hTj iFsPvp9gEYDpgFPzZZw5QMaPtEUxxjb29YIz+KQucrAEvpqDj4FjoXMD8hxM60+RSJ3R s0Pg== X-Received: by 10.69.31.1 with SMTP id ki1mr29985277pbd.100.1412128646762; Tue, 30 Sep 2014 18:57:26 -0700 (PDT) Received: from [192.168.242.58] (c-67-182-131-225.hsd1.wa.comcast.net. [67.182.131.225]) by mx.google.com with ESMTPSA id uf6sm16440307pac.16.2014.09.30.18.57.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Sep 2014 18:57:25 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_2932E80C-83E4-4549-AD45-09AB8733F71F"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r271241 - head/lib/libnv From: Garrett Cooper In-Reply-To: <20140929120336.GB2194@garage.freebsd.pl> Date: Tue, 30 Sep 2014 18:57:22 -0700 Message-Id: <2C13A741-B518-4ABB-A0E5-7895095C79DC@gmail.com> References: <201409072256.s87MuvIl059453@svn.freebsd.org> <20140929120336.GB2194@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Garrett Cooper 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, 01 Oct 2014 01:57:27 -0000 --Apple-Mail=_2932E80C-83E4-4549-AD45-09AB8733F71F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Sep 29, 2014, at 5:03, Pawel Jakub Dawidek wrote: > On Sun, Sep 07, 2014 at 10:56:57PM +0000, Garrett Cooper wrote: >> Author: ngie >> Date: Sun Sep 7 22:56:57 2014 >> New Revision: 271241 >> URL: http://svnweb.freebsd.org/changeset/base/271241 >>=20 >> Log: >> Include src.opts.mk after SHLIBDIR has been defined so libnv is = installed to >> /lib , not /usr/lib >=20 > Don't forget to add /usr/lib/libnv* to ObsoleteFiles.inc. Fixed in r272340 =97 thank you! --Apple-Mail=_2932E80C-83E4-4549-AD45-09AB8733F71F 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 iQEcBAEBCgAGBQJUK1+DAAoJEMZr5QU6S73etP0H/jW0OMM5wODYp4sSnAoFqg+5 SHpVrfGndXOcdv7+fYAnMIQqT3RZ/3iSzhp1Ht/EMyp/Ozr6LqRF+DxSSXarYG/5 FR7PNHG8P1N4RcumKYiC8k6pnPLXyKH2pdzZey7PJeCNM/rzDOhbwP7HfpyAC1h/ Q0lKPm4yFEG5/OGvrFw3dMT5nisC4eIYn9+lJcjXkmVaVaOSaRtTEztAOpOrs+zU X/ZvD0IHjD35jCPNwXmlMhxR2YKMlu7HYzGWhTntwNCTBStxSYwWmrNucYTvINwZ 8l06a5HuA4hIYXKD1SjM2KGpgjDQfWADVI8EqX46pbaITGq60HdJN8CXv+NFs4k= =NEYb -----END PGP SIGNATURE----- --Apple-Mail=_2932E80C-83E4-4549-AD45-09AB8733F71F-- From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 04:28:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EEFB9F2; Wed, 1 Oct 2014 04:28:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B69775A; Wed, 1 Oct 2014 04:28: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 s914Sekx031693; Wed, 1 Oct 2014 04:28:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s914SetH031692; Wed, 1 Oct 2014 04:28:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201410010428.s914SetH031692@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 1 Oct 2014 04:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272346 - 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: Wed, 01 Oct 2014 04:28:40 -0000 Author: markj Date: Wed Oct 1 04:28:39 2014 New Revision: 272346 URL: https://svnweb.freebsd.org/changeset/base/272346 Log: Correct the way that libelf is linked when USDT is used. Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Oct 1 04:12:38 2014 (r272345) +++ head/share/mk/bsd.dep.mk Wed Oct 1 04:28:39 2014 (r272346) @@ -123,8 +123,8 @@ ${_YC:R}.o: ${_YC} # DTrace probe definitions # libelf is currently needed for drti.o .if ${SRCS:M*.d} -LDFLAGS+= -lelf -LDADD+= ${LIBELF} +LDADD+= -lelf +DPADD+= ${LIBELF} CFLAGS+= -I${.OBJDIR} .endif .for _DSRC in ${SRCS:M*.d:N*/*} From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 05:43:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EB881E5C; Wed, 1 Oct 2014 05:43:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80F208BC; Wed, 1 Oct 2014 05:43: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 s915hUYg068774; Wed, 1 Oct 2014 05:43:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s915hTKc068771; Wed, 1 Oct 2014 05:43:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201410010543.s915hTKc068771@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 1 Oct 2014 05:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272347 - in head: share/man/man4 sys/netinet 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: Wed, 01 Oct 2014 05:43:30 -0000 Author: tuexen Date: Wed Oct 1 05:43:29 2014 New Revision: 272347 URL: https://svnweb.freebsd.org/changeset/base/272347 Log: The default for UDPLITE_RECV_CSCOV is zero. RFC 3828 recommend that this means full checksum coverage for received packets. If an application is willing to accept packets with partial coverage, it is expected to use the socekt option and provice the minimum coverage it accepts. Reviewed by: kevlo MFC after: 3 days Modified: head/share/man/man4/udplite.4 head/sys/netinet/udp_usrreq.c head/sys/netinet6/udp6_usrreq.c Modified: head/share/man/man4/udplite.4 ============================================================================== --- head/share/man/man4/udplite.4 Wed Oct 1 04:28:39 2014 (r272346) +++ head/share/man/man4/udplite.4 Wed Oct 1 05:43:29 2014 (r272347) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 7, 2014 +.Dd October 1, 2014 .Dt UDPLITE 4 .Os .Sh NAME @@ -55,16 +55,16 @@ and tested with .Bl -tag -width ".Dv UDPLITE_SEND_CSCOV" .It Dv UDPLITE_SEND_CSCOV This option sets the sender checksum coverage. -A value of zero indicates that the entire packet -is covered by the checksum. -A value of 1 to 7 must be discarded by the receiver. +A value of zero indicates that all sent packets will have +full checksum coverage. +A value of 8 to 65535 limits the checksum coverage of all sent packets +to the value given. .It Dv UDPLITE_RECV_CSCOV This option is the receiver-side analogue. -It is truly optional, i.e. not required to enable traffic -with partial checksum coverage. -Its function is that of a traffic filter: -when enabled, it instructs the kernel to drop -all packets which have a coverage less than this value. +A value of zero instructs the kernel to drop all received packets +not having full checksum coverage. +A value of 8 to 65535 instructs the kernel to drop all received +packets with a partial checksum coverage smaller than the value specified. .El .Sh ERRORS A socket operation may fail with one of the following errors returned: Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Wed Oct 1 04:28:39 2014 (r272346) +++ head/sys/netinet/udp_usrreq.c Wed Oct 1 05:43:29 2014 (r272347) @@ -689,7 +689,7 @@ udp_input(struct mbuf **mp, int *offp, i struct udpcb *up; up = intoudpcb(inp); - if (up->u_rxcslen > len) { + if (up->u_rxcslen == 0 || up->u_rxcslen > len) { INP_RUNLOCK(inp); m_freem(m); return (IPPROTO_DONE); Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Wed Oct 1 04:28:39 2014 (r272346) +++ head/sys/netinet6/udp6_usrreq.c Wed Oct 1 05:43:29 2014 (r272347) @@ -261,7 +261,7 @@ udp6_input(struct mbuf **mp, int *offp, if (uh_sum != 0) { UDPSTAT_INC(udps_badsum); - goto badunlocked; + /*goto badunlocked;*/ } /* @@ -481,7 +481,7 @@ udp6_input(struct mbuf **mp, int *offp, INP_RLOCK_ASSERT(inp); up = intoudpcb(inp); if (cscov_partial) { - if (up->u_rxcslen > ulen) { + if (up->u_rxcslen == 0 || up->u_rxcslen > ulen) { INP_RUNLOCK(inp); m_freem(m); return (IPPROTO_DONE); From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 07:15:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38015558; Wed, 1 Oct 2014 07:15:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2453A1DF; Wed, 1 Oct 2014 07:15:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s917F3Mt012077; Wed, 1 Oct 2014 07:15:03 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s917F3gG012076; Wed, 1 Oct 2014 07:15:03 GMT (envelope-from des@FreeBSD.org) Message-Id: <201410010715.s917F3gG012076@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Wed, 1 Oct 2014 07:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272348 - head/lib/libpam/modules/pam_login_access X-SVN-Group: head MIME-Version: 1.0 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, 01 Oct 2014 07:15:03 -0000 Author: des Date: Wed Oct 1 07:15:02 2014 New Revision: 272348 URL: https://svnweb.freebsd.org/changeset/base/272348 Log: Consistently cast tty and user to const char * in printf()-like contexts. Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c ============================================================================== --- head/lib/libpam/modules/pam_login_access/pam_login_access.c Wed Oct 1 05:43:29 2014 (r272347) +++ head/lib/libpam/modules/pam_login_access/pam_login_access.c Wed Oct 1 07:15:02 2014 (r272348) @@ -85,20 +85,21 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int if (login_access(user, rhost) != 0) return (PAM_SUCCESS); PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", - user, rhost); + (const char *)user, (const char *)rhost); } else if (tty != NULL && *(const char *)tty != '\0') { PAM_LOG("Checking login.access for user %s on tty %s", (const char *)user, (const char *)tty); if (login_access(user, tty) != 0) return (PAM_SUCCESS); PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", - user, tty); + (const char *)user, (const char *)tty); } else { PAM_LOG("Checking login.access for user %s", (const char *)user); if (login_access(user, "***unknown***") != 0) return (PAM_SUCCESS); - PAM_VERBOSE_ERROR("%s is not allowed to log in", user); + PAM_VERBOSE_ERROR("%s is not allowed to log in", + (const char *)user); } return (PAM_AUTH_ERR); From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 07:34:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 382CC9ED; Wed, 1 Oct 2014 07:34: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 244AE616; Wed, 1 Oct 2014 07:34: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 s917YoBJ021296; Wed, 1 Oct 2014 07:34:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s917Yofc021295; Wed, 1 Oct 2014 07:34:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410010734.s917Yofc021295@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 1 Oct 2014 07:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272349 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 01 Oct 2014 07:34:50 -0000 Author: hselasky Date: Wed Oct 1 07:34:49 2014 New Revision: 272349 URL: https://svnweb.freebsd.org/changeset/base/272349 Log: Set default cycle state in case of early interrupts. MFC after: 3 days Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Wed Oct 1 07:15:02 2014 (r272348) +++ head/sys/dev/usb/controller/xhci.c Wed Oct 1 07:34:49 2014 (r272349) @@ -614,6 +614,10 @@ xhci_init(struct xhci_softc *sc, device_ sc->sc_bus.devices = sc->sc_devices; sc->sc_bus.devices_max = XHCI_MAX_DEVICES; + /* set default cycle state in case of early interrupts */ + sc->sc_event_ccs = 1; + sc->sc_command_ccs = 1; + /* setup command queue mutex and condition varible */ cv_init(&sc->sc_cmd_cv, "CMDQ"); sx_init(&sc->sc_cmd_sx, "CMDQ lock"); From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 08:26:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12A19B66; Wed, 1 Oct 2014 08:26: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 D5786C67; Wed, 1 Oct 2014 08:26: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 s918QvTr045522; Wed, 1 Oct 2014 08:26:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s918Qqn5045488; Wed, 1 Oct 2014 08:26:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410010826.s918Qqn5045488@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 1 Oct 2014 08:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272350 - in head: . gnu/lib/csu gnu/lib/libgcc gnu/lib/libgcov gnu/lib/libstdc++ gnu/lib/libsupc++ gnu/usr.bin/cc gnu/usr.bin/cc/cc_tools lib/clang lib/libc/arm lib/libc/arm/gen lib/li... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 01 Oct 2014 08:26:58 -0000 Author: andrew Date: Wed Oct 1 08:26:51 2014 New Revision: 272350 URL: https://svnweb.freebsd.org/changeset/base/272350 Log: Remove MK_ARM_EABI, the armeb issues have been fixed. The code to support the oabi is still in the tree, but it is expected this will be removed as developers work on surrounding code. With this commit the ARM EABI is the only supported supported ABI by FreeBSD on ARMa 32-bit processors. X-MFC after: never Relnotes: yes Differential Revision: https://reviews.freebsd.org/D876 Deleted: head/lib/libc/arm/Symbol_oabi.map Modified: head/Makefile.inc1 head/gnu/lib/csu/Makefile head/gnu/lib/libgcc/Makefile head/gnu/lib/libgcov/Makefile head/gnu/lib/libstdc++/Makefile head/gnu/lib/libsupc++/Makefile head/gnu/usr.bin/cc/Makefile.inc head/gnu/usr.bin/cc/cc_tools/Makefile head/lib/clang/clang.build.mk head/lib/libc/arm/Makefile.inc head/lib/libc/arm/gen/Makefile.inc head/lib/libc/quad/Makefile.inc head/lib/libcompiler_rt/Makefile head/lib/libstand/Makefile head/libexec/rtld-elf/Makefile head/share/mk/src.opts.mk head/sys/boot/arm/ixp425/boot2/Makefile head/sys/boot/libstand32/Makefile head/sys/conf/Makefile.arm head/sys/conf/kern.opts.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Oct 1 07:34:49 2014 (r272349) +++ head/Makefile.inc1 Wed Oct 1 08:26:51 2014 (r272350) @@ -336,7 +336,7 @@ XFLAGS+= -B${CROSS_BINUTILS_PREFIX} .else XFLAGS+= -B${WORLDTMP}/usr/bin .endif -.if ${TARGET} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET} == "arm" .if ${TARGET_ARCH:M*eb*} == "" TARGET_ABI= gnueabi .elif ${TARGET_ARCH} == "armv6hf" Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Wed Oct 1 07:34:49 2014 (r272349) +++ head/gnu/lib/csu/Makefile Wed Oct 1 08:26:51 2014 (r272350) @@ -24,7 +24,7 @@ CFLAGS+= -I${GCCLIB}/include -I${GCCDIR} CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} MKDEP= -DCRT_BEGIN -.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI .endif Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Wed Oct 1 07:34:49 2014 (r272349) +++ head/gnu/lib/libgcc/Makefile Wed Oct 1 08:26:51 2014 (r272350) @@ -15,7 +15,7 @@ MK_SSP= no .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" -.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI .endif @@ -56,7 +56,7 @@ LIB2FUNCS+= _fixuns${mode}si .endfor # Likewise double-word routines. -.if ${TARGET_CPUARCH} != "arm" || ${MK_ARM_EABI} == "no" +.if ${TARGET_CPUARCH} != "arm" # These are implemented in an ARM specific file but will not be filtered out .for mode in sf df xf tf LIB2FUNCS+= _fix${mode}di _fixuns${mode}di @@ -117,14 +117,10 @@ CFLAGS.clang+= -fheinous-gnu-extensions LIB1ASMSRC = lib1funcs.asm LIB1ASMFUNCS = _dvmd_tls _bb_init_func -.if ${MK_ARM_EABI} != "no" LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c # Some compilers generate __aeabi_ functions libgcc_s is missing DPADD+= ${LIBCOMPILER_RT} LDADD+= -lcompiler_rt -.else -LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c -.endif .endif .if ${TARGET_CPUARCH} == mips @@ -319,7 +315,7 @@ CLEANFILES += cs-*.h option* SHLIB_MKMAP = ${GCCDIR}/mkmap-symver.awk SHLIB_MKMAP_OPTS = SHLIB_MAPFILES = ${GCCDIR}/libgcc-std.ver -.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_CPUARCH} == "arm" SHLIB_MAPFILES += ${GCCDIR}/config/arm/libgcc-bpabi.ver .endif VERSION_MAP = libgcc.map Modified: head/gnu/lib/libgcov/Makefile ============================================================================== --- head/gnu/lib/libgcov/Makefile Wed Oct 1 07:34:49 2014 (r272349) +++ head/gnu/lib/libgcov/Makefile Wed Oct 1 08:26:51 2014 (r272350) @@ -17,7 +17,7 @@ CFLAGS+= -D_PTHREADS -DGTHREAD_USE_WEAK CFLAGS+= -I${.CURDIR}/../../usr.bin/cc/cc_tools \ -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. -.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI .endif Modified: head/gnu/lib/libstdc++/Makefile ============================================================================== --- head/gnu/lib/libstdc++/Makefile Wed Oct 1 07:34:49 2014 (r272349) +++ head/gnu/lib/libstdc++/Makefile Wed Oct 1 08:26:51 2014 (r272350) @@ -16,9 +16,6 @@ LIB= stdc++ SHLIB_MAJOR= 6 CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} == "no" -CFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1 -.endif CFLAGS+= -I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include CFLAGS+= -I${GCCLIB}/include -I${SRCDIR}/include -I. CFLAGS+= -frandom-seed=RepeatabilityConsideredGood @@ -596,7 +593,7 @@ gthr-default.h: ${GCCDIR}/gthr-posix.h CLEANFILES+= ${THRHDRS} -.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${MACHINE_CPUARCH} == "arm" unwind.h: ${GCCDIR}/config/arm/unwind-arm.h .else unwind.h: ${GCCDIR}/unwind-generic.h Modified: head/gnu/lib/libsupc++/Makefile ============================================================================== --- head/gnu/lib/libsupc++/Makefile Wed Oct 1 07:34:49 2014 (r272349) +++ head/gnu/lib/libsupc++/Makefile Wed Oct 1 08:26:51 2014 (r272350) @@ -22,9 +22,6 @@ SRCS+= del_op.cc del_opnt.cc del_opv.cc SRCS+= cp-demangle.c CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} == "no" -CFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1 -.endif CFLAGS+= -I${GCCLIB}/include -I${SRCDIR} -I${GCCDIR} CFLAGS+= -I${.CURDIR}/../libstdc++ -I. CFLAGS+= -frandom-seed=RepeatabilityConsideredGood @@ -35,7 +32,7 @@ HDRS= exception new typeinfo cxxabi.h ex INCS= ${HDRS:S;^;${SRCDIR}/;} INCSDIR=${INCLUDEDIR}/c++/${GCCVER} -.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${MACHINE_CPUARCH} == "arm" unwind.h: ${GCCDIR}/config/arm/unwind-arm.h .else unwind.h: ${GCCDIR}/unwind-generic.h Modified: head/gnu/usr.bin/cc/Makefile.inc ============================================================================== --- head/gnu/usr.bin/cc/Makefile.inc Wed Oct 1 07:34:49 2014 (r272349) +++ head/gnu/usr.bin/cc/Makefile.inc Wed Oct 1 08:26:51 2014 (r272350) @@ -27,7 +27,7 @@ CSTD?= gnu89 CFLAGS+= -DCROSS_DIRECTORY_STRUCTURE .endif -.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI .endif Modified: head/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile Wed Oct 1 07:34:49 2014 (r272349) +++ head/gnu/usr.bin/cc/cc_tools/Makefile Wed Oct 1 08:26:51 2014 (r272350) @@ -51,10 +51,8 @@ TARGET_INC+= ${GCC_CPU}/elf.h .endif .if ${TARGET_CPUARCH} == "arm" TARGET_INC+= ${GCC_CPU}/aout.h -.if ${MK_ARM_EABI} != "no" TARGET_INC+= ${GCC_CPU}/bpabi.h .endif -.endif .if ${TARGET_ARCH} == "powerpc64" TARGET_INC+= ${GCC_CPU}/biarch64.h TARGET_INC+= ${GCC_CPU}/default64.h @@ -352,7 +350,7 @@ gthr-default.h: ${GCCDIR}/gthr-posix.h GENSRCS+= gthr-default.h -.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_CPUARCH} == "arm" unwind.h: ${GCCDIR}/config/arm/unwind-arm.h .else unwind.h: ${GCCDIR}/unwind-generic.h Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Wed Oct 1 07:34:49 2014 (r272349) +++ head/lib/clang/clang.build.mk Wed Oct 1 08:26:51 2014 (r272350) @@ -22,8 +22,7 @@ CFLAGS+= -fno-strict-aliasing TARGET_ARCH?= ${MACHINE_ARCH} BUILD_ARCH?= ${MACHINE_ARCH} -.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \ - ${MK_ARM_EABI} != "no" +.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") TARGET_ABI= gnueabi .elif ${TARGET_ARCH} == "armv6hf" TARGET_ABI= gnueabihf Modified: head/lib/libc/arm/Makefile.inc ============================================================================== --- head/lib/libc/arm/Makefile.inc Wed Oct 1 07:34:49 2014 (r272349) +++ head/lib/libc/arm/Makefile.inc Wed Oct 1 08:26:51 2014 (r272350) @@ -9,12 +9,7 @@ SOFTFLOAT_BITS=32 MDSRCS+=machdep_ldisd.c SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol.map -.if ${MK_ARM_EABI} == "no" -# This contains the symbols that were removed when moving to the ARM EABI -SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_oabi.map -.else .include "${LIBC_SRCTOP}/arm/aeabi/Makefile.inc" -.endif .if ${MACHINE_ARCH} == "armv6hf" SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_vfp.map Modified: head/lib/libc/arm/gen/Makefile.inc ============================================================================== --- head/lib/libc/arm/gen/Makefile.inc Wed Oct 1 07:34:49 2014 (r272349) +++ head/lib/libc/arm/gen/Makefile.inc Wed Oct 1 08:26:51 2014 (r272350) @@ -6,10 +6,6 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S flt_rounds.c \ arm_initfini.c -.if ${MK_ARM_EABI} == "no" -SRCS+= divsi3.S -.endif - .if ${MACHINE_ARCH} == "armv6hf" SRCS+= fpgetmask_vfp.c fpgetround_vfp.c fpgetsticky_vfp.c fpsetmask_vfp.c \ fpsetround_vfp.c fpsetsticky_vfp.c Modified: head/lib/libc/quad/Makefile.inc ============================================================================== --- head/lib/libc/quad/Makefile.inc Wed Oct 1 07:34:49 2014 (r272349) +++ head/lib/libc/quad/Makefile.inc Wed Oct 1 08:26:51 2014 (r272350) @@ -8,7 +8,7 @@ SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c -.elif ${LIBC_ARCH} == "arm" && ${MK_ARM_EABI} != "no" +.elif ${LIBC_ARCH} == "arm" SRCS+= adddi3.c anddi3.c floatunsdidf.c iordi3.c lshldi3.c notdi2.c \ qdivrem.c subdi3.c xordi3.c Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Wed Oct 1 07:34:49 2014 (r272349) +++ head/lib/libcompiler_rt/Makefile Wed Oct 1 08:26:51 2014 (r272350) @@ -144,8 +144,7 @@ SRCF+= adddf3 \ truncdfsf2 .endif -.if ${MACHINE_CPUARCH} != "mips" && \ - (${MACHINE_CPUARCH} != "arm" || ${MK_ARM_EABI} != "no") +.if ${MACHINE_CPUARCH} != "mips" SRCF+= divsi3 \ modsi3 \ udivsi3 \ @@ -174,7 +173,7 @@ SRCS+= ${file}.c . endif .endfor -.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${MACHINE_CPUARCH} == "arm" SRCS+= aeabi_idivmod.S \ aeabi_ldivmod.S \ aeabi_memcmp.S \ Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Wed Oct 1 07:34:49 2014 (r272349) +++ head/lib/libstand/Makefile Wed Oct 1 08:26:51 2014 (r272350) @@ -64,9 +64,6 @@ SRCS+= bcmp.c bcopy.c bzero.c ffs.c memc .if ${MACHINE_CPUARCH} == "arm" .PATH: ${.CURDIR}/../libc/arm/gen -.if ${MK_ARM_EABI} == "no" -SRCS+= divsi3.S -.else # Compiler support functions .PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/ # __clzsi2 and ctzsi2 for various builtin functions @@ -78,7 +75,6 @@ SRCS+= udivmoddi4.c udivmodsi4.c udivdi3 .PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/arm/ SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S -.endif .endif .if ${MACHINE_CPUARCH} == "powerpc" Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Wed Oct 1 07:34:49 2014 (r272349) +++ head/libexec/rtld-elf/Makefile Wed Oct 1 08:26:51 2014 (r272350) @@ -46,7 +46,7 @@ LDFLAGS+= -shared -Wl,-Bsymbolic DPADD= ${LIBC_PIC} LDADD= -lc_pic -.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${MACHINE_CPUARCH} == "arm" # Some of the required math functions (div & mod) are implemented in # libcompiler_rt on ARM. The library also needs to be placed first to be # correctly linked. As some of the functions are used before we have Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Oct 1 07:34:49 2014 (r272349) +++ head/share/mk/src.opts.mk Wed Oct 1 08:26:51 2014 (r272350) @@ -48,7 +48,6 @@ __DEFAULT_YES_OPTIONS = \ ACPI \ AMD \ APM \ - ARM_EABI \ AT \ ATM \ AUDIT \ Modified: head/sys/boot/arm/ixp425/boot2/Makefile ============================================================================== --- head/sys/boot/arm/ixp425/boot2/Makefile Wed Oct 1 07:34:49 2014 (r272349) +++ head/sys/boot/arm/ixp425/boot2/Makefile Wed Oct 1 08:26:51 2014 (r272350) @@ -17,9 +17,7 @@ FILES=${P} SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:tl}_board.c SRCS+=memchr.c memcmp.c memcpy.c memmem.c memset.c printf.c strcmp.c strcpy.c SRCS+=strlen.c ashldi3.c divsi3.S muldi3.c -.if ${MK_ARM_EABI} != "no" SRCS+=aeabi_unwind.c -.endif MAN= KERNPHYSADDR=0x180000 Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Wed Oct 1 07:34:49 2014 (r272349) +++ head/sys/boot/libstand32/Makefile Wed Oct 1 08:26:51 2014 (r272350) @@ -67,9 +67,6 @@ SRCS+= bcmp.c bcopy.c bzero.c ffs.c memc .if ${MACHINE_CPUARCH} == "arm" .PATH: ${LIBC}/arm/gen -.if ${MK_ARM_EABI} == "no" -SRCS+= divsi3.S -.else # Compiler support functions .PATH: ${.CURDIR}/../../../contrib/compiler-rt/lib/ # __clzsi2 and ctzsi2 for various builtin functions @@ -81,7 +78,6 @@ SRCS+= udivmoddi4.c udivmodsi4.c udivdi3 .PATH: ${.CURDIR}/../../../contrib/compiler-rt/lib/arm/ SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S -.endif .endif .if ${MACHINE_CPUARCH} == "powerpc" Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Wed Oct 1 07:34:49 2014 (r272349) +++ head/sys/conf/Makefile.arm Wed Oct 1 08:26:51 2014 (r272350) @@ -42,11 +42,7 @@ STRIP_FLAGS = -S # We don't support gcc's thump interwork stuff, so disable it CFLAGS.gcc += -mno-thumb-interwork -.if empty(DDB_ENABLED) -.if ${MK_ARM_EABI} == "no" -CFLAGS.gcc += -mno-apcs-frame -.endif -.elif ${MK_ARM_EABI} != "no" +.if !empty(DDB_ENABLED) CFLAGS += -funwind-tables # clang requires us to tell it to emit assembly with unwind information CFLAGS.clang += -mllvm -arm-enable-ehabi Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Wed Oct 1 07:34:49 2014 (r272349) +++ head/sys/conf/kern.opts.mk Wed Oct 1 08:26:51 2014 (r272350) @@ -23,7 +23,6 @@ # src tree. __DEFAULT_YES_OPTIONS = \ - ARM_EABI \ BLUETOOTH \ CDDL \ CRYPT \ From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 11:23:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2012B15; Wed, 1 Oct 2014 11:23: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 DBC1C391; Wed, 1 Oct 2014 11:23: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 s91BNtcT030975; Wed, 1 Oct 2014 11:23:55 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91BNtbB030974; Wed, 1 Oct 2014 11:23:55 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201410011123.s91BNtbB030974@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 1 Oct 2014 11:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272354 - 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, 01 Oct 2014 11:23:56 -0000 Author: glebius Date: Wed Oct 1 11:23:54 2014 New Revision: 272354 URL: https://svnweb.freebsd.org/changeset/base/272354 Log: Fix off by one in lagg_port_destroy(). Reported by: "Max N. Boyarov" Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Wed Oct 1 10:35:52 2014 (r272353) +++ head/sys/net/if_lagg.c Wed Oct 1 11:23:54 2014 (r272354) @@ -884,7 +884,7 @@ lagg_port_destroy(struct lagg_port *lp, /* Update detached port counters */ pval = lp->port_counters.val; - for (i = 0; i <= IFCOUNTERS; i++, pval++) { + for (i = 0; i < IFCOUNTERS; i++, pval++) { vdiff = ifp->if_get_counter(ifp, i) - *pval; sc->detached_counters.val[i] += vdiff; } From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 11:30:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88B67EB6; Wed, 1 Oct 2014 11:30: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 5BCD6676; Wed, 1 Oct 2014 11:30: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 s91BULkK032290; Wed, 1 Oct 2014 11:30:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91BULTJ032288; Wed, 1 Oct 2014 11:30:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410011130.s91BULTJ032288@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 1 Oct 2014 11:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272355 - 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: Wed, 01 Oct 2014 11:30:21 -0000 Author: mav Date: Wed Oct 1 11:30:20 2014 New Revision: 272355 URL: https://svnweb.freebsd.org/changeset/base/272355 Log: Fix couple issues with ROD tokens content. MFC after: 3 days Modified: head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Wed Oct 1 11:23:54 2014 (r272354) +++ head/sys/cam/ctl/ctl_tpc.c Wed Oct 1 11:30:20 2014 (r272355) @@ -1812,6 +1812,7 @@ tpc_create_token(struct ctl_lun *lun, st static int id = 0; struct scsi_vpd_id_descriptor *idd = NULL; struct scsi_ec_cscd_id *cscd; + struct scsi_read_capacity_data_long *dtsd; int targid_len; scsi_ulto4b(ROD_TYPE_AUR, token->type); @@ -1830,9 +1831,19 @@ tpc_create_token(struct ctl_lun *lun, st cscd->type_code = EC_CSCD_ID; cscd->luidt_pdt = T_DIRECT; memcpy(&cscd->codeset, idd, 4 + idd->length); + scsi_ulto3b(lun->be_lun->blocksize, cscd->dtsp.block_length); } - scsi_u64to8b(0, &token->body[40]); + scsi_u64to8b(0, &token->body[40]); /* XXX: Should be 128bit value. */ scsi_u64to8b(len, &token->body[48]); + + /* ROD token device type specific data (RC16 without first field) */ + dtsd = (struct scsi_read_capacity_data_long *)&token->body[88 - 8]; + scsi_ulto4b(lun->be_lun->blocksize, dtsd->length); + dtsd->prot_lbppbe = lun->be_lun->pblockexp & SRC16_LBPPBE; + scsi_ulto2b(lun->be_lun->pblockoff & SRC16_LALBA_A, dtsd->lalba_lbp); + if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) + dtsd->lalba_lbp[0] |= SRC16_LBPME | SRC16_LBPRZ; + if (port->target_devid) { targid_len = port->target_devid->len; memcpy(&token->body[120], port->target_devid->data, targid_len); @@ -1938,6 +1949,8 @@ ctl_populate_token(struct ctl_scsiio *ct token->range = &data->desc[0]; token->nrange = scsi_2btoul(data->range_descriptor_length) / sizeof(struct scsi_range_desc); + list->cursectors = tpc_ranges_length(token->range, token->nrange); + list->curbytes = (off_t)list->cursectors * lun->be_lun->blocksize; tpc_create_token(lun, port, list->curbytes, (struct scsi_token *)token->token); token->active = 0; @@ -1954,8 +1967,6 @@ ctl_populate_token(struct ctl_scsiio *ct } memcpy(list->res_token, token->token, sizeof(list->res_token)); list->res_token_valid = 1; - list->cursectors = tpc_ranges_length(token->range, token->nrange); - list->curbytes = (off_t)list->cursectors * lun->be_lun->blocksize; list->curseg = 0; list->completed = 1; list->last_active = time_uptime; From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 12:44:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48E04585; Wed, 1 Oct 2014 12:44: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 29BC7EF7; Wed, 1 Oct 2014 12:44: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 s91CiHEq069124; Wed, 1 Oct 2014 12:44:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91CiG7O069121; Wed, 1 Oct 2014 12:44:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410011244.s91CiG7O069121@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 1 Oct 2014 12:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272356 - in head/sys: arm/arm conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 01 Oct 2014 12:44:17 -0000 Author: andrew Date: Wed Oct 1 12:44:16 2014 New Revision: 272356 URL: https://svnweb.freebsd.org/changeset/base/272356 Log: Split you the syscall handling to a separate file. Added: head/sys/arm/arm/syscall.c - copied, changed from r272349, head/sys/arm/arm/trap.c Modified: head/sys/arm/arm/trap.c head/sys/conf/files.arm Copied and modified: head/sys/arm/arm/syscall.c (from r272349, head/sys/arm/arm/trap.c) ============================================================================== --- head/sys/arm/arm/trap.c Wed Oct 1 07:34:49 2014 (r272349, copy source) +++ head/sys/arm/arm/syscall.c Wed Oct 1 12:44:16 2014 (r272356) @@ -79,111 +79,24 @@ */ -#include "opt_ktrace.h" - #include __FBSDID("$FreeBSD$"); #include -#include #include #include -#include #include #include #include #include #include -#include -#ifdef KTRACE -#include -#include -#endif #include #include -#include -#include -#include -#include -#include - -#include -#include -#include #include -#include -#include -#include -#include -#include - -#include - -#ifdef KDB -#include -#endif - void swi_handler(struct trapframe *); -#include -#include - -extern char fusubailout[]; - -#ifdef DEBUG -int last_fault_code; /* For the benefit of pmap_fault_fixup() */ -#endif - -struct ksig { - int signb; - u_long code; -}; -struct data_abort { - int (*func)(struct trapframe *, u_int, u_int, struct thread *, - struct ksig *); - const char *desc; -}; - -static int dab_fatal(struct trapframe *, u_int, u_int, struct thread *, - struct ksig *); -static int dab_align(struct trapframe *, u_int, u_int, struct thread *, - struct ksig *); -static int dab_buserr(struct trapframe *, u_int, u_int, struct thread *, - struct ksig *); - -static const struct data_abort data_aborts[] = { - {dab_fatal, "Vector Exception"}, - {dab_align, "Alignment Fault 1"}, - {dab_fatal, "Terminal Exception"}, - {dab_align, "Alignment Fault 3"}, - {dab_buserr, "External Linefetch Abort (S)"}, - {NULL, "Translation Fault (S)"}, -#if (ARM_MMU_V6 + ARM_MMU_V7) != 0 - {NULL, "Translation Flag Fault"}, -#else - {dab_buserr, "External Linefetch Abort (P)"}, -#endif - {NULL, "Translation Fault (P)"}, - {dab_buserr, "External Non-Linefetch Abort (S)"}, - {NULL, "Domain Fault (S)"}, - {dab_buserr, "External Non-Linefetch Abort (P)"}, - {NULL, "Domain Fault (P)"}, - {dab_buserr, "External Translation Abort (L1)"}, - {NULL, "Permission Fault (S)"}, - {dab_buserr, "External Translation Abort (L2)"}, - {NULL, "Permission Fault (P)"} -}; - -/* Determine if a fault came from user mode */ -#define TRAP_USERMODE(tf) ((tf->tf_spsr & PSR_MODE) == PSR_USR32_MODE) - -/* Determine if 'x' is a permission fault */ -#define IS_PERMISSION_FAULT(x) \ - (((1 << ((x) & FAULT_TYPE_MASK)) & \ - ((1 << FAULT_PERM_P) | (1 << FAULT_PERM_S))) != 0) - static __inline void call_trapsignal(struct thread *td, int sig, u_long code) { @@ -195,588 +108,6 @@ call_trapsignal(struct thread *td, int s trapsignal(td, &ksi); } -void -data_abort_handler(struct trapframe *tf) -{ - struct vm_map *map; - struct pcb *pcb; - struct thread *td; - u_int user, far, fsr; - vm_prot_t ftype; - void *onfault; - vm_offset_t va; - int error = 0; - struct ksig ksig; - struct proc *p; - - - /* Grab FAR/FSR before enabling interrupts */ - far = cpu_faultaddress(); - fsr = cpu_faultstatus(); -#if 0 - printf("data abort: fault address=%p (from pc=%p lr=%p)\n", - (void*)far, (void*)tf->tf_pc, (void*)tf->tf_svc_lr); -#endif - - /* Update vmmeter statistics */ -#if 0 - vmexp.traps++; -#endif - - td = curthread; - p = td->td_proc; - - PCPU_INC(cnt.v_trap); - /* Data abort came from user mode? */ - user = TRAP_USERMODE(tf); - - if (user) { - td->td_pticks = 0; - td->td_frame = tf; - if (td->td_ucred != td->td_proc->p_ucred) - cred_update_thread(td); - - } - /* Grab the current pcb */ - pcb = td->td_pcb; - /* Re-enable interrupts if they were enabled previously */ - if (td->td_md.md_spinlock_count == 0) { - if (__predict_true(tf->tf_spsr & PSR_I) == 0) - enable_interrupts(PSR_I); - if (__predict_true(tf->tf_spsr & PSR_F) == 0) - enable_interrupts(PSR_F); - } - - - /* Invoke the appropriate handler, if necessary */ - if (__predict_false(data_aborts[fsr & FAULT_TYPE_MASK].func != NULL)) { - if ((data_aborts[fsr & FAULT_TYPE_MASK].func)(tf, fsr, far, - td, &ksig)) { - goto do_trapsignal; - } - goto out; - } - - /* - * At this point, we're dealing with one of the following data aborts: - * - * FAULT_TRANS_S - Translation -- Section - * FAULT_TRANS_P - Translation -- Page - * FAULT_DOMAIN_S - Domain -- Section - * FAULT_DOMAIN_P - Domain -- Page - * FAULT_PERM_S - Permission -- Section - * FAULT_PERM_P - Permission -- Page - * - * These are the main virtual memory-related faults signalled by - * the MMU. - */ - - /* fusubailout is used by [fs]uswintr to avoid page faulting */ - if (__predict_false(pcb->pcb_onfault == fusubailout)) { - tf->tf_r0 = EFAULT; - tf->tf_pc = (register_t)(intptr_t) pcb->pcb_onfault; - return; - } - - /* - * Make sure the Program Counter is sane. We could fall foul of - * someone executing Thumb code, in which case the PC might not - * be word-aligned. This would cause a kernel alignment fault - * further down if we have to decode the current instruction. - * XXX: It would be nice to be able to support Thumb at some point. - */ - if (__predict_false((tf->tf_pc & 3) != 0)) { - if (user) { - /* - * Give the user an illegal instruction signal. - */ - /* Deliver a SIGILL to the process */ - ksig.signb = SIGILL; - ksig.code = 0; - goto do_trapsignal; - } - - /* - * The kernel never executes Thumb code. - */ - printf("\ndata_abort_fault: Misaligned Kernel-mode " - "Program Counter\n"); - dab_fatal(tf, fsr, far, td, &ksig); - } - - va = trunc_page((vm_offset_t)far); - - /* - * It is only a kernel address space fault iff: - * 1. user == 0 and - * 2. pcb_onfault not set or - * 3. pcb_onfault set and not LDRT/LDRBT/STRT/STRBT instruction. - */ - if (user == 0 && (va >= VM_MIN_KERNEL_ADDRESS || - (va < VM_MIN_ADDRESS && vector_page == ARM_VECTORS_LOW)) && - __predict_true((pcb->pcb_onfault == NULL || - (ReadWord(tf->tf_pc) & 0x05200000) != 0x04200000))) { - map = kernel_map; - - /* Was the fault due to the FPE/IPKDB ? */ - if (__predict_false((tf->tf_spsr & PSR_MODE)==PSR_UND32_MODE)) { - - /* - * Force exit via userret() - * This is necessary as the FPE is an extension to - * userland that actually runs in a priveledged mode - * but uses USR mode permissions for its accesses. - */ - user = 1; - ksig.signb = SIGSEGV; - ksig.code = 0; - goto do_trapsignal; - } - } else { - map = &td->td_proc->p_vmspace->vm_map; - } - - /* - * We need to know whether the page should be mapped as R or R/W. On - * armv6 and later the fault status register indicates whether the - * access was a read or write. Prior to armv6, we know that a - * permission fault can only be the result of a write to a read-only - * location, so we can deal with those quickly. Otherwise we need to - * disassemble the faulting instruction to determine if it was a write. - */ -#if ARM_ARCH_6 || ARM_ARCH_7A - ftype = (fsr & FAULT_WNR) ? VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ; -#else - if (IS_PERMISSION_FAULT(fsr)) - ftype = VM_PROT_WRITE; - else { - u_int insn = ReadWord(tf->tf_pc); - - if (((insn & 0x0c100000) == 0x04000000) || /* STR/STRB */ - ((insn & 0x0e1000b0) == 0x000000b0) || /* STRH/STRD */ - ((insn & 0x0a100000) == 0x08000000)) { /* STM/CDT */ - ftype = VM_PROT_WRITE; - } else { - if ((insn & 0x0fb00ff0) == 0x01000090) /* SWP */ - ftype = VM_PROT_READ | VM_PROT_WRITE; - else - ftype = VM_PROT_READ; - } - } -#endif - - /* - * See if the fault is as a result of ref/mod emulation, - * or domain mismatch. - */ -#ifdef DEBUG - last_fault_code = fsr; -#endif - if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, - NULL, "Kernel page fault") != 0) - goto fatal_pagefault; - - if (pmap_fault_fixup(vmspace_pmap(td->td_proc->p_vmspace), va, ftype, - user)) { - goto out; - } - - onfault = pcb->pcb_onfault; - pcb->pcb_onfault = NULL; - if (map != kernel_map) { - PROC_LOCK(p); - p->p_lock++; - PROC_UNLOCK(p); - } - error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); - pcb->pcb_onfault = onfault; - - if (map != kernel_map) { - PROC_LOCK(p); - p->p_lock--; - PROC_UNLOCK(p); - } - if (__predict_true(error == 0)) - goto out; -fatal_pagefault: - if (user == 0) { - if (pcb->pcb_onfault) { - tf->tf_r0 = error; - tf->tf_pc = (register_t)(intptr_t) pcb->pcb_onfault; - return; - } - - printf("\nvm_fault(%p, %x, %x, 0) -> %x\n", map, va, ftype, - error); - dab_fatal(tf, fsr, far, td, &ksig); - } - - - if (error == ENOMEM) { - printf("VM: pid %d (%s), uid %d killed: " - "out of swap\n", td->td_proc->p_pid, td->td_name, - (td->td_proc->p_ucred) ? - td->td_proc->p_ucred->cr_uid : -1); - ksig.signb = SIGKILL; - } else { - ksig.signb = SIGSEGV; - } - ksig.code = 0; -do_trapsignal: - call_trapsignal(td, ksig.signb, ksig.code); -out: - /* If returning to user mode, make sure to invoke userret() */ - if (user) - userret(td, tf); -} - -/* - * dab_fatal() handles the following data aborts: - * - * FAULT_WRTBUF_0 - Vector Exception - * FAULT_WRTBUF_1 - Terminal Exception - * - * We should never see these on a properly functioning system. - * - * This function is also called by the other handlers if they - * detect a fatal problem. - * - * Note: If 'l' is NULL, we assume we're dealing with a prefetch abort. - */ -static int -dab_fatal(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, - struct ksig *ksig) -{ - const char *mode; - - mode = TRAP_USERMODE(tf) ? "user" : "kernel"; - - disable_interrupts(PSR_I|PSR_F); - if (td != NULL) { - printf("Fatal %s mode data abort: '%s'\n", mode, - data_aborts[fsr & FAULT_TYPE_MASK].desc); - printf("trapframe: %p\nFSR=%08x, FAR=", tf, fsr); - if ((fsr & FAULT_IMPRECISE) == 0) - printf("%08x, ", far); - else - printf("Invalid, "); - printf("spsr=%08x\n", tf->tf_spsr); - } else { - printf("Fatal %s mode prefetch abort at 0x%08x\n", - mode, tf->tf_pc); - printf("trapframe: %p, spsr=%08x\n", tf, tf->tf_spsr); - } - - printf("r0 =%08x, r1 =%08x, r2 =%08x, r3 =%08x\n", - tf->tf_r0, tf->tf_r1, tf->tf_r2, tf->tf_r3); - printf("r4 =%08x, r5 =%08x, r6 =%08x, r7 =%08x\n", - tf->tf_r4, tf->tf_r5, tf->tf_r6, tf->tf_r7); - printf("r8 =%08x, r9 =%08x, r10=%08x, r11=%08x\n", - tf->tf_r8, tf->tf_r9, tf->tf_r10, tf->tf_r11); - printf("r12=%08x, ", tf->tf_r12); - - if (TRAP_USERMODE(tf)) - printf("usp=%08x, ulr=%08x", - tf->tf_usr_sp, tf->tf_usr_lr); - else - printf("ssp=%08x, slr=%08x", - tf->tf_svc_sp, tf->tf_svc_lr); - printf(", pc =%08x\n\n", tf->tf_pc); - -#ifdef KDB - if (debugger_on_panic || kdb_active) - if (kdb_trap(fsr, 0, tf)) - return (0); -#endif - panic("Fatal abort"); - /*NOTREACHED*/ -} - -/* - * dab_align() handles the following data aborts: - * - * FAULT_ALIGN_0 - Alignment fault - * FAULT_ALIGN_1 - Alignment fault - * - * These faults are fatal if they happen in kernel mode. Otherwise, we - * deliver a bus error to the process. - */ -static int -dab_align(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, - struct ksig *ksig) -{ - - /* Alignment faults are always fatal if they occur in kernel mode */ - if (!TRAP_USERMODE(tf)) { - if (!td || !td->td_pcb->pcb_onfault) - dab_fatal(tf, fsr, far, td, ksig); - tf->tf_r0 = EFAULT; - tf->tf_pc = (int)td->td_pcb->pcb_onfault; - return (0); - } - - /* pcb_onfault *must* be NULL at this point */ - - /* Deliver a bus error signal to the process */ - ksig->code = 0; - ksig->signb = SIGBUS; - td->td_frame = tf; - - return (1); -} - -/* - * dab_buserr() handles the following data aborts: - * - * FAULT_BUSERR_0 - External Abort on Linefetch -- Section - * FAULT_BUSERR_1 - External Abort on Linefetch -- Page - * FAULT_BUSERR_2 - External Abort on Non-linefetch -- Section - * FAULT_BUSERR_3 - External Abort on Non-linefetch -- Page - * FAULT_BUSTRNL1 - External abort on Translation -- Level 1 - * FAULT_BUSTRNL2 - External abort on Translation -- Level 2 - * - * If pcb_onfault is set, flag the fault and return to the handler. - * If the fault occurred in user mode, give the process a SIGBUS. - * - * Note: On XScale, FAULT_BUSERR_0, FAULT_BUSERR_1, and FAULT_BUSERR_2 - * can be flagged as imprecise in the FSR. This causes a real headache - * since some of the machine state is lost. In this case, tf->tf_pc - * may not actually point to the offending instruction. In fact, if - * we've taken a double abort fault, it generally points somewhere near - * the top of "data_abort_entry" in exception.S. - * - * In all other cases, these data aborts are considered fatal. - */ -static int -dab_buserr(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, - struct ksig *ksig) -{ - struct pcb *pcb = td->td_pcb; - -#ifdef __XSCALE__ - if ((fsr & FAULT_IMPRECISE) != 0 && - (tf->tf_spsr & PSR_MODE) == PSR_ABT32_MODE) { - /* - * Oops, an imprecise, double abort fault. We've lost the - * r14_abt/spsr_abt values corresponding to the original - * abort, and the spsr saved in the trapframe indicates - * ABT mode. - */ - tf->tf_spsr &= ~PSR_MODE; - - /* - * We use a simple heuristic to determine if the double abort - * happened as a result of a kernel or user mode access. - * If the current trapframe is at the top of the kernel stack, - * the fault _must_ have come from user mode. - */ - if (tf != ((struct trapframe *)pcb->un_32.pcb32_sp) - 1) { - /* - * Kernel mode. We're either about to die a - * spectacular death, or pcb_onfault will come - * to our rescue. Either way, the current value - * of tf->tf_pc is irrelevant. - */ - tf->tf_spsr |= PSR_SVC32_MODE; - if (pcb->pcb_onfault == NULL) - printf("\nKernel mode double abort!\n"); - } else { - /* - * User mode. We've lost the program counter at the - * time of the fault (not that it was accurate anyway; - * it's not called an imprecise fault for nothing). - * About all we can do is copy r14_usr to tf_pc and - * hope for the best. The process is about to get a - * SIGBUS, so it's probably history anyway. - */ - tf->tf_spsr |= PSR_USR32_MODE; - tf->tf_pc = tf->tf_usr_lr; - } - } - - /* FAR is invalid for imprecise exceptions */ - if ((fsr & FAULT_IMPRECISE) != 0) - far = 0; -#endif /* __XSCALE__ */ - - if (pcb->pcb_onfault) { - tf->tf_r0 = EFAULT; - tf->tf_pc = (register_t)(intptr_t) pcb->pcb_onfault; - return (0); - } - - /* - * At this point, if the fault happened in kernel mode, we're toast - */ - if (!TRAP_USERMODE(tf)) - dab_fatal(tf, fsr, far, td, ksig); - - /* Deliver a bus error signal to the process */ - ksig->signb = SIGBUS; - ksig->code = 0; - td->td_frame = tf; - - return (1); -} - -/* - * void prefetch_abort_handler(struct trapframe *tf) - * - * Abort handler called when instruction execution occurs at - * a non existent or restricted (access permissions) memory page. - * If the address is invalid and we were in SVC mode then panic as - * the kernel should never prefetch abort. - * If the address is invalid and the page is mapped then the user process - * does no have read permission so send it a signal. - * Otherwise fault the page in and try again. - */ -void -prefetch_abort_handler(struct trapframe *tf) -{ - struct thread *td; - struct proc * p; - struct vm_map *map; - vm_offset_t fault_pc, va; - int error = 0; - struct ksig ksig; - - -#if 0 - /* Update vmmeter statistics */ - uvmexp.traps++; -#endif -#if 0 - printf("prefetch abort handler: %p %p\n", (void*)tf->tf_pc, - (void*)tf->tf_usr_lr); -#endif - - td = curthread; - p = td->td_proc; - PCPU_INC(cnt.v_trap); - - if (TRAP_USERMODE(tf)) { - td->td_frame = tf; - if (td->td_ucred != td->td_proc->p_ucred) - cred_update_thread(td); - } - fault_pc = tf->tf_pc; - if (td->td_md.md_spinlock_count == 0) { - if (__predict_true(tf->tf_spsr & PSR_I) == 0) - enable_interrupts(PSR_I); - if (__predict_true(tf->tf_spsr & PSR_F) == 0) - enable_interrupts(PSR_F); - } - - /* Prefetch aborts cannot happen in kernel mode */ - if (__predict_false(!TRAP_USERMODE(tf))) - dab_fatal(tf, 0, tf->tf_pc, NULL, &ksig); - td->td_pticks = 0; - - - /* Ok validate the address, can only execute in USER space */ - if (__predict_false(fault_pc >= VM_MAXUSER_ADDRESS || - (fault_pc < VM_MIN_ADDRESS && vector_page == ARM_VECTORS_LOW))) { - ksig.signb = SIGSEGV; - ksig.code = 0; - goto do_trapsignal; - } - - map = &td->td_proc->p_vmspace->vm_map; - va = trunc_page(fault_pc); - - /* - * See if the pmap can handle this fault on its own... - */ -#ifdef DEBUG - last_fault_code = -1; -#endif - if (pmap_fault_fixup(map->pmap, va, VM_PROT_READ, 1)) - goto out; - - if (map != kernel_map) { - PROC_LOCK(p); - p->p_lock++; - PROC_UNLOCK(p); - } - - error = vm_fault(map, va, VM_PROT_READ | VM_PROT_EXECUTE, - VM_FAULT_NORMAL); - if (map != kernel_map) { - PROC_LOCK(p); - p->p_lock--; - PROC_UNLOCK(p); - } - - if (__predict_true(error == 0)) - goto out; - - if (error == ENOMEM) { - printf("VM: pid %d (%s), uid %d killed: " - "out of swap\n", td->td_proc->p_pid, td->td_name, - (td->td_proc->p_ucred) ? - td->td_proc->p_ucred->cr_uid : -1); - ksig.signb = SIGKILL; - } else { - ksig.signb = SIGSEGV; - } - ksig.code = 0; - -do_trapsignal: - call_trapsignal(td, ksig.signb, ksig.code); - -out: - userret(td, tf); - -} - -extern int badaddr_read_1(const uint8_t *, uint8_t *); -extern int badaddr_read_2(const uint16_t *, uint16_t *); -extern int badaddr_read_4(const uint32_t *, uint32_t *); -/* - * Tentatively read an 8, 16, or 32-bit value from 'addr'. - * If the read succeeds, the value is written to 'rptr' and zero is returned. - * Else, return EFAULT. - */ -int -badaddr_read(void *addr, size_t size, void *rptr) -{ - union { - uint8_t v1; - uint16_t v2; - uint32_t v4; - } u; - int rv; - - cpu_drain_writebuf(); - - /* Read from the test address. */ - switch (size) { - case sizeof(uint8_t): - rv = badaddr_read_1(addr, &u.v1); - if (rv == 0 && rptr) - *(uint8_t *) rptr = u.v1; - break; - - case sizeof(uint16_t): - rv = badaddr_read_2(addr, &u.v2); - if (rv == 0 && rptr) - *(uint16_t *) rptr = u.v2; - break; - - case sizeof(uint32_t): - rv = badaddr_read_4(addr, &u.v4); - if (rv == 0 && rptr) - *(uint32_t *) rptr = u.v4; - break; - - default: - panic("badaddr: invalid size (%lu)", (u_long) size); - } - - /* Return EFAULT if the address was invalid, else zero */ - return (rv); -} - int cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) { @@ -784,11 +115,7 @@ cpu_fetch_syscall_args(struct thread *td register_t *ap; int error; -#ifdef __ARM_EABI__ sa->code = td->td_frame->tf_r7; -#else - sa->code = sa->insn & 0x000fffff; -#endif ap = &td->td_frame->tf_r0; if (sa->code == SYS_syscall) { sa->code = *ap++; @@ -827,17 +154,6 @@ syscall(struct thread *td, struct trapfr struct syscall_args sa; int error; -#ifndef __ARM_EABI__ - sa.insn = *(uint32_t *)(frame->tf_pc - INSN_SIZE); - switch (sa.insn & SWI_OS_MASK) { - case 0: /* XXX: we need our own one. */ - break; - default: - call_trapsignal(td, SIGILL, 0); - userret(td, frame); - return; - } -#endif sa.nap = 4; error = syscallenter(td, &sa); @@ -855,8 +171,9 @@ swi_handler(struct trapframe *frame) td->td_pticks = 0; /* - * Make sure the program counter is correctly aligned so we + * Make sure the program counter is correctly aligned so we * don't take an alignment fault trying to read the opcode. + * XXX: Fix for Thumb mode */ if (__predict_false(((frame->tf_pc - INSN_SIZE) & 3) != 0)) { call_trapsignal(td, SIGILL, 0); @@ -877,4 +194,3 @@ swi_handler(struct trapframe *frame) syscall(td, frame); } - Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Wed Oct 1 11:30:20 2014 (r272355) +++ head/sys/arm/arm/trap.c Wed Oct 1 12:44:16 2014 (r272356) @@ -79,28 +79,15 @@ */ -#include "opt_ktrace.h" - #include __FBSDID("$FreeBSD$"); #include -#include #include #include -#include #include #include -#include -#include #include -#include -#ifdef KTRACE -#include -#include -#endif -#include -#include #include #include @@ -108,28 +95,16 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include #include -#include +#include +#include #include -#include -#include - -#include +#include #ifdef KDB #include #endif - -void swi_handler(struct trapframe *); - -#include -#include - extern char fusubailout[]; #ifdef DEBUG @@ -775,106 +750,4 @@ badaddr_read(void *addr, size_t size, vo /* Return EFAULT if the address was invalid, else zero */ return (rv); -} - -int -cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) -{ - struct proc *p; - register_t *ap; - int error; - -#ifdef __ARM_EABI__ - sa->code = td->td_frame->tf_r7; -#else - sa->code = sa->insn & 0x000fffff; -#endif - ap = &td->td_frame->tf_r0; - if (sa->code == SYS_syscall) { - sa->code = *ap++; - sa->nap--; - } else if (sa->code == SYS___syscall) { - sa->code = ap[_QUAD_LOWWORD]; - sa->nap -= 2; - ap += 2; - } - p = td->td_proc; - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; - if (sa->code >= p->p_sysent->sv_size) - sa->callp = &p->p_sysent->sv_table[0]; - else - sa->callp = &p->p_sysent->sv_table[sa->code]; - sa->narg = sa->callp->sy_narg; - error = 0; - memcpy(sa->args, ap, sa->nap * sizeof(register_t)); - if (sa->narg > sa->nap) { - error = copyin((void *)td->td_frame->tf_usr_sp, sa->args + - sa->nap, (sa->narg - sa->nap) * sizeof(register_t)); - } - if (error == 0) { - td->td_retval[0] = 0; - td->td_retval[1] = 0; - } - return (error); -} - -#include "../../kern/subr_syscall.c" - -static void -syscall(struct thread *td, struct trapframe *frame) -{ - struct syscall_args sa; - int error; - -#ifndef __ARM_EABI__ - sa.insn = *(uint32_t *)(frame->tf_pc - INSN_SIZE); - switch (sa.insn & SWI_OS_MASK) { - case 0: /* XXX: we need our own one. */ - break; - default: - call_trapsignal(td, SIGILL, 0); - userret(td, frame); - return; - } -#endif - sa.nap = 4; - - error = syscallenter(td, &sa); - KASSERT(error != 0 || td->td_ar == NULL, - ("returning from syscall with td_ar set!")); - syscallret(td, error, &sa); -} - -void -swi_handler(struct trapframe *frame) -{ - struct thread *td = curthread; - - td->td_frame = frame; - - td->td_pticks = 0; - /* - * Make sure the program counter is correctly aligned so we - * don't take an alignment fault trying to read the opcode. - */ - if (__predict_false(((frame->tf_pc - INSN_SIZE) & 3) != 0)) { - call_trapsignal(td, SIGILL, 0); - userret(td, frame); - return; - } - /* - * Enable interrupts if they were enabled before the exception. - * Since all syscalls *should* come from user mode it will always - * be safe to enable them, but check anyway. - */ - if (td->td_md.md_spinlock_count == 0) { - if (__predict_true(frame->tf_spsr & PSR_I) == 0) - enable_interrupts(PSR_I); - if (__predict_true(frame->tf_spsr & PSR_F) == 0) - enable_interrupts(PSR_F); - } - - syscall(td, frame); -} - +} \ No newline at end of file Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Wed Oct 1 11:30:20 2014 (r272355) +++ head/sys/conf/files.arm Wed Oct 1 12:44:16 2014 (r272356) @@ -49,6 +49,7 @@ arm/arm/stdatomic.c standard \ arm/arm/support.S standard arm/arm/swtch.S standard arm/arm/sys_machdep.c standard +arm/arm/syscall.c standard arm/arm/trap.c standard arm/arm/uio_machdep.c standard arm/arm/undefined.c standard From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 12:47:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F164F89B; Wed, 1 Oct 2014 12:47:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE4F2F51; Wed, 1 Oct 2014 12:47: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 s91ClQMm069645; Wed, 1 Oct 2014 12:47:26 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91ClQqd069643; Wed, 1 Oct 2014 12:47:26 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410011247.s91ClQqd069643@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 1 Oct 2014 12:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272357 - in head: . lib/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 01 Oct 2014 12:47:27 -0000 Author: andrew Date: Wed Oct 1 12:47:25 2014 New Revision: 272357 URL: https://svnweb.freebsd.org/changeset/base/272357 Log: Fix the TARGET_ABI value clang uses. It shpuld be gnueabi on all ARM soft-float architectures, and gnueabihf for hard-float. Modified: head/Makefile.inc1 head/lib/clang/clang.build.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Oct 1 12:44:16 2014 (r272356) +++ head/Makefile.inc1 Wed Oct 1 12:47:25 2014 (r272357) @@ -337,10 +337,10 @@ XFLAGS+= -B${CROSS_BINUTILS_PREFIX} XFLAGS+= -B${WORLDTMP}/usr/bin .endif .if ${TARGET} == "arm" -.if ${TARGET_ARCH:M*eb*} == "" -TARGET_ABI= gnueabi -.elif ${TARGET_ARCH} == "armv6hf" +.if ${TARGET_ARCH:M*hf*} != "" TARGET_ABI= gnueabihf +.else +TARGET_ABI= gnueabi .endif .endif TARGET_ABI?= unknown Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Wed Oct 1 12:44:16 2014 (r272356) +++ head/lib/clang/clang.build.mk Wed Oct 1 12:47:25 2014 (r272357) @@ -22,10 +22,10 @@ CFLAGS+= -fno-strict-aliasing TARGET_ARCH?= ${MACHINE_ARCH} BUILD_ARCH?= ${MACHINE_ARCH} -.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") -TARGET_ABI= gnueabi -.elif ${TARGET_ARCH} == "armv6hf" +.if ${TARGET_ARCH:Marm*hf*} != "" TARGET_ABI= gnueabihf +.elif ${TARGET_ARCH:Marm*} != "" +TARGET_ABI= gnueabi .else TARGET_ABI= unknown .endif From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 13:35:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3741B65E; Wed, 1 Oct 2014 13:35:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 241937CB; Wed, 1 Oct 2014 13:35: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 s91DZgVf093691; Wed, 1 Oct 2014 13:35:42 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91DZgtV093690; Wed, 1 Oct 2014 13:35:42 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201410011335.s91DZgtV093690@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 1 Oct 2014 13:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272358 - 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: Wed, 01 Oct 2014 13:35:42 -0000 Author: glebius Date: Wed Oct 1 13:35:41 2014 New Revision: 272358 URL: https://svnweb.freebsd.org/changeset/base/272358 Log: Use rn_detachhead() instead of direct free(9) for radix tables. Sponsored by: Nginx, Inc. Modified: head/sys/netpfil/pf/pf_table.c Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Wed Oct 1 12:47:25 2014 (r272357) +++ head/sys/netpfil/pf/pf_table.c Wed Oct 1 13:35:41 2014 (r272358) @@ -1855,11 +1855,11 @@ pfr_destroy_ktable(struct pfr_ktable *kt } if (kt->pfrkt_ip4 != NULL) { RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip4); - free((caddr_t)kt->pfrkt_ip4, M_RTABLE); + rn_detachhead((void **)&kt->pfrkt_ip4); } if (kt->pfrkt_ip6 != NULL) { RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip6); - free((caddr_t)kt->pfrkt_ip6, M_RTABLE); + rn_detachhead((void **)&kt->pfrkt_ip6); } if (kt->pfrkt_shadow != NULL) pfr_destroy_ktable(kt->pfrkt_shadow, flushaddr); From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 14:12:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 188045FA; Wed, 1 Oct 2014 14:12:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E02E6C86; Wed, 1 Oct 2014 14: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 s91EC2ja012228; Wed, 1 Oct 2014 14:12:02 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91EC2Xu012227; Wed, 1 Oct 2014 14:12:02 GMT (envelope-from will@FreeBSD.org) Message-Id: <201410011412.s91EC2Xu012227@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 1 Oct 2014 14:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272359 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 01 Oct 2014 14:12:03 -0000 Author: will Date: Wed Oct 1 14:12:02 2014 New Revision: 272359 URL: https://svnweb.freebsd.org/changeset/base/272359 Log: zfsvfs_create(): Refuse to mount datasets whose names are too long. This is checked for in the zfs_snapshot_004_neg STF/ATF test (currently still in projects/zfsd rather than head). sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c: - zfsvfs_create(): Check whether the objset name fits into statfs.f_mntfromname, and return ENAMETOOLONG if not. Although the filesystem can be unmounted via the umount(8) command, any interface that relies on iterating on statfs (e.g. libzfs) will fail to find the filesystem by its objset name, and thus assume it's not mounted. This causes "zfs unmount", "zfs destroy", etc. to fail on these filesystems, whether or not -f is passed. MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: 974872 on 2013/08/09 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Oct 1 13:35:41 2014 (r272358) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Oct 1 14:12:02 2014 (r272359) @@ -870,6 +870,17 @@ zfsvfs_create(const char *osname, zfsvfs int i, error; uint64_t sa_obj; + /* + * XXX: Fix struct statfs so this isn't necessary! + * + * The 'osname' is used as the filesystem's special node, which means + * it must fit in statfs.f_mntfromname, or else it can't be + * enumerated, so libzfs_mnttab_find() returns NULL, which causes + * 'zfs unmount' to think it's not mounted when it is. + */ + if (strlen(osname) >= MNAMELEN) + return (SET_ERROR(ENAMETOOLONG)); + zfsvfs = kmem_zalloc(sizeof (zfsvfs_t), KM_SLEEP); /* From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 14:20:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2B91959; Wed, 1 Oct 2014 14:20:17 +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 73D8CD0F; Wed, 1 Oct 2014 14:20:17 +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 s91EKFm3081988 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 1 Oct 2014 18:20:15 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s91EKFeV081987; Wed, 1 Oct 2014 18:20:15 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 1 Oct 2014 18:20:15 +0400 From: Gleb Smirnoff To: Michael Tuexen Subject: Re: svn commit: r272326 - head/sys/netinet Message-ID: <20141001142015.GO73266@FreeBSD.org> References: <201409302029.s8UKTx0e098653@svn.freebsd.org> <4A8FE3A2-B085-4EBC-8E3E-F5A91129EEDE@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A8FE3A2-B085-4EBC-8E3E-F5A91129EEDE@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 01 Oct 2014 14:20:18 -0000 On Tue, Sep 30, 2014 at 11:03:56PM +0200, Michael Tuexen wrote: M> On 30 Sep 2014, at 22:47, Adrian Chadd wrote: M> M> > Hi, M> > M> > I think you should consider adding a new set of protocol counters for M> > UDPLITE. :) M> Yepp. There is M> http://tools.ietf.org/html/rfc5097 M> which needs to be implemented. For now, imho accounting it as UDPSTAT_INC(udps_nosum) would be better than dropping it into the void. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 14:35:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2E6DE0D; Wed, 1 Oct 2014 14:35:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF984F1E; Wed, 1 Oct 2014 14:35: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 s91EZqGV022180; Wed, 1 Oct 2014 14:35:52 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91EZq11022179; Wed, 1 Oct 2014 14:35:52 GMT (envelope-from will@FreeBSD.org) Message-Id: <201410011435.s91EZq11022179@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 1 Oct 2014 14:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272360 - head/sys/dev/acpica/Osd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 01 Oct 2014 14:35:53 -0000 Author: will Date: Wed Oct 1 14:35:52 2014 New Revision: 272360 URL: https://svnweb.freebsd.org/changeset/base/272360 Log: Add sysctl to track the resource consumption of ACPI interrupts. Submitted by: gibbs MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: 636827 on 2012/09/28 Modified: head/sys/dev/acpica/Osd/OsdSchedule.c Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Wed Oct 1 14:12:02 2014 (r272359) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Wed Oct 1 14:35:52 2014 (r272360) @@ -60,6 +60,13 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, max_ta 0, "Maximum acpi tasks"); /* + * Track and report the system's demand for task slots. + */ +static int acpi_tasks_hiwater; +SYSCTL_INT(_debug_acpi, OID_AUTO, tasks_hiwater, CTLFLAG_RD, + &acpi_tasks_hiwater, 1, "Peak demand for ACPI event task slots."); + +/* * Allow the user to tune the number of task threads we start. It seems * some systems have problems with increased parallelism. */ @@ -151,6 +158,10 @@ acpi_task_enqueue(int priority, ACPI_OSD acpi_task_count++; break; } + + if (i > acpi_tasks_hiwater) + atomic_cmpset_int(&acpi_tasks_hiwater, acpi_tasks_hiwater, i); + if (at == NULL) { printf("AcpiOsExecute: failed to enqueue task, consider increasing " "the debug.acpi.max_tasks tunable\n"); From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 14:39:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FDA812E; Wed, 1 Oct 2014 14:39:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 113F6F61; Wed, 1 Oct 2014 14:39: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 s91Ed7UM022639; Wed, 1 Oct 2014 14:39:07 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91Ed7K3022634; Wed, 1 Oct 2014 14:39:07 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201410011439.s91Ed7K3022634@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 1 Oct 2014 14:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272361 - in head/sys: net netinet netinet6 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: Wed, 01 Oct 2014 14:39:08 -0000 Author: melifaro Date: Wed Oct 1 14:39:06 2014 New Revision: 272361 URL: https://svnweb.freebsd.org/changeset/base/272361 Log: Remove lock init from radix.c. Radix has never managed its locking itself. The only consumer using radix with embeded rwlock is system routing table. Move per-AF lock inits there. Modified: head/sys/net/radix.c head/sys/netinet/in_rmx.c head/sys/netinet6/in6_rmx.c head/sys/netpfil/pf/pf_table.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Wed Oct 1 14:35:52 2014 (r272360) +++ head/sys/net/radix.c Wed Oct 1 14:39:06 2014 (r272361) @@ -1122,9 +1122,6 @@ rn_inithead_internal(void **head, int of R_Zalloc(rnh, struct radix_node_head *, sizeof (*rnh)); if (rnh == 0) return (0); -#ifdef _KERNEL - RADIX_NODE_HEAD_LOCK_INIT(rnh); -#endif *head = rnh; t = rn_newpair(rn_zeros, off, rnh->rnh_nodes); ttt = rnh->rnh_nodes + 2; Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Wed Oct 1 14:35:52 2014 (r272360) +++ head/sys/netinet/in_rmx.c Wed Oct 1 14:39:06 2014 (r272361) @@ -352,10 +352,12 @@ in_inithead(void **head, int off) if (!rn_inithead(head, 32)) return 0; + rnh = *head; + RADIX_NODE_HEAD_LOCK_INIT(rnh); + if (off == 0) /* XXX MRT see above */ return 1; /* only do the rest for a real routing table */ - rnh = *head; rnh->rnh_addaddr = in_addroute; in_setmatchfunc(rnh, V_drop_redirect); rnh->rnh_close = in_clsroute; Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Wed Oct 1 14:35:52 2014 (r272360) +++ head/sys/netinet6/in6_rmx.c Wed Oct 1 14:39:06 2014 (r272361) @@ -270,10 +270,12 @@ in6_inithead(void **head, int off) if (!rn_inithead(head, offsetof(struct sockaddr_in6, sin6_addr) << 3)) return 0; /* See above */ + rnh = *head; + RADIX_NODE_HEAD_LOCK_INIT(rnh); + if (off == 0) /* See above */ return 1; /* only do the rest for the real thing */ - rnh = *head; rnh->rnh_addaddr = in6_addroute; if (V__in6_rt_was_here == 0) { Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Wed Oct 1 14:35:52 2014 (r272360) +++ head/sys/netpfil/pf/pf_table.c Wed Oct 1 14:39:06 2014 (r272361) @@ -1853,14 +1853,10 @@ pfr_destroy_ktable(struct pfr_ktable *kt pfr_clean_node_mask(kt, &addrq); pfr_destroy_kentries(&addrq); } - if (kt->pfrkt_ip4 != NULL) { - RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip4); + if (kt->pfrkt_ip4 != NULL) rn_detachhead((void **)&kt->pfrkt_ip4); - } - if (kt->pfrkt_ip6 != NULL) { - RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip6); + if (kt->pfrkt_ip6 != NULL) rn_detachhead((void **)&kt->pfrkt_ip6); - } if (kt->pfrkt_shadow != NULL) pfr_destroy_ktable(kt->pfrkt_shadow, flushaddr); if (kt->pfrkt_rs != NULL) { From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 14:52:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC80E782; Wed, 1 Oct 2014 14:52:29 +0000 (UTC) Received: from winston.madpilot.net (winston.madpilot.net [78.47.75.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 357BD1CA; Wed, 1 Oct 2014 14:52:29 +0000 (UTC) Received: from winston.madpilot.net (localhost [127.0.0.1]) by winston.madpilot.net (Postfix) with ESMTP id 3j7L6253m3zFfD6; Wed, 1 Oct 2014 16:52:10 +0200 (CEST) Received: from winston.madpilot.net ([127.0.0.1]) by winston.madpilot.net (winston.madpilot.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BNxBuui9knYF; Wed, 1 Oct 2014 16:51:40 +0200 (CEST) Received: from marvin.madpilot.net (micro.madpilot.net [88.149.173.206]) by winston.madpilot.net (Postfix) with ESMTPSA; Wed, 1 Oct 2014 16:51:35 +0200 (CEST) Message-ID: <542C14F6.7020506@FreeBSD.org> Date: Wed, 01 Oct 2014 16:51:34 +0200 From: Guido Falsi User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Will Andrews , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r272282 - head/share/mk References: <201409291505.s8TF5Nhh066884@svn.freebsd.org> In-Reply-To: <201409291505.s8TF5Nhh066884@svn.freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Baptiste Daroussin 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, 01 Oct 2014 14:52:30 -0000 On 09/29/14 17:05, Will Andrews wrote: > Author: will > Date: Mon Sep 29 15:05:23 2014 > New Revision: 272282 > URL: http://svnweb.freebsd.org/changeset/base/272282 > > Log: > Search for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR. > This will only take effect if PORTSDIR is not set, as previously supported. > > Use .if exists(), for four specific possibilities relative to .CURDIR: > ., .., ../.., and ../../.. The fourth possibility is primarily in case > ports ever grows a third level. If none of these paths exist, fall back to > the old default of /usr/ports. > > This removes the need to set PORTSDIR explicitly (or via wrapper script) if > one is running out of a ports tree that is not in /usr/ports, but in a > home directory. > > Reviewed by: bapt, bdrewery (older version) > CR: D799 > MFC after: 1 week > Sponsored by: Spectra Logic > Hi, I just refreshed my machines head r272349 and this change is creating problems to me. Maybe I've always been doing something wrong but this is what is happening: root@marvin:~ [0]# cd /usr/ports/x11/nvidia-driver root@marvin:/usr/ports/x11/nvidia-driver [0]# make -V PORTSDIR /usr/ports/x11/nvidia-driver/../.. this is problematic since now all dependencies are relative paths, this is said to be unsupported in bsd.sanity.mk, line 35 and following ones. It also makes poudriere builds fail: root@marvin:~ [0]# poudriere bulk -C -p mptest -t -j 11amd64 x11/xlogo ====>> Creating the reference jail... done ====>> Mounting system devices for 11amd64-mptest ====>> Mounting ports/packages/distfiles ====>> Mounting packages from: /poudriere/data/packages/11amd64-mptest ====>> Logs: /poudriere/data/logs/bulk/11amd64-mptest/2014-10-01_16h44m56s ====>> WWW: http://pkg.madpilot.net:8888/logs/bulk/11amd64-mptest/2014-10-01_16h44m56s ====>> Appending to make.conf: /usr/local/etc/poudriere.d/make.conf ====>> DEVELOPER=yes ignored from make.conf. Use 'bulk -t' or 'testport' for testing instead. /etc/resolv.conf -> /poudriere/data/build/11amd64-mptest/ref/etc/resolv.conf ====>> Starting jail 11amd64-mptest ====>> Loading MOVED ====>> Calculating ports order and dependencies ====>> Error: Duplicated origin for pkgconf-0.9.7: devel/xorg-macros/../../devel/pkgconf AND x11/xlogo/../../devel/pkgconf. Rerun with -vv to see which ports are depending on these. ====>> Cleaning up ====>> Umounting file systems (the ports nvidia-driver and xlogo in these small logs are taken at random) It also completely breaks portmaster. Maybe this patch is excessive and should first try to discover if we already are in the standard /usr/ports subtree? I have not tried but I'm quite confident I can :fix: this by adding PORTSTREE=/usr/ports in /etc/make.conf, but this does not look like a good solution. -- Guido Falsi From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 15:00:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EFA39A9; Wed, 1 Oct 2014 15:00:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EF702EB; Wed, 1 Oct 2014 15:00: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 s91F0RVH032605; Wed, 1 Oct 2014 15:00:27 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91F0LgJ032570; Wed, 1 Oct 2014 15:00:21 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410011500.s91F0LgJ032570@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 1 Oct 2014 15:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272362 - in head/lib/libc: powerpc/gen powerpc/sys powerpc64/gen powerpc64/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: Wed, 01 Oct 2014 15:00:27 -0000 Author: bapt Date: Wed Oct 1 15:00:21 2014 New Revision: 272362 URL: https://svnweb.freebsd.org/changeset/base/272362 Log: Ensure that every ENTRY(foo) has a matching END(foo). It allows to build with newer binutils Differential Revision: https://reviews.freebsd.org/D877 Reviewed by: jhibbits Modified: head/lib/libc/powerpc/gen/_ctx_start.S head/lib/libc/powerpc/gen/_setjmp.S head/lib/libc/powerpc/gen/eabi.S head/lib/libc/powerpc/gen/fabs.S head/lib/libc/powerpc/gen/setjmp.S head/lib/libc/powerpc/gen/sigsetjmp.S head/lib/libc/powerpc/sys/brk.S head/lib/libc/powerpc/sys/exect.S head/lib/libc/powerpc/sys/pipe.S head/lib/libc/powerpc/sys/ptrace.S head/lib/libc/powerpc/sys/sbrk.S head/lib/libc/powerpc64/gen/_ctx_start.S head/lib/libc/powerpc64/gen/_setjmp.S head/lib/libc/powerpc64/gen/fabs.S head/lib/libc/powerpc64/gen/setjmp.S head/lib/libc/powerpc64/gen/sigsetjmp.S head/lib/libc/powerpc64/sys/brk.S head/lib/libc/powerpc64/sys/exect.S head/lib/libc/powerpc64/sys/pipe.S head/lib/libc/powerpc64/sys/ptrace.S head/lib/libc/powerpc64/sys/sbrk.S Modified: head/lib/libc/powerpc/gen/_ctx_start.S ============================================================================== --- head/lib/libc/powerpc/gen/_ctx_start.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc/gen/_ctx_start.S Wed Oct 1 15:00:21 2014 (r272362) @@ -41,5 +41,6 @@ * above branch. */ bl PIC_PLT(CNAME(abort)) /* abort */ + END(_cts_start) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc/gen/_setjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/_setjmp.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc/gen/_setjmp.S Wed Oct 1 15:00:21 2014 (r272362) @@ -58,6 +58,7 @@ ENTRY(_setjmp) stmw %r9,20(%r3) li %r3,0 blr +END(_setjmp) ENTRY(_longjmp) lmw %r9,20(%r3) @@ -68,5 +69,6 @@ ENTRY(_longjmp) bnelr li %r3,1 blr +END(_longjmp) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc/gen/eabi.S ============================================================================== --- head/lib/libc/powerpc/gen/eabi.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc/gen/eabi.S Wed Oct 1 15:00:21 2014 (r272362) @@ -29,5 +29,6 @@ __FBSDID("$FreeBSD$"); ENTRY(__eabi) blr +END(__eabi) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc/gen/fabs.S ============================================================================== --- head/lib/libc/powerpc/gen/fabs.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc/gen/fabs.S Wed Oct 1 15:00:21 2014 (r272362) @@ -33,5 +33,6 @@ __FBSDID("$FreeBSD$"); ENTRY(fabs) fabs %f1,%f1 blr +END(fabs) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/setjmp.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc/gen/setjmp.S Wed Oct 1 15:00:21 2014 (r272362) @@ -68,6 +68,7 @@ ENTRY(setjmp) stmw %r9,20(%r6) li %r3,0 /* return (0) */ blr +END(setjmp) WEAK_REFERENCE(CNAME(__longjmp), longjmp) ENTRY(__longjmp) @@ -86,5 +87,6 @@ ENTRY(__longjmp) bnelr li %r3,1 blr +END(__longjmp) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/sigsetjmp.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc/gen/sigsetjmp.S Wed Oct 1 15:00:21 2014 (r272362) @@ -73,6 +73,7 @@ ENTRY(sigsetjmp) stmw %r9,20(%r6) li %r3,0 blr +END(sigsetjmp) ENTRY(siglongjmp) lmw %r9,20(%r3) @@ -94,5 +95,6 @@ ENTRY(siglongjmp) bnelr li %r3,1 blr +END(siglongjmp) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc/sys/brk.S ============================================================================== --- head/lib/libc/powerpc/sys/brk.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc/sys/brk.S Wed Oct 1 15:00:21 2014 (r272362) @@ -71,5 +71,6 @@ ENTRY(brk) 1: b PIC_PLT(HIDENAME(cerror)) +END(brk) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc/sys/exect.S ============================================================================== --- head/lib/libc/powerpc/sys/exect.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc/sys/exect.S Wed Oct 1 15:00:21 2014 (r272362) @@ -37,5 +37,6 @@ ENTRY(exect) blr 1: b PIC_PLT(HIDENAME(cerror)) +END(exect) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc/sys/pipe.S ============================================================================== --- head/lib/libc/powerpc/sys/pipe.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc/sys/pipe.S Wed Oct 1 15:00:21 2014 (r272362) @@ -41,5 +41,6 @@ ENTRY(pipe) blr /* and return 0 */ 1: b PIC_PLT(HIDENAME(cerror)) +END(pipe) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc/sys/ptrace.S ============================================================================== --- head/lib/libc/powerpc/sys/ptrace.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc/sys/ptrace.S Wed Oct 1 15:00:21 2014 (r272362) @@ -56,5 +56,6 @@ ENTRY(ptrace) blr 1: b PIC_PLT(HIDENAME(cerror)) +END(ptrace) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc/sys/sbrk.S ============================================================================== --- head/lib/libc/powerpc/sys/sbrk.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc/sys/sbrk.S Wed Oct 1 15:00:21 2014 (r272362) @@ -68,5 +68,6 @@ ENTRY(sbrk) blr 2: b PIC_PLT(HIDENAME(cerror)) +END(sbrk) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc64/gen/_ctx_start.S ============================================================================== --- head/lib/libc/powerpc64/gen/_ctx_start.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc64/gen/_ctx_start.S Wed Oct 1 15:00:21 2014 (r272362) @@ -46,5 +46,6 @@ nop bl CNAME(abort) /* abort */ nop + END(_ctx_start) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc64/gen/_setjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/_setjmp.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc64/gen/_setjmp.S Wed Oct 1 15:00:21 2014 (r272362) @@ -80,6 +80,7 @@ ENTRY(_setjmp) std %r31,40 + 22*8(%r3) li %r3,0 blr +END(_setjmp) ENTRY(_longjmp) ld %r9,40 + 0*8(%r3) @@ -113,5 +114,6 @@ ENTRY(_longjmp) bnelr li %r3,1 blr +END(_longjmp) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc64/gen/fabs.S ============================================================================== --- head/lib/libc/powerpc64/gen/fabs.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc64/gen/fabs.S Wed Oct 1 15:00:21 2014 (r272362) @@ -33,5 +33,6 @@ __FBSDID("$FreeBSD$"); ENTRY(fabs) fabs %f1,%f1 blr +END(fabs) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc64/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/setjmp.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc64/gen/setjmp.S Wed Oct 1 15:00:21 2014 (r272362) @@ -92,6 +92,7 @@ ENTRY(setjmp) li %r3,0 /* return (0) */ blr +END(setjmp) WEAK_REFERENCE(__longjmp, longjmp) ENTRY(__longjmp) @@ -132,5 +133,6 @@ ENTRY(__longjmp) bnelr li %r3,1 blr +END(__longjmp) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc64/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/sigsetjmp.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc64/gen/sigsetjmp.S Wed Oct 1 15:00:21 2014 (r272362) @@ -97,6 +97,7 @@ ENTRY(sigsetjmp) li %r3,0 blr +END(sigsetjmp) ENTRY(siglongjmp) ld %r9,40 + 0*8(%r3) @@ -141,5 +142,6 @@ ENTRY(siglongjmp) bnelr li %r3,1 blr +END(siglongjmp) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc64/sys/brk.S ============================================================================== --- head/lib/libc/powerpc64/sys/brk.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc64/sys/brk.S Wed Oct 1 15:00:21 2014 (r272362) @@ -69,5 +69,6 @@ ENTRY(brk) ld %r0,16(%r1) mtlr %r0 blr +END(brk) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc64/sys/exect.S ============================================================================== --- head/lib/libc/powerpc64/sys/exect.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc64/sys/exect.S Wed Oct 1 15:00:21 2014 (r272362) @@ -45,5 +45,6 @@ ENTRY(exect) ld %r0,16(%r1) mtlr %r0 blr +END(exect) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc64/sys/pipe.S ============================================================================== --- head/lib/libc/powerpc64/sys/pipe.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc64/sys/pipe.S Wed Oct 1 15:00:21 2014 (r272362) @@ -49,5 +49,6 @@ ENTRY(pipe) ld %r0,16(%r1) mtlr %r0 blr +END(pipe) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc64/sys/ptrace.S ============================================================================== --- head/lib/libc/powerpc64/sys/ptrace.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc64/sys/ptrace.S Wed Oct 1 15:00:21 2014 (r272362) @@ -63,5 +63,6 @@ ENTRY(ptrace) ld %r0,16(%r1) mtlr %r0 blr +END(ptrace) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/powerpc64/sys/sbrk.S ============================================================================== --- head/lib/libc/powerpc64/sys/sbrk.S Wed Oct 1 14:39:06 2014 (r272361) +++ head/lib/libc/powerpc64/sys/sbrk.S Wed Oct 1 15:00:21 2014 (r272362) @@ -64,5 +64,6 @@ ENTRY(sbrk) ld %r0,16(%r1) mtlr %r0 blr +END(sbrk) .section .note.GNU-stack,"",%progbits From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 15:02:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 526A3BA0; Wed, 1 Oct 2014 15:02:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2540E309; Wed, 1 Oct 2014 15:02: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 s91F2cXM036285; Wed, 1 Oct 2014 15:02:38 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91F2bOk036281; Wed, 1 Oct 2014 15:02:37 GMT (envelope-from will@FreeBSD.org) Message-Id: <201410011502.s91F2bOk036281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 1 Oct 2014 15:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272363 - 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: Wed, 01 Oct 2014 15:02:38 -0000 Author: will Date: Wed Oct 1 15:02:37 2014 New Revision: 272363 URL: https://svnweb.freebsd.org/changeset/base/272363 Log: Always resolve PORTSDIR to absolute paths using realpath(1). Reported by: madpilot Reviewed by: bapt X-MFC-With: 272282 Modified: head/share/mk/bsd.port.mk head/share/mk/bsd.port.subdir.mk Modified: head/share/mk/bsd.port.mk ============================================================================== --- head/share/mk/bsd.port.mk Wed Oct 1 15:00:21 2014 (r272362) +++ head/share/mk/bsd.port.mk Wed Oct 1 15:02:37 2014 (r272363) @@ -5,13 +5,13 @@ # in the default /usr/ports. The ../../.. case is in case ports ever grows # a third level. .if exists(${.CURDIR}/Mk/bsd.port.mk) -PORTSDIR= ${.CURDIR} +PORTSDIR!= realpath ${.CURDIR} .elif exists(${.CURDIR}/../Mk/bsd.port.mk) -PORTSDIR= ${.CURDIR}/.. +PORTSDIR!= realpath ${.CURDIR}/.. .elif exists(${.CURDIR}/../../Mk/bsd.port.mk) -PORTSDIR= ${.CURDIR}/../.. +PORTSDIR!= realpath ${.CURDIR}/../.. .elif exists(${.CURDIR}/../../../Mk/bsd.port.mk) -PORTSDIR= ${.CURDIR}/../../.. +PORTSDIR!= realpath ${.CURDIR}/../../.. .else PORTSDIR= /usr/ports .endif Modified: head/share/mk/bsd.port.subdir.mk ============================================================================== --- head/share/mk/bsd.port.subdir.mk Wed Oct 1 15:00:21 2014 (r272362) +++ head/share/mk/bsd.port.subdir.mk Wed Oct 1 15:02:37 2014 (r272363) @@ -5,13 +5,13 @@ # in the default /usr/ports. The ../../.. case is in case ports ever grows # a third level. .if exists(${.CURDIR}/Mk/bsd.port.mk) -PORTSDIR= ${.CURDIR} +PORTSDIR!= realpath ${.CURDIR} .elif exists(${.CURDIR}/../Mk/bsd.port.mk) -PORTSDIR= ${.CURDIR}/.. +PORTSDIR!= realpath ${.CURDIR}/.. .elif exists(${.CURDIR}/../../Mk/bsd.port.mk) -PORTSDIR= ${.CURDIR}/../.. +PORTSDIR!= realpath ${.CURDIR}/../.. .elif exists(${.CURDIR}/../../../Mk/bsd.port.mk) -PORTSDIR= ${.CURDIR}/../../.. +PORTSDIR!= realpath ${.CURDIR}/../../.. .else PORTSDIR= /usr/ports .endif From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 15:06:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FF67E00 for ; Wed, 1 Oct 2014 15:06:06 +0000 (UTC) Received: from mail-qg0-f43.google.com (mail-qg0-f43.google.com [209.85.192.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DC50337 for ; Wed, 1 Oct 2014 15:06:05 +0000 (UTC) Received: by mail-qg0-f43.google.com with SMTP id j107so425331qga.16 for ; Wed, 01 Oct 2014 08:06:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=hTHPjtoyQ2xgSQgXtvKW170kINj/aBb46w8Wtv5In1Q=; b=aUJJr3+0vzKWvSsYLpRkd/kz4mYmbBRlYCZWNtZfcCRD08zEJQbLj4ucOf3CL/awIb szRBCGqNzI3MIlHNQYID3tZatdjxmBicaQ4+CNwSxPkiVgujCstAkTlaXecvOM+ttPQz cF5eTTj+BXRjBIrzSbD87mNmH903sWVa7gHeXjBbIUfiGLQrtZDkB85fkgAal0ApII+C PbObAm0Cwx6ymXqYAV8tkQcqwwjwPXsovw6IJhMJBpscpsSIHgOLecSoPq2BRwBAmkEI CDxeo29FmhNT3owysTnk4i6cYQgB5oTtKjAuQH4vfcswGrvcZ2YG4aLwemW+EdcF5kiA mI7Q== X-Gm-Message-State: ALoCoQn5D8eMlHNLe4UpuW1v1fD3ptFiL7ssOEkkuc8f5sBk1JmToGozVuLSiet89rP+RG85oFZE MIME-Version: 1.0 X-Received: by 10.224.127.131 with SMTP id g3mr32389843qas.81.1412175964498; Wed, 01 Oct 2014 08:06:04 -0700 (PDT) Received: by 10.140.31.36 with HTTP; Wed, 1 Oct 2014 08:06:04 -0700 (PDT) In-Reply-To: <542C14F6.7020506@FreeBSD.org> References: <201409291505.s8TF5Nhh066884@svn.freebsd.org> <542C14F6.7020506@FreeBSD.org> Date: Wed, 1 Oct 2014 09:06:04 -0600 Message-ID: Subject: Re: svn commit: r272282 - head/share/mk From: Will Andrews To: Guido Falsi Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "src-committers@FreeBSD.org" , Baptiste Daroussin 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, 01 Oct 2014 15:06:06 -0000 If r272363 doesn't resolve the issue for you, let me know. Thanks! --Will. On Wed, Oct 1, 2014 at 8:51 AM, Guido Falsi wrote: > On 09/29/14 17:05, Will Andrews wrote: >> Author: will >> Date: Mon Sep 29 15:05:23 2014 >> New Revision: 272282 >> URL: http://svnweb.freebsd.org/changeset/base/272282 >> >> Log: >> Search for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR. >> This will only take effect if PORTSDIR is not set, as previously supported. >> >> Use .if exists(), for four specific possibilities relative to .CURDIR: >> ., .., ../.., and ../../.. The fourth possibility is primarily in case >> ports ever grows a third level. If none of these paths exist, fall back to >> the old default of /usr/ports. >> >> This removes the need to set PORTSDIR explicitly (or via wrapper script) if >> one is running out of a ports tree that is not in /usr/ports, but in a >> home directory. >> >> Reviewed by: bapt, bdrewery (older version) >> CR: D799 >> MFC after: 1 week >> Sponsored by: Spectra Logic >> > > Hi, > > I just refreshed my machines head r272349 and this change is creating > problems to me. > > Maybe I've always been doing something wrong but this is what is happening: > > root@marvin:~ [0]# cd /usr/ports/x11/nvidia-driver > root@marvin:/usr/ports/x11/nvidia-driver [0]# make -V PORTSDIR > /usr/ports/x11/nvidia-driver/../.. > > this is problematic since now all dependencies are relative paths, this > is said to be unsupported in bsd.sanity.mk, line 35 and following ones. > > It also makes poudriere builds fail: > > root@marvin:~ [0]# poudriere bulk -C -p mptest -t -j 11amd64 x11/xlogo > ====>> Creating the reference jail... done > ====>> Mounting system devices for 11amd64-mptest > ====>> Mounting ports/packages/distfiles > ====>> Mounting packages from: /poudriere/data/packages/11amd64-mptest > ====>> Logs: /poudriere/data/logs/bulk/11amd64-mptest/2014-10-01_16h44m56s > ====>> WWW: > http://pkg.madpilot.net:8888/logs/bulk/11amd64-mptest/2014-10-01_16h44m56s > ====>> Appending to make.conf: /usr/local/etc/poudriere.d/make.conf > ====>> DEVELOPER=yes ignored from make.conf. Use 'bulk -t' or 'testport' > for testing instead. > /etc/resolv.conf -> /poudriere/data/build/11amd64-mptest/ref/etc/resolv.conf > ====>> Starting jail 11amd64-mptest > ====>> Loading MOVED > ====>> Calculating ports order and dependencies > ====>> Error: Duplicated origin for pkgconf-0.9.7: > devel/xorg-macros/../../devel/pkgconf AND x11/xlogo/../../devel/pkgconf. > Rerun with -vv to see which ports are depending on these. > ====>> Cleaning up > ====>> Umounting file systems > > (the ports nvidia-driver and xlogo in these small logs are taken at random) > > It also completely breaks portmaster. > > Maybe this patch is excessive and should first try to discover if we > already are in the standard /usr/ports subtree? > > I have not tried but I'm quite confident I can :fix: this by adding > PORTSTREE=/usr/ports in /etc/make.conf, but this does not look like a > good solution. > > -- > Guido Falsi From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 15:32:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCD9FC62; Wed, 1 Oct 2014 15:32: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 A98C38ED; Wed, 1 Oct 2014 15:32: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 s91FWT3U050854; Wed, 1 Oct 2014 15:32:29 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91FWTZL050853; Wed, 1 Oct 2014 15:32:29 GMT (envelope-from will@FreeBSD.org) Message-Id: <201410011532.s91FWTZL050853@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 1 Oct 2014 15:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272366 - 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, 01 Oct 2014 15:32:29 -0000 Author: will Date: Wed Oct 1 15:32:28 2014 New Revision: 272366 URL: https://svnweb.freebsd.org/changeset/base/272366 Log: In the syncer, drop the sync mutex while patting the watchdog. Some watchdog drivers (like ipmi) need to sleep while patting the watchdog. See sys/dev/ipmi/ipmi.c:ipmi_wd_event(), which calls malloc(M_WAITOK). Submitted by: asomers MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: 637548 on 2012/10/04 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Oct 1 15:23:23 2014 (r272365) +++ head/sys/kern/vfs_subr.c Wed Oct 1 15:32:28 2014 (r272366) @@ -1863,8 +1863,15 @@ sched_sync(void) continue; } - if (first_printf == 0) + if (first_printf == 0) { + /* + * Drop the sync mutex, because some watchdog + * drivers need to sleep while patting + */ + mtx_unlock(&sync_mtx); wdog_kern_pat(WD_LASTVAL); + mtx_lock(&sync_mtx); + } } if (syncer_state == SYNCER_FINAL_DELAY && syncer_final_iter > 0) From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 15:34:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1052EE0; Wed, 1 Oct 2014 15:34:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAF51910; Wed, 1 Oct 2014 15:34: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 s91FYmi3051212; Wed, 1 Oct 2014 15:34:48 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91FYmnO051211; Wed, 1 Oct 2014 15:34:48 GMT (envelope-from will@FreeBSD.org) Message-Id: <201410011534.s91FYmnO051211@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 1 Oct 2014 15:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272367 - head/sys/modules/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 01 Oct 2014 15:34:49 -0000 Author: will Date: Wed Oct 1 15:34:48 2014 New Revision: 272367 URL: https://svnweb.freebsd.org/changeset/base/272367 Log: Instead of requiring an edit to turn on ZFS debugging, define ZFS_DEBUG. MFC after: 1 month Modified: head/sys/modules/zfs/Makefile Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Wed Oct 1 15:32:28 2014 (r272366) +++ head/sys/modules/zfs/Makefile Wed Oct 1 15:34:48 2014 (r272367) @@ -94,8 +94,10 @@ CFLAGS+=-DBUILDING_ZFS CFLAGS+=-mminimal-toc .endif -#CFLAGS+=-DDEBUG=1 -#DEBUG_FLAGS=-g +.ifdef ZFS_DEBUG +CFLAGS+=-DDEBUG=1 +DEBUG_FLAGS=-g +.endif .include From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 15:40:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E422F19C; Wed, 1 Oct 2014 15:40:11 +0000 (UTC) Received: from mail-lb0-x232.google.com (mail-lb0-x232.google.com [IPv6:2a00:1450:4010:c04::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA59D95D; Wed, 1 Oct 2014 15:40:10 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id w7so583324lbi.23 for ; Wed, 01 Oct 2014 08:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=tpSHQ58/PnsARP0x6KHi4vxxbWpS3urSic2Ig2Djnuw=; b=hTownlW+EFANCmJM+vhTUQAAoN8AMzO2WA47v2BMhk5dHvHT0tgsNb8mNqeb7qu+kT /FzG65bl6GNPk8FQrpY5j/uA+P6fywAdB/hKX8cnXDgD/QFzYlkpCV0O3MrQn4H/nMZG r8kfWbKuSn21AUXekPM4FZQnIdLaEjuYd3Kuh9vz/qiUnFhXK619RCAtERyvPDE5RZop 80VjHmPZBMtGfsMfbUwysRarhpVHrRTHnSeveT25ZRQGquDBzOdQ/WjqmGw2dAkuHFRh 8F6gipG4fIIlfcmtOssPxfUG65YhJegEdOEsQqM5dNP0c1iHko2ct9pKz6G86owj341Q unMQ== MIME-Version: 1.0 X-Received: by 10.152.19.167 with SMTP id g7mr6787950lae.31.1412178008770; Wed, 01 Oct 2014 08:40:08 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.25.207.74 with HTTP; Wed, 1 Oct 2014 08:40:08 -0700 (PDT) In-Reply-To: <201410011532.s91FWTZL050853@svn.freebsd.org> References: <201410011532.s91FWTZL050853@svn.freebsd.org> Date: Wed, 1 Oct 2014 08:40:08 -0700 X-Google-Sender-Auth: MinPZJwDnONacQ5PsdGqrdTlF24 Message-ID: Subject: Re: svn commit: r272366 - head/sys/kern From: Davide Italiano To: Will Andrews 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: Wed, 01 Oct 2014 15:40:12 -0000 On Wed, Oct 1, 2014 at 8:32 AM, Will Andrews wrote: > Author: will > Date: Wed Oct 1 15:32:28 2014 > New Revision: 272366 > URL: https://svnweb.freebsd.org/changeset/base/272366 > > Log: > In the syncer, drop the sync mutex while patting the watchdog. > > Some watchdog drivers (like ipmi) need to sleep while patting the watchdog. > See sys/dev/ipmi/ipmi.c:ipmi_wd_event(), which calls malloc(M_WAITOK). > > Submitted by: asomers > MFC after: 1 month > Sponsored by: Spectra Logic > MFSpectraBSD: 637548 on 2012/10/04 > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Wed Oct 1 15:23:23 2014 (r272365) > +++ head/sys/kern/vfs_subr.c Wed Oct 1 15:32:28 2014 (r272366) > @@ -1863,8 +1863,15 @@ sched_sync(void) > continue; > } > > - if (first_printf == 0) > + if (first_printf == 0) { > + /* > + * Drop the sync mutex, because some watchdog > + * drivers need to sleep while patting > + */ > + mtx_unlock(&sync_mtx); > wdog_kern_pat(WD_LASTVAL); > + mtx_lock(&sync_mtx); > + } > > } > if (syncer_state == SYNCER_FINAL_DELAY && syncer_final_iter > 0) > I introduced something like this back in the days when I was at iX but never convinced myself this is completely safe -- I assume you investigated about possible races opened by releasing the syncer mutex, and I would be happy if you can elaborate a bit more. -- 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 Wed Oct 1 16:00:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A26FDC9A; Wed, 1 Oct 2014 16:00: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 755FBCDB; Wed, 1 Oct 2014 16:00: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 s91G0MTW063694; Wed, 1 Oct 2014 16:00:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91G0M4Y063692; Wed, 1 Oct 2014 16:00:22 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410011600.s91G0M4Y063692@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 1 Oct 2014 16:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272368 - 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: Wed, 01 Oct 2014 16:00:22 -0000 Author: andrew Date: Wed Oct 1 16:00:21 2014 New Revision: 272368 URL: https://svnweb.freebsd.org/changeset/base/272368 Log: Clean up detection of big-endian ARM. In all cases we follow the pattern arm*eb*. Check we are building for arm and if MACHINE_ARCH follows this pattern. Modified: head/share/mk/bsd.endian.mk head/share/mk/src.opts.mk Modified: head/share/mk/bsd.endian.mk ============================================================================== --- head/share/mk/bsd.endian.mk Wed Oct 1 15:34:48 2014 (r272367) +++ head/share/mk/bsd.endian.mk Wed Oct 1 16:00:21 2014 (r272368) @@ -2,16 +2,13 @@ .if ${MACHINE_ARCH} == "amd64" || \ ${MACHINE_ARCH} == "i386" || \ - ${MACHINE_ARCH} == "arm" || \ - ${MACHINE_ARCH} == "armv6" || \ - ${MACHINE_ARCH} == "armv6hf" || \ + (${MACHINE} == "arm" && ${MACHINE_ARCH:Marm*eb*} == "") || \ ${MACHINE_ARCH:Mmips*el} != "" TARGET_ENDIANNESS= 1234 .elif ${MACHINE_ARCH} == "powerpc" || \ ${MACHINE_ARCH} == "powerpc64" || \ ${MACHINE_ARCH} == "sparc64" || \ - ${MACHINE_ARCH} == "armeb" || \ - ${MACHINE_ARCH} == "armv6eb" || \ + (${MACHINE} == "arm" && ${MACHINE_ARCH:Marm*eb*} != "") || \ ${MACHINE_ARCH:Mmips*} != "" TARGET_ENDIANNESS= 4321 .endif Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Oct 1 15:34:48 2014 (r272367) +++ head/share/mk/src.opts.mk Wed Oct 1 16:00:21 2014 (r272368) @@ -193,7 +193,7 @@ __TT=${MACHINE} # Clang is only for x86, powerpc and little-endian arm right now, by default. .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP -.elif ${__T} == "arm" || ${__T} == "armv6" || ${__T} == "armv6hf" +.elif ${__TT} == "arm" && ${__T:Marm*eb*} == "" __DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP # GCC is unable to build the full clang on arm, disable it by default. __DEFAULT_NO_OPTIONS+=CLANG_FULL @@ -201,8 +201,8 @@ __DEFAULT_NO_OPTIONS+=CLANG_FULL __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP .endif # Clang the default system compiler only on little-endian arm and x86. -.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \ - ${__T} == "armv6hf" || ${__T} == "i386" +.if ${__T} == "amd64" || (${__TT} == "arm" && ${__T:Marm*eb*} == "") || \ + ${__T} == "i386" __DEFAULT_YES_OPTIONS+=CLANG_IS_CC __DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX .else From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 16:08:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B53F3EE0; Wed, 1 Oct 2014 16:08: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 87420DE4; Wed, 1 Oct 2014 16:08: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 s91G8KTn066248; Wed, 1 Oct 2014 16:08:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91G8J02066245; Wed, 1 Oct 2014 16:08:19 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410011608.s91G8J02066245@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 1 Oct 2014 16:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272369 - in head/lib: libc/arm libc/arm/aeabi libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 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, 01 Oct 2014 16:08:20 -0000 Author: andrew Date: Wed Oct 1 16:08:19 2014 New Revision: 272369 URL: https://svnweb.freebsd.org/changeset/base/272369 Log: Clean up detection of hard-float ABIs. As with big-endian in r272368 we can check against arm*hf*. Modified: head/lib/libc/arm/Makefile.inc head/lib/libc/arm/aeabi/Makefile.inc head/lib/libcompiler_rt/Makefile Modified: head/lib/libc/arm/Makefile.inc ============================================================================== --- head/lib/libc/arm/Makefile.inc Wed Oct 1 16:00:21 2014 (r272368) +++ head/lib/libc/arm/Makefile.inc Wed Oct 1 16:08:19 2014 (r272369) @@ -11,7 +11,7 @@ SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol.map .include "${LIBC_SRCTOP}/arm/aeabi/Makefile.inc" -.if ${MACHINE_ARCH} == "armv6hf" +.if ${MACHINE_ARCH:Marm*hf*} != "" SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_vfp.map .endif Modified: head/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- head/lib/libc/arm/aeabi/Makefile.inc Wed Oct 1 16:00:21 2014 (r272368) +++ head/lib/libc/arm/aeabi/Makefile.inc Wed Oct 1 16:08:19 2014 (r272369) @@ -5,7 +5,7 @@ SRCS+= aeabi_atexit.c \ aeabi_unwind_cpp.c \ aeabi_unwind_exidx.c -.if ${MACHINE_ARCH} != "armv6hf" +.if ${MACHINE_ARCH:Marm*hf*} == "" SRCS+= aeabi_double.c \ aeabi_float.c .endif Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Wed Oct 1 16:00:21 2014 (r272368) +++ head/lib/libcompiler_rt/Makefile Wed Oct 1 16:08:19 2014 (r272369) @@ -164,9 +164,9 @@ SRCF+= stdatomic .endif .for file in ${SRCF} -. if ${MACHINE_ARCH} == "armv6hf" && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) +. if ${MACHINE_ARCH:Marm*hf*} != "" && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) SRCS+= ${file}vfp.S -. elif (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH} == "armv6hf") && exists(${CRTSRC}/${CRTARCH}/${file}.S) +. elif !(${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH:Marm*hf*} == "") && exists(${CRTSRC}/${CRTARCH}/${file}.S) SRCS+= ${file}.S . else SRCS+= ${file}.c From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 16:16:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CB90273; Wed, 1 Oct 2014 16:16:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19A0CEE2; Wed, 1 Oct 2014 16:16: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 s91GG170070889; Wed, 1 Oct 2014 16:16:01 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91GG1Oh070888; Wed, 1 Oct 2014 16:16:01 GMT (envelope-from will@FreeBSD.org) Message-Id: <201410011616.s91GG1Oh070888@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 1 Oct 2014 16:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272371 - 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: Wed, 01 Oct 2014 16:16:02 -0000 Author: will Date: Wed Oct 1 16:16:01 2014 New Revision: 272371 URL: https://svnweb.freebsd.org/changeset/base/272371 Log: Embellish a comment regarding the reliability of DEBUG_VFS_LOCKS. Submitted by: kib Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Oct 1 16:09:11 2014 (r272370) +++ head/sys/sys/vnode.h Wed Oct 1 16:16:01 2014 (r272371) @@ -503,7 +503,9 @@ extern struct vnodeop_desc *vnodeop_desc * reliable since if the thread sleeps between changing the lock * state and checking it with the assert, some other thread could * change the state. They are good enough for debugging a single - * filesystem using a single-threaded test. + * filesystem using a single-threaded test. Note that the unreliability is + * limited to false negatives; efforts were made to ensure that false + * positives cannot occur. */ void assert_vi_locked(struct vnode *vp, const char *str); void assert_vi_unlocked(struct vnode *vp, const char *str); From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 16:37:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A30B5ADC for ; Wed, 1 Oct 2014 16:37:40 +0000 (UTC) Received: from mail-qg0-f41.google.com (mail-qg0-f41.google.com [209.85.192.41]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63641196 for ; Wed, 1 Oct 2014 16:37:40 +0000 (UTC) Received: by mail-qg0-f41.google.com with SMTP id f51so590388qge.0 for ; Wed, 01 Oct 2014 09:37:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=3hKavqNqkQxN14T8665jX4DBKFHL2mrMdWN+jF4eKk8=; b=IB5DF7N9JQF2nbIWfyX/7NaG9/Sf+36vVgRKfWws1jq94crf1eTbGzCbhejuJxKZ/U YgKOdiOpfKZ2t4SFtIrKkEs+uYJN8U3yECRVEH8GhqMJ1r5HQv1TywRvIdT0ZygtLXWH Ss/lc3osWXjDG+VH8RCV1IydZeeWLpBzZP5aN12y6EOj88PnDLSDd7VU7OlK8Vol0MYO wNv2nf1W2P9KfxFW34KLYknU+6fnr4Ib2Hf27Z/Ab8T9hOUmreZzC6XzstW77o4l+8Oi qxPG0so0xE6gH3azaxAQxJGl0eNvGmHmwALkVYRlz6Yu0zkQxnLDivqIX1NZ1/iBwZFK ck/w== X-Gm-Message-State: ALoCoQlE7oZaUlD65v4pAY6rGehRIMQAUx9XggDP5k75J/BIyDFKA5NqG+gutyzlJvFgIijmrtz3 MIME-Version: 1.0 X-Received: by 10.224.32.138 with SMTP id c10mr64383266qad.1.1412181453110; Wed, 01 Oct 2014 09:37:33 -0700 (PDT) Received: by 10.140.31.36 with HTTP; Wed, 1 Oct 2014 09:37:33 -0700 (PDT) In-Reply-To: References: <201410011532.s91FWTZL050853@svn.freebsd.org> Date: Wed, 1 Oct 2014 10:37:33 -0600 Message-ID: Subject: Re: svn commit: r272366 - head/sys/kern From: Will Andrews To: Davide Italiano 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: Wed, 01 Oct 2014 16:37:40 -0000 I think it depends on what kind of safety you're concerned about. There's only one syncer; none of its state can be reclaimed behind its back. If additional work is added to its queue in the interim, it will be processed as if it was already there at the start of the loop. We've been running with this change for 2 years; I don't think any issues have been reported with it. I realize that's not a guarantee that there isn't a problem. However, this change does fix an issue where the system could deadlock on shutdown because it's calling a watchdog callback that mallocs, while holding sync_mtx. --Will. On Wed, Oct 1, 2014 at 9:40 AM, Davide Italiano wrote: > On Wed, Oct 1, 2014 at 8:32 AM, Will Andrews wrote: >> Author: will >> Date: Wed Oct 1 15:32:28 2014 >> New Revision: 272366 >> URL: https://svnweb.freebsd.org/changeset/base/272366 >> >> Log: >> In the syncer, drop the sync mutex while patting the watchdog. >> >> Some watchdog drivers (like ipmi) need to sleep while patting the watchdog. >> See sys/dev/ipmi/ipmi.c:ipmi_wd_event(), which calls malloc(M_WAITOK). >> >> Submitted by: asomers >> MFC after: 1 month >> Sponsored by: Spectra Logic >> MFSpectraBSD: 637548 on 2012/10/04 >> >> Modified: >> head/sys/kern/vfs_subr.c >> >> Modified: head/sys/kern/vfs_subr.c >> ============================================================================== >> --- head/sys/kern/vfs_subr.c Wed Oct 1 15:23:23 2014 (r272365) >> +++ head/sys/kern/vfs_subr.c Wed Oct 1 15:32:28 2014 (r272366) >> @@ -1863,8 +1863,15 @@ sched_sync(void) >> continue; >> } >> >> - if (first_printf == 0) >> + if (first_printf == 0) { >> + /* >> + * Drop the sync mutex, because some watchdog >> + * drivers need to sleep while patting >> + */ >> + mtx_unlock(&sync_mtx); >> wdog_kern_pat(WD_LASTVAL); >> + mtx_lock(&sync_mtx); >> + } >> >> } >> if (syncer_state == SYNCER_FINAL_DELAY && syncer_final_iter > 0) >> > > I introduced something like this back in the days when I was at iX but > never convinced myself this is completely safe -- I assume you > investigated about possible races opened by releasing the syncer > mutex, and I would be happy if you can elaborate a bit more. > > -- > 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 Wed Oct 1 16:46:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F20A8E2E; Wed, 1 Oct 2014 16:46:28 +0000 (UTC) Received: from mail-yh0-x236.google.com (mail-yh0-x236.google.com [IPv6:2607:f8b0:4002:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B1062BD; Wed, 1 Oct 2014 16:46:28 +0000 (UTC) Received: by mail-yh0-f54.google.com with SMTP id f10so268994yha.27 for ; Wed, 01 Oct 2014 09:46: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=PGy6AHzXiHl3VDkYyGAev9k9Vti1yIZX7nuZB71mDnk=; b=anA17OYTUNrSXHs8GjKURefPPki694IDfgWf0q1lgXcd3AgEg3P+B+sVeIhAXEAu/9 gFkFUTr9YpqxFspcujtsu4vlQRfzH1kMCfGjHwGRQxkOPQmdBv+Mx4sHVd35jzQiEH8M HILfcLdcc5VhZvVN+8dZpNPXpSNs1rGY/JXYGUUCJSjQcMWDmWZcn8hgpm3RdJTmE9w8 jVQ/yeTbmxiSPYzcbSxC/uDuCss8DPU4DEwlNGV3HORM7qa7RrLS7n8LSFuf5poR/tk1 1ThXcSTdg3joOpCNP9x6AapLohFHJBoGbf0UkYam4Yp5uJm5sLvszeJf4U24LK5A2cur gFrw== MIME-Version: 1.0 X-Received: by 10.236.94.130 with SMTP id n2mr7896869yhf.163.1412181987711; Wed, 01 Oct 2014 09:46:27 -0700 (PDT) Sender: antoine.brodin.freebsd@gmail.com Received: by 10.170.164.197 with HTTP; Wed, 1 Oct 2014 09:46:27 -0700 (PDT) In-Reply-To: <201409282120.s8SLKLJs070469@svn.freebsd.org> References: <201409282120.s8SLKLJs070469@svn.freebsd.org> Date: Wed, 1 Oct 2014 18:46:27 +0200 X-Google-Sender-Auth: a1OTe30PMLxkP7jl8ZcFtzsuQNc Message-ID: Subject: Re: svn commit: r272273 - head/lib/libc/stdtime From: Antoine Brodin 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: Wed, 01 Oct 2014 16:46:29 -0000 On Sun, Sep 28, 2014 at 11:20 PM, Pedro F. Giffuni wrote: > Author: pfg > Date: Sun Sep 28 21:20:20 2014 > New Revision: 272273 > URL: http://svnweb.freebsd.org/changeset/base/272273 > > Log: > Add strptime(3) support for %U and %W (take 2) > > Add support for the missing POSIX-2001 %U and %W features: the > existing FreeBSD strptime code recognizes both directives and > validates that the week number lies in the permitted range, > but then simply discards the value. > > Initial support for the feature was written by Paul Green. > David Carlier added the initial handling of tm_wday/tm_yday. > Major credit goes to Andrey Chernov for detecting much of the > brokenness, and rewriting/cleaning most of the code, making it > much more robust. > > Tested independently with the strptime test from the GNU C > library. > > PR: 137307 > MFC after: 1 month > Relnotes: yes Hi, It seems this change breaks some ports, so please no MFC until this is fixed: http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p369565_s272290/logs/errors/latrine-1.0.0_1.log http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p369565_s272290/logs/errors/mongrel2-1.7.5_2.log http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p369565_s272290/logs/errors/deforaos-mailer-0.1.6_1.log Cheers, Antoine (portmgr hat on) > > Modified: > head/lib/libc/stdtime/strptime.c > > Modified: head/lib/libc/stdtime/strptime.c > ============================================================================== > --- head/lib/libc/stdtime/strptime.c Sun Sep 28 21:15:30 2014 (r272272) > +++ head/lib/libc/stdtime/strptime.c Sun Sep 28 21:20:20 2014 (r272273) > @@ -55,10 +55,32 @@ __FBSDID("$FreeBSD$"); > #include "un-namespace.h" > #include "libc_private.h" > #include "timelocal.h" > - > +#include "tzfile.h" > +#include > static char * _strptime(const char *, const char *, struct tm *, int *, locale_t); > > -#define asizeof(a) (sizeof (a) / sizeof ((a)[0])) > +#define asizeof(a) (sizeof(a) / sizeof((a)[0])) > + > +#define FLAG_NONE (1 << 0) > +#define FLAG_YEAR (1 << 1) > +#define FLAG_MONTH (1 << 2) > +#define FLAG_YDAY (1 << 3) > +#define FLAG_MDAY (1 << 4) > +#define FLAG_WDAY (1 << 5) > + > +/* > + * Calculate the week day of the first day of a year. Valid for > + * the Gregorian calendar, which began Sept 14, 1752 in the UK > + * and its colonies. Ref: > + * http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week > + */ > + > +static int > +first_wday_of(int year) > +{ > + return (((2 * (3 - (year / 100) % 4)) + (year % 100) + > + ((year % 100) / 4) + (isleap(year) ? 6 : 0) + 1) % 7); > +} > > static char * > _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp, > @@ -66,9 +88,18 @@ _strptime(const char *buf, const char *f > { > char c; > const char *ptr; > + int day_offset = -1, wday_offset; > + int week_offset; > int i, len; > + int flags; > int Ealternative, Oalternative; > - struct lc_time_T *tptr = __get_current_time_locale(locale); > + const struct lc_time_T *tptr = __get_current_time_locale(locale); > + static int start_of_month[2][13] = { > + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, > + {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366} > + }; > + > + flags = FLAG_NONE; > > ptr = fmt; > while (*ptr != 0) { > @@ -102,6 +133,7 @@ label: > buf = _strptime(buf, tptr->date_fmt, tm, GMTp, locale); > if (buf == NULL) > return (NULL); > + flags |= FLAG_WDAY | FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; > break; > > case 'C': > @@ -119,19 +151,23 @@ label: > if (i < 19) > return (NULL); > > - tm->tm_year = i * 100 - 1900; > + tm->tm_year = i * 100 - TM_YEAR_BASE; > + flags |= FLAG_YEAR; > + > break; > > case 'c': > buf = _strptime(buf, tptr->c_fmt, tm, GMTp, locale); > if (buf == NULL) > return (NULL); > + flags |= FLAG_WDAY | FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; > break; > > case 'D': > buf = _strptime(buf, "%m/%d/%y", tm, GMTp, locale); > if (buf == NULL) > return (NULL); > + flags |= FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; > break; > > case 'E': > @@ -150,6 +186,7 @@ label: > buf = _strptime(buf, "%Y-%m-%d", tm, GMTp, locale); > if (buf == NULL) > return (NULL); > + flags |= FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; > break; > > case 'R': > @@ -180,6 +217,7 @@ label: > buf = _strptime(buf, tptr->x_fmt, tm, GMTp, locale); > if (buf == NULL) > return (NULL); > + flags |= FLAG_MONTH | FLAG_MDAY | FLAG_YEAR; > break; > > case 'j': > @@ -197,6 +235,8 @@ label: > return (NULL); > > tm->tm_yday = i - 1; > + flags |= FLAG_YDAY; > + > break; > > case 'M': > @@ -303,7 +343,7 @@ label: > return (NULL); > > tm->tm_wday = i; > - buf += len; > + flags |= FLAG_WDAY; > break; > > case 'U': > @@ -327,6 +367,14 @@ label: > if (i > 53) > return (NULL); > > + if (c == 'U') > + day_offset = TM_SUNDAY; > + else > + day_offset = TM_MONDAY; > + > + > + week_offset = i; > + > break; > > case 'w': > @@ -338,6 +386,7 @@ label: > return (NULL); > > tm->tm_wday = i; > + flags |= FLAG_WDAY; > > break; > > @@ -374,6 +423,7 @@ label: > return (NULL); > > tm->tm_mday = i; > + flags |= FLAG_MDAY; > > break; > > @@ -413,6 +463,8 @@ label: > > tm->tm_mon = i; > buf += len; > + flags |= FLAG_MONTH; > + > break; > > case 'm': > @@ -430,6 +482,7 @@ label: > return (NULL); > > tm->tm_mon = i - 1; > + flags |= FLAG_MONTH; > > break; > > @@ -471,13 +524,14 @@ label: > len--; > } > if (c == 'Y') > - i -= 1900; > + i -= TM_YEAR_BASE; > if (c == 'y' && i < 69) > i += 100; > if (i < 0) > return (NULL); > > tm->tm_year = i; > + flags |= FLAG_YEAR; > > break; > > @@ -543,10 +597,67 @@ label: > break; > } > } > + > + if (!(flags & FLAG_YDAY) && (flags & FLAG_YEAR)) { > + if ((flags & (FLAG_MONTH | FLAG_MDAY)) == > + (FLAG_MONTH | FLAG_MDAY)) { > + tm->tm_yday = start_of_month[isleap(tm->tm_year + > + TM_YEAR_BASE)][tm->tm_mon] + (tm->tm_mday - 1); > + flags |= FLAG_YDAY; > + } else if (day_offset != -1) { > + /* Set the date to the first Sunday (or Monday) > + * of the specified week of the year. > + */ > + if (!(flags & FLAG_WDAY)) { > + tm->tm_wday = day_offset; > + flags |= FLAG_WDAY; > + } > + tm->tm_yday = (7 - > + first_wday_of(tm->tm_year + TM_YEAR_BASE) + > + day_offset) % 7 + (week_offset - 1) * 7 + > + tm->tm_wday - day_offset; > + flags |= FLAG_YDAY; > + } > + } > + > + if ((flags & (FLAG_YEAR | FLAG_YDAY)) == (FLAG_YEAR | FLAG_YDAY)) { > + if (!(flags & FLAG_MONTH)) { > + i = 0; > + while (tm->tm_yday >= > + start_of_month[isleap(tm->tm_year + > + TM_YEAR_BASE)][i]) > + i++; > + if (i > 12) { > + i = 1; > + tm->tm_yday -= > + start_of_month[isleap(tm->tm_year + > + TM_YEAR_BASE)][12]; > + tm->tm_year++; > + } > + tm->tm_mon = i - 1; > + flags |= FLAG_MONTH; > + } > + if (!(flags & FLAG_MDAY)) { > + tm->tm_mday = tm->tm_yday - > + start_of_month[isleap(tm->tm_year + TM_YEAR_BASE)] > + [tm->tm_mon] + 1; > + flags |= FLAG_MDAY; > + } > + if (!(flags & FLAG_WDAY)) { > + i = 0; > + wday_offset = first_wday_of(tm->tm_year); > + while (i++ <= tm->tm_yday) { > + if (wday_offset++ >= 6) > + wday_offset = 0; > + } > + tm->tm_wday = wday_offset; > + flags |= FLAG_WDAY; > + } > + } > + > return ((char *)buf); > } > > - > char * > strptime_l(const char * __restrict buf, const char * __restrict fmt, > struct tm * __restrict tm, locale_t loc) > @@ -564,6 +675,7 @@ strptime_l(const char * __restrict buf, > > return (ret); > } > + > char * > strptime(const char * __restrict buf, const char * __restrict fmt, > struct tm * __restrict tm) > From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 17:16:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42A96BF0; Wed, 1 Oct 2014 17:16: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 1506085E; Wed, 1 Oct 2014 17:16: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 s91HGIhG099883; Wed, 1 Oct 2014 17:16:18 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91HGIVl099882; Wed, 1 Oct 2014 17:16:18 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201410011716.s91HGIVl099882@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Wed, 1 Oct 2014 17:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272377 - 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, 01 Oct 2014 17:16:19 -0000 Author: bjk (doc committer) Date: Wed Oct 1 17:16:18 2014 New Revision: 272377 URL: https://svnweb.freebsd.org/changeset/base/272377 Log: Some cleanup for sfxge.4 Use standard mdoc macros instead of pure roff, fix some other mdoc usage, make the style consistent, and fix some grammar issues. Approved by: hrs (mentor) Modified: head/share/man/man4/sfxge.4 Modified: head/share/man/man4/sfxge.4 ============================================================================== --- head/share/man/man4/sfxge.4 Wed Oct 1 17:05:40 2014 (r272376) +++ head/share/man/man4/sfxge.4 Wed Oct 1 17:16:18 2014 (r272377) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd September 30, 2014 .Dt SFXGE 4 .Os .Sh NAME @@ -85,23 +85,30 @@ Actual values can be obtained using .Xr sysctl 8 . .Bl -tag -width indent .It Va hw.sfxge.rx_ring -Maximum number of descriptors in a receive queue ring. +The maximum number of descriptors in a receive queue ring. Supported values are: 512, 1024, 2048 and 4096. .It Va hw.sfxge.tx_ring -Maximum number of descriptors in a transmit queue ring. +The maximum number of descriptors in a transmit queue ring. Supported values are: 512, 1024, 2048 and 4096. .It Va hw.sfxge.tx_dpl_get_max -The maximum length of the deferred packet 'get-list' for queued transmit +The maximum length of the deferred packet +.Dq get-list +for queued transmit packets, used only if the transmit queue lock can be acquired. -If packet is dropped, \fItx_early_drops\fR counter grows and local sender -gets ENOBUFS error. -Value must be greater than 0. +If a packet is dropped, the +.Va tx_early_drops +counter is incremented and the local sender receives ENOBUFS. +The value must be greater than 0. .It Va hw.sfxge.tx_dpl_put_max -The maximum length of the deferred packet 'put-list' for queued transmit +The maximum length of the deferred packet +.Dq put-list +for queued transmit packets, used if the transmit queue lock cannot be acquired. -If packet is dropped, \fItx_early_drops\fR counter grows and local sender -gets ENOBUFS error. -Value must be greater or equal to 0. +If a packet is dropped, the +.Va tx_early_drops +counter is incremented and the local sender receives ENOBUFS. +The value must be greater than or equal to 0. +.El .Sh SUPPORT For general information and support, go to the Solarflare support website at: From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 18:07:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E658B0B; Wed, 1 Oct 2014 18:07:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10697DFD; Wed, 1 Oct 2014 18:07: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 s91I7ZMA023625; Wed, 1 Oct 2014 18:07:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91I7ZdN023619; Wed, 1 Oct 2014 18:07:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201410011807.s91I7ZdN023619@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 1 Oct 2014 18:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272378 - in head: share/man/man4 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, 01 Oct 2014 18:07:36 -0000 Author: markj Date: Wed Oct 1 18:07:34 2014 New Revision: 272378 URL: https://svnweb.freebsd.org/changeset/base/272378 Log: Add a sysctl, net.inet.icmp.tstamprepl, which can be used to disable replies to ICMP Timestamp packets. PR: 193689 Submitted by: Anthony Cornehl MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/icmp.4 head/sys/netinet/ip_icmp.c Modified: head/share/man/man4/icmp.4 ============================================================================== --- head/share/man/man4/icmp.4 Wed Oct 1 17:16:18 2014 (r272377) +++ head/share/man/man4/icmp.4 Wed Oct 1 18:07:34 2014 (r272378) @@ -28,7 +28,7 @@ .\" @(#)icmp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 9, 2007 +.Dd September 30, 2014 .Dt ICMP 4 .Os .Sh NAME @@ -216,6 +216,10 @@ instead of the possibly different return Number of bytes from original packet to quote in ICMP reply. This number is internally enforced to be at least 8 bytes (per RFC792) and at most the maximal space left in the ICMP reply mbuf. +.It Va tstamprepl +.Pq Vt boolean +Enable/disable replies to ICMP Timestamp packets. +Defaults to true. .El .Sh ERRORS A socket operation may fail with one of the following errors returned: Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Wed Oct 1 17:16:18 2014 (r272377) +++ head/sys/netinet/ip_icmp.c Wed Oct 1 18:07:34 2014 (r272378) @@ -149,6 +149,10 @@ SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO &VNET_NAME(icmpbmcastecho), 0, ""); +static VNET_DEFINE(int, icmptstamprepl) = 1; +#define V_icmptstamprepl VNET(icmptstamprepl) +SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFLAG_RW, + &VNET_NAME(icmptstamprepl), 0, "Respond to ICMP Timestamp packets"); #ifdef ICMPPRINTFS int icmpprintfs = 0; @@ -545,6 +549,8 @@ icmp_input(struct mbuf **mp, int *offp, goto reflect; case ICMP_TSTAMP: + if (V_icmptstamprepl == 0) + break; if (!V_icmpbmcastecho && (m->m_flags & (M_MCAST | M_BCAST)) != 0) { ICMPSTAT_INC(icps_bmcasttstamp); From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 18:18:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A973339; Wed, 1 Oct 2014 18:18:32 +0000 (UTC) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 675A2FFE; Wed, 1 Oct 2014 18:18:31 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id y10so1230797wgg.3 for ; Wed, 01 Oct 2014 11:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=9WWRYynxxFcFE4u8IYCLLFA7VMjbHQKPYGWYZ6fFDfk=; b=JC8SBfnyY5IcwOdcbd82rAnWf67KkeiGG1KKGtePvJamVpw2hO99/3ScZfSF5bSNQ1 IN3KciW1LHk/RghZPlzrKM92H1+cTtQCUhgvM7FrhjqHryW8vE6SI1DqLk85+JaqIGK6 p+GgCYbBgh8J4ntwoDDTMEXYeuDWntF0RvKweCNygiemJDTyu52N+QPQidRx3P1ejKdf b0tpjEm2Yb/UzVw8oWO59l+slBI1JZgOxX73J7eaHDb6hpbQXcpytVm3DrMVxaEjLRsL pyglAt4wApVx7cLocu8VDMfVZp8R+mee1s2/ijg1fktOTFdzOvsKL0+aFUzlBctiF+pX E04A== X-Received: by 10.180.211.36 with SMTP id mz4mr16580331wic.39.1412187509243; Wed, 01 Oct 2014 11:18:29 -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 ji10sm19390178wid.7.2014.10.01.11.18.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 01 Oct 2014 11:18:28 -0700 (PDT) Date: Wed, 1 Oct 2014 20:18:25 +0200 From: Mateusz Guzik To: Will Andrews Subject: Re: svn commit: r272366 - head/sys/kern Message-ID: <20141001181825.GA16048@dft-labs.eu> References: <201410011532.s91FWTZL050853@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201410011532.s91FWTZL050853@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: Wed, 01 Oct 2014 18:18:32 -0000 On Wed, Oct 01, 2014 at 03:32:29PM +0000, Will Andrews wrote: > Author: will > Date: Wed Oct 1 15:32:28 2014 > New Revision: 272366 > URL: https://svnweb.freebsd.org/changeset/base/272366 > > Log: > In the syncer, drop the sync mutex while patting the watchdog. > > Some watchdog drivers (like ipmi) need to sleep while patting the watchdog. > See sys/dev/ipmi/ipmi.c:ipmi_wd_event(), which calls malloc(M_WAITOK). > Is not such malloc inherently bad in case of watchdog? It looks like the code waits for request completion and then frees it unconditionally. As such, a local var on stack would do the trick. The code msleeps later, so this hack of dropping sync_mtx is still needed. > Submitted by: asomers > MFC after: 1 month > Sponsored by: Spectra Logic > MFSpectraBSD: 637548 on 2012/10/04 > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Wed Oct 1 15:23:23 2014 (r272365) > +++ head/sys/kern/vfs_subr.c Wed Oct 1 15:32:28 2014 (r272366) > @@ -1863,8 +1863,15 @@ sched_sync(void) > continue; > } > > - if (first_printf == 0) > + if (first_printf == 0) { > + /* > + * Drop the sync mutex, because some watchdog > + * drivers need to sleep while patting > + */ > + mtx_unlock(&sync_mtx); > wdog_kern_pat(WD_LASTVAL); > + mtx_lock(&sync_mtx); > + } > > } > if (syncer_state == SYNCER_FINAL_DELAY && syncer_final_iter > 0) > -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 18:59:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 733FFDFF; Wed, 1 Oct 2014 18:59:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DD0C779; Wed, 1 Oct 2014 18:59: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 s91IxwtW047153; Wed, 1 Oct 2014 18:59:58 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91Ixvqa047151; Wed, 1 Oct 2014 18:59:57 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201410011859.s91Ixvqa047151@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 1 Oct 2014 18:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272379 - in head/usr.sbin/bsdinstall: distextract distfetch X-SVN-Group: head MIME-Version: 1.0 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, 01 Oct 2014 18:59:58 -0000 Author: dteske Date: Wed Oct 1 18:59:57 2014 New Revision: 272379 URL: https://svnweb.freebsd.org/changeset/base/272379 Log: Optimize program flow for execution speed. Also fix some more style(9) nits while here: + Fix an issue when extracting small archives where dialog_mixedgauge was not rendering; leaving the user wondering if anything happened. + Add #ifdef's to assuage compilation against older libarchive NB: Minimize diff between branches; make merging easier. + Add missing calls to end_dialog(3) + Change string processing from strtok(3) to strcspn(3) (O(1) optimization) + Use EXIT_SUCCESS and EXIT_FAILURE instead of 0/1 + Optimize getenv(3) use, using stored results instead of calling repeatedly NB: Fixes copy/paste error wherein we display getenv(BSDINSTALL_DISTDIR) in an error msgbox when chdir(2) to getenv(BSDINSTALL_CHROOT) fails (wrong variable displayed in msgbox). + Use strtol(3) instead of [deprecated] atoi(3) + Add additional error checking (e.g., check return of archive_read_new(3)) + Assign DECONST strings to static variables + Fix typo in distextract.c error message (s/Could could/Could not/) + Add comments and make a minor whitespace adjustment Reviewed by: nwhitehorn, julian Modified: head/usr.sbin/bsdinstall/distextract/distextract.c head/usr.sbin/bsdinstall/distfetch/distfetch.c Modified: head/usr.sbin/bsdinstall/distextract/distextract.c ============================================================================== --- head/usr.sbin/bsdinstall/distextract/distextract.c Wed Oct 1 18:07:34 2014 (r272378) +++ head/usr.sbin/bsdinstall/distextract/distextract.c Wed Oct 1 18:59:57 2014 (r272379) @@ -40,45 +40,102 @@ __FBSDID("$FreeBSD$"); #include #include +/* Data to process */ +static char *distdir = NULL; +struct file_node { + char *path; + char *name; + int length; + struct file_node *next; +}; +static struct file_node *dists = NULL; + +/* Function prototypes */ static int count_files(const char *file); -static int extract_files(int nfiles, const char **files); +static int extract_files(int nfiles, struct file_node *files); + +#if __FreeBSD_version <= 1000008 /* r232154: bump for libarchive update */ +#define archive_read_support_filter_all(x) \ + archive_read_support_compression_all(x) +#endif + +#define _errx(...) (end_dialog(), errx(__VA_ARGS__)) int main(void) { - const char **dists; - char *diststring; - int i; + char *chrootdir; + char *distributions; int ndists = 0; int retval; + size_t file_node_size = sizeof(struct file_node); + size_t span; + struct file_node *dist = dists; char error[PATH_MAX + 512]; - if (getenv("DISTRIBUTIONS") == NULL) + if ((distributions = getenv("DISTRIBUTIONS")) == NULL) errx(EXIT_FAILURE, "DISTRIBUTIONS variable is not set"); + if ((distdir = getenv("BSDINSTALL_DISTDIR")) == NULL) + distdir = __DECONST(char *, ""); - diststring = strdup(getenv("DISTRIBUTIONS")); - for (i = 0; diststring[i] != 0; i++) - if (isspace(diststring[i]) && !isspace(diststring[i+1])) - ndists++; - ndists++; /* Last one */ - - dists = calloc(ndists, sizeof(const char *)); - if (dists == NULL) { - free(diststring); - errx(EXIT_FAILURE, "Out of memory!"); - } - - for (i = 0; i < ndists; i++) - dists[i] = strsep(&diststring, " \t"); - + /* Initialize dialog(3) */ init_dialog(stdin, stdout); dialog_vars.backtitle = __DECONST(char *, "FreeBSD Installer"); dlg_put_backtitle(); - if (chdir(getenv("BSDINSTALL_CHROOT")) != 0) { + dialog_msgbox("", + "Checking distribution archives.\nPlease wait...", 4, 35, FALSE); + + /* + * Parse $DISTRIBUTIONS into linked-list + */ + while (*distributions != '\0') { + span = strcspn(distributions, "\t\n\v\f\r "); + if (span < 1) { /* currently on whitespace */ + distributions++; + continue; + } + ndists++; + + /* Allocate a new struct for the distribution */ + if (dist == NULL) { + if ((dist = calloc(1, file_node_size)) == NULL) + _errx(EXIT_FAILURE, "Out of memory!"); + dists = dist; + } else { + dist->next = calloc(1, file_node_size); + if (dist->next == NULL) + _errx(EXIT_FAILURE, "Out of memory!"); + dist = dist->next; + } + + /* Set path */ + if ((dist->path = malloc(span + 1)) == NULL) + _errx(EXIT_FAILURE, "Out of memory!"); + snprintf(dist->path, span + 1, "%s", distributions); + dist->path[span] = '\0'; + + /* Set display name */ + dist->name = strrchr(dist->path, '/'); + if (dist->name == NULL) + dist->name = dist->path; + + /* Set initial length in files (-1 == error) */ + dist->length = count_files(dist->path); + if (dist->length < 0) { + end_dialog(); + return (EXIT_FAILURE); + } + + distributions += span; + } + + /* Optionally chdir(2) into $BSDINSTALL_CHROOT */ + chrootdir = getenv("BSDINSTALL_CHROOT"); + if (chrootdir != NULL && chdir(chrootdir) != 0) { snprintf(error, sizeof(error), - "Could could change to directory %s: %s\n", - getenv("BSDINSTALL_DISTDIR"), strerror(errno)); + "Could not change to directory %s: %s\n", + chrootdir, strerror(errno)); dialog_msgbox("Error", error, 0, 0, TRUE); end_dialog(); return (EXIT_FAILURE); @@ -88,20 +145,28 @@ main(void) end_dialog(); - free(diststring); - free(dists); + while ((dist = dists) != NULL) { + dists = dist->next; + if (dist->path != NULL) + free(dist->path); + free(dist); + } return (retval); } +/* + * Returns number of files in archive file. Parses $BSDINSTALL_DISTDIR/MANIFEST + * if it exists, otherwise uses archive(3) to read the archive file. + */ static int count_files(const char *file) { static FILE *manifest = NULL; - char *tok1; - char *tok2; + char *p; int file_count; int retval; + size_t span; struct archive *archive; struct archive_entry *entry; char line[512]; @@ -109,36 +174,46 @@ count_files(const char *file) char errormsg[PATH_MAX + 512]; if (manifest == NULL) { - snprintf(path, sizeof(path), "%s/MANIFEST", - getenv("BSDINSTALL_DISTDIR")); + snprintf(path, sizeof(path), "%s/MANIFEST", distdir); manifest = fopen(path, "r"); } if (manifest != NULL) { rewind(manifest); while (fgets(line, sizeof(line), manifest) != NULL) { - tok2 = line; - tok1 = strsep(&tok2, "\t"); - if (tok1 == NULL || strcmp(tok1, file) != 0) + p = &line[0]; + span = strcspn(p, "\t") ; + if (span < 1 || strncmp(p, file, span) != 0) continue; /* * We're at the right manifest line. The file count is * in the third element */ - tok1 = strsep(&tok2, "\t"); - tok1 = strsep(&tok2, "\t"); - if (tok1 != NULL) - return atoi(tok1); + span = strcspn(p += span + (*p != '\0' ? 1 : 0), "\t"); + span = strcspn(p += span + (*p != '\0' ? 1 : 0), "\t"); + if (span > 0) { + file_count = (int)strtol(p, (char **)NULL, 10); + if (file_count == 0 && errno == EINVAL) + continue; + return (file_count); + } } } - /* Either we didn't have a manifest, or this archive wasn't there */ - archive = archive_read_new(); + /* + * Either no manifest, or manifest didn't mention this archive. + * Use archive(3) to read the archive, counting files within. + */ + if ((archive = archive_read_new()) == NULL) { + snprintf(errormsg, sizeof(errormsg), + "Error: %s\n", archive_error_string(NULL)); + dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE); + return (-1); + } archive_read_support_format_all(archive); archive_read_support_filter_all(archive); - snprintf(path, sizeof(path), "%s/%s", getenv("BSDINSTALL_DISTDIR"), - file); + snprintf(path, sizeof(path), "%s/%s", distdir, file); retval = archive_read_open_filename(archive, path, 4096); if (retval != ARCHIVE_OK) { snprintf(errormsg, sizeof(errormsg), @@ -157,7 +232,7 @@ count_files(const char *file) } static int -extract_files(int nfiles, const char **files) +extract_files(int nfiles, struct file_node *files) { int archive_file; int archive_files[nfiles]; @@ -169,43 +244,51 @@ extract_files(int nfiles, const char **f int total_files = 0; struct archive *archive; struct archive_entry *entry; + struct file_node *file; char status[8]; + static char title[] = "Archive Extraction"; + static char pprompt[] = "Extracting distribution files...\n"; char path[PATH_MAX]; char errormsg[PATH_MAX + 512]; const char *items[nfiles*2]; /* Make the transfer list for dialog */ - for (i = 0; i < nfiles; i++) { - items[i*2] = strrchr(files[i], '/'); - if (items[i*2] != NULL) - items[i*2]++; - else - items[i*2] = files[i]; + i = 0; + for (file = files; file != NULL; file = file->next) { + items[i*2] = file->name; items[i*2 + 1] = "Pending"; - } - - dialog_msgbox("", - "Checking distribution archives.\nPlease wait...", 0, 0, FALSE); + archive_files[i] = file->length; - /* Count all the files */ - for (i = 0; i < nfiles; i++) { - archive_files[i] = count_files(files[i]); - if (archive_files[i] < 0) - return (-1); - total_files += archive_files[i]; + total_files += file->length; + i++; } - for (i = 0; i < nfiles; i++) { - archive = archive_read_new(); + i = 0; + for (file = files; file != NULL; file = file->next) { + if ((archive = archive_read_new()) == NULL) { + snprintf(errormsg, sizeof(errormsg), + "Error: %s\n", archive_error_string(NULL)); + dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE); + return (EXIT_FAILURE); + } archive_read_support_format_all(archive); archive_read_support_filter_all(archive); - snprintf(path, sizeof(path), "%s/%s", - getenv("BSDINSTALL_DISTDIR"), files[i]); + snprintf(path, sizeof(path), "%s/%s", distdir, file->path); retval = archive_read_open_filename(archive, path, 4096); + if (retval != 0) { + snprintf(errormsg, sizeof(errormsg), + "Error opening %s: %s\n", file->name, + archive_error_string(archive)); + dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE); + return (EXIT_FAILURE); + } items[i*2 + 1] = "In Progress"; archive_file = 0; + dialog_mixedgauge(title, pprompt, 0, 0, progress, nfiles, + __DECONST(char **, items)); + while ((retval = archive_read_next_header(archive, &entry)) == ARCHIVE_OK) { last_progress = progress; @@ -216,8 +299,7 @@ extract_files(int nfiles, const char **f items[i*2 + 1] = status; if (progress > last_progress) - dialog_mixedgauge("Archive Extraction", - "Extracting distribution files...", 0, 0, + dialog_mixedgauge(title, pprompt, 0, 0, progress, nfiles, __DECONST(char **, items)); @@ -240,12 +322,16 @@ extract_files(int nfiles, const char **f "Error while extracting %s: %s\n", items[i*2], archive_error_string(archive)); items[i*2 + 1] = "Failed"; - dialog_msgbox("Extract Error", errormsg, 0, 0, - TRUE); + dialog_msgbox("Extract Error", errormsg, 0, 0, TRUE); return (retval); } + progress = (current_files*100)/total_files; + dialog_mixedgauge(title, pprompt, 0, 0, progress, nfiles, + __DECONST(char **, items)); + archive_read_free(archive); + i++; } return (EXIT_SUCCESS); Modified: head/usr.sbin/bsdinstall/distfetch/distfetch.c ============================================================================== --- head/usr.sbin/bsdinstall/distfetch/distfetch.c Wed Oct 1 18:07:34 2014 (r272378) +++ head/usr.sbin/bsdinstall/distfetch/distfetch.c Wed Oct 1 18:59:57 2014 (r272379) @@ -82,7 +82,7 @@ main(void) getenv("BSDINSTALL_DISTDIR"), strerror(errno)); dialog_msgbox("Error", error, 0, 0, TRUE); end_dialog(); - return (1); + return (EXIT_FAILURE); } nfetched = fetch_files(ndists, urls); @@ -94,7 +94,7 @@ main(void) free(urls[i]); free(urls); - return ((nfetched == ndists) ? 0 : 1); + return ((nfetched == ndists) ? EXIT_SUCCESS : EXIT_FAILURE); } static int From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 19:03:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id 75CA0FAB; Wed, 1 Oct 2014 19:03:08 +0000 (UTC) Message-ID: <542C4FEC.8010800@FreeBSD.org> Date: Wed, 01 Oct 2014 15:03:08 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Will Andrews , Guido Falsi Subject: Re: svn commit: r272282 - head/share/mk References: <201409291505.s8TF5Nhh066884@svn.freebsd.org> <542C14F6.7020506@FreeBSD.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------020307090005080900090405" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "src-committers@FreeBSD.org" , Baptiste Daroussin , Bryan Drewery 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, 01 Oct 2014 19:03:09 -0000 This is a multi-part message in MIME format. --------------020307090005080900090405 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2014-10-01 11:06:04 -0400, Will Andrews wrote: > If r272363 doesn't resolve the issue for you, let me know. portmaster still fails for me because: # ls -l /usr/ports lrwxr-xr-x 1 root wheel 16 10 1 14:37 /usr/ports -> /home/jkim/ports To work around the failure, I had to apply the attached patches. Jung-uk Kim > Thanks! --Will. > > On Wed, Oct 1, 2014 at 8:51 AM, Guido Falsi > wrote: >> On 09/29/14 17:05, Will Andrews wrote: >>> Author: will Date: Mon Sep 29 15:05:23 2014 New Revision: >>> 272282 URL: http://svnweb.freebsd.org/changeset/base/272282 >>> >>> Log: Search for the nearest PORTSDIR where Mk/bsd.ports.mk >>> exists, from .CURDIR. This will only take effect if PORTSDIR >>> is not set, as previously supported. >>> >>> Use .if exists(), for four specific possibilities relative to >>> .CURDIR: ., .., ../.., and ../../.. The fourth possibility is >>> primarily in case ports ever grows a third level. If none of >>> these paths exist, fall back to the old default of /usr/ports. >>> >>> This removes the need to set PORTSDIR explicitly (or via >>> wrapper script) if one is running out of a ports tree that is >>> not in /usr/ports, but in a home directory. >>> >>> Reviewed by: bapt, bdrewery (older version) CR: D799 MFC >>> after: 1 week Sponsored by: Spectra Logic >>> >> >> Hi, >> >> I just refreshed my machines head r272349 and this change is >> creating problems to me. >> >> Maybe I've always been doing something wrong but this is what is >> happening: >> >> root@marvin:~ [0]# cd /usr/ports/x11/nvidia-driver >> root@marvin:/usr/ports/x11/nvidia-driver [0]# make -V PORTSDIR >> /usr/ports/x11/nvidia-driver/../.. >> >> this is problematic since now all dependencies are relative >> paths, this is said to be unsupported in bsd.sanity.mk, line 35 >> and following ones. >> >> It also makes poudriere builds fail: >> >> root@marvin:~ [0]# poudriere bulk -C -p mptest -t -j 11amd64 >> x11/xlogo ====>> Creating the reference jail... done ====>> >> Mounting system devices for 11amd64-mptest ====>> Mounting >> ports/packages/distfiles ====>> Mounting packages from: >> /poudriere/data/packages/11amd64-mptest ====>> Logs: >> /poudriere/data/logs/bulk/11amd64-mptest/2014-10-01_16h44m56s >> ====>> WWW: >> http://pkg.madpilot.net:8888/logs/bulk/11amd64-mptest/2014-10-01_16h44m56s >> >> >> ====>> Appending to make.conf: /usr/local/etc/poudriere.d/make.conf >> ====>> DEVELOPER=yes ignored from make.conf. Use 'bulk -t' or >> 'testport' for testing instead. /etc/resolv.conf -> >> /poudriere/data/build/11amd64-mptest/ref/etc/resolv.conf ====>> >> Starting jail 11amd64-mptest ====>> Loading MOVED ====>> >> Calculating ports order and dependencies ====>> Error: >> Duplicated origin for pkgconf-0.9.7: >> devel/xorg-macros/../../devel/pkgconf AND >> x11/xlogo/../../devel/pkgconf. Rerun with -vv to see which ports >> are depending on these. ====>> Cleaning up ====>> Umounting file >> systems >> >> (the ports nvidia-driver and xlogo in these small logs are taken >> at random) >> >> It also completely breaks portmaster. >> >> Maybe this patch is excessive and should first try to discover >> if we already are in the standard /usr/ports subtree? >> >> I have not tried but I'm quite confident I can :fix: this by >> adding PORTSTREE=/usr/ports in /etc/make.conf, but this does not >> look like a good solution. >> >> -- Guido Falsi -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJULE/rAAoJEHyflib82/FGuM8IAInuaiLVvxrRG/th0Q/o8cQ2 vFlBry7cDOVeibnYAcNzKmQBYjVD/XdwQYIJu5Hrpdwj1o6JVfUvlOQYZV++m/Yz G5zvwhqvBqgKMi95mZCXEqPDUXN241f627jnLYX6OrTnQRDqapELtMfdcVssXDMt jQcYK+0Q0F3CtHSQhUicwsUYIl2bff1uOS+vgGU/C/kvDwImla5XuCMf3WJHq87H P5X9yKADc5FzqXoCyaCN++cwHKYx0Dw9p1ym4rfX1VfbZrPjaBUsswxW55lcLQ5/ 9BWJ1sGvcuXt82M9UkcIoxstL4+uQrH3B92MAgXVI49j1iB7u2+iFU2dgZCocZs= =Epd0 -----END PGP SIGNATURE----- --------------020307090005080900090405 Content-Type: text/x-patch; name="ports.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ports.diff" Index: share/mk/bsd.port.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 --- share/mk/bsd.port.mk (revision 272375) +++ share/mk/bsd.port.mk (working copy) @@ -12,6 +12,8 @@ PORTSDIR!=3D realpath ${.CURDIR}/.. PORTSDIR!=3D realpath ${.CURDIR}/../.. .elif exists(${.CURDIR}/../../../Mk/bsd.port.mk) PORTSDIR!=3D realpath ${.CURDIR}/../../.. +.elif exists(/usr/ports/Mk/bsd.port.mk) +PORTSDIR!=3D realpath /usr/ports .else PORTSDIR=3D /usr/ports .endif Index: share/mk/bsd.port.subdir.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- share/mk/bsd.port.subdir.mk (revision 272375) +++ share/mk/bsd.port.subdir.mk (working copy) @@ -12,6 +12,8 @@ PORTSDIR!=3D realpath ${.CURDIR}/.. PORTSDIR!=3D realpath ${.CURDIR}/../.. .elif exists(${.CURDIR}/../../../Mk/bsd.port.mk) PORTSDIR!=3D realpath ${.CURDIR}/../../.. +.elif exists(/usr/ports/Mk/bsd.port.mk) +PORTSDIR!=3D realpath /usr/ports .else PORTSDIR=3D /usr/ports .endif --------------020307090005080900090405 Content-Type: text/x-patch; name="portmaster.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="portmaster.diff" --- portmaster.orig 2014-10-01 14:44:28.919316000 -0400 +++ portmaster 2014-10-01 14:44:28.919316000 -0400 @@ -359,7 +359,7 @@ if [ "$$" -eq "$PM_PARENT_PID" ]; then if [ -z "$pd" ]; then if [ -z "$PORTSDIR" ]; then - [ -d /usr/ports ] && pd=3D/usr/ports + [ -d /usr/ports ] && pd=3D`realpath /usr/ports` [ -z "$pd" ] && pd=3D`pm_make_b -f/usr/share/mk/bsd.port.mk -V PORTSDIR 2>/dev/null`= else --------------020307090005080900090405-- From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 19:54:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4ABC1C6 for ; Wed, 1 Oct 2014 19:54:13 +0000 (UTC) Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B35DD85 for ; Wed, 1 Oct 2014 19:54:12 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id cm18so831902qab.6 for ; Wed, 01 Oct 2014 12:54:06 -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=mp7RO1PXcDMakIMZaQM4rXzlB5FYNM+gHMWNnUfDKW8=; b=Q1trZc0dU3UCU23sjbOpUPoLcHoZGJ5TUdepZZ0PSrE055nnmA+9Ub3CyuVYzZUZhA xoJgTMtE6+QLUeQvIouMqOFeC3L9Ft3BjNxuiIoJ26V6Jq4XhJTCXz7hbIdIxcAC2Hvo 0Q8RhM81VGawjLGqZne2khYYmeatBsd9LxQd4tV9MkWTjjyR4ydnw3ECfidon2uGRIAa MZvgrevzu8f1CxIfq0+/wbykHc+vZSbYlLpv9hILtv/fN6z9zsky9tNlRPL1zhvXtqZ6 PRNYXlih7rH6E6zlVyOfU1TL+W/0mAH4bmOthYO2C62nk3MVeuSbktFDkTmi4Ew5lxds fFIQ== X-Gm-Message-State: ALoCoQm1t28deumSrRdNvv33Cez9fJghjzS5kIfE/9uUniQsiPYCaEjZdWq3qP/cr3yaSuh6gBB7 MIME-Version: 1.0 X-Received: by 10.224.32.138 with SMTP id c10mr66581994qad.1.1412193246574; Wed, 01 Oct 2014 12:54:06 -0700 (PDT) Received: by 10.140.31.36 with HTTP; Wed, 1 Oct 2014 12:54:06 -0700 (PDT) In-Reply-To: <542C4FEC.8010800@FreeBSD.org> References: <201409291505.s8TF5Nhh066884@svn.freebsd.org> <542C14F6.7020506@FreeBSD.org> <542C4FEC.8010800@FreeBSD.org> Date: Wed, 1 Oct 2014 13:54:06 -0600 Message-ID: Subject: Re: svn commit: r272282 - head/share/mk From: Will Andrews To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 Cc: Baptiste Daroussin , "src-committers@FreeBSD.org" , "svn-src-all@freebsd.org" , Bryan Drewery , "svn-src-head@freebsd.org" , Guido Falsi 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, 01 Oct 2014 19:54:13 -0000 What kind of problem did this cause compared to the original version? Could you provide the details of what you saw? Thanks, --Will. On Wed, Oct 1, 2014 at 1:03 PM, Jung-uk Kim wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 2014-10-01 11:06:04 -0400, Will Andrews wrote: >> If r272363 doesn't resolve the issue for you, let me know. > > portmaster still fails for me because: > > # ls -l /usr/ports > lrwxr-xr-x 1 root wheel 16 10 1 14:37 /usr/ports -> /home/jkim/ports > > To work around the failure, I had to apply the attached patches. > > Jung-uk Kim > >> Thanks! --Will. >> >> On Wed, Oct 1, 2014 at 8:51 AM, Guido Falsi >> wrote: >>> On 09/29/14 17:05, Will Andrews wrote: >>>> Author: will Date: Mon Sep 29 15:05:23 2014 New Revision: >>>> 272282 URL: http://svnweb.freebsd.org/changeset/base/272282 >>>> >>>> Log: Search for the nearest PORTSDIR where Mk/bsd.ports.mk >>>> exists, from .CURDIR. This will only take effect if PORTSDIR >>>> is not set, as previously supported. >>>> >>>> Use .if exists(), for four specific possibilities relative to >>>> .CURDIR: ., .., ../.., and ../../.. The fourth possibility is >>>> primarily in case ports ever grows a third level. If none of >>>> these paths exist, fall back to the old default of /usr/ports. >>>> >>>> This removes the need to set PORTSDIR explicitly (or via >>>> wrapper script) if one is running out of a ports tree that is >>>> not in /usr/ports, but in a home directory. >>>> >>>> Reviewed by: bapt, bdrewery (older version) CR: D799 MFC >>>> after: 1 week Sponsored by: Spectra Logic >>>> >>> >>> Hi, >>> >>> I just refreshed my machines head r272349 and this change is >>> creating problems to me. >>> >>> Maybe I've always been doing something wrong but this is what is >>> happening: >>> >>> root@marvin:~ [0]# cd /usr/ports/x11/nvidia-driver >>> root@marvin:/usr/ports/x11/nvidia-driver [0]# make -V PORTSDIR >>> /usr/ports/x11/nvidia-driver/../.. >>> >>> this is problematic since now all dependencies are relative >>> paths, this is said to be unsupported in bsd.sanity.mk, line 35 >>> and following ones. >>> >>> It also makes poudriere builds fail: >>> >>> root@marvin:~ [0]# poudriere bulk -C -p mptest -t -j 11amd64 >>> x11/xlogo ====>> Creating the reference jail... done ====>> >>> Mounting system devices for 11amd64-mptest ====>> Mounting >>> ports/packages/distfiles ====>> Mounting packages from: >>> /poudriere/data/packages/11amd64-mptest ====>> Logs: >>> /poudriere/data/logs/bulk/11amd64-mptest/2014-10-01_16h44m56s >>> ====>> WWW: >>> http://pkg.madpilot.net:8888/logs/bulk/11amd64-mptest/2014-10-01_16h44m56s >>> >>> >>> > ====>> Appending to make.conf: /usr/local/etc/poudriere.d/make.conf >>> ====>> DEVELOPER=yes ignored from make.conf. Use 'bulk -t' or >>> 'testport' for testing instead. /etc/resolv.conf -> >>> /poudriere/data/build/11amd64-mptest/ref/etc/resolv.conf ====>> >>> Starting jail 11amd64-mptest ====>> Loading MOVED ====>> >>> Calculating ports order and dependencies ====>> Error: >>> Duplicated origin for pkgconf-0.9.7: >>> devel/xorg-macros/../../devel/pkgconf AND >>> x11/xlogo/../../devel/pkgconf. Rerun with -vv to see which ports >>> are depending on these. ====>> Cleaning up ====>> Umounting file >>> systems >>> >>> (the ports nvidia-driver and xlogo in these small logs are taken >>> at random) >>> >>> It also completely breaks portmaster. >>> >>> Maybe this patch is excessive and should first try to discover >>> if we already are in the standard /usr/ports subtree? >>> >>> I have not tried but I'm quite confident I can :fix: this by >>> adding PORTSTREE=/usr/ports in /etc/make.conf, but this does not >>> look like a good solution. >>> >>> -- Guido Falsi > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQEcBAEBAgAGBQJULE/rAAoJEHyflib82/FGuM8IAInuaiLVvxrRG/th0Q/o8cQ2 > vFlBry7cDOVeibnYAcNzKmQBYjVD/XdwQYIJu5Hrpdwj1o6JVfUvlOQYZV++m/Yz > G5zvwhqvBqgKMi95mZCXEqPDUXN241f627jnLYX6OrTnQRDqapELtMfdcVssXDMt > jQcYK+0Q0F3CtHSQhUicwsUYIl2bff1uOS+vgGU/C/kvDwImla5XuCMf3WJHq87H > P5X9yKADc5FzqXoCyaCN++cwHKYx0Dw9p1ym4rfX1VfbZrPjaBUsswxW55lcLQ5/ > 9BWJ1sGvcuXt82M9UkcIoxstL4+uQrH3B92MAgXVI49j1iB7u2+iFU2dgZCocZs= > =Epd0 > -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 20:03:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1DB44CA; Wed, 1 Oct 2014 20:03:48 +0000 (UTC) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 562C7E67; Wed, 1 Oct 2014 20:03:48 +0000 (UTC) Received: by mail-ig0-f177.google.com with SMTP id a13so273769igq.4 for ; Wed, 01 Oct 2014 13:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=bHWrNX/I2/GQehfspK1q+ZO/gqJGDXcXR7483ReIbps=; b=YQxp06ZruxgVgOODYuukZTpU291Dm+Q9U2tR+Zr56aRbFTy09gdg2cvy2AktEAWwyv bCWFt/ZiuUg4JeDl0R6U1GfZp8ku1LCY4eVi458Cy1GpO1A+ZhITF8/mKi8Ei6/Td236 ceTAKtYTVA6sGBFAEEvFee+E2vJVsnzx8yiEMds5OP+4/d1qjunkdu75i+CrumJVNS8Q 7QL3ZL9Na1gabjIZlDrbWoLTIKMmdKZXTQ0txht8nL9olq+aCJenqRWKd65ls9OnV9+E Ck+WJ0EADy25GEhYf7Alx1K3n7OWHYRO4klAdF4de2oU0LkLwX+5tysHLu93fbn1hdAs FjzQ== MIME-Version: 1.0 X-Received: by 10.50.44.71 with SMTP id c7mr22533148igm.49.1412193827699; Wed, 01 Oct 2014 13:03:47 -0700 (PDT) Received: by 10.50.227.42 with HTTP; Wed, 1 Oct 2014 13:03:47 -0700 (PDT) In-Reply-To: <201409291505.s8TF5Nhh066884@svn.freebsd.org> References: <201409291505.s8TF5Nhh066884@svn.freebsd.org> Date: Wed, 1 Oct 2014 13:03:47 -0700 Message-ID: Subject: Re: svn commit: r272282 - head/share/mk From: NGie Cooper To: Will Andrews 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: Wed, 01 Oct 2014 20:03:48 -0000 On Mon, Sep 29, 2014 at 8:05 AM, Will Andrews wrote: > Author: will > Date: Mon Sep 29 15:05:23 2014 > New Revision: 272282 > URL: http://svnweb.freebsd.org/changeset/base/272282 > > Log: > Search for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR. > This will only take effect if PORTSDIR is not set, as previously supported. > > Use .if exists(), for four specific possibilities relative to .CURDIR: > ., .., ../.., and ../../.. The fourth possibility is primarily in case > ports ever grows a third level. If none of these paths exist, fall back to > the old default of /usr/ports. > > This removes the need to set PORTSDIR explicitly (or via wrapper script) if > one is running out of a ports tree that is not in /usr/ports, but in a > home directory. > > Reviewed by: bapt, bdrewery (older version) > CR: D799 > MFC after: 1 week > Sponsored by: Spectra Logic > > Modified: > head/share/mk/bsd.port.mk > head/share/mk/bsd.port.subdir.mk This change seems like it introduces a lot of unnecessary complexity in lieu of someone setting PORTSDIR to the root of their ports tree in the environment. Why isn't it using a for-loop by the way? Thanks! From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 20:07:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75AD5231 for ; Wed, 1 Oct 2014 20:07:53 +0000 (UTC) Received: from nm44-vm6.bullet.mail.bf1.yahoo.com (nm44-vm6.bullet.mail.bf1.yahoo.com [216.109.115.30]) (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 15AF4EB6 for ; Wed, 1 Oct 2014 20:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1412193736; bh=cf7E+hfqbP2psrIjyc1if1EcF7mbC8faDFhRjIBgVqQ=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:From:Subject; b=ixnDcaYRIjQeFAUkcdcBlGDJOKVQMNKx2O2KyhHqJl15iYsgf20zxfnJruUG9Q30fM0QefKoXgSfiOXVTI3MhDr8VszH6ClTliXcIerlYlSjVcPe6OKI1fCHpa2XfM0NjreXJMXYtrQStiZyx9+V6e5/rIr0hxXcL2hM8W8NW5CBhsX9BpwfCTreSqu/aECBwbJMBETe1zdp1UCCMF/3TJInf+0WfH5zFWw/dZRw9HvKtw8Ne+q6TPCeBOGyTf+4vevaa7WhcOf94GdJv4J8IphtzU8y5bNikVhp8kSXl6/dwraXqg8IpdHEh05iShg2VgDmR9w70MuVzNXKcCX+Vw== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=oi6St+lN/KMiR2PxUZppIeG6UDe81a+ffvQ5L5a2ytJkv0XhGBh5NJn7+OEGgsXQP2Uruznw88YKI/2dvwrZx7rI1UKfif8q9cefXJ+k4aU+rV2ofgkW60MtYE5LefxT0/aqbTXzHZSfAurZZjeKr88bxdGnKG38xEyHN2BL5zPqiQfXvXWQW5WJ5Ag0OrPbVspwng67JRpHlndHWCAwGuzl3CVGnJrmHkHCwWJNeTa1F7AtSKd/FoPU+29fDWXeBBngJlHDZ9FFkqSbqOOu48gcH+mT955uInLWlwdkmvYjyHC4yTmBE7WqCaILvLW7hFPlXFs/ZZCQWFgg4x/HOA==; Received: from [98.139.214.32] by nm44.bullet.mail.bf1.yahoo.com with NNFMP; 01 Oct 2014 20:02:16 -0000 Received: from [98.139.211.161] by tm15.bullet.mail.bf1.yahoo.com with NNFMP; 01 Oct 2014 20:02:16 -0000 Received: from [127.0.0.1] by smtp218.mail.bf1.yahoo.com with NNFMP; 01 Oct 2014 20:02:16 -0000 X-Yahoo-Newman-Id: 847888.33515.bm@smtp218.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: .un7UrMVM1limzaoPCQoWOCKCNiyKb6o2MiuEaGHO6HFdli ysQLMC9f_gLZgvwhxuzJVyt.rJmF7jtzeqI89CtS4e7ivup83GG4nknwilM1 NnQneUY9Fydh43..rX9n9UDmxwizxIABsvvI1OgCWGUJ1op5IFoeufd8x36Q OmRkgxn_HDmV9A.V5nrUcT2HN0GJ.XCb4CwluocT1M_5vBE3y00iG3WPa9Cx Esy4ZKrIfHWFhhkyBILQjcKIqJl.uLidLAv_Vnuc_7LUTPDq_cOu3L6Xw2V0 0RgBXOs1qpf1COqn0_b17mzwIjJL6ISI0Fnf6R2LAqaAyl2fNfmyEg8UCh4s ft.X5m53PcSXKUK4nbF_eQX5ZGJxWmyPXzjJ8KLZu9qmgB.1dimCt97cu_Go mZfQgM_SqkskJoZhSzS4D8yTwaEJ8P8Ig_dtL59y4ArTXvC1xDJlb4Iy2lDP P4aRDaCzUN2mCLYEV84UpZp0LTV6VFHC3p4TKJ2ItSa73hmxebigvaXyix4V zJhS4QDzZucYaRNR24mN_hvs782W9w9QuMFOnaWhBg.c8c9Lnc.hJh50s4bk SrqrarnIRJqtam33xt3dNldSlSC4KslR6Ob7n X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <542C5DCC.8060406@freebsd.org> Date: Wed, 01 Oct 2014 15:02:20 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Andrey A. Chernov" Subject: New bug introduced in strptime (was Re: svn commit: r272273 - head/lib/libc/stdtime) References: <201409282120.s8SLKLJs070469@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, Antoine Brodin , David Carlier 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, 01 Oct 2014 20:07:53 -0000 Hello; I can reproduce this. On FreeBSD 9.1 (no patch): pfg@minotaur:~$ uname -a FreeBSD minotaur.apache.org 9.1-RELEASE-p6 FreeBSD 9.1-RELEASE-p6 #0 r254631: Thu Aug 22 13:59:50 UTC 2013 root@loki.apache.org:/usr/obj/usr/src/sys/ASF amd64 pfg@minotaur:~$ date -j -f '%a, %e %b %Y %T %z' "Sat, 01 Aug 2009 18:07:18 +0200" +%B August On my box with the patch applied: $ date -j -f '%a, %e %b %Y %T %z' "Sat, 01 Aug 2009 18:07:18 +0200" +%B Failed conversion of ``Sat, 01 Aug 2009 18:07:18 +0200'' using format ``%a, %e %b %Y %T %z'' date: illegal time format usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] Regards, Pedro. On 10/01/14 11:46, Antoine Brodin wrote: > On Sun, Sep 28, 2014 at 11:20 PM, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Sun Sep 28 21:20:20 2014 >> New Revision: 272273 >> URL: http://svnweb.freebsd.org/changeset/base/272273 >> >> Log: >> Add strptime(3) support for %U and %W (take 2) >> >> Add support for the missing POSIX-2001 %U and %W features: the >> existing FreeBSD strptime code recognizes both directives and >> validates that the week number lies in the permitted range, >> but then simply discards the value. >> >> Initial support for the feature was written by Paul Green. >> David Carlier added the initial handling of tm_wday/tm_yday. >> Major credit goes to Andrey Chernov for detecting much of the >> brokenness, and rewriting/cleaning most of the code, making it >> much more robust. >> >> Tested independently with the strptime test from the GNU C >> library. >> >> PR: 137307 >> MFC after: 1 month >> Relnotes: yes > Hi, > > It seems this change breaks some ports, so please no MFC until this is fixed: > > http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p369565_s272290/logs/errors/latrine-1.0.0_1.log > http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p369565_s272290/logs/errors/mongrel2-1.7.5_2.log > http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p369565_s272290/logs/errors/deforaos-mailer-0.1.6_1.log > > Cheers, > > Antoine (portmgr hat on) > > From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 20:14:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id 06CB973E; Wed, 1 Oct 2014 20:13:59 +0000 (UTC) Message-ID: <542C6087.2060909@FreeBSD.org> Date: Wed, 01 Oct 2014 16:13:59 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Will Andrews Subject: Re: svn commit: r272282 - head/share/mk References: <201409291505.s8TF5Nhh066884@svn.freebsd.org> <542C14F6.7020506@FreeBSD.org> <542C4FEC.8010800@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Baptiste Daroussin , "src-committers@FreeBSD.org" , "svn-src-all@freebsd.org" , Bryan Drewery , "svn-src-head@freebsd.org" , Guido Falsi 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, 01 Oct 2014 20:14:00 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2014-10-01 15:54:06 -0400, Will Andrews wrote: > What kind of problem did this cause compared to the original > version? Could you provide the details of what you saw? # portmaster devel/autoconf devel/autoconf-wrapper ===>>> Working on: devel/autoconf devel/autoconf-wrapper ===>>> devel/autoconf 1/2 ===>>> Gathering distinfo list for installed ports ===>>> Currently installed version: autoconf-2.69 ===>>> Port directory: /usr/ports/devel/autoconf ===>>> Launching 'make checksum' for devel/autoconf in background ===>>> Gathering dependency list for devel/autoconf from ports ===>>> Launching child to install /usr/home/jkim/ports/devel/autoconf-wrapper ===>>> devel/autoconf 1/2 >> /usr/home/jkim/ports/devel/autoconf-wrapper (1/1) ===>>> No valid installed port, or port directory given ===>>> Try portmaster --help ===>>> Update for /usr/home/jkim/ports/devel/autoconf-wrapper failed ===>>> Aborting update ===>>> Update for devel/autoconf failed ===>>> Aborting update Actually, portmaster.diff is just enough to fix portmaster problem. ports.diff is for consistency. Jung-uk Kim > Thanks, --Will. > > On Wed, Oct 1, 2014 at 1:03 PM, Jung-uk Kim > wrote:> On 2014-10-01 11:06:04 -0400, Will Andrews wrote: >>>> If r272363 doesn't resolve the issue for you, let me know. > > portmaster still fails for me because: > > # ls -l /usr/ports lrwxr-xr-x 1 root wheel 16 10 1 14:37 > /usr/ports -> /home/jkim/ports > > To work around the failure, I had to apply the attached patches. > > Jung-uk Kim > >>>> Thanks! --Will. >>>> >>>> On Wed, Oct 1, 2014 at 8:51 AM, Guido Falsi >>>> wrote: >>>>> On 09/29/14 17:05, Will Andrews wrote: >>>>>> Author: will Date: Mon Sep 29 15:05:23 2014 New >>>>>> Revision: 272282 URL: >>>>>> http://svnweb.freebsd.org/changeset/base/272282 >>>>>> >>>>>> Log: Search for the nearest PORTSDIR where >>>>>> Mk/bsd.ports.mk exists, from .CURDIR. This will only take >>>>>> effect if PORTSDIR is not set, as previously supported. >>>>>> >>>>>> Use .if exists(), for four specific possibilities >>>>>> relative to .CURDIR: ., .., ../.., and ../../.. The >>>>>> fourth possibility is primarily in case ports ever grows >>>>>> a third level. If none of these paths exist, fall back >>>>>> to the old default of /usr/ports. >>>>>> >>>>>> This removes the need to set PORTSDIR explicitly (or via >>>>>> wrapper script) if one is running out of a ports tree >>>>>> that is not in /usr/ports, but in a home directory. >>>>>> >>>>>> Reviewed by: bapt, bdrewery (older version) CR: >>>>>> D799 MFC after: 1 week Sponsored by: Spectra >>>>>> Logic >>>>>> >>>>> >>>>> Hi, >>>>> >>>>> I just refreshed my machines head r272349 and this change >>>>> is creating problems to me. >>>>> >>>>> Maybe I've always been doing something wrong but this is >>>>> what is happening: >>>>> >>>>> root@marvin:~ [0]# cd /usr/ports/x11/nvidia-driver >>>>> root@marvin:/usr/ports/x11/nvidia-driver [0]# make -V >>>>> PORTSDIR /usr/ports/x11/nvidia-driver/../.. >>>>> >>>>> this is problematic since now all dependencies are >>>>> relative paths, this is said to be unsupported in >>>>> bsd.sanity.mk, line 35 and following ones. >>>>> >>>>> It also makes poudriere builds fail: >>>>> >>>>> root@marvin:~ [0]# poudriere bulk -C -p mptest -t -j >>>>> 11amd64 x11/xlogo ====>> Creating the reference jail... >>>>> done ====>> Mounting system devices for 11amd64-mptest >>>>> ====>> Mounting ports/packages/distfiles ====>> Mounting >>>>> packages from: /poudriere/data/packages/11amd64-mptest >>>>> ====>> Logs: >>>>> /poudriere/data/logs/bulk/11amd64-mptest/2014-10-01_16h44m56s >>>>> >>>>> ====>> WWW: >>>>> http://pkg.madpilot.net:8888/logs/bulk/11amd64-mptest/2014-10-01_16h44m56s >>>>> >>>>> >>>>> > >>>>> ====>> Appending to make.conf: /usr/local/etc/poudriere.d/make.conf >>>>> ====>> DEVELOPER=yes ignored from make.conf. Use 'bulk -t' >>>>> or 'testport' for testing instead. /etc/resolv.conf -> >>>>> /poudriere/data/build/11amd64-mptest/ref/etc/resolv.conf >>>>> ====>> Starting jail 11amd64-mptest ====>> Loading MOVED >>>>> ====>> Calculating ports order and dependencies ====>> >>>>> Error: Duplicated origin for pkgconf-0.9.7: >>>>> devel/xorg-macros/../../devel/pkgconf AND >>>>> x11/xlogo/../../devel/pkgconf. Rerun with -vv to see which >>>>> ports are depending on these. ====>> Cleaning up ====>> >>>>> Umounting file systems >>>>> >>>>> (the ports nvidia-driver and xlogo in these small logs are >>>>> taken at random) >>>>> >>>>> It also completely breaks portmaster. >>>>> >>>>> Maybe this patch is excessive and should first try to >>>>> discover if we already are in the standard /usr/ports >>>>> subtree? >>>>> >>>>> I have not tried but I'm quite confident I can :fix: this >>>>> by adding PORTSTREE=/usr/ports in /etc/make.conf, but this >>>>> does not look like a good solution. >>>>> >>>>> -- Guido Falsi -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJULGCHAAoJEHyflib82/FGFoMH/1BARQu10hK1avJl3W6lYl3y HeiKU7IvC0+DtfXZvA0Ixn9eGfCzmLi0TqPQTUQRQniIWBNggUTG41mD1Ar6a1nv 3e7AF8vquCwKXYpm9LS/vc4I4U4k7PguUcE2DrX2NaRdkOrNWN09b/NKO8uZndMS sFhzUcp2euCY0X9aV+hBiy7JWmZ5KF5JOA0wXWx33glduuHDHqARJeDzmGKS3ufH RNTRR4rJlWpgALGwjYwAPlS1z7EQgJ4mJBYjMmy1Q10i7sX9oFB7oQc7w/qnUndX q9RtNEgtkgZzKY5JgdUWqIitwr0wl4YCjkpGiylEp+54b7hn+n/qfhXde9G5wyA= =pH7W -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 20:15:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E08F8C7; Wed, 1 Oct 2014 20:15:49 +0000 (UTC) Received: from mail-ie0-x22f.google.com (mail-ie0-x22f.google.com [IPv6:2607:f8b0:4001:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 029ACFB9; Wed, 1 Oct 2014 20:15:48 +0000 (UTC) Received: by mail-ie0-f175.google.com with SMTP id x19so243393ier.20 for ; Wed, 01 Oct 2014 13:15:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=t+t3okt0XYT2GhwyJF9CWNEd1X6PKjzr2zGSdkeSh6Q=; b=ZebT6JUqmVEN+Wqhfrz5hGIuZqIghnjSZZZCWEwHbTJ9rVMGzpF4Mf544054bDmhaP fuIbVK9pfixXDyE9DmwqzLDvmqdDYC7lXBczcVhmZc20Dmnr7FdRHQhbsezroXbJw/7g fw1AZy1WvodcIc1pB00bCH0+kk9rdDhD4xTsKA7UaTe4K1XfY8/nkxRYlgMGO5P8ygGS iL3h1LhJjh836soF1jexjp+gnPBC0PMio/t6DWKi90vVUljZFQjzIP8F+f9bzDGnd2C6 68u81QgrL5uDUQuIzqnBKZkVBFS/QDQQzpDWfBYf86lbiTlfBSoViUeIHUsD+SqJThOU +0SQ== MIME-Version: 1.0 X-Received: by 10.50.253.193 with SMTP id ac1mr23079789igd.49.1412194548101; Wed, 01 Oct 2014 13:15:48 -0700 (PDT) Received: by 10.50.227.42 with HTTP; Wed, 1 Oct 2014 13:15:48 -0700 (PDT) In-Reply-To: <542C6087.2060909@FreeBSD.org> References: <201409291505.s8TF5Nhh066884@svn.freebsd.org> <542C14F6.7020506@FreeBSD.org> <542C4FEC.8010800@FreeBSD.org> <542C6087.2060909@FreeBSD.org> Date: Wed, 1 Oct 2014 13:15:48 -0700 Message-ID: Subject: Re: svn commit: r272282 - head/share/mk From: NGie Cooper To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 Cc: Baptiste Daroussin , "src-committers@FreeBSD.org" , "svn-src-all@freebsd.org" , Bryan Drewery , "svn-src-head@freebsd.org" , Will Andrews , Guido Falsi 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, 01 Oct 2014 20:15:49 -0000 On Wed, Oct 1, 2014 at 1:13 PM, Jung-uk Kim wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 2014-10-01 15:54:06 -0400, Will Andrews wrote: >> What kind of problem did this cause compared to the original >> version? Could you provide the details of what you saw? > > # portmaster devel/autoconf devel/autoconf-wrapper > > ===>>> Working on: > devel/autoconf > devel/autoconf-wrapper > > > ===>>> devel/autoconf 1/2 > ===>>> Gathering distinfo list for installed ports > > > ===>>> Currently installed version: autoconf-2.69 > ===>>> Port directory: /usr/ports/devel/autoconf > > ===>>> Launching 'make checksum' for devel/autoconf in background > ===>>> Gathering dependency list for devel/autoconf from ports > ===>>> Launching child to install > /usr/home/jkim/ports/devel/autoconf-wrapper > > ===>>> devel/autoconf 1/2 >> > /usr/home/jkim/ports/devel/autoconf-wrapper (1/1) > > ===>>> No valid installed port, or port directory given > ===>>> Try portmaster --help > > > ===>>> Update for /usr/home/jkim/ports/devel/autoconf-wrapper failed > ===>>> Aborting update > > ===>>> Update for devel/autoconf failed > ===>>> Aborting update > > Actually, portmaster.diff is just enough to fix portmaster problem. > ports.diff is for consistency. This is actually one of the problems that people have identified on the -current list recently that they thought was a bug in portmaster. Cheers, From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 20:16:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9CE5AF5 for ; Wed, 1 Oct 2014 20:16:53 +0000 (UTC) Received: from mail-qc0-f172.google.com (mail-qc0-f172.google.com [209.85.216.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89A31FC9 for ; Wed, 1 Oct 2014 20:16:53 +0000 (UTC) Received: by mail-qc0-f172.google.com with SMTP id o8so1078847qcw.31 for ; Wed, 01 Oct 2014 13:16:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=cJThrLAmqxL/Ddpo/3IF3nLaHQ7qvQNVKSsZFW7dZqo=; b=GhP2OFT1IEjPIJU//NXoRutWZn8yY6UwPJrJJgIXaEOD31/xsa9xxbKxxIjXIQhJFi v/MV8O6UImLZiKvmDMz5sTTs8SgpCROPeyzBKgChU3dj+kkxb4EqcC5D3CGBkh5f5u8b Gqghr8PXZp5XxS6Td5rSp+20pJDWW7gDW4ZwtyIaEP+lHvulHR/ffEGL2PSOkRkUqYZg ZhQ2Ql7MF4Zz7adAQo+XcubjNLtC5USX2bYFkLHfjlNQdKTis4WNQn6SPdsZgbBzBJoO BIbfw21dVbjidDsUUU4lgu3F/rwkPQc2pVQurGqBc6moc68HwSKRYE3a8DT3AcsuIhB7 4y0w== X-Gm-Message-State: ALoCoQnWfVwerGrDor1eOEBUXA1bnr8EqU2QosDF3pLb4XluV7bLmz0Cq0KmL2qHIdXC9h9ZIiiV MIME-Version: 1.0 X-Received: by 10.224.127.131 with SMTP id g3mr35814371qas.81.1412194612640; Wed, 01 Oct 2014 13:16:52 -0700 (PDT) Received: by 10.140.31.36 with HTTP; Wed, 1 Oct 2014 13:16:52 -0700 (PDT) In-Reply-To: References: <201409291505.s8TF5Nhh066884@svn.freebsd.org> Date: Wed, 1 Oct 2014 14:16:52 -0600 Message-ID: Subject: Re: svn commit: r272282 - head/share/mk From: Will Andrews To: NGie Cooper 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: Wed, 01 Oct 2014 20:16:53 -0000 On Wed, Oct 1, 2014 at 2:03 PM, NGie Cooper wrote: > This change seems like it introduces a lot of unnecessary complexity > in lieu of someone setting PORTSDIR to the root of their ports tree in > the environment. Sure, but people that are trying to use it somewhere other than /usr/ports shouldn't be surprised by misbehavior. I've worked with several people (who aren't steeped in the usage of ports) who were astonished by this behavior. > Why isn't it using a for-loop by the way? My original implementation used a shell for loop (see the CR), but given the lack of a legitimate use case for looking farther up than three parent directories, it seemed easier not to. I suppose one could use a static list of paths in the for loop though. --Will. From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 20:33:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F3852DC for ; Wed, 1 Oct 2014 20:33:32 +0000 (UTC) Received: from mail-qg0-f50.google.com (mail-qg0-f50.google.com [209.85.192.50]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CB68303 for ; Wed, 1 Oct 2014 20:33:31 +0000 (UTC) Received: by mail-qg0-f50.google.com with SMTP id q108so836742qgd.23 for ; Wed, 01 Oct 2014 13:33:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=6A8bZeX4025K5YBj1l1gy/z+RwFBe2d95rsvBDhyIRw=; b=LUY2x/npuhHJy2i6EroIb1I9uruRzzq0Ydn3cK0K5ET01Q0RSgSQol+8fTmoDa0opE WRornj4L4W9tZK08Yi5GAzHhA2uHQrsxl/yi/DS04PB4kFmP8cB9rWIn+k9NJh65UeDp Xc7tcFNfGEqA0jdMZ9BH5rxyHO0/kn7GsERyABM8F5NvfMEqGUq6C0iEwRcFJaDNdgva lzTpym+w2zOJ4qvAymeTWxY5YI+IFOzX2zpEnESfNuquShVh9K2c+9dcvHf2oKMkrQtr zWOo8QEifI8vIn4bqL9TWsJ4m2tfKPjXg0vjCIB093tWPItduOl7wBdT0Ntsq0fHhqGX ADwg== X-Gm-Message-State: ALoCoQl2b/qoaQhfqedmSB3hvUj39+72Hiv7CVvUEdHh+ReBT23MrxuDovgUjaGnWfJ4jwKjMB07 MIME-Version: 1.0 X-Received: by 10.224.32.138 with SMTP id c10mr67036630qad.1.1412195610628; Wed, 01 Oct 2014 13:33:30 -0700 (PDT) Received: by 10.140.31.36 with HTTP; Wed, 1 Oct 2014 13:33:30 -0700 (PDT) In-Reply-To: <542C6087.2060909@FreeBSD.org> References: <201409291505.s8TF5Nhh066884@svn.freebsd.org> <542C14F6.7020506@FreeBSD.org> <542C4FEC.8010800@FreeBSD.org> <542C6087.2060909@FreeBSD.org> Date: Wed, 1 Oct 2014 14:33:30 -0600 Message-ID: Subject: Re: svn commit: r272282 - head/share/mk From: Will Andrews To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 Cc: Baptiste Daroussin , "src-committers@FreeBSD.org" , "svn-src-all@freebsd.org" , Bryan Drewery , "svn-src-head@freebsd.org" , Guido Falsi 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, 01 Oct 2014 20:33:32 -0000 On Wed, Oct 1, 2014 at 2:13 PM, Jung-uk Kim wrote: > Actually, portmaster.diff is just enough to fix portmaster problem. > ports.diff is for consistency. So I guess portmaster is doing a string comparison to decide whether to install a port? That sounds like a bug in portmaster. I suggest changing it to always ask make for the value of PORTSDIR. --Will. From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 20:37:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 243184B8; Wed, 1 Oct 2014 20:37:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10ECE34F; Wed, 1 Oct 2014 20:37: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 s91KbFbV097058; Wed, 1 Oct 2014 20:37:15 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91KbFfW097057; Wed, 1 Oct 2014 20:37:15 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201410012037.s91KbFfW097057@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 1 Oct 2014 20:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272382 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 01 Oct 2014 20:37:16 -0000 Author: marcel Date: Wed Oct 1 20:37:15 2014 New Revision: 272382 URL: https://svnweb.freebsd.org/changeset/base/272382 Log: Suffix the cookie constants with ULL to silence warnings from compilers that try to treat them as 32-bit values. Modified: head/usr.bin/mkimg/vhd.c Modified: head/usr.bin/mkimg/vhd.c ============================================================================== --- head/usr.bin/mkimg/vhd.c Wed Oct 1 19:25:02 2014 (r272381) +++ head/usr.bin/mkimg/vhd.c Wed Oct 1 20:37:15 2014 (r272382) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); struct vhd_footer { uint64_t cookie; -#define VHD_FOOTER_COOKIE 0x636f6e6563746978 +#define VHD_FOOTER_COOKIE 0x636f6e6563746978ULL uint32_t features; #define VHD_FEATURES_TEMPORARY 0x01 #define VHD_FEATURES_RESERVED 0x02 @@ -236,7 +236,7 @@ vhd_resize(lba_t imgsz) struct vhd_dyn_header { uint64_t cookie; -#define VHD_HEADER_COOKIE 0x6378737061727365 +#define VHD_HEADER_COOKIE 0x6378737061727365ULL uint64_t data_offset; uint64_t table_offset; uint32_t version; From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 20:52:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35BDE976; Wed, 1 Oct 2014 20:52:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08A937D9; Wed, 1 Oct 2014 20:52: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 s91Kq8bn005973; Wed, 1 Oct 2014 20:52:08 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91Kq8Md005971; Wed, 1 Oct 2014 20:52:08 GMT (envelope-from will@FreeBSD.org) Message-Id: <201410012052.s91Kq8Md005971@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 1 Oct 2014 20:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272383 - 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: Wed, 01 Oct 2014 20:52:09 -0000 Author: will Date: Wed Oct 1 20:52:08 2014 New Revision: 272383 URL: https://svnweb.freebsd.org/changeset/base/272383 Log: Revise r272363 by collapsing the tests into a for loop. This has the side effect of ensuring that realpath is also run for the nominal case of PORTSDIR=/usr/ports (assuming .CURDIR is a ports directory that relies on /usr/ports but is not rooted in it). This ensures that any generated PORTSDIR used is always the actual location. Submitted by: jkim (different implementation) Modified: head/share/mk/bsd.port.mk head/share/mk/bsd.port.subdir.mk Modified: head/share/mk/bsd.port.mk ============================================================================== --- head/share/mk/bsd.port.mk Wed Oct 1 20:37:15 2014 (r272382) +++ head/share/mk/bsd.port.mk Wed Oct 1 20:52:08 2014 (r272383) @@ -4,17 +4,13 @@ # Autodetect if the command is being run in a ports tree that's not rooted # in the default /usr/ports. The ../../.. case is in case ports ever grows # a third level. -.if exists(${.CURDIR}/Mk/bsd.port.mk) -PORTSDIR!= realpath ${.CURDIR} -.elif exists(${.CURDIR}/../Mk/bsd.port.mk) -PORTSDIR!= realpath ${.CURDIR}/.. -.elif exists(${.CURDIR}/../../Mk/bsd.port.mk) -PORTSDIR!= realpath ${.CURDIR}/../.. -.elif exists(${.CURDIR}/../../../Mk/bsd.port.mk) -PORTSDIR!= realpath ${.CURDIR}/../../.. -.else -PORTSDIR= /usr/ports +.for RELPATH in . .. ../.. ../../.. +.if !defined(_PORTSDIR) && exists(${.CURDIR}/${RELPATH}/Mk/bsd.port.mk) +_PORTSDIR= ${.CURDIR}/${RELPATH} .endif +.endfor +_PORTSDIR?= /usr/ports +PORTSDIR!= realpath ${_PORTSDIR} .endif BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk Modified: head/share/mk/bsd.port.subdir.mk ============================================================================== --- head/share/mk/bsd.port.subdir.mk Wed Oct 1 20:37:15 2014 (r272382) +++ head/share/mk/bsd.port.subdir.mk Wed Oct 1 20:52:08 2014 (r272383) @@ -4,17 +4,13 @@ # Autodetect if the command is being run in a ports tree that's not rooted # in the default /usr/ports. The ../../.. case is in case ports ever grows # a third level. -.if exists(${.CURDIR}/Mk/bsd.port.mk) -PORTSDIR!= realpath ${.CURDIR} -.elif exists(${.CURDIR}/../Mk/bsd.port.mk) -PORTSDIR!= realpath ${.CURDIR}/.. -.elif exists(${.CURDIR}/../../Mk/bsd.port.mk) -PORTSDIR!= realpath ${.CURDIR}/../.. -.elif exists(${.CURDIR}/../../../Mk/bsd.port.mk) -PORTSDIR!= realpath ${.CURDIR}/../../.. -.else -PORTSDIR= /usr/ports +.for RELPATH in . .. ../.. ../../.. +.if !defined(_PORTSDIR) && exists(${.CURDIR}/${RELPATH}/Mk/bsd.port.mk) +_PORTSDIR= ${.CURDIR}/${RELPATH} .endif +.endfor +_PORTSDIR?= /usr/ports +PORTSDIR!= realpath ${_PORTSDIR} .endif BSDPORTSUBDIRMK?= ${PORTSDIR}/Mk/bsd.port.subdir.mk From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 21:03:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E394D150; Wed, 1 Oct 2014 21:03: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 C4EB293F; Wed, 1 Oct 2014 21:03: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 s91L3H1E010908; Wed, 1 Oct 2014 21:03:17 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91L3HR0010906; Wed, 1 Oct 2014 21:03:17 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201410012103.s91L3HR0010906@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 1 Oct 2014 21:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272384 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 01 Oct 2014 21:03:18 -0000 Author: marcel Date: Wed Oct 1 21:03:17 2014 New Revision: 272384 URL: https://svnweb.freebsd.org/changeset/base/272384 Log: Improve performance of mking(1) by keeping a list of "chunks" in memory, that keeps track of a particular region of the image. In particular the image_data() function needs to return to the caller whether a region contains data or is all zeroes. This required reading the region from the temporary file and comparing the bytes. When image_data() is used multiple times for the same region, this will get painful fast. With a chunk describing a region of the image, we now also have a way to refer to the image provided on the command line. This means we don't need to copy the image into a temporary file. We just keep track of the file descriptor and offset within the source file on a per-chunk basis. For streams (pipes, sockets, fifos, etc) we now use the temporary file as a swap file. We read from the input file and create a chunk of type "zeroes" for each sequence of zeroes that's a multiple of the sector size. Otherwise, we allocte from the swap file, mmap(2) it, read into the mmap(2)'d memory and create a chunk representing data. For regular files, we use SEEK_HOLE and SEEK_DATA to handle sparse files eficiently and create a chunk of type zeroes for holes and a chunk of type data for data regions. For data regions, we still compare the bytes we read to handle differences between a file system's block size and our sector size. After reading all files, image_write() is used by schemes to scribble in the reserved sectors. Since this never amounts to much, keep this data in memory in chunks of exactly 1 sector. The output image is created by looking using the chunk list to find the data and write it out to the output file. For chunks of type "zeroes" we prefer to seek, but fall back to writing zeroes to handle pipes. For chunks of type "file" and "memoty" we simply write. The net effect of this is that for reasonably large images the execution time drops from 1-2 minutes to 10-20 seconds. A typical speedup is about 5 to 8 times, depending on partition sizes, output format whether in input files are sparse or not. Bump version to 20141001. Modified: head/usr.bin/mkimg/Makefile head/usr.bin/mkimg/image.c Directory Properties: head/usr.bin/mkimg/ (props changed) Modified: head/usr.bin/mkimg/Makefile ============================================================================== --- head/usr.bin/mkimg/Makefile Wed Oct 1 20:52:08 2014 (r272383) +++ head/usr.bin/mkimg/Makefile Wed Oct 1 21:03:17 2014 (r272384) @@ -6,7 +6,7 @@ PROG= mkimg SRCS= format.c image.c mkimg.c scheme.c MAN= mkimg.1 -MKIMG_VERSION=20140927 +MKIMG_VERSION=20141001 CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION} CFLAGS+=-DSPARSE_WRITE Modified: head/usr.bin/mkimg/image.c ============================================================================== --- head/usr.bin/mkimg/image.c Wed Oct 1 20:52:08 2014 (r272383) +++ head/usr.bin/mkimg/image.c Wed Oct 1 21:03:17 2014 (r272384) @@ -27,71 +27,462 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include #include #include #include #include #include +#include #include #include +#include #include #include "image.h" #include "mkimg.h" -#define BUFFER_SIZE (1024*1024) +struct chunk { + STAILQ_ENTRY(chunk) ch_list; + size_t ch_size; /* Size of chunk in bytes. */ + lba_t ch_block; /* Block address in image. */ + union { + struct { + off_t ofs; /* Offset in backing file. */ + int fd; /* FD of backing file. */ + } file; + struct { + void *ptr; /* Pointer to data in memory */ + } mem; + } ch_u; + u_int ch_type; +#define CH_TYPE_ZEROES 0 /* Chunk is a gap (no data). */ +#define CH_TYPE_FILE 1 /* File-backed chunk. */ +#define CH_TYPE_MEMORY 2 /* Memory-backed chunk */ +}; + +static STAILQ_HEAD(chunk_head, chunk) image_chunks; +static u_int image_nchunks; + +static char image_swap_file[PATH_MAX]; +static int image_swap_fd = -1; +static u_int image_swap_pgsz; +static off_t image_swap_size; -static char image_tmpfile[PATH_MAX]; -static int image_fd = -1; static lba_t image_size; -static void -cleanup(void) +static int +is_empty_sector(void *buf) { + uint64_t *p = buf; + size_t n, max; + + assert(((uintptr_t)p & 3) == 0); - if (image_fd != -1) - close(image_fd); - unlink(image_tmpfile); + max = secsz / sizeof(uint64_t); + for (n = 0; n < max; n++) { + if (p[n] != 0UL) + return (0); + } + return (1); } -int -image_copyin(lba_t blk, int fd, uint64_t *sizep) +/* + * Swap file handlng. + */ + +static off_t +image_swap_alloc(size_t size) +{ + off_t ofs; + size_t unit; + + unit = (secsz > image_swap_pgsz) ? secsz : image_swap_pgsz; + assert((unit & (unit - 1)) == 0); + + size = (size + unit - 1) & ~(unit - 1); + + ofs = image_swap_size; + image_swap_size += size; + if (ftruncate(image_swap_fd, image_swap_size) == -1) { + image_swap_size = ofs; + ofs = -1LL; + } + return (ofs); +} + +/* + * Image chunk handling. + */ + +static struct chunk * +image_chunk_find(lba_t blk) +{ + static struct chunk *last = NULL; + struct chunk *ch; + + ch = (last != NULL && last->ch_block <= blk) + ? last : STAILQ_FIRST(&image_chunks); + while (ch != NULL) { + if (ch->ch_block <= blk && + (lba_t)(ch->ch_block + (ch->ch_size / secsz)) > blk) { + last = ch; + break; + } + ch = STAILQ_NEXT(ch, ch_list); + } + return (ch); +} + +static size_t +image_chunk_grow(struct chunk *ch, size_t sz) +{ + size_t dsz, newsz; + + newsz = ch->ch_size + sz; + if (newsz > ch->ch_size) { + ch->ch_size = newsz; + return (0); + } + /* We would overflow -- create new chunk for remainder. */ + dsz = SIZE_MAX - ch->ch_size; + assert(dsz < sz); + ch->ch_size = SIZE_MAX; + return (sz - dsz); +} + +static struct chunk * +image_chunk_memory(struct chunk *ch, lba_t blk) +{ + struct chunk *new; + void *ptr; + + ptr = calloc(1, secsz); + if (ptr == NULL) + return (NULL); + + if (ch->ch_block < blk) { + new = malloc(sizeof(*new)); + if (new == NULL) { + free(ptr); + return (NULL); + } + memcpy(new, ch, sizeof(*new)); + ch->ch_size = (blk - ch->ch_block) * secsz; + new->ch_block = blk; + new->ch_size -= ch->ch_size; + STAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); + image_nchunks++; + ch = new; + } + + if (ch->ch_size > secsz) { + new = malloc(sizeof(*new)); + if (new == NULL) { + free(ptr); + return (NULL); + } + memcpy(new, ch, sizeof(*new)); + ch->ch_size = secsz; + new->ch_block++; + new->ch_size -= secsz; + STAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); + image_nchunks++; + } + + ch->ch_type = CH_TYPE_MEMORY; + ch->ch_u.mem.ptr = ptr; + return (ch); +} + +static int +image_chunk_skipto(lba_t to) +{ + struct chunk *ch; + lba_t from; + size_t sz; + + ch = STAILQ_LAST(&image_chunks, chunk, ch_list); + from = (ch != NULL) ? ch->ch_block + (ch->ch_size / secsz) : 0LL; + + assert(from <= to); + + /* Nothing to do? */ + if (from == to) + return (0); + /* Avoid bugs due to overflows. */ + if ((uintmax_t)(to - from) > (uintmax_t)(SIZE_MAX / secsz)) + return (EFBIG); + sz = (to - from) * secsz; + if (ch != NULL && ch->ch_type == CH_TYPE_ZEROES) { + sz = image_chunk_grow(ch, sz); + if (sz == 0) + return (0); + from = ch->ch_block + (ch->ch_size / secsz); + } + ch = malloc(sizeof(*ch)); + if (ch == NULL) + return (ENOMEM); + memset(ch, 0, sizeof(*ch)); + ch->ch_block = from; + ch->ch_size = sz; + ch->ch_type = CH_TYPE_ZEROES; + STAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); + image_nchunks++; + return (0); +} + +static int +image_chunk_append(lba_t blk, size_t sz, off_t ofs, int fd) +{ + struct chunk *ch; + + ch = STAILQ_LAST(&image_chunks, chunk, ch_list); + if (ch != NULL && ch->ch_type == CH_TYPE_FILE) { + if (fd == ch->ch_u.file.fd && + blk == (lba_t)(ch->ch_block + (ch->ch_size / secsz)) && + ofs == (off_t)(ch->ch_u.file.ofs + ch->ch_size)) { + sz = image_chunk_grow(ch, sz); + if (sz == 0) + return (0); + blk = ch->ch_block + (ch->ch_size / secsz); + ofs = ch->ch_u.file.ofs + ch->ch_size; + } + } + ch = malloc(sizeof(*ch)); + if (ch == NULL) + return (ENOMEM); + memset(ch, 0, sizeof(*ch)); + ch->ch_block = blk; + ch->ch_size = sz; + ch->ch_type = CH_TYPE_FILE; + ch->ch_u.file.ofs = ofs; + ch->ch_u.file.fd = fd; + STAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); + image_nchunks++; + return (0); +} + +static int +image_chunk_copyin(lba_t blk, void *buf, size_t sz, off_t ofs, int fd) +{ + uint8_t *p = buf; + int error; + + error = 0; + sz = (sz + secsz - 1) & ~(secsz - 1); + while (!error && sz > 0) { + if (is_empty_sector(p)) + error = image_chunk_skipto(blk + 1); + else + error = image_chunk_append(blk, secsz, ofs, fd); + blk++; + p += secsz; + sz -= secsz; + ofs += secsz; + } + return (error); +} + +/* + * File mapping support. + */ + +static void * +image_file_map(int fd, off_t ofs, size_t sz) +{ + void *ptr; + size_t unit; + int flags, prot; + + unit = (secsz > image_swap_pgsz) ? secsz : image_swap_pgsz; + assert((unit & (unit - 1)) == 0); + + flags = MAP_NOCORE | MAP_NOSYNC | MAP_SHARED; + /* Allow writing to our swap file only. */ + prot = PROT_READ | ((fd == image_swap_fd) ? PROT_WRITE : 0); + sz = (sz + unit - 1) & ~(unit - 1); + ptr = mmap(NULL, sz, prot, flags, fd, ofs); + return ((ptr == MAP_FAILED) ? NULL : ptr); +} + +static int +image_file_unmap(void *buffer, size_t sz) +{ + size_t unit; + + unit = (secsz > image_swap_pgsz) ? secsz : image_swap_pgsz; + sz = (sz + unit - 1) & ~(unit - 1); + munmap(buffer, sz); + return (0); +} + +/* + * Input/source file handling. + */ + +static int +image_copyin_stream(lba_t blk, int fd, uint64_t *sizep) { char *buffer; uint64_t bytesize; - ssize_t bcnt, rdsz; - int error, partial; + off_t swofs; + size_t iosz; + ssize_t rdsz; + int error; - assert(BUFFER_SIZE % secsz == 0); + /* + * This makes sure we're doing I/O in multiples of the page + * size as well as of the sector size. 2MB is the minimum + * by virtue of secsz at least 512 bytes and the page size + * at least 4K bytes. + */ + iosz = secsz * image_swap_pgsz; - buffer = malloc(BUFFER_SIZE); - if (buffer == NULL) - return (ENOMEM); bytesize = 0; - partial = 0; - while (1) { - rdsz = read(fd, buffer, BUFFER_SIZE); - if (rdsz <= 0) { - error = (rdsz < 0) ? errno : 0; - break; - } - if (partial) - abort(); - bytesize += rdsz; - bcnt = (rdsz + secsz - 1) / secsz; - error = image_write(blk, buffer, bcnt); + do { + swofs = image_swap_alloc(iosz); + if (swofs == -1LL) + return (errno); + buffer = image_file_map(image_swap_fd, swofs, iosz); + if (buffer == NULL) + return (errno); + rdsz = read(fd, buffer, iosz); + if (rdsz > 0) + error = image_chunk_copyin(blk, buffer, rdsz, swofs, + image_swap_fd); + else if (rdsz < 0) + error = errno; + else + error = 0; + image_file_unmap(buffer, iosz); + /* XXX should we relinguish unused swap space? */ if (error) + return (error); + + bytesize += rdsz; + blk += (rdsz + secsz - 1) / secsz; + } while (rdsz > 0); + + if (sizep != NULL) + *sizep = bytesize; + return (0); +} + +static int +image_copyin_mapped(lba_t blk, int fd, uint64_t *sizep) +{ + off_t cur, data, end, hole, pos; + void *buf; + uint64_t bytesize; + size_t iosz, sz; + int error; + + /* + * We'd like to know the size of the file and we must + * be able to seek in order to mmap(2). If this isn't + * possible, then treat the file as a stream/pipe. + */ + end = lseek(fd, 0L, SEEK_END); + if (end == -1L) + return (image_copyin_stream(blk, fd, sizep)); + + /* + * We need the file opened for the duration and our + * caller is going to close the file. Make a dup(2) + * so that control the faith of the descriptor. + */ + fd = dup(fd); + if (fd == -1) + return (errno); + + iosz = secsz * image_swap_pgsz; + + bytesize = 0; + cur = pos = 0; + error = 0; + while (!error && cur < end) { + hole = lseek(fd, cur, SEEK_HOLE); + data = lseek(fd, cur, SEEK_DATA); + + /* + * Treat the entire file as data if sparse files + * are not supported by the underlying file system. + */ + if (hole == -1 && data == -1) { + data = cur; + hole = end; + } + + if (cur == hole && data > hole) { + hole = pos; + pos = data & ~((uint64_t)secsz - 1); + + blk += (pos - hole) / secsz; + error = image_chunk_skipto(blk); + + bytesize += pos - hole; + cur = data; + } else if (cur == data && hole > data) { + data = pos; + pos = (hole + secsz - 1) & ~((uint64_t)secsz - 1); + + while (data < pos) { + sz = (pos - data > (off_t)iosz) + ? iosz : (size_t)(pos - data); + + buf = image_file_map(fd, data, sz); + if (buf != NULL) { + error = image_chunk_copyin(blk, buf, + sz, data, fd); + image_file_unmap(buf, sz); + } else + error = errno; + + blk += sz / secsz; + bytesize += sz; + data += sz; + } + cur = hole; + } else { + /* + * I don't know what this means or whether it + * can happen at all... + */ + error = EDOOFUS; break; - blk += bcnt; - partial = ((ssize_t)(bcnt * secsz) != rdsz) ? 1 : 0; + } } - free(buffer); - if (sizep != NULL) + if (error) + close(fd); + if (!error && sizep != NULL) *sizep = bytesize; return (error); } int +image_copyin(lba_t blk, int fd, uint64_t *sizep) +{ + struct stat sb; + int error; + + error = image_chunk_skipto(blk); + if (!error) { + if (fstat(fd, &sb) == -1 || !S_ISREG(sb.st_mode)) + error = image_copyin_stream(blk, fd, sizep); + else + error = image_copyin_mapped(blk, fd, sizep); + } + return (error); +} + +/* + * Output/sink file handling. + */ + +int image_copyout(int fd) { int error; @@ -115,71 +506,124 @@ image_copyout_done(int fd) return (error); } -int -image_copyout_region(int fd, lba_t blk, lba_t size) +static int +image_copyout_memory(int fd, size_t size, void *ptr) { - char *buffer; - off_t ofs; + + if (write(fd, ptr, size) == -1) + return (errno); + return (0); +} + +static int +image_copyout_zeroes(int fd, size_t size) +{ + static uint8_t *zeroes = NULL; size_t sz; - ssize_t rdsz, wrsz; int error; - ofs = lseek(fd, 0L, SEEK_CUR); + if (lseek(fd, (off_t)size, SEEK_CUR) != -1) + return (0); + + /* + * If we can't seek, we must write. + */ + + if (zeroes == NULL) { + zeroes = calloc(1, secsz); + if (zeroes == NULL) + return (ENOMEM); + } + + while (size > 0) { + sz = (size > secsz) ? secsz : size; + error = image_copyout_memory(fd, sz, zeroes); + if (error) + return (error); + size -= sz; + } + return (0); +} + +static int +image_copyout_file(int fd, size_t size, int ifd, off_t iofs) +{ + void *buf; + size_t iosz, sz; + int error; + + iosz = secsz * image_swap_pgsz; + + while (size > 0) { + sz = (size > iosz) ? iosz : size; + buf = image_file_map(ifd, iofs, sz); + if (buf == NULL) + return (errno); + error = image_copyout_memory(fd, sz, buf); + image_file_unmap(buf, sz); + if (error) + return (error); + size -= sz; + iofs += sz; + } + return (0); +} + +int +image_copyout_region(int fd, lba_t blk, lba_t size) +{ + struct chunk *ch; + size_t ofs, sz; + int error; - blk *= secsz; - if (lseek(image_fd, blk, SEEK_SET) != blk) - return (errno); - buffer = malloc(BUFFER_SIZE); - if (buffer == NULL) - return (errno); - error = 0; size *= secsz; + while (size > 0) { - sz = (BUFFER_SIZE < size) ? BUFFER_SIZE : size; - rdsz = read(image_fd, buffer, sz); - if (rdsz <= 0) { - error = (rdsz < 0) ? errno : 0; + ch = image_chunk_find(blk); + if (ch == NULL) + return (EINVAL); + ofs = (blk - ch->ch_block) * secsz; + sz = ch->ch_size - ofs; + sz = ((lba_t)sz < size) ? sz : (size_t)size; + switch (ch->ch_type) { + case CH_TYPE_ZEROES: + error = image_copyout_zeroes(fd, sz); break; - } - wrsz = (ofs == -1) ? - write(fd, buffer, rdsz) : - sparse_write(fd, buffer, rdsz); - if (wrsz < 0) { - error = errno; + case CH_TYPE_FILE: + error = image_copyout_file(fd, sz, ch->ch_u.file.fd, + ch->ch_u.file.ofs + ofs); + break; + case CH_TYPE_MEMORY: + error = image_copyout_memory(fd, sz, ch->ch_u.mem.ptr); break; + default: + return (EDOOFUS); } - assert(wrsz == rdsz); - size -= rdsz; + size -= sz; + blk += sz / secsz; } - free(buffer); - return (error); + return (0); } int image_data(lba_t blk, lba_t size) { - char *buffer, *p; - - blk *= secsz; - if (lseek(image_fd, blk, SEEK_SET) != blk) - return (1); + struct chunk *ch; + lba_t lim; - size *= secsz; - buffer = malloc(size); - if (buffer == NULL) - return (1); - - if (read(image_fd, buffer, size) != (ssize_t)size) { - free(buffer); - return (1); + while (1) { + ch = image_chunk_find(blk); + if (ch == NULL) + return (0); + if (ch->ch_type != CH_TYPE_ZEROES) + return (1); + lim = ch->ch_block + (ch->ch_size / secsz); + if (lim >= blk + size) + return (0); + size -= lim - blk; + blk = lim; } - - p = buffer; - while (size > 0 && *p == '\0') - size--, p++; - - free(buffer); - return ((size == 0) ? 0 : 1); + /*NOTREACHED*/ } lba_t @@ -192,39 +636,87 @@ image_get_size(void) int image_set_size(lba_t blk) { + int error; - image_size = blk; - if (ftruncate(image_fd, blk * secsz) == -1) - return (errno); - return (0); + error = image_chunk_skipto(blk); + if (!error) + image_size = blk; + return (error); } int image_write(lba_t blk, void *buf, ssize_t len) { + struct chunk *ch; - blk *= secsz; - if (lseek(image_fd, blk, SEEK_SET) != blk) - return (errno); - len *= secsz; - if (sparse_write(image_fd, buf, len) != len) - return (errno); + while (len > 0) { + if (!is_empty_sector(buf)) { + ch = image_chunk_find(blk); + if (ch == NULL) + return (ENXIO); + /* We may not be able to write to files. */ + if (ch->ch_type == CH_TYPE_FILE) + return (EINVAL); + if (ch->ch_type == CH_TYPE_ZEROES) { + ch = image_chunk_memory(ch, blk); + if (ch == NULL) + return (ENOMEM); + } + assert(ch->ch_type == CH_TYPE_MEMORY); + memcpy(ch->ch_u.mem.ptr, buf, secsz); + } + blk++; + buf = (char *)buf + secsz; + len--; + } return (0); } +static void +image_cleanup(void) +{ + struct chunk *ch; + + while ((ch = STAILQ_FIRST(&image_chunks)) != NULL) { + switch (ch->ch_type) { + case CH_TYPE_FILE: + /* We may be closing the same file multiple times. */ + if (ch->ch_u.file.fd != -1) + close(ch->ch_u.file.fd); + break; + case CH_TYPE_MEMORY: + free(ch->ch_u.mem.ptr); + break; + default: + break; + } + STAILQ_REMOVE_HEAD(&image_chunks, ch_list); + free(ch); + } + if (image_swap_fd != -1) + close(image_swap_fd); + unlink(image_swap_file); +} + int image_init(void) { const char *tmpdir; - if (atexit(cleanup) == -1) + STAILQ_INIT(&image_chunks); + image_nchunks = 0; + + image_swap_size = 0; + image_swap_pgsz = getpagesize(); + + if (atexit(image_cleanup) == -1) return (errno); if ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0') tmpdir = _PATH_TMP; - snprintf(image_tmpfile, sizeof(image_tmpfile), "%s/mkimg-XXXXXX", + snprintf(image_swap_file, sizeof(image_swap_file), "%s/mkimg-XXXXXX", tmpdir); - image_fd = mkstemp(image_tmpfile); - if (image_fd == -1) + image_swap_fd = mkstemp(image_swap_file); + if (image_swap_fd == -1) return (errno); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 21:21:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB1C4718; Wed, 1 Oct 2014 21:21:56 +0000 (UTC) Received: from mail-ie0-x236.google.com (mail-ie0-x236.google.com [IPv6:2607:f8b0:4001:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 758D5C15; Wed, 1 Oct 2014 21:21:56 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id rp18so1262812iec.41 for ; Wed, 01 Oct 2014 14:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=r2K+/f0uOXmEDUbYDfZzdlWyWhYu1uu8in5uPB0KN14=; b=jrAWph9OAEikgMZf5LQYdksC95ihyZAsuEa/pxvVDXwyWRJ7Z6NIH1msQu18gzeMmU uWz2qjsc7wyVGaY2BPZaV9UAnb1ZFwnLcCwkxoFMJt9qS6nu1hOpvHr/zO6Aa9zcaW7y PNb3tnpo1++eGuUEc+yvicVXrPerAnkRBQcISViUVEDiGGvYGdOj1YS/YQAsqlJvaz8h +5dxchRQ9/58iAqncDNlUnAZvPENXwJeNJdPey9eBJQQq6YcQ1DB4qd0GlXOjp4n6MGT 4NkzIIL8oaGqr+PR8Qpb12uH7q5m3VFiwsABVQtaHV31VMe0JIs5FY0zaIJPgmqlEGVX og6g== MIME-Version: 1.0 X-Received: by 10.42.212.7 with SMTP id gq7mr4626064icb.28.1412198515747; Wed, 01 Oct 2014 14:21:55 -0700 (PDT) Received: by 10.50.227.42 with HTTP; Wed, 1 Oct 2014 14:21:55 -0700 (PDT) In-Reply-To: References: <201409291505.s8TF5Nhh066884@svn.freebsd.org> Date: Wed, 1 Oct 2014 14:21:55 -0700 Message-ID: Subject: Re: svn commit: r272282 - head/share/mk From: NGie Cooper To: Will Andrews 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: Wed, 01 Oct 2014 21:21:56 -0000 On Wed, Oct 1, 2014 at 1:16 PM, Will Andrews wrote: > On Wed, Oct 1, 2014 at 2:03 PM, NGie Cooper wrote: >> This change seems like it introduces a lot of unnecessary complexity >> in lieu of someone setting PORTSDIR to the root of their ports tree in >> the environment. > > Sure, but people that are trying to use it somewhere other than > /usr/ports shouldn't be surprised by misbehavior. I've worked with > several people (who aren't steeped in the usage of ports) who were > astonished by this behavior. Sounds like a documentation issue though (it's not listed in the handbook :(..: https://www.freebsd.org/doc/handbook/ports-using.html ) >> Why isn't it using a for-loop by the way? > > My original implementation used a shell for loop (see the CR), but > given the lack of a legitimate use case for looking farther up than > three parent directories, it seemed easier not to. I suppose one > could use a static list of paths in the for loop though. Yep -- that's what I meant :). Thanks! From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 21:24:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6B9E909; Wed, 1 Oct 2014 21:24: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 A3C37C3D; Wed, 1 Oct 2014 21:24: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 s91LOxGu020609; Wed, 1 Oct 2014 21:24:59 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91LOxFU020608; Wed, 1 Oct 2014 21:24:59 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201410012124.s91LOxFU020608@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 1 Oct 2014 21:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272385 - 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, 01 Oct 2014 21:24:59 -0000 Author: melifaro Date: Wed Oct 1 21:24:58 2014 New Revision: 272385 URL: https://svnweb.freebsd.org/changeset/base/272385 Log: Free radix mask entries on main radix destroy. This is temporary commit to be merged to 10. Other approach (like hash table) should be used to store different masks. PR: 194078 Submitted by: Rumen Telbizov MFC after: 3 days Modified: head/sys/net/radix.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Wed Oct 1 21:03:17 2014 (r272384) +++ head/sys/net/radix.c Wed Oct 1 21:24:58 2014 (r272385) @@ -1178,6 +1178,18 @@ rn_inithead(void **head, int off) return (1); } +static int +rn_freeentry(struct radix_node *rn, void *arg) +{ + struct radix_node_head * const rnh = arg; + struct radix_node *x; + + x = (struct radix_node *)rn_delete(rn + 2, NULL, rnh); + if (x != NULL) + Free(x); + return (0); +} + int rn_detachhead(void **head) { @@ -1188,6 +1200,7 @@ rn_detachhead(void **head) rnh = *head; + rn_walktree(rnh->rnh_masks, rn_freeentry, rnh->rnh_masks); rn_detachhead_internal((void **)&rnh->rnh_masks); rn_detachhead_internal(head); return (1); From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 21:37:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B0A9E5; Wed, 1 Oct 2014 21:37: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 06A5FDE2; Wed, 1 Oct 2014 21:37: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 s91LbYi6025973; Wed, 1 Oct 2014 21:37:34 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91LbXL4025967; Wed, 1 Oct 2014 21:37:33 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201410012137.s91LbXL4025967@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 1 Oct 2014 21:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272386 - in head: sbin/ifconfig share/man/man4 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, 01 Oct 2014 21:37:35 -0000 Author: hrs Date: Wed Oct 1 21:37:32 2014 New Revision: 272386 URL: https://svnweb.freebsd.org/changeset/base/272386 Log: Virtualize lagg(4) cloner. This change fixes a panic when tearing down if_lagg(4) interfaces which were cloned in a vnet jail. Sysctl nodes which are dynamically generated for each cloned interface (net.link.lagg.N.*) have been removed, and use_flowid and flowid_shift ifconfig(8) parameters have been added instead. Flags and per-interface statistics counters are displayed in "ifconfig -v". CR: D842 Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/iflagg.c head/share/man/man4/lagg.4 head/sys/net/ieee8023ad_lacp.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Oct 1 21:24:58 2014 (r272385) +++ head/sbin/ifconfig/ifconfig.8 Wed Oct 1 21:37:32 2014 (r272386) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd September 9, 2014 +.Dd October 1, 2014 .Dt IFCONFIG 8 .Os .Sh NAME @@ -679,7 +679,7 @@ Set a flag to enable Neighbor Unreachabi Clear a flag .Cm nud . .It Cm no_prefer_iface -Set a flag to not honor rule 5 of source address selection in RFC 3484. +Set a flag to not honor rule 5 of source address selection in RFC 3484. In practice this means the address on the outgoing interface will not be preferred, effectively yielding the decision to the address selection policy table, configurable with @@ -2331,9 +2331,16 @@ Remove the interface named by from the aggregation interface. .It Cm laggproto Ar proto Set the aggregation protocol. -The default is failover. -The available options are failover, lacp, loadbalance, roundrobin, broadcast -and none. +The default is +.Li failover . +The available options are +.Li failover , +.Li lacp , +.Li loadbalance , +.Li roundrobin , +.Li broadcast +and +.Li none . .It Cm lagghash Ar option Ns Oo , Ns Ar option Oc Set the packet layers to hash for aggregation protocols which load balance. The default is @@ -2348,6 +2355,34 @@ src/dst address for IPv4 or IPv6. .It Cm l4 src/dst port for TCP/UDP/SCTP. .El +.It Cm use_flowid +Enable local hash computation for RSS hash on the interface. +The +.Li loadbalance +and +.Li lacp +modes will use the RSS hash from the network card if available +to avoid computing one, this may give poor traffic distribution +if the hash is invalid or uses less of the protocol header information. +.Cm use_flowid +disables use of RSS hash from the network card. +The default value can be set via the +.Va net.link.lagg.default_use_flowid +.Xr sysctl 8 +variable. +.Li 0 +means +.Dq disabled +and +.Li 1 +means +.Dq enabled . +.It Cm -use_flowid +Disable local hash computation for RSS hash on the interface. +.It Cm flowid_shift Ar number +Set a shift parameter for RSS local hash computation. +Hash is calculated by using flowid bits in a packet header mbuf +which are shifted by the number of this parameter. .El .Pp The following parameters are specific to IP tunnel interfaces, Modified: head/sbin/ifconfig/iflagg.c ============================================================================== --- head/sbin/ifconfig/iflagg.c Wed Oct 1 21:24:58 2014 (r272385) +++ head/sbin/ifconfig/iflagg.c Wed Oct 1 21:37:32 2014 (r272386) @@ -68,7 +68,7 @@ setlaggproto(const char *val, int d, int bzero(&ra, sizeof(ra)); ra.ra_proto = LAGG_PROTO_MAX; - for (i = 0; i < (sizeof(lpr) / sizeof(lpr[0])); i++) { + for (i = 0; i < nitems(lpr); i++) { if (strcmp(val, lpr[i].lpr_name) == 0) { ra.ra_proto = lpr[i].lpr_proto; break; @@ -83,6 +83,48 @@ setlaggproto(const char *val, int d, int } static void +setlaggflowidshift(const char *val, int d, int s, const struct afswtch *afp) +{ + struct lagg_reqall ra; + + bzero(&ra, sizeof(ra)); + ra.ra_opts = LAGG_OPT_FLOWIDSHIFT; + strlcpy(ra.ra_ifname, name, sizeof(ra.ra_ifname)); + ra.ra_flowid_shift = (int)strtol(val, NULL, 10); + if (ra.ra_flowid_shift & ~LAGG_OPT_FLOWIDSHIFT_MASK) + errx(1, "Invalid flowid_shift option: %s", val); + + if (ioctl(s, SIOCSLAGG, &ra) != 0) + err(1, "SIOCSLAGG"); +} + +static void +setlaggsetopt(const char *val, int d, int s, const struct afswtch *afp) +{ + struct lagg_reqall ra; + + bzero(&ra, sizeof(ra)); + ra.ra_opts = d; + switch (ra.ra_opts) { + case LAGG_OPT_USE_FLOWID: + case -LAGG_OPT_USE_FLOWID: + case LAGG_OPT_LACP_STRICT: + case -LAGG_OPT_LACP_STRICT: + case LAGG_OPT_LACP_TXTEST: + case -LAGG_OPT_LACP_TXTEST: + case LAGG_OPT_LACP_RXTEST: + case -LAGG_OPT_LACP_RXTEST: + break; + default: + err(1, "Invalid lagg option"); + } + strlcpy(ra.ra_ifname, name, sizeof(ra.ra_ifname)); + + if (ioctl(s, SIOCSLAGG, &ra) != 0) + err(1, "SIOCSLAGG"); +} + +static void setlagghash(const char *val, int d, int s, const struct afswtch *afp) { struct lagg_reqflags rf; @@ -169,7 +211,7 @@ lagg_status(int s) if (ioctl(s, SIOCGLAGG, &ra) == 0) { lp = (struct lacp_opreq *)&ra.ra_lacpreq; - for (i = 0; i < (sizeof(lpr) / sizeof(lpr[0])); i++) { + for (i = 0; i < nitems(lpr); i++) { if (ra.ra_proto == lpr[i].lpr_proto) { proto = lpr[i].lpr_name; break; @@ -197,9 +239,28 @@ lagg_status(int s) if (isport) printf(" laggdev %s", rp.rp_ifname); putchar('\n'); - if (verbose && ra.ra_proto == LAGG_PROTO_LACP) - printf("\tlag id: %s\n", - lacp_format_peer(lp, "\n\t\t ")); + if (verbose) { + printf("\tlagg options:\n"); + printf("\t\tuse_flowid: %d\n", + (ra.ra_opts & LAGG_OPT_USE_FLOWID) ? 1 : 0); + printf("\t\tflowid_shift: %d\n", ra.ra_flowid_shift); + switch (ra.ra_proto) { + case LAGG_PROTO_LACP: + printf("\t\tlacp_strict: %d\n", + (ra.ra_opts & LAGG_OPT_LACP_STRICT) ? 1 : 0); + printf("\t\tlacp_rxtest: %d\n", + (ra.ra_opts & LAGG_OPT_LACP_RXTEST) ? 1 : 0); + printf("\t\tlacp_txtest: %d\n", + (ra.ra_opts & LAGG_OPT_LACP_TXTEST) ? 1 : 0); + } + printf("\tlagg statistics:\n"); + printf("\t\tactive ports: %d\n", ra.ra_active); + printf("\t\tflapping: %u\n", ra.ra_flapping); + if (ra.ra_proto == LAGG_PROTO_LACP) { + printf("\tlag id: %s\n", + lacp_format_peer(lp, "\n\t\t ")); + } + } for (i = 0; i < ra.ra_ports; i++) { lp = (struct lacp_opreq *)&rpbuf[i].rp_lacpreq; @@ -226,6 +287,15 @@ static struct cmd lagg_cmds[] = { DEF_CMD_ARG("-laggport", unsetlaggport), DEF_CMD_ARG("laggproto", setlaggproto), DEF_CMD_ARG("lagghash", setlagghash), + DEF_CMD("use_flowid", LAGG_OPT_USE_FLOWID, setlaggsetopt), + DEF_CMD("-use_flowid", -LAGG_OPT_USE_FLOWID, setlaggsetopt), + DEF_CMD("lacp_strict", LAGG_OPT_LACP_STRICT, setlaggsetopt), + DEF_CMD("-lacp_strict", -LAGG_OPT_LACP_STRICT, setlaggsetopt), + DEF_CMD("lacp_txtest", LAGG_OPT_LACP_TXTEST, setlaggsetopt), + DEF_CMD("-lacp_txtest", -LAGG_OPT_LACP_TXTEST, setlaggsetopt), + DEF_CMD("lacp_rxtest", LAGG_OPT_LACP_RXTEST, setlaggsetopt), + DEF_CMD("-lacp_rxtest", -LAGG_OPT_LACP_RXTEST, setlaggsetopt), + DEF_CMD_ARG("flowid_shift", setlaggflowidshift), }; static struct afswtch af_lagg = { .af_name = "af_lagg", Modified: head/share/man/man4/lagg.4 ============================================================================== --- head/share/man/man4/lagg.4 Wed Oct 1 21:24:58 2014 (r272385) +++ head/share/man/man4/lagg.4 Wed Oct 1 21:37:32 2014 (r272386) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 2012 +.Dd October 1, 2014 .Dt LAGG 4 .Os .Sh NAME @@ -143,9 +143,9 @@ modes will use the RSS hash from the net computing one, this may give poor traffic distribution if the hash is invalid or uses less of the protocol header information. Local hash computation can be forced per interface by setting the -.Va net.link.lagg.X.use_flowid -.Xr sysctl 8 -variable to zero where X is the interface number. +.Cm use_flowid +.Xr ifconfig 8 +flag. The default for new interfaces is set via the .Va net.link.lagg.default_use_flowid .Xr sysctl 8 . Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Wed Oct 1 21:24:58 2014 (r272385) +++ head/sys/net/ieee8023ad_lacp.c Wed Oct 1 21:37:32 2014 (r272386) @@ -190,14 +190,15 @@ static const char *lacp_format_portid(co static void lacp_dprintf(const struct lacp_port *, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); -static int lacp_debug = 0; +static VNET_DEFINE(int, lacp_debug); +#define V_lacp_debug VNET(lacp_debug) SYSCTL_NODE(_net_link_lagg, OID_AUTO, lacp, CTLFLAG_RD, 0, "ieee802.3ad"); -SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RWTUN, - &lacp_debug, 0, "Enable LACP debug logging (1=debug, 2=trace)"); +SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RWTUN | CTLFLAG_VNET, + &VNET_NAME(lacp_debug), 0, "Enable LACP debug logging (1=debug, 2=trace)"); -#define LACP_DPRINTF(a) if (lacp_debug & 0x01) { lacp_dprintf a ; } -#define LACP_TRACE(a) if (lacp_debug & 0x02) { lacp_dprintf(a,"%s\n",__func__); } -#define LACP_TPRINTF(a) if (lacp_debug & 0x04) { lacp_dprintf a ; } +#define LACP_DPRINTF(a) if (V_lacp_debug & 0x01) { lacp_dprintf a ; } +#define LACP_TRACE(a) if (V_lacp_debug & 0x02) { lacp_dprintf(a,"%s\n",__func__); } +#define LACP_TPRINTF(a) if (V_lacp_debug & 0x04) { lacp_dprintf a ; } /* * partner administration variables. @@ -300,7 +301,7 @@ lacp_pdu_input(struct lacp_port *lp, str goto bad; } - if (lacp_debug > 0) { + if (V_lacp_debug > 0) { lacp_dprintf(lp, "lacpdu receive\n"); lacp_dump_lacpdu(du); } @@ -385,7 +386,7 @@ lacp_xmit_lacpdu(struct lacp_port *lp) sizeof(du->ldu_collector)); du->ldu_collector.lci_maxdelay = 0; - if (lacp_debug > 0) { + if (V_lacp_debug > 0) { lacp_dprintf(lp, "lacpdu transmit\n"); lacp_dump_lacpdu(du); } @@ -497,12 +498,14 @@ lacp_tick(void *arg) if ((lp->lp_state & LACP_STATE_AGGREGATION) == 0) continue; + CURVNET_SET(lp->lp_ifp->if_vnet); lacp_run_timers(lp); lacp_select(lp); lacp_sm_mux(lp); lacp_sm_tx(lp); lacp_sm_ptx_tx_schedule(lp); + CURVNET_RESTORE(); } callout_reset(&lsc->lsc_callout, hz, lacp_tick, lsc); } @@ -747,48 +750,10 @@ lacp_transit_expire(void *vp) lsc->lsc_suppress_distributing = FALSE; } -static void -lacp_attach_sysctl(struct lacp_softc *lsc, struct sysctl_oid *p_oid) -{ - struct lagg_softc *sc = lsc->lsc_softc; - - SYSCTL_ADD_UINT(&sc->ctx, SYSCTL_CHILDREN(p_oid), OID_AUTO, - "lacp_strict_mode", - CTLFLAG_RW, - &lsc->lsc_strict_mode, - lsc->lsc_strict_mode, - "Enable LACP strict mode"); -} - -static void -lacp_attach_sysctl_debug(struct lacp_softc *lsc, struct sysctl_oid *p_oid) -{ - struct lagg_softc *sc = lsc->lsc_softc; - struct sysctl_oid *oid; - - /* Create a child of the parent lagg interface */ - oid = SYSCTL_ADD_NODE(&sc->ctx, SYSCTL_CHILDREN(p_oid), - OID_AUTO, "debug", CTLFLAG_RD, NULL, "DEBUG"); - - SYSCTL_ADD_UINT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_test", - CTLFLAG_RW, - &lsc->lsc_debug.lsc_rx_test, - lsc->lsc_debug.lsc_rx_test, - "Bitmap of if_dunit entries to drop RX frames for"); - SYSCTL_ADD_UINT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_test", - CTLFLAG_RW, - &lsc->lsc_debug.lsc_tx_test, - lsc->lsc_debug.lsc_tx_test, - "Bitmap of if_dunit entries to drop TX frames for"); -} - void lacp_attach(struct lagg_softc *sc) { struct lacp_softc *lsc; - struct sysctl_oid *oid; lsc = malloc(sizeof(struct lacp_softc), M_DEVBUF, M_WAITOK | M_ZERO); @@ -802,14 +767,6 @@ lacp_attach(struct lagg_softc *sc) TAILQ_INIT(&lsc->lsc_aggregators); LIST_INIT(&lsc->lsc_ports); - /* Create a child of the parent lagg interface */ - oid = SYSCTL_ADD_NODE(&sc->ctx, SYSCTL_CHILDREN(sc->sc_oid), - OID_AUTO, "lacp", CTLFLAG_RD, NULL, "LACP"); - - /* Attach sysctl nodes */ - lacp_attach_sysctl(lsc, oid); - lacp_attach_sysctl_debug(lsc, oid); - callout_init_mtx(&lsc->lsc_transit_callout, &lsc->lsc_mtx, 0); callout_init_mtx(&lsc->lsc_callout, &lsc->lsc_mtx, 0); @@ -875,7 +832,7 @@ lacp_select_tx_port(struct lagg_softc *s return (NULL); } - if (sc->use_flowid && (m->m_flags & M_FLOWID)) + if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && (m->m_flags & M_FLOWID)) hash = m->m_pkthdr.flowid >> sc->flowid_shift; else hash = lagg_hashmbuf(sc, m, lsc->lsc_hashkey); @@ -1374,7 +1331,7 @@ lacp_sm_mux(struct lacp_port *lp) enum lacp_selected selected = lp->lp_selected; struct lacp_aggregator *la; - if (lacp_debug > 1) + if (V_lacp_debug > 1) lacp_dprintf(lp, "%s: state= 0x%x, selected= 0x%x, " "p_sync= 0x%x, p_collecting= 0x%x\n", __func__, lp->lp_mux_state, selected, p_sync, p_collecting); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Wed Oct 1 21:24:58 2014 (r272385) +++ head/sys/net/if_lagg.c Wed Oct 1 21:37:32 2014 (r272386) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #if defined(INET) || defined(INET6) #include @@ -81,13 +82,21 @@ static struct { {0, NULL} }; -SLIST_HEAD(__trhead, lagg_softc) lagg_list; /* list of laggs */ -static struct mtx lagg_list_mtx; +VNET_DEFINE(SLIST_HEAD(__trhead, lagg_softc), lagg_list); /* list of laggs */ +#define V_lagg_list VNET(lagg_list) +static VNET_DEFINE(struct mtx, lagg_list_mtx); +#define V_lagg_list_mtx VNET(lagg_list_mtx) +#define LAGG_LIST_LOCK_INIT(x) mtx_init(&V_lagg_list_mtx, \ + "if_lagg list", NULL, MTX_DEF) +#define LAGG_LIST_LOCK_DESTROY(x) mtx_destroy(&V_lagg_list_mtx) +#define LAGG_LIST_LOCK(x) mtx_lock(&V_lagg_list_mtx) +#define LAGG_LIST_UNLOCK(x) mtx_unlock(&V_lagg_list_mtx) eventhandler_tag lagg_detach_cookie = NULL; static int lagg_clone_create(struct if_clone *, int, caddr_t); static void lagg_clone_destroy(struct ifnet *); -static struct if_clone *lagg_cloner; +static VNET_DEFINE(struct if_clone *, lagg_cloner); +#define V_lagg_cloner VNET(lagg_cloner) static const char laggname[] = "lagg"; static void lagg_lladdr(struct lagg_softc *, uint8_t *); @@ -123,7 +132,6 @@ static void lagg_media_status(struct ifn static struct lagg_port *lagg_link_active(struct lagg_softc *, struct lagg_port *); static const void *lagg_gethdr(struct mbuf *, u_int, u_int, void *); -static int lagg_sysctl_active(SYSCTL_HANDLER_ARGS); /* Simple round robin */ static void lagg_rr_attach(struct lagg_softc *); @@ -232,29 +240,55 @@ SYSCTL_DECL(_net_link); SYSCTL_NODE(_net_link, OID_AUTO, lagg, CTLFLAG_RW, 0, "Link Aggregation"); -static int lagg_failover_rx_all = 0; /* Allow input on any failover links */ -SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW, - &lagg_failover_rx_all, 0, +/* Allow input on any failover links */ +static VNET_DEFINE(int, lagg_failover_rx_all); +#define V_lagg_failover_rx_all VNET(lagg_failover_rx_all) +SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(lagg_failover_rx_all), 0, "Accept input from any interface in a failover lagg"); -static int def_use_flowid = 1; /* Default value for using M_FLOWID */ + +/* Default value for using M_FLOWID */ +static VNET_DEFINE(int, def_use_flowid) = 1; +#define V_def_use_flowid VNET(def_use_flowid) SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RWTUN, - &def_use_flowid, 0, + &VNET_NAME(def_use_flowid), 0, "Default setting for using flow id for load sharing"); -static int def_flowid_shift = 16; /* Default value for using M_FLOWID */ + +/* Default value for using M_FLOWID */ +static VNET_DEFINE(int, def_flowid_shift) = 16; +#define V_def_flowid_shift VNET(def_flowid_shift) SYSCTL_INT(_net_link_lagg, OID_AUTO, default_flowid_shift, CTLFLAG_RWTUN, - &def_flowid_shift, 0, + &VNET_NAME(def_flowid_shift), 0, "Default setting for flowid shift for load sharing"); +static void +vnet_lagg_init(const void *unused __unused) +{ + + LAGG_LIST_LOCK_INIT(); + SLIST_INIT(&V_lagg_list); + V_lagg_cloner = if_clone_simple(laggname, lagg_clone_create, + lagg_clone_destroy, 0); +} +VNET_SYSINIT(vnet_lagg_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + vnet_lagg_init, NULL); + +static void +vnet_lagg_uninit(const void *unused __unused) +{ + + if_clone_detach(V_lagg_cloner); + LAGG_LIST_LOCK_DESTROY(); +} +VNET_SYSUNINIT(vnet_lagg_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + vnet_lagg_uninit, NULL); + static int lagg_modevent(module_t mod, int type, void *data) { switch (type) { case MOD_LOAD: - mtx_init(&lagg_list_mtx, "if_lagg list", NULL, MTX_DEF); - SLIST_INIT(&lagg_list); - lagg_cloner = if_clone_simple(laggname, lagg_clone_create, - lagg_clone_destroy, 0); lagg_input_p = lagg_input; lagg_linkstate_p = lagg_port_state; lagg_detach_cookie = EVENTHANDLER_REGISTER( @@ -264,10 +298,8 @@ lagg_modevent(module_t mod, int type, vo case MOD_UNLOAD: EVENTHANDLER_DEREGISTER(ifnet_departure_event, lagg_detach_cookie); - if_clone_detach(lagg_cloner); lagg_input_p = NULL; lagg_linkstate_p = NULL; - mtx_destroy(&lagg_list_mtx); break; default: return (EOPNOTSUPP); @@ -445,8 +477,6 @@ lagg_clone_create(struct if_clone *ifc, struct lagg_softc *sc; struct ifnet *ifp; static const u_char eaddr[6]; /* 00:00:00:00:00:00 */ - struct sysctl_oid *oid; - char num[14]; /* sufficient for 32 bits */ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); ifp = sc->sc_ifp = if_alloc(IFT_ETHER); @@ -455,29 +485,10 @@ lagg_clone_create(struct if_clone *ifc, return (ENOSPC); } - sysctl_ctx_init(&sc->ctx); - snprintf(num, sizeof(num), "%u", unit); - sc->use_flowid = def_use_flowid; - sc->flowid_shift = def_flowid_shift; - sc->sc_oid = oid = SYSCTL_ADD_NODE(&sc->ctx, - &SYSCTL_NODE_CHILDREN(_net_link, lagg), - OID_AUTO, num, CTLFLAG_RD, NULL, ""); - SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, - sc->use_flowid, "Use flow id for load sharing"); - SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "flowid_shift", CTLTYPE_INT|CTLFLAG_RW, &sc->flowid_shift, - sc->flowid_shift, - "Shift flowid bits to prevent multiqueue collisions"); - SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "count", CTLTYPE_INT|CTLFLAG_RD, &sc->sc_count, sc->sc_count, - "Total number of ports"); - SYSCTL_ADD_PROC(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "active", CTLTYPE_INT|CTLFLAG_RD, sc, 0, lagg_sysctl_active, - "I", "Total number of active ports"); - SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "flapping", CTLTYPE_INT|CTLFLAG_RD, &sc->sc_flapping, - sc->sc_flapping, "Total number of port change events"); + if (V_def_use_flowid) + sc->sc_opts |= LAGG_OPT_USE_FLOWID; + sc->flowid_shift = V_def_flowid_shift; + /* Hash all layers by default */ sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; @@ -515,9 +526,9 @@ lagg_clone_create(struct if_clone *ifc, lagg_unregister_vlan, sc, EVENTHANDLER_PRI_FIRST); /* Insert into the global list of laggs */ - mtx_lock(&lagg_list_mtx); - SLIST_INSERT_HEAD(&lagg_list, sc, sc_entries); - mtx_unlock(&lagg_list_mtx); + LAGG_LIST_LOCK(); + SLIST_INSERT_HEAD(&V_lagg_list, sc, sc_entries); + LAGG_LIST_UNLOCK(); return (0); } @@ -542,14 +553,13 @@ lagg_clone_destroy(struct ifnet *ifp) /* Unhook the aggregation protocol */ lagg_proto_detach(sc); - sysctl_ctx_free(&sc->ctx); ifmedia_removeall(&sc->sc_media); ether_ifdetach(ifp); if_free(ifp); - mtx_lock(&lagg_list_mtx); - SLIST_REMOVE(&lagg_list, sc, lagg_softc, sc_entries); - mtx_unlock(&lagg_list_mtx); + LAGG_LIST_LOCK(); + SLIST_REMOVE(&V_lagg_list, sc, lagg_softc, sc_entries); + LAGG_LIST_UNLOCK(); taskqueue_drain(taskqueue_swi, &sc->sc_lladdr_task); LAGG_LOCK_DESTROY(sc); @@ -752,10 +762,10 @@ lagg_port_create(struct lagg_softc *sc, return (ENOMEM); /* Check if port is a stacked lagg */ - mtx_lock(&lagg_list_mtx); - SLIST_FOREACH(sc_ptr, &lagg_list, sc_entries) { + LAGG_LIST_LOCK(); + SLIST_FOREACH(sc_ptr, &V_lagg_list, sc_entries) { if (ifp == sc_ptr->sc_ifp) { - mtx_unlock(&lagg_list_mtx); + LAGG_LIST_UNLOCK(); free(lp, M_DEVBUF); return (EINVAL); /* XXX disable stacking for the moment, its untested */ @@ -763,14 +773,14 @@ lagg_port_create(struct lagg_softc *sc, lp->lp_flags |= LAGG_PORT_STACK; if (lagg_port_checkstacking(sc_ptr) >= LAGG_MAX_STACKING) { - mtx_unlock(&lagg_list_mtx); + LAGG_LIST_UNLOCK(); free(lp, M_DEVBUF); return (E2BIG); } #endif } } - mtx_unlock(&lagg_list_mtx); + LAGG_LIST_UNLOCK(); /* Change the interface type */ lp->lp_iftype = ifp->if_type; @@ -1205,6 +1215,31 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd LAGG_RLOCK(sc, &tracker); ra->ra_proto = sc->sc_proto; lagg_proto_request(sc, &ra->ra_psc); + ra->ra_opts = sc->sc_opts; + if (sc->sc_proto == LAGG_PROTO_LACP) { + struct lacp_softc *lsc; + + lsc = (struct lacp_softc *)sc->sc_psc; + if (lsc->lsc_debug.lsc_tx_test != 0) + ra->ra_opts |= LAGG_OPT_LACP_TXTEST; + if (lsc->lsc_debug.lsc_rx_test != 0) + ra->ra_opts |= LAGG_OPT_LACP_RXTEST; + if (lsc->lsc_strict_mode != 0) + ra->ra_opts |= LAGG_OPT_LACP_STRICT; + + ra->ra_active = sc->sc_active; + } else { + /* + * LACP tracks active links automatically, + * the others do not. + */ + ra->ra_active = 0; + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + ra->ra_active += LAGG_PORTACTIVE(lp); + } + ra->ra_flapping = sc->sc_flapping; + ra->ra_flowid_shift = sc->flowid_shift; + count = 0; buf = outbuf; len = min(ra->ra_size, buflen); @@ -1225,9 +1260,88 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd free(outbuf, M_TEMP); break; case SIOCSLAGG: + /* + * Set options or protocol depending on + * ra->ra_opts and ra->ra_proto. + */ error = priv_check(td, PRIV_NET_LAGG); if (error) break; + if (ra->ra_opts != 0) { + /* + * Set options. LACP options are stored in sc->sc_psc, + * not in sc_opts. + */ + int valid, lacp; + + switch (ra->ra_opts) { + case LAGG_OPT_USE_FLOWID: + case -LAGG_OPT_USE_FLOWID: + case LAGG_OPT_FLOWIDSHIFT: + valid = 1; + lacp = 0; + break; + case LAGG_OPT_LACP_TXTEST: + case -LAGG_OPT_LACP_TXTEST: + case LAGG_OPT_LACP_RXTEST: + case -LAGG_OPT_LACP_RXTEST: + case LAGG_OPT_LACP_STRICT: + case -LAGG_OPT_LACP_STRICT: + valid = lacp = 1; + break; + default: + valid = lacp = 0; + break; + } + + LAGG_WLOCK(sc); + if (valid == 0 || + (lacp == 1 && sc->sc_proto != LAGG_PROTO_LACP)) { + /* Invalid combination of options specified. */ + error = EINVAL; + LAGG_WUNLOCK(sc); + break; /* Return from SIOCSLAGG. */ + } + /* + * Store new options into sc->sc_opts except for + * FLOWIDSHIFT and LACP options. + */ + if (lacp == 0) { + if (ra->ra_opts == LAGG_OPT_FLOWIDSHIFT) + sc->flowid_shift = ra->ra_flowid_shift; + else if (ra->ra_opts > 0) + sc->sc_opts |= ra->ra_opts; + else + sc->sc_opts &= ~ra->ra_opts; + } else { + struct lacp_softc *lsc; + + lsc = (struct lacp_softc *)sc->sc_psc; + + switch (ra->ra_opts) { + case LAGG_OPT_LACP_TXTEST: + lsc->lsc_debug.lsc_tx_test = 1; + break; + case -LAGG_OPT_LACP_TXTEST: + lsc->lsc_debug.lsc_tx_test = 0; + break; + case LAGG_OPT_LACP_RXTEST: + lsc->lsc_debug.lsc_rx_test = 1; + break; + case -LAGG_OPT_LACP_RXTEST: + lsc->lsc_debug.lsc_rx_test = 0; + break; + case LAGG_OPT_LACP_STRICT: + lsc->lsc_strict_mode = 1; + break; + case -LAGG_OPT_LACP_STRICT: + lsc->lsc_strict_mode = 0; + break; + } + } + LAGG_WUNLOCK(sc); + break; /* Return from SIOCSLAGG. */ + } if (ra->ra_proto < 1 || ra->ra_proto >= LAGG_PROTO_MAX) { error = EPROTONOSUPPORT; break; @@ -1687,27 +1801,6 @@ lagg_gethdr(struct mbuf *m, u_int off, u return (mtod(m, char *) + off); } -static int -lagg_sysctl_active(SYSCTL_HANDLER_ARGS) -{ - struct lagg_softc *sc = (struct lagg_softc *)arg1; - struct lagg_port *lp; - int error; - - /* LACP tracks active links automatically, the others do not */ - if (sc->sc_proto != LAGG_PROTO_LACP) { - sc->sc_active = 0; - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) - sc->sc_active += LAGG_PORTACTIVE(lp); - } - - error = sysctl_handle_int(oidp, &sc->sc_active, 0, req); - if ((error) || (req->newptr == NULL)) - return (error); - - return (0); -} - uint32_t lagg_hashmbuf(struct lagg_softc *sc, struct mbuf *m, uint32_t key) { @@ -1948,7 +2041,7 @@ lagg_fail_input(struct lagg_softc *sc, s struct ifnet *ifp = sc->sc_ifp; struct lagg_port *tmp_tp; - if (lp == sc->sc_primary || lagg_failover_rx_all) { + if (lp == sc->sc_primary || V_lagg_failover_rx_all) { m->m_pkthdr.rcvif = ifp; return (m); } @@ -2043,7 +2136,7 @@ lagg_lb_start(struct lagg_softc *sc, str struct lagg_port *lp = NULL; uint32_t p = 0; - if (sc->use_flowid && (m->m_flags & M_FLOWID)) + if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && (m->m_flags & M_FLOWID)) p = m->m_pkthdr.flowid >> sc->flowid_shift; else p = lagg_hashmbuf(sc, m, lb->lb_key); Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Wed Oct 1 21:24:58 2014 (r272385) +++ head/sys/net/if_lagg.h Wed Oct 1 21:37:32 2014 (r272386) @@ -125,6 +125,19 @@ struct lagg_reqall { struct lacp_opreq rpsc_lacp; } ra_psc; #define ra_lacpreq ra_psc.rpsc_lacp + int ra_opts; /* Option bitmap */ +#define LAGG_OPT_NONE 0x00 +#define LAGG_OPT_USE_FLOWID 0x01 /* use M_FLOWID */ +/* Pseudo flags which are used in ra_opts but not stored into sc_opts. */ +#define LAGG_OPT_FLOWIDSHIFT 0x02 /* Set flowid */ +#define LAGG_OPT_FLOWIDSHIFT_MASK 0x1f /* flowid is uint32_t */ +#define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ +#define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ +#define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */ + u_int ra_count; /* number of ports */ + u_int ra_active; /* active port count */ + u_int ra_flapping; /* number of flapping */ + int ra_flowid_shift; /* shift the flowid */ }; #define SIOCGLAGG _IOWR('i', 143, struct lagg_reqall) @@ -212,9 +225,7 @@ struct lagg_softc { eventhandler_tag vlan_attach; eventhandler_tag vlan_detach; struct callout sc_callout; - struct sysctl_ctx_list ctx; /* sysctl variables */ - struct sysctl_oid *sc_oid; /* sysctl tree oid */ - int use_flowid; /* use M_FLOWID */ + u_int sc_opts; int flowid_shift; /* shift the flowid */ struct lagg_counters detached_counters; /* detached ports sum */ }; From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 22:05:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BDF7B76 for ; Wed, 1 Oct 2014 22:05:38 +0000 (UTC) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EEDD1F7 for ; Wed, 1 Oct 2014 22:05:37 +0000 (UTC) Received: by mail-la0-f44.google.com with SMTP id gb8so1311256lab.3 for ; Wed, 01 Oct 2014 15:05:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=mCyGT5GkfZCWGO179W8jGCxGbXNEZIs+N1kBgGEbY2k=; b=JfQ4UmvBkAGmU7EjQSSPVDPjXetTmdtw8BqRAjoQDEvBvgp8Oaui6auVKekn6W1ygV dTBRGEjq3IvnbC6Z713xh5Ln3EyGFhosY/yHe8C/Nme1LwUspUOVw6r4XfG4J0LSHwgx mJOkNQWmsgF2glcxkVjM+qkbeVuu9TOf62TuJt1dAxFSH31MkEgkwrU8wPrB2J/YuAXh 9Oc1F9v1BWNZPv+s7IUHSEHhX5spjlqve5h8dFRSuoH6QwlHS8Y7TGGiHvnibrZ4vRCO AKTYMxXfeuDNbQy2jOtN2zGurGfkcy4hw7RRBYEbpX/zJAH67D4IQ4qqyfijZ1Olto/r Nu1w== X-Gm-Message-State: ALoCoQld57UwU6wdj56iUU1eDzXyXJ+fynGsmz7eiYic/icfNwttzDxWifPXjlGpEvyBZi4URxFA X-Received: by 10.112.24.104 with SMTP id t8mr55670872lbf.46.1412201129713; Wed, 01 Oct 2014 15:05:29 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id cm9sm855535lbb.39.2014.10.01.15.05.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Oct 2014 15:05:28 -0700 (PDT) Message-ID: <542C7AA5.80708@freebsd.org> Date: Thu, 02 Oct 2014 02:05:25 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Pedro Giffuni Subject: Re: New bug introduced in strptime (was Re: svn commit: r272273 - head/lib/libc/stdtime) References: <201409282120.s8SLKLJs070469@svn.freebsd.org> <542C5DCC.8060406@freebsd.org> In-Reply-To: <542C5DCC.8060406@freebsd.org> Content-Type: multipart/mixed; boundary="------------040504000904060602060807" Cc: svn-src-head@freebsd.org, Antoine Brodin , David Carlier 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, 01 Oct 2014 22:05:38 -0000 This is a multi-part message in MIME format. --------------040504000904060602060807 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit On 02.10.2014 0:02, Pedro Giffuni wrote: > Hello; > > I can reproduce this. On FreeBSD 9.1 (no patch): It was the bug in the original patch. I just miss it. Fix attached. -- http://ache.vniz.net/ --------------040504000904060602060807 Content-Type: text/plain; charset=windows-1251; name="patch_len" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch_len" --- strptime.c.bak 2014-10-02 01:44:39.000000000 +0400 +++ strptime.c 2014-10-02 01:59:20.000000000 +0400 @@ -342,6 +342,7 @@ if (i == asizeof(tptr->weekday)) return (NULL); + buf += len; tm->tm_wday = i; flags |= FLAG_WDAY; break; --------------040504000904060602060807-- From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 22:09:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18E6DBCF for ; Wed, 1 Oct 2014 22:09:06 +0000 (UTC) Received: from nm15.bullet.mail.bf1.yahoo.com (nm15.bullet.mail.bf1.yahoo.com [98.139.212.174]) (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 AEB4A21E for ; Wed, 1 Oct 2014 22:09:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1412201343; bh=GbxLrnEe37hn56kEmv7bESkdJCq09C7UvedzYeS3TzA=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:From:Subject; b=FFzBlmD0xjrQ3IIxFTy9EPtjmEkHJSLm71R766fNSP15v8zUnOSTSMpSizuwkr1XVB9kIzIf3lb6T6ZbJLRr/SGyu28wsrXJrtXW90NzOrG1dZtmsaaYXvkJIPzXtzQCUsL6UqnAuKBm94gnjfFJk6Xk5tvi3FOMks7ZP2NFkkmkw2XsAKCsRCpfFup0TjDgx6nmQw5bYvMecSMgPZu1BVoCoki/5xN28L3mRMEYLOS/5bgZsoDfuRTjQiP+1lLz6wtls99tE69s0s3hgAIbOe3NzuvWW82u8rkYVnaPhz1qQJ0XtZtTi0qVQ2vRDmwV/+qJ2LB5cx2gmiyajwoONA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=SC+8dX1EjpU5ml1ytLW07VbnPW85kIG9FPrQFyWhMa7EL5Nxqjr5oeB5ynCxlN9Y1dmYN/jrh26WHXcM+1T9rCpEjNkOMSIlgyfeqisl/ECVlbgU30uAZXt6259n4JLMspMmyD65BBj7NTkMCPZ+hZ7hi1QJJTQU4o3L/lx08O0RqgGwIzWIGqiw2U6ZXIeGmXhmrNDxAxVHan4GMJot/6UM5qfU6dNTBHLWV30E9yLHF5G5DczFoJng47BbqhFJaqPyDnO/rQUVY6vEzdQfegYA6mZVFm7NzkgI9gZIJGzRslddbrEQml4Xs5ezI4NYtao6iipiEpo07xN59PXX5A==; Received: from [98.139.215.143] by nm15.bullet.mail.bf1.yahoo.com with NNFMP; 01 Oct 2014 22:09:03 -0000 Received: from [98.139.211.202] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 01 Oct 2014 22:09:03 -0000 Received: from [127.0.0.1] by smtp211.mail.bf1.yahoo.com with NNFMP; 01 Oct 2014 22:09:03 -0000 X-Yahoo-Newman-Id: 825483.74689.bm@smtp211.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: DzozbikVM1mJ2wgYiJrY4s7uQTV9fgxBKp.JWIJ9IgeCHZP pX6MJFDTV6DM1agiLXZRKsDZ5qm3YTdljatFF9TcLbVxdWpEugBIMH6858WQ jIYIufalhd8XVnOV.bd7PzdHwN3Xxp9PSV8RGkKjes0hiDiysdroXUn2WfTT IMYJBQPlk37JLzmwQABJXdD7NmNvsjL8i2xjhVggbc2FIfJjtr9sdWqszP51 L2_ExN__hL.o1Hoq0OFrLnxIepKUO5FGqN86fdHdCtIn1iI9p6PRFW9voSv_ vef5BJIIf9Ktwxns2FPaosa1Tg5EcYi9kld1btCT7N._n20DkUNBDuh0b4uW OCtN6klth2cYpPxmv7pPASoctcHweVdQtXoxmAf2HCkA8hb.88eZ4_BwYjKa ontFOw5bRiiPd4DqmixhnYL6bcCr0BC7DRfM6LHcYRBCc6ADd5M.JDKGMuu_ .S2SU1FDiXxaHzqY9mmZo.Wkm4fWWNhUYqV_.EVfFztTruNyA7c0i7iCK3GM 29T8BIqSibxTbdnWtmFKlKW_uNuBSpg-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <542C7B82.7030903@freebsd.org> Date: Wed, 01 Oct 2014 17:09:06 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Andrey Chernov Subject: Re: New bug introduced in strptime (was Re: svn commit: r272273 - head/lib/libc/stdtime) References: <201409282120.s8SLKLJs070469@svn.freebsd.org> <542C5DCC.8060406@freebsd.org> <542C7AA5.80708@freebsd.org> In-Reply-To: <542C7AA5.80708@freebsd.org> Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Antoine Brodin , David Carlier 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, 01 Oct 2014 22:09:06 -0000 On 10/01/14 17:05, Andrey Chernov wrote: > On 02.10.2014 0:02, Pedro Giffuni wrote: >> Hello; >> >> I can reproduce this. On FreeBSD 9.1 (no patch): > It was the bug in the original patch. I just miss it. Fix attached. > Thank you both for the fix (and antoine for reporting it), I confirmed the fix works ... will commit it shortly. Pedro. From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 22:10:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68FE6D19 for ; Wed, 1 Oct 2014 22:10:56 +0000 (UTC) Received: from mail-qc0-f176.google.com (mail-qc0-f176.google.com [209.85.216.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 223A62FC for ; Wed, 1 Oct 2014 22:10:55 +0000 (UTC) Received: by mail-qc0-f176.google.com with SMTP id r5so1265149qcx.21 for ; Wed, 01 Oct 2014 15:10:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=o14yQrWWqjqlrCVvdZy1KjTpRwkw1MxzLy7jcEfjmiE=; b=J8/sPlwUmy+6v4C2lDoQs/yVaaCUkMl2z5FWh0G0w39STcwObT3PvUPQ5FeawEhr3M mI7PsoREQOGUFyaJTYOV+KhdU8nisNcnmvFaDHXgGmBxe0dF+0OjIc2zB+lveh7ZHWpR V00eanoY6yg4OkPqz4ZwMMWkDOjIcD9YcKzxsSgWmj6B0qMjCgH6yd2411ubBKx24DLX yVNyFGNVP9SHdAUC5dDjyY98uDDhKpO5xGyV7IQUhJzHsXEx/S2fXpC7V7Vu1YjIOYaM uduMAPi6t8Incxu3YpQkNHxDLLEQozeqNzF43F97PPvd6sDSyF1XFx2RPKh25679GPYn YtKA== X-Gm-Message-State: ALoCoQlMUrb8V076YOkCy5nPPyGmGNQYsvU8f7FLvHR9wQS+0kW33avC8oi1mS2JDt3BdCD08+zl MIME-Version: 1.0 X-Received: by 10.224.4.72 with SMTP id 8mr36619333qaq.79.1412201454558; Wed, 01 Oct 2014 15:10:54 -0700 (PDT) Received: by 10.140.31.36 with HTTP; Wed, 1 Oct 2014 15:10:54 -0700 (PDT) In-Reply-To: References: <201409291505.s8TF5Nhh066884@svn.freebsd.org> Date: Wed, 1 Oct 2014 16:10:54 -0600 Message-ID: Subject: Re: svn commit: r272282 - head/share/mk From: Will Andrews To: NGie Cooper 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: Wed, 01 Oct 2014 22:10:56 -0000 On Wed, Oct 1, 2014 at 3:21 PM, NGie Cooper wrote: > Sounds like a documentation issue though (it's not listed in the > handbook :(..: https://www.freebsd.org/doc/handbook/ports-using.html ) Well, I would argue this sort of thing should not need to be documented in the first place. --Will. From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 22:18:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1062474; Wed, 1 Oct 2014 22:18:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE8733B0; Wed, 1 Oct 2014 22:18: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 s91MI78A046089; Wed, 1 Oct 2014 22:18:07 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s91MI78V046088; Wed, 1 Oct 2014 22:18:07 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201410012218.s91MI78V046088@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 1 Oct 2014 22:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272387 - head/lib/libc/stdtime X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 01 Oct 2014 22:18:07 -0000 Author: pfg Date: Wed Oct 1 22:18:07 2014 New Revision: 272387 URL: https://svnweb.freebsd.org/changeset/base/272387 Log: strptime: fix bug introduced in r272273. Reported by: portmgr (antoine) Fix by: Andrey Chernov, David Carlier PR: 137307 (follow up) Modified: head/lib/libc/stdtime/strptime.c Modified: head/lib/libc/stdtime/strptime.c ============================================================================== --- head/lib/libc/stdtime/strptime.c Wed Oct 1 21:37:32 2014 (r272386) +++ head/lib/libc/stdtime/strptime.c Wed Oct 1 22:18:07 2014 (r272387) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "timelocal.h" #include "tzfile.h" -#include + static char * _strptime(const char *, const char *, struct tm *, int *, locale_t); #define asizeof(a) (sizeof(a) / sizeof((a)[0])) @@ -342,6 +342,7 @@ label: if (i == asizeof(tptr->weekday)) return (NULL); + buf += len; tm->tm_wday = i; flags |= FLAG_WDAY; break; From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 00:13:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBDE76A5; Thu, 2 Oct 2014 00:13:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A83202DF; Thu, 2 Oct 2014 00:13: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 s920D9Dw003618; Thu, 2 Oct 2014 00:13:09 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s920D9rt003617; Thu, 2 Oct 2014 00:13:09 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410020013.s920D9rt003617@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 2 Oct 2014 00:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272389 - head/sys/cddl/boot/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 00:13:09 -0000 Author: delphij Date: Thu Oct 2 00:13:08 2014 New Revision: 272389 URL: https://svnweb.freebsd.org/changeset/base/272389 Log: Diff reduction with kernel code: instruct the compiler that the data of these types may be unaligned to their "normal" alignment and exercise caution when accessing them. PR: 194071 MFC after: 3 days Modified: head/sys/cddl/boot/zfs/lz4.c Modified: head/sys/cddl/boot/zfs/lz4.c ============================================================================== --- head/sys/cddl/boot/zfs/lz4.c Wed Oct 1 23:15:23 2014 (r272388) +++ head/sys/cddl/boot/zfs/lz4.c Thu Oct 2 00:13:08 2014 (r272389) @@ -83,6 +83,17 @@ lz4_decompress(void *s_start, void *d_st #endif /* + * Unaligned memory access is automatically enabled for "common" CPU, + * such as x86. For others CPU, the compiler will be more cautious, and + * insert extra code to ensure aligned access is respected. If you know + * your target CPU supports unaligned memory access, you may want to + * force this option manually to improve performance + */ +#if defined(__ARM_FEATURE_UNALIGNED) +#define LZ4_FORCE_UNALIGNED_ACCESS 1 +#endif + +/* * Compiler Options */ #if __STDC_VERSION__ >= 199901L /* C99 */ @@ -113,6 +124,10 @@ lz4_decompress(void *s_start, void *d_st #define S32 int32_t #define U64 uint64_t +#ifndef LZ4_FORCE_UNALIGNED_ACCESS +#pragma pack(1) +#endif + typedef struct _U16_S { U16 v; } U16_S; @@ -123,6 +138,10 @@ typedef struct _U64_S { U64 v; } U64_S; +#ifndef LZ4_FORCE_UNALIGNED_ACCESS +#pragma pack() +#endif + #define A64(x) (((U64_S *)(x))->v) #define A32(x) (((U32_S *)(x))->v) #define A16(x) (((U16_S *)(x))->v) From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 00:19:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE97390E; Thu, 2 Oct 2014 00: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 9B7BE334; Thu, 2 Oct 2014 00: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 s920JPM3004431; Thu, 2 Oct 2014 00:19:25 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s920JPp5004430; Thu, 2 Oct 2014 00:19:25 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201410020019.s920JPp5004430@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 2 Oct 2014 00:19:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272390 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 00:19:25 -0000 Author: hrs Date: Thu Oct 2 00:19:24 2014 New Revision: 272390 URL: https://svnweb.freebsd.org/changeset/base/272390 Log: Add IFCAP_HWSTATS. Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Thu Oct 2 00:13:08 2014 (r272389) +++ head/sbin/ifconfig/ifconfig.c Thu Oct 2 00:19:24 2014 (r272390) @@ -903,7 +903,7 @@ unsetifdescr(const char *val, int value, "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ "\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ -"\26RXCSUM_IPV6\27TXCSUM_IPV6" +"\26RXCSUM_IPV6\27TXCSUM_IPV6\30HWSTATS" /* * Print the status of the interface. If an address family was From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 00:25:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76009D8E; Thu, 2 Oct 2014 00:25:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 621225F0; Thu, 2 Oct 2014 00:25: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 s920Pw5b008960; Thu, 2 Oct 2014 00:25:58 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s920PvEW008958; Thu, 2 Oct 2014 00:25:57 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201410020025.s920PvEW008958@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 2 Oct 2014 00:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272391 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 02 Oct 2014 00:25:58 -0000 Author: hrs Date: Thu Oct 2 00:25:57 2014 New Revision: 272391 URL: https://svnweb.freebsd.org/changeset/base/272391 Log: Add an additional routing table lookup when m->m_pkthdr.fibnum is changed at a PFIL hook in ip{,6}_output(). IPFW setfib rule did not perform a routing table lookup when the destination address was not changed. CR: D805 Modified: head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Oct 2 00:19:24 2014 (r272390) +++ head/sys/netinet/ip_output.c Thu Oct 2 00:25:57 2014 (r272391) @@ -136,7 +136,9 @@ ip_output(struct mbuf *m, struct mbuf *o struct rtentry *rte; /* cache for ro->ro_rt */ struct in_addr odst; struct m_tag *fwd_tag = NULL; + uint32_t fibnum; int have_ia_ref; + int needfiblookup; #ifdef IPSEC int no_route_but_check_spd = 0; #endif @@ -202,6 +204,7 @@ ip_output(struct mbuf *m, struct mbuf *o * therefore we need restore gw if we're redoing lookup. */ gw = dst = (struct sockaddr_in *)&ro->ro_dst; + fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : M_GETFIB(m); again: ia = NULL; have_ia_ref = 0; @@ -283,10 +286,9 @@ again: #ifdef RADIX_MPATH rtalloc_mpath_fib(ro, ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr), - inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); + fibnum); #else - in_rtalloc_ign(ro, 0, - inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); + in_rtalloc_ign(ro, 0, fibnum); #endif rte = ro->ro_rt; } @@ -504,6 +506,7 @@ sendit: goto done; ip = mtod(m, struct ip *); + needfiblookup = 0; /* See if destination IP address was changed by packet filter. */ if (odst.s_addr != ip->ip_dst.s_addr) { @@ -529,9 +532,18 @@ sendit: } else { if (have_ia_ref) ifa_free(&ia->ia_ifa); - goto again; /* Redo the routing table lookup. */ + needfiblookup = 1; /* Redo the routing table lookup. */ } } + /* See if fib was changed by packet filter. */ + if (fibnum != M_GETFIB(m)) { + m->m_flags |= M_SKIP_FIREWALL; + fibnum = M_GETFIB(m); + RO_RTFREE(ro); + needfiblookup = 1; + } + if (needfiblookup) + goto again; /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */ if (m->m_flags & M_FASTFWD_OURS) { Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Oct 2 00:19:24 2014 (r272390) +++ head/sys/netinet6/ip6_output.c Thu Oct 2 00:25:57 2014 (r272391) @@ -255,6 +255,8 @@ ip6_output(struct mbuf *m0, struct ip6_p struct route_in6 *ro_pmtu = NULL; int hdrsplit = 0; int sw_csum, tso; + int needfiblookup; + uint32_t fibnum; struct m_tag *fwd_tag = NULL; ip6 = mtod(m, struct ip6_hdr *); @@ -448,6 +450,7 @@ ip6_output(struct mbuf *m0, struct ip6_p if (ro->ro_rt == NULL) (void )flowtable_lookup(AF_INET6, m, (struct route *)ro); #endif + fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : M_GETFIB(m); again: /* * if specified, try to fill in the traffic class field. @@ -489,7 +492,7 @@ again: dst_sa.sin6_addr = ip6->ip6_dst; } error = in6_selectroute_fib(&dst_sa, opt, im6o, ro, &ifp, - &rt, inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); + &rt, fibnum); if (error != 0) { if (ifp != NULL) in6_ifstat_inc(ifp, ifs6_out_discard); @@ -649,7 +652,7 @@ again: /* Determine path MTU. */ if ((error = ip6_getpmtu(ro_pmtu, ro, ifp, &finaldst, &mtu, - &alwaysfrag, inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m))) != 0) + &alwaysfrag, fibnum)) != 0) goto bad; /* @@ -727,6 +730,7 @@ again: goto done; ip6 = mtod(m, struct ip6_hdr *); + needfiblookup = 0; /* See if destination IP address was changed by packet filter. */ if (!IN6_ARE_ADDR_EQUAL(&odst, &ip6->ip6_dst)) { m->m_flags |= M_SKIP_FIREWALL; @@ -747,8 +751,17 @@ again: error = netisr_queue(NETISR_IPV6, m); goto done; } else - goto again; /* Redo the routing table lookup. */ + needfiblookup = 1; /* Redo the routing table lookup. */ } + /* See if fib was changed by packet filter. */ + if (fibnum != M_GETFIB(m)) { + m->m_flags |= M_SKIP_FIREWALL; + fibnum = M_GETFIB(m); + RO_RTFREE(ro); + needfiblookup = 1; + } + if (needfiblookup) + goto again; /* See if local, if yes, send it to netisr. */ if (m->m_flags & M_FASTFWD_OURS) { From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 01:16:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 407EEE73; Thu, 2 Oct 2014 01:16:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CDA0B51; Thu, 2 Oct 2014 01:16: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 s921GVo0033934; Thu, 2 Oct 2014 01:16:31 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s921GVTZ033933; Thu, 2 Oct 2014 01:16:31 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201410020116.s921GVTZ033933@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 2 Oct 2014 01:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272393 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 01:16:31 -0000 Author: hrs Date: Thu Oct 2 01:16:30 2014 New Revision: 272393 URL: https://svnweb.freebsd.org/changeset/base/272393 Log: Resurrect set_rcvar() as a function to define a rc.conf variable. It defines a variable and its default value in load_rc_config() just after rc.conf is loaded. "rcvar" command shows the current and the default values. This is an attempt to solve a problem that rc.d scripts from third-party software do not have entries in /etc/defaults/rc.conf. The fact that load_rc_config() reads rc.conf only once and /etc/rc invokes the function before running rc.d scripts made developers confused for a long time because load_rc_config() just before run_rc_command() in each rc.d script overrides variables only when the script is directly invoked, not from /etc/rc. Variables defined in set_rcvar are always set in load_rc_config() after loading rc.conf. An rc.d script can now be written in a self-contained manner regarding the related variables as follows: --- name=foo rcvar=foo_enable set_rcvar foo_enable YES "Enable $name" set_rcvar foo_flags "-s" "Flags to $name" ... load_rc_config $name run_rc_command "$@" --- Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Thu Oct 2 00:34:03 2014 (r272392) +++ head/etc/rc.subr Thu Oct 2 01:16:30 2014 (r272393) @@ -68,6 +68,39 @@ list_vars() done; } } +# set_rcvar [var] [defval] [desc] +# +# Echo or define a rc.conf(5) variable name. Global variable +# $rcvars is used. +# +# If no argument is specified, echo "${name}_enable". +# +# If only a var is specified, echo "${var}_enable". +# +# If var and defval are specified, the ${var} is defined as +# rc.conf(5) variable and the default value is ${defvar}. An +# optional argument $desc can also be specified to add a +# description for that. +# +set_rcvar() +{ + local _var + + case $# in + 0) echo ${name}_enable ;; + 1) echo ${1}_enable ;; + *) + debug "set_rcvar: \$$1=$2 is added" \ + " as a rc.conf(5) variable." + _var=$1 + rcvars="${rcvars# } $_var" + eval ${_var}_defval=\"$2\" + shift 2 + eval ${_var}_desc=\"$*\" + ;; + esac +} + # set_rcvar_obsolete oldvar [newvar] [msg] # Define obsolete variable. # Global variable $rcvars_obsolete is used. @@ -76,7 +109,7 @@ set_rcvar_obsolete() { local _var _var=$1 - debug "rcvar_obsolete: \$$1(old) -> \$$2(new) is defined" + debug "set_rcvar_obsolete: \$$1(old) -> \$$2(new) is defined" rcvars_obsolete="${rcvars_obsolete# } $1" eval ${1}_newvar=\"$2\" @@ -1091,8 +1124,8 @@ $command $rc_flags $command_args" echo "" fi echo "#" - # Get unique vars in $rcvar - for _v in $rcvar; do + # Get unique vars in $rcvar $rcvars + for _v in $rcvar $rcvars; do case $v in $_v\ *|\ *$_v|*\ $_v\ *) ;; *) v="${v# } $_v" ;; @@ -1238,7 +1271,7 @@ run_rc_script() unset name command command_args command_interpreter \ extra_commands pidfile procname \ - rcvar rcvars_obsolete required_dirs required_files \ + rcvar rcvars rcvars_obsolete required_dirs required_files \ required_vars eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd @@ -1306,7 +1339,7 @@ load_rc_config() done # Set defaults if defined. - for _var in $rcvar; do + for _var in $rcvar $rcvars; do eval _defval=\$${_var}_defval if [ -n "$_defval" ]; then eval : \${$_var:=\$${_var}_defval} From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 01:31:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8F82E3 for ; Thu, 2 Oct 2014 01:31:06 +0000 (UTC) Received: from o3.shared.sendgrid.net (o3.shared.sendgrid.net [208.117.48.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 912AFCBD for ; Thu, 2 Oct 2014 01:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=from:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=p6iDGWq1t9DSuD47Va0EeS7SgC8=; b=mPXHvFndCa+TmtkzhJ HuMYEqHy26iOMf1SoAU/Dk2do0HXVO93PlaT8tGrbAuMpA7KBc/yS7By7/gwd26Q U8f9ZfPq3fw5a9ZT/JmxNfc1fopYux8+k19diwwiyTahdgw6UN8meB1QFleOY6jf p+CAsDo9eJ7Fevx697NBRKuIU= Received: by filter0017p1mdw1.sendgrid.net with SMTP id filter0017p1mdw1.30456.542CAAD29 2014-10-02 01:30:59.427366421 +0000 UTC Received: from mail.tarsnap.com (unknown [10.100.60.108]) by ismtpd-001.iad1.sendgrid.net (SG) with ESMTP id 148ce7b4946.3e38.62d4b2 for ; Thu, 02 Oct 2014 01:30:59 +0000 (GMT) Received: (qmail 91473 invoked from network); 2 Oct 2014 01:30:58 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 2 Oct 2014 01:30:58 -0000 Received: (qmail 18543 invoked from network); 2 Oct 2014 01:30:36 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 2 Oct 2014 01:30:36 -0000 Message-ID: <542CAABB.5090900@freebsd.org> Date: Wed, 01 Oct 2014 18:30:35 -0700 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Hiroki Sato , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r272393 - head/etc References: <201410020116.s921GVTZ033933@svn.freebsd.org> In-Reply-To: <201410020116.s921GVTZ033933@svn.freebsd.org> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SG-EID: EvYvoie/qnEezyq2t4eRKjDm9X7ZKbCMt75WvXA+XNHnO/H+4TSyS3LaP5biz4R71wZqX/njskddFETnsqVsAHuo3tsZRndkZnAz6oh9HdbJK+PNuQyfrA3bVyrfCol7/Zlcw/pADSt2BGNOhJVMpGg/errDbmZx2w+GOfaYR0+huAewHG9Ln+V2lZ6D3MwN 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, 02 Oct 2014 01:31:06 -0000 On 10/01/14 18:16, Hiroki Sato wrote: > This is an attempt to solve a problem that rc.d scripts from third-party > software do not have entries in /etc/defaults/rc.conf. Isn't this why we have the > : ${foo_enable="NO"} idiom in ports rc.d files? > The fact that > load_rc_config() reads rc.conf only once and /etc/rc invokes the function > before running rc.d scripts made developers confused for a long time because > load_rc_config() just before run_rc_command() in each rc.d script overrides > variables only when the script is directly invoked, not from /etc/rc. If a script is setting variables for its own use, there's no need to use functions from rc.subr -- it can just set the variables directly. If a script is editing rc.conf, sending a SIGALRM to $$ will signal /etc/rc to re-source rc.conf. I'm really not clear on what this commit accomplishes. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 02:00:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCA273AA; Thu, 2 Oct 2014 02:00: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 A80E5E90; Thu, 2 Oct 2014 02:00: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 s9220M5V055013; Thu, 2 Oct 2014 02:00:22 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9220M4E055012; Thu, 2 Oct 2014 02:00:22 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410020200.s9220M4E055012@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 2 Oct 2014 02:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272394 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 02:00:22 -0000 Author: ae Date: Thu Oct 2 02:00:21 2014 New Revision: 272394 URL: https://svnweb.freebsd.org/changeset/base/272394 Log: Do not strip outer header when operating in transport mode. Instead requeue mbuf back to IPv4 protocol handler. If there is one extra IP-IP encapsulation, it will be handled with tunneling interface. And thus proper interface will be exposed into mbuf's rcvif. Also, tcpdump that listens on tunneling interface will see packets in both directions. Sponsored by: Yandex LLC Modified: head/sys/netipsec/ipsec_input.c Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Thu Oct 2 01:16:30 2014 (r272393) +++ head/sys/netipsec/ipsec_input.c Thu Oct 2 02:00:21 2014 (r272394) @@ -391,7 +391,8 @@ ipsec4_common_input_cb(struct mbuf *m, s #endif /* DEV_ENC */ /* IP-in-IP encapsulation */ - if (prot == IPPROTO_IPIP) { + if (prot == IPPROTO_IPIP && + saidx->mode != IPSEC_MODE_TRANSPORT) { if (m->m_pkthdr.len - skip < sizeof(struct ip)) { IPSEC_ISTAT(sproto, hdrops); @@ -431,7 +432,8 @@ ipsec4_common_input_cb(struct mbuf *m, s } #ifdef INET6 /* IPv6-in-IP encapsulation. */ - if (prot == IPPROTO_IPV6) { + if (prot == IPPROTO_IPV6 && + saidx->mode != IPSEC_MODE_TRANSPORT) { if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) { IPSEC_ISTAT(sproto, hdrops); @@ -502,6 +504,12 @@ ipsec4_common_input_cb(struct mbuf *m, s key_sa_recordxfer(sav, m); /* record data transfer */ + /* + * In transport mode requeue decrypted mbuf back to IPv4 protocol + * handler. This is necessary to correctly expose rcvif. + */ + if (saidx->mode == IPSEC_MODE_TRANSPORT) + prot = IPPROTO_IPIP; #ifdef DEV_ENC /* * Pass the mbuf to enc0 for bpf and pfil. From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 03:39:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BBFDF26; Thu, 2 Oct 2014 03:39:31 +0000 (UTC) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.allbsd.org", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5007BACC; Thu, 2 Oct 2014 03:39:30 +0000 (UTC) Received: from alph.d.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=56) by mail.allbsd.org (8.14.9/8.14.8) with ESMTP id s923d4ma051923 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Oct 2014 12:39:15 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.8/8.14.8) with ESMTP id s923d1h5015132; Thu, 2 Oct 2014 12:39:04 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Thu, 02 Oct 2014 12:37:47 +0900 (JST) Message-Id: <20141002.123747.2156790647982484029.hrs@allbsd.org> To: cperciva@freebsd.org Subject: Re: svn commit: r272393 - head/etc From: Hiroki Sato In-Reply-To: <542CAABB.5090900@freebsd.org> References: <201410020116.s921GVTZ033933@svn.freebsd.org> <542CAABB.5090900@freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.6 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Thu_Oct__2_12_37_47_2014_642)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Thu, 02 Oct 2014 12:39:24 +0900 (JST) X-Spam-Status: No, score=-97.9 required=13.0 tests=CONTENT_TYPE_PRESENT, RDNS_NONE,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 03:39:31 -0000 ----Security_Multipart(Thu_Oct__2_12_37_47_2014_642)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Colin Percival wrote in <542CAABB.5090900@freebsd.org>: cp> On 10/01/14 18:16, Hiroki Sato wrote: cp> > This is an attempt to solve a problem that rc.d scripts from third-party cp> > software do not have entries in /etc/defaults/rc.conf. cp> cp> Isn't this why we have the cp> > : ${foo_enable="NO"} cp> idiom in ports rc.d files? cp> cp> > The fact that cp> > load_rc_config() reads rc.conf only once and /etc/rc invokes the function cp> > before running rc.d scripts made developers confused for a long time because cp> > load_rc_config() just before run_rc_command() in each rc.d script overrides cp> > variables only when the script is directly invoked, not from /etc/rc. cp> cp> If a script is setting variables for its own use, there's no need to use cp> functions from rc.subr -- it can just set the variables directly. If a cp> script is editing rc.conf, sending a SIGALRM to $$ will signal /etc/rc to cp> re-source rc.conf. cp> cp> I'm really not clear on what this commit accomplishes. The primary purpose is to make it clear which variables are used in the script for *user configuration* and provide a consistent writing style for scripts from both base and ports. More specifically, I want to implement a way to list user-configurable variables and which one is changed from the default value, by effectively replacing functionality of defaults/rc.conf with set_rcvar(). Use of : ${foo="NO"} idiom after load_rc_config() works as you pointed out. However, it does not work with listing variables. Plus, there are many scripts written in an inconsistent way. Some scripts call load_rc_config() multiple times, some have the idioms between load_rc_config() and run_rc_command(), and some have them mistakenly before load_rc_config(). I think this is due to confusion about how load_rc_config() works and all of them can be fixed/rewritten consistently of course, but I think gathering definitions at the head of the scripts and making them being defined at the end of load_rc_config() as set_rcvar_obsolete() does are more intuitive. -- Hiroki ----Security_Multipart(Thu_Oct__2_12_37_47_2014_642)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlQsyIsACgkQTyzT2CeTzy3ZdwCfQh1CkzJMQ76OfJ4xbHEaNoY+ f10An0h6thcsnu9IOdidwWkrXYB2SpAP =NkWt -----END PGP SIGNATURE----- ----Security_Multipart(Thu_Oct__2_12_37_47_2014_642)---- From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 04:07:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96EAC3E2; Thu, 2 Oct 2014 04:07:46 +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 56917D86; Thu, 2 Oct 2014 04:07:45 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id E8C89D6247C; Thu, 2 Oct 2014 14:07:35 +1000 (EST) Date: Thu, 2 Oct 2014 14:07:12 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mateusz Guzik Subject: Re: svn commit: r272366 - head/sys/kern In-Reply-To: <20141001181825.GA16048@dft-labs.eu> Message-ID: <20141002133405.W1665@besplex.bde.org> References: <201410011532.s91FWTZL050853@svn.freebsd.org> <20141001181825.GA16048@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=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=UiRU701cgEFRS5dujKwA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Will Andrews 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, 02 Oct 2014 04:07:46 -0000 On Wed, 1 Oct 2014, Mateusz Guzik wrote: > On Wed, Oct 01, 2014 at 03:32:29PM +0000, Will Andrews wrote: >> Author: will >> Date: Wed Oct 1 15:32:28 2014 >> New Revision: 272366 >> URL: https://svnweb.freebsd.org/changeset/base/272366 >> >> Log: >> In the syncer, drop the sync mutex while patting the watchdog. >> >> Some watchdog drivers (like ipmi) need to sleep while patting the watchdog. >> See sys/dev/ipmi/ipmi.c:ipmi_wd_event(), which calls malloc(M_WAITOK). > > Is not such malloc inherently bad in case of watchdog? > > It looks like the code waits for request completion and then frees it > unconditionally. As such, a local var on stack would do the trick. > > The code msleeps later, so this hack of dropping sync_mtx is still > needed. It's not a hack then. Then it is at the end of the loop, so any state changes are picked up by looping. However, sync_vnode() has _always_ just released the lock and re-acquired it, so there is no new problem, and probably no old one either. It is just hard to see that there is no problem in code that doesn't check for state changes after sleeping. % while (!LIST_EMPTY(slp)) { % error = sync_vnode(slp, &bo, td); % if (error == 1) { % LIST_REMOVE(bo, bo_synclist); % LIST_INSERT_HEAD(next, bo, bo_synclist); % continue; % } Since we get here, sync_vnode() didn't return early; it unlocked, and the last statement in it is to re-lock... (All sync_vnode() did before unlocking was to read a vnode from the list and lock and hold it.) % % if (first_printf == 0) ... so we can sprinkle any number of unlock/lock pairs here without adding any new problems. % wdog_kern_pat(WD_LASTVAL); % % } Bruce From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 04:59:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31CB6B23; Thu, 2 Oct 2014 04:59:28 +0000 (UTC) Received: from shxd.cx (unknown [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3D71E8; Thu, 2 Oct 2014 04:59:28 +0000 (UTC) Received: from [64.201.244.132] (port=59586 helo=THEMADHATTER) by shxd.cx with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1XZSka-000049-3F; Wed, 01 Oct 2014 15:52:00 -0700 From: To: "'Hiroki Sato'" , References: <201410020116.s921GVTZ033933@svn.freebsd.org> <542CAABB.5090900@freebsd.org> <20141002.123747.2156790647982484029.hrs@allbsd.org> In-Reply-To: <20141002.123747.2156790647982484029.hrs@allbsd.org> Subject: RE: svn commit: r272393 - head/etc Date: Wed, 1 Oct 2014 21:59:11 -0700 Message-ID: <193c01cfddfd$9b1c6ef0$d1554cd0$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQIKWLejTHnCEajZOhjMlj6r7bWH2AH0PTEWApew9nObgumf0A== Content-Language: en-us Sender: devin@shxd.cx Cc: svn-src-head@freebsd.org, dteske@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, 02 Oct 2014 04:59:28 -0000 > -----Original Message----- > From: owner-src-committers@freebsd.org [mailto:owner-src- > committers@freebsd.org] On Behalf Of Hiroki Sato > Sent: Wednesday, October 1, 2014 8:38 PM > To: cperciva@freebsd.org > Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > head@freebsd.org > Subject: Re: svn commit: r272393 - head/etc > > Colin Percival wrote > in <542CAABB.5090900@freebsd.org>: > > cp> On 10/01/14 18:16, Hiroki Sato wrote: > cp> > This is an attempt to solve a problem that rc.d scripts from third-party > cp> > software do not have entries in /etc/defaults/rc.conf. > cp> > cp> Isn't this why we have the > cp> > : ${foo_enable="NO"} > cp> idiom in ports rc.d files? > cp> > cp> > The fact that > cp> > load_rc_config() reads rc.conf only once and /etc/rc invokes the > function > cp> > before running rc.d scripts made developers confused for a long time > because > cp> > load_rc_config() just before run_rc_command() in each rc.d script > overrides > cp> > variables only when the script is directly invoked, not from /etc/rc. > cp> > cp> If a script is setting variables for its own use, there's no need to use > cp> functions from rc.subr -- it can just set the variables directly. If a > cp> script is editing rc.conf, sending a SIGALRM to $$ will signal /etc/rc to > cp> re-source rc.conf. > cp> > cp> I'm really not clear on what this commit accomplishes. > > The primary purpose is to make it clear which variables are used in > the script for *user configuration* and provide a consistent writing > style for scripts from both base and ports. More specifically, I > want to implement a way to list user-configurable variables and which > one is changed from the default value, by effectively replacing > functionality of defaults/rc.conf with set_rcvar(). > > Use of : ${foo="NO"} idiom after load_rc_config() works as you > pointed out. However, it does not work with listing variables. > Plus, there are many scripts written in an inconsistent way. Some > scripts call load_rc_config() multiple times, some have the idioms > between load_rc_config() and run_rc_command(), and some have them > mistakenly before load_rc_config(). I think this is due to confusion > about how load_rc_config() works and all of them can be > fixed/rewritten consistently of course, but I think gathering > definitions at the head of the scripts and making them being defined > at the end of load_rc_config() as set_rcvar_obsolete() does are more > intuitive. > I'm going to chime in here. I'm equally befuddled because for years (properly understanding load_rc_config()) would just create a file under /etc/rc.conf.d/. There's your stand-in for /etc/defaults/rc.conf right there; a file in the little-known and even less talked-about /etc/rc.conf.d/ directory -- where I believe you it is that one precisely does what it is you're looking for (based on your description). -- Devin From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 05:32:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BEEEF83; Thu, 2 Oct 2014 05:32: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 1C5966EA; Thu, 2 Oct 2014 05:32: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 s925WTVe054902; Thu, 2 Oct 2014 05:32:29 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s925WTHU054901; Thu, 2 Oct 2014 05:32:29 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201410020532.s925WTHU054901@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Thu, 2 Oct 2014 05:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272395 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 05:32:30 -0000 Author: neel Date: Thu Oct 2 05:32:29 2014 New Revision: 272395 URL: https://svnweb.freebsd.org/changeset/base/272395 Log: Get rid of code that dealt with the hardware not being able to save/restore the PAT MSR on guest exit/entry. This workaround was done for a beta release of VMware Fusion 5 but is no longer needed in later versions. All Intel CPUs since Nehalem have supported saving and restoring MSR_PAT in the VM exit and entry controls. Discussed with: grehan Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Thu Oct 2 02:00:21 2014 (r272394) +++ head/sys/amd64/vmm/intel/vmx.c Thu Oct 2 05:32:29 2014 (r272395) @@ -94,23 +94,18 @@ __FBSDID("$FreeBSD$"); #define PROCBASED_CTLS2_ONE_SETTING PROCBASED2_ENABLE_EPT #define PROCBASED_CTLS2_ZERO_SETTING 0 -#define VM_EXIT_CTLS_ONE_SETTING_NO_PAT \ +#define VM_EXIT_CTLS_ONE_SETTING \ (VM_EXIT_HOST_LMA | \ VM_EXIT_SAVE_EFER | \ - VM_EXIT_LOAD_EFER) - -#define VM_EXIT_CTLS_ONE_SETTING \ - (VM_EXIT_CTLS_ONE_SETTING_NO_PAT | \ + VM_EXIT_LOAD_EFER | \ VM_EXIT_ACKNOWLEDGE_INTERRUPT | \ VM_EXIT_SAVE_PAT | \ VM_EXIT_LOAD_PAT) + #define VM_EXIT_CTLS_ZERO_SETTING VM_EXIT_SAVE_DEBUG_CONTROLS -#define VM_ENTRY_CTLS_ONE_SETTING_NO_PAT VM_ENTRY_LOAD_EFER +#define VM_ENTRY_CTLS_ONE_SETTING (VM_ENTRY_LOAD_EFER | VM_ENTRY_LOAD_PAT) -#define VM_ENTRY_CTLS_ONE_SETTING \ - (VM_ENTRY_CTLS_ONE_SETTING_NO_PAT | \ - VM_ENTRY_LOAD_PAT) #define VM_ENTRY_CTLS_ZERO_SETTING \ (VM_ENTRY_LOAD_DEBUG_CONTROLS | \ VM_ENTRY_INTO_SMM | \ @@ -152,10 +147,6 @@ SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, initia */ static SYSCTL_NODE(_hw_vmm_vmx, OID_AUTO, cap, CTLFLAG_RW, NULL, NULL); -static int vmx_patmsr; -SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, patmsr, CTLFLAG_RD, &vmx_patmsr, 0, - "PAT MSR saved and restored in VCMS"); - static int cap_halt_exit; SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, halt_exit, CTLFLAG_RD, &cap_halt_exit, 0, "HLT triggers a VM-exit"); @@ -615,48 +606,24 @@ vmx_init(int ipinum) } /* Check support for VM-exit controls */ - vmx_patmsr = 1; error = vmx_set_ctlreg(MSR_VMX_EXIT_CTLS, MSR_VMX_TRUE_EXIT_CTLS, VM_EXIT_CTLS_ONE_SETTING, VM_EXIT_CTLS_ZERO_SETTING, &exit_ctls); if (error) { - /* Try again without the PAT MSR bits */ - error = vmx_set_ctlreg(MSR_VMX_EXIT_CTLS, - MSR_VMX_TRUE_EXIT_CTLS, - VM_EXIT_CTLS_ONE_SETTING_NO_PAT, - VM_EXIT_CTLS_ZERO_SETTING, - &exit_ctls); - if (error) { - printf("vmx_init: processor does not support desired " - "exit controls\n"); - return (error); - } else { - if (bootverbose) - printf("vmm: PAT MSR access not supported\n"); - vmx_patmsr = 0; - } + printf("vmx_init: processor does not support desired " + "exit controls\n"); + return (error); } /* Check support for VM-entry controls */ - if (vmx_patmsr) { - error = vmx_set_ctlreg(MSR_VMX_ENTRY_CTLS, - MSR_VMX_TRUE_ENTRY_CTLS, - VM_ENTRY_CTLS_ONE_SETTING, - VM_ENTRY_CTLS_ZERO_SETTING, - &entry_ctls); - } else { - error = vmx_set_ctlreg(MSR_VMX_ENTRY_CTLS, - MSR_VMX_TRUE_ENTRY_CTLS, - VM_ENTRY_CTLS_ONE_SETTING_NO_PAT, - VM_ENTRY_CTLS_ZERO_SETTING, - &entry_ctls); - } - + error = vmx_set_ctlreg(MSR_VMX_ENTRY_CTLS, MSR_VMX_TRUE_ENTRY_CTLS, + VM_ENTRY_CTLS_ONE_SETTING, VM_ENTRY_CTLS_ZERO_SETTING, + &entry_ctls); if (error) { printf("vmx_init: processor does not support desired " - "entry controls\n"); - return (error); + "entry controls\n"); + return (error); } /* @@ -889,6 +856,10 @@ vmx_vminit(struct vm *vm, pmap_t pmap) * VM exit and entry respectively. It is also restored from the * host VMCS area on a VM exit. * + * MSR_PAT is saved and restored in the guest VMCS are on a VM exit + * and entry respectively. It is also restored from the host VMCS + * area on a VM exit. + * * The TSC MSR is exposed read-only. Writes are disallowed as that * will impact the host TSC. * XXX Writes would be implemented with a wrmsr trap, and @@ -900,19 +871,10 @@ vmx_vminit(struct vm *vm, pmap_t pmap) guest_msr_rw(vmx, MSR_SYSENTER_ESP_MSR) || guest_msr_rw(vmx, MSR_SYSENTER_EIP_MSR) || guest_msr_rw(vmx, MSR_EFER) || + guest_msr_rw(vmx, MSR_PAT) || guest_msr_ro(vmx, MSR_TSC)) panic("vmx_vminit: error setting guest msr access"); - /* - * MSR_PAT is saved and restored in the guest VMCS are on a VM exit - * and entry respectively. It is also restored from the host VMCS - * area on a VM exit. However, if running on a system with no - * MSR_PAT save/restore support, leave access disabled so accesses - * will be trapped. - */ - if (vmx_patmsr && guest_msr_rw(vmx, MSR_PAT)) - panic("vmx_vminit: error setting guest pat msr access"); - vpid_alloc(vpid, VM_MAXCPU); if (virtual_interrupt_delivery) { From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 05:56:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F03535A; Thu, 2 Oct 2014 05:56: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 8BC428E9; Thu, 2 Oct 2014 05:56: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 s925uIgD064422; Thu, 2 Oct 2014 05:56:18 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s925uIY4064421; Thu, 2 Oct 2014 05:56:18 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201410020556.s925uIY4064421@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 2 Oct 2014 05:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272396 - 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, 02 Oct 2014 05:56:18 -0000 Author: hrs Date: Thu Oct 2 05:56:17 2014 New Revision: 272396 URL: https://svnweb.freebsd.org/changeset/base/272396 Log: Virtualize net.link.vlan.soft_pad. Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Oct 2 05:32:29 2014 (r272395) +++ head/sys/net/if_vlan.c Thu Oct 2 05:56:17 2014 (r272396) @@ -148,9 +148,10 @@ static SYSCTL_NODE(_net_link, IFT_L2VLAN static SYSCTL_NODE(_net_link_vlan, PF_LINK, link, CTLFLAG_RW, 0, "for consistency"); -static int soft_pad = 0; -SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW, &soft_pad, 0, - "pad short frames before tagging"); +static VNET_DEFINE(int, soft_pad); +#define V_soft_pad VNET(soft_pad) +SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(soft_pad), 0, "pad short frames before tagging"); static const char vlanname[] = "vlan"; static MALLOC_DEFINE(M_VLAN, vlanname, "802.1Q Virtual LAN Interface"); @@ -1082,7 +1083,7 @@ vlan_transmit(struct ifnet *ifp, struct * devices that just discard such runts instead or mishandle * them somehow. */ - if (soft_pad && p->if_type == IFT_ETHER) { + if (V_soft_pad && p->if_type == IFT_ETHER) { static char pad[8]; /* just zeros */ int n; From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 06:00:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F200A5AD; Thu, 2 Oct 2014 06:00: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 DE8F098D; Thu, 2 Oct 2014 06:00: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 s9260tGs066201; Thu, 2 Oct 2014 06:00:55 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9260tqI066200; Thu, 2 Oct 2014 06:00:55 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201410020600.s9260tqI066200@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Thu, 2 Oct 2014 06:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272397 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 02 Oct 2014 06:00:56 -0000 Author: ganbold Date: Thu Oct 2 06:00:55 2014 New Revision: 272397 URL: https://svnweb.freebsd.org/changeset/base/272397 Log: Allow timer0 to run at full 24MHz not at 24MHz/16 by setting prescale to 1. Approved by: stas (mentor) Modified: head/sys/arm/allwinner/timer.c Modified: head/sys/arm/allwinner/timer.c ============================================================================== --- head/sys/arm/allwinner/timer.c Thu Oct 2 05:56:17 2014 (r272396) +++ head/sys/arm/allwinner/timer.c Thu Oct 2 06:00:55 2014 (r272397) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #define TIMER_ENABLE (1<<0) #define TIMER_AUTORELOAD (1<<1) #define TIMER_OSC24M (1<<2) /* oscillator = 24mhz */ -#define TIMER_PRESCALAR (4<<4) /* prescalar = 16 */ +#define TIMER_PRESCALAR (0<<4) /* prescalar = 1 */ #define SYS_TIMER_CLKSRC 24000000 /* clock source */ From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 06:29:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD74CF60; Thu, 2 Oct 2014 06:29:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7D26BEE; Thu, 2 Oct 2014 06:29: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 s926Tn4i078871; Thu, 2 Oct 2014 06:29:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s926TnT1078870; Thu, 2 Oct 2014 06:29:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410020629.s926TnT1078870@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 2 Oct 2014 06:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272398 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 02 Oct 2014 06:29:49 -0000 Author: bapt Date: Thu Oct 2 06:29:49 2014 New Revision: 272398 URL: https://svnweb.freebsd.org/changeset/base/272398 Log: Make sure to not skip any argument when converting from deprecated +POS1, -POS2 to -kPOS1,POS2, so that sort +0n gets translated to sort -k1,1n as it is expected PR: 193994 Submitted by: rodrigo MFC after: 3 days Modified: head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Thu Oct 2 06:00:55 2014 (r272397) +++ head/usr.bin/sort/sort.c Thu Oct 2 06:29:49 2014 (r272398) @@ -897,7 +897,7 @@ fix_obsolete_keys(int *argc, char **argv } } } - sprintf(sopt, "-k%d.%d", f1, c1); + sprintf(sopt, "-k%d.%d%s", f1, c1, sopts1); argv[i] = sort_strdup(sopt); } } From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 08:12:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BF2DCF2; Thu, 2 Oct 2014 08:12:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86588A81; Thu, 2 Oct 2014 08:12: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 s928Chd5029803; Thu, 2 Oct 2014 08:12:43 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s928CgKE029799; Thu, 2 Oct 2014 08:12:42 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201410020812.s928CgKE029799@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Thu, 2 Oct 2014 08:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272399 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 08:12:43 -0000 Author: ganbold Date: Thu Oct 2 08:12:42 2014 New Revision: 272399 URL: https://svnweb.freebsd.org/changeset/base/272399 Log: Add uart driver for Qualcomm MSM 7000/8000 series chips. It is working on IFC6410 board which has Qualcomm Snapdragon SoC. Approved by: stas (mentor) Added: head/sys/dev/uart/uart_dev_msm.c (contents, props changed) head/sys/dev/uart/uart_dev_msm.h (contents, props changed) Modified: head/sys/dev/uart/uart.h head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/dev/uart/uart.h ============================================================================== --- head/sys/dev/uart/uart.h Thu Oct 2 06:29:49 2014 (r272398) +++ head/sys/dev/uart/uart.h Thu Oct 2 08:12:42 2014 (r272399) @@ -65,6 +65,7 @@ struct uart_bas { struct uart_class; extern struct uart_class uart_imx_class __attribute__((weak)); +extern struct uart_class uart_msm_class __attribute__((weak)); extern struct uart_class uart_ns8250_class __attribute__((weak)); extern struct uart_class uart_quicc_class __attribute__((weak)); extern struct uart_class uart_s3c2410_class __attribute__((weak)); Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Thu Oct 2 06:29:49 2014 (r272398) +++ head/sys/dev/uart/uart_bus_fdt.c Thu Oct 2 08:12:42 2014 (r272399) @@ -84,6 +84,7 @@ static struct ofw_compat_data compat_dat {"fsl,imx21-uart", (uintptr_t)&uart_imx_class}, {"fsl,mvf600-uart", (uintptr_t)&uart_vybrid_class}, {"lpc,uart", (uintptr_t)&uart_lpc_class}, + {"qcom,uart-dm", (uintptr_t)&uart_msm_class}, {"ti,ns16550", (uintptr_t)&uart_ti8250_class}, {"ns16550", (uintptr_t)&uart_ns8250_class}, {NULL, (uintptr_t)NULL}, Added: head/sys/dev/uart/uart_dev_msm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_dev_msm.c Thu Oct 2 08:12:42 2014 (r272399) @@ -0,0 +1,568 @@ +/*- + * Copyright (c) 2014 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* Qualcomm MSM7K/8K uart driver */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_ddb.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "uart_if.h" + +#define DEF_CLK 7372800 + +#define GETREG(bas, reg) \ + bus_space_read_4((bas)->bst, (bas)->bsh, (reg)) +#define SETREG(bas, reg, value) \ + bus_space_write_4((bas)->bst, (bas)->bsh, (reg), (value)) + +static int msm_uart_param(struct uart_bas *, int, int, int, int); + +/* + * Low-level UART interface. + */ +static int msm_probe(struct uart_bas *bas); +static void msm_init(struct uart_bas *bas, int, int, int, int); +static void msm_term(struct uart_bas *bas); +static void msm_putc(struct uart_bas *bas, int); +static int msm_rxready(struct uart_bas *bas); +static int msm_getc(struct uart_bas *bas, struct mtx *mtx); + +extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; + +static int +msm_uart_param(struct uart_bas *bas, int baudrate, int databits, + int stopbits, int parity) +{ + int ulcon; + + ulcon = 0; + + switch (databits) { + case 5: + ulcon |= (UART_DM_5_BPS << 4); + break; + case 6: + ulcon |= (UART_DM_6_BPS << 4); + break; + case 7: + ulcon |= (UART_DM_7_BPS << 4); + break; + case 8: + ulcon |= (UART_DM_8_BPS << 4); + break; + default: + return (EINVAL); + } + + switch (parity) { + case UART_PARITY_NONE: + ulcon |= UART_DM_NO_PARITY; + break; + case UART_PARITY_ODD: + ulcon |= UART_DM_ODD_PARITY; + break; + case UART_PARITY_EVEN: + ulcon |= UART_DM_EVEN_PARITY; + break; + case UART_PARITY_SPACE: + ulcon |= UART_DM_SPACE_PARITY; + break; + case UART_PARITY_MARK: + default: + return (EINVAL); + } + + switch (stopbits) { + case 1: + ulcon |= (UART_DM_SBL_1 << 2); + break; + case 2: + ulcon |= (UART_DM_SBL_2 << 2); + break; + default: + return (EINVAL); + } + uart_setreg(bas, UART_DM_MR2, ulcon); + + /* Set 115200 for both TX and RX. */; + uart_setreg(bas, UART_DM_CSR, UART_DM_CSR_115200); + uart_barrier(bas); + + return (0); +} + +struct uart_ops uart_msm_ops = { + .probe = msm_probe, + .init = msm_init, + .term = msm_term, + .putc = msm_putc, + .rxready = msm_rxready, + .getc = msm_getc, +}; + +static int +msm_probe(struct uart_bas *bas) +{ + + return (0); +} + +static void +msm_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, + int parity) +{ + + if (bas->rclk == 0) + bas->rclk = DEF_CLK; + + KASSERT(bas->rclk != 0, ("msm_init: Invalid rclk")); + + /* Set default parameters */ + msm_uart_param(bas, baudrate, databits, stopbits, parity); + + /* + * Configure UART mode registers MR1 and MR2. + * Hardware flow control isn't supported. + */ + uart_setreg(bas, UART_DM_MR1, 0x0); + + /* Reset interrupt mask register. */ + uart_setreg(bas, UART_DM_IMR, 0); + + /* + * Configure Tx and Rx watermarks configuration registers. + * TX watermark value is set to 0 - interrupt is generated when + * FIFO level is less than or equal to 0. + */ + uart_setreg(bas, UART_DM_TFWR, UART_DM_TFW_VALUE); + + /* Set RX watermark value */ + uart_setreg(bas, UART_DM_RFWR, UART_DM_RFW_VALUE); + + /* + * Configure Interrupt Programming Register. + * Set initial Stale timeout value. + */ + uart_setreg(bas, UART_DM_IPR, UART_DM_STALE_TIMEOUT_LSB); + + /* Disable IRDA mode */ + uart_setreg(bas, UART_DM_IRDA, 0x0); + + /* + * Configure and enable sim interface if required. + * Configure hunt character value in HCR register. + * Keep it in reset state. + */ + uart_setreg(bas, UART_DM_HCR, 0x0); + + /* Issue soft reset command */ + SETREG(bas, UART_DM_CR, UART_DM_RESET_TX); + SETREG(bas, UART_DM_CR, UART_DM_RESET_RX); + SETREG(bas, UART_DM_CR, UART_DM_RESET_ERROR_STATUS); + SETREG(bas, UART_DM_CR, UART_DM_RESET_BREAK_INT); + SETREG(bas, UART_DM_CR, UART_DM_RESET_STALE_INT); + + /* Enable/Disable Rx/Tx DM interfaces */ + /* Disable Data Mover for now. */ + uart_setreg(bas, UART_DM_DMEN, 0x0); + + /* Enable transmitter and receiver */ + uart_setreg(bas, UART_DM_CR, UART_DM_CR_RX_ENABLE); + uart_setreg(bas, UART_DM_CR, UART_DM_CR_TX_ENABLE); + + uart_barrier(bas); +} + +static void +msm_term(struct uart_bas *bas) +{ + + /* XXX */ +} + +static void +msm_putc(struct uart_bas *bas, int c) +{ + int limit; + + /* + * Write to NO_CHARS_FOR_TX register the number of characters + * to be transmitted. However, before writing TX_FIFO must + * be empty as indicated by TX_READY interrupt in IMR register + */ + + /* + * Check if transmit FIFO is empty. + * If not wait for TX_READY interrupt. + */ + limit = 1000; + if (!(uart_getreg(bas, UART_DM_SR) & UART_DM_SR_TXEMT)) { + while ((uart_getreg(bas, UART_DM_ISR) & UART_DM_TX_READY) == 0 + && --limit) + DELAY(4); + } + /* FIFO is ready, write number of characters to be written */ + uart_setreg(bas, UART_DM_NO_CHARS_FOR_TX, 1); + + /* Wait till TX FIFO has space */ + while ((uart_getreg(bas, UART_DM_SR) & UART_DM_SR_TXRDY) == 0) + DELAY(4); + + /* TX FIFO has space. Write char */ + SETREG(bas, UART_DM_TF(0), (c & 0xff)); +} + +static int +msm_rxready(struct uart_bas *bas) +{ + + /* Wait for a character to come ready */ + return ((uart_getreg(bas, UART_DM_SR) & UART_DM_SR_RXRDY) == + UART_DM_SR_RXRDY); +} + +static int +msm_getc(struct uart_bas *bas, struct mtx *mtx) +{ + int c; + + uart_lock(mtx); + + /* Wait for a character to come ready */ + while ((uart_getreg(bas, UART_DM_SR) & UART_DM_SR_RXRDY) != + UART_DM_SR_RXRDY) + DELAY(4); + + /* Check for Overrun error. If so reset Error Status */ + if (uart_getreg(bas, UART_DM_SR) & UART_DM_SR_UART_OVERRUN) + uart_setreg(bas, UART_DM_CR, UART_DM_RESET_ERROR_STATUS); + + /* Read char */ + c = uart_getreg(bas, UART_DM_RF(0)); + + uart_unlock(mtx); + + return (c); +} + +/* + * High-level UART interface. + */ +struct msm_uart_softc { + struct uart_softc base; + uint32_t ier; +}; + +static int msm_bus_probe(struct uart_softc *sc); +static int msm_bus_attach(struct uart_softc *sc); +static int msm_bus_flush(struct uart_softc *, int); +static int msm_bus_getsig(struct uart_softc *); +static int msm_bus_ioctl(struct uart_softc *, int, intptr_t); +static int msm_bus_ipend(struct uart_softc *); +static int msm_bus_param(struct uart_softc *, int, int, int, int); +static int msm_bus_receive(struct uart_softc *); +static int msm_bus_setsig(struct uart_softc *, int); +static int msm_bus_transmit(struct uart_softc *); +static void msm_bus_grab(struct uart_softc *); +static void msm_bus_ungrab(struct uart_softc *); + +static kobj_method_t msm_methods[] = { + KOBJMETHOD(uart_probe, msm_bus_probe), + KOBJMETHOD(uart_attach, msm_bus_attach), + KOBJMETHOD(uart_flush, msm_bus_flush), + KOBJMETHOD(uart_getsig, msm_bus_getsig), + KOBJMETHOD(uart_ioctl, msm_bus_ioctl), + KOBJMETHOD(uart_ipend, msm_bus_ipend), + KOBJMETHOD(uart_param, msm_bus_param), + KOBJMETHOD(uart_receive, msm_bus_receive), + KOBJMETHOD(uart_setsig, msm_bus_setsig), + KOBJMETHOD(uart_transmit, msm_bus_transmit), + KOBJMETHOD(uart_grab, msm_bus_grab), + KOBJMETHOD(uart_ungrab, msm_bus_ungrab), + {0, 0 } +}; + +int +msm_bus_probe(struct uart_softc *sc) +{ + + sc->sc_txfifosz = 64; + sc->sc_rxfifosz = 64; + + device_set_desc(sc->sc_dev, "Qualcomm HSUART"); + + return (0); +} + +static int +msm_bus_attach(struct uart_softc *sc) +{ + struct msm_uart_softc *u = (struct msm_uart_softc *)sc; + struct uart_bas *bas = &sc->sc_bas; + + sc->sc_hwiflow = 0; + sc->sc_hwoflow = 0; + + /* Set TX_READY, TXLEV, RXLEV, RXSTALE */ + u->ier = UART_DM_IMR_ENABLED; + + /* Configure Interrupt Mask register IMR */ + uart_setreg(bas, UART_DM_IMR, u->ier); + + return (0); +} + +/* + * Write the current transmit buffer to the TX FIFO. + */ +static int +msm_bus_transmit(struct uart_softc *sc) +{ + struct msm_uart_softc *u = (struct msm_uart_softc *)sc; + struct uart_bas *bas = &sc->sc_bas; + int i; + + uart_lock(sc->sc_hwmtx); + + /* Write some data */ + for (i = 0; i < sc->sc_txdatasz; i++) { + /* Write TX data */ + msm_putc(bas, sc->sc_txbuf[i]); + uart_barrier(bas); + } + + /* TX FIFO is empty now, enable TX_READY interrupt */ + u->ier |= UART_DM_TX_READY; + SETREG(bas, UART_DM_IMR, u->ier); + uart_barrier(bas); + + /* + * Inform upper layer that it is transmitting data to hardware, + * this will be cleared when TXIDLE interrupt occurs. + */ + sc->sc_txbusy = 1; + uart_unlock(sc->sc_hwmtx); + + return (0); +} + +static int +msm_bus_setsig(struct uart_softc *sc, int sig) +{ + + return (0); +} + +static int +msm_bus_receive(struct uart_softc *sc) +{ + struct msm_uart_softc *u = (struct msm_uart_softc *)sc; + struct uart_bas *bas; + int c; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + + /* Initialize Receive Path and interrupt */ + SETREG(bas, UART_DM_CR, UART_DM_RESET_STALE_INT); + SETREG(bas, UART_DM_CR, UART_DM_STALE_EVENT_ENABLE); + u->ier |= UART_DM_RXLEV; + SETREG(bas, UART_DM_IMR, u->ier); + + /* Loop over until we are full, or no data is available */ + while (uart_getreg(bas, UART_DM_SR) & UART_DM_SR_RXRDY) { + if (uart_rx_full(sc)) { + /* No space left in input buffer */ + sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; + break; + } + + /* Read RX FIFO */ + c = uart_getreg(bas, UART_DM_RF(0)); + uart_barrier(bas); + + uart_rx_put(sc, c); + } + + uart_unlock(sc->sc_hwmtx); + + return (0); +} + +static int +msm_bus_param(struct uart_softc *sc, int baudrate, int databits, + int stopbits, int parity) +{ + int error; + + if (sc->sc_bas.rclk == 0) + sc->sc_bas.rclk = DEF_CLK; + + KASSERT(sc->sc_bas.rclk != 0, ("msm_init: Invalid rclk")); + + uart_lock(sc->sc_hwmtx); + error = msm_uart_param(&sc->sc_bas, baudrate, databits, stopbits, + parity); + uart_unlock(sc->sc_hwmtx); + + return (error); +} + +static int +msm_bus_ipend(struct uart_softc *sc) +{ + struct msm_uart_softc *u = (struct msm_uart_softc *)sc; + struct uart_bas *bas = &sc->sc_bas; + uint32_t isr; + int ipend; + + uart_lock(sc->sc_hwmtx); + + /* Get ISR status */ + isr = GETREG(bas, UART_DM_MISR); + + ipend = 0; + + /* Uart RX starting, notify upper layer */ + if (isr & UART_DM_RXLEV) { + u->ier &= ~UART_DM_RXLEV; + SETREG(bas, UART_DM_IMR, u->ier); + uart_barrier(bas); + ipend |= SER_INT_RXREADY; + } + + /* Stale RX interrupt */ + if (isr & UART_DM_RXSTALE) { + /* Disable and reset it */ + SETREG(bas, UART_DM_CR, UART_DM_STALE_EVENT_DISABLE); + SETREG(bas, UART_DM_CR, UART_DM_RESET_STALE_INT); + uart_barrier(bas); + ipend |= SER_INT_RXREADY; + } + + /* TX READY interrupt */ + if (isr & UART_DM_TX_READY) { + /* Clear TX Ready */ + SETREG(bas, UART_DM_CR, UART_DM_CLEAR_TX_READY); + + /* Disable TX_READY */ + u->ier &= ~UART_DM_TX_READY; + SETREG(bas, UART_DM_IMR, u->ier); + uart_barrier(bas); + + if (sc->sc_txbusy != 0) + ipend |= SER_INT_TXIDLE; + } + + if (isr & UART_DM_TXLEV) { + /* TX FIFO is empty */ + u->ier &= ~UART_DM_TXLEV; + SETREG(bas, UART_DM_IMR, u->ier); + uart_barrier(bas); + + if (sc->sc_txbusy != 0) + ipend |= SER_INT_TXIDLE; + } + + uart_unlock(sc->sc_hwmtx); + return (ipend); +} + +static int +msm_bus_flush(struct uart_softc *sc, int what) +{ + + return (0); +} + +static int +msm_bus_getsig(struct uart_softc *sc) +{ + + return (0); +} + +static int +msm_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) +{ + + return (EINVAL); +} + +static void +msm_bus_grab(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + + /* + * XXX: Turn off all interrupts to enter polling mode. Leave the + * saved mask alone. We'll restore whatever it was in ungrab. + */ + uart_lock(sc->sc_hwmtx); + SETREG(bas, UART_DM_CR, UART_DM_RESET_STALE_INT); + SETREG(bas, UART_DM_IMR, 0); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} + +static void +msm_bus_ungrab(struct uart_softc *sc) +{ + struct msm_uart_softc *u = (struct msm_uart_softc *)sc; + struct uart_bas *bas = &sc->sc_bas; + + /* + * Restore previous interrupt mask + */ + uart_lock(sc->sc_hwmtx); + SETREG(bas, UART_DM_IMR, u->ier); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} + +struct uart_class uart_msm_class = { + "msm", + msm_methods, + sizeof(struct msm_uart_softc), + .uc_ops = &uart_msm_ops, + .uc_range = 8, + .uc_rclk = DEF_CLK, +}; Added: head/sys/dev/uart/uart_dev_msm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_dev_msm.h Thu Oct 2 08:12:42 2014 (r272399) @@ -0,0 +1,229 @@ +/*- + * Copyright (c) 2014 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _UART_DM_H_ +#define _UART_DM_H_ + +#define UART_DM_EXTR_BITS(value, start_pos, end_pos) \ + ((value << (32 - end_pos)) >> (32 - (end_pos - start_pos))) + +/* UART Parity Mode */ +enum UART_DM_PARITY_MODE { + UART_DM_NO_PARITY, + UART_DM_ODD_PARITY, + UART_DM_EVEN_PARITY, + UART_DM_SPACE_PARITY +}; + +/* UART Stop Bit Length */ +enum UART_DM_STOP_BIT_LEN { + UART_DM_SBL_9_16, + UART_DM_SBL_1, + UART_DM_SBL_1_9_16, + UART_DM_SBL_2 +}; + +/* UART Bits per Char */ +enum UART_DM_BITS_PER_CHAR { + UART_DM_5_BPS, + UART_DM_6_BPS, + UART_DM_7_BPS, + UART_DM_8_BPS +}; + +/* 8-N-1 Configuration */ +#define UART_DM_8_N_1_MODE (UART_DM_NO_PARITY | \ + (UART_DM_SBL_1 << 2) | \ + (UART_DM_8_BPS << 4)) + +/* UART_DM Registers */ + +/* UART Operational Mode Registers (HSUART) */ +#define UART_DM_MR1 0x00 +#define UART_DM_MR1_AUTO_RFR_LEVEL1_BMSK 0xffffff00 +#define UART_DM_MR1_AUTO_RFR_LEVEL0_BMSK 0x3f +#define UART_DM_MR1_CTS_CTL_BMSK 0x40 +#define UART_DM_MR1_RX_RDY_CTL_BMSK 0x80 + +#define UART_DM_MR2 0x04 +#define UART_DM_MR2_ERROR_MODE_BMSK 0x40 +#define UART_DM_MR2_BITS_PER_CHAR_BMSK 0x30 +#define UART_DM_MR2_STOP_BIT_LEN_BMSK 0x0c +#define UART_DM_MR2_PARITY_MODE_BMSK 0x03 +#define UART_DM_RXBRK_ZERO_CHAR_OFF (1 << 8) +#define UART_DM_LOOPBACK (1 << 7) + +/* UART Clock Selection Register, write only */ +#define UART_DM_CSR 0x08 +#define UART_DM_CSR_115200 0xff +#define UART_DM_CSR_57600 0xee +#define UART_DM_CSR_38400 0xdd +#define UART_DM_CSR_28800 0xcc +#define UART_DM_CSR_19200 0xbb +#define UART_DM_CSR_14400 0xaa +#define UART_DM_CSR_9600 0x99 +#define UART_DM_CSR_7200 0x88 +#define UART_DM_CSR_4800 0x77 +#define UART_DM_CSR_3600 0x66 +#define UART_DM_CSR_2400 0x55 +#define UART_DM_CSR_1200 0x44 +#define UART_DM_CSR_600 0x33 +#define UART_DM_CSR_300 0x22 +#define UART_DM_CSR_150 0x11 +#define UART_DM_CSR_75 0x00 + +/* UART DM TX FIFO Registers - 4, write only */ +#define UART_DM_TF(x) (0x70 + (4 * (x))) + +/* UART Command Register, write only */ +#define UART_DM_CR 0x10 +#define UART_DM_CR_RX_ENABLE (1 << 0) +#define UART_DM_CR_RX_DISABLE (1 << 1) +#define UART_DM_CR_TX_ENABLE (1 << 2) +#define UART_DM_CR_TX_DISABLE (1 << 3) + +/* UART_DM_CR channel command bit value (register field is bits 8:4) */ +#define UART_DM_RESET_RX 0x10 +#define UART_DM_RESET_TX 0x20 +#define UART_DM_RESET_ERROR_STATUS 0x30 +#define UART_DM_RESET_BREAK_INT 0x40 +#define UART_DM_START_BREAK 0x50 +#define UART_DM_STOP_BREAK 0x60 +#define UART_DM_RESET_CTS 0x70 +#define UART_DM_RESET_STALE_INT 0x80 +#define UART_DM_RFR_LOW 0xD0 +#define UART_DM_RFR_HIGH 0xE0 +#define UART_DM_CR_PROTECTION_EN 0x100 +#define UART_DM_STALE_EVENT_ENABLE 0x500 +#define UART_DM_STALE_EVENT_DISABLE 0x600 +#define UART_DM_FORCE_STALE_EVENT 0x400 +#define UART_DM_CLEAR_TX_READY 0x300 +#define UART_DM_RESET_TX_ERROR 0x800 +#define UART_DM_RESET_TX_DONE 0x810 + +/* UART Interrupt Mask Register */ +#define UART_DM_IMR 0x14 +/* these can be used for both ISR and IMR registers */ +#define UART_DM_TXLEV (1 << 0) +#define UART_DM_RXHUNT (1 << 1) +#define UART_DM_RXBRK_CHNG (1 << 2) +#define UART_DM_RXSTALE (1 << 3) +#define UART_DM_RXLEV (1 << 4) +#define UART_DM_DELTA_CTS (1 << 5) +#define UART_DM_CURRENT_CTS (1 << 6) +#define UART_DM_TX_READY (1 << 7) +#define UART_DM_TX_ERROR (1 << 8) +#define UART_DM_TX_DONE (1 << 9) +#define UART_DM_RXBREAK_START (1 << 10) +#define UART_DM_RXBREAK_END (1 << 11) +#define UART_DM_PAR_FRAME_ERR_IRQ (1 << 12) + +#define UART_DM_IMR_ENABLED (UART_DM_TX_READY | \ + UART_DM_TXLEV | \ + UART_DM_RXLEV | \ + UART_DM_RXSTALE) + +/* UART Interrupt Programming Register */ +#define UART_DM_IPR 0x18 +#define UART_DM_STALE_TIMEOUT_LSB 0x0f +#define UART_DM_STALE_TIMEOUT_MSB 0x00 +#define UART_DM_IPR_STALE_TIMEOUT_MSB_BMSK 0xffffff80 +#define UART_DM_IPR_STALE_LSB_BMSK 0x1f + +/* UART Transmit/Receive FIFO Watermark Register */ +#define UART_DM_TFWR 0x1c +/* Interrupt is generated when FIFO level is less than or equal to this value */ +#define UART_DM_TFW_VALUE 0 + +#define UART_DM_RFWR 0x20 +/* Interrupt generated when no of words in RX FIFO is greater than this value */ +#define UART_DM_RFW_VALUE 0 + +/* UART Hunt Character Register */ +#define UART_DM_HCR 0x24 + +/* Used for RX transfer initialization */ +#define UART_DM_DMRX 0x34 +/* Default DMRX value - any value bigger than FIFO size would be fine */ +#define UART_DM_DMRX_DEF_VALUE 0x220 + +/* Register to enable IRDA function */ +#define UART_DM_IRDA 0x38 + +/* UART Data Mover Enable Register */ +#define UART_DM_DMEN 0x3c + +/* Number of characters for Transmission */ +#define UART_DM_NO_CHARS_FOR_TX 0x40 + +/* UART RX FIFO Base Address */ +#define UART_DM_BADR 0x44 + +#define UART_DM_SIM_CFG_ADDR 0x80 + +/* Read only registers */ +/* UART Status Register */ +#define UART_DM_SR 0x08 +/* register field mask mapping */ +#define UART_DM_SR_RXRDY (1 << 0) +#define UART_DM_SR_RXFULL (1 << 1) +#define UART_DM_SR_TXRDY (1 << 2) +#define UART_DM_SR_TXEMT (1 << 3) +#define UART_DM_SR_UART_OVERRUN (1 << 4) +#define UART_DM_SR_PAR_FRAME_ERR (1 << 5) +#define UART_DM_RX_BREAK (1 << 6) +#define UART_DM_HUNT_CHAR (1 << 7) +#define UART_DM_RX_BRK_START_LAST (1 << 8) + +/* UART Receive FIFO Registers - 4 in numbers */ +#define UART_DM_RF(x) (0x70 + (4 * (x))) + +/* UART Masked Interrupt Status Register */ +#define UART_DM_MISR 0x10 + +/* UART Interrupt Status Register */ +#define UART_DM_ISR 0x14 + +/* Number of characters received since the end of last RX transfer */ +#define UART_DM_RX_TOTAL_SNAP 0x38 + +/* UART TX FIFO Status Register */ +#define UART_DM_TXFS 0x4c +#define UART_DM_TXFS_STATE_LSB(x) UART_DM_EXTR_BITS(x,0,6) +#define UART_DM_TXFS_STATE_MSB(x) UART_DM_EXTR_BITS(x,14,31) +#define UART_DM_TXFS_BUF_STATE(x) UART_DM_EXTR_BITS(x,7,9) +#define UART_DM_TXFS_ASYNC_STATE(x) UART_DM_EXTR_BITS(x,10,13) + +/* UART RX FIFO Status Register */ +#define UART_DM_RXFS 0x50 +#define UART_DM_RXFS_STATE_LSB(x) UART_DM_EXTR_BITS(x,0,6) +#define UART_DM_RXFS_STATE_MSB(x) UART_DM_EXTR_BITS(x,14,31) +#define UART_DM_RXFS_BUF_STATE(x) UART_DM_EXTR_BITS(x,7,9) +#define UART_DM_RXFS_ASYNC_STATE(x) UART_DM_EXTR_BITS(x,10,13) + +#endif /* _UART_DM_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 08:17:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A389EFBC; Thu, 2 Oct 2014 08:17:21 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B400ACB; Thu, 2 Oct 2014 08:17:21 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XZXaO-000BMn-5J; Thu, 02 Oct 2014 08:01:48 +0400 Message-ID: <542D09CF.5000803@FreeBSD.org> Date: Thu, 02 Oct 2014 12:16:15 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Hiroki Sato , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r272391 - in head/sys: netinet netinet6 References: <201410020025.s920PvEW008958@svn.freebsd.org> In-Reply-To: <201410020025.s920PvEW008958@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: Thu, 02 Oct 2014 08:17:21 -0000 On 02.10.2014 04:25, Hiroki Sato wrote: > Author: hrs > Date: Thu Oct 2 00:25:57 2014 > New Revision: 272391 > URL: https://svnweb.freebsd.org/changeset/base/272391 > > Log: > Add an additional routing table lookup when m->m_pkthdr.fibnum is changed > at a PFIL hook in ip{,6}_output(). IPFW setfib rule did not perform > a routing table lookup when the destination address was not changed. > > CR: D805 > > Modified: > head/sys/netinet/ip_output.c > head/sys/netinet6/ip6_output.c I'm not very happy with this. We already have large conditional for checking if dst has changed, how you have added another conditional for fib.. This idea is quite weird: why should we try to check all this stuff for every packet instead of asking pfil consumers to provide information they already know? We'd better discuss something like M_DSTCHANGED flag instead of doing these hacks. Additionally, you haven't changed "ip_fastfwd" part so the behavior is now inconsistent. > > Modified: head/sys/netinet/ip_output.c > ============================================================================== > --- head/sys/netinet/ip_output.c Thu Oct 2 00:19:24 2014 (r272390) > +++ head/sys/netinet/ip_output.c Thu Oct 2 00:25:57 2014 (r272391) > @@ -136,7 +136,9 @@ ip_output(struct mbuf *m, struct mbuf *o > struct rtentry *rte; /* cache for ro->ro_rt */ > struct in_addr odst; > struct m_tag *fwd_tag = NULL; > + uint32_t fibnum; > int have_ia_ref; > + int needfiblookup; > #ifdef IPSEC > int no_route_but_check_spd = 0; > #endif > @@ -202,6 +204,7 @@ ip_output(struct mbuf *m, struct mbuf *o > * therefore we need restore gw if we're redoing lookup. > */ > gw = dst = (struct sockaddr_in *)&ro->ro_dst; > + fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : M_GETFIB(m); > again: > ia = NULL; > have_ia_ref = 0; > @@ -283,10 +286,9 @@ again: > #ifdef RADIX_MPATH > rtalloc_mpath_fib(ro, > ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr), > - inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); > + fibnum); > #else > - in_rtalloc_ign(ro, 0, > - inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); > + in_rtalloc_ign(ro, 0, fibnum); > #endif > rte = ro->ro_rt; > } > @@ -504,6 +506,7 @@ sendit: > goto done; > > ip = mtod(m, struct ip *); > + needfiblookup = 0; > > /* See if destination IP address was changed by packet filter. */ > if (odst.s_addr != ip->ip_dst.s_addr) { > @@ -529,9 +532,18 @@ sendit: > } else { > if (have_ia_ref) > ifa_free(&ia->ia_ifa); > - goto again; /* Redo the routing table lookup. */ > + needfiblookup = 1; /* Redo the routing table lookup. */ > } > } > + /* See if fib was changed by packet filter. */ > + if (fibnum != M_GETFIB(m)) { > + m->m_flags |= M_SKIP_FIREWALL; > + fibnum = M_GETFIB(m); > + RO_RTFREE(ro); > + needfiblookup = 1; > + } > + if (needfiblookup) > + goto again; > > /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */ > if (m->m_flags & M_FASTFWD_OURS) { > > Modified: head/sys/netinet6/ip6_output.c > ============================================================================== > --- head/sys/netinet6/ip6_output.c Thu Oct 2 00:19:24 2014 (r272390) > +++ head/sys/netinet6/ip6_output.c Thu Oct 2 00:25:57 2014 (r272391) > @@ -255,6 +255,8 @@ ip6_output(struct mbuf *m0, struct ip6_p > struct route_in6 *ro_pmtu = NULL; > int hdrsplit = 0; > int sw_csum, tso; > + int needfiblookup; > + uint32_t fibnum; > struct m_tag *fwd_tag = NULL; > > ip6 = mtod(m, struct ip6_hdr *); > @@ -448,6 +450,7 @@ ip6_output(struct mbuf *m0, struct ip6_p > if (ro->ro_rt == NULL) > (void )flowtable_lookup(AF_INET6, m, (struct route *)ro); > #endif > + fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : M_GETFIB(m); > again: > /* > * if specified, try to fill in the traffic class field. > @@ -489,7 +492,7 @@ again: > dst_sa.sin6_addr = ip6->ip6_dst; > } > error = in6_selectroute_fib(&dst_sa, opt, im6o, ro, &ifp, > - &rt, inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); > + &rt, fibnum); > if (error != 0) { > if (ifp != NULL) > in6_ifstat_inc(ifp, ifs6_out_discard); > @@ -649,7 +652,7 @@ again: > > /* Determine path MTU. */ > if ((error = ip6_getpmtu(ro_pmtu, ro, ifp, &finaldst, &mtu, > - &alwaysfrag, inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m))) != 0) > + &alwaysfrag, fibnum)) != 0) > goto bad; > > /* > @@ -727,6 +730,7 @@ again: > goto done; > ip6 = mtod(m, struct ip6_hdr *); > > + needfiblookup = 0; > /* See if destination IP address was changed by packet filter. */ > if (!IN6_ARE_ADDR_EQUAL(&odst, &ip6->ip6_dst)) { > m->m_flags |= M_SKIP_FIREWALL; > @@ -747,8 +751,17 @@ again: > error = netisr_queue(NETISR_IPV6, m); > goto done; > } else > - goto again; /* Redo the routing table lookup. */ > + needfiblookup = 1; /* Redo the routing table lookup. */ > } > + /* See if fib was changed by packet filter. */ > + if (fibnum != M_GETFIB(m)) { > + m->m_flags |= M_SKIP_FIREWALL; > + fibnum = M_GETFIB(m); > + RO_RTFREE(ro); > + needfiblookup = 1; > + } > + if (needfiblookup) > + goto again; > > /* See if local, if yes, send it to netisr. */ > if (m->m_flags & M_FASTFWD_OURS) { > > From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 09:42:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 462CD772; Thu, 2 Oct 2014 09:42:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26FBD649; Thu, 2 Oct 2014 09:42: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 s929gCfk073412; Thu, 2 Oct 2014 09:42:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s929gCW7073411; Thu, 2 Oct 2014 09:42:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410020942.s929gCW7073411@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 2 Oct 2014 09:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272401 - 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: Thu, 02 Oct 2014 09:42:12 -0000 Author: mav Date: Thu Oct 2 09:42:11 2014 New Revision: 272401 URL: https://svnweb.freebsd.org/changeset/base/272401 Log: Rework the logic of sequential SCSI LUN scanner. Previous logic was not differentiating disconnected LUNs and absent targets. That made it to stop scan if LUN 0 was not found for any reason. That made problematic, for example, using iSCSI targets declaring SPC-2 compliance and having no LUN 0 configured. The new logic continues sequential LUN scan if: -- we have more configured LUNs that need recheck; -- this LUN is connected and its SCSI version allows more LUNs; -- this LUN is disconnected, its SCSI version allows more LUNs and we guess they may be connected (we haven't scanned first 8 LUNs yet or kern.cam.cam_srch_hi sysctl is set to scan more). Reported by: trasz MFC after: 1 month Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Thu Oct 2 08:57:11 2014 (r272400) +++ head/sys/cam/scsi/scsi_xpt.c Thu Oct 2 09:42:11 2014 (r272401) @@ -1135,6 +1135,7 @@ out: u_int8_t periph_qual; path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID; + scsi_find_quirk(path->device); inq_buf = &path->device->inq_data; periph_qual = SID_QUAL(inq_buf); @@ -1163,8 +1164,6 @@ out: goto out; } - scsi_find_quirk(path->device); - scsi_devise_transport(path); if (path->device->lun_id == 0 && @@ -1213,10 +1212,13 @@ out: : SF_RETRY_UA, &softc->saved_ccb) == ERESTART) { goto outr; - } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - /* Don't wedge the queue */ - xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, - /*run_queue*/TRUE); + } else { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + /* Don't wedge the queue */ + xpt_release_devq(done_ccb->ccb_h.path, + /*count*/1, /*run_queue*/TRUE); + } + path->device->flags &= ~CAM_DEV_INQUIRY_DATA_VALID; } /* * If we get to this point, we got an error status back @@ -1975,7 +1977,7 @@ scsi_scan_bus(struct cam_periph *periph, struct cam_path *path, *oldpath; scsi_scan_bus_info *scan_info; struct cam_et *target; - struct cam_ed *device; + struct cam_ed *device, *nextdev; int next_target; path_id_t path_id; target_id_t target_id; @@ -1984,18 +1986,10 @@ scsi_scan_bus(struct cam_periph *periph, oldpath = request_ccb->ccb_h.path; status = cam_ccb_status(request_ccb); - /* Reuse the same CCB to query if a device was really found */ scan_info = (scsi_scan_bus_info *)request_ccb->ccb_h.ppriv_ptr0; - xpt_setup_ccb(&request_ccb->ccb_h, request_ccb->ccb_h.path, - request_ccb->ccb_h.pinfo.priority); - request_ccb->ccb_h.func_code = XPT_GDEV_TYPE; - - path_id = request_ccb->ccb_h.path_id; target_id = request_ccb->ccb_h.target_id; lun_id = request_ccb->ccb_h.target_lun; - xpt_action(request_ccb); - target = request_ccb->ccb_h.path->target; next_target = 1; @@ -2068,56 +2062,36 @@ scsi_scan_bus(struct cam_periph *periph, } } } else { - mtx_unlock(&target->luns_mtx); - if (request_ccb->ccb_h.status != CAM_REQ_CMP) { - int phl; - - /* - * If we already probed lun 0 successfully, or - * we have additional configured luns on this - * target that might have "gone away", go onto - * the next lun. - */ - /* - * We may touch devices that we don't - * hold references too, so ensure they - * don't disappear out from under us. - * The target above is referenced by the - * path in the request ccb. - */ - phl = 0; - device = TAILQ_FIRST(&target->ed_entries); - if (device != NULL) { - phl = CAN_SRCH_HI_SPARSE(device); - if (device->lun_id == 0) - device = TAILQ_NEXT(device, links); - } - if ((lun_id != 0) || (device != NULL)) { - if (lun_id < (CAM_SCSI2_MAXLUN-1) || phl) { - lun_id++; - next_target = 0; - } - } - if (lun_id == request_ccb->ccb_h.target_lun - || lun_id > scan_info->cpi->max_lun) - next_target = 1; - } else { - + mtx_unlock(&target->luns_mtx); device = request_ccb->ccb_h.path->device; - - if ((SCSI_QUIRK(device)->quirks & - CAM_QUIRK_NOLUNS) == 0) { - /* Try the next lun */ - if (lun_id < (CAM_SCSI2_MAXLUN-1) - || CAN_SRCH_HI_DENSE(device)) { - lun_id++; + /* Continue sequential LUN scan if: */ + /* -- we have more LUNs that need recheck */ + mtx_lock(&target->bus->eb_mtx); + nextdev = device; + while ((nextdev = TAILQ_NEXT(nextdev, links)) != NULL) + if ((nextdev->flags & CAM_DEV_UNCONFIGURED) == 0) + break; + mtx_unlock(&target->bus->eb_mtx); + if (nextdev != NULL) { + next_target = 0; + /* -- this LUN is connected and its SCSI version + * allows more LUNs. */ + } else if ((device->flags & CAM_DEV_UNCONFIGURED) == 0) { + if (lun_id < (CAM_SCSI2_MAXLUN-1) || + CAN_SRCH_HI_DENSE(device)) next_target = 0; - } + /* -- this LUN is disconnected, its SCSI version + * allows more LUNs and we guess they may be. */ + } else if ((device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0) { + if (lun_id < (CAM_SCSI2_MAXLUN-1) || + CAN_SRCH_HI_SPARSE(device)) + next_target = 0; + } + if (next_target == 0) { + lun_id++; + if (lun_id > scan_info->cpi->max_lun) + next_target = 1; } - if (lun_id == request_ccb->ccb_h.target_lun - || lun_id > scan_info->cpi->max_lun) - next_target = 1; - } } /* From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 10:02:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4086BDE0; Thu, 2 Oct 2014 10:02:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C4BA8B0; Thu, 2 Oct 2014 10:02: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 s92A2dLM083011; Thu, 2 Oct 2014 10:02:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92A2dS8083010; Thu, 2 Oct 2014 10:02:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410021002.s92A2dS8083010@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 2 Oct 2014 10:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272402 - 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: Thu, 02 Oct 2014 10:02:39 -0000 Author: mav Date: Thu Oct 2 10:02:38 2014 New Revision: 272402 URL: https://svnweb.freebsd.org/changeset/base/272402 Log: Restore CAM_QUIRK_NOLUNS check, lost in previous commit. MFC after: 1 month Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Thu Oct 2 09:42:11 2014 (r272401) +++ head/sys/cam/scsi/scsi_xpt.c Thu Oct 2 10:02:38 2014 (r272402) @@ -2074,6 +2074,9 @@ scsi_scan_bus(struct cam_periph *periph, mtx_unlock(&target->bus->eb_mtx); if (nextdev != NULL) { next_target = 0; + /* -- stop if CAM_QUIRK_NOLUNS is set. */ + } else if (SCSI_QUIRK(device)->quirks & CAM_QUIRK_NOLUNS) { + next_target = 1; /* -- this LUN is connected and its SCSI version * allows more LUNs. */ } else if ((device->flags & CAM_DEV_UNCONFIGURED) == 0) { From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 10:29:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67059462; Thu, 2 Oct 2014 10:29: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 DDA8AB23; Thu, 2 Oct 2014 10:29: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 s92ATpGx089608 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Oct 2014 14:29:51 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s92ATpHY089607; Thu, 2 Oct 2014 14:29:51 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 2 Oct 2014 14:29:51 +0400 From: Gleb Smirnoff To: Hiroki Sato Subject: Re: svn commit: r272386 - in head: sbin/ifconfig share/man/man4 sys/net Message-ID: <20141002102951.GE73266@FreeBSD.org> References: <201410012137.s91LbXL4025967@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201410012137.s91LbXL4025967@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, 02 Oct 2014 10:29:54 -0000 On Wed, Oct 01, 2014 at 09:37:33PM +0000, Hiroki Sato wrote: H> Author: hrs H> Date: Wed Oct 1 21:37:32 2014 H> New Revision: 272386 H> URL: https://svnweb.freebsd.org/changeset/base/272386 H> H> Log: H> Virtualize lagg(4) cloner. This change fixes a panic when tearing down H> if_lagg(4) interfaces which were cloned in a vnet jail. H> H> Sysctl nodes which are dynamically generated for each cloned interface H> (net.link.lagg.N.*) have been removed, and use_flowid and flowid_shift H> ifconfig(8) parameters have been added instead. Flags and per-interface H> statistics counters are displayed in "ifconfig -v". Thanks a lot for this, Hiroki-san! -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 10:30:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F72F5AC; Thu, 2 Oct 2014 10:30:47 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A9063BBE; Thu, 2 Oct 2014 10:30:45 +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 s92AUh7V089634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Oct 2014 14:30:43 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s92AUhGq089633; Thu, 2 Oct 2014 14:30:43 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 2 Oct 2014 14:30:43 +0400 From: Gleb Smirnoff To: Hiroki Sato Subject: Re: svn commit: r272390 - head/sbin/ifconfig Message-ID: <20141002103043.GF73266@FreeBSD.org> References: <201410020019.s920JPp5004430@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201410020019.s920JPp5004430@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, 02 Oct 2014 10:30:47 -0000 On Thu, Oct 02, 2014 at 12:19:25AM +0000, Hiroki Sato wrote: H> Author: hrs H> Date: Thu Oct 2 00:19:24 2014 H> New Revision: 272390 H> URL: https://svnweb.freebsd.org/changeset/base/272390 H> H> Log: H> Add IFCAP_HWSTATS. Actually this flag was a temporary workaround, which I hope to remove soon. There is no reason to display it to userland. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 10:31:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB5356ED; Thu, 2 Oct 2014 10:31:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D577ABC7; Thu, 2 Oct 2014 10:31: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 s92AVX6i096521; Thu, 2 Oct 2014 10:31:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92AVW0d096515; Thu, 2 Oct 2014 10:31:32 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410021031.s92AVW0d096515@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 2 Oct 2014 10:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272403 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 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, 02 Oct 2014 10:31:34 -0000 Author: trasz Date: Thu Oct 2 10:31:32 2014 New Revision: 272403 URL: https://svnweb.freebsd.org/changeset/base/272403 Log: Make autofs timeout handling use timeout task instead of callout; that's because the handler can sleep on sx lock. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs.c head/sys/fs/autofs/autofs.h head/sys/fs/autofs/autofs_vfsops.c head/sys/fs/autofs/autofs_vnops.c Modified: head/sys/fs/autofs/autofs.c ============================================================================== --- head/sys/fs/autofs/autofs.c Thu Oct 2 10:02:38 2014 (r272402) +++ head/sys/fs/autofs/autofs.c Thu Oct 2 10:31:32 2014 (r272403) @@ -76,6 +76,7 @@ #include #include #include +#include #include #include #include @@ -260,7 +261,7 @@ autofs_path(struct autofs_node *anp) } static void -autofs_callout(void *context) +autofs_task(void *context, int pending) { struct autofs_request *ar; @@ -414,9 +415,14 @@ autofs_trigger_one(struct autofs_node *a strlcpy(ar->ar_options, amp->am_options, sizeof(ar->ar_options)); - callout_init(&ar->ar_callout, 1); - callout_reset(&ar->ar_callout, - autofs_timeout * hz, autofs_callout, ar); + TIMEOUT_TASK_INIT(taskqueue_thread, &ar->ar_task, 0, + autofs_task, ar); + error = taskqueue_enqueue_timeout(taskqueue_thread, + &ar->ar_task, autofs_timeout * hz); + if (error != 0) { + AUTOFS_WARN("taskqueue_enqueue_timeout() failed " + "with error %d", error); + } refcount_init(&ar->ar_refcount, 1); TAILQ_INSERT_TAIL(&autofs_softc->sc_requests, ar, ar_next); } @@ -451,7 +457,8 @@ autofs_trigger_one(struct autofs_node *a * XXX: Is it safe? */ sx_xunlock(&autofs_softc->sc_lock); - callout_drain(&ar->ar_callout); + taskqueue_cancel_timeout(taskqueue_thread, &ar->ar_task, NULL); + taskqueue_drain_timeout(taskqueue_thread, &ar->ar_task); sx_xlock(&autofs_softc->sc_lock); uma_zfree(autofs_request_zone, ar); } Modified: head/sys/fs/autofs/autofs.h ============================================================================== --- head/sys/fs/autofs/autofs.h Thu Oct 2 10:02:38 2014 (r272402) +++ head/sys/fs/autofs/autofs.h Thu Oct 2 10:31:32 2014 (r272403) @@ -97,7 +97,7 @@ struct autofs_request { char ar_prefix[MAXPATHLEN]; char ar_key[MAXPATHLEN]; char ar_options[MAXPATHLEN]; - struct callout ar_callout; + struct timeout_task ar_task; volatile u_int ar_refcount; }; Modified: head/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- head/sys/fs/autofs/autofs_vfsops.c Thu Oct 2 10:02:38 2014 (r272402) +++ head/sys/fs/autofs/autofs_vfsops.c Thu Oct 2 10:31:32 2014 (r272403) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Thu Oct 2 10:02:38 2014 (r272402) +++ head/sys/fs/autofs/autofs_vnops.c Thu Oct 2 10:31:32 2014 (r272403) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 10:32:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CD1F841; Thu, 2 Oct 2014 10:32: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 7DC99BD5; Thu, 2 Oct 2014 10:32: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 s92AWPg6097132; Thu, 2 Oct 2014 10:32:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92AWOGn097128; Thu, 2 Oct 2014 10:32:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201410021032.s92AWOGn097128@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 2 Oct 2014 10:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272404 - 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: Thu, 02 Oct 2014 10:32:25 -0000 Author: tuexen Date: Thu Oct 2 10:32:24 2014 New Revision: 272404 URL: https://svnweb.freebsd.org/changeset/base/272404 Log: Fix the checksum computation for UDPLite/IPv6. This requires the usage of a function computing the checksum only over a part of the function. Therefore introduce in6_cksum_partial() and implement in6_cksum() based on that. While there, ensure that the UDPLite packet contains at least enough bytes to contain the header. Reviewed by: kevlo MFC after: 3 days Modified: head/sys/netinet6/in6.h head/sys/netinet6/in6_cksum.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Thu Oct 2 10:31:32 2014 (r272403) +++ head/sys/netinet6/in6.h Thu Oct 2 10:32:24 2014 (r272404) @@ -647,6 +647,8 @@ struct ip6_hdr; int in6_cksum_pseudo(struct ip6_hdr *, uint32_t, uint8_t, uint16_t); int in6_cksum(struct mbuf *, u_int8_t, u_int32_t, u_int32_t); +int in6_cksum_partial(struct mbuf *, u_int8_t, u_int32_t, u_int32_t, + u_int32_t); int in6_localaddr(struct in6_addr *); int in6_localip(struct in6_addr *); int in6_addrscope(const struct in6_addr *); Modified: head/sys/netinet6/in6_cksum.c ============================================================================== --- head/sys/netinet6/in6_cksum.c Thu Oct 2 10:31:32 2014 (r272403) +++ head/sys/netinet6/in6_cksum.c Thu Oct 2 10:32:24 2014 (r272404) @@ -145,9 +145,11 @@ in6_cksum_pseudo(struct ip6_hdr *ip6, ui * off is an offset where TCP/UDP/ICMP6 header starts. * len is a total length of a transport segment. * (e.g. TCP header + TCP payload) + * cov is the number of bytes to be taken into account for the checksum */ int -in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len) +in6_cksum_partial(struct mbuf *m, u_int8_t nxt, u_int32_t off, + u_int32_t len, u_int32_t cov) { struct ip6_hdr *ip6; u_int16_t *w, scope; @@ -215,9 +217,9 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, } w = (u_int16_t *)(mtod(m, u_char *) + off); mlen = m->m_len - off; - if (len < mlen) - mlen = len; - len -= mlen; + if (cov < mlen) + mlen = cov; + cov -= mlen; /* * Force to even boundary. */ @@ -273,7 +275,7 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, * Lastly calculate a summary of the rest of mbufs. */ - for (;m && len; m = m->m_next) { + for (;m && cov; m = m->m_next) { if (m->m_len == 0) continue; w = mtod(m, u_int16_t *); @@ -290,12 +292,12 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, sum += s_util.s; w = (u_int16_t *)((char *)w + 1); mlen = m->m_len - 1; - len--; + cov--; } else mlen = m->m_len; - if (len < mlen) - mlen = len; - len -= mlen; + if (cov < mlen) + mlen = cov; + cov -= mlen; /* * Force to even boundary. */ @@ -343,7 +345,7 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, } else if (mlen == -1) s_util.c[0] = *(char *)w; } - if (len) + if (cov) panic("in6_cksum: out of data"); if (mlen == -1) { /* The last mbuf has odd # of bytes. Follow the @@ -355,3 +357,9 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, REDUCE; return (~sum & 0xffff); } + +int +in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len) +{ + return (in6_cksum_partial(m, nxt, off, len, len)); +} Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Oct 2 10:31:32 2014 (r272403) +++ head/sys/netinet6/udp6_usrreq.c Thu Oct 2 10:32:24 2014 (r272404) @@ -227,11 +227,16 @@ udp6_input(struct mbuf **mp, int *offp, nxt = ip6->ip6_nxt; cscov_partial = (nxt == IPPROTO_UDPLITE) ? 1 : 0; - if (nxt == IPPROTO_UDPLITE && (ulen == 0 || ulen == plen)) { + if (nxt == IPPROTO_UDPLITE) { /* Zero means checksum over the complete packet. */ if (ulen == 0) ulen = plen; - cscov_partial = 0; + if (ulen == plen) + cscov_partial = 0; + if ((ulen < sizeof(struct udphdr)) || (ulen > plen)) { + /* XXX: What is the right UDPLite MIB counter? */ + goto badunlocked; + } } if (nxt == IPPROTO_UDP && plen != ulen) { UDPSTAT_INC(udps_badlen); @@ -257,7 +262,7 @@ udp6_input(struct mbuf **mp, int *offp, m->m_pkthdr.csum_data); uh_sum ^= 0xffff; } else - uh_sum = in6_cksum(m, nxt, off, ulen); + uh_sum = in6_cksum_partial(m, nxt, off, plen, ulen); if (uh_sum != 0) { UDPSTAT_INC(udps_badsum); @@ -844,8 +849,8 @@ udp6_output(struct inpcb *inp, struct mb ip6->ip6_dst = *faddr; if (cscov_partial) { - if ((udp6->uh_sum = in6_cksum(m, 0, - sizeof(struct ip6_hdr), cscov)) == 0) + if ((udp6->uh_sum = in6_cksum_partial(m, nxt, + sizeof(struct ip6_hdr), plen, cscov)) == 0) udp6->uh_sum = 0xffff; } else { udp6->uh_sum = in6_cksum_pseudo(ip6, plen, nxt, 0); From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 10:32:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9FD0842; Thu, 2 Oct 2014 10:32:25 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D60FBD4; Thu, 2 Oct 2014 10:32:24 +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 s92AWMtX089656 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Oct 2014 14:32:22 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s92AWM0L089655; Thu, 2 Oct 2014 14:32:22 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 2 Oct 2014 14:32:22 +0400 From: Gleb Smirnoff To: "Alexander V. Chernikov" Subject: Re: svn commit: r272391 - in head/sys: netinet netinet6 Message-ID: <20141002103222.GG73266@FreeBSD.org> References: <201410020025.s920PvEW008958@svn.freebsd.org> <542D09CF.5000803@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <542D09CF.5000803@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , 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, 02 Oct 2014 10:32:25 -0000 On Thu, Oct 02, 2014 at 12:16:15PM +0400, Alexander V. Chernikov wrote: A> On 02.10.2014 04:25, Hiroki Sato wrote: A> > Author: hrs A> > Date: Thu Oct 2 00:25:57 2014 A> > New Revision: 272391 A> > URL: https://svnweb.freebsd.org/changeset/base/272391 A> > A> > Log: A> > Add an additional routing table lookup when m->m_pkthdr.fibnum is changed A> > at a PFIL hook in ip{,6}_output(). IPFW setfib rule did not perform A> > a routing table lookup when the destination address was not changed. A> > A> > CR: D805 A> > A> > Modified: A> > head/sys/netinet/ip_output.c A> > head/sys/netinet6/ip6_output.c A> I'm not very happy with this. A> We already have large conditional for checking if dst has changed, how A> you have added another conditional for fib.. A> This idea is quite weird: why should we try to check all this stuff for A> every packet instead of asking pfil consumers A> to provide information they already know? A> A> We'd better discuss something like M_DSTCHANGED flag instead of doing A> these hacks. And here you suggest to abuse mbuf flags to merely carry return value of a pfil hook :) -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 10:35:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F73BB01; Thu, 2 Oct 2014 10:35:59 +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 3C4DBBF3; Thu, 2 Oct 2014 10:35:58 +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 s92AZuEF089724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Oct 2014 14:35:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s92AZuj9089723; Thu, 2 Oct 2014 14:35:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 2 Oct 2014 14:35:56 +0400 From: Gleb Smirnoff To: Edward Tomasz Napierala , kib@FreeBSD.org Subject: Re: svn commit: r272403 - head/sys/fs/autofs Message-ID: <20141002103556.GH73266@FreeBSD.org> References: <201410021031.s92AVW0d096515@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201410021031.s92AVW0d096515@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, 02 Oct 2014 10:35:59 -0000 On Thu, Oct 02, 2014 at 10:31:32AM +0000, Edward Tomasz Napierala wrote: E> Author: trasz E> Date: Thu Oct 2 10:31:32 2014 E> New Revision: 272403 E> URL: https://svnweb.freebsd.org/changeset/base/272403 E> E> Log: E> Make autofs timeout handling use timeout task instead of callout; E> that's because the handler can sleep on sx lock. How long can it sleep? AFAIU, the taskqueue_thread is used by other subsystems. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 10:37:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B27D8C58; Thu, 2 Oct 2014 10:37:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ECF2C0C; Thu, 2 Oct 2014 10:37: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 s92AbvV1097856; Thu, 2 Oct 2014 10:37:57 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92AbvE3097855; Thu, 2 Oct 2014 10:37:57 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410021037.s92AbvE3097855@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 2 Oct 2014 10:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272405 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 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, 02 Oct 2014 10:37:57 -0000 Author: trasz Date: Thu Oct 2 10:37:56 2014 New Revision: 272405 URL: https://svnweb.freebsd.org/changeset/base/272405 Log: Call uma_zfree() outside of lock, and improve comment. Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs.c Modified: head/sys/fs/autofs/autofs.c ============================================================================== --- head/sys/fs/autofs/autofs.c Thu Oct 2 10:32:24 2014 (r272404) +++ head/sys/fs/autofs/autofs.c Thu Oct 2 10:37:56 2014 (r272405) @@ -454,13 +454,13 @@ autofs_trigger_one(struct autofs_node *a if (last) { TAILQ_REMOVE(&autofs_softc->sc_requests, ar, ar_next); /* - * XXX: Is it safe? + * Unlock the sc_lock, so that autofs_task() can complete. */ sx_xunlock(&autofs_softc->sc_lock); taskqueue_cancel_timeout(taskqueue_thread, &ar->ar_task, NULL); taskqueue_drain_timeout(taskqueue_thread, &ar->ar_task); - sx_xlock(&autofs_softc->sc_lock); uma_zfree(autofs_request_zone, ar); + sx_xlock(&autofs_softc->sc_lock); } /* From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 10:39:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15AEEDA1; Thu, 2 Oct 2014 10:39:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDBEFC14; Thu, 2 Oct 2014 10:39: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 s92Ad7Kg098063; Thu, 2 Oct 2014 10:39:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92Ad7GF098062; Thu, 2 Oct 2014 10:39:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410021039.s92Ad7GF098062@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 2 Oct 2014 10:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272406 - 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: Thu, 02 Oct 2014 10:39:08 -0000 Author: mav Date: Thu Oct 2 10:39:07 2014 New Revision: 272406 URL: https://svnweb.freebsd.org/changeset/base/272406 Log: Make disconnected LUN 0 don't remain in half-configured state if there are no LUNs on SPC-3 target after we tried REPORT LUNS. Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Thu Oct 2 10:37:56 2014 (r272405) +++ head/sys/cam/scsi/scsi_xpt.c Thu Oct 2 10:39:07 2014 (r272406) @@ -1194,12 +1194,6 @@ out: SID_ANSI_REV(inq_buf) > SCSI_REV_SPC2 && (SCSI_QUIRK(path->device)->quirks & CAM_QUIRK_NORPTLUNS) == 0) { - if (path->device->flags & - CAM_DEV_UNCONFIGURED) { - path->device->flags &= - ~CAM_DEV_UNCONFIGURED; - xpt_acquire_device(path->device); - } PROBE_SET_ACTION(softc, PROBE_REPORT_LUNS); periph->path->target->rpl_size = 16; xpt_release_ccb(done_ccb); @@ -1310,14 +1304,6 @@ out: tlun, 8); CAM_DEBUG(path, CAM_DEBUG_PROBE, ("lun 0 in position %u\n", idx)); - } else { - /* - * There is no lun 0 in our list. Destroy - * the validity of the inquiry data so we - * bail here and now. - */ - path->device->flags &= - ~CAM_DEV_INQUIRY_DATA_VALID; } } /* @@ -1330,7 +1316,8 @@ out: probe_purge_old(path, lp, softc->flags); lp = NULL; } - if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) { + if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID && + SID_QUAL(&path->device->inq_data) == SID_QUAL_LU_CONNECTED) { struct scsi_inquiry_data *inq_buf; inq_buf = &path->device->inq_data; if (INQ_DATA_TQ_ENABLED(inq_buf)) @@ -1345,6 +1332,8 @@ out: if (lp) { free(lp, M_CAMXPT); } + PROBE_SET_ACTION(softc, PROBE_INVALID); + xpt_release_ccb(done_ccb); break; } case PROBE_MODE_SENSE: From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 10:49:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B8E223E; Thu, 2 Oct 2014 10:49:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77D14CF6; Thu, 2 Oct 2014 10:49: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 s92An26r002942; Thu, 2 Oct 2014 10:49:02 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92An2Mk002941; Thu, 2 Oct 2014 10:49:02 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201410021049.s92An2Mk002941@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 2 Oct 2014 10:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272408 - 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: Thu, 02 Oct 2014 10:49:02 -0000 Author: tuexen Date: Thu Oct 2 10:49:01 2014 New Revision: 272408 URL: https://svnweb.freebsd.org/changeset/base/272408 Log: Check for UDP/IPv6 packets that the length in the UDP header is at least the minimum. Make the check similar to the one for UDPLite/IPv6. MFC after: 3 days Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Oct 2 10:46:12 2014 (r272407) +++ head/sys/netinet6/udp6_usrreq.c Thu Oct 2 10:49:01 2014 (r272408) @@ -237,18 +237,9 @@ udp6_input(struct mbuf **mp, int *offp, /* XXX: What is the right UDPLite MIB counter? */ goto badunlocked; } - } - if (nxt == IPPROTO_UDP && plen != ulen) { - UDPSTAT_INC(udps_badlen); - goto badunlocked; - } - - /* - * Checksum extended UDP header and data. - */ - if (uh->uh_sum == 0) { - if (ulen > plen || ulen < sizeof(struct udphdr)) { - UDPSTAT_INC(udps_nosum); + } else { + if ((ulen < sizeof(struct udphdr)) || (plen != ulen)) { + UDPSTAT_INC(udps_badlen); goto badunlocked; } } From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 10:58:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E15053F; Thu, 2 Oct 2014 10:58:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A9FDDD9; Thu, 2 Oct 2014 10:58: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 s92Awr05007651; Thu, 2 Oct 2014 10:58:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92AwraG007650; Thu, 2 Oct 2014 10:58:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201410021058.s92AwraG007650@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 2 Oct 2014 10:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272409 - 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: Thu, 02 Oct 2014 10:58:53 -0000 Author: mav Date: Thu Oct 2 10:58:52 2014 New Revision: 272409 URL: https://svnweb.freebsd.org/changeset/base/272409 Log: Use REPORT LUNS command for SPC-2 devices with LUN 0 disconnected. SPC-2 tells REPORT LUNS shall be supported by devices supporting LUNs other then LUN 0. If we see LUN 0 disconnected, guess there may be others, and so REPORT LUNS shall be supported. MFC after: 1 month Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Thu Oct 2 10:49:01 2014 (r272408) +++ head/sys/cam/scsi/scsi_xpt.c Thu Oct 2 10:58:52 2014 (r272409) @@ -1191,7 +1191,7 @@ out: xpt_schedule(periph, priority); goto out; } else if (path->device->lun_id == 0 && - SID_ANSI_REV(inq_buf) > SCSI_REV_SPC2 && + SID_ANSI_REV(inq_buf) >= SCSI_REV_SPC2 && (SCSI_QUIRK(path->device)->quirks & CAM_QUIRK_NORPTLUNS) == 0) { PROBE_SET_ACTION(softc, PROBE_REPORT_LUNS); From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 12:27:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3206BEAB; Thu, 2 Oct 2014 12:27: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 03B8BA09; Thu, 2 Oct 2014 12:27: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 s92CRgCV052415; Thu, 2 Oct 2014 12:27:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92CRgFK052409; Thu, 2 Oct 2014 12:27:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410021227.s92CRgFK052409@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 2 Oct 2014 12:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272410 - in head: share/man/man4 sys/dev/usb sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 02 Oct 2014 12:27:43 -0000 Author: hselasky Date: Thu Oct 2 12:27:41 2014 New Revision: 272410 URL: https://svnweb.freebsd.org/changeset/base/272410 Log: Add new USB ID. PR: 194091 MFC after: 3 days Modified: head/share/man/man4/urtwn.4 head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_urtwn.c Modified: head/share/man/man4/urtwn.4 ============================================================================== --- head/share/man/man4/urtwn.4 Thu Oct 2 10:58:52 2014 (r272409) +++ head/share/man/man4/urtwn.4 Thu Oct 2 12:27:41 2014 (r272410) @@ -19,7 +19,7 @@ .Os .Sh NAME .Nm urtwn -.Nd Realtek RTL8188CU/RTL8188EU/RTL8192CU USB IEEE 802.11b/g/n wireless network device +.Nd Realtek RTL8188CU/RTL8188RU/RTL8188EU/RTL8192CU USB IEEE 802.11b/g/n wireless network device .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -82,10 +82,11 @@ firmware license .Sh HARDWARE The .Nm -driver supports Realtek RTL8188CU/RTL8188EU/RTL8192CU based USB +driver supports Realtek RTL8188CU/RTL8188RU/RTL8188EU/RTL8192CU based USB IEEE 802.11b/g/n wireless network adapters, including: .Pp .Bl -tag -width Ds -offset indent -compact +.It Alfa AWUS036NHR v2 .It ASUS USB-N10 NANO .It Belkin F7D1102 Surf Wireless Micro .It D-Link DWA-125 rev D1 Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Oct 2 10:58:52 2014 (r272409) +++ head/sys/dev/usb/usbdevs Thu Oct 2 12:27:41 2014 (r272410) @@ -3717,6 +3717,7 @@ product REALTEK RTL8191CU 0x8177 RTL8191 product REALTEK RTL8192CU 0x8178 RTL8192CU product REALTEK RTL8192CE 0x817c RTL8192CE product REALTEK RTL8188RU_1 0x817d RTL8188RU +product REALTEK RTL8188RU_3 0x817f RTL8188RU product REALTEK RTL8712 0x8712 RTL8712 product REALTEK RTL8713 0x8712 RTL8713 product REALTEK RTL8188RU_2 0x317f RTL8188RU Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Thu Oct 2 10:58:52 2014 (r272409) +++ head/sys/dev/usb/wlan/if_urtwn.c Thu Oct 2 12:27:41 2014 (r272410) @@ -141,6 +141,7 @@ static const STRUCT_USB_HOST_ID urtwn_de URTWN_DEV(REALTEK, RTL8188CUS), URTWN_DEV(REALTEK, RTL8188RU_1), URTWN_DEV(REALTEK, RTL8188RU_2), + URTWN_DEV(REALTEK, RTL8188RU_3), URTWN_DEV(REALTEK, RTL8191CU), URTWN_DEV(REALTEK, RTL8192CE), URTWN_DEV(REALTEK, RTL8192CU), From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 14:44:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84E68973; Thu, 2 Oct 2014 14:44:03 +0000 (UTC) Received: from mail-ig0-x230.google.com (mail-ig0-x230.google.com [IPv6:2607:f8b0:4001:c05::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38A01CB9; Thu, 2 Oct 2014 14:44:03 +0000 (UTC) Received: by mail-ig0-f176.google.com with SMTP id hn15so1482809igb.3 for ; Thu, 02 Oct 2014 07:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=ZUmUX7OSZvYZNcuIkV+Y7gWkFmhC0taLNeUeHXWUerE=; b=0mDIkjVgvPajVDY3EGUB+IOmlC1Lwwv5oGSPVJ7tsFz2FDOFmPq1e4V+w2PRJEmYh0 62KYS4Hl/r+FFHcCW7WJzJIqbsWRMpH851DjHhQV5YdGa4qO+K94OR0ekczgDoDrz4IF QscfB90ZNxS0WysikGuny+utgp+D/OvFucdKOKiChzs9xrSX4Y8gnK2zOKnKQlARlRjP eDJYBK43jNh7FKxVwODi/xXOdESC/vCUDi7DQHu8bcbFbsqgjZqkr7c67sTp7l4gyTnk BUZ4PtwiqnVB1qNiCvSLeNX57iLPUrmzUyiAaThGk+XZMr7OokeYZwFySbPTxP5s/RKw 1/eg== X-Received: by 10.50.142.97 with SMTP id rv1mr5336077igb.11.1412261042546; Thu, 02 Oct 2014 07:44:02 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.44.196 with HTTP; Thu, 2 Oct 2014 07:43:42 -0700 (PDT) In-Reply-To: <201410012103.s91L3HR0010906@svn.freebsd.org> References: <201410012103.s91L3HR0010906@svn.freebsd.org> From: Ed Maste Date: Thu, 2 Oct 2014 10:43:42 -0400 X-Google-Sender-Auth: sctHYZ9w8Sd0Fi-2UlzKdT3hbTs Message-ID: Subject: Re: svn commit: r272384 - head/usr.bin/mkimg To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 14:44:03 -0000 On 1 October 2014 17:03, Marcel Moolenaar wrote: > Improve performance of mking(1) by keeping a list of "chunks" in memory, > that keeps track of a particular region of the image. Nice work, thanks Marcel! I've been using brooks' NO_ROOT support along with makefs / mkimg to build and test changes by creating an image to boot in QEMU. This change provides a noticeable improvement in the cycle time. From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 15:03:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 164B838A; Thu, 2 Oct 2014 15:03:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02D28F34; Thu, 2 Oct 2014 15:03: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 s92F3pOw027838; Thu, 2 Oct 2014 15:03:51 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92F3p6B027837; Thu, 2 Oct 2014 15:03:51 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201410021503.s92F3p6B027837@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 2 Oct 2014 15:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272411 - 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: Thu, 02 Oct 2014 15:03:52 -0000 Author: gnn Date: Thu Oct 2 15:03:51 2014 New Revision: 272411 URL: https://svnweb.freebsd.org/changeset/base/272411 Log: Properly handle a case that should never happen (the bus_dma callback being called with error set to non-zero). Modified: head/sys/dev/sfxge/sfxge_dma.c Modified: head/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- head/sys/dev/sfxge/sfxge_dma.c Thu Oct 2 12:27:41 2014 (r272410) +++ head/sys/dev/sfxge/sfxge_dma.c Thu Oct 2 15:03:51 2014 (r272411) @@ -164,11 +164,14 @@ sfxge_dma_alloc(struct sfxge_softc *sc, /* * The callback gets error information about the mapping - * and will have set our vaddr to NULL if something went + * and will have set esm_addr to 0 if something went * wrong. */ - if (vaddr == NULL) + if (esmp->esm_addr == 0) { + bus_dmamem_free(esmp->esm_tag, esmp->esm_base, esmp->esm_map); + bus_dma_tag_destroy(esmp->esm_tag); return (ENOMEM); + } esmp->esm_base = vaddr; From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 16:13:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42ED734C; Thu, 2 Oct 2014 16:13: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 2D4579FD; Thu, 2 Oct 2014 16:13: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 s92GDEXf062311; Thu, 2 Oct 2014 16:13:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92GDCX9062300; Thu, 2 Oct 2014 16:13:12 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201410021613.s92GDCX9062300@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 2 Oct 2014 16:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272414 - in head: release release/amd64 release/i386 share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 16:13:14 -0000 Author: gjb Date: Thu Oct 2 16:13:12 2014 New Revision: 272414 URL: https://svnweb.freebsd.org/changeset/base/272414 Log: Merge the following revisions from ^/projects/release-vmimage: r272234, r272236, r272262, r272264, r272269, r272271, r272272, r272277, r272279, r272376, r272380, r272381, r272392, r272234, r272412: r272234: Initial commit to include virtual machine images as part of the FreeBSD release builds. This adds a make(1) environment variable requirement, WITH_VMIMAGES, which triggers the virtual machine image targets when not defined to an empty value. Relevant user-driven variables include: o VMFORMATS: The virtual machine image formats to create. Valid formats are provided by running 'mkimg --formats' o VMSIZE: The size of the resulting virtual machine image. Typical compression is roughly 140Mb, regardless of the target size (10GB, 15GB, 20GB, 40GB sizes have been tested with the same result). o VMBASE: The prefix of the virtual machine disk images. The VMBASE make(1) environment variable is suffixed with each format in VMFORMATS for each individual disk image, as well as '.img' for the source UFS filesystem passed to mkimg(1). This also includes a new script, mk-vmimage.sh, based on how the VM images for 10.0-RELEASE, 9.3-RELEASE, and 10.1-RELEASE were created (mk-vmimage.sh in ^/user/gjb/thermite/). With the order in which the stages need to occur, as well as sanity-checking error cases, it makes much more sense to execute a shell script called from make(1), using env(1) to set specific parameters for the target image than it does to do this in make(1) directly. r272236: Use VMBASE in place of a hard-coded filename in the CLEANFILES list. r272262: Remove a 'set -x' that snuck in during testing. r272264: release/Makefile: Connect the virtual machine image build to the release target if WITH_VMIMAGES is set to a non-empty value. release/release.sh: Add WITH_VMIMAGES to RELEASE_RMAKEFLAGS. release/release.conf.sample: Add commented entries for tuning the release build if the WITH_VMIMAGES make(1) environment variable is set to a non-empty value. r272269: release/Makefile: Include .OBJDIR in DESTDIR in the vm-base target. release/release.sh: Provide the full path to mddev. r272271: Fix UFS label for the root filesystem. r272272: Remove comments left in accidentally while testing, so the VM /etc/fstab is actually created. r272277: Remove the UFS label from the root filesystem since it is added by mkimg(1) as a gpt label, consistent with the fstab(5) entry. r272279: Comment cleanup in panic() message when mkimg(1) does not support the requested disk image format. r272376: Separate release/scripts/mk-vmimage.sh to machine-specific scripts, making it possible to mimic the functionality for non-x86 targets. Move echo output if MAKEFLAGS is empty outside of usage(). Remove TARGET/TARGET_ARCH evaluation. r272380: Avoid using env(1) to set values passed to mk-vmimage.sh, and instead pass the values as arguments to the script, making it easier to run this by hand, without 'make release'. Add usage_vm_base() and usage_vm_image() usage helpers. r272381: After evaluating WITH_VMIMAGES is non-empty, ensure the mk-vmimage.sh script exists before running it. r272392: Add WITH_COMPRESSED_VMIMAGES variable, which when set enables xz(1) compression of the virtual machine images. This is intentionally separate to allow more fine-grained tuning over which images are compressed, especially in cases where compressing 20GB sparse images can take hours. r272412: Document the new 'vm-image' target, and associated release.conf variables. r272413: Remove two stray comments added during the initial iterations of testing, no longer needed. MFC after: 5 days X-MFC-10.1: yes Tested on: r272269, r272272, r272279, r272380, r272392 Sponsored by: The FreeBSD Foundation Added: head/release/amd64/mk-vmimage.sh - copied, changed from r272376, projects/release-vmimage/release/amd64/mk-vmimage.sh head/release/i386/mk-vmimage.sh - copied, changed from r272376, projects/release-vmimage/release/i386/mk-vmimage.sh Modified: head/release/Makefile head/release/release.conf.sample head/release/release.sh head/share/man/man7/release.7 Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Thu Oct 2 16:05:01 2014 (r272413) +++ head/release/Makefile Thu Oct 2 16:13:12 2014 (r272414) @@ -23,6 +23,9 @@ # WITH_DVD: if set, generate dvd1.iso # WITH_COMPRESSED_IMAGES: if set, compress installation images with xz(1) # (uncompressed images are not removed) +# WITH_VMIMAGES: if set, build virtual machine images with the release +# WITH_COMPRESSED_VMIMAGES: if set, compress virtual machine disk images +# with xz(1) (extremely time consuming) # TARGET/TARGET_ARCH: architecture of built release # @@ -94,6 +97,11 @@ IMAGES+= memstick.img IMAGES+= mini-memstick.img .endif +VMTARGETS= vm-base vm-image +VMFORMATS?= vhd vmdk qcow2 raw +VMSIZE?= 20G +VMBASE?= vm + CLEANFILES= packagesystem *.txz MANIFEST system ${IMAGES} .if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) . for I in ${IMAGES} @@ -103,7 +111,16 @@ CLEANFILES+= ${I}.xz .if defined(WITH_DVD) && !empty(WITH_DVD) CLEANFILES+= pkg-stage .endif +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) +CLEANFILES+= ${VMBASE}.img +. for FORMAT in ${VMFORMATS} +CLEANFILES+= ${VMBASE}.${FORMAT} +. endfor +.endif CLEANDIRS= dist ftp release bootonly dvd +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) +CLEANDIRS+= ${VMTARGETS} +.endif beforeclean: chflags -R noschg . .include @@ -263,6 +280,9 @@ ftp: packagesystem release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS} +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS} +.endif install: .if defined(DESTDIR) && !empty(DESTDIR) @@ -277,3 +297,44 @@ install: .endfor cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5 +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) + mkdir -p ${DESTDIR}/vmimages +. for FORMAT in ${VMFORMATS} + cp -p ${VMBASE}.${FORMAT} \ + ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} +. endfor +. if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES) +# This is very time consuming, so defer it after the images are moved to +# the DESTDIR. +. for FORMAT in ${VMFORMATS} + # Don't keep the originals. There is a copy in ${.OBJDIR} if needed. + ${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} +. endfor +. endif + cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \ + ${DESTDIR}/vmimages/CHECKSUM.SHA256 + cd ${DESTDIR}/vmimages && md5 ${OSRELEASE}* > \ + ${DESTDIR}/vmimages/CHECKSUM.MD5 +.endif + +vm-base: +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) +. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh) + env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ + ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \ + ${VMBASE}.img ${WORLDDIR} ${.OBJDIR}/${.TARGET} ${VMSIZE} +. endif +.endif + touch ${.TARGET} + +vm-image: vm-base +.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) +. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh) +. for FORMAT in ${VMFORMATS} + env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ + ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \ + ${VMBASE}.img ${FORMAT} ${VMBASE}.${FORMAT} +. endfor +. endif +.endif + touch ${.TARGET} Copied and modified: head/release/amd64/mk-vmimage.sh (from r272376, projects/release-vmimage/release/amd64/mk-vmimage.sh) ============================================================================== --- projects/release-vmimage/release/amd64/mk-vmimage.sh Wed Oct 1 17:05:40 2014 (r272376, copy source) +++ head/release/amd64/mk-vmimage.sh Thu Oct 2 16:13:12 2014 (r272414) @@ -35,8 +35,25 @@ PATH="/bin:/usr/bin:/sbin:/usr/sbin" export PATH +usage_vm_base() { + echo -n "$(basename ${0}) vm-base " + echo " " + return 0 +} + +usage_vm_image() { + echo -n "$(basename ${0}) vm-image " + echo " " + return 0 +} + usage() { - echo "$(basename ${0}) [...]" + echo "Usage:" + echo "$(basename ${0}) [vm-base|vm-image] [...]" + echo + usage_vm_base + echo + usage_vm_image exit 1 } @@ -56,6 +73,20 @@ panic() { vm_create_baseimage() { # Creates the UFS root filesystem for the virtual machine disk, # written to the formatted disk image with mkimg(1). + # + # Arguments: + # vm-base + + VMBASE="${1}" + WORLDDIR="${2}" + DESTDIR="${3}" + VMSIZE="${4}" + + if [ -z "${VMBASE}" -o -z "${WORLDDIR}" -o -z "${DESTDIR}" \ + -o -z "${VMSIZE}" ]; then + usage + fi + i=0 mkdir -p ${DESTDIR} truncate -s ${VMSIZE} ${VMBASE} @@ -63,7 +94,7 @@ vm_create_baseimage() { newfs -j /dev/${mddev} mount /dev/${mddev} ${DESTDIR} cd ${WORLDDIR} && \ - ${IMAKE} DESTDIR=${DESTDIR} \ + make DESTDIR=${DESTDIR} \ installworld installkernel distribution || \ panic 1 "\n\nCannot install the base system to ${DESTDIR}." chroot ${DESTDIR} /usr/bin/newaliases @@ -89,6 +120,19 @@ vm_create_baseimage() { } vm_create_vmdisk() { + # Creates the virtual machine disk image from the raw disk image. + # + # Arguments: + # vm-image " + + VMBASE="${1}" + FORMAT="${2}" + VMIMAGE="${3}" + + if [ -z "${VMBASE}" -o -z "${FORMAT}" -o -z "${VMIMAGE}" ]; then + usage + fi + mkimg_version=$(mkimg --version 2>/dev/null | awk '{print $2}') # We need mkimg(1) '--version' output, at minimum, to be able to @@ -124,10 +168,7 @@ vm_create_vmdisk() { main() { cmd="${1}" - - if [ -z "${MAKEFLAGS}" ]; then - echo "It is probably not safe to run this by hand yet..." - fi + shift 1 case ${cmd} in vm-base) Copied and modified: head/release/i386/mk-vmimage.sh (from r272376, projects/release-vmimage/release/i386/mk-vmimage.sh) ============================================================================== --- projects/release-vmimage/release/i386/mk-vmimage.sh Wed Oct 1 17:05:40 2014 (r272376, copy source) +++ head/release/i386/mk-vmimage.sh Thu Oct 2 16:13:12 2014 (r272414) @@ -35,8 +35,25 @@ PATH="/bin:/usr/bin:/sbin:/usr/sbin" export PATH +usage_vm_base() { + echo -n "$(basename ${0}) vm-base " + echo " " + return 0 +} + +usage_vm_image() { + echo -n "$(basename ${0}) vm-image " + echo " " + return 0 +} + usage() { - echo "$(basename ${0}) [...]" + echo "Usage:" + echo "$(basename ${0}) [vm-base|vm-image] [...]" + echo + usage_vm_base + echo + usage_vm_image exit 1 } @@ -56,6 +73,20 @@ panic() { vm_create_baseimage() { # Creates the UFS root filesystem for the virtual machine disk, # written to the formatted disk image with mkimg(1). + # + # Arguments: + # vm-base + + VMBASE="${1}" + WORLDDIR="${2}" + DESTDIR="${3}" + VMSIZE="${4}" + + if [ -z "${VMBASE}" -o -z "${WORLDDIR}" -o -z "${DESTDIR}" \ + -o -z "${VMSIZE}" ]; then + usage + fi + i=0 mkdir -p ${DESTDIR} truncate -s ${VMSIZE} ${VMBASE} @@ -63,7 +94,7 @@ vm_create_baseimage() { newfs -j /dev/${mddev} mount /dev/${mddev} ${DESTDIR} cd ${WORLDDIR} && \ - ${IMAKE} DESTDIR=${DESTDIR} \ + make DESTDIR=${DESTDIR} \ installworld installkernel distribution || \ panic 1 "\n\nCannot install the base system to ${DESTDIR}." chroot ${DESTDIR} /usr/bin/newaliases @@ -89,6 +120,19 @@ vm_create_baseimage() { } vm_create_vmdisk() { + # Creates the virtual machine disk image from the raw disk image. + # + # Arguments: + # vm-image " + + VMBASE="${1}" + FORMAT="${2}" + VMIMAGE="${3}" + + if [ -z "${VMBASE}" -o -z "${FORMAT}" -o -z "${VMIMAGE}" ]; then + usage + fi + mkimg_version=$(mkimg --version 2>/dev/null | awk '{print $2}') # We need mkimg(1) '--version' output, at minimum, to be able to @@ -124,10 +168,7 @@ vm_create_vmdisk() { main() { cmd="${1}" - - if [ -z "${MAKEFLAGS}" ]; then - echo "It is probably not safe to run this by hand yet..." - fi + shift 1 case ${cmd} in vm-base) Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Thu Oct 2 16:05:01 2014 (r272413) +++ head/release/release.conf.sample Thu Oct 2 16:13:12 2014 (r272414) @@ -77,3 +77,24 @@ PORTBRANCH="ports/head@rHEAD" ## as TARGET/TARGET_ARCH. #CHROOT_MAKEENV= +## Set to a non-empty value to build virtual machine images as part of the +## release build. +#WITH_VMIMAGES= + +## Set to a non-empty value to compress virtual machine images with xz(1) +## as part of the release build. +#WITH_COMPRESSED_VMIMAGES= + +## If WITH_VMIMAGES is set to a non-empty value, this is the name of the +## file to use for the installed userland/kernel. +#VMBASE="vm" + +## If WITH_VMIMAGES is set to a non-empty value, this is the size of the +## virtual machine disk filesystem. Valid size values are described in +## the truncate(1) manual page. +#VMSIZE="20G" + +## If WITH_VMIMAGES is set to a non-empty value, this is a list of disk +## image formats to create. Valid values are listed in the mkimg(1) +## manual page, as well as 'mkimg --formats' output. +#VMFORMATS="vhdf vmdk qcow2 raw" Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Thu Oct 2 16:05:01 2014 (r272413) +++ head/release/release.sh Thu Oct 2 16:13:12 2014 (r272414) @@ -89,6 +89,11 @@ NOPORTS= WITH_DVD= WITH_COMPRESSED_IMAGES= +# Set to non-empty value to build virtual machine images as part of +# the release. +WITH_VMIMAGES= +WITH_COMPRESSED_VMIMAGES= + usage() { echo "Usage: $0 [-c release.conf]" exit 1 @@ -169,7 +174,7 @@ CHROOT_DMAKEFLAGS="${CONF_FILES}" RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ - ${DOCPORTS} WITH_DVD=${WITH_DVD}" + ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES}" # Force src checkout if configured FORCE_SRC_KEY= @@ -274,4 +279,5 @@ eval chroot ${CHROOTDIR} make -C /usr/sr eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ release eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} + install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \ + WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Thu Oct 2 16:05:01 2014 (r272413) +++ head/share/man/man7/release.7 Thu Oct 2 16:13:12 2014 (r272414) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 11, 2014 +.Dd October 2, 2014 .Dt RELEASE 7 .Os .Sh NAME @@ -351,6 +351,61 @@ Set to the target directory within to check out .Va ${UBOOTSRC}/${UBOOTBRANCH} . .El +.Sh VIRTUAL MACHINE DISK IMAGES +The following +.Fa release.conf +variables are relevant only to virtual machine disk image builds: +.Bl -tag -width Ev +.It Va WITH_VMIMAGES +Set to a non-null value to build virtual machine disk images as part +of the release build. +.Va WITH_VMIMAGES +may also be specified as an envirionment variable passed to +.Xr make 1 . +.Pp +The option requires +.Xr mkimg 1 +version 20140927 or later. +.It Va WITH_COMPRESSED_VMIMAGES +Set to a non-null value to compress the virtual machine disk images with +.Xr xz 1 +as part of the +.Cm install +.Xr make 1 +target. +Note that compressing virtual machine disk images may take a very long +time on some systems. +.It Va VMBASE +Set to change the name of the resulting virtual machine disk image file. +The default value is +.Va vm . +.It Va VMSIZE +Set to change the size of the virtual machine disk capacity. +The default value is +.Va 20G . +See +.Xr truncate 1 +for valid values. +.Pp +Virtual machine disk images are, by default, created as sparse images. +When +.Va WITH_COMPRESSED_VMIMAGES +is used, the resulting files compressed with +.Xr xz 1 +compress to roughly the same size, regardless of the specified disk image +size. +.It Va VMFORMATS +Set to the target virtual disk image format(s) to create. +By default, the +.Va vhdf , Va vmdk , Va qcow2 , +and +.Va raw +formats are created. +See +.Xr mkimg 1 +for valid format values +.Pq requires version 20140927 or later . +.El .Sh MAKEFILE TARGETS The release makefile .Pq Pa src/release/Makefile @@ -407,6 +462,14 @@ Creates a directory named .Pa ftp containing the distribution files used in network installations and suitable for upload to an FTP mirror. +.It Cm vm-image +Creates virtual machine disk images in various formats. +The +.Cm vm-image +target requires the +.Va WITH_VMIMAGES +.Xr make 1 +envirionment variable to be set to a non-null value. .El .Pp Major subtargets called by targets above: From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 16:36:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6ADF6B97; Thu, 2 Oct 2014 16:36: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 4B921CCF; Thu, 2 Oct 2014 16:36: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 s92Gacx2072772; Thu, 2 Oct 2014 16:36:38 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92GabUV072769; Thu, 2 Oct 2014 16:36:37 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201410021636.s92GabUV072769@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Thu, 2 Oct 2014 16:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272416 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 16:36:38 -0000 Author: dumbbell Date: Thu Oct 2 16:36:37 2014 New Revision: 272416 URL: https://svnweb.freebsd.org/changeset/base/272416 Log: vt(4): Save/restore keyboard mode & LED states when switching window Add new functions to manipulate these mode & state, instead of calling kbdd_ioctl() everyhere. This fixes at least two bugs: 1. The state of the Scroll Lock LED and the state of scroll mode could be out-of-sync. For instance, if one enables scroll mode on window #1 and switches to window #2, the LED would remain on, but the window wouldn't be in scroll mode. Similarily, when switching between a console and an X.Org session, the LED states could be inconsistent with the real state. 2. When exiting from an X.Org session, the user could be unable to type anything. The workaround was to switch to another console window and come back. Differential Revision: https://reviews.freebsd.org/D821 Reviewed by: ray@ Approved by: ray@ Tested by: kwm@ MFC after: 3 days Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Thu Oct 2 16:32:52 2014 (r272415) +++ head/sys/dev/vt/vt.h Thu Oct 2 16:36:37 2014 (r272416) @@ -260,6 +260,7 @@ struct vt_window { unsigned int vw_number; /* (c) Window number. */ int vw_kbdmode; /* (?) Keyboard mode. */ int vw_prev_kbdmode;/* (?) Previous mode. */ + int vw_kbdstate; /* (?) Keyboard state. */ int vw_grabbed; /* (?) Grab count. */ char *vw_kbdsq; /* Escape sequence queue*/ unsigned int vw_flags; /* (d) Per-window flags. */ Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Oct 2 16:32:52 2014 (r272415) +++ head/sys/dev/vt/vt_core.c Thu Oct 2 16:36:37 2014 (r272416) @@ -298,6 +298,97 @@ vt_switch_timer(void *arg) } static int +vt_save_kbd_mode(struct vt_window *vw, keyboard_t *kbd) +{ + int mode, ret; + + mode = 0; + ret = kbdd_ioctl(kbd, KDGKBMODE, (caddr_t)&mode); + if (ret == ENOIOCTL) + ret = ENODEV; + if (ret != 0) + return (ret); + + vw->vw_kbdmode = mode; + + return (0); +} + +static int +vt_update_kbd_mode(struct vt_window *vw, keyboard_t *kbd) +{ + int ret; + + ret = kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode); + if (ret == ENOIOCTL) + ret = ENODEV; + + return (ret); +} + +static int +vt_save_kbd_state(struct vt_window *vw, keyboard_t *kbd) +{ + int state, ret; + + state = 0; + ret = kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state); + if (ret == ENOIOCTL) + ret = ENODEV; + if (ret != 0) + return (ret); + + vw->vw_kbdstate &= ~LOCK_MASK; + vw->vw_kbdstate |= state & LOCK_MASK; + + return (0); +} + +static int +vt_update_kbd_state(struct vt_window *vw, keyboard_t *kbd) +{ + int state, ret; + + state = vw->vw_kbdstate & LOCK_MASK; + ret = kbdd_ioctl(kbd, KDSKBSTATE, (caddr_t)&state); + if (ret == ENOIOCTL) + ret = ENODEV; + + return (ret); +} + +static int +vt_save_kbd_leds(struct vt_window *vw, keyboard_t *kbd) +{ + int leds, ret; + + leds = 0; + ret = kbdd_ioctl(kbd, KDGETLED, (caddr_t)&leds); + if (ret == ENOIOCTL) + ret = ENODEV; + if (ret != 0) + return (ret); + + vw->vw_kbdstate &= ~LED_MASK; + vw->vw_kbdstate |= leds & LED_MASK; + + return (0); +} + +static int +vt_update_kbd_leds(struct vt_window *vw, keyboard_t *kbd) +{ + int leds, ret; + + leds = vw->vw_kbdstate & LED_MASK; + ret = kbdd_ioctl(kbd, KDSETLED, (caddr_t)&leds); + if (ret == ENOIOCTL) + ret = ENODEV; + + return (ret); +} + +static int vt_window_preswitch(struct vt_window *vw, struct vt_window *curvw) { @@ -409,7 +500,11 @@ vt_window_switch(struct vt_window *vw) mtx_lock(&Giant); kbd = kbd_get_keyboard(vd->vd_keyboard); if (kbd != NULL) { - kbdd_ioctl(kbd, KDSKBMODE, (void *)&vw->vw_kbdmode); + if (curvw->vw_kbdmode == K_XLATE) + vt_save_kbd_state(curvw, kbd); + + vt_update_kbd_mode(vw, kbd); + vt_update_kbd_state(vw, kbd); } mtx_unlock(&Giant); DPRINTF(10, "%s(ttyv%d) done\n", __func__, vw->vw_number); @@ -602,7 +697,6 @@ static int vt_processkey(keyboard_t *kbd, struct vt_device *vd, int c) { struct vt_window *vw = vd->vd_curwindow; - int state = 0; #if VT_ALT_TO_ESC_HACK if (c & RELKEY) { @@ -665,10 +759,9 @@ vt_processkey(keyboard_t *kbd, struct vt vt_proc_window_switch(vw); return (0); case SLK: { - - kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state); + vt_save_kbd_state(vw, kbd); VT_LOCK(vd); - if (state & SLKED) { + if (vw->vw_kbdstate & SLKED) { /* Turn scrolling on. */ vw->vw_flags |= VWF_SCROLL; VTBUF_SLCK_ENABLE(&vw->vw_buf); @@ -1201,13 +1294,11 @@ vtterm_cngetc(struct terminal *tm) struct vt_window *vw = tm->tm_softc; struct vt_device *vd = vw->vw_device; keyboard_t *kbd; - int state; u_int c; if (vw->vw_kbdsq && *vw->vw_kbdsq) return (*vw->vw_kbdsq++); - state = 0; /* Make sure the splash screen is not there. */ if (vd->vd_flags & VDF_SPLASH) { /* Remove splash */ @@ -1223,8 +1314,8 @@ vtterm_cngetc(struct terminal *tm) return (-1); /* Force keyboard input mode to K_XLATE */ - c = K_XLATE; - kbdd_ioctl(kbd, KDSKBMODE, (void *)&c); + vw->vw_kbdmode = K_XLATE; + vt_update_kbd_mode(vw, kbd); /* Switch the keyboard to polling to make it work here. */ kbdd_poll(kbd, TRUE); @@ -1243,8 +1334,8 @@ vtterm_cngetc(struct terminal *tm) if (c & SPCLKEY) { switch (c) { case SPCLKEY | SLK: - kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state); - if (state & SLKED) { + vt_save_kbd_state(vw, kbd); + if (vw->vw_kbdstate & SLKED) { /* Turn scrolling on. */ vw->vw_flags |= VWF_SCROLL; VTBUF_SLCK_ENABLE(&vw->vw_buf); @@ -1311,7 +1402,7 @@ vtterm_cngrab(struct terminal *tm) /* We shall always use the keyboard in the XLATE mode here. */ vw->vw_prev_kbdmode = vw->vw_kbdmode; vw->vw_kbdmode = K_XLATE; - (void)kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode); + vt_update_kbd_mode(vw, kbd); kbdd_poll(kbd, TRUE); } @@ -1336,7 +1427,7 @@ vtterm_cnungrab(struct terminal *tm) kbdd_poll(kbd, FALSE); vw->vw_kbdmode = vw->vw_prev_kbdmode; - (void)kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode); + vt_update_kbd_mode(vw, kbd); kbdd_disable(kbd); } @@ -1890,12 +1981,8 @@ skip_thunk: case SETFKEY: case KDGKBINFO: case KDGKBTYPE: - case KDSKBSTATE: /* set keyboard state (locks) */ - case KDGKBSTATE: /* get keyboard state (locks) */ case KDGETREPEAT: /* get keyboard repeat & delay rates */ case KDSETREPEAT: /* set keyboard repeat & delay rates (new) */ - case KDSETLED: /* set keyboard LED status */ - case KDGETLED: /* get keyboard LED status */ case KBADDKBD: /* add/remove keyboard to/from mux */ case KBRELKBD: { error = 0; @@ -1915,18 +2002,101 @@ skip_thunk: } return (error); } + case KDGKBSTATE: { /* get keyboard state (locks) */ + error = 0; + + if (vw == vd->vd_curwindow) { + mtx_lock(&Giant); + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd != NULL) + error = vt_save_kbd_state(vw, kbd); + mtx_unlock(&Giant); + + if (error != 0) + return (error); + } + + *(int *)data = vw->vw_kbdstate & LOCK_MASK; + + return (error); + } + case KDSKBSTATE: { /* set keyboard state (locks) */ + int state; + + state = *(int *)data; + if (state & ~LOCK_MASK) + return (EINVAL); + + vw->vw_kbdstate &= ~LOCK_MASK; + vw->vw_kbdstate |= state; + + error = 0; + if (vw == vd->vd_curwindow) { + mtx_lock(&Giant); + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd != NULL) + error = vt_update_kbd_state(vw, kbd); + mtx_unlock(&Giant); + } + + return (error); + } + case KDGETLED: { /* get keyboard LED status */ + error = 0; + + if (vw == vd->vd_curwindow) { + mtx_lock(&Giant); + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd != NULL) + error = vt_save_kbd_leds(vw, kbd); + mtx_unlock(&Giant); + + if (error != 0) + return (error); + } + + *(int *)data = vw->vw_kbdstate & LED_MASK; + + return (error); + } + case KDSETLED: { /* set keyboard LED status */ + int leds; + + leds = *(int *)data; + if (leds & ~LED_MASK) + return (EINVAL); + + vw->vw_kbdstate &= ~LED_MASK; + vw->vw_kbdstate |= leds; + + error = 0; + if (vw == vd->vd_curwindow) { + mtx_lock(&Giant); + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd != NULL) + error = vt_update_kbd_leds(vw, kbd); + mtx_unlock(&Giant); + } + + return (error); + } case KDGKBMODE: { - int mode = -1; + error = 0; - mtx_lock(&Giant); - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) { - kbdd_ioctl(kbd, KDGKBMODE, (void *)&mode); + if (vw == vd->vd_curwindow) { + mtx_lock(&Giant); + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd != NULL) + error = vt_save_kbd_mode(vw, kbd); + mtx_unlock(&Giant); + + if (error != 0) + return (error); } - mtx_unlock(&Giant); - DPRINTF(20, "mode %d, vw_kbdmode %d\n", mode, vw->vw_kbdmode); - *(int *)data = mode; - return (0); + + *(int *)data = vw->vw_kbdmode; + + return (error); } case KDSKBMODE: { int mode; @@ -1937,19 +2107,17 @@ skip_thunk: case K_RAW: case K_CODE: vw->vw_kbdmode = mode; - if (vw == vd->vd_curwindow) { - keyboard_t *kbd; - error = 0; + error = 0; + if (vw == vd->vd_curwindow) { mtx_lock(&Giant); kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) { - error = kbdd_ioctl(kbd, KDSKBMODE, - (void *)&mode); - } + if (kbd != NULL) + error = vt_update_kbd_mode(vw, kbd); mtx_unlock(&Giant); } - return (0); + + return (error); default: return (EINVAL); } @@ -1977,8 +2145,17 @@ skip_thunk: return (0); case CONS_GETINFO: { vid_info_t *vi = (vid_info_t *)data; + if (vi->size != sizeof(struct vid_info)) + return (EINVAL); + + if (vw == vd->vd_curwindow) { + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd != NULL) + vt_save_kbd_state(vw, kbd); + } vi->m_num = vd->vd_curwindow->vw_number + 1; + vi->mk_keylock = vw->vw_kbdstate & LOCK_MASK; /* XXX: other fields! */ return (0); } @@ -2093,13 +2270,14 @@ skip_thunk: (void *)vd, vt_kbdevent, vd); if (i >= 0) { if (vd->vd_keyboard != -1) { + vt_save_kbd_state(vd->vd_curwindow, kbd); kbd_release(kbd, (void *)vd); } kbd = kbd_get_keyboard(i); vd->vd_keyboard = i; - (void)kbdd_ioctl(kbd, KDSKBMODE, - (caddr_t)&vd->vd_curwindow->vw_kbdmode); + vt_update_kbd_mode(vd->vd_curwindow, kbd); + vt_update_kbd_state(vd->vd_curwindow, kbd); } else { error = EPERM; /* XXX */ } @@ -2115,6 +2293,7 @@ skip_thunk: mtx_unlock(&Giant); return (EINVAL); } + vt_save_kbd_state(vd->vd_curwindow, kbd); error = kbd_release(kbd, (void *)vd); if (error == 0) { vd->vd_keyboard = -1; From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 16:56:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF8A4AD2; Thu, 2 Oct 2014 16:56: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 BB805F0E; Thu, 2 Oct 2014 16:56: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 s92Gu0P5082962; Thu, 2 Oct 2014 16:56:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92Gu0qi082961; Thu, 2 Oct 2014 16:56:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410021656.s92Gu0qi082961@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 2 Oct 2014 16:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272422 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 16:56:00 -0000 Author: hselasky Date: Thu Oct 2 16:56:00 2014 New Revision: 272422 URL: https://svnweb.freebsd.org/changeset/base/272422 Log: Make sure we always set the maximum number of valid contexts. MFC after: 3 days Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Thu Oct 2 16:49:22 2014 (r272421) +++ head/sys/dev/usb/controller/xhci.c Thu Oct 2 16:56:00 2014 (r272422) @@ -2271,14 +2271,17 @@ xhci_configure_mask(struct usb_device *u /* adjust */ x--; - /* figure out maximum */ - if (x > sc->sc_hw.devs[index].context_num) { + /* figure out the maximum number of contexts */ + if (x > sc->sc_hw.devs[index].context_num) sc->sc_hw.devs[index].context_num = x; - temp = xhci_ctx_get_le32(sc, &pinp->ctx_slot.dwSctx0); - temp &= ~XHCI_SCTX_0_CTX_NUM_SET(31); - temp |= XHCI_SCTX_0_CTX_NUM_SET(x + 1); - xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx0, temp); - } + else + x = sc->sc_hw.devs[index].context_num; + + /* update number of contexts */ + temp = xhci_ctx_get_le32(sc, &pinp->ctx_slot.dwSctx0); + temp &= ~XHCI_SCTX_0_CTX_NUM_SET(31); + temp |= XHCI_SCTX_0_CTX_NUM_SET(x + 1); + xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx0, temp); } return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 18:33:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0731C3ED; Thu, 2 Oct 2014 18:33: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 E7D70D82; Thu, 2 Oct 2014 18:33: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 s92IXwu7031864; Thu, 2 Oct 2014 18:33:58 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92IXwr6031863; Thu, 2 Oct 2014 18:33:58 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201410021833.s92IXwr6031863@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 2 Oct 2014 18:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272441 - head/lib/libc/stdtime X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 18:33:59 -0000 Author: pfg Date: Thu Oct 2 18:33:58 2014 New Revision: 272441 URL: https://svnweb.freebsd.org/changeset/base/272441 Log: strptime: %s format fix. Almost never needed in real life because %s is tends to be only one format spec. 1) Return code of gmtime_r() is checked. 2) All flags are set. Submitted by: ache MFC after: 3 weeks Modified: head/lib/libc/stdtime/strptime.c Modified: head/lib/libc/stdtime/strptime.c ============================================================================== --- head/lib/libc/stdtime/strptime.c Thu Oct 2 18:32:30 2014 (r272440) +++ head/lib/libc/stdtime/strptime.c Thu Oct 2 18:33:58 2014 (r272441) @@ -503,8 +503,11 @@ label: } errno = sverrno; buf = cp; - gmtime_r(&t, tm); + if (gmtime_r(&t, tm) == NULL) + return (NULL); *GMTp = 1; + flags |= FLAG_YDAY | FLAG_WDAY | FLAG_MONTH | + FLAG_MDAY | FLAG_YEAR; } break; From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 18:45:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39BEE9D9; Thu, 2 Oct 2014 18:45:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2620DE91; Thu, 2 Oct 2014 18:45: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 s92Ij1pk037199; Thu, 2 Oct 2014 18:45:01 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92Ij1ZW037196; Thu, 2 Oct 2014 18:45:01 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201410021845.s92Ij1ZW037196@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Thu, 2 Oct 2014 18:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272442 - head/sys/modules/ncr X-SVN-Group: head MIME-Version: 1.0 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, 02 Oct 2014 18:45:01 -0000 Author: rpaulo Date: Thu Oct 2 18:45:00 2014 New Revision: 272442 URL: https://svnweb.freebsd.org/changeset/base/272442 Log: Remove the extra CFLAGS now that the driver has been fixed by jhb. Modified: head/sys/modules/ncr/Makefile Modified: head/sys/modules/ncr/Makefile ============================================================================== --- head/sys/modules/ncr/Makefile Thu Oct 2 18:33:58 2014 (r272441) +++ head/sys/modules/ncr/Makefile Thu Oct 2 18:45:00 2014 (r272442) @@ -7,5 +7,3 @@ SRCS= ncr.c SRCS+= device_if.h bus_if.h pci_if.h opt_ncr.h opt_cam.h .include - -CFLAGS+=-Wno-error=unused-const-variable From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 18:52:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B8B5D04; Thu, 2 Oct 2014 18:52:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14047F7A; Thu, 2 Oct 2014 18:52: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 s92IqTw0041679; Thu, 2 Oct 2014 18:52:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92IqTnQ041678; Thu, 2 Oct 2014 18:52:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201410021852.s92IqTnQ041678@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 2 Oct 2014 18:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272443 - head/lib/libc/stdtime X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 18:52:30 -0000 Author: pfg Date: Thu Oct 2 18:52:29 2014 New Revision: 272443 URL: https://svnweb.freebsd.org/changeset/base/272443 Log: strptime(3): Update manpage for %U and %W. %U and %W were implemented as part of r272273 so take them out of the BUGS section and mention them in the SYNOPSIS. MFC after: 1 month Modified: head/lib/libc/stdtime/strptime.3 Modified: head/lib/libc/stdtime/strptime.3 ============================================================================== --- head/lib/libc/stdtime/strptime.3 Thu Oct 2 18:45:00 2014 (r272442) +++ head/lib/libc/stdtime/strptime.3 Thu Oct 2 18:52:29 2014 (r272443) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" " -.Dd June 25, 2012 +.Dd October 2, 2014 .Dt STRPTIME 3 .Os .Sh NAME @@ -79,7 +79,11 @@ and .Fa \&%D , are now interpreted as beginning at 1969 per POSIX requirements. Years 69-00 are interpreted in the 20th century (1969-2000), years -01-68 in the 21st century (2001-2068). +01-68 in the 21st century (2001-2068). The +.Fa \&%U +and +.Fa %W +format specifiers accept any value within the range 00 to 53. .Pp If the .Fa format @@ -161,14 +165,6 @@ and 12PM is taken as noon. .Pp The -.Fa \&%U -and -.Fa %W -format specifiers accept any value within the range 00 to 53 -without validating against other values supplied (like month -or day of the year, for example). -.Pp -The .Fa %Z format specifier only accepts time zone abbreviations of the local time zone, or the value "GMT". From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 19:11:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE94E60D; Thu, 2 Oct 2014 19: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 A5E3B259; Thu, 2 Oct 2014 19: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 s92JBKTU050342; Thu, 2 Oct 2014 19:11:20 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92JBJnO050314; Thu, 2 Oct 2014 19:11:19 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201410021911.s92JBJnO050314@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 2 Oct 2014 19:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272444 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... X-SVN-Group: head MIME-Version: 1.0 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, 02 Oct 2014 19:11:20 -0000 Author: jkim Date: Thu Oct 2 19:11:18 2014 New Revision: 272444 URL: https://svnweb.freebsd.org/changeset/base/272444 Log: Merge ACPICA 20140926. Added: head/sys/contrib/dev/acpica/common/acgetline.c - copied, changed from r256655, vendor-sys/acpica/dist/source/common/acgetline.c head/sys/contrib/dev/acpica/common/ahids.c - copied, changed from r263851, vendor-sys/acpica/dist/source/common/ahids.c head/sys/contrib/dev/acpica/common/ahuuids.c - copied, changed from r271440, vendor-sys/acpica/dist/source/common/ahuuids.c head/sys/contrib/dev/acpica/common/cmfsize.c - copied, changed from r263851, vendor-sys/acpica/dist/source/common/cmfsize.c head/sys/contrib/dev/acpica/compiler/aslascii.c - copied, changed from r271440, vendor-sys/acpica/dist/source/compiler/aslascii.c head/sys/contrib/dev/acpica/compiler/aslmapenter.c - copied, changed from r272286, vendor-sys/acpica/dist/source/compiler/aslmapenter.c head/sys/contrib/dev/acpica/compiler/aslmapoutput.c - copied, changed from r272286, vendor-sys/acpica/dist/source/compiler/aslmapoutput.c head/sys/contrib/dev/acpica/compiler/aslmaputils.c - copied, changed from r272286, vendor-sys/acpica/dist/source/compiler/aslmaputils.c head/sys/contrib/dev/acpica/compiler/aslmessages.c - copied, changed from r264919, vendor-sys/acpica/dist/source/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslparser.y - copied, changed from r271440, vendor-sys/acpica/dist/source/compiler/aslparser.y head/sys/contrib/dev/acpica/compiler/aslrules.y - copied unchanged from r271440, vendor-sys/acpica/dist/source/compiler/aslrules.y head/sys/contrib/dev/acpica/compiler/aslsupport.y - copied, changed from r271440, vendor-sys/acpica/dist/source/compiler/aslsupport.y head/sys/contrib/dev/acpica/compiler/asltokens.y - copied unchanged from r271440, vendor-sys/acpica/dist/source/compiler/asltokens.y head/sys/contrib/dev/acpica/compiler/asltypes.y - copied unchanged from r271440, vendor-sys/acpica/dist/source/compiler/asltypes.y head/sys/contrib/dev/acpica/components/debugger/dbtest.c - copied, changed from r260659, vendor-sys/acpica/dist/source/components/debugger/dbtest.c head/sys/contrib/dev/acpica/components/tables/tbdata.c - copied, changed from r263851, vendor-sys/acpica/dist/source/components/tables/tbdata.c head/sys/contrib/dev/acpica/components/utilities/utfileio.c - copied, changed from r267974, vendor-sys/acpica/dist/source/components/utilities/utfileio.c head/sys/contrib/dev/acpica/components/utilities/uthex.c - copied, changed from r271440, vendor-sys/acpica/dist/source/components/utilities/uthex.c head/sys/contrib/dev/acpica/components/utilities/utprint.c - copied, changed from r267974, vendor-sys/acpica/dist/source/components/utilities/utprint.c head/sys/contrib/dev/acpica/components/utilities/utuuid.c - copied, changed from r271440, vendor-sys/acpica/dist/source/components/utilities/utuuid.c head/sys/contrib/dev/acpica/include/platform/acenvex.h - copied unchanged from r267974, vendor-sys/acpica/dist/source/include/platform/acenvex.h head/sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c - copied, changed from r267974, vendor-sys/acpica/dist/source/os_specific/service_layers/oslibcfs.c Deleted: head/sys/contrib/dev/acpica/compiler/aslcompiler.y Modified: head/sys/conf/files head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslbtypes.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfileio.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslhex.c head/sys/contrib/dev/acpica/compiler/asllength.c head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/asllistsup.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/aslnamesp.c head/sys/contrib/dev/acpica/compiler/asloffset.c head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslprepkg.c head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslrestype1.c head/sys/contrib/dev/acpica/compiler/aslrestype1i.c head/sys/contrib/dev/acpica/compiler/aslrestype2.c head/sys/contrib/dev/acpica/compiler/aslrestype2d.c head/sys/contrib/dev/acpica/compiler/aslrestype2e.c head/sys/contrib/dev/acpica/compiler/aslrestype2q.c head/sys/contrib/dev/acpica/compiler/aslrestype2s.c head/sys/contrib/dev/acpica/compiler/aslrestype2w.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslstubs.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/asluuid.c head/sys/contrib/dev/acpica/compiler/aslwalks.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtparser.l head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/compiler/dtsubtable.c head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/compiler/preprocess.h head/sys/contrib/dev/acpica/compiler/prexpress.c head/sys/contrib/dev/acpica/compiler/prmacros.c head/sys/contrib/dev/acpica/compiler/prparser.l head/sys/contrib/dev/acpica/compiler/prparser.y head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/compiler/prutils.c head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/debugger/dbconvert.c head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbfileio.c head/sys/contrib/dev/acpica/components/debugger/dbhistry.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbstats.c head/sys/contrib/dev/acpica/components/debugger/dbutils.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c head/sys/contrib/dev/acpica/components/disassembler/dmnames.c head/sys/contrib/dev/acpica/components/disassembler/dmobject.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c head/sys/contrib/dev/acpica/components/disassembler/dmutils.c head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c head/sys/contrib/dev/acpica/components/dispatcher/dsargs.c head/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c head/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c head/sys/contrib/dev/acpica/components/dispatcher/dsobject.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c head/sys/contrib/dev/acpica/components/dispatcher/dswexec.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/dispatcher/dswscope.c head/sys/contrib/dev/acpica/components/dispatcher/dswstate.c head/sys/contrib/dev/acpica/components/events/evevent.c head/sys/contrib/dev/acpica/components/events/evglock.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/components/events/evgpeblk.c head/sys/contrib/dev/acpica/components/events/evgpeinit.c head/sys/contrib/dev/acpica/components/events/evgpeutil.c head/sys/contrib/dev/acpica/components/events/evhandler.c head/sys/contrib/dev/acpica/components/events/evmisc.c head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/events/evrgnini.c head/sys/contrib/dev/acpica/components/events/evsci.c head/sys/contrib/dev/acpica/components/events/evxface.c head/sys/contrib/dev/acpica/components/events/evxfevnt.c head/sys/contrib/dev/acpica/components/events/evxfgpe.c head/sys/contrib/dev/acpica/components/events/evxfregn.c head/sys/contrib/dev/acpica/components/executer/exconfig.c head/sys/contrib/dev/acpica/components/executer/exconvrt.c head/sys/contrib/dev/acpica/components/executer/excreate.c head/sys/contrib/dev/acpica/components/executer/exdebug.c head/sys/contrib/dev/acpica/components/executer/exdump.c head/sys/contrib/dev/acpica/components/executer/exfield.c head/sys/contrib/dev/acpica/components/executer/exfldio.c head/sys/contrib/dev/acpica/components/executer/exmisc.c head/sys/contrib/dev/acpica/components/executer/exmutex.c head/sys/contrib/dev/acpica/components/executer/exnames.c head/sys/contrib/dev/acpica/components/executer/exoparg1.c head/sys/contrib/dev/acpica/components/executer/exoparg2.c head/sys/contrib/dev/acpica/components/executer/exoparg3.c head/sys/contrib/dev/acpica/components/executer/exoparg6.c head/sys/contrib/dev/acpica/components/executer/exprep.c head/sys/contrib/dev/acpica/components/executer/exregion.c head/sys/contrib/dev/acpica/components/executer/exresnte.c head/sys/contrib/dev/acpica/components/executer/exresolv.c head/sys/contrib/dev/acpica/components/executer/exresop.c head/sys/contrib/dev/acpica/components/executer/exstore.c head/sys/contrib/dev/acpica/components/executer/exstoren.c head/sys/contrib/dev/acpica/components/executer/exstorob.c head/sys/contrib/dev/acpica/components/executer/exsystem.c head/sys/contrib/dev/acpica/components/executer/exutils.c head/sys/contrib/dev/acpica/components/hardware/hwacpi.c head/sys/contrib/dev/acpica/components/hardware/hwesleep.c head/sys/contrib/dev/acpica/components/hardware/hwgpe.c head/sys/contrib/dev/acpica/components/hardware/hwpci.c head/sys/contrib/dev/acpica/components/hardware/hwregs.c head/sys/contrib/dev/acpica/components/hardware/hwsleep.c head/sys/contrib/dev/acpica/components/hardware/hwtimer.c head/sys/contrib/dev/acpica/components/hardware/hwvalid.c head/sys/contrib/dev/acpica/components/hardware/hwxface.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nsalloc.c head/sys/contrib/dev/acpica/components/namespace/nsarguments.c head/sys/contrib/dev/acpica/components/namespace/nsconvert.c head/sys/contrib/dev/acpica/components/namespace/nsdump.c head/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c head/sys/contrib/dev/acpica/components/namespace/nseval.c head/sys/contrib/dev/acpica/components/namespace/nsinit.c head/sys/contrib/dev/acpica/components/namespace/nsload.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsobject.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/namespace/nspredef.c head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c head/sys/contrib/dev/acpica/components/namespace/nsrepair.c head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c head/sys/contrib/dev/acpica/components/namespace/nssearch.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/namespace/nswalk.c head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/namespace/nsxfname.c head/sys/contrib/dev/acpica/components/namespace/nsxfobj.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psopcode.c head/sys/contrib/dev/acpica/components/parser/psopinfo.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/parser/psscope.c head/sys/contrib/dev/acpica/components/parser/pstree.c head/sys/contrib/dev/acpica/components/parser/psutils.c head/sys/contrib/dev/acpica/components/parser/pswalk.c head/sys/contrib/dev/acpica/components/parser/psxface.c head/sys/contrib/dev/acpica/components/resources/rsaddr.c head/sys/contrib/dev/acpica/components/resources/rscalc.c head/sys/contrib/dev/acpica/components/resources/rscreate.c head/sys/contrib/dev/acpica/components/resources/rsdump.c head/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c head/sys/contrib/dev/acpica/components/resources/rsinfo.c head/sys/contrib/dev/acpica/components/resources/rsio.c head/sys/contrib/dev/acpica/components/resources/rsirq.c head/sys/contrib/dev/acpica/components/resources/rslist.c head/sys/contrib/dev/acpica/components/resources/rsmemory.c head/sys/contrib/dev/acpica/components/resources/rsmisc.c head/sys/contrib/dev/acpica/components/resources/rsserial.c head/sys/contrib/dev/acpica/components/resources/rsutils.c head/sys/contrib/dev/acpica/components/resources/rsxface.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbfind.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbprint.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/tables/tbxfroot.c head/sys/contrib/dev/acpica/components/utilities/utaddress.c head/sys/contrib/dev/acpica/components/utilities/utalloc.c head/sys/contrib/dev/acpica/components/utilities/utbuffer.c head/sys/contrib/dev/acpica/components/utilities/utcache.c head/sys/contrib/dev/acpica/components/utilities/utcopy.c head/sys/contrib/dev/acpica/components/utilities/utdebug.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/components/utilities/uterror.c head/sys/contrib/dev/acpica/components/utilities/uteval.c head/sys/contrib/dev/acpica/components/utilities/utexcep.c head/sys/contrib/dev/acpica/components/utilities/utglobal.c head/sys/contrib/dev/acpica/components/utilities/utids.c head/sys/contrib/dev/acpica/components/utilities/utinit.c head/sys/contrib/dev/acpica/components/utilities/utlock.c head/sys/contrib/dev/acpica/components/utilities/utmath.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/components/utilities/utmutex.c head/sys/contrib/dev/acpica/components/utilities/utobject.c head/sys/contrib/dev/acpica/components/utilities/utosi.c head/sys/contrib/dev/acpica/components/utilities/utownerid.c head/sys/contrib/dev/acpica/components/utilities/utpredef.c head/sys/contrib/dev/acpica/components/utilities/utresrc.c head/sys/contrib/dev/acpica/components/utilities/utstate.c head/sys/contrib/dev/acpica/components/utilities/utstring.c head/sys/contrib/dev/acpica/components/utilities/uttrack.c head/sys/contrib/dev/acpica/components/utilities/utxface.c head/sys/contrib/dev/acpica/components/utilities/utxferror.c head/sys/contrib/dev/acpica/components/utilities/utxfinit.c head/sys/contrib/dev/acpica/components/utilities/utxfmutex.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acbuffer.h head/sys/contrib/dev/acpica/include/accommon.h head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acdispat.h head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/achware.h head/sys/contrib/dev/acpica/include/acinterp.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acnames.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acopcode.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acparser.h head/sys/contrib/dev/acpica/include/acpi.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acresrc.h head/sys/contrib/dev/acpica/include/acrestyp.h head/sys/contrib/dev/acpica/include/acstruct.h head/sys/contrib/dev/acpica/include/actables.h head/sys/contrib/dev/acpica/include/actbl.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actbl3.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/amlcode.h head/sys/contrib/dev/acpica/include/amlresrc.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/contrib/dev/acpica/include/platform/acfreebsd.h head/sys/contrib/dev/acpica/include/platform/acgcc.h head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c head/sys/dev/acpica/Osd/OsdTable.c head/sys/dev/acpica/acpi.c head/usr.sbin/acpi/acpiconf/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/acpidb/acpidb.c head/usr.sbin/acpi/acpidump/Makefile head/usr.sbin/acpi/acpidump/acpi.c head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Oct 2 18:52:29 2014 (r272443) +++ head/sys/conf/files Thu Oct 2 19:11:18 2014 (r272444) @@ -255,6 +255,8 @@ contrib/altq/altq/altq_red.c optional a contrib/altq/altq/altq_rio.c optional altq contrib/altq/altq/altq_rmclass.c optional altq contrib/altq/altq/altq_subr.c optional altq +contrib/dev/acpica/common/ahids.c optional acpi acpi_debug +contrib/dev/acpica/common/ahuuids.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbcmds.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbconvert.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbdisply.c optional acpi acpi_debug @@ -265,6 +267,7 @@ contrib/dev/acpica/components/debugger/d contrib/dev/acpica/components/debugger/dbmethod.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbnames.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbstats.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbtest.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbutils.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbxface.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmbuffer.c optional acpi acpi_debug @@ -387,6 +390,7 @@ contrib/dev/acpica/components/resources/ contrib/dev/acpica/components/resources/rsserial.c optional acpi contrib/dev/acpica/components/resources/rsutils.c optional acpi contrib/dev/acpica/components/resources/rsxface.c optional acpi +contrib/dev/acpica/components/tables/tbdata.c optional acpi contrib/dev/acpica/components/tables/tbfadt.c optional acpi contrib/dev/acpica/components/tables/tbfind.c optional acpi contrib/dev/acpica/components/tables/tbinstal.c optional acpi @@ -407,6 +411,7 @@ contrib/dev/acpica/components/utilities/ contrib/dev/acpica/components/utilities/uteval.c optional acpi contrib/dev/acpica/components/utilities/utexcep.c optional acpi contrib/dev/acpica/components/utilities/utglobal.c optional acpi +contrib/dev/acpica/components/utilities/uthex.c optional acpi contrib/dev/acpica/components/utilities/utids.c optional acpi contrib/dev/acpica/components/utilities/utinit.c optional acpi contrib/dev/acpica/components/utilities/utlock.c optional acpi @@ -420,6 +425,7 @@ contrib/dev/acpica/components/utilities/ contrib/dev/acpica/components/utilities/utresrc.c optional acpi contrib/dev/acpica/components/utilities/utstate.c optional acpi contrib/dev/acpica/components/utilities/utstring.c optional acpi +contrib/dev/acpica/components/utilities/utuuid.c optional acpi acpi_debug contrib/dev/acpica/components/utilities/utxface.c optional acpi contrib/dev/acpica/components/utilities/utxferror.c optional acpi contrib/dev/acpica/components/utilities/utxfinit.c optional acpi Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Thu Oct 2 18:52:29 2014 (r272443) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Thu Oct 2 19:11:18 2014 (r272444) @@ -19,9 +19,10 @@ fulldirs="common compiler components inc # files to remove stripdirs="generate libraries tests tools" stripfiles="Makefile README accygwin.h acefi.h achaiku.h acintel.h \ - aclinux.h acmacosx.h acmsvc.h acnetbsd.h acos2.h acwin.h \ - acwin64.h new_table.txt osfreebsdtbl.c oslinuxtbl.c osunixdir.c \ - osunixmap.c oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c" + aclinux.h aclinuxex.h acmacosx.h acmsvc.h acnetbsd.h acos2.h \ + acwin.h acwin64.h new_table.txt osefitbl.c osefixf.c \ + osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c oswindir.c \ + oswintbl.c oswinxf.c readme.txt utclib.c" # include files to canonify src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h \ @@ -30,8 +31,8 @@ src_headers="acapps.h acbuffer.h accommo acopcode.h acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h \ acpredef.h acresrc.h acrestyp.h acstruct.h actables.h actbl.h \ actbl1.h actbl2.h actbl3.h actypes.h acutils.h amlcode.h \ - amlresrc.h platform/acenv.h platform/acfreebsd.h \ - platform/acgcc.h" + amlresrc.h platform/acenv.h platform/acenvex.h \ + platform/acfreebsd.h platform/acgcc.h" comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h \ aslsupport.l asltypes.h dtcompiler.h dttemplate.h preprocess.h" platform_headers="acfreebsd.h acgcc.h" Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Thu Oct 2 18:52:29 2014 (r272443) +++ head/sys/contrib/dev/acpica/changes.txt Thu Oct 2 19:11:18 2014 (r272444) @@ -1,4 +1,921 @@ ---------------------------------------- +26 September 2014. Summary of changes for version 20140926: + +1) ACPICA kernel-resident subsystem: + +Updated the GPIO operation region handler interface (GeneralPurposeIo). +In order to support GPIO Connection objects with multiple pins, along +with the related Field objects, the following changes to the interface +have been made: The Address is now defined to be the offset in bits of +the field unit from the previous invocation of a Connection. It can be +viewed as a "Pin Number Index" into the connection resource descriptor. +The BitWidth is the exact bit width of the field. It is usually one bit, +but not always. See the ACPICA reference guide (section 8.8.6.2.1) for +additional information and examples. + +GPE support: During ACPICA/GPE initialization, ensure that all GPEs with +corresponding _Lxx/_Exx methods are disabled (they may have been enabled +by the firmware), so that they cannot fire until they are enabled via +AcpiUpdateAllGpes. Rafael J. Wysocki. + +Added a new return flag for the Event/GPE status interfaces -- +AcpiGetEventStatus and AcpiGetGpeStatus. The new +ACPI_EVENT_FLAGS_HAS_HANDLER flag is used to indicate that the event or +GPE currently has a handler associated with it, and can thus actually +affect the system. Lv Zheng. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 99.1K Code, 27.3K Data, 126.4K Total + Debug Version: 192.8K Code, 79.9K Data, 272.7K Total + Previous Release: + Non-Debug Version: 98.8K Code, 27.3K Data, 126.1K Total + Debug Version: 192.1K Code, 79.8K Data, 271.9K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a memory allocation/free regression introduced in 20140828 +that could cause the compiler to crash. This was introduced inadvertently +during the effort to eliminate compiler memory leaks. ACPICA BZ 1111, +1113. + +iASL: Removed two error messages that have been found to create false +positives, until they can be fixed and fully validated (ACPICA BZ 1112): +1) Illegal forward reference within a method +2) Illegal reference across two methods + +iASL: Implemented a new option (-lm) to create a hardware mapping file +that summarizes all GPIO, I2C, SPI, and UART connections. This option +works for both the compiler and disassembler. See the iASL compiler user +guide for additional information and examples (section 6.4.6). + +AcpiDump: Added support for the version 1 (ACPI 1.0) RSDP in addition to +version 2. This corrects the AE_BAD_HEADER exception seen on systems with +a version 1 RSDP. Lv Zheng ACPICA BZ 1097. + +AcpiExec: For Unix versions, don't attempt to put STDIN into raw mode +unless STDIN is actually a terminal. Assists with batch-mode processing. +ACPICA BZ 1114. + +Disassembler/AcpiHelp: Added another large group of recognized _HID +values. + + +---------------------------------------- +28 August 2014. Summary of changes for version 20140828: + +1) ACPICA kernel-resident subsystem: + +Fixed a problem related to the internal use of the Timer() operator where +a 64-bit divide could cause an attempted link to a double-precision math +library. This divide is not actually necessary, so the code was +restructured to eliminate it. Lv Zheng. + +ACPI 5.1: Added support for the runtime validation of the _DSD package +(similar to the iASL support). + +ACPI 5.1/Headers: Added support for the GICC affinity subtable to the +SRAT table. Hanjun Guo . + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 98.8K Code, 27.3K Data, 126.1K Total + Debug Version: 192.1K Code, 79.8K Data, 271.9K Total + Previous Release: + Non-Debug Version: 98.7K Code, 27.3K Data, 126.0K Total1 + Debug Version: 192.0K Code, 79.7K Data, 271.7K Total + +2) iASL Compiler/Disassembler and Tools: + +AcpiExec: Fixed a problem on unix systems where the original terminal +state was not always properly restored upon exit. Seen when using the -v +option. ACPICA BZ 1104. + +iASL: Fixed a problem with the validation of the ranges/length within the +Memory24 resource descriptor. There was a boundary condition when the +range was equal to the (length -1) caused by the fact that these values +are defined in 256-byte blocks, not bytes. ACPICA BZ 1098 + +Disassembler: Fixed a problem with the GpioInt descriptor interrupt +polarity +flags. The flags are actually 2 bits, not 1, and the "ActiveBoth" keyword +is +now supported properly. + +ACPI 5.1: Added the GICC affinity subtable to the SRAT table. Supported +in the disassembler, data table compiler, and table template generator. + +iASL: Added a requirement for Device() objects that one of either a _HID +or _ADR must exist within the scope of a Device, as per the ACPI +specification. Remove a similar requirement that was incorrectly in place +for the _DSD object. + +iASL: Added error detection for illegal named references within control +methods that would cause runtime failures. Now trapped as errors are: 1) +References to objects within a non-parent control method. 2) Forward +references (within a method) -- for control methods, AML interpreters use +a one-pass parse of control methods. ACPICA BZ 1008. + +iASL: Added error checking for dependencies related to the _PSx power +methods. ACPICA BZ 1029. +1) For _PS0, one of these must exist within the same scope: _PS1, _PS2, +_PS3. +2) For _PS1, _PS2, and PS3: A _PS0 object must exist within the same +scope. + +iASL and table compiler: Cleanup miscellaneous memory leaks by fully +deploying the existing object and string caches and adding new caches for +the table compiler. + +iASL: Split the huge parser source file into multiple subfiles to improve +manageability. Generation now requires the M4 macro preprocessor, which +is part of the Bison distribution on both unix and windows platforms. + +AcpiSrc: Fixed and removed all extraneous warnings generated during +entire ACPICA source code scan and/or conversion. + + +---------------------------------------- + +24 July 2014. Summary of changes for version 20140724: + +The ACPI 5.1 specification has been released and is available at: +http://uefi.org/specs/access + + +0) ACPI 5.1 support in ACPICA: + +ACPI 5.1 is fully supported in ACPICA as of this release. + +New predefined names. Support includes iASL and runtime ACPICA +validation. + _CCA (Cache Coherency Attribute). + _DSD (Device-Specific Data). David Box. + +Modifications to existing ACPI tables. Support includes headers, iASL +Data Table compiler, disassembler, and the template generator. + FADT - New fields and flags. Graeme Gregory. + GTDT - One new subtable and new fields. Tomasz Nowicki. + MADT - Two new subtables. Tomasz Nowicki. + PCCT - One new subtable. + +Miscellaneous. + New notification type for System Resource Affinity change events. + + +1) ACPICA kernel-resident subsystem: + +Fixed a regression introduced in 20140627 where a fault can happen during +the deletion of Alias AML namespace objects. The problem affected both +the core ACPICA and the ACPICA tools including iASL and AcpiExec. + +Implemented a new GPE public interface, AcpiMarkGpeForWake. Provides a +simple mechanism to enable wake GPEs that have no associated handler or +control method. Rafael Wysocki. + +Updated the AcpiEnableGpe interface to disallow the enable if there is no +handler or control method associated with the particular GPE. This will +help avoid meaningless GPEs and even GPE floods. Rafael Wysocki. + +Updated GPE handling and dispatch by disabling the GPE before clearing +the status bit for edge-triggered GPEs. Lv Zheng. + +Added Timer() support to the AML Debug object. The current timer value is +now displayed with each invocation of (Store to) the debug object to +enable simple generation of execution times for AML code (method +execution for example.) ACPICA BZ 1093. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 98.7K Code, 27.3K Data, 126.0K Total + Debug Version: 192.0K Code, 79.7K Data, 271.7K Total + Previous Release: + Non-Debug Version: 98.7K Code, 27.2K Data, 125.9K Total + Debug Version: 191.7K Code, 79.6K Data, 271.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +Fixed an issue with the recently added local printf implementation, +concerning width/precision specifiers that could cause incorrect output. +Lv Zheng. ACPICA BZ 1094. + +Disassembler: Added support to detect buffers that contain UUIDs and +disassemble them to an invocation of the ToUUID operator. Also emit +commented descriptions of known ACPI-related UUIDs. + +AcpiHelp: Added support to display known ACPI-related UUIDs. New option, +-u. Adds three new files. + +iASL: Update table compiler and disassembler for DMAR table changes that +were introduced in September 2013. With assistance by David Woodhouse. + +---------------------------------------- +27 June 2014. Summary of changes for version 20140627: + +1) ACPICA kernel-resident subsystem: + +Formatted Output: Implemented local versions of standard formatted output +utilities such as printf, etc. Over time, it has been discovered that +there are in fact many portability issues with printf, and the addition +of this feature will fix/prevent these issues once and for all. Some +known issues are summarized below: + +1) Output of 64-bit values is not portable. For example, UINT64 is %ull +for the Linux kernel and is %uI64 for some MSVC versions. +2) Invoking printf consistently in a manner that is portable across both +32-bit and 64-bit platforms is difficult at best in many situations. +3) The output format for pointers varies from system to system (leading +zeros especially), and leads to inconsistent output from ACPICA across +platforms. +4) Certain platform-specific printf formats may conflict with ACPICA use. +5) If there is no local C library available, ACPICA now has local support +for printf. + +-- To address these printf issues in a complete manner, ACPICA now +directly implements a small subset of printf format specifiers, only +those that it requires. Adds a new file, utilities/utprint.c. Lv Zheng. + +Implemented support for ACPICA generation within the EFI environment. +Initially, the AcpiDump utility is supported in the UEFI shell +environment. Lv Zheng. + +Added a new external interface, AcpiLogError, to improve ACPICA +portability. This allows the host to redirect error messages from the +ACPICA utilities. Lv Zheng. + +Added and deployed new OSL file I/O interfaces to improve ACPICA +portability: + AcpiOsOpenFile + AcpiOsCloseFile + AcpiOsReadFile + AcpiOsWriteFile + AcpiOsGetFileOffset + AcpiOsSetFileOffset +There are C library implementations of these functions in the new file +service_layers/oslibcfs.c -- however, the functions can be implemented by +the local host in any way necessary. Lv Zheng. + +Implemented a mechanism to disable/enable ACPI table checksum validation +at runtime. This can be useful when loading tables very early during OS +initialization when it may not be possible to map the entire table in +order to compute the checksum. Lv Zheng. + +Fixed a buffer allocation issue for the Generic Serial Bus support. +Originally, a fixed buffer length was used. This change allows for +variable-length buffers based upon the protocol indicated by the field +access attributes. Reported by Lan Tianyu. Lv Zheng. + +Fixed a problem where an object detached from a namespace node was not +properly terminated/cleared and could cause a circular list problem if +reattached. ACPICA BZ 1063. David Box. + +Fixed a possible recursive lock acquisition in hwregs.c. Rakib Mullick. + +Fixed a possible memory leak in an error return path within the function +AcpiUtCopyIobjectToIobject. ACPICA BZ 1087. Colin Ian King. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 98.7K Code, 27.2K Data, 125.9K Total + Debug Version: 191.7K Code, 79.6K Data, 271.3K Total + Previous Release: + Non-Debug Version: 96.8K Code, 27.2K Data, 124.0K Total + Debug Version: 189.5K Code, 79.7K Data, 269.2K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Add dump of ASCII equivalent text within a comment at the +end of each line of the output for the Buffer() ASL operator. + +AcpiDump: Miscellaneous changes: + Fixed repetitive table dump in -n mode. + For older EFI platforms, use the ACPI 1.0 GUID during RSDP search if +the ACPI 2.0 GUID fails. + +iASL: Fixed a problem where the compiler could fault if incorrectly given +an acpidump output file as input. ACPICA BZ 1088. David Box. + +AcpiExec/AcpiNames: Fixed a problem where these utilities could fault if +they are invoked without any arguments. + +Debugger: Fixed a possible memory leak in an error return path. ACPICA BZ +1086. Colin Ian King. + +Disassembler: Cleaned up a block of code that extracts a parent Op +object. Added a comment that explains that the parent is guaranteed to be +valid in this case. ACPICA BZ 1069. + +---------------------------------------- +24 April 2014. Summary of changes for version 20140424: + +1) ACPICA kernel-resident subsystem: + +Implemented support to skip/ignore NULL address entries in the RSDT/XSDT. +Some of these tables are known to contain a trailing NULL entry. Lv +Zheng. + +Removed an extraneous error message for the case where there are a large +number of system GPEs (> 124). This was the "32-bit FADT register is too +long to convert to GAS struct" message, which is irrelevant for GPEs +since the GPEx_BLK_LEN fields of the FADT are always used instead of the +(limited capacity) GAS bit length. Also, several changes to ensure proper +support for GPE numbers > 255, where some "GPE number" fields were 8-bits +internally. + +Implemented and deployed additional configuration support for the public +ACPICA external interfaces. Entire classes of interfaces can now be +easily modified or configured out, replaced by stubbed inline functions +by default. Lv Zheng. + +Moved all public ACPICA runtime configuration globals to the public +ACPICA external interface file for convenience. Also, removed some +obsolete/unused globals. See the file acpixf.h. Lv Zheng. + +Documentation: Added a new section to the ACPICA reference describing the +maximum number of GPEs that can be supported by the FADT-defined GPEs in +block zero and one. About 1200 total. See section 4.4.1 of the ACPICA +reference. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 96.8K Code, 27.2K Data, 124.0K Total + Debug Version: 189.5K Code, 79.7K Data, 269.2K Total + Previous Release: + Non-Debug Version: 97.0K Code, 27.2K Data, 124.2K Total + Debug Version: 189.7K Code, 79.5K Data, 269.2K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL and disassembler: Add full support for the LPIT table (Low Power +Idle Table). Includes support in the disassembler, data table compiler, +and template generator. + +AcpiDump utility: +1) Add option to force the use of the RSDT (over the XSDT). +2) Improve validation of the RSDP signature (use 8 chars instead of 4). + +iASL: Add check for predefined packages that are too large. For +predefined names that contain subpackages, check if each subpackage is +too large. (Check for too small already exists.) + +Debugger: Updated the GPE command (which simulates a GPE by executing the +GPE code paths in ACPICA). The GPE device is now optional, and defaults +to the GPE 0/1 FADT-defined blocks. + +Unix application OSL: Update line-editing support. Add additional error +checking and take care not to reset terminal attributes on exit if they +were never set. This should help guarantee that the terminal is always +left in the previous state on program exit. + +---------------------------------------- +25 March 2014. Summary of changes for version 20140325: + +1) ACPICA kernel-resident subsystem: + +Updated the auto-serialize feature for control methods. This feature +automatically serializes all methods that create named objects in order +to prevent runtime errors. The update adds support to ignore the +currently executing AML SyncLevel when invoking such a method, in order +to prevent disruption of any existing SyncLevel priorities that may exist +in the AML code. Although the use of SyncLevels is relatively rare, this +change fixes a regression where an AE_AML_MUTEX_ORDER exception can +appear on some machines starting with the 20140214 release. + +Added a new external interface to allow the host to install ACPI tables +very early, before the namespace is even created. AcpiInstallTable gives +the host additional flexibility for ACPI table management. Tables can be +installed directly by the host as if they had originally appeared in the +XSDT/RSDT. Installed tables can be SSDTs or other ACPI data tables +(anything except the DSDT and FACS). Adds a new file, tbdata.c, along +with additional internal restructuring and cleanup. See the ACPICA +Reference for interface details. Lv Zheng. + +Added validation of the checksum for all incoming dynamically loaded +tables (via external interfaces or via AML Load/LoadTable operators). Lv +Zheng. + +Updated the use of the AcpiOsWaitEventsComplete interface during Notify +and GPE handler removal. Restructured calls to eliminate possible race +conditions. Lv Zheng. + +Added a warning for the use/execution of the ASL/AML Unload (table) +operator. This will help detect and identify machines that use this +operator if and when it is ever used. This operator has never been seen +in the field and the usage model and possible side-effects of the drastic +runtime action of a full table removal are unknown. + +Reverted the use of #pragma push/pop which was introduced in the 20140214 +release. It appears that push and pop are not implemented by enough +compilers to make the use of this feature feasible for ACPICA at this +time. However, these operators may be deployed in a future ACPICA +release. + +Added the missing EXPORT_SYMBOL macros for the install and remove SCI +handler interfaces. + +Source code generation: +1) Disabled the use of the "strchr" macro for the gcc-specific +generation. For some versions of gcc, this macro can periodically expose +a compiler bug which in turn causes compile-time error(s). +2) Added support for PPC64 compilation. Colin Ian King. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 97.0K Code, 27.2K Data, 124.2K Total + Debug Version: 189.7K Code, 79.5K Data, 269.2K Total + Previous Release: + Non-Debug Version: 96.5K Code, 27.2K Data, 123.7K Total + Debug Version: 188.6K Code, 79.0K Data, 267.6K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Added several new features to improve the readability of +the resulting ASL code. Extra information is emitted within comment +fields in the ASL code: +1) Known _HID/_CID values are decoded to descriptive text. +2) Standard values for the Notify() operator are decoded to descriptive +text. +3) Target operands are expanded to full pathnames (in a comment) when +possible. + +Disassembler: Miscellaneous updates for extern() handling: +1) Abort compiler if file specified by -fe option does not exist. +2) Silence unnecessary warnings about argument count mismatches. +3) Update warning messages concerning unresolved method externals. +4) Emit "UnknownObj" keyword for externals whose type cannot be +determined. + +AcpiHelp utility: +1) Added the -a option to display both the ASL syntax and the AML +encoding for an input ASL operator. This effectively displays all known +information about an ASL operator with one AcpiHelp invocation. +2) Added substring match support (similar to a wildcard) for the -i +(_HID/PNP IDs) option. + +iASL/Disassembler: Since this tool does not yet support execution on big- +endian machines, added detection of endianness and an error message if +execution is attempted on big-endian. Support for big-endian within iASL +is a feature that is on the ACPICA to-be-done list. + +AcpiBin utility: +1) Remove option to extract binary files from an acpidump; this function +is made obsolete by the AcpiXtract utility. +2) General cleanup of open files and allocated buffers. + +---------------------------------------- +14 February 2014. Summary of changes for version 20140214: + +1) ACPICA kernel-resident subsystem: + +Implemented a new mechanism to proactively prevent problems with ill- +behaved reentrant control methods that create named ACPI objects. This +behavior is illegal as per the ACPI specification, but is nonetheless +frequently seen in the field. Previously, this could lead to an +AE_ALREADY_EXISTS exception if the method was actually entered by more +than one thread. This new mechanism detects such methods at table load +time and marks them "serialized" to prevent reentrancy. A new global +option, AcpiGbl_AutoSerializeMethods, has been added to disable this +feature if desired. This mechanism and global option obsoletes and +supersedes the previous AcpiGbl_SerializeAllMethods option. + +Added the "Windows 2013" string to the _OSI support. ACPICA will now +respond TRUE to _OSI queries with this string. It is the stated policy of +ACPICA to add new strings to the _OSI support as soon as possible after +they are defined. See the full ACPICA _OSI policy which has been added to +the utilities/utosi.c file. + +Hardened/updated the _PRT return value auto-repair code: +1) Do not abort the repair on a single subpackage failure, continue to +check all subpackages. +2) Add check for the minimum subpackage length (4). +3) Properly handle extraneous NULL package elements. + +Added support to avoid the possibility of infinite loops when traversing +object linked lists. Never allow an infinite loop, even in the face of +corrupted object lists. + +ACPICA headers: Deployed the use of #pragma pack(push) and #pragma +pack(pop) directives to ensure that the ACPICA headers are independent of +compiler settings or other host headers. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 96.5K Code, 27.2K Data, 123.7K Total + Debug Version: 188.6K Code, 79.0K Data, 267.6K Total + Previous Release: + Non-Debug Version: 96.2K Code, 27.0K Data, 123.2K Total + Debug Version: 187.5K Code, 78.3K Data, 265.8K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL/Table-compiler: Fixed a problem with support for the SPMI table. The +first reserved field was incorrectly forced to have a value of zero. This +change correctly forces the field to have a value of one. ACPICA BZ 1081. + +Debugger: Added missing support for the "Extra" and "Data" subobjects +when displaying object data. + +Debugger: Added support to display entire object linked lists when +displaying object data. + +iASL: Removed the obsolete -g option to obtain ACPI tables from the +Windows registry. This feature has been superseded by the acpidump +utility. + +---------------------------------------- +14 January 2014. Summary of changes for version 20140114: + +1) ACPICA kernel-resident subsystem: + +Updated all ACPICA copyrights and signons to 2014. Added the 2014 +copyright to all module headers and signons, including the standard Linux +header. This affects virtually every file in the ACPICA core subsystem, +iASL compiler, all ACPICA utilities, and the test suites. + +Improved parameter validation for AcpiInstallGpeBlock. Added the +following checks: +1) The incoming device handle refers to type ACPI_TYPE_DEVICE. +2) There is not already a GPE block attached to the device. +Likewise, with AcpiRemoveGpeBlock, ensure that the incoming object is a +device. + +Correctly support "references" in the ACPI_OBJECT. This change fixes the +support to allow references (namespace nodes) to be passed as arguments +to control methods via the evaluate object interface. This is probably +most useful for testing purposes, however. + +Improved support for 32/64 bit physical addresses in printf()-like +output. This change improves the support for physical addresses in printf +debug statements and other output on both 32-bit and 64-bit hosts. It +consistently outputs the appropriate number of bytes for each host. The +%p specifier is unsatisfactory since it does not emit uniform output on +all hosts/clib implementations (on some, leading zeros are not supported, +leading to difficult-to-read output). + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 96.2K Code, 27.0K Data, 123.2K Total + Debug Version: 187.5K Code, 78.3K Data, 265.8K Total + Previous Release: + Non-Debug Version: 96.1K Code, 27.0K Data, 123.1K Total + Debug Version: 185.6K Code, 77.3K Data, 262.9K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fix a possible fault when using the Connection() operator. Fixes a +problem if the parent Field definition for the Connection operator refers +to an operation region that does not exist. ACPICA BZ 1064. + +AcpiExec: Load of local test tables is now optional. The utility has the +capability to load some various tables to test features of ACPICA. +However, there are enough of them that the output of the utility became +confusing. With this change, only the required local tables are displayed +(RSDP, XSDT, etc.) along with the actual tables loaded via the command +line specification. This makes the default output simler and easier to +understand. The -el command line option restores the original behavior +for testing purposes. + +AcpiExec: Added support for overlapping operation regions. This change +expands the simulation of operation regions by supporting regions that +overlap within the given address space. Supports SystemMemory and +SystemIO. ASLTS test suite updated also. David Box. ACPICA BZ 1031. + +AcpiExec: Added region handler support for PCI_Config and EC spaces. This +allows AcpiExec to simulate these address spaces, similar to the current +support for SystemMemory and SystemIO. + +Debugger: Added new command to read/write/compare all namespace objects. +The command "test objects" will exercise the entire namespace by writing +new values to each data object, and ensuring that the write was +successful. The original value is then restored and verified. + +Debugger: Added the "test predefined" command. This change makes this +test public and puts it under the new "test" command. The test executes +each and every predefined name within the current namespace. + +---------------------------------------- +18 December 2013. Summary of changes for version 20131218: + +Global note: The ACPI 5.0A specification was released this month. There +are no changes needed for ACPICA since this release of ACPI is an +errata/clarification release. The specification is available at +acpi.info. + + +1) ACPICA kernel-resident subsystem: + +Added validation of the XSDT root table if it is present. Some older +platforms contain an XSDT that is ill-formed or otherwise invalid (such +as containing some or all entries that are NULL pointers). This change +adds a new function to validate the XSDT before actually using it. If the +XSDT is found to be invalid, ACPICA will now automatically fall back to +using the RSDT instead. Original implementation by Zhao Yakui. Ported to +ACPICA and enhanced by Lv Zheng and Bob Moore. + +Added a runtime option to ignore the XSDT and force the use of the RSDT. +This change adds a runtime option that will force ACPICA to use the RSDT +instead of the XSDT (AcpiGbl_DoNotUseXsdt). Although the ACPI spec +requires that an XSDT be used instead of the RSDT, the XSDT has been +found to be corrupt or ill-formed on some machines. Lv Zheng. + +Added a runtime option to favor 32-bit FADT register addresses over the +64-bit addresses. This change adds an option to favor 32-bit FADT +addresses when there is a conflict between the 32-bit and 64-bit versions +of the same register. The default behavior is to use the 64-bit version +in accordance with the ACPI specification. This can now be overridden via +the AcpiGbl_Use32BitFadtAddresses flag. ACPICA BZ 885. Lv Zheng. + +During the change above, the internal "Convert FADT" and "Verify FADT" +functions have been merged to simplify the code, making it easier to +understand and maintain. ACPICA BZ 933. + +Improve exception reporting and handling for GPE block installation. +Return an actual status from AcpiEvGetGpeXruptBlock and don't clobber the +status when exiting AcpiEvInstallGpeBlock. ACPICA BZ 1019. + +Added helper macros to extract bus/segment numbers from the HEST table. +This change adds two macros to extract the encoded bus and segment +numbers from the HEST Bus field - ACPI_HEST_BUS and ACPI_HEST_SEGMENT. +Betty Dall + +Removed the unused ACPI_FREE_BUFFER macro. This macro is no longer used +by ACPICA. It is not a public macro, so it should have no effect on +existing OSV code. Lv Zheng. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 96.1K Code, 27.0K Data, 123.1K Total + Debug Version: 185.6K Code, 77.3K Data, 262.9K Total + Previous Release: + Non-Debug Version: 95.9K Code, 27.0K Data, 122.9K Total + Debug Version: 185.1K Code, 77.2K Data, 262.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Improved pathname support for emitted External() +statements. This change adds full pathname support for external names +that have been resolved internally by the inclusion of additional ACPI +tables (via the iASL -e option). Without this change, the disassembler +can emit multiple externals for the same object, or it become confused +when the Scope() operator is used on an external object. Overall, greatly +improves the ability to actually recompile the emitted ASL code when +objects a referenced across multiple ACPI tables. Reported by Michael +Tsirkin (mst@redhat.com). + +Tests/ASLTS: Updated functional control suite to execute with no errors. +David Box. Fixed several errors related to the testing of the interpreter +slack mode. Lv Zheng. + +iASL: Added support to detect names that are declared within a control +method, but are unused (these are temporary names that are only valid +during the time the method is executing). A remark is issued for these +cases. ACPICA BZ 1022. + +iASL: Added full support for the DBG2 table. Adds full disassembler, +table compiler, and template generator support for the DBG2 table (Debug +Port 2 table). + +iASL: Added full support for the PCCT table, update the table definition. +Updates the PCCT table definition in the actbl3.h header and adds table +compiler and template generator support. + +iASL: Added an option to emit only error messages (no warnings/remarks). +The -ve option will enable only error messages, warnings and remarks are +suppressed. This can simplify debugging when only the errors are +important, such as when an ACPI table is disassembled and there are many +warnings and remarks -- but only the actual errors are of real interest. + +Example ACPICA code (source/tools/examples): Updated the example code so +that it builds to an actual working program, not just example code. Added +ACPI tables and execution of an example control method in the DSDT. Added +makefile support for Unix generation. + +---------------------------------------- +15 November 2013. Summary of changes for version 20131115: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Resource Manager: Fixed loop termination for the "get AML length" +function. The loop previously had an error termination on a NULL resource +pointer, which can never happen since the loop simply increments a valid +resource pointer. This fix changes the loop to terminate with an error on +an invalid end-of-buffer condition. The problem can be seen as an +infinite loop by callers to AcpiSetCurrentResources with an invalid or +corrupted resource descriptor, or a resource descriptor that is missing +an END_TAG descriptor. Reported by Dan Carpenter +. Lv Zheng, Bob Moore. + +Table unload and ACPICA termination: Delete all attached data objects +during namespace node deletion. This fix updates namespace node deletion +to delete the entire list of attached objects (attached via +AcpiAttachObject) instead of just one of the attached items. ACPICA BZ +1024. Tomasz Nowicki (tomasz.nowicki@linaro.org). + +ACPICA termination: Added support to delete all objects attached to the +root namespace node. This fix deletes any and all objects that have been +attached to the root node via AcpiAttachData. Previously, none of these +objects were deleted. Reported by Tomasz Nowicki. ACPICA BZ 1026. + +Debug output: Do not emit the function nesting level for the in-kernel +build. The nesting level is really only useful during a single-thread +execution. Therefore, only enable this output for the AcpiExec utility. +Also, only emit the thread ID when executing under AcpiExec (Context +switches are still always detected and a message is emitted). ACPICA BZ +972. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 95.9K Code, 27.0K Data, 122.9K Total + Debug Version: 185.1K Code, 77.2K Data, 262.3K Total + Previous Release: + Non-Debug Version: 95.8K Code, 27.0K Data, 122.8K Total + Debug Version: 185.2K Code, 77.2K Data, 262.4K Total + + +2) iASL Compiler/Disassembler and Tools: + +AcpiExec/Unix-OSL: Use instead of . This is the +correct portable POSIX header for terminal control functions. + +Disassembler: Fixed control method invocation issues related to the use +of the CondRefOf() operator. The problem is seen in the disassembly where +control method invocations may not be disassembled properly if the +control method name has been used previously as an argument to CondRefOf. +The solution is to not attempt to emit an external declaration for the +CondRefOf target (it is not necessary in the first place). This prevents +disassembler object type confusion. ACPICA BZ 988. + +Unix Makefiles: Added an option to disable compiler optimizations and the +_FORTIFY_SOURCE flag. Some older compilers have problems compiling ACPICA +with optimizations (reportedly, gcc 4.4 for example). This change adds a +command line option for make (NOOPT) that disables all compiler +optimizations and the _FORTIFY_SOURCE compiler flag. The default +optimization is -O2 with the _FORTIFY_SOURCE flag specified. ACPICA BZ +1034. Lv Zheng, Bob Moore. + +Tests/ASLTS: Added options to specify individual test cases and modes. +This allows testers running aslts.sh to optionally specify individual +test modes and test cases. Also added an option to disable the forced +generation of the ACPICA tools from source if desired. Lv Zheng. + +---------------------------------------- +27 September 2013. Summary of changes for version 20130927: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Fixed a problem with store operations to reference objects. This change +fixes a problem where a Store operation to an ArgX object that contained +a +reference to a field object did not complete the automatic dereference +and +then write to the actual field object. Instead, the object type of the +field object was inadvertently changed to match the type of the source +operand. The new behavior will actually write to the field object (buffer +field or field unit), thus matching the correct ACPI-defined behavior. + +Implemented support to allow the host to redefine individual OSL +prototypes. This change enables the host to redefine OSL prototypes found +in the acpiosxf.h file. This allows the host to implement OSL interfaces +with a macro or inlined function. Further, it allows the host to add any +additional required modifiers such as __iomem, __init, __exit, etc., as +necessary on a per-interface basis. Enables maximum flexibility for the +OSL interfaces. Lv Zheng. + +Hardcoded the access width for the FADT-defined reset register. The ACPI +specification requires the reset register width to be 8 bits. ACPICA now +hardcodes the width to 8 and ignores the FADT width value. This provides +compatibility with other ACPI implementations that have allowed BIOS code +with bad register width values to go unnoticed. Matthew Garett, Bob +Moore, +Lv Zheng. + +Changed the position/use of the ACPI_PRINTF_LIKE macro. This macro is +used +in the OSL header (acpiosxf). The change modifies the position of this +macro in each instance where it is used (AcpiDebugPrint, etc.) to avoid +build issues if the OSL defines the implementation of the interface to be +an inline stub function. Lv Zheng. + +Deployed a new macro ACPI_EXPORT_SYMBOL_INIT for the main ACPICA +initialization interfaces. This change adds a new macro for the main init +and terminate external interfaces in order to support hosts that require +additional or different processing for these functions. Changed from +ACPI_EXPORT_SYMBOL to ACPI_EXPORT_SYMBOL_INIT for these functions. Lv +Zheng, Bob Moore. + +Cleaned up the memory allocation macros for configurability. In the +common +case, the ACPI_ALLOCATE and related macros now resolve directly to their +respective AcpiOs* OSL interfaces. Two options: +1) The ACPI_ALLOCATE_ZEROED macro uses a simple local implementation by +default, unless overridden by the USE_NATIVE_ALLOCATE_ZEROED define. +2) For AcpiExec (and for debugging), the macros can optionally be +resolved +to the local ACPICA interfaces that track each allocation (local tracking +is used to immediately detect memory leaks). +Lv Zheng. + +Simplified the configuration for ACPI_REDUCED_HARDWARE. Allows the kernel +to predefine this macro to either TRUE or FALSE during the system build. + +Replaced __FUNCTION_ with __func__ in the gcc-specific header. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 95.8K Code, 27.0K Data, 122.8K Total + Debug Version: 185.2K Code, 77.2K Data, 262.4K Total + Previous Release: + Non-Debug Version: 96.7K Code, 27.1K Data, 123.9K Total + Debug Version: 184.4K Code, 76.8K Data, 261.2K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented wildcard support for the -e option. This simplifies use +when there are many SSDTs that must be included to resolve external +method +declarations. ACPICA BZ 1041. Example: + iasl -e ssdt*.dat -d dsdt.dat + +AcpiExec: Add history/line-editing for Unix/Linux systems. This change +adds a portable module that implements full history and limited line +editing for Unix and Linux systems. It does not use readline() due to +portability issues. Instead it uses the POSIX termio interface to put the +terminal in raw input mode so that the various special keys can be +trapped +(such as up/down-arrow for history support and left/right-arrow for line +editing). Uses the existing debugger history mechanism. ACPICA BZ 1036. + +AcpiXtract: Add support to handle (ignore) "empty" lines containing only +one or more spaces. This provides compatible with early or different +versions of the AcpiDump utility. ACPICA BZ 1044. + +AcpiDump: Do not ignore tables that contain only an ACPI table header. +Apparently, some BIOSs create SSDTs that contain an ACPI table header but +no other data. This change adds support to dump these tables. Any tables +shorter than the length of an ACPI table header remain in error (an error +message is emitted). Reported by Yi Li. + +Debugger: Echo actual command along with the "unknown command" message. + +---------------------------------------- 23 August 2013. Summary of changes for version 20130823: 1) ACPICA kernel-resident subsystem: Copied and modified: head/sys/contrib/dev/acpica/common/acgetline.c (from r256655, vendor-sys/acpica/dist/source/common/acgetline.c) ============================================================================== --- vendor-sys/acpica/dist/source/common/acgetline.c Thu Oct 17 00:06:42 2013 (r256655, copy source) +++ head/sys/contrib/dev/acpica/common/acgetline.c Thu Oct 2 19:11:18 2014 (r272444) @@ -5,7 +5,7 @@ *****************************************************************************/ /* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 19:35:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B347E30; Thu, 2 Oct 2014 19:35:28 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9E99751; Thu, 2 Oct 2014 19:35:27 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 818C2B9D5; Thu, 2 Oct 2014 15:35:26 -0400 (EDT) From: John Baldwin To: Rui Paulo Subject: Re: svn commit: r272442 - head/sys/modules/ncr Date: Thu, 2 Oct 2014 15:07:23 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201410021845.s92Ij1ZW037196@svn.freebsd.org> In-Reply-To: <201410021845.s92Ij1ZW037196@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201410021507.23770.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 02 Oct 2014 15:35:26 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 19:35:28 -0000 On Thursday, October 02, 2014 2:45:01 pm Rui Paulo wrote: > Author: rpaulo > Date: Thu Oct 2 18:45:00 2014 > New Revision: 272442 > URL: https://svnweb.freebsd.org/changeset/base/272442 > > Log: > Remove the extra CFLAGS now that the driver has been fixed by jhb. Oops, sorry I missed that. Thanks for fixing it. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 19:53:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41D5D56B; Thu, 2 Oct 2014 19:53: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 27BFF946; Thu, 2 Oct 2014 19:53: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 s92Jref8070848; Thu, 2 Oct 2014 19:53:40 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92Jrc7i070838; Thu, 2 Oct 2014 19:53:38 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201410021953.s92Jrc7i070838@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Thu, 2 Oct 2014 19:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272445 - in head: etc/mtree usr.sbin/pw usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 19:53:40 -0000 Author: brd (doc committer) Date: Thu Oct 2 19:53:37 2014 New Revision: 272445 URL: https://svnweb.freebsd.org/changeset/base/272445 Log: - Add a test for bug 191427 where pw(8) will go into an infinite loop Reviewed by: will MFC after: 1 month Added: head/usr.sbin/pw/tests/ head/usr.sbin/pw/tests/Makefile (contents, props changed) head/usr.sbin/pw/tests/group (contents, props changed) head/usr.sbin/pw/tests/helper_functions.shin (contents, props changed) head/usr.sbin/pw/tests/master.passwd (contents, props changed) head/usr.sbin/pw/tests/pw_delete.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.sbin/pw/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Oct 2 19:11:18 2014 (r272444) +++ head/etc/mtree/BSD.tests.dist Thu Oct 2 19:53:37 2014 (r272445) @@ -287,6 +287,8 @@ .. newsyslog .. + pw + .. sa .. .. Modified: head/usr.sbin/pw/Makefile ============================================================================== --- head/usr.sbin/pw/Makefile Thu Oct 2 19:11:18 2014 (r272444) +++ head/usr.sbin/pw/Makefile Thu Oct 2 19:53:37 2014 (r272445) @@ -11,4 +11,10 @@ WARNS?= 2 DPADD= ${LIBCRYPT} ${LIBUTIL} LDADD= -lcrypt -lutil +.include + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/usr.sbin/pw/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pw/tests/Makefile Thu Oct 2 19:53:37 2014 (r272445) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.sbin/pw + +ATF_TESTS_SH= pw_delete + +FILES= group helper_functions.shin master.passwd +FILESDIR= ${TESTSDIR} + +.include Added: head/usr.sbin/pw/tests/group ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pw/tests/group Thu Oct 2 19:53:37 2014 (r272445) @@ -0,0 +1,3 @@ +# $FreeBSD$ +# +wheel:*:0:root Added: head/usr.sbin/pw/tests/helper_functions.shin ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pw/tests/helper_functions.shin Thu Oct 2 19:53:37 2014 (r272445) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# Workdir to run tests in +TESTDIR=$(atf_get_srcdir) + +# Populate the files pw needs to use into $HOME/etc +populate_etc_skel() { + cp ${TESTDIR}/master.passwd ${HOME} || \ + atf_fail "Populating master.passwd in ${HOME}" + cp ${TESTDIR}/group ${HOME} || atf_fail "Populating group in ${HOME}" + + # Generate the passwd file + pwd_mkdb -p -d ${HOME} ${HOME}/master.passwd || \ + atf_fail "generate passwd from master.passwd" +} Added: head/usr.sbin/pw/tests/master.passwd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pw/tests/master.passwd Thu Oct 2 19:53:37 2014 (r272445) @@ -0,0 +1,4 @@ +# $FreeBSD$ +# +root:*:0:0::0:0:Charlie &:/root:/bin/csh +toor:*:0:0::0:0:Bourne-again Superuser:/root: Added: head/usr.sbin/pw/tests/pw_delete.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pw/tests/pw_delete.sh Thu Oct 2 19:53:37 2014 (r272445) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +# Test that a user can be deleted when another user is part of this +# user's default group and does not go into an infinate loop. +# PR: 191427 +atf_test_case rmuser_seperate_group cleanup +rmuser_seperate_group_head() { + atf_set "timeout" "30" +} +rmuser_seperate_group_body() { + populate_etc_skel + pw -V ${HOME} useradd test || atf_fail "Creating test user" + pw -V ${HOME} groupmod test -M 'test,root' || \ + atf_fail "Modifying the group" + pw -V ${HOME} userdel test || atf_fail "delete the user" +} + + +atf_init_test_cases() { + atf_add_test_case rmuser_seperate_group +} From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 20:01:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60620AC3; Thu, 2 Oct 2014 20:01:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDA4A1E; Thu, 2 Oct 2014 20:01: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 s92K1FVC074955; Thu, 2 Oct 2014 20:01:15 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92K1EJo074951; Thu, 2 Oct 2014 20:01:14 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201410022001.s92K1EJo074951@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 2 Oct 2014 20:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272446 - in head: sbin/ifconfig 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, 02 Oct 2014 20:01:15 -0000 Author: hrs Date: Thu Oct 2 20:01:13 2014 New Revision: 272446 URL: https://svnweb.freebsd.org/changeset/base/272446 Log: Separate option handling from SIOC[SG]LAGG to SIOC[SG]LAGGOPTS for backward compatibility with old ifconfig(8). Modified: head/sbin/ifconfig/iflagg.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sbin/ifconfig/iflagg.c ============================================================================== --- head/sbin/ifconfig/iflagg.c Thu Oct 2 19:53:37 2014 (r272445) +++ head/sbin/ifconfig/iflagg.c Thu Oct 2 20:01:13 2014 (r272446) @@ -85,27 +85,27 @@ setlaggproto(const char *val, int d, int static void setlaggflowidshift(const char *val, int d, int s, const struct afswtch *afp) { - struct lagg_reqall ra; + struct lagg_reqopts ro; - bzero(&ra, sizeof(ra)); - ra.ra_opts = LAGG_OPT_FLOWIDSHIFT; - strlcpy(ra.ra_ifname, name, sizeof(ra.ra_ifname)); - ra.ra_flowid_shift = (int)strtol(val, NULL, 10); - if (ra.ra_flowid_shift & ~LAGG_OPT_FLOWIDSHIFT_MASK) + bzero(&ro, sizeof(ro)); + ro.ro_opts = LAGG_OPT_FLOWIDSHIFT; + strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname)); + ro.ro_flowid_shift = (int)strtol(val, NULL, 10); + if (ro.ro_flowid_shift & ~LAGG_OPT_FLOWIDSHIFT_MASK) errx(1, "Invalid flowid_shift option: %s", val); - if (ioctl(s, SIOCSLAGG, &ra) != 0) - err(1, "SIOCSLAGG"); + if (ioctl(s, SIOCSLAGGOPTS, &ro) != 0) + err(1, "SIOCSLAGGOPTS"); } static void setlaggsetopt(const char *val, int d, int s, const struct afswtch *afp) { - struct lagg_reqall ra; + struct lagg_reqopts ro; - bzero(&ra, sizeof(ra)); - ra.ra_opts = d; - switch (ra.ra_opts) { + bzero(&ro, sizeof(ro)); + ro.ro_opts = d; + switch (ro.ro_opts) { case LAGG_OPT_USE_FLOWID: case -LAGG_OPT_USE_FLOWID: case LAGG_OPT_LACP_STRICT: @@ -118,10 +118,10 @@ setlaggsetopt(const char *val, int d, in default: err(1, "Invalid lagg option"); } - strlcpy(ra.ra_ifname, name, sizeof(ra.ra_ifname)); + strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname)); - if (ioctl(s, SIOCSLAGG, &ra) != 0) - err(1, "SIOCSLAGG"); + if (ioctl(s, SIOCSLAGGOPTS, &ro) != 0) + err(1, "SIOCSLAGGOPTS"); } static void @@ -186,6 +186,7 @@ lagg_status(int s) struct lagg_protos lpr[] = LAGG_PROTOS; struct lagg_reqport rp, rpbuf[LAGG_MAX_PORTS]; struct lagg_reqall ra; + struct lagg_reqopts ro; struct lagg_reqflags rf; struct lacp_opreq *lp; const char *proto = ""; @@ -193,6 +194,7 @@ lagg_status(int s) bzero(&rp, sizeof(rp)); bzero(&ra, sizeof(ra)); + bzero(&ro, sizeof(ro)); strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname)); strlcpy(rp.rp_portname, name, sizeof(rp.rp_portname)); @@ -204,6 +206,9 @@ lagg_status(int s) ra.ra_size = sizeof(rpbuf); ra.ra_port = rpbuf; + strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname)); + ioctl(s, SIOCGLAGGOPTS, &ro); + strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname)); if (ioctl(s, SIOCGLAGGFLAGS, &rf) != 0) rf.rf_flags = 0; @@ -242,20 +247,20 @@ lagg_status(int s) if (verbose) { printf("\tlagg options:\n"); printf("\t\tuse_flowid: %d\n", - (ra.ra_opts & LAGG_OPT_USE_FLOWID) ? 1 : 0); - printf("\t\tflowid_shift: %d\n", ra.ra_flowid_shift); + (ro.ro_opts & LAGG_OPT_USE_FLOWID) ? 1 : 0); + printf("\t\tflowid_shift: %d\n", ro.ro_flowid_shift); switch (ra.ra_proto) { case LAGG_PROTO_LACP: printf("\t\tlacp_strict: %d\n", - (ra.ra_opts & LAGG_OPT_LACP_STRICT) ? 1 : 0); + (ro.ro_opts & LAGG_OPT_LACP_STRICT) ? 1 : 0); printf("\t\tlacp_rxtest: %d\n", - (ra.ra_opts & LAGG_OPT_LACP_RXTEST) ? 1 : 0); + (ro.ro_opts & LAGG_OPT_LACP_RXTEST) ? 1 : 0); printf("\t\tlacp_txtest: %d\n", - (ra.ra_opts & LAGG_OPT_LACP_TXTEST) ? 1 : 0); + (ro.ro_opts & LAGG_OPT_LACP_TXTEST) ? 1 : 0); } printf("\tlagg statistics:\n"); - printf("\t\tactive ports: %d\n", ra.ra_active); - printf("\t\tflapping: %u\n", ra.ra_flapping); + printf("\t\tactive ports: %d\n", ro.ro_active); + printf("\t\tflapping: %u\n", ro.ro_flapping); if (ra.ra_proto == LAGG_PROTO_LACP) { printf("\tlag id: %s\n", lacp_format_peer(lp, "\n\t\t ")); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Oct 2 19:53:37 2014 (r272445) +++ head/sys/net/if_lagg.c Thu Oct 2 20:01:13 2014 (r272446) @@ -1189,6 +1189,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd { struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; struct lagg_reqall *ra = (struct lagg_reqall *)data; + struct lagg_reqopts *ro = (struct lagg_reqopts *)data; struct lagg_reqport *rp = (struct lagg_reqport *)data, rpbuf; struct lagg_reqflags *rf = (struct lagg_reqflags *)data; struct ifreq *ifr = (struct ifreq *)data; @@ -1215,31 +1216,6 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd LAGG_RLOCK(sc, &tracker); ra->ra_proto = sc->sc_proto; lagg_proto_request(sc, &ra->ra_psc); - ra->ra_opts = sc->sc_opts; - if (sc->sc_proto == LAGG_PROTO_LACP) { - struct lacp_softc *lsc; - - lsc = (struct lacp_softc *)sc->sc_psc; - if (lsc->lsc_debug.lsc_tx_test != 0) - ra->ra_opts |= LAGG_OPT_LACP_TXTEST; - if (lsc->lsc_debug.lsc_rx_test != 0) - ra->ra_opts |= LAGG_OPT_LACP_RXTEST; - if (lsc->lsc_strict_mode != 0) - ra->ra_opts |= LAGG_OPT_LACP_STRICT; - - ra->ra_active = sc->sc_active; - } else { - /* - * LACP tracks active links automatically, - * the others do not. - */ - ra->ra_active = 0; - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) - ra->ra_active += LAGG_PORTACTIVE(lp); - } - ra->ra_flapping = sc->sc_flapping; - ra->ra_flowid_shift = sc->flowid_shift; - count = 0; buf = outbuf; len = min(ra->ra_size, buflen); @@ -1260,96 +1236,118 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd free(outbuf, M_TEMP); break; case SIOCSLAGG: - /* - * Set options or protocol depending on - * ra->ra_opts and ra->ra_proto. - */ error = priv_check(td, PRIV_NET_LAGG); if (error) break; - if (ra->ra_opts != 0) { - /* - * Set options. LACP options are stored in sc->sc_psc, - * not in sc_opts. - */ - int valid, lacp; + if (ra->ra_proto < 1 || ra->ra_proto >= LAGG_PROTO_MAX) { + error = EPROTONOSUPPORT; + break; + } - switch (ra->ra_opts) { - case LAGG_OPT_USE_FLOWID: - case -LAGG_OPT_USE_FLOWID: - case LAGG_OPT_FLOWIDSHIFT: - valid = 1; - lacp = 0; - break; + LAGG_WLOCK(sc); + lagg_proto_detach(sc); + lagg_proto_attach(sc, ra->ra_proto); + break; + case SIOCGLAGGOPTS: + ro->ro_opts = sc->sc_opts; + if (sc->sc_proto == LAGG_PROTO_LACP) { + struct lacp_softc *lsc; + + lsc = (struct lacp_softc *)sc->sc_psc; + if (lsc->lsc_debug.lsc_tx_test != 0) + ro->ro_opts |= LAGG_OPT_LACP_TXTEST; + if (lsc->lsc_debug.lsc_rx_test != 0) + ro->ro_opts |= LAGG_OPT_LACP_RXTEST; + if (lsc->lsc_strict_mode != 0) + ro->ro_opts |= LAGG_OPT_LACP_STRICT; + + ro->ro_active = sc->sc_active; + } else { + ro->ro_active = 0; + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + ro->ro_active += LAGG_PORTACTIVE(lp); + } + ro->ro_flapping = sc->sc_flapping; + ro->ro_flowid_shift = sc->flowid_shift; + break; + case SIOCSLAGGOPTS: + error = priv_check(td, PRIV_NET_LAGG); + if (error) + break; + if (ro->ro_opts == 0) + break; + /* + * Set options. LACP options are stored in sc->sc_psc, + * not in sc_opts. + */ + int valid, lacp; + + switch (ro->ro_opts) { + case LAGG_OPT_USE_FLOWID: + case -LAGG_OPT_USE_FLOWID: + case LAGG_OPT_FLOWIDSHIFT: + valid = 1; + lacp = 0; + break; + case LAGG_OPT_LACP_TXTEST: + case -LAGG_OPT_LACP_TXTEST: + case LAGG_OPT_LACP_RXTEST: + case -LAGG_OPT_LACP_RXTEST: + case LAGG_OPT_LACP_STRICT: + case -LAGG_OPT_LACP_STRICT: + valid = lacp = 1; + break; + default: + valid = lacp = 0; + break; + } + + LAGG_WLOCK(sc); + if (valid == 0 || + (lacp == 1 && sc->sc_proto != LAGG_PROTO_LACP)) { + /* Invalid combination of options specified. */ + error = EINVAL; + LAGG_WUNLOCK(sc); + break; /* Return from SIOCSLAGGOPTS. */ + } + /* + * Store new options into sc->sc_opts except for + * FLOWIDSHIFT and LACP options. + */ + if (lacp == 0) { + if (ro->ro_opts == LAGG_OPT_FLOWIDSHIFT) + sc->flowid_shift = ro->ro_flowid_shift; + else if (ro->ro_opts > 0) + sc->sc_opts |= ro->ro_opts; + else + sc->sc_opts &= ~ro->ro_opts; + } else { + struct lacp_softc *lsc; + + lsc = (struct lacp_softc *)sc->sc_psc; + + switch (ro->ro_opts) { case LAGG_OPT_LACP_TXTEST: + lsc->lsc_debug.lsc_tx_test = 1; + break; case -LAGG_OPT_LACP_TXTEST: + lsc->lsc_debug.lsc_tx_test = 0; + break; case LAGG_OPT_LACP_RXTEST: + lsc->lsc_debug.lsc_rx_test = 1; + break; case -LAGG_OPT_LACP_RXTEST: + lsc->lsc_debug.lsc_rx_test = 0; + break; case LAGG_OPT_LACP_STRICT: - case -LAGG_OPT_LACP_STRICT: - valid = lacp = 1; + lsc->lsc_strict_mode = 1; break; - default: - valid = lacp = 0; + case -LAGG_OPT_LACP_STRICT: + lsc->lsc_strict_mode = 0; break; } - - LAGG_WLOCK(sc); - if (valid == 0 || - (lacp == 1 && sc->sc_proto != LAGG_PROTO_LACP)) { - /* Invalid combination of options specified. */ - error = EINVAL; - LAGG_WUNLOCK(sc); - break; /* Return from SIOCSLAGG. */ - } - /* - * Store new options into sc->sc_opts except for - * FLOWIDSHIFT and LACP options. - */ - if (lacp == 0) { - if (ra->ra_opts == LAGG_OPT_FLOWIDSHIFT) - sc->flowid_shift = ra->ra_flowid_shift; - else if (ra->ra_opts > 0) - sc->sc_opts |= ra->ra_opts; - else - sc->sc_opts &= ~ra->ra_opts; - } else { - struct lacp_softc *lsc; - - lsc = (struct lacp_softc *)sc->sc_psc; - - switch (ra->ra_opts) { - case LAGG_OPT_LACP_TXTEST: - lsc->lsc_debug.lsc_tx_test = 1; - break; - case -LAGG_OPT_LACP_TXTEST: - lsc->lsc_debug.lsc_tx_test = 0; - break; - case LAGG_OPT_LACP_RXTEST: - lsc->lsc_debug.lsc_rx_test = 1; - break; - case -LAGG_OPT_LACP_RXTEST: - lsc->lsc_debug.lsc_rx_test = 0; - break; - case LAGG_OPT_LACP_STRICT: - lsc->lsc_strict_mode = 1; - break; - case -LAGG_OPT_LACP_STRICT: - lsc->lsc_strict_mode = 0; - break; - } - } - LAGG_WUNLOCK(sc); - break; /* Return from SIOCSLAGG. */ - } - if (ra->ra_proto < 1 || ra->ra_proto >= LAGG_PROTO_MAX) { - error = EPROTONOSUPPORT; - break; } - - LAGG_WLOCK(sc); - lagg_proto_detach(sc); - lagg_proto_attach(sc, ra->ra_proto); + LAGG_WUNLOCK(sc); break; case SIOCGLAGGFLAGS: rf->rf_flags = sc->sc_flags; Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Thu Oct 2 19:53:37 2014 (r272445) +++ head/sys/net/if_lagg.h Thu Oct 2 20:01:13 2014 (r272446) @@ -125,19 +125,6 @@ struct lagg_reqall { struct lacp_opreq rpsc_lacp; } ra_psc; #define ra_lacpreq ra_psc.rpsc_lacp - int ra_opts; /* Option bitmap */ -#define LAGG_OPT_NONE 0x00 -#define LAGG_OPT_USE_FLOWID 0x01 /* use M_FLOWID */ -/* Pseudo flags which are used in ra_opts but not stored into sc_opts. */ -#define LAGG_OPT_FLOWIDSHIFT 0x02 /* Set flowid */ -#define LAGG_OPT_FLOWIDSHIFT_MASK 0x1f /* flowid is uint32_t */ -#define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ -#define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ -#define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */ - u_int ra_count; /* number of ports */ - u_int ra_active; /* active port count */ - u_int ra_flapping; /* number of flapping */ - int ra_flowid_shift; /* shift the flowid */ }; #define SIOCGLAGG _IOWR('i', 143, struct lagg_reqall) @@ -151,6 +138,27 @@ struct lagg_reqflags { #define SIOCGLAGGFLAGS _IOWR('i', 145, struct lagg_reqflags) #define SIOCSLAGGHASH _IOW('i', 146, struct lagg_reqflags) +struct lagg_reqopts { + char ro_ifname[IFNAMSIZ]; /* name of the lagg */ + + int ro_opts; /* Option bitmap */ +#define LAGG_OPT_NONE 0x00 +#define LAGG_OPT_USE_FLOWID 0x01 /* use M_FLOWID */ +/* Pseudo flags which are used in ro_opts but not stored into sc_opts. */ +#define LAGG_OPT_FLOWIDSHIFT 0x02 /* Set flowid */ +#define LAGG_OPT_FLOWIDSHIFT_MASK 0x1f /* flowid is uint32_t */ +#define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ +#define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ +#define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */ + u_int ro_count; /* number of ports */ + u_int ro_active; /* active port count */ + u_int ro_flapping; /* number of flapping */ + int ro_flowid_shift; /* shift the flowid */ +}; + +#define SIOCGLAGGOPTS _IOWR('i', 152, struct lagg_reqopts) +#define SIOCSLAGGOPTS _IOW('i', 153, struct lagg_reqopts) + #ifdef _KERNEL /* From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 20:13:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11BEA1A8; Thu, 2 Oct 2014 20:13:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8A69BAD; Thu, 2 Oct 2014 20:13: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 s92KDqN3081489; Thu, 2 Oct 2014 20:13:52 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92KDq2T081488; Thu, 2 Oct 2014 20:13:52 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201410022013.s92KDq2T081488@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 2 Oct 2014 20:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272447 - head/sys/modules/acpi/acpi X-SVN-Group: head MIME-Version: 1.0 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, 02 Oct 2014 20:13:53 -0000 Author: jkim Date: Thu Oct 2 20:13:52 2014 New Revision: 272447 URL: https://svnweb.freebsd.org/changeset/base/272447 Log: Remove obsolete Makefile for acpi.ko. Deleted: head/sys/modules/acpi/acpi/ From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 20:17:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BE08394; Thu, 2 Oct 2014 20:17:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78EBFBD9; Thu, 2 Oct 2014 20:17: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 s92KHHbH082116; Thu, 2 Oct 2014 20:17:17 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92KHHnn082115; Thu, 2 Oct 2014 20:17:17 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201410022017.s92KHHnn082115@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 2 Oct 2014 20:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272448 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 20:17:17 -0000 Author: hrs Date: Thu Oct 2 20:17:16 2014 New Revision: 272448 URL: https://svnweb.freebsd.org/changeset/base/272448 Log: Revert r272390. Pointed out by: glebius Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Thu Oct 2 20:13:52 2014 (r272447) +++ head/sbin/ifconfig/ifconfig.c Thu Oct 2 20:17:16 2014 (r272448) @@ -903,7 +903,7 @@ unsetifdescr(const char *val, int value, "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ "\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ -"\26RXCSUM_IPV6\27TXCSUM_IPV6\30HWSTATS" +"\26RXCSUM_IPV6\27TXCSUM_IPV6" /* * Print the status of the interface. If an address family was From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 20:19:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94FD75C0; Thu, 2 Oct 2014 20:19:52 +0000 (UTC) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.allbsd.org", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 195FDBFA; Thu, 2 Oct 2014 20:19:51 +0000 (UTC) Received: from alph.d.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=56) by mail.allbsd.org (8.14.9/8.14.8) with ESMTP id s92KJSIm050867 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Oct 2014 05:19:38 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.8/8.14.8) with ESMTP id s92KJSiP023539; Fri, 3 Oct 2014 05:19:28 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Fri, 03 Oct 2014 05:19:22 +0900 (JST) Message-Id: <20141003.051922.1556521429831098306.hrs@allbsd.org> To: glebius@FreeBSD.org Subject: Re: svn commit: r272390 - head/sbin/ifconfig From: Hiroki Sato In-Reply-To: <20141002103043.GF73266@FreeBSD.org> References: <201410020019.s920JPp5004430@svn.freebsd.org> <20141002103043.GF73266@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.6 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Fri_Oct__3_05_19_22_2014_795)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Fri, 03 Oct 2014 05:19:46 +0900 (JST) X-Spam-Status: No, score=-97.9 required=13.0 tests=CONTENT_TYPE_PRESENT, RDNS_NONE,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 20:19:52 -0000 ----Security_Multipart(Fri_Oct__3_05_19_22_2014_795)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Gleb Smirnoff wrote in <20141002103043.GF73266@FreeBSD.org>: gl> On Thu, Oct 02, 2014 at 12:19:25AM +0000, Hiroki Sato wrote: gl> H> Author: hrs gl> H> Date: Thu Oct 2 00:19:24 2014 gl> H> New Revision: 272390 gl> H> URL: https://svnweb.freebsd.org/changeset/base/272390 gl> H> gl> H> Log: gl> H> Add IFCAP_HWSTATS. gl> gl> Actually this flag was a temporary workaround, which I hope to gl> remove soon. There is no reason to display it to userland. Ok, reverted. I misunderstood it as one used for some non-temporary purpose. -- Hiroki ----Security_Multipart(Fri_Oct__3_05_19_22_2014_795)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlQts0oACgkQTyzT2CeTzy0dowCgyksS0Lll0yjPit/mbLuewUtI GKAAnAmk0KvVjtyUF+BRAsZjs8mHu32g =bivz -----END PGP SIGNATURE----- ----Security_Multipart(Fri_Oct__3_05_19_22_2014_795)---- From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 21:18:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D1BBB11; Thu, 2 Oct 2014 21:18:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49F4C286; Thu, 2 Oct 2014 21:18: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 s92LIHj8010945; Thu, 2 Oct 2014 21:18:17 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92LIHrn010944; Thu, 2 Oct 2014 21:18:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410022118.s92LIHrn010944@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 2 Oct 2014 21:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272449 - 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: Thu, 02 Oct 2014 21:18:17 -0000 Author: jhb Date: Thu Oct 2 21:18:16 2014 New Revision: 272449 URL: https://svnweb.freebsd.org/changeset/base/272449 Log: Require p_cansched() for changing a process' protection status via procctl() rather than p_cansee(). Submitted by: rwatson MFC after: 3 days Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Thu Oct 2 20:17:16 2014 (r272448) +++ head/sys/kern/sys_process.c Thu Oct 2 21:18:16 2014 (r272449) @@ -1240,7 +1240,7 @@ protect_setchild(struct thread *td, stru { PROC_LOCK_ASSERT(p, MA_OWNED); - if (p->p_flag & P_SYSTEM || p_cansee(td, p) != 0) + if (p->p_flag & P_SYSTEM || p_cansched(td, p) != 0) return (0); if (flags & PPROT_SET) { p->p_flag |= P_PROTECTED; From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 21:34:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52674570; Thu, 2 Oct 2014 21:34: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 3EEBA679; Thu, 2 Oct 2014 21:34: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 s92LYrIq020095; Thu, 2 Oct 2014 21:34:53 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92LYruR020094; Thu, 2 Oct 2014 21:34:53 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201410022134.s92LYruR020094@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Thu, 2 Oct 2014 21:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272451 - head/contrib/tcpdump X-SVN-Group: head MIME-Version: 1.0 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, 02 Oct 2014 21:34:53 -0000 Author: luigi Date: Thu Oct 2 21:34:52 2014 New Revision: 272451 URL: https://svnweb.freebsd.org/changeset/base/272451 Log: add CAP_EVENT for the libpcap device so we will be able to use pcap--netmap which does poll() on the file descriptor MFC after: 2 weeks Modified: head/contrib/tcpdump/tcpdump.c Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Thu Oct 2 21:19:13 2014 (r272450) +++ head/contrib/tcpdump/tcpdump.c Thu Oct 2 21:34:52 2014 (r272451) @@ -1533,7 +1533,12 @@ main(int argc, char **argv) if (RFileName == NULL && VFileName == NULL) { static const unsigned long cmds[] = { BIOCGSTATS }; - cap_rights_init(&rights, CAP_IOCTL, CAP_READ); + /* + * the various libpcap devices use a combination of + * read (bpf), ioctl (bpf, netmap), poll (netmap) + * so we add the relevant access rights. + */ + cap_rights_init(&rights, CAP_IOCTL, CAP_READ, CAP_EVENT); if (cap_rights_limit(pcap_fileno(pd), &rights) < 0 && errno != ENOSYS) { error("unable to limit pcap descriptor"); From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 22:05:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E67A4A70; Thu, 2 Oct 2014 22:05:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2A4697A; Thu, 2 Oct 2014 22:05: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 s92M5mCL034286; Thu, 2 Oct 2014 22:05:48 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92M5mI9034285; Thu, 2 Oct 2014 22:05:48 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201410022205.s92M5mI9034285@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 2 Oct 2014 22:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272452 - 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: Thu, 02 Oct 2014 22:05:49 -0000 Author: gnn Date: Thu Oct 2 22:05:48 2014 New Revision: 272452 URL: https://svnweb.freebsd.org/changeset/base/272452 Log: Fixup the setting of the baud rate. Modified: head/sys/dev/sfxge/sfxge_port.c Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Thu Oct 2 21:34:52 2014 (r272451) +++ head/sys/dev/sfxge/sfxge_port.c Thu Oct 2 22:05:48 2014 (r272452) @@ -220,14 +220,14 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLE #endif /* SFXGE_HAVE_PAUSE_MEDIAOPTS */ -static const u_long sfxge_link_baudrate[EFX_LINK_NMODES] = { +static const uint64_t sfxge_link_baudrate[EFX_LINK_NMODES] = { [EFX_LINK_10HDX] = IF_Mbps(10), [EFX_LINK_10FDX] = IF_Mbps(10), [EFX_LINK_100HDX] = IF_Mbps(100), [EFX_LINK_100FDX] = IF_Mbps(100), [EFX_LINK_1000HDX] = IF_Gbps(1), [EFX_LINK_1000FDX] = IF_Gbps(1), - [EFX_LINK_10000FDX] = MIN(IF_Gbps(10ULL), ULONG_MAX), + [EFX_LINK_10000FDX] = IF_Gbps(10), }; void From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 22:22:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 800F9E5; Thu, 2 Oct 2014 22:22: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 6BA7FB89; Thu, 2 Oct 2014 22:22: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 s92MMZ4m043379; Thu, 2 Oct 2014 22:22:35 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92MMZXe043378; Thu, 2 Oct 2014 22:22:35 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201410022222.s92MMZXe043378@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Thu, 2 Oct 2014 22:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272454 - 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, 02 Oct 2014 22:22:35 -0000 Author: gavin Date: Thu Oct 2 22:22:34 2014 New Revision: 272454 URL: https://svnweb.freebsd.org/changeset/base/272454 Log: Add HARDWARE section of urnis(4) driver to try to gain more visibility. MFC after: 3 days Modified: head/share/man/man4/urndis.4 Modified: head/share/man/man4/urndis.4 ============================================================================== --- head/share/man/man4/urndis.4 Thu Oct 2 22:16:00 2014 (r272453) +++ head/share/man/man4/urndis.4 Thu Oct 2 22:22:34 2014 (r272454) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 25, 2014 +.Dd October 2, 2014 .Dt URNDIS 4 .Os .Sh NAME @@ -68,6 +68,12 @@ such as those commonly found on Android It does not support different media types or options. For more information on configuring this device, see .Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver supports the +.Qq tethering +functionality of many Android devices. .Sh SEE ALSO .Xr arp 4 , .Xr cdce 4 , From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 22:33:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 114F33CC; Thu, 2 Oct 2014 22:33:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5E28C66; Thu, 2 Oct 2014 22: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 s92MXZvU048149; Thu, 2 Oct 2014 22:33:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92MXZHB048148; Thu, 2 Oct 2014 22:33:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201410022233.s92MXZHB048148@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 2 Oct 2014 22:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272455 - head/cddl/contrib/opensolaris/cmd/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 02 Oct 2014 22:33:36 -0000 Author: markj Date: Thu Oct 2 22:33:35 2014 New Revision: 272455 URL: https://svnweb.freebsd.org/changeset/base/272455 Log: Have dtrace(1) handle SIGPIPE by cleaning up and exiting. Additionally, install signal handlers when running in list mode (-l), and acknowledge interrupts by cleaning up and exiting. This ensures that a command like $ dtrace -l -P 'pid$target' -p | less won't cause the ptrace(2)d target process to be killed if less(1) exits before all dtrace output is consumed. Reported by: Anton Yuzhaninov Differential Revision: https://reviews.freebsd.org/D880 Reviewed by: rpaulo MFC after: 1 month Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Thu Oct 2 22:22:34 2014 (r272454) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Thu Oct 2 22:33:35 2014 (r272455) @@ -710,6 +710,9 @@ list_probe(dtrace_hdl_t *dtp, const dtra if (g_verbose && dtrace_probe_info(dtp, pdp, &p) == 0) print_probe_info(&p); + if (g_intr != 0) + return (1); + return (0); } @@ -1220,11 +1223,34 @@ intr(int signo) g_impatient = 1; } +static void +installsighands(void) +{ + struct sigaction act, oact; + + (void) sigemptyset(&act.sa_mask); + act.sa_flags = 0; + act.sa_handler = intr; + + if (sigaction(SIGINT, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) + (void) sigaction(SIGINT, &act, NULL); + + if (sigaction(SIGTERM, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) + (void) sigaction(SIGTERM, &act, NULL); + +#if !defined(sun) + if (sigaction(SIGPIPE, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) + (void) sigaction(SIGPIPE, &act, NULL); + + if (sigaction(SIGUSR1, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) + (void) sigaction(SIGUSR1, &act, NULL); +#endif +} + int main(int argc, char *argv[]) { dtrace_bufdesc_t buf; - struct sigaction act, oact; dtrace_status_t status[2]; dtrace_optval_t opt; dtrace_cmd_t *dcp; @@ -1776,6 +1802,8 @@ main(int argc, char *argv[]) if (g_ofile != NULL && (g_ofp = fopen(g_ofile, "a")) == NULL) fatal("failed to open output file '%s'", g_ofile); + installsighands(); + oprintf("%5s %10s %17s %33s %s\n", "ID", "PROVIDER", "MODULE", "FUNCTION", "NAME"); @@ -1861,20 +1889,7 @@ main(int argc, char *argv[]) if (opt != DTRACEOPT_UNSET) notice("allowing destructive actions\n"); - (void) sigemptyset(&act.sa_mask); - act.sa_flags = 0; - act.sa_handler = intr; - - if (sigaction(SIGINT, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) - (void) sigaction(SIGINT, &act, NULL); - - if (sigaction(SIGTERM, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) - (void) sigaction(SIGTERM, &act, NULL); - -#if !defined(sun) - if (sigaction(SIGUSR1, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) - (void) sigaction(SIGUSR1, &act, NULL); -#endif + installsighands(); /* * Now that tracing is active and we are ready to consume trace data, From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 23:08:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00D0EDF0; Thu, 2 Oct 2014 23:08: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 D64EFF58; Thu, 2 Oct 2014 23:08: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 s92N8aNn062967; Thu, 2 Oct 2014 23:08:36 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92N8aAB062966; Thu, 2 Oct 2014 23:08:36 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201410022308.s92N8aAB062966@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Thu, 2 Oct 2014 23:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272457 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 02 Oct 2014 23:08:37 -0000 Author: kargl Date: Thu Oct 2 23:08:36 2014 New Revision: 272457 URL: https://svnweb.freebsd.org/changeset/base/272457 Log: Remove whitespace and 2 blank lines. Modified: head/lib/msun/src/e_lgamma_r.c Modified: head/lib/msun/src/e_lgamma_r.c ============================================================================== --- head/lib/msun/src/e_lgamma_r.c Thu Oct 2 22:52:05 2014 (r272456) +++ head/lib/msun/src/e_lgamma_r.c Thu Oct 2 23:08:36 2014 (r272457) @@ -14,12 +14,12 @@ __FBSDID("$FreeBSD$"); /* __ieee754_lgamma_r(x, signgamp) - * Reentrant version of the logarithm of the Gamma function - * with user provide pointer for the sign of Gamma(x). + * Reentrant version of the logarithm of the Gamma function + * with user provide pointer for the sign of Gamma(x). * * Method: * 1. Argument Reduction for 0 < x <= 8 - * Since gamma(1+s)=s*gamma(s), for x in [0,8], we may + * Since gamma(1+s)=s*gamma(s), for x in [0,8], we may * reduce x to a number in [1.5,2.5] by * lgamma(1+s) = log(s) + lgamma(s) * for example, @@ -57,20 +57,20 @@ __FBSDID("$FreeBSD$"); * by * 3 5 11 * w = w0 + w1*z + w2*z + w3*z + ... + w6*z - * where + * where * |w - f(z)| < 2**-58.74 - * + * * 4. For negative x, since (G is gamma function) * -x*G(-x)*G(x) = pi/sin(pi*x), * we have * G(x) = pi/(sin(pi*x)*(-x)*G(-x)) * since G(-x) is positive, sign(G(x)) = sign(sin(pi*x)) for x<0 - * Hence, for x<0, signgam = sign(sin(pi*x)) and + * Hence, for x<0, signgam = sign(sin(pi*x)) and * lgamma(x) = log(|Gamma(x)|) * = log(pi/(|x*sin(pi*x)|)) - lgamma(-x); - * Note: one should avoid compute pi*(-x) directly in the + * Note: one should avoid compute pi*(-x) directly in the * computation of sin(pi*(-x)). - * + * * 5. Special Cases * lgamma(2+s) ~ s*(1-Euler) for tiny s * lgamma(1) = lgamma(2) = 0 @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); * lgamma(0) = lgamma(neg.integer) = inf and raise divide-by-zero * lgamma(inf) = inf * lgamma(-inf) = inf (bug for bug compatible with C99!?) - * */ #include @@ -187,9 +186,9 @@ sin_pi(double x) switch (n) { case 0: y = __kernel_sin(pi*y,zero,0); break; - case 1: + case 1: case 2: y = __kernel_cos(pi*(0.5-y),zero); break; - case 3: + case 3: case 4: y = __kernel_sin(pi*(one-y),zero,0); break; case 5: case 6: y = -__kernel_cos(pi*(y-1.5),zero); break; @@ -263,7 +262,7 @@ __ieee754_lgamma_r(double x, int *signga p3 = t2+w*(t5+w*(t8+w*(t11+w*t14))); p = z*p1-(tt-w*(p2+y*p3)); r += (tf + p); break; - case 2: + case 2: p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5))))); p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5)))); r += (-0.5*y + p1/p2); @@ -291,7 +290,7 @@ __ieee754_lgamma_r(double x, int *signga y = z*z; w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*w6))))); r = (x-half)*(t-one)+w; - } else + } else /* 2**58 <= x <= inf */ r = x*(__ieee754_log(x)-one); if(hx<0) r = nadj - r; @@ -301,4 +300,3 @@ __ieee754_lgamma_r(double x, int *signga #if (LDBL_MANT_DIG == 53) __weak_reference(lgamma_r, lgammal_r); #endif - From owner-svn-src-head@FreeBSD.ORG Thu Oct 2 23:26:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F245155; Thu, 2 Oct 2014 23:26: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 789411A5; Thu, 2 Oct 2014 23:26: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 s92NQo6c072235; Thu, 2 Oct 2014 23:26:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92NQo3M072234; Thu, 2 Oct 2014 23:26:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201410022326.s92NQo3M072234@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 2 Oct 2014 23:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272458 - in head/contrib/netbsd-tests: . bin bin/cat bin/cp bin/dd bin/df bin/expr bin/pax bin/ps bin/sh bin/sh/dotcmd bin/sleep bin/tar crypto crypto/libcrypto crypto/libcrypto/bf cry... X-SVN-Group: head MIME-Version: 1.0 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, 02 Oct 2014 23:26:50 -0000 Author: ngie Date: Thu Oct 2 23:26:49 2014 New Revision: 272458 URL: https://svnweb.freebsd.org/changeset/base/272458 Log: Import the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 , minus the vendor Makefiles Provide directions for how to bootstrap the vendor sources in FREEBSD-upgrade MFC after 2 weeks Discussed with: rpaulo Sponsored by: EMC / Isilon Storage Division Added: head/contrib/netbsd-tests/ - copied from r272347, vendor/NetBSD/tests/09.30.2014_20.45/ head/contrib/netbsd-tests/FREEBSD-upgrade - copied, changed from r272269, head/contrib/pjdfstest/FREEBSD-upgrade Deleted: head/contrib/netbsd-tests/Makefile head/contrib/netbsd-tests/Makefile.inc head/contrib/netbsd-tests/README head/contrib/netbsd-tests/bin/Makefile head/contrib/netbsd-tests/bin/cat/Makefile head/contrib/netbsd-tests/bin/cp/Makefile head/contrib/netbsd-tests/bin/dd/Makefile head/contrib/netbsd-tests/bin/df/Makefile head/contrib/netbsd-tests/bin/expr/Makefile head/contrib/netbsd-tests/bin/pax/Makefile head/contrib/netbsd-tests/bin/ps/Makefile head/contrib/netbsd-tests/bin/sh/Makefile head/contrib/netbsd-tests/bin/sh/dotcmd/Makefile head/contrib/netbsd-tests/bin/sleep/Makefile head/contrib/netbsd-tests/bin/tar/Makefile head/contrib/netbsd-tests/crypto/Makefile head/contrib/netbsd-tests/crypto/Makefile.inc head/contrib/netbsd-tests/crypto/libcrypto/Makefile head/contrib/netbsd-tests/crypto/libcrypto/Makefile.inc head/contrib/netbsd-tests/crypto/libcrypto/bf/Makefile head/contrib/netbsd-tests/crypto/libcrypto/bn/Makefile head/contrib/netbsd-tests/crypto/libcrypto/bn/Makefile.inc head/contrib/netbsd-tests/crypto/libcrypto/bn/bn/Makefile head/contrib/netbsd-tests/crypto/libcrypto/bn/div/Makefile head/contrib/netbsd-tests/crypto/libcrypto/bn/exp/Makefile head/contrib/netbsd-tests/crypto/libcrypto/cast/Makefile head/contrib/netbsd-tests/crypto/libcrypto/conf/Makefile head/contrib/netbsd-tests/crypto/libcrypto/des/Makefile head/contrib/netbsd-tests/crypto/libcrypto/dh/Makefile head/contrib/netbsd-tests/crypto/libcrypto/dsa/Makefile head/contrib/netbsd-tests/crypto/libcrypto/ec/Makefile head/contrib/netbsd-tests/crypto/libcrypto/ecdh/Makefile head/contrib/netbsd-tests/crypto/libcrypto/ecdsa/Makefile head/contrib/netbsd-tests/crypto/libcrypto/engine/Makefile head/contrib/netbsd-tests/crypto/libcrypto/evp/Makefile head/contrib/netbsd-tests/crypto/libcrypto/hmac/Makefile head/contrib/netbsd-tests/crypto/libcrypto/idea/Makefile head/contrib/netbsd-tests/crypto/libcrypto/lhash/Makefile head/contrib/netbsd-tests/crypto/libcrypto/md2/Makefile head/contrib/netbsd-tests/crypto/libcrypto/md4/Makefile head/contrib/netbsd-tests/crypto/libcrypto/md5/Makefile head/contrib/netbsd-tests/crypto/libcrypto/mdc2/Makefile head/contrib/netbsd-tests/crypto/libcrypto/rand/Makefile head/contrib/netbsd-tests/crypto/libcrypto/rc2/Makefile head/contrib/netbsd-tests/crypto/libcrypto/rc4/Makefile head/contrib/netbsd-tests/crypto/libcrypto/rc5/Makefile head/contrib/netbsd-tests/crypto/libcrypto/ripemd/Makefile head/contrib/netbsd-tests/crypto/libcrypto/rsa/Makefile head/contrib/netbsd-tests/crypto/libcrypto/sha/Makefile head/contrib/netbsd-tests/crypto/libcrypto/sha1/Makefile head/contrib/netbsd-tests/crypto/libcrypto/srp/Makefile head/contrib/netbsd-tests/crypto/libcrypto/threads/Makefile head/contrib/netbsd-tests/crypto/libcrypto/x509v3/Makefile head/contrib/netbsd-tests/crypto/opencrypto/Makefile head/contrib/netbsd-tests/crypto/opencrypto/Makefile.inc head/contrib/netbsd-tests/dev/Makefile head/contrib/netbsd-tests/dev/Makefile.inc head/contrib/netbsd-tests/dev/audio/Makefile head/contrib/netbsd-tests/dev/cgd/Makefile head/contrib/netbsd-tests/dev/dm/Makefile head/contrib/netbsd-tests/dev/md/Makefile head/contrib/netbsd-tests/dev/raidframe/Makefile head/contrib/netbsd-tests/dev/scsipi/Makefile head/contrib/netbsd-tests/dev/scsipi/libscsitest/Makefile head/contrib/netbsd-tests/dev/sysmon/Makefile head/contrib/netbsd-tests/fs/Makefile head/contrib/netbsd-tests/fs/Makefile.inc head/contrib/netbsd-tests/fs/cd9660/Makefile head/contrib/netbsd-tests/fs/common/Makefile head/contrib/netbsd-tests/fs/ffs/Makefile head/contrib/netbsd-tests/fs/fifofs/Makefile head/contrib/netbsd-tests/fs/hfs/Makefile head/contrib/netbsd-tests/fs/kernfs/Makefile head/contrib/netbsd-tests/fs/lfs/Makefile head/contrib/netbsd-tests/fs/msdosfs/Makefile head/contrib/netbsd-tests/fs/nfs/Makefile head/contrib/netbsd-tests/fs/nfs/nfsservice/Makefile head/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/Makefile.inc head/contrib/netbsd-tests/fs/nullfs/Makefile head/contrib/netbsd-tests/fs/psshfs/Makefile head/contrib/netbsd-tests/fs/ptyfs/Makefile head/contrib/netbsd-tests/fs/puffs/Makefile head/contrib/netbsd-tests/fs/puffs/h_dtfs/Makefile head/contrib/netbsd-tests/fs/tmpfs/Makefile head/contrib/netbsd-tests/fs/umapfs/Makefile head/contrib/netbsd-tests/fs/union/Makefile head/contrib/netbsd-tests/fs/vfs/Makefile head/contrib/netbsd-tests/fs/zfs/Makefile head/contrib/netbsd-tests/games/Makefile head/contrib/netbsd-tests/include/Makefile head/contrib/netbsd-tests/include/Makefile.inc head/contrib/netbsd-tests/include/machine/Makefile head/contrib/netbsd-tests/include/sys/Makefile head/contrib/netbsd-tests/ipf/Makefile head/contrib/netbsd-tests/ipf/expected/Makefile head/contrib/netbsd-tests/ipf/input/Makefile head/contrib/netbsd-tests/ipf/regress/Makefile head/contrib/netbsd-tests/kernel/Makefile head/contrib/netbsd-tests/kernel/Makefile.inc head/contrib/netbsd-tests/kernel/kqueue/Makefile head/contrib/netbsd-tests/kernel/kqueue/Makefile.inc head/contrib/netbsd-tests/kernel/kqueue/read/Makefile head/contrib/netbsd-tests/kernel/kqueue/write/Makefile head/contrib/netbsd-tests/kernel/tty/Makefile head/contrib/netbsd-tests/lib/Makefile head/contrib/netbsd-tests/lib/Makefile.inc head/contrib/netbsd-tests/lib/csu/Makefile head/contrib/netbsd-tests/lib/csu/Makefile.check_stack head/contrib/netbsd-tests/lib/csu/Makefile.inc head/contrib/netbsd-tests/lib/csu/dso/Makefile head/contrib/netbsd-tests/lib/libbluetooth/Makefile head/contrib/netbsd-tests/lib/libbpfjit/Makefile head/contrib/netbsd-tests/lib/libc/Makefile head/contrib/netbsd-tests/lib/libc/Makefile.inc head/contrib/netbsd-tests/lib/libc/arch/Makefile.exec_prot head/contrib/netbsd-tests/lib/libc/c063/Makefile head/contrib/netbsd-tests/lib/libc/db/Makefile head/contrib/netbsd-tests/lib/libc/gen/Makefile head/contrib/netbsd-tests/lib/libc/gen/execve/Makefile head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/Makefile head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/Makefile.inc head/contrib/netbsd-tests/lib/libc/hash/Makefile head/contrib/netbsd-tests/lib/libc/inet/Makefile head/contrib/netbsd-tests/lib/libc/locale/Makefile head/contrib/netbsd-tests/lib/libc/net/Makefile head/contrib/netbsd-tests/lib/libc/net/Makefile.inc head/contrib/netbsd-tests/lib/libc/net/getaddrinfo/Makefile head/contrib/netbsd-tests/lib/libc/regex/Makefile head/contrib/netbsd-tests/lib/libc/rpc/Makefile head/contrib/netbsd-tests/lib/libc/setjmp/Makefile head/contrib/netbsd-tests/lib/libc/ssp/Makefile head/contrib/netbsd-tests/lib/libc/stdio/Makefile head/contrib/netbsd-tests/lib/libc/stdlib/Makefile head/contrib/netbsd-tests/lib/libc/string/Makefile head/contrib/netbsd-tests/lib/libc/sync/Makefile head/contrib/netbsd-tests/lib/libc/sys/Makefile head/contrib/netbsd-tests/lib/libc/termios/Makefile head/contrib/netbsd-tests/lib/libc/time/Makefile head/contrib/netbsd-tests/lib/libc/tls/Makefile head/contrib/netbsd-tests/lib/libc/tls/Makefile.inc head/contrib/netbsd-tests/lib/libc/tls/dso/Makefile head/contrib/netbsd-tests/lib/libc/tls_dso/Makefile head/contrib/netbsd-tests/lib/libc/ttyio/Makefile head/contrib/netbsd-tests/lib/libcrypt/Makefile head/contrib/netbsd-tests/lib/libcurses/Makefile head/contrib/netbsd-tests/lib/libcurses/Makefile.inc head/contrib/netbsd-tests/lib/libcurses/check_files/Makefile head/contrib/netbsd-tests/lib/libcurses/director/Makefile head/contrib/netbsd-tests/lib/libcurses/slave/Makefile head/contrib/netbsd-tests/lib/libcurses/tests/Makefile head/contrib/netbsd-tests/lib/libdes/Makefile head/contrib/netbsd-tests/lib/libevent/Makefile head/contrib/netbsd-tests/lib/libexecinfo/Makefile head/contrib/netbsd-tests/lib/libm/Makefile head/contrib/netbsd-tests/lib/libobjc/Makefile head/contrib/netbsd-tests/lib/libposix/Makefile head/contrib/netbsd-tests/lib/libposix/Makefile.inc head/contrib/netbsd-tests/lib/libposix/bsd/Makefile head/contrib/netbsd-tests/lib/libposix/posix1/Makefile head/contrib/netbsd-tests/lib/libposix/posix2/Makefile head/contrib/netbsd-tests/lib/libppath/Makefile head/contrib/netbsd-tests/lib/libprop/Makefile head/contrib/netbsd-tests/lib/libpthread/Makefile head/contrib/netbsd-tests/lib/libpthread/dlopen/Makefile head/contrib/netbsd-tests/lib/libpthread/dlopen/dso/Makefile head/contrib/netbsd-tests/lib/librt/Makefile head/contrib/netbsd-tests/lib/librumpclient/Makefile head/contrib/netbsd-tests/lib/librumphijack/Makefile head/contrib/netbsd-tests/lib/libskey/Makefile head/contrib/netbsd-tests/lib/libsljit/Makefile head/contrib/netbsd-tests/lib/libtre/Makefile head/contrib/netbsd-tests/lib/libutil/Makefile head/contrib/netbsd-tests/lib/semaphore/Makefile head/contrib/netbsd-tests/lib/semaphore/Makefile.inc head/contrib/netbsd-tests/lib/semaphore/pthread/Makefile head/contrib/netbsd-tests/libexec/Makefile head/contrib/netbsd-tests/libexec/Makefile.inc head/contrib/netbsd-tests/libexec/ld.elf_so/Makefile head/contrib/netbsd-tests/libexec/ld.elf_so/Makefile.inc head/contrib/netbsd-tests/libexec/ld.elf_so/data/Makefile head/contrib/netbsd-tests/libexec/ld.elf_so/helper_dso1/Makefile head/contrib/netbsd-tests/libexec/ld.elf_so/helper_dso2/Makefile head/contrib/netbsd-tests/libexec/ld.elf_so/helper_ifunc_dso/Makefile head/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso0/Makefile head/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso1/Makefile head/contrib/netbsd-tests/libexec/ld.elf_so/helper_symver_dso2/Makefile head/contrib/netbsd-tests/modules/Makefile head/contrib/netbsd-tests/modules/Makefile.inc head/contrib/netbsd-tests/modules/k_helper/Makefile head/contrib/netbsd-tests/modules/k_helper2/Makefile head/contrib/netbsd-tests/modules/k_helper3/Makefile head/contrib/netbsd-tests/modules/k_uvm/Makefile head/contrib/netbsd-tests/net/Makefile head/contrib/netbsd-tests/net/Makefile.inc head/contrib/netbsd-tests/net/bpf/Makefile head/contrib/netbsd-tests/net/bpfilter/Makefile head/contrib/netbsd-tests/net/bpfjit/Makefile head/contrib/netbsd-tests/net/carp/Makefile head/contrib/netbsd-tests/net/fdpass/Makefile head/contrib/netbsd-tests/net/icmp/Makefile head/contrib/netbsd-tests/net/if/Makefile head/contrib/netbsd-tests/net/if_bridge/Makefile head/contrib/netbsd-tests/net/if_loop/Makefile head/contrib/netbsd-tests/net/mpls/Makefile head/contrib/netbsd-tests/net/net/Makefile head/contrib/netbsd-tests/net/npf/Makefile head/contrib/netbsd-tests/net/route/Makefile head/contrib/netbsd-tests/net/sys/Makefile head/contrib/netbsd-tests/rump/Makefile head/contrib/netbsd-tests/rump/Makefile.inc head/contrib/netbsd-tests/rump/kernspace/Makefile head/contrib/netbsd-tests/rump/modautoload/Makefile head/contrib/netbsd-tests/rump/rumpkern/Makefile head/contrib/netbsd-tests/rump/rumpkern/h_client/Makefile head/contrib/netbsd-tests/rump/rumpkern/h_server/Makefile head/contrib/netbsd-tests/rump/rumpnet/Makefile head/contrib/netbsd-tests/rump/rumpvfs/Makefile head/contrib/netbsd-tests/sbin/Makefile head/contrib/netbsd-tests/sbin/Makefile.inc head/contrib/netbsd-tests/sbin/fsck_ffs/Makefile head/contrib/netbsd-tests/sbin/ifconfig/Makefile head/contrib/netbsd-tests/sbin/newfs/Makefile head/contrib/netbsd-tests/sbin/newfs_msdos/Makefile head/contrib/netbsd-tests/sbin/resize_ffs/Makefile head/contrib/netbsd-tests/sbin/route/Makefile head/contrib/netbsd-tests/sbin/sysctl/Makefile head/contrib/netbsd-tests/share/Makefile head/contrib/netbsd-tests/share/examples/Makefile head/contrib/netbsd-tests/share/mk/Makefile head/contrib/netbsd-tests/sys/Makefile head/contrib/netbsd-tests/sys/rc/Makefile head/contrib/netbsd-tests/usr.bin/Makefile head/contrib/netbsd-tests/usr.bin/awk/Makefile head/contrib/netbsd-tests/usr.bin/basename/Makefile head/contrib/netbsd-tests/usr.bin/bzip2/Makefile head/contrib/netbsd-tests/usr.bin/cc/Makefile head/contrib/netbsd-tests/usr.bin/cmp/Makefile head/contrib/netbsd-tests/usr.bin/config/Makefile head/contrib/netbsd-tests/usr.bin/config/support/Makefile head/contrib/netbsd-tests/usr.bin/config/support/arch/Makefile head/contrib/netbsd-tests/usr.bin/config/support/arch/regress/Makefile head/contrib/netbsd-tests/usr.bin/config/support/arch/regress/conf/Makefile head/contrib/netbsd-tests/usr.bin/config/support/arch/regress/conf/Makefile.regress head/contrib/netbsd-tests/usr.bin/config/support/conf/Makefile head/contrib/netbsd-tests/usr.bin/cut/Makefile head/contrib/netbsd-tests/usr.bin/diff/Makefile head/contrib/netbsd-tests/usr.bin/dirname/Makefile head/contrib/netbsd-tests/usr.bin/find/Makefile head/contrib/netbsd-tests/usr.bin/grep/Makefile head/contrib/netbsd-tests/usr.bin/gzip/Makefile head/contrib/netbsd-tests/usr.bin/id/Makefile head/contrib/netbsd-tests/usr.bin/infocmp/Makefile head/contrib/netbsd-tests/usr.bin/jot/Makefile head/contrib/netbsd-tests/usr.bin/m4/Makefile head/contrib/netbsd-tests/usr.bin/make/Makefile head/contrib/netbsd-tests/usr.bin/mkdep/Makefile head/contrib/netbsd-tests/usr.bin/nbperf/Makefile head/contrib/netbsd-tests/usr.bin/netpgpverify/Makefile head/contrib/netbsd-tests/usr.bin/pr/Makefile head/contrib/netbsd-tests/usr.bin/rump_server/Makefile head/contrib/netbsd-tests/usr.bin/sdiff/Makefile head/contrib/netbsd-tests/usr.bin/sed/Makefile head/contrib/netbsd-tests/usr.bin/shmif_dumpbus/Makefile head/contrib/netbsd-tests/usr.bin/sort/Makefile head/contrib/netbsd-tests/usr.bin/tmux/Makefile head/contrib/netbsd-tests/usr.bin/tr/Makefile head/contrib/netbsd-tests/usr.bin/unifdef/Makefile head/contrib/netbsd-tests/usr.bin/vmstat/Makefile head/contrib/netbsd-tests/usr.bin/xlint/Makefile head/contrib/netbsd-tests/usr.bin/xlint/lint1/Makefile head/contrib/netbsd-tests/usr.sbin/Makefile head/contrib/netbsd-tests/usr.sbin/mtree/Makefile head/contrib/netbsd-tests/usr.sbin/tcpdump/Makefile head/contrib/netbsd-tests/usr.sbin/traceroute/Makefile head/contrib/netbsd-tests/usr.sbin/useradd/Makefile Copied and modified: head/contrib/netbsd-tests/FREEBSD-upgrade (from r272269, head/contrib/pjdfstest/FREEBSD-upgrade) ============================================================================== --- head/contrib/pjdfstest/FREEBSD-upgrade Sun Sep 28 20:06:02 2014 (r272269, copy source) +++ head/contrib/netbsd-tests/FREEBSD-upgrade Thu Oct 2 23:26:49 2014 (r272458) @@ -1,23 +1,36 @@ $FreeBSD$ This document contains a collection of notes specific to the import -of pjdfstest into head. These notes are built on the instructions in -the FreeBSD Subversion Primer that detail how to deal with vendor +of the NetBSD test suite into head. These notes are built on the instructions +in the FreeBSD Subversion Primer that detail how to deal with vendor branches and you are supposed to follow those: http://www.freebsd.org/doc/en/articles/committers-guide/subversion-primer.html -The pjdfstest source code is hosted on GitHub: +The NetBSD test source code was originally obtained via NetBSD anoncvs as +described in the NetBSD handbook: - https://github.com/pjd/pjdfstest + http://www.netbsd.org/docs/guide/en/chap-fetch.html#chap-fetch-cvs -and is imported into the pjdfstest vendor branch (see base/vendor/pjdfstest/). +and is imported into the NetBSD/tests vendor branch (see +base/vendor/NetBSD/tests/). + +The process used to bootstrap the vendor tree was similar to the following: + + /bin/sh + export CVSROOT="anoncvs@anoncvs.NetBSD.org:/cvsroot" + cvs -z9 co -D "09/30/2014 20:45" -P src/tests + mv src/tests/* tests/dist/. + +Please adjust the checkout date spec (the argument passed via -D) to match +the desired checkout time. To merge the vendor branch into head do something like this: - cd .../base/head/contrib/pjdfstest + cd .../base/head/contrib/netbsd-tests svn merge --accept=postpone \ - svn+ssh://svn.freebsd.org/base/vendor/pjdfstest/dist . + svn+ssh://svn.freebsd.org/base/vendor/NetBSD/tests/dist . + find . -name Makefile\* | xargs svn rm --force and resolve any conflicts that may arise at this point. From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 01:20:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16AE979E; Fri, 3 Oct 2014 01:20:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03515D9D; Fri, 3 Oct 2014 01:20: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 s931Kn2O030671; Fri, 3 Oct 2014 01:20:49 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s931Knx0030670; Fri, 3 Oct 2014 01:20:49 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201410030120.s931Knx0030670@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 3 Oct 2014 01:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272465 - 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, 03 Oct 2014 01:20:50 -0000 Author: kevlo Date: Fri Oct 3 01:20:49 2014 New Revision: 272465 URL: https://svnweb.freebsd.org/changeset/base/272465 Log: Mention umoscom(4) and uslcom(4). Modified: head/share/man/man4/ucom.4 Modified: head/share/man/man4/ucom.4 ============================================================================== --- head/share/man/man4/ucom.4 Fri Oct 3 00:58:42 2014 (r272464) +++ head/share/man/man4/ucom.4 Fri Oct 3 01:20:49 2014 (r272465) @@ -81,8 +81,10 @@ multiple external ports. .Xr umcs 4 , .Xr umct 4 , .Xr umodem 4 , +.Xr umoscom 4 , .Xr uplcom 4 , .Xr usb 4 , +.Xr uslcom 4 , .Xr uvisor 4 , .Xr uvscom 4 .Sh HISTORY From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 01:39:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B615B55; Fri, 3 Oct 2014 01:39: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 383D6F22; Fri, 3 Oct 2014 01:39: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 s931dY9A036974; Fri, 3 Oct 2014 01:39:34 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s931dYUP036973; Fri, 3 Oct 2014 01:39:34 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201410030139.s931dYUP036973@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 3 Oct 2014 01:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272466 - 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, 03 Oct 2014 01:39:34 -0000 Author: kevlo Date: Fri Oct 3 01:39:33 2014 New Revision: 272466 URL: https://svnweb.freebsd.org/changeset/base/272466 Log: bump .Dd Reported by: gjb Modified: head/share/man/man4/ucom.4 Modified: head/share/man/man4/ucom.4 ============================================================================== --- head/share/man/man4/ucom.4 Fri Oct 3 01:20:49 2014 (r272465) +++ head/share/man/man4/ucom.4 Fri Oct 3 01:39:33 2014 (r272466) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2008 +.Dd October 3, 2014 .Dt UCOM 4 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 02:24:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5C9D3AC; Fri, 3 Oct 2014 02:24: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 8757B3B0; Fri, 3 Oct 2014 02:24: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 s932OhaG059973; Fri, 3 Oct 2014 02:24:43 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s932OfSw059966; Fri, 3 Oct 2014 02:24:41 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201410030224.s932OfSw059966@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 3 Oct 2014 02:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272467 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nfs fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 03 Oct 2014 02:24:43 -0000 Author: araujo (ports committer) Date: Fri Oct 3 02:24:41 2014 New Revision: 272467 URL: https://svnweb.freebsd.org/changeset/base/272467 Log: Fix failures and warnings reported by newpynfs20090424 test tool. This fix addresses only issues with the pynfs reports, none of these issues are know to create problems for extant real clients. Submitted by: Bart Hsiao Reworked by: myself Reviewed by: rmacklem Approved by: rmacklem Sponsored by: QNAP Systems Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfs/nfsproto.h head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Oct 3 01:39:33 2014 (r272466) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Oct 3 02:24:41 2014 (r272467) @@ -2837,6 +2837,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i #endif vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ + vap->va_filerev = zp->z_seq; /* * Add in any requested optional attributes and the create time. Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Fri Oct 3 01:39:33 2014 (r272466) +++ head/sys/fs/nfs/nfs_commonsubs.c Fri Oct 3 02:24:41 2014 (r272467) @@ -820,7 +820,6 @@ nfsv4_loadattr(struct nfsrv_descript *nd struct dqblk dqb; uid_t savuid; #endif - if (compare) { retnotsup = 0; error = nfsrv_getattrbits(nd, &attrbits, NULL, &retnotsup); @@ -902,6 +901,12 @@ nfsv4_loadattr(struct nfsrv_descript *nd goto nfsmout; if (compare && !(*retcmpp)) { NFSSETSUPP_ATTRBIT(&checkattrbits); + + /* Some filesystem do not support NFSv4ACL */ + if (nfsrv_useacl == 0 || nfs_supportsnfsv4acls(vp) == 0) { + NFSCLRBIT_ATTRBIT(&checkattrbits, NFSATTRBIT_ACL); + NFSCLRBIT_ATTRBIT(&checkattrbits, NFSATTRBIT_ACLSUPPORT); + } if (!NFSEQUAL_ATTRBIT(&retattrbits, &checkattrbits) || retnotsup) *retcmpp = NFSERR_NOTSAME; @@ -1052,7 +1057,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd case NFSATTRBIT_ACL: if (compare) { if (!(*retcmpp)) { - if (nfsrv_useacl) { + if (nfsrv_useacl && nfs_supportsnfsv4acls(vp)) { NFSACL_T *naclp; naclp = acl_alloc(M_WAITOK); @@ -1073,21 +1078,22 @@ nfsv4_loadattr(struct nfsrv_descript *nd } } } else { - if (vp != NULL && aclp != NULL) - error = nfsrv_dissectacl(nd, aclp, &aceerr, - &cnt, p); - else - error = nfsrv_dissectacl(nd, NULL, &aceerr, - &cnt, p); - if (error) - goto nfsmout; + if (vp != NULL && aclp != NULL) + error = nfsrv_dissectacl(nd, aclp, &aceerr, + &cnt, p); + else + error = nfsrv_dissectacl(nd, NULL, &aceerr, + &cnt, p); + if (error) + goto nfsmout; } + attrsum += cnt; break; case NFSATTRBIT_ACLSUPPORT: NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); if (compare && !(*retcmpp)) { - if (nfsrv_useacl) { + if (nfsrv_useacl && nfs_supportsnfsv4acls(vp)) { if (fxdr_unsigned(u_int32_t, *tl) != NFSV4ACE_SUPTYPES) *retcmpp = NFSERR_NOTSAME; @@ -2090,6 +2096,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd } } } + /* * Put out the attribute bitmap for the ones being filled in * and get the field for the number of attributes returned. Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Fri Oct 3 01:39:33 2014 (r272466) +++ head/sys/fs/nfs/nfs_var.h Fri Oct 3 02:24:41 2014 (r272467) @@ -644,9 +644,9 @@ int nfsvno_updfilerev(vnode_t, struct nf int nfsvno_fillattr(struct nfsrv_descript *, struct mount *, vnode_t, struct nfsvattr *, fhandle_t *, int, nfsattrbit_t *, struct ucred *, NFSPROC_T *, int, int, int, int, uint64_t); -int nfsrv_sattr(struct nfsrv_descript *, struct nfsvattr *, nfsattrbit_t *, +int nfsrv_sattr(struct nfsrv_descript *, vnode_t, struct nfsvattr *, nfsattrbit_t *, NFSACL_T *, NFSPROC_T *); -int nfsv4_sattr(struct nfsrv_descript *, struct nfsvattr *, nfsattrbit_t *, +int nfsv4_sattr(struct nfsrv_descript *, vnode_t, struct nfsvattr *, nfsattrbit_t *, NFSACL_T *, NFSPROC_T *); int nfsvno_checkexp(mount_t, NFSSOCKADDR_T, struct nfsexstuff *, struct ucred **); Modified: head/sys/fs/nfs/nfsproto.h ============================================================================== --- head/sys/fs/nfs/nfsproto.h Fri Oct 3 01:39:33 2014 (r272466) +++ head/sys/fs/nfs/nfsproto.h Fri Oct 3 02:24:41 2014 (r272467) @@ -996,7 +996,11 @@ struct nfsv3_sattr { NFSATTRBM_TIMEDELTA | \ NFSATTRBM_TIMEMETADATA | \ NFSATTRBM_TIMEMODIFY | \ - NFSATTRBM_MOUNTEDONFILEID) + NFSATTRBM_MOUNTEDONFILEID | \ + NFSATTRBM_QUOTAHARD | \ + NFSATTRBM_QUOTASOFT | \ + NFSATTRBM_QUOTAUSED) + #ifdef QUOTA /* Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri Oct 3 01:39:33 2014 (r272466) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Fri Oct 3 02:24:41 2014 (r272467) @@ -1008,7 +1008,7 @@ nfsvno_getsymlink(struct nfsrv_descript *pathcpp = NULL; *lenp = 0; if ((nd->nd_flag & ND_NFSV3) && - (error = nfsrv_sattr(nd, nvap, NULL, NULL, p))) + (error = nfsrv_sattr(nd, NULL, nvap, NULL, NULL, p))) goto nfsmout; NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); len = fxdr_unsigned(int, *tl); @@ -2298,7 +2298,7 @@ nfsmout: * (Return 0 or EBADRPC) */ int -nfsrv_sattr(struct nfsrv_descript *nd, struct nfsvattr *nvap, +nfsrv_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, nfsattrbit_t *attrbitp, NFSACL_T *aclp, struct thread *p) { u_int32_t *tl; @@ -2380,7 +2380,7 @@ nfsrv_sattr(struct nfsrv_descript *nd, s }; break; case ND_NFSV4: - error = nfsv4_sattr(nd, nvap, attrbitp, aclp, p); + error = nfsv4_sattr(nd, vp, nvap, attrbitp, aclp, p); }; nfsmout: NFSEXITCODE2(error, nd); @@ -2392,7 +2392,7 @@ nfsmout: * Returns NFSERR_BADXDR if it can't be parsed, 0 otherwise. */ int -nfsv4_sattr(struct nfsrv_descript *nd, struct nfsvattr *nvap, +nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, nfsattrbit_t *attrbitp, NFSACL_T *aclp, struct thread *p) { u_int32_t *tl; @@ -2429,6 +2429,11 @@ nfsv4_sattr(struct nfsrv_descript *nd, s switch (bitpos) { case NFSATTRBIT_SIZE: NFSM_DISSECT(tl, u_int32_t *, NFSX_HYPER); + if (vp != NULL && vp->v_type != VREG) { + error = (vp->v_type == VDIR) ? NFSERR_ISDIR : + NFSERR_INVAL; + goto nfsmout; + } nvap->na_size = fxdr_hyper(tl); attrsum += NFSX_HYPER; break; Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Fri Oct 3 01:39:33 2014 (r272466) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Fri Oct 3 02:24:41 2014 (r272467) @@ -210,6 +210,17 @@ nfsrvd_getattr(struct nfsrv_descript *nd if (nd->nd_repstat == 0) { accmode = 0; NFSSET_ATTRBIT(&tmpbits, &attrbits); + + /* + * GETATTR with write-only attr time_access_set and time_modify_set + * should return NFS4ERR_INVAL. + */ + if (NFSISSET_ATTRBIT(&tmpbits, NFSATTRBIT_TIMEACCESSSET) || + NFSISSET_ATTRBIT(&tmpbits, NFSATTRBIT_TIMEMODIFYSET)){ + error = NFSERR_INVAL; + vput(vp); + goto out; + } if (NFSISSET_ATTRBIT(&tmpbits, NFSATTRBIT_ACL)) { NFSCLRBIT_ATTRBIT(&tmpbits, NFSATTRBIT_ACL); accmode |= VREAD_ACL; @@ -315,7 +326,7 @@ nfsrvd_setattr(struct nfsrv_descript *nd stateid.seqid = fxdr_unsigned(u_int32_t, *tl++); NFSBCOPY((caddr_t)tl,(caddr_t)stateid.other,NFSX_STATEIDOTHER); } - error = nfsrv_sattr(nd, &nva, &attrbits, aclp, p); + error = nfsrv_sattr(nd, vp, &nva, &attrbits, aclp, p); if (error) goto nfsmout; preat_ret = nfsvno_getattr(vp, &nva2, nd->nd_cred, p, 1); @@ -1019,7 +1030,7 @@ nfsrvd_create(struct nfsrv_descript *nd, switch (how) { case NFSCREATE_GUARDED: case NFSCREATE_UNCHECKED: - error = nfsrv_sattr(nd, &nva, NULL, NULL, p); + error = nfsrv_sattr(nd, NULL, &nva, NULL, NULL, p); if (error) goto nfsmout; break; @@ -1204,7 +1215,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); vtyp = nfsv34tov_type(*tl); } - error = nfsrv_sattr(nd, &nva, &attrbits, aclp, p); + error = nfsrv_sattr(nd, NULL, &nva, &attrbits, aclp, p); if (error) goto nfsmout; nva.na_type = vtyp; @@ -1850,7 +1861,7 @@ nfsrvd_mkdir(struct nfsrv_descript *nd, if (!nd->nd_repstat) { NFSVNO_ATTRINIT(&nva); if (nd->nd_flag & ND_NFSV3) { - error = nfsrv_sattr(nd, &nva, NULL, NULL, p); + error = nfsrv_sattr(nd, NULL, &nva, NULL, NULL, p); if (error) goto nfsmout; } else { @@ -1967,11 +1978,21 @@ nfsrvd_commit(struct nfsrv_descript *nd, int error = 0, for_ret = 1, aft_ret = 1, cnt; u_int64_t off; - if (nd->nd_repstat) { + if (nd->nd_repstat) { nfsrv_wcc(nd, for_ret, &bfor, aft_ret, &aft); goto out; } + + /* Return NFSERR_ISDIR in NFSv4 when commit on a directory. */ + if (vp->v_type != VREG) { + if (nd->nd_flag & ND_NFSV3) + error = NFSERR_NOTSUPP; + else + error = (vp->v_type == VDIR) ? NFSERR_ISDIR : NFSERR_INVAL; + goto nfsmout; + } NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED); + /* * XXX At this time VOP_FSYNC() does not accept offset and byte * count parameters, so these arguments are useless (someday maybe). @@ -2683,7 +2704,7 @@ nfsrvd_open(struct nfsrv_descript *nd, _ switch (how) { case NFSCREATE_UNCHECKED: case NFSCREATE_GUARDED: - error = nfsv4_sattr(nd, &nva, &attrbits, aclp, p); + error = nfsv4_sattr(nd, NULL, &nva, &attrbits, aclp, p); if (error) goto nfsmout; /* @@ -2707,7 +2728,7 @@ nfsrvd_open(struct nfsrv_descript *nd, _ NFSM_DISSECT(tl, u_int32_t *, NFSX_VERF); cverf[0] = *tl++; cverf[1] = *tl; - error = nfsv4_sattr(nd, &nva, &attrbits, aclp, p); + error = nfsv4_sattr(nd, vp, &nva, &attrbits, aclp, p); if (error != 0) goto nfsmout; if (NFSISSET_ATTRBIT(&attrbits, @@ -2858,7 +2879,7 @@ nfsrvd_open(struct nfsrv_descript *nd, _ * The IETF working group decided that this is the correct * error return for all non-regular files. */ - nd->nd_repstat = NFSERR_SYMLINK; + nd->nd_repstat = (vp->v_type == VDIR) ? NFSERR_ISDIR : NFSERR_SYMLINK; } if (!nd->nd_repstat && (stp->ls_flags & NFSLCK_WRITEACCESS)) nd->nd_repstat = nfsvno_accchk(vp, VWRITE, nd->nd_cred, @@ -3197,6 +3218,11 @@ nfsrvd_opendowngrade(struct nfsrv_descri nfsv4stateid_t stateid; nfsquad_t clientid; + /* opendowngrade can only work on a file object.*/ + if (vp->v_type != VREG) { + error = NFSERR_INVAL; + goto nfsmout; + } NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID + 3 * NFSX_UNSIGNED); stp->ls_ownerlen = 0; stp->ls_op = nd->nd_rp; Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Oct 3 01:39:33 2014 (r272466) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Oct 3 02:24:41 2014 (r272467) @@ -1628,9 +1628,17 @@ tryagain: */ if (error == 0 && (stp->ls_flags & NFSLCK_OPEN) && ((stp->ls_openowner->ls_flags & NFSLCK_NEEDSCONFIRM) || - (getlckret == 0 && stp->ls_lfp != lfp))) - error = NFSERR_BADSTATEID; - if (error == 0 && + (getlckret == 0 && stp->ls_lfp != lfp))){ + /* + * NFSLCK_SETATTR should return OK rather than NFSERR_BADSTATEID + * The only exception is using SETATTR with SIZE. + * */ + if ((new_stp->ls_flags & + (NFSLCK_SETATTR | NFSLCK_CHECK)) != NFSLCK_SETATTR) + error = NFSERR_BADSTATEID; + } + + if (error == 0 && (stp->ls_flags & (NFSLCK_DELEGREAD | NFSLCK_DELEGWRITE)) && getlckret == 0 && stp->ls_lfp != lfp) error = NFSERR_BADSTATEID; @@ -4909,12 +4917,17 @@ tryagain: * Now, look for a conflicting open share. */ if (remove) { - LIST_FOREACH(stp, &lfp->lf_open, ls_file) { - if (stp->ls_flags & NFSLCK_WRITEDENY) { - error = NFSERR_FILEOPEN; - break; + /* + * If the entry in the directory was the last reference to the + * corresponding filesystem object, the object can be destroyed + * */ + if(lfp->lf_usecount>1) + LIST_FOREACH(stp, &lfp->lf_open, ls_file) { + if (stp->ls_flags & NFSLCK_WRITEDENY) { + error = NFSERR_FILEOPEN; + break; + } } - } } NFSUNLOCKSTATE(); From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 04:13:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4C1FED9; Fri, 3 Oct 2014 04:13:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2526F74; Fri, 3 Oct 2014 04:13: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 s934DPwc012128; Fri, 3 Oct 2014 04:13:25 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s934DPR2012127; Fri, 3 Oct 2014 04:13:25 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201410030413.s934DPR2012127@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Fri, 3 Oct 2014 04:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272468 - 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: Fri, 03 Oct 2014 04:13:26 -0000 Author: hrs Date: Fri Oct 3 04:13:25 2014 New Revision: 272468 URL: https://svnweb.freebsd.org/changeset/base/272468 Log: Fix a bug in r272297 which prevented dumpdev from setting. !u is not equivalent to (u != 0). Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Fri Oct 3 02:24:41 2014 (r272467) +++ head/sys/geom/geom_dev.c Fri Oct 3 04:13:25 2014 (r272468) @@ -395,7 +395,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd error = g_io_getattr("GEOM::frontstuff", cp, &i, data); break; case DIOCSKERNELDUMP: - if (*(u_int *)data != 0) { + if (*(u_int *)data == 0) { error = set_dumper(NULL, NULL); break; } From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 08:09:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A48B886; Fri, 3 Oct 2014 08:09:22 +0000 (UTC) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com [IPv6:2a00:1450:4010:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 327F078B; Fri, 3 Oct 2014 08:09:21 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id ge10so600725lab.10 for ; Fri, 03 Oct 2014 01:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=JLPO7V+nYbESt0Tzu1Cxumh//71/1TrAFqXe3Bc9vFY=; b=IKWr/ZfY0VArtYCXDqFOSaxwXsNywgSEwu7jL7kL2R0TOt6k4zipS32UUlh5vgWJJW qWulUe0M/5bH9iAGJogtnzvozE5qXehU2EHVN0H3lQRwR/Bk4JNO3RBTxXcIAhqrqZEz d/OYiFEMgDn62mg4brNKe35r64CbXLXuPj79YmMRE9maoIfM+R/yQfXBdrCFXh5gfvc1 xjGIPCsmp5QGDF36+WqNnttVcPMr8dEoLKU/EwuUAerd0kfgrGLehdZmYX+UJK09LpWE KR+ai+THzCTo7edOUMbl8loMcxemtt8tmw80rEgmEiFW5rJlQlhHUongphIxHhdoWKh2 BUGw== X-Received: by 10.152.4.165 with SMTP id l5mr3950796lal.49.1412323758908; Fri, 03 Oct 2014 01:09:18 -0700 (PDT) Received: from brick.home (adcv67.neoplus.adsl.tpnet.pl. [79.184.47.67]) by mx.google.com with ESMTPSA id b1sm2421676lah.34.2014.10.03.01.09.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Oct 2014 01:09:18 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 3 Oct 2014 10:09:15 +0200 From: Edward Tomasz Napierala To: Gleb Smirnoff Subject: Re: svn commit: r272403 - head/sys/fs/autofs Message-ID: <20141003080915.GA93114@brick.home> Mail-Followup-To: Gleb Smirnoff , kib@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201410021031.s92AVW0d096515@svn.freebsd.org> <20141002103556.GH73266@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141002103556.GH73266@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, kib@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, 03 Oct 2014 08:09:22 -0000 On 1002T1435, Gleb Smirnoff wrote: > On Thu, Oct 02, 2014 at 10:31:32AM +0000, Edward Tomasz Napierala wrote: > E> Author: trasz > E> Date: Thu Oct 2 10:31:32 2014 > E> New Revision: 272403 > E> URL: https://svnweb.freebsd.org/changeset/base/272403 > E> > E> Log: > E> Make autofs timeout handling use timeout task instead of callout; > E> that's because the handler can sleep on sx lock. > > How long can it sleep? AFAIU, the taskqueue_thread is used by other > subsystems. For the duration of M_WAITOK allocation. From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 08:46:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C134694C; Fri, 3 Oct 2014 08:46: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 ADAD1BB4; Fri, 3 Oct 2014 08:46: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 s938ko4J037453; Fri, 3 Oct 2014 08:46:50 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s938koJ6037452; Fri, 3 Oct 2014 08:46:50 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201410030846.s938koJ6037452@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 3 Oct 2014 08:46:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272469 - 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: Fri, 03 Oct 2014 08:46:50 -0000 Author: tuexen Date: Fri Oct 3 08:46:49 2014 New Revision: 272469 URL: https://svnweb.freebsd.org/changeset/base/272469 Log: UPD and UDPLite require a checksum. So check for it. MFC after: 3 days Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Fri Oct 3 04:13:25 2014 (r272468) +++ head/sys/netinet6/udp6_usrreq.c Fri Oct 3 08:46:49 2014 (r272469) @@ -237,11 +237,19 @@ udp6_input(struct mbuf **mp, int *offp, /* XXX: What is the right UDPLite MIB counter? */ goto badunlocked; } + if (uh->uh_sum == 0) { + /* XXX: What is the right UDPLite MIB counter? */ + goto badunlocked; + } } else { if ((ulen < sizeof(struct udphdr)) || (plen != ulen)) { UDPSTAT_INC(udps_badlen); goto badunlocked; } + if (uh->uh_sum == 0) { + UDPSTAT_INC(udps_nosum); + goto badunlocked; + } } if ((m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) && From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 09:58:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E1212A3; Fri, 3 Oct 2014 09: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 7E4A5348; Fri, 3 Oct 2014 09: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 s939w7qp070194; Fri, 3 Oct 2014 09:58:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s939w6D8070190; Fri, 3 Oct 2014 09:58:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410030958.s939w6D8070190@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 3 Oct 2014 09:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272470 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 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, 03 Oct 2014 09:58:07 -0000 Author: trasz Date: Fri Oct 3 09:58:05 2014 New Revision: 272470 URL: https://svnweb.freebsd.org/changeset/base/272470 Log: Make autofs(4) use shared lock for lookups, instead of exclusive one. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs.c head/sys/fs/autofs/autofs.h head/sys/fs/autofs/autofs_vfsops.c head/sys/fs/autofs/autofs_vnops.c Modified: head/sys/fs/autofs/autofs.c ============================================================================== --- head/sys/fs/autofs/autofs.c Fri Oct 3 08:46:49 2014 (r272469) +++ head/sys/fs/autofs/autofs.c Fri Oct 3 09:58:05 2014 (r272470) @@ -297,9 +297,9 @@ autofs_cached(struct autofs_node *anp, c * is necessary for wildcard indirect map keys to work. */ if (anp->an_parent == NULL && componentlen != 0) { - AUTOFS_LOCK(amp); + AUTOFS_SLOCK(amp); error = autofs_node_find(anp, component, componentlen, NULL); - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); if (error != 0) return (false); } Modified: head/sys/fs/autofs/autofs.h ============================================================================== --- head/sys/fs/autofs/autofs.h Fri Oct 3 08:46:49 2014 (r272469) +++ head/sys/fs/autofs/autofs.h Fri Oct 3 09:58:05 2014 (r272470) @@ -53,9 +53,12 @@ extern int autofs_mount_on_stat; __func__, ## __VA_ARGS__); \ } while (0) -#define AUTOFS_LOCK(X) sx_xlock(&X->am_lock) -#define AUTOFS_UNLOCK(X) sx_xunlock(&X->am_lock) -#define AUTOFS_ASSERT_LOCKED(X) sx_assert(&X->am_lock, SA_XLOCKED) +#define AUTOFS_SLOCK(X) sx_slock(&X->am_lock) +#define AUTOFS_XLOCK(X) sx_xlock(&X->am_lock) +#define AUTOFS_SUNLOCK(X) sx_sunlock(&X->am_lock) +#define AUTOFS_XUNLOCK(X) sx_xunlock(&X->am_lock) +#define AUTOFS_ASSERT_LOCKED(X) sx_assert(&X->am_lock, SA_LOCKED) +#define AUTOFS_ASSERT_XLOCKED(X) sx_assert(&X->am_lock, SA_XLOCKED) #define AUTOFS_ASSERT_UNLOCKED(X) sx_assert(&X->am_lock, SA_UNLOCKED) struct autofs_node { Modified: head/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- head/sys/fs/autofs/autofs_vfsops.c Fri Oct 3 08:46:49 2014 (r272469) +++ head/sys/fs/autofs/autofs_vfsops.c Fri Oct 3 09:58:05 2014 (r272470) @@ -88,14 +88,14 @@ autofs_mount(struct mount *mp) vfs_getnewfsid(mp); - AUTOFS_LOCK(amp); + AUTOFS_XLOCK(amp); error = autofs_node_new(NULL, amp, ".", -1, &->am_root); if (error != 0) { - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); free(amp, M_AUTOFS); return (error); } - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); vfs_mountedfrom(mp, from); @@ -146,7 +146,7 @@ autofs_unmount(struct mount *mp, int mnt pause("autofs_umount", 1); } - AUTOFS_LOCK(amp); + AUTOFS_XLOCK(amp); /* * Not terribly efficient, but at least not recursive. @@ -160,7 +160,7 @@ autofs_unmount(struct mount *mp, int mnt autofs_node_delete(amp->am_root); mp->mnt_data = NULL; - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); sx_destroy(&->am_lock); Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Fri Oct 3 08:46:49 2014 (r272469) +++ head/sys/fs/autofs/autofs_vnops.c Fri Oct 3 09:58:05 2014 (r272470) @@ -277,22 +277,22 @@ autofs_lookup(struct vop_lookup_args *ap } } - AUTOFS_LOCK(amp); + AUTOFS_SLOCK(amp); error = autofs_node_find(anp, cnp->cn_nameptr, cnp->cn_namelen, &child); if (error != 0) { if ((cnp->cn_flags & ISLASTCN) && cnp->cn_nameiop == CREATE) { - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); return (EJUSTRETURN); } - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); return (ENOENT); } /* * XXX: Dropping the node here is ok, because we never remove nodes. */ - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); error = autofs_node_vn(child, mp, vpp); if (error != 0) { @@ -325,14 +325,14 @@ autofs_mkdir(struct vop_mkdir_args *ap) if (autofs_ignore_thread(curthread) == false) return (EPERM); - AUTOFS_LOCK(amp); + AUTOFS_XLOCK(amp); error = autofs_node_new(anp, amp, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen, &child); if (error != 0) { - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); return (error); } - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); error = autofs_node_vn(child, vp->v_mount, ap->a_vpp); @@ -427,7 +427,7 @@ autofs_readdir(struct vop_readdir_args * } i = 2; /* Account for "." and "..". */ - AUTOFS_LOCK(amp); + AUTOFS_SLOCK(amp); TAILQ_FOREACH(child, &anp->an_children, an_next) { if (resid < AUTOFS_DELEN) { if (ap->a_eofflag != NULL) @@ -445,14 +445,14 @@ autofs_readdir(struct vop_readdir_args * error = autofs_readdir_one(uio, child->an_name, child->an_fileno); if (error != 0) { - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); return (error); } offset += AUTOFS_DELEN; resid -= AUTOFS_DELEN; } - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); return (0); } @@ -505,7 +505,7 @@ autofs_node_new(struct autofs_node *pare struct autofs_node *anp; if (parent != NULL) - AUTOFS_ASSERT_LOCKED(parent->an_mount); + AUTOFS_ASSERT_XLOCKED(parent->an_mount); anp = uma_zalloc(autofs_node_zone, M_WAITOK | M_ZERO); if (namelen >= 0) @@ -567,7 +567,7 @@ autofs_node_delete(struct autofs_node *a { struct autofs_node *parent; - AUTOFS_ASSERT_LOCKED(anp->an_mount); + AUTOFS_ASSERT_XLOCKED(anp->an_mount); KASSERT(TAILQ_EMPTY(&anp->an_children), ("have children")); callout_drain(&anp->an_callout); From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 09:58:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C0523EC; Fri, 3 Oct 2014 09:58:38 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CF5E354; Fri, 3 Oct 2014 09:58:38 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XZvdv-0004fU-Cc; Fri, 03 Oct 2014 09:43:03 +0400 Message-ID: <542E7309.8080602@FreeBSD.org> Date: Fri, 03 Oct 2014 13:57:29 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r272391 - in head/sys: netinet netinet6 References: <201410020025.s920PvEW008958@svn.freebsd.org> <542D09CF.5000803@FreeBSD.org> <20141002103222.GG73266@FreeBSD.org> In-Reply-To: <20141002103222.GG73266@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, Hiroki Sato , 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, 03 Oct 2014 09:58:38 -0000 On 02.10.2014 14:32, Gleb Smirnoff wrote: > On Thu, Oct 02, 2014 at 12:16:15PM +0400, Alexander V. Chernikov wrote: > A> On 02.10.2014 04:25, Hiroki Sato wrote: > A> > Author: hrs > A> > Date: Thu Oct 2 00:25:57 2014 > A> > New Revision: 272391 > A> > URL: https://svnweb.freebsd.org/changeset/base/272391 > A> > > A> > Log: > A> > Add an additional routing table lookup when m->m_pkthdr.fibnum is changed > A> > at a PFIL hook in ip{,6}_output(). IPFW setfib rule did not perform > A> > a routing table lookup when the destination address was not changed. > A> > > A> > CR: D805 > A> > > A> > Modified: > A> > head/sys/netinet/ip_output.c > A> > head/sys/netinet6/ip6_output.c > A> I'm not very happy with this. > A> We already have large conditional for checking if dst has changed, how > A> you have added another conditional for fib.. > A> This idea is quite weird: why should we try to check all this stuff for > A> every packet instead of asking pfil consumers > A> to provide information they already know? > A> > A> We'd better discuss something like M_DSTCHANGED flag instead of doing > A> these hacks. > > And here you suggest to abuse mbuf flags to merely carry return value of > a pfil hook :) Why not? We have some M_PROTOX flags for exactly the same: store some state inside particular subsystem being set internally and cleared on return. We can use alternative approach like making last PFIL argument being pointer to some unsigned value representing flags and check it on return. The problem here is that we will make PFIL batching implementation harder.. > From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 10:18:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E651870; Fri, 3 Oct 2014 10:18:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59FFC766; Fri, 3 Oct 2014 10:18: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 s93AINAv079637; Fri, 3 Oct 2014 10:18:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93AIN1A079636; Fri, 3 Oct 2014 10:18:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410031018.s93AIN1A079636@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 3 Oct 2014 10:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272471 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 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, 03 Oct 2014 10:18:23 -0000 Author: trasz Date: Fri Oct 3 10:18:22 2014 New Revision: 272471 URL: https://svnweb.freebsd.org/changeset/base/272471 Log: Fix autofs debug macros. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs.h Modified: head/sys/fs/autofs/autofs.h ============================================================================== --- head/sys/fs/autofs/autofs.h Fri Oct 3 09:58:05 2014 (r272470) +++ head/sys/fs/autofs/autofs.h Fri Oct 3 10:18:22 2014 (r272471) @@ -42,15 +42,18 @@ extern uma_zone_t autofs_node_zone; extern int autofs_debug; extern int autofs_mount_on_stat; -#define AUTOFS_DEBUG(X, ...) \ - if (autofs_debug > 1) { \ - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ +#define AUTOFS_DEBUG(X, ...) \ + do { \ + if (autofs_debug > 1) \ + printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ } while (0) -#define AUTOFS_WARN(X, ...) \ - if (autofs_debug > 0) { \ - printf("WARNING: %s: " X "\n", \ - __func__, ## __VA_ARGS__); \ +#define AUTOFS_WARN(X, ...) \ + do { \ + if (autofs_debug > 0) { \ + printf("WARNING: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ } while (0) #define AUTOFS_SLOCK(X) sx_slock(&X->am_lock) From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 12:14:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63F9B3F4; Fri, 3 Oct 2014 12:14:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 501DB341; Fri, 3 Oct 2014 12:14: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 s93CEKc0036095; Fri, 3 Oct 2014 12:14:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93CEKOI036094; Fri, 3 Oct 2014 12:14:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410031214.s93CEKOI036094@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 3 Oct 2014 12:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272472 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 03 Oct 2014 12:14:20 -0000 Author: andrew Date: Fri Oct 3 12:14:19 2014 New Revision: 272472 URL: https://svnweb.freebsd.org/changeset/base/272472 Log: Allow the optional limitation on dmb instructions as is already the case with dsb instructions. Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Fri Oct 3 10:18:22 2014 (r272471) +++ head/contrib/binutils/gas/config/tc-arm.c Fri Oct 3 12:14:19 2014 (r272472) @@ -6571,6 +6571,7 @@ do_barrier (void) if (inst.operands[0].present) { constraint ((inst.instruction & 0xf0) != 0x40 + && (inst.instruction & 0xf0) != 0x50 && inst.operands[0].imm != 0xf, "bad barrier type"); inst.instruction |= inst.operands[0].imm; From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 12:20:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A80F35A2; Fri, 3 Oct 2014 12:20:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9419C370; Fri, 3 Oct 2014 12:20: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 s93CKc4k039267; Fri, 3 Oct 2014 12:20:38 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93CKcEq039266; Fri, 3 Oct 2014 12:20:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410031220.s93CKcEq039266@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 3 Oct 2014 12:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272473 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 03 Oct 2014 12:20:38 -0000 Author: andrew Date: Fri Oct 3 12:20:37 2014 New Revision: 272473 URL: https://svnweb.freebsd.org/changeset/base/272473 Log: Add all the dmb/dsb optional limitations, including the alternative values. These are needed for some code llvm generates when targeting ARMv7. Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Fri Oct 3 12:14:19 2014 (r272472) +++ head/contrib/binutils/gas/config/tc-arm.c Fri Oct 3 12:20:37 2014 (r272473) @@ -14695,10 +14695,18 @@ static const struct asm_cond conds[] = static struct asm_barrier_opt barrier_opt_names[] = { - { "sy", 0xf }, - { "un", 0x7 }, - { "st", 0xe }, - { "unst", 0x6 } + { "sy", 0xf }, + { "un", 0x7 }, + { "st", 0xe }, + { "unst", 0x6 }, + { "ish", 0xb }, + { "sh", 0xb }, + { "ishst", 0xa }, + { "shst", 0xa }, + { "nsh", 0x7 }, + { "nshst", 0x6 }, + { "osh", 0x3 }, + { "oshst", 0x2 } }; /* Table of ARM-format instructions. */ From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 14:49:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87C3C9E8; Fri, 3 Oct 2014 14:49: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 7316F7E1; Fri, 3 Oct 2014 14:49: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 s93EnohU009121; Fri, 3 Oct 2014 14:49:50 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93EnnR9009098; Fri, 3 Oct 2014 14:49:49 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201410031449.s93EnnR9009098@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 3 Oct 2014 14:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272474 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 03 Oct 2014 14:49:50 -0000 Author: smh Date: Fri Oct 3 14:49:48 2014 New Revision: 272474 URL: https://svnweb.freebsd.org/changeset/base/272474 Log: Fix various issues with zvols When performing snapshot renames we could deadlock due to the locking in zvol_rename_minors. In order to avoid this use the same workaround as zvol_open in zvol_rename_minors. Add missing zvol_rename_minors to dsl_dataset_promote_sync. Protect against invalid index into zv_name in zvol_remove_minors. Replace zvol_remove_minor calls with zvol_remove_minors to ensure any potential children are also renamed. Don't fail zvol_create_minors if zvol_create_minor returns EEXIST. Restore the valid pool check in zfs_ioc_destroy_snaps to ensure we don't call zvol_remove_minors when zfs_unmount_snap fails. PR: 193803 MFC after: 1 week Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Oct 3 12:20:37 2014 (r272473) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Oct 3 14:49:48 2014 (r272474) @@ -2257,6 +2257,9 @@ dsl_dataset_promote_sync(void *arg, dmu_ dsl_dir_t *odd = NULL; uint64_t oldnext_obj; int64_t delta; +#if defined(__FreeBSD__) && defined(_KERNEL) + char *oldname, *newname; +#endif VERIFY0(promote_hold(ddpa, dp, FTAG)); hds = ddpa->ddpa_clone; @@ -2322,6 +2325,14 @@ dsl_dataset_promote_sync(void *arg, dmu_ dd->dd_phys->dd_clones, origin_head->ds_object, tx)); } +#if defined(__FreeBSD__) && defined(_KERNEL) + /* Take the spa_namespace_lock early so zvol renames don't deadlock. */ + mutex_enter(&spa_namespace_lock); + + oldname = kmem_alloc(MAXPATHLEN, KM_SLEEP); + newname = kmem_alloc(MAXPATHLEN, KM_SLEEP); +#endif + /* move snapshots to this dir */ for (snap = list_head(&ddpa->shared_snaps); snap; snap = list_next(&ddpa->shared_snaps, snap)) { @@ -2356,6 +2367,12 @@ dsl_dataset_promote_sync(void *arg, dmu_ VERIFY0(dsl_dir_hold_obj(dp, dd->dd_object, NULL, ds, &ds->ds_dir)); +#if defined(__FreeBSD__) && defined(_KERNEL) + dsl_dataset_name(ds, newname); + zfsvfs_update_fromname(oldname, newname); + zvol_rename_minors(oldname, newname); +#endif + /* move any clone references */ if (ds->ds_phys->ds_next_clones_obj && spa_version(dp->dp_spa) >= SPA_VERSION_DIR_CLONES) { @@ -2393,6 +2410,12 @@ dsl_dataset_promote_sync(void *arg, dmu_ ASSERT(!dsl_prop_hascb(ds)); } +#if defined(__FreeBSD__) && defined(_KERNEL) + mutex_exit(&spa_namespace_lock); + + kmem_free(newname, MAXPATHLEN); + kmem_free(oldname, MAXPATHLEN); +#endif /* * Change space accounting. * Note, pa->*usedsnap and dd_used_breakdown[SNAP] will either Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Oct 3 12:20:37 2014 (r272473) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Oct 3 14:49:48 2014 (r272474) @@ -3540,6 +3540,7 @@ zfs_destroy_unmount_origin(const char *f static int zfs_ioc_destroy_snaps(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl) { + int error, poollen; nvlist_t *snaps; nvpair_t *pair; boolean_t defer; @@ -3548,13 +3549,24 @@ zfs_ioc_destroy_snaps(const char *poolna return (SET_ERROR(EINVAL)); defer = nvlist_exists(innvl, "defer"); + poollen = strlen(poolname); for (pair = nvlist_next_nvpair(snaps, NULL); pair != NULL; pair = nvlist_next_nvpair(snaps, pair)) { const char *name = nvpair_name(pair); - (void) zfs_unmount_snap(name); + /* + * The snap must be in the specified pool to prevent the + * invalid removal of zvol minors below. + */ + if (strncmp(name, poolname, poollen) != 0 || + (name[poollen] != '/' && name[poollen] != '@')) + return (SET_ERROR(EXDEV)); + + error = zfs_unmount_snap(name); + if (error != 0) + return (error); #if defined(__FreeBSD__) - (void) zvol_remove_minor(name); + zvol_remove_minors(name); #endif } @@ -3679,7 +3691,11 @@ zfs_ioc_destroy(zfs_cmd_t *zc) else err = dsl_destroy_head(zc->zc_name); if (zc->zc_objset_type == DMU_OST_ZVOL && err == 0) +#ifdef __FreeBSD__ + zvol_remove_minors(zc->zc_name); +#else (void) zvol_remove_minor(zc->zc_name); +#endif return (err); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Oct 3 12:20:37 2014 (r272473) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Oct 3 14:49:48 2014 (r272474) @@ -882,7 +882,8 @@ zvol_remove_minors(const char *name) LIST_FOREACH_SAFE(zv, &all_zvols, zv_links, tzv) { if (strcmp(zv->zv_name, name) == 0 || (strncmp(zv->zv_name, name, namelen) == 0 && - zv->zv_name[namelen] == '/')) { + strlen(zv->zv_name) > namelen && (zv->zv_name[namelen] == '/' || + zv->zv_name[namelen] == '@'))) { (void) zvol_remove_zv(zv); } } @@ -2570,9 +2571,10 @@ zvol_create_minors(const char *name) if (dmu_objset_type(os) == DMU_OST_ZVOL) { dsl_dataset_long_hold(os->os_dsl_dataset, FTAG); dsl_pool_rele(dmu_objset_pool(os), FTAG); - if ((error = zvol_create_minor(name)) == 0) + error = zvol_create_minor(name); + if (error == 0 || error == EEXIST) { error = zvol_create_snapshots(os, name); - else { + } else { printf("ZFS WARNING: Unable to create ZVOL %s (error=%d).\n", name, error); } @@ -2673,12 +2675,17 @@ zvol_rename_minors(const char *oldname, size_t oldnamelen, newnamelen; zvol_state_t *zv; char *namebuf; + boolean_t locked = B_FALSE; oldnamelen = strlen(oldname); newnamelen = strlen(newname); DROP_GIANT(); - mutex_enter(&spa_namespace_lock); + /* See comment in zvol_open(). */ + if (!MUTEX_HELD(&spa_namespace_lock)) { + mutex_enter(&spa_namespace_lock); + locked = B_TRUE; + } LIST_FOREACH(zv, &all_zvols, zv_links) { if (strcmp(zv->zv_name, oldname) == 0) { @@ -2693,7 +2700,8 @@ zvol_rename_minors(const char *oldname, } } - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); PICKUP_GIANT(); } From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 15:00:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32E57EB9; Fri, 3 Oct 2014 15:00:02 +0000 (UTC) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E34C78FA; Fri, 3 Oct 2014 15:00:01 +0000 (UTC) Received: by mail-ig0-f175.google.com with SMTP id uq10so194569igb.8 for ; Fri, 03 Oct 2014 08:00:01 -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:content-type; bh=sDfB37LYFqcFgD0lN4uLDCShbpw0LrhkG9FFQvNTrNs=; b=RKLbRA+89FoOA5CDeBx4ntoCcxkN+YkLM/l+oOmweUQ+YgSgIf8x6Eyv2AAM2+O8bt 8ZtVnS90+iLOaI+Bb2yEwlt0RfcRMcD+Xft+qAMqOXiZJRA7xU91i2cUIpgCiz70bpq7 fh1TMpwP0YLQuNl0Ms58KN6XAlaSlb/hc4DY7qFma3gG87SRA0OjcFtuEqYG8Tr1b2h7 ziIZInNN1erZTuCb+kKZlpR8q7HVehgx0i1Z9FXIkr8WUpie5Hzbew7CgXgm9R4CzjP1 X+2i8KkAD3Hnn0BLB6stmfqw99q3wf0e9xX7HeTgfNzineivBT7aNJuURQuhrxN7SFdt NZdA== X-Received: by 10.43.59.80 with SMTP id wn16mr13786037icb.6.1412348401313; Fri, 03 Oct 2014 08:00:01 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.9.221 with HTTP; Fri, 3 Oct 2014 07:59:41 -0700 (PDT) In-Reply-To: References: <201410012103.s91L3HR0010906@svn.freebsd.org> From: Ed Maste Date: Fri, 3 Oct 2014 10:59:41 -0400 X-Google-Sender-Auth: 3ern_Nup925-hQbC_wU1pmTSQQY Message-ID: Subject: Re: svn commit: r272384 - head/usr.bin/mkimg To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 03 Oct 2014 15:00:02 -0000 On 2 October 2014 10:43, Ed Maste wrote: > > I've been using brooks' NO_ROOT support along with makefs / mkimg to > build and test changes by creating an image to boot in QEMU. This > change provides a noticeable improvement in the cycle time. I've had a couple of inquiries about the workflow I've been using, so I've added a brief set of steps to my Wiki page at https://wiki.freebsd.org/EdMaste/BuildVM . With -DNO_ROOT for the install targets an mtree file named METALOG file is created at the top of DESTDIR. Files are installed owned by the user, without special flags. Makefs reads the METALOG file and applies the desired ownership, permissions and flags in the generated file system. Then mkimg creates an image with a GPT partition table, the UFS filesystem created by makefs, and the various boot loader bits for legacy and UEFI boot. From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 15:03:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23065115; Fri, 3 Oct 2014 15:03:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F5979B3; Fri, 3 Oct 2014 15:03: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 s93F3ijh017695; Fri, 3 Oct 2014 15:03:44 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93F3i8V017694; Fri, 3 Oct 2014 15:03:44 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201410031503.s93F3i8V017694@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 3 Oct 2014 15:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272475 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 03 Oct 2014 15:03:45 -0000 Author: lwhsu (ports committer) Date: Fri Oct 3 15:03:44 2014 New Revision: 272475 URL: https://svnweb.freebsd.org/changeset/base/272475 Log: Bump .Dd Approved by: kevlo Modified: head/share/man/man9/sleepqueue.9 Modified: head/share/man/man9/sleepqueue.9 ============================================================================== --- head/share/man/man9/sleepqueue.9 Fri Oct 3 14:49:48 2014 (r272474) +++ head/share/man/man9/sleepqueue.9 Fri Oct 3 15:03:44 2014 (r272475) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2013 +.Dd September 22, 2014 .Dt SLEEPQUEUE 9 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 15:07:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABF9B483; Fri, 3 Oct 2014 15:07: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 97A3F9F7; Fri, 3 Oct 2014 15:07: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 s93F7iOl018369; Fri, 3 Oct 2014 15:07:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93F7iT4018368; Fri, 3 Oct 2014 15:07:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410031507.s93F7iT4018368@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 3 Oct 2014 15:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272476 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 03 Oct 2014 15:07:44 -0000 Author: andrew Date: Fri Oct 3 15:07:43 2014 New Revision: 272476 URL: https://svnweb.freebsd.org/changeset/base/272476 Log: Allow vld and vst instructions to use the canonical form from ARM ARM when including an alignment. Previously binutils would only allow instructions in the form "vld1.64 {d0, d1}, [r0, :128]" where the final comma should not be there, instead the above instruction should be "vld1.64 {d0, d1}, [r0:128]". This change duplicates the alignment code from within the function to handle this case. Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Fri Oct 3 15:03:44 2014 (r272475) +++ head/contrib/binutils/gas/config/tc-arm.c Fri Oct 3 15:07:43 2014 (r272476) @@ -4688,6 +4688,23 @@ parse_address_main (char **str, int i, i return PARSE_OPERAND_FAIL; } } + else if (skip_past_char (&p, ':') == SUCCESS) + { + /* FIXME: '@' should be used here, but it's filtered out by generic + code before we get to see it here. This may be subject to + change. */ + expressionS exp; + my_get_expression (&exp, &p, GE_NO_PREFIX); + if (exp.X_op != O_constant) + { + inst.error = _("alignment must be constant"); + return PARSE_OPERAND_FAIL; + } + inst.operands[i].imm = exp.X_add_number << 8; + inst.operands[i].immisalign = 1; + /* Alignments are not pre-indexes. */ + inst.operands[i].preind = 0; + } if (skip_past_char (&p, ']') == FAIL) { From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 15:58:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D6DFC40; Fri, 3 Oct 2014 15:58:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69905F93; Fri, 3 Oct 2014 15:58: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 s93Fw5CS042216; Fri, 3 Oct 2014 15:58:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93Fw5fa042215; Fri, 3 Oct 2014 15:58:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410031558.s93Fw5fa042215@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 3 Oct 2014 15:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272479 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 03 Oct 2014 15:58:05 -0000 Author: hselasky Date: Fri Oct 3 15:58:04 2014 New Revision: 272479 URL: https://svnweb.freebsd.org/changeset/base/272479 Log: Fix XHCI driver for devices which have more than 15 physical root HUB ports. The current bitmap array was too small to hold more than 16 bits and would at some point toggle the context size, which then would trigger an enumeration fault and cause a fallback to the EHCI companion controller, if any. MFC after: 3 days Modified: head/sys/dev/usb/controller/xhci.h Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Fri Oct 3 15:54:51 2014 (r272478) +++ head/sys/dev/usb/controller/xhci.h Fri Oct 3 15:58:04 2014 (r272479) @@ -493,7 +493,8 @@ struct xhci_softc { uint8_t sc_noscratch; /* root HUB device configuration */ uint8_t sc_conf; - uint8_t sc_hub_idata[2]; + /* root HUB port event bitmap, max 256 ports */ + uint8_t sc_hub_idata[32]; /* size of context */ uint8_t sc_ctx_is_64_byte; From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 16:09:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52906F5B; Fri, 3 Oct 2014 16:09:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E8F0118; Fri, 3 Oct 2014 16:09: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 s93G9lkP047262; Fri, 3 Oct 2014 16:09:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93G9lNI047261; Fri, 3 Oct 2014 16:09:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201410031609.s93G9lNI047261@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 3 Oct 2014 16:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272480 - 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: Fri, 03 Oct 2014 16:09:47 -0000 Author: hselasky Date: Fri Oct 3 16:09:46 2014 New Revision: 272480 URL: https://svnweb.freebsd.org/changeset/base/272480 Log: When we fail to get a USB reference we should just return, because there are no more references held. MFC after: 3 days Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Fri Oct 3 15:58:04 2014 (r272479) +++ head/sys/dev/usb/usb_dev.c Fri Oct 3 16:09:46 2014 (r272480) @@ -298,6 +298,10 @@ error: } mtx_unlock(&usb_ref_lock); DPRINTFN(2, "fail\n"); + + /* clear all refs */ + memset(crd, 0, sizeof(*crd)); + return (USB_ERR_INVAL); } @@ -1093,8 +1097,8 @@ usb_ioctl(struct cdev *dev, u_long cmd, goto done; if (usb_usb_ref_device(cpd, &refs)) { - err = ENXIO; - goto done; + /* we lost the reference */ + return (ENXIO); } err = (f->methods->f_ioctl_post) (f, cmd, addr, fflags); @@ -1117,9 +1121,8 @@ usb_ioctl(struct cdev *dev, u_long cmd, while (usb_ref_device(cpd, &refs, 1 /* need uref */)) { if (usb_ref_device(cpd, &refs, 0)) { - /* device no longer exits */ - err = ENXIO; - goto done; + /* device no longer exists */ + return (ENXIO); } usb_unref_device(cpd, &refs); usb_pause_mtx(NULL, hz / 128); @@ -1411,9 +1414,9 @@ usb_read(struct cdev *dev, struct uio *u return (err); err = usb_ref_device(cpd, &refs, 0 /* no uref */ ); - if (err) { + if (err) return (ENXIO); - } + fflags = cpd->fflags; f = refs.rxfifo; @@ -1537,9 +1540,9 @@ usb_write(struct cdev *dev, struct uio * return (err); err = usb_ref_device(cpd, &refs, 0 /* no uref */ ); - if (err) { + if (err) return (ENXIO); - } + fflags = cpd->fflags; f = refs.txfifo; From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 17:12:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CCA3FDB for ; Fri, 3 Oct 2014 17:12:46 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03BD5A7F for ; Fri, 3 Oct 2014 17:12:46 +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 s93HCjVF085322 for ; Fri, 3 Oct 2014 17:12:45 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s93HCjqh085317 for svn-src-head@freebsd.org; Fri, 3 Oct 2014 17:12:45 GMT (envelope-from bdrewery) Received: (qmail 13300 invoked from network); 3 Oct 2014 12:12:44 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 3 Oct 2014 12:12:44 -0500 Message-ID: <542ED903.30808@FreeBSD.org> Date: Fri, 03 Oct 2014 12:12:35 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Marcelo Araujo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r272467 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nfs fs/nfsserver References: <201410030224.s932OfSw059966@svn.freebsd.org> In-Reply-To: <201410030224.s932OfSw059966@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="2BuID1jo3Xnnqej1HLRUnOGbVDsL5uf3G" 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, 03 Oct 2014 17:12:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2BuID1jo3Xnnqej1HLRUnOGbVDsL5uf3G Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/2/2014 9:24 PM, Marcelo Araujo wrote: > Author: araujo (ports committer) > Date: Fri Oct 3 02:24:41 2014 > New Revision: 272467 > URL: https://svnweb.freebsd.org/changeset/base/272467 >=20 > Log: > Fix failures and warnings reported by newpynfs20090424 test tool. > This fix addresses only issues with the pynfs reports, none of these > issues are know to create problems for extant real clients. Do you have more details than "fix bugs"? :) Even which failures were fixed would be helpful to document. > =20 > Submitted by: Bart Hsiao > Reworked by: myself > Reviewed by: rmacklem > Approved by: rmacklem > Sponsored by: QNAP Systems Inc. >=20 --=20 Regards, Bryan Drewery --2BuID1jo3Xnnqej1HLRUnOGbVDsL5uf3G Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJULtkDAAoJEDXXcbtuRpfP+LMH/jcvDJGroTsfBqtqeQ6QRJMQ nyEOSQ1pZFOqQoRKtVkaHHb1x8iTgLsMh2PKqaFZSDOFnPI/K/cZVENgGvHXum7d Mr4f6Mgwl4GTe20cFkzE8CwW1nud3GCEmzD9tyGNQC0Uqq89gPvgPxPmrHLeeCgy Y6eyWyxP9QFvWyl3IPw+BPlFB+9HE4k6G34fK6w7YtrR1hVLF4tJsJMw6ZYLgh5z BhIZhL+/34hQvg1D1y4KU4NhDBksfYvuADQ3rUuLmXxtc965SJIUEbQ2T8YPie16 mUcrZ4cXlpn+Gg2cA81Ct4TDr0JkxNNk6rd9FG6FqOy7ZNu721/iMJWXFr6ImXg= =UX6r -----END PGP SIGNATURE----- --2BuID1jo3Xnnqej1HLRUnOGbVDsL5uf3G-- From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 17:17:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DF27229; Fri, 3 Oct 2014 17:17:20 +0000 (UTC) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2981CAB4; Fri, 3 Oct 2014 17:17:19 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id m15so2071050wgh.16 for ; Fri, 03 Oct 2014 10:17:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=NcOBy7nZWo49ANbYwczU+sBG9LKZDBbfbRCoDdTOCzo=; b=epHoIRz3GB7oQd8RKgWg1Rpfh5F1Bt9LnjvPaFqPmDhgIXqdjRSIB3N/sfKL0fZ9X3 A8L94soaubQiNonnbo+Ad+DJDdx2+SsSKUmG77COyF7Jmi58fMNdauPepjKZks0Ceikf GPFoed5YEgfrS1uANYXR57res9GnPLSZ6Pl9HmGDe1SAZ8iJcHPhnkJxrinSvEP0Jo4x 3Alspf72fUqMiGckhMUwEOzlD2X6UKXLaWQqYoPqNjudJkOhnMJUxfBkEsYyDHYQs25T Ii5HTq9EVYVW9mgmOCjcTLrRPzB795PBcEQPceJraQlSJnaMC7IEUbTFjWvOSU+SDEh6 hnDA== MIME-Version: 1.0 X-Received: by 10.180.102.7 with SMTP id fk7mr14114611wib.77.1412356637370; Fri, 03 Oct 2014 10:17:17 -0700 (PDT) Received: by 10.216.159.193 with HTTP; Fri, 3 Oct 2014 10:17:17 -0700 (PDT) Received: by 10.216.159.193 with HTTP; Fri, 3 Oct 2014 10:17:17 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <542ED903.30808@FreeBSD.org> References: <201410030224.s932OfSw059966@svn.freebsd.org> <542ED903.30808@FreeBSD.org> Date: Sat, 4 Oct 2014 01:17:17 +0800 Message-ID: Subject: Re: svn commit: r272467 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nfs fs/nfsserver From: Marcelo Araujo To: Bryan Drewery 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, Marcelo Araujo 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, 03 Oct 2014 17:17:20 -0000 Hey, Yes I have, you could check here: https://reviews.freebsd.org/D798 I should added the phabric on the commit log. My bad! Best Regards, On Oct 4, 2014 1:12 AM, "Bryan Drewery" wrote: > On 10/2/2014 9:24 PM, Marcelo Araujo wrote: > > Author: araujo (ports committer) > > Date: Fri Oct 3 02:24:41 2014 > > New Revision: 272467 > > URL: https://svnweb.freebsd.org/changeset/base/272467 > > > > Log: > > Fix failures and warnings reported by newpynfs20090424 test tool. > > This fix addresses only issues with the pynfs reports, none of these > > issues are know to create problems for extant real clients. > > Do you have more details than "fix bugs"? :) > > Even which failures were fixed would be helpful to document. > > > > > Submitted by: Bart Hsiao > > Reworked by: myself > > Reviewed by: rmacklem > > Approved by: rmacklem > > Sponsored by: QNAP Systems Inc. > > > > > -- > Regards, > Bryan Drewery > > From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 17:20:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B83254EC for ; Fri, 3 Oct 2014 17:20:57 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9829CB76 for ; Fri, 3 Oct 2014 17:20:57 +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 s93HKvIF086480 for ; Fri, 3 Oct 2014 17:20:57 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s93HKvcT086473 for svn-src-head@freebsd.org; Fri, 3 Oct 2014 17:20:57 GMT (envelope-from bdrewery) Received: (qmail 21726 invoked from network); 3 Oct 2014 12:20:55 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 3 Oct 2014 12:20:55 -0500 Message-ID: <542EDAEE.2060003@FreeBSD.org> Date: Fri, 03 Oct 2014 12:20:46 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: araujo@FreeBSD.org Subject: Re: svn commit: r272467 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nfs fs/nfsserver References: <201410030224.s932OfSw059966@svn.freebsd.org> <542ED903.30808@FreeBSD.org> In-Reply-To: OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VCpKNxXU1lcKkmxGcoaB6dAmBEAFstiGH" Cc: svn-src-head@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, 03 Oct 2014 17:20:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VCpKNxXU1lcKkmxGcoaB6dAmBEAFstiGH Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/3/2014 12:17 PM, Marcelo Araujo wrote: > Hey, >=20 > Yes I have, you could check here: https://reviews.freebsd.org/D798 >=20 > I should added the phabric on the commit log. My bad! >=20 > Best Regards, >=20 Thanks! --=20 Regards, Bryan Drewery --VCpKNxXU1lcKkmxGcoaB6dAmBEAFstiGH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJULtruAAoJEDXXcbtuRpfPBhIH/0csnoP+9zEJioBA/SBOrMDT RwfS88qdo3Nd9F5dLPHd6BolxD+lwzv7MDeblGNeni7J6HymB/25MV6bM2B0VUM7 QUfzzOhukB0YKrR1uruNMQtVsFgfqklHkoukeiV5GN3nfLCr7S5tcsc7fY0lI83K 4+HAAxmVeacYazF1u0LNRwd2yIWxUKZ2bApa42B/kCUPrKSJG6CG8nlFujubcoth Zobfb1aqBsjsTmFreC1/y5k3HXxynbPLI9Vp+DWjRl0yvfkRAHwsCL0NhcmaLPoD MlFT+NJVH3lvylv7FA3+14ysqmqLBEL306zj237RKUpygef0UhijgUSJ1cXkxXo= =BhmL -----END PGP SIGNATURE----- --VCpKNxXU1lcKkmxGcoaB6dAmBEAFstiGH-- From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 17:23:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0855F66C; Fri, 3 Oct 2014 17:23:28 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC749B95; Fri, 3 Oct 2014 17:23:27 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Xa6Zh-0003Oo-N7; Fri, 03 Oct 2014 17:23:25 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s93HNO9S021807; Fri, 3 Oct 2014 11:23:24 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+F3brBIs7wIAZw0/t7q6tM X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r272467 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nfs fs/nfsserver From: Ian Lepore To: araujo@FreeBSD.org In-Reply-To: References: <201410030224.s932OfSw059966@svn.freebsd.org> <542ED903.30808@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 03 Oct 2014 11:23:24 -0600 Message-ID: <1412357004.12052.86.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery 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, 03 Oct 2014 17:23:28 -0000 On Sat, 2014-10-04 at 01:17 +0800, Marcelo Araujo wrote: > Hey, > > Yes I have, you could check here: https://reviews.freebsd.org/D798 > > I should added the phabric on the commit log. My bad! > IMO, no amount of verbiage in phabricator linked to from a commit message is a substitute for a proper detailed commit message. -- Ian > Best Regards, > On Oct 4, 2014 1:12 AM, "Bryan Drewery" wrote: > > > On 10/2/2014 9:24 PM, Marcelo Araujo wrote: > > > Author: araujo (ports committer) > > > Date: Fri Oct 3 02:24:41 2014 > > > New Revision: 272467 > > > URL: https://svnweb.freebsd.org/changeset/base/272467 > > > > > > Log: > > > Fix failures and warnings reported by newpynfs20090424 test tool. > > > This fix addresses only issues with the pynfs reports, none of these > > > issues are know to create problems for extant real clients. > > > > Do you have more details than "fix bugs"? :) > > > > Even which failures were fixed would be helpful to document. > > > > > > > > Submitted by: Bart Hsiao > > > Reworked by: myself > > > Reviewed by: rmacklem > > > Approved by: rmacklem > > > Sponsored by: QNAP Systems Inc. > > > > > > > > > -- > > Regards, > > Bryan Drewery > > > > From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 17:27:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D172834; Fri, 3 Oct 2014 17:27:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38F33BCA; Fri, 3 Oct 2014 17:27: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 s93HRVFW084593; Fri, 3 Oct 2014 17:27:31 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93HRVnH084592; Fri, 3 Oct 2014 17:27:31 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201410031727.s93HRVnH084592@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Fri, 3 Oct 2014 17:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272481 - 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, 03 Oct 2014 17:27:31 -0000 Author: grehan Date: Fri Oct 3 17:27:30 2014 New Revision: 272481 URL: https://svnweb.freebsd.org/changeset/base/272481 Log: Add new fields in the FADT, required by IASL 20140926-64. The new IASL from the recent acpi-ca import will error out if it doesn't see these new fields, which were previously reserved. Reported by: lme Reviewed by: neel Modified: head/usr.sbin/bhyve/acpi.c Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Fri Oct 3 16:09:46 2014 (r272480) +++ head/usr.sbin/bhyve/acpi.c Fri Oct 3 17:27:30 2014 (r272481) @@ -430,7 +430,10 @@ basl_fwrite_fadt(FILE *fp) EFPRINTF(fp, "\n"); EFPRINTF(fp, "[0001]\t\tValue to cause reset : 06\n"); - EFPRINTF(fp, "[0003]\t\tReserved : 000000\n"); + EFPRINTF(fp, "[0002]\t\tARM Flags (decoded below): 0000\n"); + EFPRINTF(fp, "\t\t\tPSCI Compliant : 0\n"); + EFPRINTF(fp, "\t\t\tMust use HVC for PSCI : 0\n"); + EFPRINTF(fp, "[0001]\t\tFADT Minor Revision : 01\n"); EFPRINTF(fp, "[0008]\t\tFACS Address : 00000000%08X\n", basl_acpi_base + FACS_OFFSET); EFPRINTF(fp, "[0008]\t\tDSDT Address : 00000000%08X\n", From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 17:29:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0A8C9E1; Fri, 3 Oct 2014 17:29:19 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8BEBBE0; Fri, 3 Oct 2014 17:29:18 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id cc10so7893294wib.13 for ; Fri, 03 Oct 2014 10:29:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=4IgHtERnFJru8S22fuElpAwubPjIGqhteDt46hhFtA4=; b=vSsGofW7ZJ3+ey6KTcMwzKqNNvXDAI1ILOgqA2TCe+LLvNwOoKO2HAdvCleSaJEqMI sJfgLxsR2h3Zpo1+B6i2TrLeYvjRZkLhfxIemPFmqKalyF2JugwACdkH1bTv+gq2sJWC Fw0ibDbsFfDsnBjpHLFTLEhutTSrF4qG6VWneetj8qjqt64K3aUi4jylR7ts/qxjEFT8 5F/QHucW8HQYBh478H+/JP5FG8Cbhuw9ZxoiP8lp7jRDhUf4lyLQJdeX/Jc2FXa2hMbD mVowz/EWeLkoXxjkEN1QbdT9FP21aKK+jKl0uGApIAe1HmzNfyzfecPIl0Ez77/GThs8 8Kwg== MIME-Version: 1.0 X-Received: by 10.180.189.84 with SMTP id gg20mr13850232wic.37.1412357356820; Fri, 03 Oct 2014 10:29:16 -0700 (PDT) Received: by 10.216.159.193 with HTTP; Fri, 3 Oct 2014 10:29:16 -0700 (PDT) Received: by 10.216.159.193 with HTTP; Fri, 3 Oct 2014 10:29:16 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <1412357004.12052.86.camel@revolution.hippie.lan> References: <201410030224.s932OfSw059966@svn.freebsd.org> <542ED903.30808@FreeBSD.org> <1412357004.12052.86.camel@revolution.hippie.lan> Date: Sat, 4 Oct 2014 01:29:16 +0800 Message-ID: Subject: Re: svn commit: r272467 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nfs fs/nfsserver From: Marcelo Araujo To: Ian Lepore 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, araujo@freebsd.org, Bryan Drewery 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, 03 Oct 2014 17:29:19 -0000 Sure, noted! Thanks. On Oct 4, 2014 1:23 AM, "Ian Lepore" wrote: > On Sat, 2014-10-04 at 01:17 +0800, Marcelo Araujo wrote: > > Hey, > > > > Yes I have, you could check here: https://reviews.freebsd.org/D798 > > > > I should added the phabric on the commit log. My bad! > > > > IMO, no amount of verbiage in phabricator linked to from a commit > message is a substitute for a proper detailed commit message. > > -- Ian > > > Best Regards, > > On Oct 4, 2014 1:12 AM, "Bryan Drewery" wrote: > > > > > On 10/2/2014 9:24 PM, Marcelo Araujo wrote: > > > > Author: araujo (ports committer) > > > > Date: Fri Oct 3 02:24:41 2014 > > > > New Revision: 272467 > > > > URL: https://svnweb.freebsd.org/changeset/base/272467 > > > > > > > > Log: > > > > Fix failures and warnings reported by newpynfs20090424 test tool. > > > > This fix addresses only issues with the pynfs reports, none of > these > > > > issues are know to create problems for extant real clients. > > > > > > Do you have more details than "fix bugs"? :) > > > > > > Even which failures were fixed would be helpful to document. > > > > > > > > > > > Submitted by: Bart Hsiao > > > > Reworked by: myself > > > > Reviewed by: rmacklem > > > > Approved by: rmacklem > > > > Sponsored by: QNAP Systems Inc. > > > > > > > > > > > > > -- > > > Regards, > > > Bryan Drewery > > > > > > > > > From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 20:24:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F3D279B; Fri, 3 Oct 2014 20:24:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01C6EF9; Fri, 3 Oct 2014 20:24: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 s93KOvvZ070725; Fri, 3 Oct 2014 20:24:57 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93KOveM070721; Fri, 3 Oct 2014 20:24:57 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201410032024.s93KOveM070721@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 3 Oct 2014 20:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272482 - in head/bin/sh: . tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 03 Oct 2014 20:24:58 -0000 Author: jilles Date: Fri Oct 3 20:24:56 2014 New Revision: 272482 URL: https://svnweb.freebsd.org/changeset/base/272482 Log: sh: Fix LINENO and prompt after $'\0 and newline. Added: head/bin/sh/tests/builtins/lineno3.0 (contents, props changed) head/bin/sh/tests/builtins/lineno3.0.stdout (contents, props changed) Modified: head/bin/sh/parser.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Fri Oct 3 17:27:30 2014 (r272481) +++ head/bin/sh/parser.c Fri Oct 3 20:24:56 2014 (r272482) @@ -1279,6 +1279,13 @@ readcstyleesc(char *out) c = pgetc(); if (c == PEOF) synerror("Unterminated quoted string"); + if (c == '\n') { + plinno++; + if (doprompt) + setprompt(2); + else + setprompt(0); + } } pungetc(); return out; Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Fri Oct 3 17:27:30 2014 (r272481) +++ head/bin/sh/tests/builtins/Makefile Fri Oct 3 20:24:56 2014 (r272482) @@ -100,6 +100,7 @@ FILES+= jobid2.0 FILES+= kill1.0 kill2.0 FILES+= lineno.0 lineno.0.stdout FILES+= lineno2.0 +FILES+= lineno3.0 lineno3.0.stdout FILES+= local1.0 FILES+= local2.0 FILES+= local3.0 Added: head/bin/sh/tests/builtins/lineno3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/lineno3.0 Fri Oct 3 20:24:56 2014 (r272482) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +echo before: $LINENO +dummy=$'a\0 +' +echo after: $LINENO Added: head/bin/sh/tests/builtins/lineno3.0.stdout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/lineno3.0.stdout Fri Oct 3 20:24:56 2014 (r272482) @@ -0,0 +1,2 @@ +before: 3 +after: 6 From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 20:34:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DF71B1F; Fri, 3 Oct 2014 20:34: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 F30581F9; Fri, 3 Oct 2014 20:34: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 s93KYuTr075584; Fri, 3 Oct 2014 20:34:56 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93KYuUD075578; Fri, 3 Oct 2014 20:34:56 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201410032034.s93KYuUD075578@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 3 Oct 2014 20:34:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272483 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs 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: Fri, 03 Oct 2014 20:34:57 -0000 Author: smh Date: Fri Oct 3 20:34:55 2014 New Revision: 272483 URL: https://svnweb.freebsd.org/changeset/base/272483 Log: Refactor ZFS ARC reclaim checks and limits Remove previously added kmem methods in favour of defines which allow diff minimisation between upstream code base. Rebalance ARC free target to be vm_pageout_wakeup_thresh by default which eliminates issue where ARC gets minimised instead of balancing with VM pageout. The restores the target point prior to r270759. Bring in missing upstream only changes which move unused code to further eliminate code differences. Add additional DTRACE probe to aid monitoring of ARC behaviour. Enable upstream i386 code paths on platforms which don't define UMA_MD_SMALL_ALLOC. Fix mixture of byte an page values in arc_memory_throttle i386 code path value assignment of available_memory. PR: 187594 Review: D702 Reviewed by: avg MFC after: 1 week X-MFC-With: r270759 & r270861 Sponsored by: Multiplay Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c head/sys/cddl/compat/opensolaris/sys/kmem.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/vm/vm_pageout.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Fri Oct 3 20:24:56 2014 (r272482) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Fri Oct 3 20:34:55 2014 (r272483) @@ -126,42 +126,6 @@ kmem_size_init(void *unused __unused) } SYSINIT(kmem_size_init, SI_SUB_KMEM, SI_ORDER_ANY, kmem_size_init, NULL); -/* - * The return values from kmem_free_* are only valid once the pagedaemon - * has been initialised, before then they return 0. - * - * To ensure the returns are valid the caller can use a SYSINIT with - * subsystem set to SI_SUB_KTHREAD_PAGE and an order of at least - * SI_ORDER_SECOND. - */ -u_int -kmem_free_target(void) -{ - - return (vm_cnt.v_free_target); -} - -u_int -kmem_free_min(void) -{ - - return (vm_cnt.v_free_min); -} - -u_int -kmem_free_count(void) -{ - - return (vm_cnt.v_free_count + vm_cnt.v_cache_count); -} - -u_int -kmem_page_count(void) -{ - - return (vm_cnt.v_page_count); -} - uint64_t kmem_size(void) { @@ -169,13 +133,6 @@ kmem_size(void) return (kmem_size_val); } -uint64_t -kmem_used(void) -{ - - return (vmem_size(kmem_arena, VMEM_ALLOC)); -} - static int kmem_std_constructor(void *mem, int size __unused, void *private, int flags) { Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/kmem.h Fri Oct 3 20:24:56 2014 (r272482) +++ head/sys/cddl/compat/opensolaris/sys/kmem.h Fri Oct 3 20:34:55 2014 (r272483) @@ -66,17 +66,6 @@ typedef struct kmem_cache { void *zfs_kmem_alloc(size_t size, int kmflags); void zfs_kmem_free(void *buf, size_t size); uint64_t kmem_size(void); -uint64_t kmem_used(void); -u_int kmem_page_count(void); - -/* - * The return values from kmem_free_* are only valid once the pagedaemon - * has been initialised, before then they return 0. - */ -u_int kmem_free_count(void); -u_int kmem_free_target(void); -u_int kmem_free_min(void); - kmem_cache_t *kmem_cache_create(char *name, size_t bufsize, size_t align, int (*constructor)(void *, void *, int), void (*destructor)(void *, void *), void (*reclaim)(void *) __unused, void *private, vmem_t *vmp, int cflags); @@ -88,6 +77,9 @@ void kmem_reap(void); int kmem_debugging(void); void *calloc(size_t n, size_t s); +#define freemem (vm_cnt.v_free_count + vm_cnt.v_cache_count) +#define minfree vm_cnt.v_free_min +#define heap_arena kmem_arena #define kmem_alloc(size, kmflags) zfs_kmem_alloc((size), (kmflags)) #define kmem_zalloc(size, kmflags) zfs_kmem_alloc((size), (kmflags) | M_ZERO) #define kmem_free(buf, size) zfs_kmem_free((buf), (size)) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Oct 3 20:24:56 2014 (r272482) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Oct 3 20:34:55 2014 (r272483) @@ -138,6 +138,7 @@ #include #include +#include #ifdef illumos #ifndef _KERNEL @@ -201,7 +202,7 @@ int zfs_arc_shrink_shift = 0; int zfs_arc_p_min_shift = 0; int zfs_disable_dup_eviction = 0; uint64_t zfs_arc_average_blocksize = 8 * 1024; /* 8KB */ -u_int zfs_arc_free_target = (1 << 19); /* default before pagedaemon init only */ +u_int zfs_arc_free_target = 0; static int sysctl_vfs_zfs_arc_free_target(SYSCTL_HANDLER_ARGS); @@ -210,11 +211,10 @@ static void arc_free_target_init(void *unused __unused) { - zfs_arc_free_target = kmem_free_target(); + zfs_arc_free_target = vm_pageout_wakeup_thresh; } SYSINIT(arc_free_target_init, SI_SUB_KTHREAD_PAGE, SI_ORDER_ANY, arc_free_target_init, NULL); -#endif TUNABLE_QUAD("vfs.zfs.arc_meta_limit", &zfs_arc_meta_limit); SYSCTL_DECL(_vfs_zfs); @@ -245,15 +245,16 @@ sysctl_vfs_zfs_arc_free_target(SYSCTL_HA if (err != 0 || req->newptr == NULL) return (err); - if (val < kmem_free_min()) + if (val < minfree) return (EINVAL); - if (val > kmem_page_count()) + if (val > vm_cnt.v_page_count) return (EINVAL); zfs_arc_free_target = val; return (0); } +#endif /* * Note that buffers can be in one of 6 states: @@ -2445,8 +2446,8 @@ arc_shrink(void) if (arc_c > arc_c_min) { uint64_t to_free; - DTRACE_PROBE2(arc__shrink, uint64_t, arc_c, uint64_t, - arc_c_min); + DTRACE_PROBE4(arc__shrink, uint64_t, arc_c, uint64_t, + arc_c_min, uint64_t, arc_p, uint64_t, to_free); #ifdef _KERNEL to_free = arc_c >> arc_shrink_shift; #else @@ -2462,6 +2463,10 @@ arc_shrink(void) arc_c = MAX(arc_size, arc_c_min); if (arc_p > arc_c) arc_p = (arc_c >> 1); + + DTRACE_PROBE2(arc__shrunk, uint64_t, arc_c, uint64_t, + arc_p); + ASSERT(arc_c >= arc_c_min); ASSERT((int64_t)arc_p >= 0); } @@ -2486,18 +2491,13 @@ arc_reclaim_needed(void) return (1); } - if (kmem_free_count() < zfs_arc_free_target) { - DTRACE_PROBE2(arc__reclaim_freetarget, uint64_t, - kmem_free_count(), uint64_t, zfs_arc_free_target); - return (1); - } - /* * Cooperate with pagedaemon when it's time for it to scan * and reclaim some pages. */ - if (vm_paging_needed()) { - DTRACE_PROBE(arc__reclaim_paging); + if (freemem < zfs_arc_free_target) { + DTRACE_PROBE2(arc__reclaim_freemem, uint64_t, + freemem, uint64_t, zfs_arc_free_target); return (1); } @@ -2527,7 +2527,18 @@ arc_reclaim_needed(void) if (availrmem < swapfs_minfree + swapfs_reserve + extra) return (1); -#if defined(__i386) + /* + * Check that we have enough availrmem that memory locking (e.g., via + * mlock(3C) or memcntl(2)) can still succeed. (pages_pp_maximum + * stores the number of pages that cannot be locked; when availrmem + * drops below pages_pp_maximum, page locking mechanisms such as + * page_pp_lock() will fail.) + */ + if (availrmem <= pages_pp_maximum) + return (1); + +#endif /* sun */ +#if defined(__i386) || !defined(UMA_MD_SMALL_ALLOC) /* * If we're on an i386 platform, it's possible that we'll exhaust the * kernel heap space before we ever run out of available physical @@ -2539,25 +2550,33 @@ arc_reclaim_needed(void) * heap is allocated. (Or, in the calculation, if less than 1/4th is * free) */ - if (btop(vmem_size(heap_arena, VMEM_FREE)) < - (btop(vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC)) >> 2)) - return (1); -#endif -#else /* sun */ -#ifdef __i386__ - /* i386 has KVA limits that the raw page counts above don't consider */ - if (kmem_used() > (kmem_size() * 3) / 4) { + if (vmem_size(heap_arena, VMEM_FREE) < + (vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC) >> 2)) { DTRACE_PROBE2(arc__reclaim_used, uint64_t, - kmem_used(), uint64_t, (kmem_size() * 3) / 4); + vmem_size(heap_arena, VMEM_FREE), uint64_t, + (vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC)) >> 2); return (1); } #endif +#ifdef sun + /* + * If zio data pages are being allocated out of a separate heap segment, + * then enforce that the size of available vmem for this arena remains + * above about 1/16th free. + * + * Note: The 1/16th arena free requirement was put in place + * to aggressively evict memory from the arc in order to avoid + * memory fragmentation issues. + */ + if (zio_arena != NULL && + vmem_size(zio_arena, VMEM_FREE) < + (vmem_size(zio_arena, VMEM_ALLOC) >> 4)) + return (1); #endif /* sun */ - -#else +#else /* _KERNEL */ if (spa_get_random(100) == 0) return (1); -#endif +#endif /* _KERNEL */ DTRACE_PROBE(arc__reclaim_no); return (0); @@ -2566,13 +2585,14 @@ arc_reclaim_needed(void) extern kmem_cache_t *zio_buf_cache[]; extern kmem_cache_t *zio_data_buf_cache[]; -static void +static void __noinline arc_kmem_reap_now(arc_reclaim_strategy_t strat) { size_t i; kmem_cache_t *prev_cache = NULL; kmem_cache_t *prev_data_cache = NULL; + DTRACE_PROBE(arc__kmem_reap_start); #ifdef _KERNEL if (arc_meta_used >= arc_meta_limit) { /* @@ -2608,6 +2628,16 @@ arc_kmem_reap_now(arc_reclaim_strategy_t } kmem_cache_reap_now(buf_cache); kmem_cache_reap_now(hdr_cache); + +#ifdef sun + /* + * Ask the vmem arena to reclaim unused memory from its + * quantum caches. + */ + if (zio_arena != NULL && strat == ARC_RECLAIM_AGGR) + vmem_qcache_reap(zio_arena); +#endif + DTRACE_PROBE(arc__kmem_reap_end); } static void @@ -2625,6 +2655,7 @@ arc_reclaim_thread(void *dummy __unused) if (arc_no_grow) { if (last_reclaim == ARC_RECLAIM_CONS) { + DTRACE_PROBE(arc__reclaim_aggr_no_grow); last_reclaim = ARC_RECLAIM_AGGR; } else { last_reclaim = ARC_RECLAIM_CONS; @@ -2632,6 +2663,7 @@ arc_reclaim_thread(void *dummy __unused) } else { arc_no_grow = TRUE; last_reclaim = ARC_RECLAIM_AGGR; + DTRACE_PROBE(arc__reclaim_aggr); membar_producer(); } @@ -2736,6 +2768,7 @@ arc_adapt(int bytes, arc_state_t *state) * cache size, increment the target cache size */ if (arc_size > arc_c - (2ULL << SPA_MAXBLOCKSHIFT)) { + DTRACE_PROBE1(arc__inc_adapt, int, bytes); atomic_add_64(&arc_c, (int64_t)bytes); if (arc_c > arc_c_max) arc_c = arc_c_max; @@ -2757,20 +2790,6 @@ arc_evict_needed(arc_buf_contents_t type if (type == ARC_BUFC_METADATA && arc_meta_used >= arc_meta_limit) return (1); -#ifdef sun -#ifdef _KERNEL - /* - * If zio data pages are being allocated out of a separate heap segment, - * then enforce that the size of available vmem for this area remains - * above about 1/32nd free. - */ - if (type == ARC_BUFC_DATA && zio_arena != NULL && - vmem_size(zio_arena, VMEM_FREE) < - (vmem_size(zio_arena, VMEM_ALLOC) >> 5)) - return (1); -#endif -#endif /* sun */ - if (arc_reclaim_needed()) return (1); @@ -3929,20 +3948,16 @@ static int arc_memory_throttle(uint64_t reserve, uint64_t txg) { #ifdef _KERNEL - uint64_t available_memory = - ptoa((uintmax_t)vm_cnt.v_free_count + vm_cnt.v_cache_count); + uint64_t available_memory = ptob(freemem); static uint64_t page_load = 0; static uint64_t last_txg = 0; -#ifdef sun -#if defined(__i386) +#if defined(__i386) || !defined(UMA_MD_SMALL_ALLOC) available_memory = - MIN(available_memory, vmem_size(heap_arena, VMEM_FREE)); + MIN(available_memory, ptob(vmem_size(heap_arena, VMEM_FREE))); #endif -#endif /* sun */ - if (vm_cnt.v_free_count + vm_cnt.v_cache_count > - (uint64_t)physmem * arc_lotsfree_percent / 100) + if (freemem > (uint64_t)physmem * arc_lotsfree_percent / 100) return (0); if (txg > last_txg) { @@ -3955,7 +3970,7 @@ arc_memory_throttle(uint64_t reserve, ui * continue to let page writes occur as quickly as possible. */ if (curproc == pageproc) { - if (page_load > available_memory / 4) + if (page_load > MAX(ptob(minfree), available_memory) / 4) return (SET_ERROR(ERESTART)); /* Note: reserve is inflated, so we deflate */ page_load += reserve / 8; @@ -3983,8 +3998,10 @@ arc_tempreserve_space(uint64_t reserve, int error; uint64_t anon_size; - if (reserve > arc_c/4 && !arc_no_grow) + if (reserve > arc_c/4 && !arc_no_grow) { arc_c = MIN(arc_c_max, reserve * 4); + DTRACE_PROBE1(arc__set_reserve, uint64_t, arc_c); + } if (reserve > arc_c) return (SET_ERROR(ENOMEM)); @@ -4038,6 +4055,7 @@ arc_lowmem(void *arg __unused, int howto mutex_enter(&arc_lowmem_lock); mutex_enter(&arc_reclaim_thr_lock); needfree = 1; + DTRACE_PROBE(arc__needfree); cv_signal(&arc_reclaim_thr_cv); /* Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri Oct 3 20:24:56 2014 (r272482) +++ head/sys/vm/vm_pageout.c Fri Oct 3 20:34:55 2014 (r272483) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include "opt_vm.h" +#include "opt_kdtrace.h" #include #include #include @@ -89,6 +90,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -133,6 +135,10 @@ static struct kproc_desc page_kp = { SYSINIT(pagedaemon, SI_SUB_KTHREAD_PAGE, SI_ORDER_SECOND, kproc_start, &page_kp); +SDT_PROVIDER_DEFINE(vm); +SDT_PROBE_DEFINE(vm, , , vm__lowmem_cache); +SDT_PROBE_DEFINE(vm, , , vm__lowmem_scan); + #if !defined(NO_SWAPPING) /* the kernel process "vm_daemon"*/ static void vm_daemon(void); @@ -667,6 +673,7 @@ vm_pageout_grow_cache(int tries, vm_padd * may acquire locks and/or sleep, so they can only be invoked * when "tries" is greater than zero. */ + SDT_PROBE0(vm, , , vm__lowmem_cache); EVENTHANDLER_INVOKE(vm_lowmem, 0); /* @@ -920,6 +927,7 @@ vm_pageout_scan(struct vm_domain *vmd, i /* * Decrease registered cache sizes. */ + SDT_PROBE0(vm, , , vm__lowmem_scan); EVENTHANDLER_INVOKE(vm_lowmem, 0); /* * We do this explicitly after the caches have been From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 20:36:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7DCECA0; Fri, 3 Oct 2014 20:36:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C96AA222; Fri, 3 Oct 2014 20:36:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s93KaADZ075850; Fri, 3 Oct 2014 20:36:10 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93KaAjb075845; Fri, 3 Oct 2014 20:36:10 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410032036.s93KaAjb075845@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 3 Oct 2014 20:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272484 - in head: . cddl/lib/libzfs cddl/lib/libzpool X-SVN-Group: head MIME-Version: 1.0 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, 03 Oct 2014 20:36:11 -0000 Author: delphij Date: Fri Oct 3 20:36:09 2014 New Revision: 272484 URL: https://svnweb.freebsd.org/changeset/base/272484 Log: Add dependencies to various libraries to libzfs and libzpool. Submitted by: sef Modified: head/Makefile.inc1 head/cddl/lib/libzfs/Makefile head/cddl/lib/libzpool/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Oct 3 20:34:55 2014 (r272483) +++ head/Makefile.inc1 Fri Oct 3 20:36:09 2014 (r272484) @@ -1531,7 +1531,9 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ + lib/libgeom \ ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ + ${_cddl_lib_libuutil} \ ${_cddl_lib_libavl} \ ${_cddl_lib_libzfs_core} \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ @@ -1543,6 +1545,8 @@ gnu/lib/libstdc++__L: lib/msun__L gnu/lib/libsupc++__L: gnu/lib/libstdc++__L .endif +lib/libgeom__L: lib/libexpat__L + .if defined(WITH_ATF) || ${MK_TESTS} != "no" .if !defined(WITH_ATF) # Ensure that the ATF libraries will be built during make libraries, even @@ -1580,9 +1584,11 @@ lib/libopie__L lib/libtacplus__L: lib/li _cddl_lib_libumem= cddl/lib/libumem _cddl_lib_libnvpair= cddl/lib/libnvpair _cddl_lib_libavl= cddl/lib/libavl +_cddl_lib_libuutil= cddl/lib/libuutil _cddl_lib_libzfs_core= cddl/lib/libzfs_core _cddl_lib= cddl/lib cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L +cddl/lib/libzfs__L: lib/libgeom__L .endif .if ${MK_CRYPT} != "no" Modified: head/cddl/lib/libzfs/Makefile ============================================================================== --- head/cddl/lib/libzfs/Makefile Fri Oct 3 20:34:55 2014 (r272483) +++ head/cddl/lib/libzfs/Makefile Fri Oct 3 20:36:09 2014 (r272484) @@ -7,8 +7,11 @@ LIB= zfs DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} \ - ${LIBAVL} ${LIBZFS_CORE} -LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -lavl -lzfs_core + ${LIBAVL} ${LIBZFS_CORE} ${LIBUUTIL} ${LIBBSDXML} ${LIBGEOM} \ + ${LIBNVPAIR} + +LDADD= -lmd -lpthread -lumem -lutil -luutil -lm -lnvpair -lavl \ + -lbsdxml -lgeom -lnvpair -lzfs_core SRCS= deviceid.c \ fsshare.c \ Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Fri Oct 3 20:34:55 2014 (r272483) +++ head/cddl/lib/libzpool/Makefile Fri Oct 3 20:36:09 2014 (r272484) @@ -56,8 +56,9 @@ CFLAGS+= -I${.CURDIR}/../../../lib/libpt CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/sys CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_CPUARCH}/include -DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBZ} -LDADD= -lmd -lpthread -lz +DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBZ} ${LIBNVPAIR} \ + ${LIBAVL} ${LIBUMEM} +LDADD= -lmd -lpthread -lz -lnvpair -lavl -lumem # atomic.S doesn't like profiling. MK_PROFILE= no From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 20:48:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A50FFAF; Fri, 3 Oct 2014 20:48:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B80033C; Fri, 3 Oct 2014 20:48: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 s93KmDmj080758; Fri, 3 Oct 2014 20:48:13 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93KmBue080752; Fri, 3 Oct 2014 20:48:11 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201410032048.s93KmBue080752@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 3 Oct 2014 20:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272485 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 03 Oct 2014 20:48:13 -0000 Author: marcel Date: Fri Oct 3 20:48:11 2014 New Revision: 272485 URL: https://svnweb.freebsd.org/changeset/base/272485 Log: Add mkimg_chs() for those schemes that need the LBA broken down into cylinder, head and track numbers. Return ~0U for these values when mkimg wasn't given both -T and -H (i.e. no geometry) or the cylinder would be larger than the provided maximum. Use mkimgs_chs() for the EBR, MBR and PC98 schemes to fill in the appropriate fields. Make sure to use a "rounded" size so that the partition is always a multiple of the track size. We reserved the room for it in the metadata callback so that's a valid thing to do. Bump the mkimg version number. While doing that again: have mkimg.o depend on the Makefile so that a version change triggers a rebuild as needed. Modified: head/usr.bin/mkimg/Makefile head/usr.bin/mkimg/ebr.c head/usr.bin/mkimg/mbr.c head/usr.bin/mkimg/mkimg.c head/usr.bin/mkimg/mkimg.h head/usr.bin/mkimg/pc98.c Modified: head/usr.bin/mkimg/Makefile ============================================================================== --- head/usr.bin/mkimg/Makefile Fri Oct 3 20:36:09 2014 (r272484) +++ head/usr.bin/mkimg/Makefile Fri Oct 3 20:48:11 2014 (r272485) @@ -6,7 +6,9 @@ PROG= mkimg SRCS= format.c image.c mkimg.c scheme.c MAN= mkimg.1 -MKIMG_VERSION=20141001 +MKIMG_VERSION=20141003 +mkimg.o: Makefile + CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION} CFLAGS+=-DSPARSE_WRITE Modified: head/usr.bin/mkimg/ebr.c ============================================================================== --- head/usr.bin/mkimg/ebr.c Fri Oct 3 20:36:09 2014 (r272484) +++ head/usr.bin/mkimg/ebr.c Fri Oct 3 20:48:11 2014 (r272485) @@ -58,12 +58,14 @@ ebr_metadata(u_int where, lba_t blk) } static void -ebr_chs(u_char *cyl, u_char *hd, u_char *sec, uint32_t lba __unused) +ebr_chs(u_char *cylp, u_char *hdp, u_char *secp, lba_t lba) { + u_int cyl, hd, sec; - *cyl = 0xff; /* XXX */ - *hd = 0xff; /* XXX */ - *sec = 0xff; /* XXX */ + mkimg_chs(lba, 1023, &cyl, &hd, &sec); + *cylp = cyl; + *hdp = hd; + *secp = (sec & 0x3f) | ((cyl >> 2) & 0xc0); } static int @@ -72,7 +74,7 @@ ebr_write(lba_t imgsz __unused, void *bo u_char *ebr; struct dos_partition *dp; struct part *part, *next; - lba_t block; + lba_t block, size; int error; ebr = malloc(secsz); @@ -84,24 +86,26 @@ ebr_write(lba_t imgsz __unused, void *bo error = 0; STAILQ_FOREACH_SAFE(part, &partlist, link, next) { block = part->block - nsecs; + size = round_track(part->size); dp = (void *)(ebr + DOSPARTOFF); ebr_chs(&dp->dp_scyl, &dp->dp_shd, &dp->dp_ssect, nsecs); dp->dp_typ = ALIAS_TYPE2INT(part->type); ebr_chs(&dp->dp_ecyl, &dp->dp_ehd, &dp->dp_esect, - part->block + part->size - 1); + part->block + size - 1); le32enc(&dp->dp_start, nsecs); - le32enc(&dp->dp_size, part->size); + le32enc(&dp->dp_size, size); /* Add link entry */ if (next != NULL) { + size = round_track(next->size); dp++; ebr_chs(&dp->dp_scyl, &dp->dp_shd, &dp->dp_ssect, next->block - nsecs); dp->dp_typ = DOSPTYP_EXT; ebr_chs(&dp->dp_ecyl, &dp->dp_ehd, &dp->dp_esect, - next->block + next->size - 1); + next->block + size - 1); le32enc(&dp->dp_start, next->block - nsecs); - le32enc(&dp->dp_size, next->size + nsecs); + le32enc(&dp->dp_size, size + nsecs); } error = image_write(block, ebr, 1); Modified: head/usr.bin/mkimg/mbr.c ============================================================================== --- head/usr.bin/mkimg/mbr.c Fri Oct 3 20:36:09 2014 (r272484) +++ head/usr.bin/mkimg/mbr.c Fri Oct 3 20:48:11 2014 (r272485) @@ -59,12 +59,14 @@ mbr_metadata(u_int where, lba_t blk) } static void -mbr_chs(u_char *cyl, u_char *hd, u_char *sec, uint32_t lba __unused) +mbr_chs(u_char *cylp, u_char *hdp, u_char *secp, lba_t lba) { + u_int cyl, hd, sec; - *cyl = 0xff; /* XXX */ - *hd = 0xff; /* XXX */ - *sec = 0xff; /* XXX */ + mkimg_chs(lba, 1023, &cyl, &hd, &sec); + *cylp = cyl; + *hdp = hd; + *secp = (sec & 0x3f) | ((cyl >> 2) & 0xc0); } static int @@ -73,6 +75,7 @@ mbr_write(lba_t imgsz __unused, void *bo u_char *mbr; struct dos_partition *dpbase, *dp; struct part *part; + lba_t size; int error; mbr = malloc(secsz); @@ -86,15 +89,16 @@ mbr_write(lba_t imgsz __unused, void *bo le16enc(mbr + DOSMAGICOFFSET, DOSMAGIC); dpbase = (void *)(mbr + DOSPARTOFF); STAILQ_FOREACH(part, &partlist, link) { + size = round_track(part->size); dp = dpbase + part->index; dp->dp_flag = (part->index == 0 && bootcode != NULL) ? 0x80 : 0; mbr_chs(&dp->dp_scyl, &dp->dp_shd, &dp->dp_ssect, part->block); dp->dp_typ = ALIAS_TYPE2INT(part->type); mbr_chs(&dp->dp_ecyl, &dp->dp_ehd, &dp->dp_esect, - part->block + part->size - 1); + part->block + size - 1); le32enc(&dp->dp_start, part->block); - le32enc(&dp->dp_size, part->size); + le32enc(&dp->dp_size, size); } error = image_write(0, mbr, 1); free(mbr); Modified: head/usr.bin/mkimg/mkimg.c ============================================================================== --- head/usr.bin/mkimg/mkimg.c Fri Oct 3 20:36:09 2014 (r272484) +++ head/usr.bin/mkimg/mkimg.c Fri Oct 3 20:48:11 2014 (r272485) @@ -340,6 +340,27 @@ sparse_write(int fd, const void *ptr, si #endif /* SPARSE_WRITE */ void +mkimg_chs(lba_t lba, u_int maxcyl, u_int *cylp, u_int *hdp, u_int *secp) +{ + u_int hd, sec; + + *cylp = *hdp = *secp = ~0U; + if (nsecs == 1 || nheads == 1) + return; + + sec = lba % nsecs + 1; + lba /= nsecs; + hd = lba % nheads; + lba /= nheads; + if (lba > maxcyl) + return; + + *cylp = lba; + *hdp = hd; + *secp = sec; +} + +void mkimg_uuid(struct uuid *uuid) { static uint8_t gen[sizeof(struct uuid)]; Modified: head/usr.bin/mkimg/mkimg.h ============================================================================== --- head/usr.bin/mkimg/mkimg.h Fri Oct 3 20:36:09 2014 (r272484) +++ head/usr.bin/mkimg/mkimg.h Fri Oct 3 20:48:11 2014 (r272485) @@ -87,6 +87,8 @@ round_track(lba_t n) ssize_t sparse_write(int, const void *, size_t); #endif +void mkimg_chs(lba_t, u_int, u_int *, u_int *, u_int *); + struct uuid; void mkimg_uuid(struct uuid *); Modified: head/usr.bin/mkimg/pc98.c ============================================================================== --- head/usr.bin/mkimg/pc98.c Fri Oct 3 20:36:09 2014 (r272484) +++ head/usr.bin/mkimg/pc98.c Fri Oct 3 20:48:11 2014 (r272485) @@ -68,12 +68,14 @@ pc98_metadata(u_int where, lba_t blk) } static void -pc98_chs(u_short *cyl, u_char *hd, u_char *sec, uint32_t lba __unused) +pc98_chs(u_short *cylp, u_char *hdp, u_char *secp, lba_t lba) { + u_int cyl, hd, sec; - *cyl = 0xffff; /* XXX */ - *hd = 0xff; /* XXX */ - *sec = 0xff; /* XXX */ + mkimg_chs(lba, 0xffff, &cyl, &hd, &sec); + le16enc(cylp, cyl); + *hdp = hd; + *secp = sec; } static int @@ -82,6 +84,7 @@ pc98_write(lba_t imgsz __unused, void *b struct part *part; struct pc98_partition *dpbase, *dp; u_char *buf; + lba_t size; int error, ptyp; buf = malloc(PC98_BOOTCODESZ); @@ -95,6 +98,7 @@ pc98_write(lba_t imgsz __unused, void *b le16enc(buf + PC98_MAGICOFS, PC98_MAGIC); dpbase = (void *)(buf + secsz); STAILQ_FOREACH(part, &partlist, link) { + size = round_track(part->size); dp = dpbase + part->index; ptyp = ALIAS_TYPE2INT(part->type); dp->dp_mid = ptyp; @@ -102,7 +106,7 @@ pc98_write(lba_t imgsz __unused, void *b pc98_chs(&dp->dp_scyl, &dp->dp_shd, &dp->dp_ssect, part->block); pc98_chs(&dp->dp_scyl, &dp->dp_shd, &dp->dp_ssect, - part->block + part->size - 1); + part->block + size - 1); if (part->label != NULL) memcpy(dp->dp_name, part->label, strlen(part->label)); } From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 20:52:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EBBE31B; Fri, 3 Oct 2014 20:52:55 +0000 (UTC) Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com [IPv6:2607:f8b0:400e:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23C475FB; Fri, 3 Oct 2014 20:52:55 +0000 (UTC) Received: by mail-pa0-f41.google.com with SMTP id eu11so2101734pac.14 for ; Fri, 03 Oct 2014 13:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=JOhWY9vhmMZrSvqHRRwWcUNVpgMiWLMiX+uncEbEocA=; b=TbNONUvjTW55rCvHuF+QKZn3hSoCCSRyJxqUMJAf5zFzIHptG3VTPXIo9JCbobgzXt 6BfmKvO4d+cfB1OzfgZONn9uyaRXlxpIgTp3NFznMExnnVcHvFzh7oHRdrjM9ScGSFYM NysNL6s/pHCa1YTj7zLk+RfMkKRZSFmgOnchXmn7vQqssW2FlIlFsR3TIqYYIgSMRMHd 39Wdz+ZDF6Uc0W2+QUWg1KKQePxDcorvb3ntPjdutab1rN5xButfAFhIY2Sm1Z/71iht 4qwYNErKdD36fvgz8SXQ9TB46gbYeiFfyKU4M9f6ZdZPtQ4Nmhby3Z37u2oMULCZaKgf JFHA== X-Received: by 10.70.65.7 with SMTP id t7mr2992046pds.133.1412369574713; Fri, 03 Oct 2014 13:52:54 -0700 (PDT) Received: from [10.57.40.208] (mobile-166-137-212-089.mycingular.net. [166.137.212.89]) by mx.google.com with ESMTPSA id gi14sm7189192pbd.10.2014.10.03.13.52.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 13:52:54 -0700 (PDT) References: <201410032036.s93KaAjb075845@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201410032036.s93KaAjb075845@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (11D257) From: Garrett Cooper Subject: Re: svn commit: r272484 - in head: . cddl/lib/libzfs cddl/lib/libzpool Date: Fri, 3 Oct 2014 13:52:49 -0700 To: Xin LI Cc: "svn-src-head@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, 03 Oct 2014 20:52:55 -0000 > On Oct 3, 2014, at 13:36, Xin LI wrote: >=20 > Author: delphij > Date: Fri Oct 3 20:36:09 2014 > New Revision: 272484 > URL: https://svnweb.freebsd.org/changeset/base/272484 >=20 > Log: > Add dependencies to various libraries to libzfs and libzpool. >=20 > Submitted by: sef >=20 > Modified: > head/Makefile.inc1 > head/cddl/lib/libzfs/Makefile > head/cddl/lib/libzpool/Makefile >=20 > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/Makefile.inc1 Fri Oct 3 20:34:55 2014 (r272483) > +++ head/Makefile.inc1 Fri Oct 3 20:36:09 2014 (r272484) > @@ -1531,7 +1531,9 @@ _prebuild_libs=3D ${_kerberos5_lib_libasn1 > lib/ncurses/ncurses lib/ncurses/ncursesw \ > lib/libopie lib/libpam ${_lib_libthr} \ > lib/libradius lib/libsbuf lib/libtacplus \ > + lib/libgeom \ > ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ > + ${_cddl_lib_libuutil} \ > ${_cddl_lib_libavl} \ > ${_cddl_lib_libzfs_core} \ > lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ > @@ -1543,6 +1545,8 @@ gnu/lib/libstdc++__L: lib/msun__L > gnu/lib/libsupc++__L: gnu/lib/libstdc++__L > .endif >=20 > +lib/libgeom__L: lib/libexpat__L > + > .if defined(WITH_ATF) || ${MK_TESTS} !=3D "no" > .if !defined(WITH_ATF) > # Ensure that the ATF libraries will be built during make libraries, even > @@ -1580,9 +1584,11 @@ lib/libopie__L lib/libtacplus__L: lib/li > _cddl_lib_libumem=3D cddl/lib/libumem > _cddl_lib_libnvpair=3D cddl/lib/libnvpair > _cddl_lib_libavl=3D cddl/lib/libavl > +_cddl_lib_libuutil=3D cddl/lib/libuutil > _cddl_lib_libzfs_core=3D cddl/lib/libzfs_core > _cddl_lib=3D cddl/lib > cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L > +cddl/lib/libzfs__L: lib/libgeom__L > .endif >=20 > .if ${MK_CRYPT} !=3D "no" Hi Xin! The changes to Makefile.inc1 are only required if MK_ZFS =3D=3D no. Coul= d you please adjust the code to account for that? Thanks! -Garrett= From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 20:54:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B0E4478; Fri, 3 Oct 2014 20: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 15740611; Fri, 3 Oct 2014 20: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 s93KsdF0085065; Fri, 3 Oct 2014 20:54:39 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93KsZPi085044; Fri, 3 Oct 2014 20:54:35 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201410032054.s93KsZPi085044@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 3 Oct 2014 20:54:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272486 - head/usr.bin/mkimg/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 03 Oct 2014 20:54:39 -0000 Author: marcel Date: Fri Oct 3 20:54:35 2014 New Revision: 272486 URL: https://svnweb.freebsd.org/changeset/base/272486 Log: Update baseline files for EBR, MBR and PC98 now that mkimg fills in the CHS fields appropriately when -T and -H are given on the command line. Modified: head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow2.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-ebr.raw.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhd.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdf.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vmdk.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow2.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-mbr.raw.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhd.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdf.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-mbr.vmdk.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow2.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-pc98.raw.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-pc98.vhd.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-pc98.vhdf.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-pc98.vmdk.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-ebr.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-ebr.qcow2.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-ebr.raw.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-ebr.vhd.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdf.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-ebr.vmdk.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-mbr.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-mbr.qcow2.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-mbr.raw.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-mbr.vhd.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdf.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-mbr.vmdk.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-pc98.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-pc98.qcow2.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-pc98.raw.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-pc98.vhd.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-pc98.vhdf.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-pc98.vmdk.gz.uu Modified: head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow.gz.uu Fri Oct 3 20:48:11 2014 (r272485) +++ head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow.gz.uu Fri Oct 3 20:54:35 2014 (r272486) @@ -1,128 +1,128 @@ # $FreeBSD$ begin 644 img-63x255-4096-ebr.qcow.gz -M'XL(",4S(E0``VEM9RTV,W@R-34M-#`Y-BUE8G(N<6-O=RYO=70`K9W);AS9 -M$47W^HK2+%%3142.&BC"@`UX9R]L;SO'=7V`X&\W);Z!C+Q7H7:WFFA04.=% -MU>/A4=M]\'0^W_TXG5HY-=VI&4_[?+K]>?J0T[V?//PX??OGW_[^_OZ/;X_N -MQN3\DZ?FSW.73VZ>[/X -M.66#]F#PE.;.Z?4).;WFUU[?C7N["C*R, -M.XVX$^0[9=QIQ)T@WRGC3B/N!/E.&7<:<2?(=\JXTX@[0;Y3QIV&W"'?*>/. -M0NZ0[XQQ9R%WR'?&N+.0.^0[8]Q9R!WRG3'N+.0.^0.^6Y@ -MW.7_>Y[/(=^-C+LQY`[Y;F3*N0[Y;&'=+Q%V'?+$W"'?+8R[->0.^6YEW*TA=\AW*^-N#;E# -MOEL9=VO('?+=RKA;0^Z0[U;&W1IRAWRW,N[6D#ODNY5QMT;<]?@IPAT)A.[- -M(=]MC+LMXJY'OML8=UO$78]\MS'NMHB['OEN8]QM$7<]\MW&N-LB[GKDNXUQ -MMT7<]`[.1/NY!QQ-P#? -MR9EP)^>(NP'X3E@?*+Z_.W`W`-\)Z^\D[.\&X#MA_9V$_=T`?">LOY.POQN` -M[X3U=Q+V=P/PG;#^3L+^;@"^$];?2=C?#LOY.POQN`[X3U=Q+V=R-^BG`7]G]8?R=A?SOO).SO1N0[UM])V-^-R'>LOY.POQN1[UA_)V%_ -M-R+?L?Y.POYN1+YC_9V$_=V(?,?Z.PG[NPD_1;@+^[L)^8[U=Q+V=Q/R'>OO -M).SO)N0[UM])V-]-R'>LOY.POYN0[UA_)V%_-R'?L?Y.POYN0KYC_9V$_=V$ -M?,?Z.PG[NPGYCO5W$O9W$_(=Z^\D[.\FY#O6WTG8WTW(=ZR_D["_FY#O6'\G -M87\W(=^Q_D["_FY"OF/]G83]W8R?(MR%_=V,?,?Z.PG[NQGYCO5W$O9W,_(= -MZ^\D[.]FY#O6WTG8W\W(=ZR_D["_FY'O6'\G87\W(]^Q_D["_FY&OF/]G83] -MW8Q\Q_H["?N[&?F.]7<2]G]8 -M?R=A?S["_FY!OF/]G83]W8)\Q_H["?N[!?F.]7<2]G<+ -M\AWK[R3L[Q;D.];?2=C?+OO).SO%N0[UM])V-\MR'>LOY.POUN0 -M[UA_)V%_M^*G"'=A?[OO).SO5N0[UM])V-^MR'>LOY.POUN1[UA_)V%_MR+?L?Y.POYN1;YC -M_9V$_=V*?,?Z.PG[NQ7YCO5W$O9W*_(=Z^\D[.]6Y#O6WTG8WZW(=ZR_D["_ -MV_!3A+NPO]N0[UA_)V%_MR'?L?Y.POYN0[YC_9V$_=V&?,?Z.PG[NPWYCO5W -M$O9W&_(=Z^\D[.\VY#O6WTG8WVW(=ZR_D["_VY#O6'\G87^W(=^Q_D["_FY# -MOF/]G83]W89\Q_H["?N[#?F.]7<2]G<;\AWK[R3L[S;D.];?2=C?[?@IPEW8 -MW^W(=ZR_D["_VY'O6'\G87^W(]^Q_D["_FY'OF/]G83]W8Y\Q_H["?N['?F. -M]7<2]G<[\AWK[R3L[W;D.];?2=C?[]8?R=A?[^8_V=A/W=CGS'^CL)^[L=^8[U=Q+V=SOR'>OO).KO[(R?PMQI_L3-G>H< -M\-WM4Y@[=?U=ON_O="ISP'?*^CMU_=TI<7>Z*7/`=\KZ.W7]W2EQ=_JMS`'? -M*>OOU/5WI\OA[(#OE/5WZOJ[OO\MSC.@=\IZR_4]??/LOU/7WY6SJW/`=\KZ.W7]'9@#OE/6WZGK[XYS -MZ/X[9?V=NOXNSSVI<\AWK+]3U]\]R7.%.W3_G;+^3EU_]R1Q]Z1PA^Z_4];? -MJ>OOGB3NGA3NT/UWROH[=?W=D\OA[)#O6'^GKK\K9U?GD.]8?Z>NOP-SR'>L -MOU/7WX$YY#O6WZGK[_+OOGEX.9X=\Q_H[=?U=.;LZAWS'^CMU_1V80[YC -M_9VZ_NXXA^Z_4];?J>OO\MRS.H=\Q_H[=?W=LSQ7N$/WWRGK[]3U=\\2=\\* -M=^C^.V7]G;K^[EGB[EGA#MU_IZR_4]??/;LLOU/7WSW/0[UM^IZ^^.<^C^.V7]G;K^+L^]J'/(=ZR_4]??OB<(?NOU/6WZGK[UXD[EX4[M#]=\KZ.W7]W8O+X>R0[UA_IZZ_*V=7 -MYY#O6'^GKK\#<\AWK+]3U]^!.>0[UM^IZ^_RW,LZAWS'^CMU_=W+/%>Y0[YC -M_9VZ_NYEXNYEY0[YCO5WZOJ[EXF[EY4[Y#O6WZGK[UY>#F>'?,?Z.W7]73F[ -M.H=\Q_H[=?T=F$.^8_V=NO[N.(?NOU/6WZGK[_+O$G>O"G?H_CME_9VZ_NY5XNY5X0[=?Z>LOU/7W[VZ',X.^8[U -M=^KZNW)V=0[YCO5WZOH[,(=\Q_H[=?T=F$.^8_V=NOXNS[VN<\AWK+]3U]^] -MSG.5.^0[UM^IZ^]>)^Y>5^Z0[UA_IZZ_>YVX>UVY0[YC_9VZ_N[UY7!VR'>L -MOU/7WY6SJW/(=ZR_4]??@3GD.];?J>OOCG/H_CME_9VZ_B[/7=4YY#O6WZGK -M[Z[R7.$.W7^GK+]3U]]=)>ZN"G?H_CME_9VZ_NXJ<7=5N$/WWRGK[]3U=U>7 -MP]DAW['^3EU_5\ZNSB'?L?Y.77\'YI#O6'^GKK\#<\AWK+]3U]_EN3=U#OF. -M]7?J^KLW>:YRAWS'^CMU_=V;Q-V;RAWR'>OOU/5W;Q)W;RIWR'>LOU/7W[VY -M',X.^8[U=^KZNW)V=0[YCO5WZOH[,(=\Q_H[=?W=<0[=?Z>LOU/7W^6YMW4. -M^8[U=^KZN[=YKG"'[K]3UM^IZ^_>)N[>%N[0_7?*^CMU_=W;Q-W;PAVZ_TY9 -M?Z>NOWM[.9P=\AWK[]3U=^7LZASR'>OOU/5W8`[YCO5WZOH[,(=\Q_H[=?U= -MGGM7YY#O6'^GKK][E^NORMG5^>0[UA_IZZ_`W/(=ZR_4]??'>?0_7?*^CMU -M_5V>>U_GD.]8?Z=1?V?H_CME_9U&_9VA^^^4]7<:]7>&[K]3UM]IU-\9NO]. -M67^G47]GZ/X[9?V=1OV=H?OOE/5W&O5WANZ_4];?*>GO/M0YY#O6WZGK[S[D -MNOORMG5.>0[UM^IZ^_`'/(=Z^_4]7?'.73_G;+^SO(G;NYN7"'[K\SUM^9Z^_.B;MSX0[=?V>LOS/7WYTO -MA[,#OC/6WYGK[\K9U3G@.V/]G;G^#LP!WQGK[\SU=V`.^,Y8?V>NO\MS4N>` -M[XSU=^;Z.\ESE3O@.V/]G;G^3M++D\H=\)VQ_LY).ZG<`=\9Z^_,]7=R -M.9P=\)VQ_LYNOSO.H?OOC/5WYOJ[/*=U -M#OF.]7?F^CO-$.W7]GK+\S -MU]_IY7!VR'>LOS/7WY6SJW/(=ZR_,]??@3GD.];?F>OOP!SR'>OOS/5W><[J -M'/(=Z^_,]7>6YRIWR'>LOS/7WUGBSBIWR'>LOS/7WUGBSBIWR'>LOS/7W]GE -M<';(=ZR_,]??E;.K<\AWK+\SU]^!.>0[UM^9Z^^.<^C^.V/]G;G^+L\U=0[Y -MCO5WYOJ[)L\5[M#]=\;Z.W/]79.X:PIWZ/X[8_V=N?ZN2=PUA3MT_YVQ_LY< -M?]=<#F>'?,?Z.W/]73F[.H=\Q_H[<_T=F$.^8_V=N?X.S"'?L?[.7'^7Y]HZ -MAWS'^CMS_5V;YRIWR'>LOS/7W[6)N[9RAWS'^CMS_5V;N&LK=\AWK+\SU]^U -ME\/9(=^Q_LYOOS/5W?9ZKW"'?L?[.7'_7)^[ZRAWR'>OOS/5W?>*NK]PAW['^SEQ_ -MUU\.9X=\Q_H[<_U=.;LZAWS'^CMS_1V80[YC_9VY_NXXA^Z_,];?F>OO\MQ0 -MYY#O6']GKK\;\ESA#MU_9ZR_,]??#8F[H7"'[K\SUM^9Z^^&Q-U0N$/WWQGK -M[\SU=\/E<';(=ZR_,]??E;.K<\AWK+\SU]^!.>0[UM^9Z^_`'/(=Z^_,]7=Y -M;JQSR'>LOS/7WXUYKG*'?,?Z.W/]W9BX&RMWR'>LOS/7WXV)N[%RAWS'^CMS -M_=UX.9P=\AWK[\SU=^7LZASR'>OOS/5W8`[YCO5WYOJ[XQRZ_\Y8?V>NO\MS -M'^L<\AWK[\SU=Q_S7.$.W7]GK+\SU]]]3-Q]+-RA^^^,]7?F^KN/B;N/A3MT -M_YVQ_LYOOP!SR'>OOS/5W8`[YCO5W -MYOJ[//>ISB'?L?[.7'_W*<]5[I#O6']GKK_[E+C[5+E#OF/]G;G^[E/B[E/E -M#OF.]7?F^KM/E\/9(=^Q_LY?+X>S0[YC_9VY_JZ<79U#OF/]G;G^#LPAW['^SEQ_ -M!^:0[UA_9ZZ_RW-?ZASR'>OOS/5W7_)X0_??&>OOS/5WUXF[Z\(=NO_. -M6']GKK^[3MQ=%^[0_7?&^CMS_=WUY7!VR'>LOS/7WY6SJW/(=ZR_,]??@3GD -M.];?F>OOP!SR'>OOS/5W>>YKG4.^8_V=N?[N:YZKW"'?L?[.7'_W-7'WM7*' -M?,?Z.W/]W=?$W=?*'?(=Z^_,]7=?+X>S0[YC_9VY_JZ<79U#OF/]G;G^#LPA -MW['^SEQ_=YAKSO@IS%V3/W%S-W4.^*YA_5WC^KN;/')NYO?RASP77P]FA/V^[G#C]A6_OW8]O -MCZY^#+;H&J)@<-_AX-W<]V^SVW_@]F-JTR>W'W#;7N:IL/@O_+K0S<'_9'7U_WXGU*-GLX3^#O_A6]_>?_P -MKSS8__C>;?M3TY[:[C3HK[["__SUW^#KVZ/OW?_O#=_-@>_=AW/Y!9??S@YS -M7^_-V1U]=47N/76?N_N?WYN[?G_O]]L>?>_6N>^^VM`OT#?[)W_O]H?[(>]_ -MG7]Y>TO+U/=77AWK\!V_W)Z_O='R[/_Y]H'_XS\N].0W>[NGA -MW`]1W?MZ/O@2!J=W?7QUZ,^C_R-?C,,MA[_XG?M]Y.%W[MV<_KDB&'Z8Y?OO -C8A/X._^%;_]X__"ON\$F#?YI)]C?HNIWL_>?C]]/6??_O[^_O?OCZZ +M&Y/S3YYR/^^W,O=@Z[]U3K\_M9S.XR_,??LN:.[>J[/?\>KNO=GCW-6CNS>+ +MGU,V:`\&3VGNG%Z?D--K?NWUW;JW*W>G]^>]725OM_VUP7^XUZ>_"Y9?>GV_ +M\^O;P<'?RNMKX%,]FQL>S%T.;[>%3XUL;OHIS'KNX%,SFUN"N1X^M;*Y+9@; +MX%,[GI.??&WOYD;XE+`YA7.G,C?!IXS--0_FSFGNMLS-\"GRN1#'7?Y<5.X6 +M^!3A3D+N5O@4X4Y"[C;X%.%.0NYV^!3A3B+N!#]%N-.(.T&*4L:=1MP),K(R +M[C3B3I#OE'&G$7>"?*>,.XVX$^0[9=QIQ)T@WRGC3B/N!/E.&7<:XLY`[Y +MSAAW%G&G^"G"71-QI\AW#>.NB;A3Y+N&<==$W"GR7<.X:R+N%/FN8=PU$7>* +M?-.NB[@SY+N.<==%W!GR7<>XZR+N#/FN8]QU$7>&?-L9='W*'?-\FQMT4<=ZFB+L6^6YBW$T1=RWRW<2XFR+N6N2[B7$WA=PAWTV,N_R?2?D<\MW, +MN)M#[I#O9L;=''*'?#&W"'?K8R[->0. +M^6YEW*TA=\AW*^-N#;E#OEL9=VO('?+=RKA;0^Z0[U;&W1IQU^.G"'ZVB+L>^6YCW&T1=SWRW<:XVR+N>N2[C7&W1=SUR'<;XVZ+N.N1[S;& +MW19QUR/?;8R[+>0.^6YCW.TA=\AW.^-N#[E#OML9=WO('?+=SKC;0^Z0[W;& +MW1YRAWRW,^[VD#ODNYUQMX?<(=_MC+L]XF[`3V'N)/^`SP'?R9EP)^>(NP'X +M3LZ$.SE'W`W`=\+Z0/']W8&[`?A.6'\G87\W`-\)Z^\D[.\&X#MA_9V$_=T` +M?">LOY.POQN`[X3U=Q+V=P/PG;#^3L+^;@"^$];?2=C?#LOY.POQOQ4X2[L+\;D>]8?R=A +M?SOO).SO1N0[ +MUM])V-^-R'>LOY.POQN1[UA_)V%_-R+?L?Y.POYN1+YC_9V$_=V(?,?Z.PG[ +MNQ'YCO5W$O9W(_(=Z^\D[.]&Y#O6WTG8WTWX*<)=V-]-R'>LOY.POYN0[UA_ +M)V%_-R'?L?Y.POYN0KYC_9V$_=V$?,?Z.PG[NPGYCO5W$O9W$_(=Z^\D[.\F +MY#O6WTG8WTW(=ZR_D["_FY#O6'\G87\W(=^Q_D["_FY"OF/]G83]W81\Q_H[ +M"?N["?F.]7<2]G<3\AWK[R3L[V;\%.$N[.]FY#O6WTG8W\W(=ZR_D["_FY'O +M6'\G87\W(]^Q_D["_FY&OF/]G83]W8Q\Q_H["?N[&?F.]7<2]G]8?R=A?SOO +M).SO%N0[UM])V-\MR'>LOY.POUN0[UA_)V%_MR#?L?Y.POYN0;YC_9V$_=V" +M?,?Z.PG[NQ4_1;@+^[L5^8[U=Q+V=ROR'>OO).SO5N0[UM])V-^MR'>LOY.P +MOUN1[UA_)V%_MR+?L?Y.POYN1;YC_9V$_=V*?,?Z.PG[NQ7YCO5W$O9W*_(= +MZ^\D[.]6Y#O6WTG8WZW(=ZR_D["_6Y'O6'\G87^W(M^Q_D["_FY%OF/]G83] +MW8:?(MR%_=V&?,?Z.PG[NPWYCO5W$O9W&_(=Z^\D[.\VY#O6WTG8WVW(=ZR_ +MD["_VY#O6'\G87^W(=^Q_D["_FY#OF/]G83]W89\Q_H["?N[#?F.]7<2]G<; +M\AWK[R3L[S;D.];?2=C?;[" +M_FY'OF/]G83]W8Y\Q_H["?N['?F.]7<2]G<[\AWK[R3L[W;D.];?2=C?[]8?R=A?[^8_V=A/W=CGS'^CL)^[L=^8[U=Q+V +M=SOR'>OO).SO=N0[UM])V-_MR'>LOY.PO]N1[UA_)U%_9V?\%.9.\P_PISIZZ_R_?]G4YE#OA.67^GKK\[)>Y.MV4.^$Y9?Z>NOSLE[DZ_E3G@ +M.V7]G;K^[G0YG!WPG;+^3EU_5\ZNS@'?*>OOU/5W8`[X3EE_IZZ_`W/`=\KZ +M.W7]79Y[7.>`[Y3U=^KZN\=YKG('?*>LOU/7WSU.W#VNW`'?*>OOU/5WCQ-W +MCRMWP'?*^CMU_=WCR^'L@.^4]7?J^KMR=G4.^$Y9?Z>NOP-SP'?*^CMU_=UQ +M#MU_IZR_4]??Y;DG=0[YCO5WZOJ[)WFN<(?NOU/6WZGK[YXD[IX4[M#]=\KZ +M.W7]W9/$W9/"';K_3EE_IZZ_>W(YG!WR'>OOU/5WY>SJ'/(=Z^_4]7=@#OF. +M]7?J^CLPAWS'^CMU_5V>>UKGD.]8?Z>NOWN:YRIWR'>LOU/7WSU-W#VMW"'? +ML?Y.77_W-''WM'*'?,?Z.W7]W=/+X>R0[UA_IZZ_*V=7YY#O6'^GKK\#<\AW +MK+]3U]\=Y]#]=\KZ.W7]79Y[5N>0[UA_IZZ_>Y;G"G?H_CME_9VZ_NY9XNY9 +MX0[=?Z>LOU/7WSU+W#TKW*'[[Y3U=^KZNV>7P]DAW['^3EU_5\ZNSB'?L?Y. +M77\'YI#O6'^GKK\#<\AWK+]3U]_EN>=U#OF.]7?J^KOG>:YRAWS'^CMU_=WS +MQ-WSRAWR'>OOU/5WSQ-WSRMWR'>LOU/7WSV_',X.^8[U=^KZNW)V=0[YCO5W +MZOH[,(=\Q_H[=?W=<0[=?Z>LOU/7W^6Y%W4.^8[U=^KZNQ=YKG"'[K]3UM^I +MZ^]>).Y>%.[0_7?*^CMU_=V+Q-V+PAVZ_TY9?Z>NOWMQ.9P=\AWK[]3U=^7L +MZASR'>OOU/5W8`[YCO5WZOH[,(=\Q_H[=?U=GGM9YY#O6'^GKK][F>NORMG +M5^>0[UA_IZZ_`W/(=ZR_4]??'>?0_7?*^CMU_5V>>U7GD.]8?Z>NOWN5YPIW +MZ/X[9?V=NO[N5>+N5>$.W7^GK+]3U]^]2MR]*MRA^^^4]7?J^KM7E\/9(=^Q +M_DY=?U?.KLXAW['^3EU_!^:0[UA_IZZ_`W/(=ZR_4]??Y;G7=0[YCO5WZOJ[ +MUWFN$.W7^GK+]3U]]=)>ZN"G?H_CME_9VZ_N[J +MOOP!SR'>OOU/5W8`[YCO5WZOJ[//>FSB'? +ML?Y.77_W)L]5[I#O6'^GKK][D[A[4[E#OF/]G;K^[DWB[DWE#OF.]7?J^KLW +ME\/9(=^Q_DY=?U?.KLXAW['^3EU_!^:0[UA_IZZ_.\ZA^^^4]7?J^KL\][;. +M(=^Q_DY=?_S0[YC_9VZ_JZ<79U#OF/]G;K^#LPAW['^3EU_!^:0[UA_IZZ_ +MRW/OZASR'>OOU/5W[_)OO-.KO#-U_IZR_TZB_,W3_G;+^3J/^SM#]=\KZ.R7]W8Y0[YC_9VZ_NY#XNY#Y0[YCO5WZOJ[#XF[#Y4[Y#O6WZGK[SY<#F>'?,?Z +M.W7]73F[.H=\Q_H[=?T=F$.^8_V=NO[N.(?NOU/6WUG^@9L[USG@.V/]W;=? +M>,!=]M.Y<(?NOS/6WYGK[\YI[URX0_??&>OOS/5WY\3=N7"'[K\SUM^9Z^_. +ME\/9`=\9Z^_,]7?E[.H<\)VQ_LYOO]'(X.^0[UM^9Z^_*V=4YY#O6WYGK[\`<\AWK[\SU=V`.^8[U=^;ZNSQG +M=0[YCO5WYOH[RW.5.^0[UM^9Z^\L<6>5.^0[UM^9Z^\L<6>5.^0[UM^9Z^_L +MOOP!SR'>OOS/5WQSET_YVQ_LYS0[YC_9VY_JZ<79U#OF/]G;G^#LPAW['^SEQ_!^:0[UA_9ZZ_RW-M +MG4.^8_V=N?ZNS7.5.^0[UM^9Z^_:Q%U;N4.^8_V=N?ZN3=RUE3OD.];?F>OO +MVLOA[)#O6']GKK\K9U?GD.]8?V>NOP-SR'>LOS/7WQWGT/UWQOH[<_U=GNOJ +M'/(=Z^_,]7==GBO[0_7?&^CMS_5V7N.L*=^C^.V/] +MG;G^KKLZ0[UA_9ZZ_ZQ-W?>4.^8[U=^;ZNSYQUU?ND.]8?V>N +MO^LOA[-#OF/]G;G^KIQ=G4.^8_V=N?X.S"'?L?[.7']WG$/WWQGK[\SU=WEN +MJ'/(=ZR_,]??#7FN<(?NOS/6WYGK[X;$W5"X0_??&>OOS/5W0^)N*-RA^^^, +M]7?F^KOAOOP!SR'>OOS/5W8`[YCO5WYOJ[ +M/#?6.>0[UM^9Z^_&/%>Y0[YC_9VY_FY,W(V5.^0[UM^9Z^_&Q-U8N4.^8_V= +MN?YNO!S.#OF.]7?F^KMR=G4.^8[U=^;Z.S"'?,?Z.W/]W7$.W7]GK+\SU]_E +MN8]U#OF.]7?F^KN/>:YPA^Z_,];?F>OO/B;N/A;NT/UWQOH[<_W=Q\3=Q\(= +MNO_.6']GKK_[>#F<'?(=Z^_,]7?E[.H<\AWK[\SU=V`.^8[U=^;Z.S"'?,?Z +M.W/]79[[5.>0[UA_9ZZ_^Y3G*G?(=ZR_,]???4KI +MNOP-SR'>LOS/7WQWGT/UW +MQOH[<_U=GOMN +MOP-SR'>LOS/7W^6Y+W4.^8[U=^;ZNR]YKG*'?,?Z.W/]W9?$W9?*'?(=Z^_, +M]7=?$G=?*G?(=ZR_,]???;D0[UA_9ZZ_N\ESE3OD.];?F>OO;A)W-Y4[ +MY#O6WYGK[VX2=S>5.^0[UM^9Z^]N+H>S0[YC_9VY_JZ<79U#OF/]G;G^#LPA +MW['^SEQ_=YAKSO@IS%V3?^#F;NL<\%W#^KO&]7>W>>Y4YH#OOCV%N6M; +MN+N]+7/`=PWK[QK7W]TF[FY_*W/`=PWK[QK7W]U>#F>'_KSM0)_Y[_P]2_O'_Z5 +M!_L?G]VV/S7MJ>U.@_[J*_S/7_\-OKX]^NS^?V_X;@Y\=A_.Y1=[N__C>W/7[>[_?]NBS6^>^^VI#OT#?[)_\V>T/]T/> +M_SK_N$+93N?\GU/[D]>W^GX=G_\^T#_\)^7>W,:O-W3 +MP[FYF`5\"8/3NSZ^.O3GT?^1+\;AEL-?_.1^'WGXR;V;TS]7!,,/LWS_76P" +A?^>_\/4?[Q_^=3?8I,$_[02;;_2=SX_^!PM'3SM0J``` ` end Modified: head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow2.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow2.gz.uu Fri Oct 3 20:48:11 2014 (r272485) +++ head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow2.gz.uu Fri Oct 3 20:54:35 2014 (r272486) @@ -1,22 +1,22 @@ # $FreeBSD$ begin 644 img-63x255-4096-ebr.qcow2.gz -M'XL("+P[(U0``VEM9RTV,W@R-34M-#`Y-BUE8G(N<6-O=S(N;W5T`*V8R9+3 -M0`Q`[_F*9E@&!@ANJ;VQ)#`P5'&#`W!V%G]%BF_'3LMN6Y;`2X6H6L'9B"H-+A.BK(:#*"X7HE##N2BN$*(T[VS\J -M(4KSSL:]VPE1FGB-*\LW'O#D*4YATHWIF`.PI1FG?`O'M"N)N`JX4H -MS3M@WCTEW+,>9Z4HS3M@WCTGW(N`$_H=:-X!\^Z6<"\#3NAWH'D'S+M7A+L+ -M.*'?@>8=,.]>$^Y-P`G]#C3O@'GW=N*=%?H=:-XA\^X=L9*`$_H=:MXA\\X2 -M#@).Z'>H>8?,.R2<"SBAWZ'F'3+O4L)E`2?T.]2\0^9=3K@BX(1^AYIWR+PK -M"?<^X(1^AYIWR+S[0+B/`2?T.]2\0^;=)\)M`D[H=ZAYYYAW6\)]#CBAWSG- -M.\>\^T*X^X`3^IW3O'/,NZ^$^];C0(KJO4L2>2//R_/)C.]Q6927L]8'3_7K\[8"%?SN0MT669J:` -MQV;X]^&/L+[%<@]\'J>_':"!+N&^(TYPVP$.O7V!,BBKD7?#WP/<9ATZZ?=/A!U%UMVI]ROKPGY";T%1M.=R<], -MI]M>Q/N';;8>+0XBTS5CW+E1#=9SM(21L[>99K=?>#$LKXQ'5FX+&5>NQ\&R -FC:`\=Y;&P.:HZ5X?./UZ`BXV!ET67OM7?T'9%>AF-(4```` +M'XL("%[N+50``VEM9RTV,W@R-34M-#`Y-BUE8G(N<6-O=S(N;W5T`*V8VY+3 +M,`R&[_[@`KA.3T_1X=FI:R5V%"G>=M)V,NVX_S=R +M_%E-6A3A84QIC:N,:\QA8TZ?Z04F^3!\F>.O[S\6Z>-X$V"V4%+"P'+?XP:L +M?Q$'&JZPXP$KXY+J4,!!EQJ#-4)*\\[FO6N% +ME.:=S7NW$5*:=S;OW59(:=[9O'<[(:5Y!XIW)N+V0DKS#IAWCPCW..(.0DKS +M#IAW3PCWM,=9*:5Y!\R[9X1['G%"OP/-.V#>O2#@>0?,N]>$>Q-Q0K\#S3M@WKT=>6>%?@>:=\B\>T>L(N*$?H>:=\B\LX2# +MB!/Z'6K>(?,.">^0>;Q]Q0K]#S3MDWGT@W,>($_H=:MXA\^X3X581)_0[U+QSS+LUX3Y'G-#OG.:= +M8]Y](=Q=Q`G]SFG>.>;=5\)]ZW$@I7KOBD)^$>Y^M&=AWNM/%Z^/K7#4!R:` +M]27`J0H#KIEUPF78&Q<"Y0D'G-\;83)MV9ELR6?*;VW<%6E]ZV#S*L7MYI[N +MX3)@69JV'0%_=_7!9!F7U[?<^V&_*UOAJ`\<[Q;#9P>LP[\#2[_)RLK4\-`* +M_][_$=:WGN^&+^#T?P=HH"NX[X@CW#K!^0N,0_+-=%L-O$O?)[C5(G;F$V[R +MWP%_R[.7!M3)EO/*4O>]I;UOB+H?6W:EW*^OB?4)O04&TYVHSXRG +MZW_$^YMMMAX>!YGIFB%NTW<680DS9V\UKFX[\V)8OC,>N',]9+AS`P[F;03- +DN;.<##Q]:WS4!XX_%\-G`#H"SG8&7>5_>V_^`UMI__/2%``` ` end Modified: head/usr.bin/mkimg/tests/img-63x255-4096-ebr.raw.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-63x255-4096-ebr.raw.gz.uu Fri Oct 3 20:48:11 2014 (r272485) +++ head/usr.bin/mkimg/tests/img-63x255-4096-ebr.raw.gz.uu Fri Oct 3 20:54:35 2014 (r272486) @@ -1,12 +1,12 @@ # $FreeBSD$ begin 644 img-63x255-4096-ebr.raw.gz -M'XL("`'&'50``VEM9RTV,W@R-34M-#`Y-BUE8G(N,35MA'R;P%9+"+__24B%\`\`9'I+=PLV&=0#-<07.&S[TN1Y!;-.[HGN-K/&5>NJ<.7$%W,L.BL3ILL!CN_ -M1^,,L@-9@#"337'@)[[PU7<*92CF[HH^"-VU#E?Q\Y+@U(:[P'%CH2+Q9"'< -M>+TZ5-V`Y`9.]H*M\ -+0F1O]"SVO.4&```` +M'XL("%[N+50``VEM9RTV,W@R-34M-#`Y-BUE8G(NC:,F="V`Z,*X[^GOJV@140\'(`G()\@I*'%7X>;P#^56,QPK8 +MX,0>;A)L*BB$JRQZ:MK(B>#+V_&P9M+$/?F&IR(^Q#.ZHW^FKAE@/@*CG2"] +,?(PE/\L2J-?E!@`` ` end Modified: head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhd.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhd.gz.uu Fri Oct 3 20:48:11 2014 (r272485) +++ head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhd.gz.uu Fri Oct 3 20:54:35 2014 (r272486) @@ -1,18 +1,18 @@ # $FreeBSD$ begin 644 img-63x255-4096-ebr.vhd.gz -M'XL("`'&'50``VEM9RTV,W@R-34M-#`Y-BUE8G(N=FAD+F]U=`"ME\%NG#`0 -MAN_[%"/UE@,R@VW(92-%3<^1HK1G+X$HAS91MX<<>/AXL+W8@-EL,\`BK\;S -M^1_/V,A"N`M`5Z![T!UH1>U:@KZ&N@&P1O_@^"[]7QC:US]=^^_EO?#7L'.P -M4L1>J3OY8P72#E(#&AI$/U$;AH`IOMT]7[W\?@XX]+@PL-0@$92%R,4XC3BI -M(]*/VX?OZCZJ$<5JRN*FQ@GK9?M3X^&7HXRPY/\20PQ+E&G -MQ,PKDKDVJ5&P:SB]Y74)[FKG<^%*Q19&;=\"=`DU4MN639B'Q6-+Y?WX9OX> -MNYD^S)2*CI(QM\E\N.A+!4-GKT"2P*UP8:0K]VQ*J;E7? -MN&SW,>Z).]S^,J!28,P"^!CTML,/A.5P0'._V*>XFPE6N^B9*M#DE=1>W(]S>_0). -M;JFC/:%;,V2#5L6M7/>R'FCWDX!^_C(%D\%>:EI@@K&$> +MWH$!"R'<#T`7H#O0+6A%[5*"OH.R`K!&7W"H<_\*??/G=]O\>S]F_M=O'"P7 +MW"MV)W\L0-I!2D!#@^A7:D,?,-G-_NWV_==;P*''A8&E!HF@+$1.QJG$21V1 +M?MP_/HS5%5-U9R\W3M=!T;$>!5>793N.D];+]J>BH9.#S%"BE\C`<9$Z)49> +M3.;L:W.W&KX5+%9L8I:T%Z!Q*I+9-FS`/DV)3Y7CX:SX.[4@? +M+J2*9HLQMLGE<-&G"H;.7H$D@6OAPD`YC'$SJ?*MV=.QG_0-.PE"!0,.X<>S +M=T8!UZ=SL3+GRXNQJ,^LQO6%@.OZ>N#*[J@;OSL$&$4U[=+<[U7OW]CW=D;? +MSFW;+<>]I@ZWNPZH%!@S`3X%?4WBY:@J,MNS4YB9>MG0WV?Q9KBM^P>< +M7%-'9T([9U@,5B5.%E.-_/@Z0]Y"7H"HO`UCX&E]X:SO;BH#HW!7],$T7$.X +M,NZ?,QQ>"!=B7'TZ66:6\,+L;:?JFL2+48]WQB=W+D'BG>MPF/8@,,/)8C/0 +M]IK6RX;^9Q8_#HC^4Y3LVX;^,$VF4'I@,H46V"96:-)^/[17F.BB0+B$%P7" +D);PH$"[A18%P"2\*A$MX42!=*5=O9=7"4H>W2H8-_?,$8FS,XCPJ#$=;!YWMQ -M$.(>`/,F^[*@V\R>;K5>]33Z<3>P;9-`AVO,+K/`]%H,$].+-L`U%`J=U&]G -MARK$'7.;V]X'%`+J.@*^>OU8YG"4VHHY`U(GQF5!M]_@YH&J3QA1`A<@)"AV -MJX;OA[=$?!6AN0QV.'8-YQ5V&93"[0)[U.'Y).^,) -MHE."16-%WF11IN%]89R!:J`%$#7(&`:.\85)OVVL!D/F7M`/8G-KBROQ>AK@ -MV!5S`>/Z0A7$$X7PBO>J6+LF'(M!)]%P6 -M=,\;W!R0#\!L'E3#W28+D"U(#5+8>9PO5?['7%JG"P/AD;D*F_NT?WF< -M:U?$3E+(>W2Z.$?#D?=V(8Z/QFK=ET`Z=?2!!,E297&"S';]-[8.)S.GBKEW -*5W]/U6F<$`D````` +M'XL("%_N+50``VEM9RTV,W@R-34M-#`Y-BUE8G(N=FAD9BYO=70`K94[;\,@ +M$(#W_(J3NF6(``,F2R)%3>=*5=O9<7&4H>W2H8-_?#EC',[&>508C$`'G^_% +MF3'_`+@WV><%[6KTM(OEHJ/QP_U`G@1Z7(VG.&ZK%(Y%@TLNX8+"/H-2N&V$*YRPB7;Z3.Q/Q7D7SR/YNI=G7F8/#QS;CQYB*$WER/$WD+P;JK+"X#W:[I +M."]HGU>T>:#L@=D\:/I_FRY`-Z`M:(7S4H)>0VEBH*"9U-;?7[;^.?W&$48< +M]\4@V?&\*/"VZ!)$A1_1'SB/]'O8'Y>GSV/`A5(5/BPU.ETYB)R8:ZBY3[N7 +MQ[%VQ=1)AGB/HYYQV7.&$^]M8YPIS.G +.BOOO+OX`/$*Q[A`)```` ` end Modified: head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vmdk.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vmdk.gz.uu Fri Oct 3 20:48:11 2014 (r272485) +++ head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vmdk.gz.uu Fri Oct 3 20:54:35 2014 (r272486) @@ -1,6 +1,6 @@ # $FreeBSD$ begin 644 img-63x255-4096-ebr.vmdk.gz -M'XL("`+&'50``VEM9RTV,W@R-34M-#`Y-BUE8G(N=FUD:RYO=70`K5S1;N3& +M'XL("%_N+50``VEM9RTV,W@R-34M-#`Y-BUE8G(N=FUD:RYO=70`K5S1;N3& M$7SW5PSDMSPL6,LEN7PX.W'.`8(@@!$[]FO(Y3`68M\==$*0`_3QX9!3HR)% M'FFK=:L#^]A=V]U#M735!679].'3D]?3&`(41*"3.'$F+W/TVGQ0;CSYZ)F-X;7>1$-Y5#PIO*(>%-Y9#P MIG)(>%,Y)+RI'!+>5`X);RJ'A#>50\*;RB'A3>60\*9R2/199BB'1&\JAT1O M*H=$;RJ'1&\JAT1O*H=$;RJ'1&\JAT1O*H=$;RJ'1&\JAT1O*H=$;RJ'1&\J -MAT1O*H=$;RJ'/&=99BB'/&>F7S7^ -M[V+Z5;(O_]Z^\?3-:?Z'@-?Q<2ZJ\%MQB])=ST=[I..%6O\F[:OV741I^<< -MODT$]H[_*3O/`=/YNN?\ZI=IG&?E?B8_][+<\"U2?]>LGL=LJFZ4Z^9PXZ"2 -M\YP=X4[WOGJ9WF-_X?(^F'DO<+?!]BOY?3W\&3Z^4KC.NMS^MP$6A6N:%X#_9'[GSZ;QV_.K +MQO]=3+]*]N7?VS>>OCG-_Q#P.C[.115^*VY1NNOY:(8_??OC(L,)SDSN.L'M +M/LZ)M.RWX+X6N/#MNQ?/V2_NUN=.KP7NJ^F3<)?/9:?[I&/%&O^F[6MV7<3I +M.8=O$X&]XW_*SG/`=+[N.;_Z91KG6;F?R<^]+#=\B]3?-:OG,9NJ&^6Z.5R; +M)LO*$>YT[ZN7V=V,#P/+KXR#7[D!9/Z5.\&=;0=!/4Z62:3Q\N_M&T_?G>9_ +7)L!+!#3KX"7\'I'LB_\#:C6@$!Y@```` ` end Modified: head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow.gz.uu Fri Oct 3 20:48:11 2014 (r272485) +++ head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow.gz.uu Fri Oct 3 20:54:35 2014 (r272486) @@ -1,128 +1,128 @@ # $FreeBSD$ begin 644 img-63x255-4096-mbr.qcow.gz -M'XL(",@S(E0``VEM9RTV,W@R-34M-#`Y-BUM8G(N<6-O=RYO=70`K9W);EQ7 -MLD7G_HI4+U%=1L1MU9!$`:^`FM4;O*JI;SO.#Q#JVXL63T/&W5LA/TLF#`KT -MW<@\7%HR[(6C\_G^Q^G4RJGI3LUXVN?3W<_3AYP>_.3QQ^G;__[]'Q\>_OCV -MV_V8G'_PE/MYOY6Y1UO_J7/ZQU/+Z3S^Q-S=AZ"Y!Z_._L2K>_!FCW-7O]V_ -M6?R#1W.;S=%CXULKGIAS#KN8-/S6QN">9Z^-3*YK9@ -M;H!/[7A.?O"]O9\;X5/"YA3.G5 -MNP4^1;B3D+L5/D6XDY"[#3Y%N).0NQT^1;B3B#O!3Q'N-.).D**4<:<1=X*, -MK(P[C;@3Y#MEW&G$G2#?*>-.(^X$^4X9=QIQ)\AWRKC3B#M!OE/&G8;<(=\I -MX\Y"[I#OC'%G(7?(=\:XLY`[Y#MCW%G('?*=,>XLY`[YSAAW%G*'?&>,.PNY -M0[XSQIU%W"E^BG#71-PI\EW#N&LB[A3YKF'<-1%WBGS7,.Z:B#M%OFL8=TW$ -MG2+?-8R[)N).D>\:QET3<:?(=PWCK@FY0[YK&'=MR!WR7&W"'?M8R[-N0.^:YEW+4A=\AW+>.NC;@S_!3AKHNX -M,^2[CG'71=P9\EW'N.LB[@SYKF/<=1%WAGS7,>ZZB#M#ONL8=UW$G2'?=8R[ -M+N+.D.\ZQET7<=>'W"'?]8R[/N0.^:YGW/4A=\AW/>.N -M#[E#ONL9=WW('?)=S[CK0^Z0[WK&71]QU^"G"'=#Q%V#?#0[T;&W1ARAWPW,N[&D#ODNY%Q-X;<(=^-C+LQY`[Y;F3*N1;Z;&'=3Q%V+?#& -MW"'?K8R[->0.^6YEW*TA=\AW*^-N#;E#OEL9=VO('?+=RKA;(^YZ_!3AC@1" -M#^:0[S;&W19QUR/?;8R[+>*N1[[;&'=;Q%V/?+%W"'?;8R[/>0.^6YGW.TA=\AW.^-N#[E#OML9=WO('?+= -MSKC;0^Z0[W;&W1YRAWRW,^[VD#ODNYUQMT?<#?@IS)WD3_@<\)V<"7=RCK@; -M@._D3+B3<\3=`'PGK`\4W]\=N!N`[X3U=Q+V=P/PG;#^3L+^;@"^$];?2=C? -M#LOY.POQN` -M[X3U=Q+V=P/PG;#^3L+^;@"^$];?2=C?#]8?R=A?SOO).SO)N0[UM])V-]-R'>L -MOY.POYN0[UA_)V%_-R'?L?Y.POYNQD\1[L+^;D:^8_V=A/W=C'S'^CL)^[L9 -M^8[U=Q+V=S/R'>OO).SO9N0[UM])V-_-R'>LOY.POYN1[UA_)V%_-R/?L?Y. -MPOYN1KYC_9V$_=V,?,?Z.PG[NQGYCO5W$O9W,_(=Z^\D[.]FY#O6WTG8W\W( -M=ZR_D["_FY'O6'\G87^WX*<(=V%_MR#?L?Y.POYN0;YC_9V$_=V"?,?Z.PG[ -MNP7YCO5W$O9W"_(=Z^\D[.\6Y#O6WTG8WRW(=ZR_D["_6Y#O6'\G87^W(-^Q -M_D["_FY!OF/]G83]W8)\Q_H["?N[!?F.]7<2]G<+\AWK[R3L[Q;D.];?2=C? -M+]8?R=A?[OO).SO5N0[UM]) -MV-]M^"G"7=C?;OO).SO-N0[UM])V-]MR'>LOY.PO]N0[UA_)V%_ -MMR'?L?Y.POYN0[YC_9V$_=V&?,?Z.PG[NPWYCO5W$O9W&_(=Z^\D[.]V_!3A -M+NSO=N0[UM])V-_MR'>LOY.PO]N1[UA_)V%_MR/?L?Y.POYN1[YC_9V$_=V. -M?,?Z.PG[NQWYCO5W$O9W._(=Z^\D[.]VY#O6WTG8W^W(=ZR_D["_VY'O6'\G -M87^W(]^Q_D["_FY'OF/]G83]W8Y\Q_H["?N['?F.]7<2]7=VQD]A[C1_XN9. -M=0[X[NXIS)VZ_B[?]W`[9?V=NO[NE+@[_5[F -M@.^4]7?J^KO3Y7!VP'?*^CMU_5TYNSH'?*>LOU/7WX$YX#ME_9VZ_@[,`=\I -MZ^_4]7=Y[DF=`[Y3UM^IZ^^>Y+G*'?"=LOY.77_W)''WI'('?*>LOU/7WSU) -MW#VIW`'?*>OOU/5W3RZ'LP.^4];?J>OORMG5.>`[9?V=NOX.S`'?*>OOU/5W -MQSET_YVR_DY=?Y?GGM8YY#O6WZGK[Y[FN<(=NO].67^GKK][FKA[6KA#]]\I -MZ^_4]7=/$W=/"W?H_CME_9VZ_N[IY7!VR'>LOU/7WY6SJW/(=ZR_4]??@3GD -M.];?J>OOP!SR'>OOU/5W>>Y9G4.^8_V=NO[N69ZKW"'?L?Y.77_W+''WK'*' -M?,?Z.W7]W;/$W;/*'?(=Z^_4]7?/+H>S0[YC_9VZ_JZ<79U#OF/]G;K^#LPA -MW['^3EU_=YQ#]]\IZ^_4]7=Y[GF=0[YC_9VZ_NYYGBO7PYGAWS'^CMU_5TYNSJ'?,?Z -M.W7]'9A#OF/]G;K^#LPAW['^3EU_E^=>U#GD.];?J>OO7N2YRAWR'>OOU/5W -M+Q)W+RIWR'>LOU/7W[U(W+VHW"'?L?Y.77_WXG(X.^0[UM^IZ^_*V=4YY#O6 -MWZGK[\`<\AWK[]3U=\0[UM^IZ^]>YKG"';K_3EE_ -MIZZ_>YFX>UFX0_??*>OOU/5W+Q-W+PMWZ/X[9?V=NO[NY>5P=LAWK+]3U]^5 -MLZMSR'>LOU/7WX$YY#O6WZGK[\`<\AWK[]3U=WGN59U#OF/]G;K^[E6>J]PA -MW['^3EU_]RIQ]ZIRAWS'^CMU_=VKQ-VKRAWR'>OOU/5WKRZ'LT.^8_V=NOZN -MG%V=0[YC_9VZ_@[,(=^Q_DY=?W><0_??*>OOU/5W>>YUG4.^8_V=NO[N=9XK -MW*'[[Y3U=^KZN]>)N]>%.W3_G;+^3EU_]SIQ][IPA^Z_4];?J>OO7E\.9X=\ -MQ_H[=?U=.;LZAWS'^CMU_1V80[YC_9VZ_@[,(=^Q_DY=?Y?GWM0YY#O6WZGK -M[][DNOORMG5.>0[UM^IZ^_`'/(=Z^_4]7?'.73_G;+^3EU_E^>NZASR'>OO -MU/5W5WFN<(?NOU/6WZGK[ZX2=U>%.W3_G;+^3EU_=Y6XNRKNOP-SR'>LOU/7WX$YY#O6WZGK[_+OO -MWEX.9X=\Q_H[=?U=.;LZAWS'^CMU_1V80[YC_9VZ_NXXA^Z_4];?J>OO\MR[ -M.H=\Q_H[=?W=NSQ7N$/WWRGK[]3U=^\2=^\*=^C^.V7]G;K^[EWB[EWA#MU_ -MIZR_4]??O;LLOU/7W[W/0[UM^IZ^^.<^C^.V7] -MG;K^+L]]J'/(=ZR_TZB_,W3_G;+^3J/^SM#]=\KZ.XWZ.T/WWRGK[S3J[PS= -M?Z>LO].HOS-T_YVR_DZC_L[0_7?*^CN-^CM#]]\IZ^^4]'OOU/5W -M'_-#F<'?(= -MZ^_4]7?E[.H<\AWK[]3U=V`.^8[U=^KZN^,OOS/5W -MY\OA[(#OC/5WYOJ[OO\IS4 -M.>`[8_V=N?Y.\ESE#OC.6']GKK^3]/*D<@=\9ZR_,]??2>).*G?`=\;Z.W/] -MG5P.9P=\9ZR_,]??E;.K<\!WQOH[<_T=F`.^,];?F>OOCG/H_CMC_9VY_B[/ -M:9U#OF/]G;G^3O-LOS/7WVGB3@MWZ/X[8_V=N?Y.$W=:N$/WWQGK -M[\SU=WHYG!WR'>OOS/5WY>SJ'/(=Z^_,]7=@#OF.]7?F^CLPAWS'^CMS_5V> -MLSJ'?,?Z.W/]G>6YRAWR'>OOS/5WEKBSRAWR'>OOS/5WEKBSRAWR'>OOS/5W -M=CF<'?(=Z^_,]7?E[.H<\AWK[\SU=V`.^8[U=^;ZN^,NOVL2=TWA#MU_9ZR_ -M,]??-9?#V2'?L?[.7']7SJ[.(=^Q_LYNOP-SR'>LOS/7W^6Y -MMLXAW['^SEQ_U^:YRAWR'>OOS/5W;>*NK=PAW['^SEQ_UR;NVLH=\AWK[\SU -M=^WE<';(=ZR_,]??E;.K<\AWK+\SU]^!.>0[UM^9Z^^.<^C^.V/]G;G^+L]U -M=0[YCO5WYOJ[+L\5[M#]=\;Z.W/]79>XZPIWZ/X[8_V=N?ZN2]QUA3MT_YVQ -M_LY'?,?Z.W/]73F[.H=\Q_H[<_T=F$.^8_V=N?X.S"'?L?[.7'^7 -MY_HZAWS'^CMS_5V?YRIWR'>LOS/7W_6)N[YRAWS'^CMS_5V?N.LK=\AWK+\S -MU]_UE\/9(=^Q_LYOOS/5W8YZKW"'?L?[.7'\W)N[&RAWR'>OOS/5W8^)NK-PAW['^ -MSEQ_-UX.9X=\Q_H[<_U=.;LZAWS'^CMS_1V80[YC_9VY_NXXA^Z_,];?F>OO -M\MRG.H=\Q_H[<_W=ISQ7N$/WWQGK[\SU=Y\2=Y\*=^C^.V/]G;G^[E/B[E/A -M#MU_9ZR_,]???;HLOS/7WWW.0[UM^9Z^^.<^C^ -M.V/]G;G^+L]]J7/(=ZR_,]???E<(?NOS/6WYGK -M[[XD[KX4[M#]=\;Z.W/]W9?+X>R0[UA_9ZZ_*V=7YY#O6']GKK\#<\AWK+\S -MU]^!.>0[UM^9Z^_RW-Y0[YC_9VY_NYKXNYKY0[YCO5W -MYOJ[KXF[KY4[Y#O6WYGK[[Y>#F>'?,?Z.W/]73F[.H=\Q_H[<_T=F$.^8_V= -MN?[N.(?NOS/6WYGK[_+<=9U#OF/]G;G^[CK/%>[0_7?&^CMS_=UUXNZZ<(?N -MOS/6WYGK[ZX3=]>%.W3_G;'^SEQ_=WTYG!WR'>OOS/5WY>SJ'/(=Z^_,]7=@ -M#OF.]7?F^CLPAWS'^CMS_5V>NZESR'>LOS/7W]WDN)NYO* -M'?(=Z^_,]7OOS/5W-Y?#V2'?L?[.7']7SJ[.(=^Q_LYNOSO,-6?\%.:NR9^XN=LZ!WS7L/ZN-Z^]N -M$W>WMV4.^*YA_5WC^KO;Q-WM[V4.^*YA_5WC^KO;R^'LT)^W74Z]W=+;6Z3^+OOX#=\4\^4Y].=&_Y7S0U<1_6BP;4_3=!C\O_SZ -MT%5$?^7U==LO_O[VWX%I^U/3GMKN-.C/OL)__\^_W"N\GP,R^/^]X?LY((/' -M<_D%E]\?#W,W#^;LGKZZ(@^>>LC=P\\?S%U_>/`;>(]D4.?^$."&OD#?["^6 -M07^XW^_U?,/K'_[P\ -MF-/@[9X>SWW_%XP'W\]'W\+@]*Z/KP[]`?=_Y9MQN#;Q)W_E_C'R^%?N_9S^ -K6A$,W\WRQV^+$_@[_\*W?WYX_-?]8),&?]D)-G?TG<^__1>$>8]XH:@````` +M'XL("&'N+50``VEM9RTV,W@R-34M-#`Y-BUM8G(N<6-O=RYO=70`K9W)CE79 +M$47G]16/'I+N1<1M:3)3EFS),WM@>UJW';\/0/YV`WF:S+A[$Y0+0*5$67?K +MO9.+1:E8.IS/=]].IU9.37=JQM,^G[[^//V0T[V?//QQ^O+/O_W]W?UO7WZ[ +M&Y/S#YYR/^^W,O=@Z[]U3K\]M9S.XT_,??TA:.[>J[,_\.KNO=GCW-5O=V\6 +M/Z=LT!X,GM+<.;T^(:?7_-SKNW5O5^Y.[]>]725OM_VYP7^XUZ=_"):?>GU_ +M\.O;P<'?R^MKX%,]FQL>S%T.;[>%3XUL;OHAS'KNX%,SFUN"N1X^M;*Y+9@; +MX%,[GI,??&WOYD;XE+`YA7.G,C?!IXS--0_FSFGNMLS-\"GRZT(<=_G71>5N +M@4\1[B3D;H5/$>XDY&Z#3Q'N).1NAT\1[B3B3O!3A#N-N!.D*&7<:<2=(",K +MXTXC[@3Y3AEW&G$GR'?*N-.(.T&^4\:=1MP)\ITR[C3B3I#OE'&G(7?(=\JX +MLY`[Y#MCW%G('?*=,>XLY`[YSAAW%G*'?&>,.PNY0[XSQIV%W"'?&>/.0NZ0 +M[XQQ9Q%WBI\BW#41=XI\US#NFH@[1;YK&'=-Q)TBWS6,NR;B3I'O&L9=$W&G +MR'<-XZZ)N%/DNX9QUT3<*?)=P[AK0NZ0[QK&71MRAWS7,N[:D#ODNY9QUX;< +M(=^UC+LVY`[YKF7L9='W*'?-*N0;X;&'=# +MQ%V#?#2[D7$WAMPAWXV,NS'D#OEN9-R-(7?(=R/C;@RY0[X;&7=CR!WR +MWZFB+L6^6YBW$T1=RWRW<2XFR+N +M6N2[B7$W1=RUR'<3XVZ*N&N1[R;&W11QUR+?38R[*>0.^6YBW.4_)N5SR'Z6B+L.^6YAW"T1=QWRW<*X6R+N.N2[A7&W1-QUR'<+XVZ)N.N0 +M[Q;&W1)QUR'?+8R[)>*N0[Y;&'=+R!WRW<*X6T/ND.]6QMT:&W"'?K8R[->0.^6YEW*TA=\AW*^-N#;E#OEL9=VO$78^?(MR10.C> +M'/+=QKC;(NYZY+N-<;=%W/7(=QOC;HNXZY'O-L;=%G'7(]]MC+LMXJY'OML8 +M=UO$78]\MS'NMI`[Y+N-<;>'W"'?[8R[/>0.^6YGW.TA=\AW.^-N#[E#OML9 +M=WO('?+=SKC;0^Z0[W;&W1YRAWRW,^[VB+L!/X6YD_P!GP.^DS/A3LX1=P/P +MG9P)=W*.N!N`[X3U@>+[NP-W`_"=L/Y.POYN`+X3UM])V-\-P'?"^CL)^[L! +M^$Y8?R=A?S<`WPGK[R3L[P;@.V']G83]W0!\)ZR_D["_&X#OA/5W$O9W`_"= +ML/Y.POYN`+X3UM])V-\-P'?"^CL)^[L!^$Y8?R=A?S?BIPAW87\W(M^Q_D[" +M_FY$OF/]G83]W8A\Q_H["?N[$?F.]7<2]G]8?R=A?SOO).SO1N0[UM])V-^-R'>LOY.POYOP4X2[L+^;D.]8?R=A?SOO).SO)N0[UM])V-]- +MR'>LOY.POYN0[UA_)V%_-R'?L?Y.POYN0KYC_9V$_=V$?,?Z.PG[NPGYCO5W +M$O9W$_(=Z^\D[.\FY#O6WTG8W\WX*<)=V-_-R'>LOY.POYN1[UA_)V%_-R/? +ML?Y.POYN1KYC_9V$_=V,?,?Z.PG[NQGYCO5W$O9W,_(=Z^\D[.]FY#O6WTG8 +MW\W(=ZR_D["_FY'O6'\G87\W(]^Q_D["_FY&OF/]G83]W8Q\Q_H["?N[&?F. +M]7<2]G]8?R=A +M?[OO).SO5N0[ +MUM])V-^MR'>LOY.POUN1[UA_)V%_MR+?L?Y.POYN1;YC_9V$_=V*?,?Z.PG[ +MNPT_1;@+^[L-^8[U=Q+V=QOR'>OO).SO-N0[UM])V-]MR'>LOY.PO]N0[UA_ +M)V%_MR'?L?Y.POYN0[YC_9V$_=V&?,?Z.PG[NPWYCO5W$O9W&_(=Z^\D[.\V +MY#O6WTG8WVW(=ZR_D["_VY#O6'\G87^W(=^Q_D["_FY#OF/]G83]W8Z?(MR% +M_=V.?,?Z.PG[NQWYCO5W$O9W._(=Z^\D[.]VY#O6WTG8W^W(=ZR_D["_VY'O +M6'\G87^W(]^Q_D["_FY'OF/]G83]W8Y\Q_H["?N['?F.]7<2]G<[\AWK[R3L +M[W;D.];?2=C?[]8?R=A?[Y.MV4.^$Y9?Z>NOSLE[DZ_ESG@ +M.V7]G;K^[G0YG!WPG;+^3EU_5\ZNS@'?*>OOU/5W8`[X3EE_IZZ_`W/`=\KZ +M.W7]79Y[5.>`[Y3U=^KZNT=YKG('?*>LOU/7WSU*W#VJW`'?*>OOU/5WCQ)W +MCRIWP'?*^CMU_=VCR^'L@.^4]7?J^KMR=G4.^$Y9?Z>NOP-SP'?*^CMU_=UQ +M#MU_IZR_4]??Y;G'=0[YCO5WZOJ[QWFN<(?NOU/6WZGK[QXG[AX7[M#]=\KZ +M.W7]W>/$W>/"';K_3EE_IZZ_>WPYG!WR'>OOU/5WY>SJ'/(=Z^_4]7=@#OF. +M]7?J^CLPAWS'^CMU_5V>>U+GD.]8?Z>NOWN2YRIWR'>LOU/7WSU)W#VIW"'? +ML?Y.77_W)''WI'*'?,?Z.W7]W9/+X>R0[UA_IZZ_*V=7YY#O6'^GKK\#<\AW +MK+]3U]\=Y]#]=\KZ.W7]79Y[6N>0[UA_IZZ_>YKG"G?H_CME_9VZ_NYIXNYI +MX0[=?Z>LOU/7WSU-W#TMW*'[[Y3U=^KZNZ>7P]DAW['^3EU_5\ZNSB'?L?Y. +M77\'YI#O6'^GKK\#<\AWK+]3U]_EN6=U#OF.]7?J^KMG>:YRAWS'^CMU_=VS +MQ-VSRAWR'>OOU/5WSQ)WSRIWR'>LOU/7WSV[',X.^8[U=^KZNW)V=0[YCO5W +MZOH[,(=\Q_H[=?W=<0[=?Z>LOU/7W^6YYW4.^8[U=^KZN^=YKG"'[K]3UM^I +MZ^^>)^Z>%^[0_7?*^CMU_=WSQ-WSPAVZ_TY9?Z>NOWM^.9P=\AWK[]3U=^7L +MZASR'>OOU/5W8`[YCO5WZOH[,(=\Q_H[=?U=GGM1YY#O6'^GKK][D>NORMG +M5^>0[UA_IZZ_`W/(=ZR_4]??'>?0_7?*^CMU_5V>>UGGD.]8?Z>NOWN9YPIW +MZ/X[9?V=NO[N9>+N9>$.W7^GK+]3U]^]3-R]+-RA^^^4]7?J^KN7E\/9(=^Q +M_DY=?U?.KLXAW['^3EU_!^:0[UA_IZZ_`W/(=ZR_4]??Y;E7=0[YCO5WZOJ[ +M5WFN$.W7^GK+]3U]]=)>ZN"G?H_CME_9VZ_N[J +MOOP!SR'>OOU/5W8`[YCO5WZOJ[//>ZSB'? +ML?Y.77_W.L]5[I#O6'^GKK][G;A[7;E#OF/]G;K^[G7B[G7E#OF.]7?J^KO7 +ME\/9(=^Q_DY=?U?.KLXAW['^3EU_!^:0[UA_IZZ_.\ZA^^^4]7?J^KL\]Z;. +M(=^Q_DY=?_S0[YC_9VZ_JZ<79U#OF/]G;K^#LPAW['^3EU_!^:0[UA_IZZ_ +MRW-OZQSR'>OOU/5W;_-SF<'?(=Z^_4]7?E[.H<\AWK[]3U=V`.^8[U=^KZN^,OO-.KO#-U_IZR_TZB_,W3_G;+^3J/^SM#]=\KZ.R7]W?LZAWS'^CMU_=W[ +M/%>Y0[YC_9VZ_NY]XNY]Y0[YCO5WZOJ[]XF[]Y4[Y#O6WZGK[]Y?#F>'?,?Z +M.W7]73F[.H=\Q_H[=?T=F$.^8_V=NO[N.(?NOU/6WUG^P,V=ZQSPG;'^[NLG +M'G"7_70NW*'[[XSU=^;ZNW/:.Q?NT/UWQOH[<_W=.7%W+MRA^^^,]7?F^KOS +MY7!VP'?&^CMS_5TYNSH'?&>LOS/7WX$YX#MC_9VY_@[,`=\9Z^_,]7=Y3NH< +M\)VQ_LYLOS/7WTEZ>5*Y`[XSUM^9Z^\D<2>5.^`[8_V=N?Y. +M+H>S`[XSUM^9Z^_*V=4YX#MC_9VY_@[,`=\9Z^_,]7?'.73_G;'^SEQ_E^>T +MSB'?L?[.7'^G>:YPA^Z_,];?F>OO-'&GA3MT_YVQ_LY).RWLOS/7W^6YILXA +MW['^SEQ_U^2YPAVZ_\Y8?V>NOVL2=TWA#MU_9ZR_,]??-8F[IG"'[K\SUM^9 +MZ^^:R^'LD.]8?V>NORMG5^>0[UA_9ZZ_`W/(=ZR_,]??@3GD.];?F>OO\EQ; +MYY#O6']GKK]K\USE#OF.]7?F^KLV<==6[I#O6']GKK]K$W=MY0[YCO5WYOJ[ +M]G(X.^0[UM^9Z^_*V=4YY#O6WYGK[\`<\AWK[\SU=\NO\MS +M?9U#OF/]G;G^KL]SE3OD.];?F>OO^L1=7[E#OF/]G;G^KD_<]94[Y#O6WYGK +M[_K+X>R0[UA_9ZZ_*V=7YY#O6']GKK\#<\AWK+\SU]\=Y]#]=\;Z.W/]79X; +MZASR'>OOS/5W0YXKW*'[[XSU=^;ZNR%Q-Q3NT/UWQOH[<_W=D+@;"G?H_CMC +M_9VY_FZX',X.^8[U=^;ZNW)V=0[YCO5WYOH[,(=\Q_H[<_T=F$.^8_V=N?XN +MSXUU#OF.]7?F^KLQSU7ND.]8?V>NOQL3=V/E#OF.]7?F^KLQ<3=6[I#O6']G +MKK\;+X>S0[YC_9VY_JZ<79U#OF/]G;G^#LPAW['^SEQ_=YQ#]]\9Z^_,]7=Y +M[D.=0[YC_9VY_NY#GBOOO/N:YRAWR'>OOS/5W'Q-W'RMWR'>LOS/7WWU,W'VL +MW"'?L?[.7'_W\7(X.^0[UM^9Z^_*V=4YY#O6WYGK[\`<\AWK[\SU=\0[UM^9Z^\^Y;G"';K_SEA_9ZZ_^Y2X^U2X0_??&>OOS/5W +MGQ)WGPIWZ/X[8_V=N?[NT^5P=LAWK+\SU]^5LZMSR'>LOS/7WX$YY#O6WYGK +M[\`<\AWK[\SU=WGNJ]PAW['^SEQ_]SEQ][ERAWS'^CMS +M_=WGQ-WGRAWR'>OOS/5WGR^'LT.^8_V=N?ZNG%V=0[YC_9VY_@[,(=^Q_LY< +M?W><0_??&>OOS/5W>>ZZSB'?L?[.7']WG><*=^C^.V/]G;G^[CIQ=UVX0_?? +M&>OOS/5WUXF[Z\(=NO_.6']GKK^[OAS.#OF.]7?F^KMR=G4.^8[U=^;Z.S"' +M?,?Z.W/]'9A#OF/]G;G^+L_=U#GD.];?F>OO;O)4. +M^8[U=^;ZNYO$W4WE#OF.]7?F^KN;R^'LD.]8?V>NORMG5^>0[UA_9ZZ_`W/( +M=ZR_,]??'>::,WX*<]?D#]S<;9T#OFM8?]>X_NXVSYW*'/#=UZW90[XKF']7>/ZN]O$W>WO90[XKF']7>/ZN]O+X>S0W[==3IQ^XLL[]^W+ +M;U??!]OO7]M&3^<)_)-_XLM?WCW\7@:_WVOT!P:_O6$Y#.8WW-[=:_2]K9O: +M!-[7G][9+;V]1>KOLO??\,T=?-?O[LVAOS?ZSYP?NHKH1X-M>YJFP^"_\NM# +M5Q']F=?7;;_XZ]M_!Z;M3TU[:KO3H#_["O_SUW^[5W@W!V3P_[WANSD@@X=S +M^067WQ\/ZNM#@?^#M_N#UW?K\;;-+@+SO!YBM]Y_-O_P.[1]$3H:@````` ` end Modified: head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow2.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow2.gz.uu Fri Oct 3 20:48:11 2014 (r272485) +++ head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow2.gz.uu Fri Oct 3 20:54:35 2014 (r272486) @@ -1,23 +1,22 @@ # $FreeBSD$ begin 644 img-63x255-4096-mbr.qcow2.gz -M'XL(",`[(U0``VEM9RTV,W@R-34M-#`Y-BUM8G(N<6-O=S(N;W5T`*V8VY+3 -M,`Q`W_=M)F,NVX.B/; -M1VJ2+(LOYW+O0N%"Y0X;UWRG`USOR_!PQU_??RSZK^--A/G,B%(&EOL.-V#] -M8QQ8N,R/![R.ZV6'"@[.46-0"A?,[*8&%-SMS6GI3IM1B@B\!AAQYF9[90HRSLPO'.,VRM1EG<@O'M$N,>,.RA1 -MEG<@O'M"N*<=SFM1EG<@O'M&N.>,4_H=6-Z!\.X%X5XR3NEW8'D'PKM7A+ME -MG-+OP/(.A'>O"?>&<4J_`\L[$-Z]'7GGE7X'EG.4?H>6=RB\0\(%QBG]#BWO4'B7$ZY@G-+OT/(.A7=+PI6,4_H=6MZA\*XB -MW'O&*?T.+>]0>/>!_T9^/K8*V=[8`)8 -M7@*.-XMAN\.>"JV"X#-^AP.(R!-.(_%UOR@.>J< -M/C1'+!":WM9SF0TGO*928]QNYO4[U<<%P#QW=3T"_C[G!Y-I7)[?XV2HXXNS'#31P3KAKL2/G4Z\*[_ -MN8=;+;C5-[C)QPWM/=1>&S`GF\\K2]DUJ\[6WCZWE^[M'=;YWUM<>G?[ZS@_ -MI5G!8+H3^;GQ=-NK@N[N7>Q'BX/$=-T0US:J_GX.MC"Q>JMQ=MN9-\/+RGA@ -MY;:08>5&',S;"*I39VD,;'XU/ML#QY^+X3L"`P%G6\%0M/]M-_\!8,LR/2,5 -"```` +M'XL("&+N+50``VEM9RTV,W@R-34M-#`Y-BUM8G(N<6-O=S(N;W5T`*V8VY+3 +M,`Q`W_[80HS3N;]FXO1&G>@>*=";B#$*5Y!\R[1X1[''!'(4KS +M#IAW3PCW=,!9*4KS#IAWSPCW/."$?@>:=\"\>T&XEP$G]#O0O`/FW2O"W0:< +MT.]`\PZ8=Z\)]R;@A'X'FG?`O'L[\Q]P0K]#S3MDWGT@W,>`$_H=:MXA\^X3X=8!)_0[U+QSS+L-X3X'G-#OG.:= +M8]Y](=Q=P`G]SFG>.>;=5\)]&W`@10W>99E\$.Y^4K.P[/6G"]?'5CCK`S/` +MZA+@7(8>5R\ZX=Q/N-.@$<[ZP.EN-7X/P'.Q70"L:`7'.)IP[HO-KTZ3]Z5A +MJ4!H>CL;RBR>\,:7QWH5X?8+K]^Y/BX`YKEIF@GP=Y\?S*9Q>7[E8>']K?SC +MAK*KVKPP%3PTP[_W?Z9"M[C%*MCC],<---`G/+38"6X3X;HKEF/TR[A.1][% +MGR/<>A5:?8N;?=S0W4,=I`%ULOFRLE1#LQILC?:YNW3O[K#Z?V]VZ3WLKPGY +M">IK=;N'-L+PR'EBY +M'61<."$AHZ))*E6Z_I>W,Y9*GR,/7Q*0Q)1^-!!B$9/CI;VR0DAI`I4&Z -MA7G=,=Q$W(?B5(PT]7<,:"7T?0(4""19\VO'@C$U5`;, -M&:S^5N'SY_&AD'`J5\"$TWNX23!5T!+NRG`E5=],4>P4KSN^9KB&QH2KMM3A -M34PIW;:U)U;>9DJ,^7\>7+]9#XY1).Y_T(+N//@A6(N])Y -9W3'\BK@3L`K`;#?H?SXIBQ>7_'@>Y08````` +M'XL("&+N+50``VEM9RTV,W@R-34M-#`Y-BUM8G(N][(S9\;5I_#AMUAURN#'F$"18`J__$L+B-P`*@/H +M5\9MQ_"E8AN*CV*DZ<,P8&AM_3?37/N +M,!!!70;=@2X!W>0S,7#)+SSU75(9)@IW1Q^DX?J` +MJ^/U6N#,0;@0XQ[+R[*2PH/3:U)U;>9DZ->;\>;-#9#XYC+.Y'T(+N/+0A5( +L6M'/>RVVNPA!__X,@9L\%>:+;9C$<$\ -MO,,,8\&8O0!D`;(%V8`4U"XYR%LH%8#I=`_V[]S]A:Y^_]/4_][.F;NZG87E -M++2*S"^!FDA)0TR3RE=K0>4SVXW"\>?M]]#AT.#\QE\`1A('PV3R*#>J( -M].O^\>=473%7-UK9>=H6BC88483JLNPNQ'%C9<;3(Z'EO4S_1'^BCA`7J1-L -M8A7(7%K4P-DEG-RRN@9WLW.QL*EB$J,T;P8RAQ*I;=+&K\/L,:ER/GWHOZ=F -MH@]74D4&P9CV\75WT:4*^L%.`2>!6^Y"3SE-<0NI\JW5D[$==PVS"$SX#NS= -MCU=O1$&H3^9L8\W7@[&J3Y,^L[>87GBO=W3W67P/P*JZ#JB851CC!H>K>G!8 -MB]$CNU?=^M4Y%,UB0/IMNP_6KWI-'-^JO0XH!&@]`SYY??6FC.OU*94XOJI/ -M&%%2.1<2%'Y5X6'_*KU2#OZO^BF-EW!><%CM8]Q=@"ML]HV4H#A%>1>V -M`]S>_CR.;ZFCFM`L=:PZ*Q(GBU83NS#.D#>0%\"4Z\,8.,071GVWZ[ZT=&(;RP>ONYNCIQ,*KISOCBSB5(O',M#M,6 -M`MU7%I.!9M3\O=[1/63Q;8'H/D7)OFWHBFDRA=P!DRDTP":Q0IWV^R&=PD0' -J!<(E/"@0+N%!@7`)#PJ$2WA0(%S"@P+ADAX4I#D",K;[!%1JM8A=#@`` +M'XL("&+N+50``VEM9RTV,W@R-34M-#`Y-BUM8G(N=FAD+F]U=`"METMOW"`0 +MQ^_[*4;J+0<+CP&3RZX4-3U7JMJ>L6-'.?2A;@\Y^,.7,>`%OS;;S)I%6,"/ +M/\S#0@C_`]`5Z!YT!UI1NY:@[Z$V`*XS%!SK,KS"T/[ZV;5_7UZ+\!L.'E:* +M=%8^G>9C!=(M4@-:6D0_41N&B"D^/#[?O?QXCC@,N+BPU"`1E(/(Q3I&3.J( +M].GAR\>YNFJI[C++K]/W4/7)B"I55Q2G%"?=+#>>BH9>CC)CR5ZRCA27J5-B +M-BN1N7:HR6;7<'IOUBVXNT.PA7<5YQBUJP7H$FJDMG.;>`Z+XESE]?S;_CEW +M,WVXX2HZ,<:\3VYO%X.K8!P<%$@2N+==&"GG.6[%5=YU>CJ?)T/#'8)0L0/' +M[>>G=T%!JD^78N?,MXVQJ<^2/A=;PJ[4VQW#0Y$_$[!I;@,:X:,CQTT;;MH0 +M'0*LHIJBM`RQ&LZO=>_=BD%./FR/R?DU3\SV;?K;@$J!M0O@UZBOW95QNSYC +MF.UK1H=1-:5SI<'@6Q5^?_RV$K_&;J2#_\M^QN(U7!2<9OL<=TIPE0^W"R5) +M3IG?I>T$=_3_B)-[ZB@G=&L=FYM5S,YBS6Q>:FV"SFNF3++B@FOG-YQJ:YE-D8SCXPW1BY!\LCU +M..1-!';,+,X#W:AEO=TQ?"[RQP,Q?(K8OFT8DBF;0AF`;`H=L&-6:'F_'SHH +L9+HH$([QHD`XQHL"X1@O"H1CO"@0CO&B0#C6BX)V5T`A#O\`HP_9YET.```` ` end Modified: head/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdf.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdf.gz.uu Fri Oct 3 20:48:11 2014 (r272485) +++ head/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdf.gz.uu Fri Oct 3 20:54:35 2014 (r272486) @@ -1,15 +1,15 @@ # $FreeBSD$ begin 644 img-63x255-4096-mbr.vhdf.gz -M'XL("`3&'50``VEM9RTV,W@R-34M-#`Y-BUM8G(N=FAD9BYO=70`K96[;L,@ -M%(;W/,61NF6PN)LLB10UG2M5;6?7P5&&MDN'#G[X@O&%8WQ)*NQC"POX_)\+ -M0(B_``0#4DR\YSOJ8X;O>K/=-#3Z<1]0$ZBJ")A9H,>5%F<'6"MDV[#&*W#" -M[6.MI,!-V_8&==97 -MF\3YU4W!R!R$!*E`LUL5OI_>1@H]CJ9RV./8&JX3["MH"G<(<-Q7WT"AP:RP -M[L)V@-O[I\.))74V$L1,=;XJ`J4`:4=.U<@-I!KD,@PY54 -ME]]?IORY_H89=CC:'T6QN?F,N]6B=*5=O9<7"4(>W2H8-_?.^,[8"Q\U%A",(Z>/(> +M=YP9T&RSL#6+Y:*E\?UC0,.`\0B8(=#A*L3A`I19*AKSFEYI +M)`.C7N&[[>:N0X.$;(,-GW7FX0[#KKC/&UJ<_USWWBJHS' +M]14V<7Q-FS"J`*E`:3#B7H6?NX^10H?CJ1QV.'$+UPMV&32%VWBX'(VUM])E +M8K?+SSM_[N'6[M?CY#5U>!+,3AEFG55ID\5@"_?Y<09N@>?`3&<3(7"(+UST +MK6(9(G#WBCZ(W2T)5X3KN8<3-]R%$+:>OJ?=<7DZ'WM<7ZKZ +M/Y::#ETA1$;NFM#=E^W;\UA='A^2"4Z/DTZ_[*'CP>EM?)P3D]?3&`(41*"3.'$F+W/TVGQ0;CSYZ)F-X;7>1%,Y)+RI'!+>5`X);RJ'A#>50\*;RB'A3>60\*9R2/199BB'1&\JAT1O M*H=$;RJ'1&\JAT1O*H=$;RJ'1&\JAT1O*H=$;RJ'1&\JAT1O*H=$;RJ'1&\J MAT1O*H=$;RJ'/&=99BB'/&>F/KF -M-/^3`-'^-L#A0>C[%X`L^(+P*`\.PZLIXL7PRGLI^`:7^]6"OPY_?742N,ZX -M?^A_&V!1N*9Y`?A/YG?^;!J_/;_*&Y_O=7Q@BBK\FMVB=-?ST0Q_^O;'1883 -MG)E^=H+;_?I(+&B_!?>UP.73T_>,HK\)7)\[O1:XKZ9/PET^EYTNJ(X5:_RK -MNZ_9=1&GYQR^[P0ZD/_+.\\!T_FZY_SJEVF<9^5^)C_WLMSP/5=_>:V>QVQ, -M;Y3KYG!A4.EYSHYPIWM?O;]]X^NXT_S,!7B*@6039%_\'RJ'TQAO8``` +M-/^3`-'^-L!)$+<$9,$7C(_RR'XUX_\)\SZ8>2\%WP;;KQ3\]?!G^/CJ)'"= +MFNYZ,9_O3MCXL, +M)S@S_>P$M_OUD5C0?@ON:X$+/P_TXCG[3>#ZW.FUP'TU?1+N\KGL=$%UK%CC +M7]U]S:Z+.#WG\'TGT('\7]YY#IC.USWG5[],XSPK]S/YN9?EAN^Y^LMK]3QF +M8WJC7#>':]-D63G"G>Y]]3*[F_%A8/F5O7WCZ;O3_,\$>(F`9AV\A%],DGWQ?Q6YC7-O8``` ` end Modified: head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow.gz.uu Fri Oct 3 20:48:11 2014 (r272485) +++ head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow.gz.uu Fri Oct 3 20:54:35 2014 (r272486) @@ -1,126 +1,126 @@ # $FreeBSD$ begin 644 img-63x255-4096-pc98.qcow.gz -M'XL(",HS(E0``VEM9RTV,W@R-34M-#`Y-BUP8SDX+G%C;W6Y,FI$BA`H -M9,=%IM>I(Z)UX-QN?_S8;$;;#+O-L&PNA\VW?VX_;7/K'^[^W'S]SW_^Z_7M -M'U]_^S%FVS]Y*OWS=%[G[FS];Y_S/YXZ;K;+3\Q]^VDT=^O=Q5]X=[<^[/7< -M\]]^?%A^SM5@W!GW\F3F_XN??W.7U<^W%ZO^[CNOBXHQK<6?D.U?<><6=D>]<<><5=T:^<\6=5]P9^]"<1]" -M<1+.R7># -MXFZHN'/RW:"X&RKNG'PW*.Z&BCLGWPV*NZ'DCGPW*N[&DCORW:BX&TONR'>C -MXFXLN2/?C8J[L>2.?#)N5W$7Y+N=XFY7<1?DNYWB;E=Q%^2[G>)N5W$7Y+N=XFY7<1?D -MNYWB;E=Q%^2[G>)N5W)'OIL4=U/)'?EN4MQ-)7?DNTEQ-Y7\FQ=U4^ -MFQ1W4\D=^6Y2W$TE=^2[27$WE=R1[R;%W51Q-]!3L^)NKK@;R'>SXFZNN!O( -M=[/B;JZX&\AWL^)NKK@;R'>SXFZNN!O(=[/B;JZX&\AWL^)NKK@;R'>SXFXN -MN2/?W?R_\/!"Q1WY;E'<+25WY+M%<;>4W)'O%L7=4G)'OEL4=TO)'?EN4=PM -M)7?DNT5QMY3\6Q=U2<3?24WO%W;[B;B3?[15W^XJ[D7RW5]SM*^Y&\MU> -M<;>ON!O)=WO%W;[B;B3?[15W^XJ[D7RW5]SM*^Y&\MU><;^.BKMCQ=V.?'=4W!TK[G;DNZ/B[EAQMR/? -M'15WQXJ['?GNJ+@[5MSMR'='Q=VQXFY'OCLJ[HXE=^2[D^+N5')'OCLI[DXE -M=^2[D^+N5')'OCLI[DXE=^2[D^+N5')'OCLI[DXE=^2[D^+N5')'OCLI[DX5 -M=Q,]M79`UR\4W$WDN[/B[EQQ-Y'OSHJ[<\7=1+X[*^[.%7<3^>ZLN#M7W$WD -MN[/B[EQQ-Y'OSHJ[<\7=1+X[*^[.)7?DNXOB[E)R1[Z[*.XN)7?DNXOB[E)R -M1[Z[*.XN)7?DNXOB[E)R1[Z[*.XN)7?DNXOB[E)R1[Z[*.XN%7#[TSU=U;V=S/XSE1_9V5_ -M-X/O3/5W5O9W,_C.5']G97\W@^],]7=6]G#[TSU=U;V=PL] -MI?H[*_N[A7RG^CLK^[N%?*?Z.RO[NX5\I_H[*_N[A7RG^CLK^[N%?*?Z.RO[ -MNX5\I_H[*_N[A7RG^CLK^[N%?*?Z.RO[NX5\I_H[*_N[A7RG^CLK^[N%?*?Z -M.RO[NX5\I_H[*_N[A7RG^CLK^[N%?*?Z.RO[NX5\I_H[*_N[/3VE^CLK^[L] -M^4[U=U;V=WORG>KOK.SO]N0[U=]9V=_MR7>JO[.RO]N3[U1_9V5_MR??J?[. -MROYN3[Y3_9V5_=V>?*?Z.RO[NSWY3O5W5O9W>_*=ZN^L[._VY#O5WUG9W^W) -M=ZJ_L[*_VY/O5']G97^W)]^I_L[*_FY/OE/]G97]W8&>4OV=E?W=@7RG^CLK -M^[L#^4[U=U;V=P?RG>KOK.SO#N0[U=]9V=\=R'>JO[.ROSN0[U1_9V5_=R#? -MJ?[.RO[N0+Y3_9V5_=V!?*?Z.RO[NP/Y3O5W5O9W!_*=ZN^L[.\.Y#O5WUG9 -MWQW(=ZJ_L[*_.Y#O5']G97]W(-^I_L[*_NY(3ZG^SLK^[DB^4_V=E?W=D7RG -M^CLK^[LC^4[U=U;V=T?RG>KOK.SOCN0[U=]9V=\=R7>JO[.ROSN2[U1_9V5_ -M=R3?J?[.RO[N2+Y3_9V5_=V1?*?Z.RO[NR/Y3O5W5O9W1_*=ZN^L[.^.Y#O5 -MWUG9WQW)=ZJ_L[*_.Y+O5']G97]WHJ=4?V=E?WKOK.SO3N0[U=]9V=^=R'>JO[.ROSN1[U1_ -M9V5_=R+?J?[.RO[N1+Y3_9V5_=V)?*?Z.RO[NQ/Y3O5W5O9W)_*=ZN^L[.]. -MY#O5WUG9WYW(=ZJ_L[*_.]-3JK^SLK\[D^]4?V=E?WKOK.SOSN0[U=]9V=^=R7>JO[.ROSN3 -M[U1_9V5_=R;?J?[.RO[N3+Y3_9V5_=V9?*?Z.RO[NS/Y3O5W5O9W9_*=ZN^L -M[._.Y#O5WUG9WUWH*=7?6=G?7KOK.SO+N0[U=]9V=]=R'>JO[.R -MO[N0[U1_9V5_=R'?J?[.RO[N0KY3_9V5_=V%?*?Z.RO[NPOY3O5W5O9W%_*= -MZN^LZN]B"T_YS2_@A3O; -M+^L<^,Y5?^>IO]LT[C:_KW/@.U?]G:?^#LX.?.>JO_/4W\$<^,Y5?^>IOX,Y -M\)VK_LY3?P=SX#M7_9VG_NY>F[O7Y\!WKOH[3_W=O?;V[G7NP'>N^CM/_=V] -MQMV]SAWXSE5_YZF_N]>XN]>Y`]^YZN\\]7=P=N`[5_V=I_X.YL!WKOH[3_T= -MS('O7/5WGOJ[ZSFZ_\Y5?^>IO[O?YN[W.?*=ZN\\]7?W&W?W5^[H_CM7_9VG -M_NY^X^[^RAW=?^>JO_/4W]UOW-U?N:/[[USU=Y[Z.S@[\IWJ[SSU=S!'OE/] -MG:?^#N;(=ZJ_\]3?P1SY3O5WGOJ[!VWN09\CWZG^SE-_]Z!Q]Z!S1[Y3_9VG -M_NY!X^Y!YXY\I_H[3_W=@\;=@\X=^4[U=Y[Z.S@[\IWJ[SSU=S!'OE/]G:?^ -M#N;(=ZJ_\]3?7<_1_7>N^CM/_=W#-O>PSY'O5'_GJ;][V+A[N')']]^YZN\\ -M]7JO_/4W\'9D>]4?^>IOX,Y\IWJ -M[SSU=S!'OE/]G:?^#N;(=ZJ_\]3?/6ISC_H<^4[U=Y[ZNT>-NT>=._*=ZN\\ -M]7>/&G>/.G?D.]7?>>KO'C7N'G7NR'>JO_/4W\'9D>]4?^>IOX,Y\IWJ[SSU -M=S!'OE/]G:?^[GJ.[K]SU=]YZN\>M[G'?8Y\I_H[3_W=X\;=XY4[NO_.57_G -MJ;][W+A[O')']]^YZN\\]7>/&W>/5^[H_CM7_9VG_@[.CGRG^CM/_1W,D>]4 -M?^>IOX,Y\IWJ[SSU=S!'OE/]G:?^[DF;>]+GR'>JO_/4WSUIW#WIW)'O5'_G -MJ;][TKA[TKDCWZG^SE-_]Z1Q]Z1S1[Y3_9VG_@[.CGRG^CM/_1W,D>]4?^>I -MOX,Y\IWJ[SSU=]=S=/^=J_[.4W_WM,T][7/D.]7?>>KOGC;NGJ[]4?^>IOX,Y\IWJ[SSU=\_:W+,^1[Y3_9VG_NY9X^Y9YXY\I_H[ -M3_W=L\;=L\X=^4[U=Y[ZNV>-NV>=._*=ZN\\]7=P=N0[U=]YZN]@CGRG^CM/ -M_1W,D>]4?^>IO[N>H_OO7/5WGOJ[YVWN>9\CWZG^SE-_][QQ]WSECNZ_<]7? -M>>KOGC?NGJ_]4?^>IOWO1YE[T.?*=ZN\\]7>KO7C3N7G3NR'>JO_/4W[UHW+WHW)'O5'_GJ;^#LR/?J?[.4W\'<^0[U=]Y -MZN]@CGRG^CM/_=WU'-U_YZJ_\]3?O6QS+_L<^4[U=Y[ZNY>-NY>KO7C;N7J[JSY'O5'_GJ;][U;A[U;DCWZG^ -MSE-_]ZIQ]ZIS1[Y3_9VG_NY5X^Y5YXY\I_H[3_T=G!WY3O5WGOH[F"/?J?[. -M4W\'<^0[U=]YZN^NY^C^.U?]G5?]7=#]=Z[Z.Z_ZNZ#[[USU=U[U=T'WW[GJ -M[[SJ[X+NOW/5WWG5WP7=?^>JO_.JOPNZ_\Y5?^=5?Q=T_YVK_LZK_B[H_CM7 -M_9VG_NY-VWK3Y\AWJK_SU-^]:=R]Z=R1[U1_YZF_>].X>].Y(]^I_LY3?_>F -MF^4_V=I_X.SHY\I_H[3_T=S)'O5'_GJ;^#.?*=ZN\\]7?71 -M^KMMXVZ[A^KM(_1W,@>]"]7>1^CN8 -M`]^%ZN\B]7?6YJS/@>]"]7>1^CMKW%GG#GP7JK^+U-]9X\XZ=^"[4/U=I/[. -M&G?6N0/?A>KO(O5W<';@NU#]7:3^#N;`=Z'ZNTC]'KOO''G*W=T_UVH_BY2?^>- -M.U^YH_OO0O5WD?H[.#ORG>KO(O5W,$>^4_U=I/X.YLAWJK^+U-_!'/E.]7>1 -M^KMH<]'GR'>JOXO4WT7C+CIWY#O5WT7J[Z)Q%YT[\IWJ[R+U=]&XB\X=^4[U -M=Y'Z.S@[\IWJ[R+U=S!'OE/]7:3^#N;(=ZJ_B]3?7<_1_7>A^KM(_=W0YH8^ -M1[Y3_5VD_FYHW`TK=W3_7:C^+E)_-S3NAI4[NO\N5'\7J;\;&G?#RAW=?Q>J -MOXO4W\'9D>]4?Q>IOX,Y\IWJ[R+U=S!'OE/]7:3^#N;(=ZJ_B]3?C6UN['/D -M.]7?1>KOQL;=V+DCWZG^+E)_-S;NQLX=^4[U=Y'ZN[%Q-W;NR'>JOXO4W\'9 -MD>]4?Q>IOX,Y\IWJ[R+U=S!'OE/]7:3^[GJ.[K\+U=]%ZN]V;6[7Y\AWJK^+ -MU-_M&G>[E3NZ_RY4?Q>IO]LU[G8K=W3_7:C^+E)_MVO<[5;NZ/Z[4/U=I/X. -MSHY\I_J[2/T=S)'O5'\7J;^#.?*=ZN\B]71^KNI<3=U[LAWJK^+U-]-C;NI^4_U=I/X.SHY\I_J[ -M2/T=S)'O5'\7J;^#.?*=ZN\B]7?7YN<^1[U1_%ZF_FQMW -M\\H=W7\7JK^+U-_-C;MYY8[NOPO5WT7J[^;&W;QR1_??A>KO(O5W<';D.]7? -M1>KO8(Y\I_J[2/T=S)'O5'\7J;^#.?*=ZN\B]7=+FUOZ'/E.]7>1^KNE<;=T -M[LAWJK^+U-\MC;NE^4_U=I/YN:=PMG3ORG>KO(O5W<';D.]7?1>KO8(Y\ -MI_J[2/T=S)'O5'\7J;^[GJ/[[T+U=Y'ZN[=M[FV?(]^I_BY2?_>VKO8(Y\I_J[2/T=S)'O5'\7J;][U^;>]3GRG>KO(O5W[QIW[SIW -MY#O5WT7J[]XU[MYU[LAWJK^+U-^]:]R]Z]R1[U1_%ZF_@[,CWZG^+E)_!W/D -M.]7?1>KO8(Y\I_J[2/W=]1S=?Q>JOXO4W[UO<^_['/E.]7>1^KOWC;OW*W=T -M_UVH_BY2?_>^KO8(Y\I_J[2/W=AS;WH<^1[U1_%ZF_^]"X^]"Y -M(]^I_BY2?_>AA^4_U=I/[N0^/N0^>.?*?ZNTC]'9P=^4[U=Y'Z.Y@C -MWZG^+E)_!W/D.]7?1>KOKN?H_KM0_5VD_NYCF_O8Y\AWJK^+U-]];-Q]7+FC -M^^]"]7>1^KN/C;N/*W=T_UVH_BY2?_>QJOXO4 -MW\$<^4[U=Y'Z.Y@CWZG^+E)_!W/D.]7?1>KO/K6Y3WV.?*?ZNTC]W:?&W:?. -M'?E.]7>1^KM/C;M/G3ORG>KO(O5WGQIWGSIWY#O5WT7J[^#LR'>JOXO4W\$< -M^4[U=Y'Z.Y@CWZG^+E)_=S4W;.&IX>87\,(=[FZ"WL]]#GPWJ/[NVPMWN/O< -MN/N\7>?`=X/J[X;4WWUN;^_SEW4.?#>H_FY(_=WGQMWGW]W_UK'?Q^-\]?&!S' -MS?YZ\+_:!QZ_W\VS#)OC0)_K__CI_ -MO\LY-MN;_W3C=P?7K^^FOS]*_.]\W#]Y?YOKC_O]MQC3W?^]W9KSXN-N[LY] -M_RW&K:_GG2]A<7H?K]\=_1'W?^>+<75QXD]^Y_XQ<_UH1+-_-\L>_ -C3O?P=_W"UR^O[_[U8W!H@[_L!(=ON&RWO_T?@O'+%J.H```` +M'XL("&/N+50``VEM9RTV,W@R-34M-#`Y-BUP8SDX+G%C;W#T/@/SLAF9W[NZH]4TP&A@T +M`A7Y*2MK]0+-+&W6ZY_?5JO15L-F-?MNZWN_>3A]]6W__J/_WQW +M_]NW/WZ.V?HOKDH_WYZ6N0=;_]?G_,=5A]5Z_H6Y[]^-YN[=7?R-N[OW9B_G +MKO[X^6;Y.E>#\6!PU>;6[?Y,/+WAU^[O2WJ[]O/I_;ZWZ^+MCFIP\V#P:YO[ +M5[L__UNP_-+]_)7X0K,[PM,7VM=E;H]7;=3< +M0^[^=<'=`:\2W%G)W1&O$MQ9R=T)KQ+<6NN/.*.R/?N>+.*^Z,?.>*.Z^X,_*=*^Z\ +MY(Y\%XJ[*+DCWX7B+DKNR'>AN(N2._)=*.ZBY(Y\%XJ[*+DCWX7B+DKNR'>A +MN(N2._)=*.ZBXL[IJD%Q-U3<.?EN4-P-%7=.OAL4=T/%G9/O!L7=4''GY+M! +M<3=4W#GY;E#<#15W3KX;%'=#Q9V3[P;%W5!R1[X;%7=CR1WY;E36W)'O1L7=6')'OAL5=V/)'?EN5-R-)7?DNU%Q-Y;]&Q=U8<1=TU49Q +MMZFX"_+=1G&WJ;@+\MU&<;>IN`ORW49QMZFX"_+=1G&WJ;@+\MU&<;>IN`OR +MW49QMZFX"_+=1G&W*;DCWVT5=]N2._+=5G&W+;DCWVT5=]N2._+=5G&W+;DC +MWVT5=]N2._+=5G&W+;DCWVT5=]N2._+=5G&WK;@;Z*I)<3=5W`WDNTEQ-U7< +M#>2[27$W5=P-Y+M)<3=5W`WDNTEQ-U7<#>2[27$W5=P-Y+M)<3=5W`WDNTEQ +M-Y7_N_BL\O%!Q1[Z;%7=SR1WY;E;7W)'O9L7=7')'OIL5 +M=W/)'?EN5MS-)7?DNUEQ-U?ZHN#N6W)'OCHJ[ +M8\D=^>ZHN#N6W)'OCHJ[8\D=^>ZHN#N6W)'OCHJ[8\D=^>ZHN#N6W)'OCHJ[ +M8\7=EJY:.J#+%PKNMN2[D^+N5'&W)=^=%'>GBKLM^>ZDN#M5W&W)=R?%W:GB +M;DN^.RGN3A5W6_+=27%WJKC;DN].BKM3R1WY[JRX.Y?_.BKMSR1WY[JRX +M.Y?_.BKMSR1WY[JRX.Y?_.BKMSR1WY[JRX.Y?_.BKMSQ=T$5]G= +M#^"%@KL)?&`[ +M4_V=E?W=!+XSU=]9V=]-X#M3_9V5_=T$OC/5WUG9WTW@.U/]G97]W02^,]7? +M6=G?3>`[4_V=E?W=!+XSU=]9V=]-X#M3_9V5_=T$OC/5WUG9WTW@.U/]G97] +MW4Q7J?[.ROYN)M^I_L[*_FXFWZG^SLK^;B;?J?[.ROYN)M^I_L[*_FXFWZG^ +MSLK^;B;?J?[.ROYN)M^I_L[*_FXFWZG^SLK^;B;?J?[.ROYN)M^I_L[*_FXF +MWZG^SLK^;B;?J?[.ROYN)M^I_L[*_FXFWZG^SLK^;B;?J?[.ROYN1U>I_L[* +M_FY'OE/]G97]W8Y\I_H[*_N['?E.]7=6]G<[\IWJ[ZSL[W;D.]7?6=G?[]4?V=E?[^4_V=E?W=CGRG^CLK^[L=^4[U=U;V +M=SORG>KOK.SO=N0[U=]9V=_MR'>JO[.RO]N1[U1_9V5_MZ>K5']G97^W)]^I +M_L[*_FY/OE/]G97]W9Y\I_H[*_N[/?E.]7=6]G=[\IWJ[ZSL[_;D.]7?6=G? +M[KOK.SO]N0[U=]9V=_MR7>JO[.ROSO05:J_L[*_.Y#O5']G97]W +M(-^I_L[*_NY`OE/]G97]W8%\I_H[*_N[`_E.]7=6]G<'\IWJ[ZSL[P[D.]7? +M6=G?'KOK.SO#N0[U=]9V=\=Z2K5WUG9WQW)=ZJ_L[*_.Y+O5']G +M97]W)-^I_L[*_NY(OE/]G97]W9%\I_H[*_N[(_E.]7=6]G='\IWJ[ZSL[X[D +M.]7?6=G?' 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 E7B62B50; Fri, 3 Oct 2014 21:46:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D486BB66; Fri, 3 Oct 2014 21:46: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 s93Lk7je008860; Fri, 3 Oct 2014 21:46:07 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93Lk7gx008859; Fri, 3 Oct 2014 21:46:07 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201410032146.s93Lk7gx008859@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 3 Oct 2014 21:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272487 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 03 Oct 2014 21:46:08 -0000 Author: ae Date: Fri Oct 3 21:46:07 2014 New Revision: 272487 URL: https://svnweb.freebsd.org/changeset/base/272487 Log: Add GUID of FreeBSD slice to GPT scheme. MFC after: 1 week Modified: head/sys/boot/common/part.c Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Fri Oct 3 20:54:35 2014 (r272486) +++ head/sys/boot/common/part.c Fri Oct 3 21:46:07 2014 (r272487) @@ -53,6 +53,7 @@ static const uuid_t gpt_uuid_unused = GP static const uuid_t gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; static const uuid_t gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; static const uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI; +static const uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static const uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; static const uuid_t gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; static const uuid_t gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; @@ -139,6 +140,8 @@ gpt_parttype(uuid_t type) return (PART_FREEBSD_VINUM); else if (uuid_equal(&type, &gpt_uuid_freebsd_nandfs, NULL)) return (PART_FREEBSD_NANDFS); + else if (uuid_equal(&type, &gpt_uuid_freebsd, NULL)) + return (PART_FREEBSD); return (PART_UNKNOWN); } From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 23:20:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10AA1492; Fri, 3 Oct 2014 23:20:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5625AD6; Fri, 3 Oct 2014 23:20: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 s93NKeJH052325; Fri, 3 Oct 2014 23:20:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93NKcBQ052316; Fri, 3 Oct 2014 23:20:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201410032320.s93NKcBQ052316@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 3 Oct 2014 23:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272488 - in head: . cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf cddl/contrib/opensolaris/lib/libdtrace/common cddl/lib/libdtrace lib/libproc lib/libproc/tests lib/librtld_db X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 03 Oct 2014 23:20:41 -0000 Author: markj Date: Fri Oct 3 23:20:37 2014 New Revision: 272488 URL: https://svnweb.freebsd.org/changeset/base/272488 Log: Hook up support for userland CTF support in DTrace. This required some modifications to libproc to support fetching the CTF info for a given file. With this change, dtrace(1) is able to resolve type info for function and USDT probe arguments, and function return values. In particular, the args[n] syntax should now work for referencing arguments of userland probes, provided that the requisite CTF info is available. The uctf tests pass if the test programs are compiled with CTF info. The current infrastructure around the DTrace test suite doesn't support this yet. Differential Revision: https://reviews.freebsd.org/D891 MFC after: 1 month Relnotes: yes Sponsored by: EMC / Isilon Storage Division Modified: head/ObsoleteFiles.inc head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c head/cddl/lib/libdtrace/libproc_compat.h head/lib/libproc/Makefile head/lib/libproc/libproc.h head/lib/libproc/proc_sym.c head/lib/libproc/tests/proc_test.c head/lib/librtld_db/rtld_db.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Oct 3 21:46:07 2014 (r272487) +++ head/ObsoleteFiles.inc Fri Oct 3 23:20:37 2014 (r272488) @@ -1496,6 +1496,7 @@ OLD_LIBS+=usr/lib/libpanel.so.4 OLD_LIBS+=usr/lib/libpanelw.so.4 OLD_LIBS+=usr/lib/libpmc.so.4 OLD_LIBS+=usr/lib/libproc.so.1 +OLD_LIBS+=usr/lib/libproc.so.2 OLD_LIBS+=usr/lib/libradius.so.3 OLD_LIBS+=usr/lib/librpcsvc.so.4 OLD_LIBS+=usr/lib/libsdp.so.3 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh Fri Oct 3 21:46:07 2014 (r272487) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh Fri Oct 3 23:20:37 2014 (r272488) @@ -38,7 +38,7 @@ fi ./$exe & pid=$! -$dtrace -32 -qs /dev/stdin <dtpd_mod; } -#else - obj = pdp->dtpd_mod; -#endif if ((pmp = Plmid_to_map(P, lmid, obj)) == NULL) return (NULL); -#if defined(sun) (void) Pobjname(P, pmp->pr_vaddr, m, sizeof (m)); if ((obj = strrchr(m, '/')) == NULL) obj = &m[0]; else obj++; +#if defined(sun) (void) Plmid(P, pmp->pr_vaddr, &lmid); #endif @@ -571,9 +563,7 @@ dt_pid_usdt_mapping(void *data, const pr { struct ps_prochandle *P = data; GElf_Sym sym; -#if defined(sun) prsyminfo_t sip; -#endif dof_helper_t dh; GElf_Half e_type; const char *mname; @@ -852,11 +842,7 @@ dt_pid_get_types(dtrace_hdl_t *dtp, cons ctf_funcinfo_t f; ctf_id_t argv[32]; GElf_Sym sym; -#if defined(sun) prsyminfo_t si; -#else - void *si; -#endif struct ps_prochandle *p; int i, args; char buf[DTRACE_ARGTYPELEN]; @@ -941,13 +927,11 @@ dt_pid_get_types(dtrace_hdl_t *dtp, cons pdp->dtpd_func, pdp->dtpd_provider, pdp->dtpd_mod); goto out; } -#if defined(sun) if (ctf_func_info(fp, si.prs_id, &f) == CTF_ERR) { dt_dprintf("failed to get ctf information for %s in %s`%s\n", pdp->dtpd_func, pdp->dtpd_provider, pdp->dtpd_mod); goto out; } -#endif (void) snprintf(buf, sizeof (buf), "%s`%s", pdp->dtpd_provider, pdp->dtpd_mod); @@ -977,7 +961,6 @@ dt_pid_get_types(dtrace_hdl_t *dtp, cons (void) ctf_type_qname(fp, f.ctc_return, adp->dtargd_native + ret, DTRACE_ARGTYPELEN - ret, buf); *nargs = 2; -#if defined(sun) } else { if (ctf_func_args(fp, si.prs_id, argc, argv) == CTF_ERR) goto out; @@ -993,7 +976,6 @@ dt_pid_get_types(dtrace_hdl_t *dtp, cons (void) ctf_type_qname(fp, argv[i], adp->dtargd_native + ret, DTRACE_ARGTYPELEN - ret, buf); } -#endif } out: dt_proc_unlock(dtp, p); Modified: head/cddl/lib/libdtrace/libproc_compat.h ============================================================================== --- head/cddl/lib/libdtrace/libproc_compat.h Fri Oct 3 21:46:07 2014 (r272487) +++ head/cddl/lib/libdtrace/libproc_compat.h Fri Oct 3 23:20:37 2014 (r272488) @@ -38,7 +38,7 @@ #define Pxlookup_by_addr(p, a, n, s, sym, i) \ proc_addr2sym(p, a, n, s, sym) #define Pxlookup_by_name(p, l, s1, s2, sym, a) \ - proc_name2sym((p), (s1), (s2), (sym)) + proc_name2sym(p, s1, s2, sym, a) #define Paddr_to_map proc_addr2map #define Pcreate_error strerror #define Pdelbkpt proc_bkptdel @@ -46,10 +46,10 @@ #define Plmid(p, a, l) (-1) #define Plmid_to_map(p, l, o) proc_obj2map((p), (o)) #define Plookup_by_addr proc_addr2sym -#define Pname_to_ctf(p, obj) NULL +#define Pname_to_ctf(p, obj) (ctf_file_t *)proc_name2ctf(p, obj) #define Pname_to_map proc_name2map #define Pobject_iter proc_iter_objs -#define Pobject_iter_resolved(p, f, arg) 1 +#define Pobject_iter_resolved(p, f, arg) proc_iter_objs(p, f, arg) #define Pobjname proc_objname #define Pread proc_read #define Prd_agent proc_rdagent Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Fri Oct 3 21:46:07 2014 (r272487) +++ head/lib/libproc/Makefile Fri Oct 3 23:20:37 2014 (r272488) @@ -25,7 +25,18 @@ LDADD+= -lsupc++ DPADD+= ${LIBSTDCPLUSPLUS} .endif -SHLIB_MAJOR= 2 +.if ${MK_CDDL} != "no" +LDADD+= -lctf +DPADD+= ${LIBCTF} +IGNORE_PRAGMA= YES +CFLAGS+= -I${.CURDIR}/../../cddl/contrib/opensolaris/lib/libctf/common \ + -I${.CURDIR}/../../sys/cddl/contrib/opensolaris/uts/common \ + -I${.CURDIR}/../../sys/cddl/compat/opensolaris +.else +CFLAGS+= -DNO_CTF +.endif + +SHLIB_MAJOR= 3 MAN= Modified: head/lib/libproc/libproc.h ============================================================================== --- head/lib/libproc/libproc.h Fri Oct 3 21:46:07 2014 (r272487) +++ head/lib/libproc/libproc.h Fri Oct 3 23:20:37 2014 (r272488) @@ -37,6 +37,7 @@ #include #include +struct ctf_file; struct proc_handle; typedef void (*proc_child_func)(void *); @@ -67,6 +68,11 @@ typedef struct prmap { #define MA_NOCOREDUMP 0x20 } prmap_t; +typedef struct prsyminfo { + u_int prs_lmid; /* Map id. */ + u_int prs_id; /* Symbol id. */ +} prsyminfo_t; + typedef int proc_map_f(void *, const prmap_t *, const char *); typedef int proc_sym_f(void *, const GElf_Sym *, const char *); @@ -125,7 +131,9 @@ int proc_create(const char *, char * con struct proc_handle **); int proc_detach(struct proc_handle *, int); int proc_getflags(struct proc_handle *); -int proc_name2sym(struct proc_handle *, const char *, const char *, GElf_Sym *); +int proc_name2sym(struct proc_handle *, const char *, const char *, + GElf_Sym *, prsyminfo_t *); +struct ctf_file *proc_name2ctf(struct proc_handle *, const char *); int proc_setflags(struct proc_handle *, int); int proc_state(struct proc_handle *); pid_t proc_getpid(struct proc_handle *); @@ -133,8 +141,7 @@ int proc_wstatus(struct proc_handle *); int proc_getwstat(struct proc_handle *); char * proc_signame(int, char *, size_t); int proc_read(struct proc_handle *, void *, size_t, size_t); -const lwpstatus_t * - proc_getlwpstatus(struct proc_handle *); +const lwpstatus_t *proc_getlwpstatus(struct proc_handle *); void proc_free(struct proc_handle *); rd_agent_t *proc_rdagent(struct proc_handle *); void proc_updatesyms(struct proc_handle *); Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Fri Oct 3 21:46:07 2014 (r272487) +++ head/lib/libproc/proc_sym.c Fri Oct 3 23:20:37 2014 (r272488) @@ -32,6 +32,10 @@ __FBSDID("$FreeBSD$"); #include +#ifndef NO_CTF +#include +#include +#endif #include #include @@ -42,10 +46,17 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifndef NO_CTF +#include +#endif #include #include "_libproc.h" +#ifdef NO_CTF +typedef struct ctf_file ctf_file_t; +#endif + #ifndef NO_CXA_DEMANGLE extern char *__cxa_demangle(const char *, char *, size_t *, int *); #endif /* NO_CXA_DEMANGLE */ @@ -389,7 +400,7 @@ proc_name2map(struct proc_handle *p, con */ static int lookup_name(Elf *e, Elf_Scn *scn, u_long stridx, const char *symbol, - GElf_Sym *symcopy) + GElf_Sym *symcopy, prsyminfo_t *si) { GElf_Sym sym; Elf_Data *data; @@ -404,6 +415,8 @@ lookup_name(Elf *e, Elf_Scn *scn, u_long s = elf_strptr(e, stridx, sym.st_name); if (s != NULL && strcmp(s, symbol) == 0) { memcpy(symcopy, &sym, sizeof(*symcopy)); + if (si != NULL) + si->prs_id = i; return (0); } } @@ -412,7 +425,7 @@ lookup_name(Elf *e, Elf_Scn *scn, u_long int proc_name2sym(struct proc_handle *p, const char *object, const char *symbol, - GElf_Sym *symcopy) + GElf_Sym *symcopy, prsyminfo_t *si) { Elf *e; Elf_Scn *scn, *dynsymscn = NULL, *symtabscn = NULL; @@ -462,11 +475,11 @@ proc_name2sym(struct proc_handle *p, con * First look up the symbol in the dynsymtab, and fall back to the * symtab if the lookup fails. */ - error = lookup_name(e, dynsymscn, dynsymstridx, symbol, symcopy); + error = lookup_name(e, dynsymscn, dynsymstridx, symbol, symcopy, si); if (error == 0) goto out; - error = lookup_name(e, symtabscn, symtabstridx, symbol, symcopy); + error = lookup_name(e, symtabscn, symtabstridx, symbol, symcopy, si); if (error == 0) goto out; @@ -484,6 +497,26 @@ err0: return (error); } +ctf_file_t * +proc_name2ctf(struct proc_handle *p, const char *name) +{ +#ifndef NO_CTF + prmap_t *map; + int error; + + if ((map = proc_name2map(p, name)) == NULL) { + DPRINTFX("ERROR: couldn't find object %s", object); + return (NULL); + } + + return (ctf_open(map->pr_mapname, &error)); +#else + (void)p; + (void)name; + return (NULL); +#endif +} + int proc_iter_symbyaddr(struct proc_handle *p, const char *object, int which, int mask, proc_sym_f *func, void *cd) Modified: head/lib/libproc/tests/proc_test.c ============================================================================== --- head/lib/libproc/tests/proc_test.c Fri Oct 3 21:46:07 2014 (r272487) +++ head/lib/libproc/tests/proc_test.c Fri Oct 3 23:20:37 2014 (r272488) @@ -227,6 +227,7 @@ ATF_TC_HEAD(map_alias_name2sym, tc) ATF_TC_BODY(map_alias_name2sym, tc) { GElf_Sym sym1, sym2; + prsyminfo_t si1, si2; struct proc_handle *phdl; int error; @@ -239,14 +240,15 @@ ATF_TC_BODY(map_alias_name2sym, tc) * Make sure that "target_prog:main" and "a.out:main" return the same * symbol. */ - error = proc_name2sym(phdl, target_prog_file, "main", &sym1); + error = proc_name2sym(phdl, target_prog_file, "main", &sym1, &si1); ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'main' via %s", target_prog_file); - error = proc_name2sym(phdl, aout_object, "main", &sym2); + error = proc_name2sym(phdl, aout_object, "main", &sym2, &si2); ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'main' via %s", aout_object); ATF_CHECK_EQ(memcmp(&sym1, &sym2, sizeof(sym1)), 0); + ATF_CHECK_EQ(si1.prs_id, si2.prs_id); ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution"); @@ -271,11 +273,11 @@ ATF_TC_BODY(symbol_lookup, tc) phdl = start_prog(tc, false); - error = proc_name2sym(phdl, target_prog_file, "main", &main_sym); + error = proc_name2sym(phdl, target_prog_file, "main", &main_sym, NULL); ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'main'"); error = proc_name2sym(phdl, ldelf_object, "r_debug_state", - &r_debug_state_sym); + &r_debug_state_sym, NULL); ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'r_debug_state'"); set_bkpt(phdl, r_debug_state_sym.st_value, &saved); Modified: head/lib/librtld_db/rtld_db.c ============================================================================== --- head/lib/librtld_db/rtld_db.c Fri Oct 3 21:46:07 2014 (r272487) +++ head/lib/librtld_db/rtld_db.c Fri Oct 3 23:20:37 2014 (r272488) @@ -237,14 +237,14 @@ rd_reset(rd_agent_t *rdap) GElf_Sym sym; if (proc_name2sym(rdap->rda_php, "ld-elf.so.1", "r_debug_state", - &sym) < 0) + &sym, NULL) < 0) return (RD_ERR); DPRINTF("found r_debug_state at 0x%lx\n", (unsigned long)sym.st_value); rdap->rda_preinit_addr = sym.st_value; rdap->rda_dlactivity_addr = sym.st_value; if (proc_name2sym(rdap->rda_php, "ld-elf.so.1", "_r_debug_postinit", - &sym) < 0) + &sym, NULL) < 0) return (RD_ERR); DPRINTF("found _r_debug_postinit at 0x%lx\n", (unsigned long)sym.st_value); From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 23:26:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7CC466B; Fri, 3 Oct 2014 23:26:58 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 30F55BB2; Fri, 3 Oct 2014 23:26:58 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id C586520E7088B; Fri, 3 Oct 2014 23:26:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id 5DE2B20E70886; Fri, 3 Oct 2014 23:26:47 +0000 (UTC) Message-ID: <985EC1F71A75425DB8055BE27C00D9A4@multiplay.co.uk> From: "Steven Hartland" To: "Mark Johnston" , , , References: <201410032320.s93NKcBQ052316@svn.freebsd.org> Subject: Re: svn commit: r272488 - in head: . cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf cddl/contrib/opensolaris/lib/libdtrace/common cddl/lib/libdtrace lib/libproc lib/libproc/tests lib/librtld_db Date: Sat, 4 Oct 2014 00:26:40 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 03 Oct 2014 23:26:58 -0000 Nice work Mark! ----- Original Message ----- From: "Mark Johnston" To: ; ; Sent: Saturday, October 04, 2014 12:20 AM Subject: svn commit: r272488 - in head: . cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf cddl/contrib/opensolaris/lib/libdtrace/common cddl/lib/libdtrace lib/libproc lib/libproc/tests lib/librtld_db > Author: markj > Date: Fri Oct 3 23:20:37 2014 > New Revision: 272488 > URL: https://svnweb.freebsd.org/changeset/base/272488 > > Log: > Hook up support for userland CTF support in DTrace. This required some > modifications to libproc to support fetching the CTF info for a given file. > > With this change, dtrace(1) is able to resolve type info for function and > USDT probe arguments, and function return values. In particular, the args[n] > syntax should now work for referencing arguments of userland probes, > provided that the requisite CTF info is available. > > The uctf tests pass if the test programs are compiled with CTF info. The > current infrastructure around the DTrace test suite doesn't support this > yet. > > Differential Revision: https://reviews.freebsd.org/D891 > MFC after: 1 month > Relnotes: yes > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/ObsoleteFiles.inc > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh > head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c > head/cddl/lib/libdtrace/libproc_compat.h > head/lib/libproc/Makefile > head/lib/libproc/libproc.h > head/lib/libproc/proc_sym.c > head/lib/libproc/tests/proc_test.c > head/lib/librtld_db/rtld_db.c > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Fri Oct 3 21:46:07 2014 (r272487) > +++ head/ObsoleteFiles.inc Fri Oct 3 23:20:37 2014 (r272488) > @@ -1496,6 +1496,7 @@ OLD_LIBS+=usr/lib/libpanel.so.4 > OLD_LIBS+=usr/lib/libpanelw.so.4 > OLD_LIBS+=usr/lib/libpmc.so.4 > OLD_LIBS+=usr/lib/libproc.so.1 > +OLD_LIBS+=usr/lib/libproc.so.2 > OLD_LIBS+=usr/lib/libradius.so.3 > OLD_LIBS+=usr/lib/librpcsvc.so.4 > OLD_LIBS+=usr/lib/libsdp.so.3 > > Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh Fri Oct 3 21:46:07 2014 (r272487) > +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh Fri Oct 3 23:20:37 2014 (r272488) > @@ -38,7 +38,7 @@ fi > ./$exe & > pid=$! > > -$dtrace -32 -qs /dev/stdin < +$dtrace -qs /dev/stdin < typedef struct info { > char *zi_gamename; > int zi_ndungeons; > > Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c > ============================================================================== > --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c Fri Oct 3 21:46:07 2014 (r272487) > +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c Fri Oct 3 23:20:37 2014 (r272488) > @@ -434,15 +434,10 @@ static const prmap_t * > dt_pid_fix_mod(dtrace_probedesc_t *pdp, struct ps_prochandle *P) > { > char m[MAXPATHLEN]; > -#if defined(sun) > Lmid_t lmid = PR_LMID_EVERY; > -#else > - Lmid_t lmid = 0; > -#endif > const char *obj; > const prmap_t *pmp; > > -#if defined(sun) > /* > * Pick apart the link map from the library name. > */ > @@ -463,20 +458,17 @@ dt_pid_fix_mod(dtrace_probedesc_t *pdp, > } else { > obj = pdp->dtpd_mod; > } > -#else > - obj = pdp->dtpd_mod; > -#endif > > if ((pmp = Plmid_to_map(P, lmid, obj)) == NULL) > return (NULL); > > -#if defined(sun) > (void) Pobjname(P, pmp->pr_vaddr, m, sizeof (m)); > if ((obj = strrchr(m, '/')) == NULL) > obj = &m[0]; > else > obj++; > > +#if defined(sun) > (void) Plmid(P, pmp->pr_vaddr, &lmid); > #endif > > @@ -571,9 +563,7 @@ dt_pid_usdt_mapping(void *data, const pr > { > struct ps_prochandle *P = data; > GElf_Sym sym; > -#if defined(sun) > prsyminfo_t sip; > -#endif > dof_helper_t dh; > GElf_Half e_type; > const char *mname; > @@ -852,11 +842,7 @@ dt_pid_get_types(dtrace_hdl_t *dtp, cons > ctf_funcinfo_t f; > ctf_id_t argv[32]; > GElf_Sym sym; > -#if defined(sun) > prsyminfo_t si; > -#else > - void *si; > -#endif > struct ps_prochandle *p; > int i, args; > char buf[DTRACE_ARGTYPELEN]; > @@ -941,13 +927,11 @@ dt_pid_get_types(dtrace_hdl_t *dtp, cons > pdp->dtpd_func, pdp->dtpd_provider, pdp->dtpd_mod); > goto out; > } > -#if defined(sun) > if (ctf_func_info(fp, si.prs_id, &f) == CTF_ERR) { > dt_dprintf("failed to get ctf information for %s in %s`%s\n", > pdp->dtpd_func, pdp->dtpd_provider, pdp->dtpd_mod); > goto out; > } > -#endif > > (void) snprintf(buf, sizeof (buf), "%s`%s", pdp->dtpd_provider, > pdp->dtpd_mod); > @@ -977,7 +961,6 @@ dt_pid_get_types(dtrace_hdl_t *dtp, cons > (void) ctf_type_qname(fp, f.ctc_return, adp->dtargd_native + > ret, DTRACE_ARGTYPELEN - ret, buf); > *nargs = 2; > -#if defined(sun) > } else { > if (ctf_func_args(fp, si.prs_id, argc, argv) == CTF_ERR) > goto out; > @@ -993,7 +976,6 @@ dt_pid_get_types(dtrace_hdl_t *dtp, cons > (void) ctf_type_qname(fp, argv[i], adp->dtargd_native + > ret, DTRACE_ARGTYPELEN - ret, buf); > } > -#endif > } > out: > dt_proc_unlock(dtp, p); > > Modified: head/cddl/lib/libdtrace/libproc_compat.h > ============================================================================== > --- head/cddl/lib/libdtrace/libproc_compat.h Fri Oct 3 21:46:07 2014 (r272487) > +++ head/cddl/lib/libdtrace/libproc_compat.h Fri Oct 3 23:20:37 2014 (r272488) > @@ -38,7 +38,7 @@ > #define Pxlookup_by_addr(p, a, n, s, sym, i) \ > proc_addr2sym(p, a, n, s, sym) > #define Pxlookup_by_name(p, l, s1, s2, sym, a) \ > - proc_name2sym((p), (s1), (s2), (sym)) > + proc_name2sym(p, s1, s2, sym, a) > #define Paddr_to_map proc_addr2map > #define Pcreate_error strerror > #define Pdelbkpt proc_bkptdel > @@ -46,10 +46,10 @@ > #define Plmid(p, a, l) (-1) > #define Plmid_to_map(p, l, o) proc_obj2map((p), (o)) > #define Plookup_by_addr proc_addr2sym > -#define Pname_to_ctf(p, obj) NULL > +#define Pname_to_ctf(p, obj) (ctf_file_t *)proc_name2ctf(p, obj) > #define Pname_to_map proc_name2map > #define Pobject_iter proc_iter_objs > -#define Pobject_iter_resolved(p, f, arg) 1 > +#define Pobject_iter_resolved(p, f, arg) proc_iter_objs(p, f, arg) > #define Pobjname proc_objname > #define Pread proc_read > #define Prd_agent proc_rdagent > > Modified: head/lib/libproc/Makefile > ============================================================================== > --- head/lib/libproc/Makefile Fri Oct 3 21:46:07 2014 (r272487) > +++ head/lib/libproc/Makefile Fri Oct 3 23:20:37 2014 (r272488) > @@ -25,7 +25,18 @@ LDADD+= -lsupc++ > DPADD+= ${LIBSTDCPLUSPLUS} > .endif > > -SHLIB_MAJOR= 2 > +.if ${MK_CDDL} != "no" > +LDADD+= -lctf > +DPADD+= ${LIBCTF} > +IGNORE_PRAGMA= YES > +CFLAGS+= -I${.CURDIR}/../../cddl/contrib/opensolaris/lib/libctf/common \ > + -I${.CURDIR}/../../sys/cddl/contrib/opensolaris/uts/common \ > + -I${.CURDIR}/../../sys/cddl/compat/opensolaris > +.else > +CFLAGS+= -DNO_CTF > +.endif > + > +SHLIB_MAJOR= 3 > > MAN= > > > Modified: head/lib/libproc/libproc.h > ============================================================================== > --- head/lib/libproc/libproc.h Fri Oct 3 21:46:07 2014 (r272487) > +++ head/lib/libproc/libproc.h Fri Oct 3 23:20:37 2014 (r272488) > @@ -37,6 +37,7 @@ > #include > #include > > +struct ctf_file; > struct proc_handle; > > typedef void (*proc_child_func)(void *); > @@ -67,6 +68,11 @@ typedef struct prmap { > #define MA_NOCOREDUMP 0x20 > } prmap_t; > > +typedef struct prsyminfo { > + u_int prs_lmid; /* Map id. */ > + u_int prs_id; /* Symbol id. */ > +} prsyminfo_t; > + > typedef int proc_map_f(void *, const prmap_t *, const char *); > typedef int proc_sym_f(void *, const GElf_Sym *, const char *); > > @@ -125,7 +131,9 @@ int proc_create(const char *, char * con > struct proc_handle **); > int proc_detach(struct proc_handle *, int); > int proc_getflags(struct proc_handle *); > -int proc_name2sym(struct proc_handle *, const char *, const char *, GElf_Sym *); > +int proc_name2sym(struct proc_handle *, const char *, const char *, > + GElf_Sym *, prsyminfo_t *); > +struct ctf_file *proc_name2ctf(struct proc_handle *, const char *); > int proc_setflags(struct proc_handle *, int); > int proc_state(struct proc_handle *); > pid_t proc_getpid(struct proc_handle *); > @@ -133,8 +141,7 @@ int proc_wstatus(struct proc_handle *); > int proc_getwstat(struct proc_handle *); > char * proc_signame(int, char *, size_t); > int proc_read(struct proc_handle *, void *, size_t, size_t); > -const lwpstatus_t * > - proc_getlwpstatus(struct proc_handle *); > +const lwpstatus_t *proc_getlwpstatus(struct proc_handle *); > void proc_free(struct proc_handle *); > rd_agent_t *proc_rdagent(struct proc_handle *); > void proc_updatesyms(struct proc_handle *); > > Modified: head/lib/libproc/proc_sym.c > ============================================================================== > --- head/lib/libproc/proc_sym.c Fri Oct 3 21:46:07 2014 (r272487) > +++ head/lib/libproc/proc_sym.c Fri Oct 3 23:20:37 2014 (r272488) > @@ -32,6 +32,10 @@ > __FBSDID("$FreeBSD$"); > > #include > +#ifndef NO_CTF > +#include > +#include > +#endif > #include > > #include > @@ -42,10 +46,17 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifndef NO_CTF > +#include > +#endif > #include > > #include "_libproc.h" > > +#ifdef NO_CTF > +typedef struct ctf_file ctf_file_t; > +#endif > + > #ifndef NO_CXA_DEMANGLE > extern char *__cxa_demangle(const char *, char *, size_t *, int *); > #endif /* NO_CXA_DEMANGLE */ > @@ -389,7 +400,7 @@ proc_name2map(struct proc_handle *p, con > */ > static int > lookup_name(Elf *e, Elf_Scn *scn, u_long stridx, const char *symbol, > - GElf_Sym *symcopy) > + GElf_Sym *symcopy, prsyminfo_t *si) > { > GElf_Sym sym; > Elf_Data *data; > @@ -404,6 +415,8 @@ lookup_name(Elf *e, Elf_Scn *scn, u_long > s = elf_strptr(e, stridx, sym.st_name); > if (s != NULL && strcmp(s, symbol) == 0) { > memcpy(symcopy, &sym, sizeof(*symcopy)); > + if (si != NULL) > + si->prs_id = i; > return (0); > } > } > @@ -412,7 +425,7 @@ lookup_name(Elf *e, Elf_Scn *scn, u_long > > int > proc_name2sym(struct proc_handle *p, const char *object, const char *symbol, > - GElf_Sym *symcopy) > + GElf_Sym *symcopy, prsyminfo_t *si) > { > Elf *e; > Elf_Scn *scn, *dynsymscn = NULL, *symtabscn = NULL; > @@ -462,11 +475,11 @@ proc_name2sym(struct proc_handle *p, con > * First look up the symbol in the dynsymtab, and fall back to the > * symtab if the lookup fails. > */ > - error = lookup_name(e, dynsymscn, dynsymstridx, symbol, symcopy); > + error = lookup_name(e, dynsymscn, dynsymstridx, symbol, symcopy, si); > if (error == 0) > goto out; > > - error = lookup_name(e, symtabscn, symtabstridx, symbol, symcopy); > + error = lookup_name(e, symtabscn, symtabstridx, symbol, symcopy, si); > if (error == 0) > goto out; > > @@ -484,6 +497,26 @@ err0: > return (error); > } > > +ctf_file_t * > +proc_name2ctf(struct proc_handle *p, const char *name) > +{ > +#ifndef NO_CTF > + prmap_t *map; > + int error; > + > + if ((map = proc_name2map(p, name)) == NULL) { > + DPRINTFX("ERROR: couldn't find object %s", object); > + return (NULL); > + } > + > + return (ctf_open(map->pr_mapname, &error)); > +#else > + (void)p; > + (void)name; > + return (NULL); > +#endif > +} > + > int > proc_iter_symbyaddr(struct proc_handle *p, const char *object, int which, > int mask, proc_sym_f *func, void *cd) > > Modified: head/lib/libproc/tests/proc_test.c > ============================================================================== > --- head/lib/libproc/tests/proc_test.c Fri Oct 3 21:46:07 2014 (r272487) > +++ head/lib/libproc/tests/proc_test.c Fri Oct 3 23:20:37 2014 (r272488) > @@ -227,6 +227,7 @@ ATF_TC_HEAD(map_alias_name2sym, tc) > ATF_TC_BODY(map_alias_name2sym, tc) > { > GElf_Sym sym1, sym2; > + prsyminfo_t si1, si2; > struct proc_handle *phdl; > int error; > > @@ -239,14 +240,15 @@ ATF_TC_BODY(map_alias_name2sym, tc) > * Make sure that "target_prog:main" and "a.out:main" return the same > * symbol. > */ > - error = proc_name2sym(phdl, target_prog_file, "main", &sym1); > + error = proc_name2sym(phdl, target_prog_file, "main", &sym1, &si1); > ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'main' via %s", > target_prog_file); > - error = proc_name2sym(phdl, aout_object, "main", &sym2); > + error = proc_name2sym(phdl, aout_object, "main", &sym2, &si2); > ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'main' via %s", > aout_object); > > ATF_CHECK_EQ(memcmp(&sym1, &sym2, sizeof(sym1)), 0); > + ATF_CHECK_EQ(si1.prs_id, si2.prs_id); > > ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution"); > > @@ -271,11 +273,11 @@ ATF_TC_BODY(symbol_lookup, tc) > > phdl = start_prog(tc, false); > > - error = proc_name2sym(phdl, target_prog_file, "main", &main_sym); > + error = proc_name2sym(phdl, target_prog_file, "main", &main_sym, NULL); > ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'main'"); > > error = proc_name2sym(phdl, ldelf_object, "r_debug_state", > - &r_debug_state_sym); > + &r_debug_state_sym, NULL); > ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'r_debug_state'"); > > set_bkpt(phdl, r_debug_state_sym.st_value, &saved); > > Modified: head/lib/librtld_db/rtld_db.c > ============================================================================== > --- head/lib/librtld_db/rtld_db.c Fri Oct 3 21:46:07 2014 (r272487) > +++ head/lib/librtld_db/rtld_db.c Fri Oct 3 23:20:37 2014 (r272488) > @@ -237,14 +237,14 @@ rd_reset(rd_agent_t *rdap) > GElf_Sym sym; > > if (proc_name2sym(rdap->rda_php, "ld-elf.so.1", "r_debug_state", > - &sym) < 0) > + &sym, NULL) < 0) > return (RD_ERR); > DPRINTF("found r_debug_state at 0x%lx\n", (unsigned long)sym.st_value); > rdap->rda_preinit_addr = sym.st_value; > rdap->rda_dlactivity_addr = sym.st_value; > > if (proc_name2sym(rdap->rda_php, "ld-elf.so.1", "_r_debug_postinit", > - &sym) < 0) > + &sym, NULL) < 0) > return (RD_ERR); > DPRINTF("found _r_debug_postinit at 0x%lx\n", > (unsigned long)sym.st_value); > > From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 02:34:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC0208F4; Sat, 4 Oct 2014 02:34:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98976E39; Sat, 4 Oct 2014 02:34: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 s942YVxb044246; Sat, 4 Oct 2014 02:34:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s942YVR1044244; Sat, 4 Oct 2014 02:34:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201410040234.s942YVR1044244@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 4 Oct 2014 02:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272489 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 02:34:31 -0000 Author: markj Date: Sat Oct 4 02:34:30 2014 New Revision: 272489 URL: https://svnweb.freebsd.org/changeset/base/272489 Log: Remove an incorrect and useless debug print. X-MFC-With: r272488 Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Fri Oct 3 23:20:37 2014 (r272488) +++ head/lib/libproc/proc_sym.c Sat Oct 4 02:34:30 2014 (r272489) @@ -504,10 +504,8 @@ proc_name2ctf(struct proc_handle *p, con prmap_t *map; int error; - if ((map = proc_name2map(p, name)) == NULL) { - DPRINTFX("ERROR: couldn't find object %s", object); + if ((map = proc_name2map(p, name)) == NULL) return (NULL); - } return (ctf_open(map->pr_mapname, &error)); #else From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 05:01:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8451CA89; Sat, 4 Oct 2014 05:01:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70E5CE59; Sat, 4 Oct 2014 05:01: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 s9451wvO014440; Sat, 4 Oct 2014 05:01:58 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9451wJF014439; Sat, 4 Oct 2014 05:01:58 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201410040501.s9451wJF014439@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sat, 4 Oct 2014 05:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272490 - 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: Sat, 04 Oct 2014 05:01:58 -0000 Author: nyan Date: Sat Oct 4 05:01:57 2014 New Revision: 272490 URL: https://svnweb.freebsd.org/changeset/base/272490 Log: - MFi386: Add compile-with option for tau32-ddk.c. - Whitespace change. - Remove duplicate line. Modified: head/sys/conf/files.pc98 Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Sat Oct 4 02:34:30 2014 (r272489) +++ head/sys/conf/files.pc98 Sat Oct 4 05:01:57 2014 (r272490) @@ -89,7 +89,8 @@ dev/agp/agp_via.c optional agp dev/aic/aic_cbus.c optional aic isa dev/ce/ceddk.c optional ce dev/ce/if_ce.c optional ce -dev/ce/tau32-ddk.c optional ce +dev/ce/tau32-ddk.c optional ce \ + compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}" dev/cp/cpddk.c optional cp dev/cp/if_cp.c optional cp dev/ct/bshw_machdep.c optional ct @@ -241,7 +242,7 @@ pc98/pc98/pc98_machdep.c standard # # x86 shared code between IA32, AMD64 and PC98 architectures # -x86/isa/atpic.c optional atpic +x86/isa/atpic.c optional atpic x86/isa/clock.c standard x86/isa/isa.c optional isa x86/pci/pci_bus.c optional pci @@ -259,5 +260,4 @@ x86/x86/mptable_pci.c optional apic pci x86/x86/msi.c optional apic pci x86/x86/nexus.c standard x86/x86/tsc.c standard -x86/x86/tsc.c standard x86/x86/delay.c standard From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 05:03:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8621CC63; Sat, 4 Oct 2014 05:03:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73230E6F; Sat, 4 Oct 2014 05:03: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 s9453eCR014676; Sat, 4 Oct 2014 05:03:40 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9453ewp014675; Sat, 4 Oct 2014 05:03:40 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201410040503.s9453ewp014675@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sat, 4 Oct 2014 05:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272491 - 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: Sat, 04 Oct 2014 05:03:40 -0000 Author: nyan Date: Sat Oct 4 05:03:39 2014 New Revision: 272491 URL: https://svnweb.freebsd.org/changeset/base/272491 Log: Reduce diffs against i386. Modified: head/sys/conf/options.pc98 Modified: head/sys/conf/options.pc98 ============================================================================== --- head/sys/conf/options.pc98 Sat Oct 4 05:01:57 2014 (r272490) +++ head/sys/conf/options.pc98 Sat Oct 4 05:03:39 2014 (r272491) @@ -31,12 +31,6 @@ KVA_PAGES opt_global.h TIMER_FREQ opt_clock.h -# options for serial support -COM_ESP opt_sio.h -COM_MULTIPORT opt_sio.h -CONSPEED opt_sio.h -GDBSPEED opt_sio.h - CPU_BLUELIGHTNING_3X opt_cpu.h CPU_BLUELIGHTNING_FPU_OP_CACHE opt_cpu.h CPU_BTB_EN opt_cpu.h @@ -67,8 +61,17 @@ I486_CPU opt_global.h I586_CPU opt_global.h I686_CPU opt_global.h +# options for serial support +COM_ESP opt_sio.h +COM_MULTIPORT opt_sio.h +CONSPEED opt_sio.h +GDBSPEED opt_sio.h + GDC +# AGP debugging support +AGP_DEBUG opt_agp.h + # Video spigot SPIGOT_UNSECURE opt_spigot.h @@ -96,7 +99,6 @@ DEV_NPX opt_npx.h # Debugging NPX_DEBUG opt_npx.h -AGP_DEBUG opt_agp.h # BPF just-in-time compiler BPF_JITTER opt_bpf.h From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 06:01:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8FC67EB; Sat, 4 Oct 2014 06:01:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A99AF3E0; Sat, 4 Oct 2014 06:01: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 s9461VNv041361; Sat, 4 Oct 2014 06:01:31 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9461Vxk041359; Sat, 4 Oct 2014 06:01:31 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201410040601.s9461Vxk041359@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sat, 4 Oct 2014 06:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272492 - in head/sys: conf i386/i386 pc98/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 04 Oct 2014 06:01:31 -0000 Author: nyan Date: Sat Oct 4 06:01:30 2014 New Revision: 272492 URL: https://svnweb.freebsd.org/changeset/base/272492 Log: Merge pc98's machdep.c into i386/i386/machdep.c. Deleted: head/sys/pc98/pc98/machdep.c Modified: head/sys/conf/files.pc98 head/sys/i386/i386/machdep.c Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Sat Oct 4 05:03:39 2014 (r272491) +++ head/sys/conf/files.pc98 Sat Oct 4 06:01:30 2014 (r272492) @@ -149,6 +149,7 @@ i386/i386/initcpu.c standard i386/i386/io.c optional io i386/i386/k6_mem.c optional mem i386/i386/locore.s standard no-obj +i386/i386/machdep.c standard i386/i386/mem.c optional mem i386/i386/minidump_machdep.c standard i386/i386/mp_clock.c optional smp @@ -237,7 +238,6 @@ pc98/pc98/busiosubr.c standard pc98/pc98/canbepm.c optional canbepm pc98/pc98/canbus.c optional canbus pc98/pc98/canbus_if.m optional canbus -pc98/pc98/machdep.c standard pc98/pc98/pc98_machdep.c standard # # x86 shared code between IA32, AMD64 and PC98 architectures Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sat Oct 4 05:03:39 2014 (r272491) +++ head/sys/i386/i386/machdep.c Sat Oct 4 06:01:30 2014 (r272492) @@ -109,7 +109,11 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef PC98 +#include +#else #include +#endif #include @@ -204,6 +208,14 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, int _udatasel, _ucodesel; u_int basemem; +#ifdef PC98 +int need_pre_dma_flush; /* If 1, use wbinvd befor DMA transfer. */ +int need_post_dma_flush; /* If 1, use invd after DMA transfer. */ + +static int ispc98 = 1; +SYSCTL_INT(_machdep, OID_AUTO, ispc98, CTLFLAG_RD, &ispc98, 0, ""); +#endif + int cold = 1; #ifdef COMPAT_43 @@ -259,7 +271,8 @@ cpu_startup(dummy) { uintmax_t memsize; char *sysenv; - + +#ifndef PC98 /* * On MacBooks, we need to disallow the legacy USB circuit to * generate an SMI# because this can cause several problems, @@ -285,6 +298,7 @@ cpu_startup(dummy) } freeenv(sysenv); } +#endif /* !PC98 */ /* * Good {morning,afternoon,evening,night}. @@ -1235,6 +1249,7 @@ SYSCTL_INT(_machdep, OID_AUTO, idle_mwai #define STATE_MWAIT 0x1 #define STATE_SLEEPING 0x2 +#ifndef PC98 static void cpu_idle_acpi(sbintime_t sbt) { @@ -1253,6 +1268,7 @@ cpu_idle_acpi(sbintime_t sbt) __asm __volatile("sti; hlt"); *state = STATE_RUNNING; } +#endif /* !PC98 */ #ifndef XEN static void @@ -1370,7 +1386,7 @@ cpu_probe_amdc1e(void) } } -#ifdef XEN +#if defined(PC98) || defined(XEN) void (*cpu_idle_fn)(sbintime_t) = cpu_idle_hlt; #else void (*cpu_idle_fn)(sbintime_t) = cpu_idle_acpi; @@ -1458,7 +1474,9 @@ struct { { cpu_idle_spin, "spin" }, { cpu_idle_mwait, "mwait" }, { cpu_idle_hlt, "hlt" }, +#ifndef PC98 { cpu_idle_acpi, "acpi" }, +#endif { NULL, NULL } }; @@ -1475,9 +1493,11 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG if (strstr(idle_tbl[i].id_name, "mwait") && (cpu_feature2 & CPUID2_MON) == 0) continue; +#ifndef PC98 if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && cpu_idle_hook == NULL) continue; +#endif p += sprintf(p, "%s%s", p != avail ? ", " : "", idle_tbl[i].id_name); } @@ -1512,9 +1532,11 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) if (strstr(idle_tbl[i].id_name, "mwait") && (cpu_feature2 & CPUID2_MON) == 0) continue; +#ifndef PC98 if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && cpu_idle_hook == NULL) continue; +#endif if (strcmp(idle_tbl[i].id_name, buf)) continue; cpu_idle_fn = idle_tbl[i].id_fn; @@ -2000,7 +2022,7 @@ sdtossd(sd, ssd) ssd->ssd_gran = sd->sd_gran; } -#ifndef XEN +#if !defined(PC98) && !defined(XEN) static int add_physmap_entry(uint64_t base, uint64_t length, vm_paddr_t *physmap, int *physmap_idxp) @@ -2107,7 +2129,9 @@ add_smap_entries(struct bios_smap *smapb if (!add_smap_entry(smap, physmap, physmap_idxp)) break; } +#endif /* !PC98 && !XEN */ +#ifndef XEN static void basemem_setup(void) { @@ -2155,7 +2179,7 @@ basemem_setup(void) for (i = basemem / 4; i < 160; i++) pte[i] = (i << PAGE_SHIFT) | PG_V | PG_RW | PG_U; } -#endif +#endif /* !XEN */ /* * Populate the (physmap) array with base/bound pairs describing the @@ -2170,6 +2194,271 @@ basemem_setup(void) * * XXX first should be vm_paddr_t. */ +#ifdef PC98 +static void +getmemsize(int first) +{ + int off, physmap_idx, pa_indx, da_indx; + u_long physmem_tunable, memtest; + vm_paddr_t physmap[PHYSMAP_SIZE]; + pt_entry_t *pte; + quad_t dcons_addr, dcons_size; + int i; + int pg_n; + u_int extmem; + u_int under16; + vm_paddr_t pa; + + bzero(physmap, sizeof(physmap)); + + /* XXX - some of EPSON machines can't use PG_N */ + pg_n = PG_N; + if (pc98_machine_type & M_EPSON_PC98) { + switch (epson_machine_id) { +#ifdef WB_CACHE + default: +#endif + case EPSON_PC486_HX: + case EPSON_PC486_HG: + case EPSON_PC486_HA: + pg_n = 0; + break; + } + } + + under16 = pc98_getmemsize(&basemem, &extmem); + basemem_setup(); + + physmap[0] = 0; + physmap[1] = basemem * 1024; + physmap_idx = 2; + physmap[physmap_idx] = 0x100000; + physmap[physmap_idx + 1] = physmap[physmap_idx] + extmem * 1024; + + /* + * Now, physmap contains a map of physical memory. + */ + +#ifdef SMP + /* make hole for AP bootstrap code */ + physmap[1] = mp_bootaddress(physmap[1]); +#endif + + /* + * Maxmem isn't the "maximum memory", it's one larger than the + * highest page of the physical address space. It should be + * called something like "Maxphyspage". We may adjust this + * based on ``hw.physmem'' and the results of the memory test. + */ + Maxmem = atop(physmap[physmap_idx + 1]); + +#ifdef MAXMEM + Maxmem = MAXMEM / 4; +#endif + + if (TUNABLE_ULONG_FETCH("hw.physmem", &physmem_tunable)) + Maxmem = atop(physmem_tunable); + + /* + * By default keep the memtest enabled. Use a general name so that + * one could eventually do more with the code than just disable it. + */ + memtest = 1; + TUNABLE_ULONG_FETCH("hw.memtest.tests", &memtest); + + if (atop(physmap[physmap_idx + 1]) != Maxmem && + (boothowto & RB_VERBOSE)) + printf("Physical memory use set to %ldK\n", Maxmem * 4); + + /* + * If Maxmem has been increased beyond what the system has detected, + * extend the last memory segment to the new limit. + */ + if (atop(physmap[physmap_idx + 1]) < Maxmem) + physmap[physmap_idx + 1] = ptoa((vm_paddr_t)Maxmem); + + /* + * We need to divide chunk if Maxmem is larger than 16MB and + * under 16MB area is not full of memory. + * (1) system area (15-16MB region) is cut off + * (2) extended memory is only over 16MB area (ex. Melco "HYPERMEMORY") + */ + if ((under16 != 16 * 1024) && (extmem > 15 * 1024)) { + /* 15M - 16M region is cut off, so need to divide chunk */ + physmap[physmap_idx + 1] = under16 * 1024; + physmap_idx += 2; + physmap[physmap_idx] = 0x1000000; + physmap[physmap_idx + 1] = physmap[2] + extmem * 1024; + } + + /* call pmap initialization to make new kernel address space */ + pmap_bootstrap(first); + + /* + * Size up each available chunk of physical memory. + */ + physmap[0] = PAGE_SIZE; /* mask off page 0 */ + pa_indx = 0; + da_indx = 1; + phys_avail[pa_indx++] = physmap[0]; + phys_avail[pa_indx] = physmap[0]; + dump_avail[da_indx] = physmap[0]; + pte = CMAP3; + + /* + * Get dcons buffer address + */ + if (getenv_quad("dcons.addr", &dcons_addr) == 0 || + getenv_quad("dcons.size", &dcons_size) == 0) + dcons_addr = 0; + + /* + * physmap is in bytes, so when converting to page boundaries, + * round up the start address and round down the end address. + */ + for (i = 0; i <= physmap_idx; i += 2) { + vm_paddr_t end; + + end = ptoa((vm_paddr_t)Maxmem); + if (physmap[i + 1] < end) + end = trunc_page(physmap[i + 1]); + for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) { + int tmp, page_bad, full; + int *ptr = (int *)CADDR3; + + full = FALSE; + /* + * block out kernel memory as not available. + */ + if (pa >= KERNLOAD && pa < first) + goto do_dump_avail; + + /* + * block out dcons buffer + */ + if (dcons_addr > 0 + && pa >= trunc_page(dcons_addr) + && pa < dcons_addr + dcons_size) + goto do_dump_avail; + + page_bad = FALSE; + if (memtest == 0) + goto skip_memtest; + + /* + * map page into kernel: valid, read/write,non-cacheable + */ + *pte = pa | PG_V | PG_RW | pg_n; + invltlb(); + + tmp = *(int *)ptr; + /* + * Test for alternating 1's and 0's + */ + *(volatile int *)ptr = 0xaaaaaaaa; + if (*(volatile int *)ptr != 0xaaaaaaaa) + page_bad = TRUE; + /* + * Test for alternating 0's and 1's + */ + *(volatile int *)ptr = 0x55555555; + if (*(volatile int *)ptr != 0x55555555) + page_bad = TRUE; + /* + * Test for all 1's + */ + *(volatile int *)ptr = 0xffffffff; + if (*(volatile int *)ptr != 0xffffffff) + page_bad = TRUE; + /* + * Test for all 0's + */ + *(volatile int *)ptr = 0x0; + if (*(volatile int *)ptr != 0x0) + page_bad = TRUE; + /* + * Restore original value. + */ + *(int *)ptr = tmp; + +skip_memtest: + /* + * Adjust array of valid/good pages. + */ + if (page_bad == TRUE) + continue; + /* + * If this good page is a continuation of the + * previous set of good pages, then just increase + * the end pointer. Otherwise start a new chunk. + * Note that "end" points one higher than end, + * making the range >= start and < end. + * If we're also doing a speculative memory + * test and we at or past the end, bump up Maxmem + * so that we keep going. The first bad page + * will terminate the loop. + */ + if (phys_avail[pa_indx] == pa) { + phys_avail[pa_indx] += PAGE_SIZE; + } else { + pa_indx++; + if (pa_indx == PHYS_AVAIL_ARRAY_END) { + printf( + "Too many holes in the physical address space, giving up\n"); + pa_indx--; + full = TRUE; + goto do_dump_avail; + } + phys_avail[pa_indx++] = pa; /* start */ + phys_avail[pa_indx] = pa + PAGE_SIZE; /* end */ + } + physmem++; +do_dump_avail: + if (dump_avail[da_indx] == pa) { + dump_avail[da_indx] += PAGE_SIZE; + } else { + da_indx++; + if (da_indx == DUMP_AVAIL_ARRAY_END) { + da_indx--; + goto do_next; + } + dump_avail[da_indx++] = pa; /* start */ + dump_avail[da_indx] = pa + PAGE_SIZE; /* end */ + } +do_next: + if (full) + break; + } + } + *pte = 0; + invltlb(); + + /* + * XXX + * The last chunk must contain at least one page plus the message + * buffer to avoid complicating other code (message buffer address + * calculation, etc.). + */ + while (phys_avail[pa_indx - 1] + PAGE_SIZE + + round_page(msgbufsize) >= phys_avail[pa_indx]) { + physmem -= atop(phys_avail[pa_indx] - phys_avail[pa_indx - 1]); + phys_avail[pa_indx--] = 0; + phys_avail[pa_indx--] = 0; + } + + Maxmem = atop(phys_avail[pa_indx]); + + /* Trim off space for the message buffer. */ + phys_avail[pa_indx] -= round_page(msgbufsize); + + /* Map the message buffer. */ + for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) + pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + + off); + + PT_UPDATES_FLUSH(); +} +#else /* PC98 */ static void getmemsize(int first) { @@ -2567,6 +2856,7 @@ do_next: PT_UPDATES_FLUSH(); } +#endif /* PC98 */ #ifdef XEN #define MTOPSIZE (1<<(14 + PAGE_SHIFT)) @@ -2830,6 +3120,13 @@ init386(first) */ proc_linkup0(&proc0, &thread0); +#ifdef PC98 + /* + * Initialize DMAC + */ + pc98_init_dmac(); +#endif + metadata_missing = 0; if (bootinfo.bi_modulep) { preload_metadata = (caddr_t)bootinfo.bi_modulep + KERNBASE; @@ -2993,7 +3290,9 @@ init386(first) #ifdef DEV_ISA #ifdef DEV_ATPIC +#ifndef PC98 elcr_probe(); +#endif atpic_startup(); #else /* Reset and mask the atpics and leave them shut down. */ @@ -3027,6 +3326,9 @@ init386(first) setidt(IDT_GP, &IDTVEC(prot), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); initializecpu(); /* Initialize CPU registers */ +#ifdef PC98 + initializecpucache(); +#endif /* make an initial tss so cpu can get interrupt stack on syscall! */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ @@ -3114,6 +3416,7 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu pcpu->pc_acpi_id = 0xffffffff; } +#ifndef PC98 static int smap_sysctl_handler(SYSCTL_HANDLER_ARGS) { @@ -3149,6 +3452,7 @@ smap_sysctl_handler(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_machdep, OID_AUTO, smap, CTLTYPE_OPAQUE|CTLFLAG_RD, NULL, 0, smap_sysctl_handler, "S,bios_smap_xattr", "Raw BIOS SMAP data"); +#endif /* !PC98 */ void spinlock_enter(void) From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 07:56:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1B862DC; Sat, 4 Oct 2014 07: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 9C9ADF6C; Sat, 4 Oct 2014 07: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 s947upGO093985; Sat, 4 Oct 2014 07:56:51 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s947upS2093983; Sat, 4 Oct 2014 07:56:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410040756.s947upS2093983@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 4 Oct 2014 07:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272502 - in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 07:56:51 -0000 Author: delphij Date: Sat Oct 4 07:56:50 2014 New Revision: 272502 URL: https://svnweb.freebsd.org/changeset/base/272502 Log: MFV r272493: Show individual disk capacity when doing zpool list -v. Illumos issue: 5147 zpool list -v should show individual disk capacity MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Oct 4 07:50:06 2014 (r272501) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Oct 4 07:56:50 2014 (r272502) @@ -2857,10 +2857,7 @@ print_pool(zpool_handle_t *zhp, list_cbd right_justify = B_FALSE; if (pl->pl_prop != ZPROP_INVAL) { - if (pl->pl_prop == ZPOOL_PROP_EXPANDSZ && - zpool_get_prop_int(zhp, pl->pl_prop, NULL) == 0) - propstr = "-"; - else if (zpool_get_prop(zhp, pl->pl_prop, property, + if (zpool_get_prop(zhp, pl->pl_prop, property, sizeof (property), NULL, cb->cb_literal) != 0) propstr = "-"; else @@ -2894,21 +2891,37 @@ print_pool(zpool_handle_t *zhp, list_cbd } static void -print_one_column(zpool_prop_t prop, uint64_t value, boolean_t scripted) +print_one_column(zpool_prop_t prop, uint64_t value, boolean_t scripted, + boolean_t valid) { char propval[64]; boolean_t fixed; size_t width = zprop_width(prop, &fixed, ZFS_TYPE_POOL); - - if (prop == ZPOOL_PROP_EXPANDSZ && value == 0) - (void) strlcpy(propval, "-", sizeof (propval)); - else if (prop == ZPOOL_PROP_FRAGMENTATION && value == ZFS_FRAG_INVALID) - (void) strlcpy(propval, "-", sizeof (propval)); - else if (prop == ZPOOL_PROP_FRAGMENTATION) + switch (prop) { + case ZPOOL_PROP_EXPANDSZ: + if (value == 0) + (void) strlcpy(propval, "-", sizeof (propval)); + else + zfs_nicenum(value, propval, sizeof (propval)); + break; + case ZPOOL_PROP_FRAGMENTATION: + if (value == ZFS_FRAG_INVALID) { + (void) strlcpy(propval, "-", sizeof (propval)); + } else { + (void) snprintf(propval, sizeof (propval), "%llu%%", + value); + } + break; + case ZPOOL_PROP_CAPACITY: (void) snprintf(propval, sizeof (propval), "%llu%%", value); - else + break; + default: zfs_nicenum(value, propval, sizeof (propval)); + } + + if (!valid) + (void) strlcpy(propval, "-", sizeof (propval)); if (scripted) (void) printf("\t%s", propval); @@ -2930,6 +2943,9 @@ print_list_stats(zpool_handle_t *zhp, co (uint64_t **)&vs, &c) == 0); if (name != NULL) { + boolean_t toplevel = (vs->vs_space != 0); + uint64_t cap; + if (scripted) (void) printf("\t%s", name); else if (strlen(name) + depth > cb->cb_namewidth) @@ -2938,24 +2954,26 @@ print_list_stats(zpool_handle_t *zhp, co (void) printf("%*s%s%*s", depth, "", name, (int)(cb->cb_namewidth - strlen(name) - depth), ""); - /* only toplevel vdevs have capacity stats */ - if (vs->vs_space == 0) { - if (scripted) - (void) printf("\t-\t-\t-\t-"); - else - (void) printf(" - - - -"); - } else { - print_one_column(ZPOOL_PROP_SIZE, vs->vs_space, - scripted); - print_one_column(ZPOOL_PROP_CAPACITY, vs->vs_alloc, - scripted); - print_one_column(ZPOOL_PROP_FREE, - vs->vs_space - vs->vs_alloc, scripted); - print_one_column(ZPOOL_PROP_FRAGMENTATION, - vs->vs_fragmentation, scripted); - } - print_one_column(ZPOOL_PROP_EXPANDSZ, vs->vs_esize, - scripted); + /* + * Print the properties for the individual vdevs. Some + * properties are only applicable to toplevel vdevs. The + * 'toplevel' boolean value is passed to the print_one_column() + * to indicate that the value is valid. + */ + print_one_column(ZPOOL_PROP_SIZE, vs->vs_space, scripted, + toplevel); + print_one_column(ZPOOL_PROP_ALLOCATED, vs->vs_alloc, scripted, + toplevel); + print_one_column(ZPOOL_PROP_FREE, vs->vs_space - vs->vs_alloc, + scripted, toplevel); + print_one_column(ZPOOL_PROP_EXPANDSZ, vs->vs_esize, scripted, + B_TRUE); + print_one_column(ZPOOL_PROP_FRAGMENTATION, + vs->vs_fragmentation, scripted, + (vs->vs_fragmentation != ZFS_FRAG_INVALID && toplevel)); + cap = (vs->vs_space == 0) ? 0 : + (vs->vs_alloc * 100 / vs->vs_space); + print_one_column(ZPOOL_PROP_CAPACITY, cap, scripted, toplevel); (void) printf("\n"); } @@ -3024,7 +3042,8 @@ list_callback(zpool_handle_t *zhp, void * -H Scripted mode. Don't display headers, and separate properties * by a single tab. * -o List of properties to display. Defaults to - * "name,size,allocated,free,capacity,health,altroot" + * "name,size,allocated,free,expandsize,fragmentation,capacity," + * "dedupratio,health,altroot" * -p Diplay values in parsable (exact) format. * -T Display a timestamp in date(1) or Unix format * @@ -3038,7 +3057,7 @@ zpool_do_list(int argc, char **argv) int ret; list_cbdata_t cb = { 0 }; static char default_props[] = - "name,size,allocated,free,fragmentation,expandsize,capacity," + "name,size,allocated,free,expandsize,fragmentation,capacity," "dedupratio,health,altroot"; char *props = default_props; unsigned long interval = 0, count = 0; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Sat Oct 4 07:50:06 2014 (r272501) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Sat Oct 4 07:56:50 2014 (r272502) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -304,7 +304,6 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo case ZPOOL_PROP_FREE: case ZPOOL_PROP_FREEING: case ZPOOL_PROP_LEAKED: - case ZPOOL_PROP_EXPANDSZ: if (literal) { (void) snprintf(buf, len, "%llu", (u_longlong_t)intval); @@ -312,7 +311,16 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo (void) zfs_nicenum(intval, buf, len); } break; - + case ZPOOL_PROP_EXPANDSZ: + if (intval == 0) { + (void) strlcpy(buf, "-", len); + } else if (literal) { + (void) snprintf(buf, len, "%llu", + (u_longlong_t)intval); + } else { + (void) zfs_nicenum(intval, buf, len); + } + break; case ZPOOL_PROP_CAPACITY: if (literal) { (void) snprintf(buf, len, "%llu", @@ -330,13 +338,11 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo (u_longlong_t)intval); } break; - case ZPOOL_PROP_DEDUPRATIO: (void) snprintf(buf, len, "%llu.%02llux", (u_longlong_t)(intval / 100), (u_longlong_t)(intval % 100)); break; - case ZPOOL_PROP_HEALTH: verify(nvlist_lookup_nvlist(zpool_get_config(zhp, NULL), ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0); From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 08:03:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 926716A8; Sat, 4 Oct 2014 08:03: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 7EC70CA; Sat, 4 Oct 2014 08:03: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 s9483r1B098389; Sat, 4 Oct 2014 08:03:53 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9483rJH098388; Sat, 4 Oct 2014 08:03:53 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410040803.s9483rJH098388@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 4 Oct 2014 08:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272503 - 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: Sat, 04 Oct 2014 08:03:53 -0000 Author: mjg Date: Sat Oct 4 08:03:52 2014 New Revision: 272503 URL: https://svnweb.freebsd.org/changeset/base/272503 Log: Add sequence counters with memory barriers. Current implementation is somewhat simplistic and hackish, will be improved later after possible memory barrier overhaul. Reviewed by: kib MFC after: 3 weeks Added: head/sys/sys/seq.h (contents, props changed) Added: head/sys/sys/seq.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/seq.h Sat Oct 4 08:03:52 2014 (r272503) @@ -0,0 +1,139 @@ +/*- + * Copyright (c) 2014 Mateusz Guzik + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_SEQ_H_ +#define _SYS_SEQ_H_ + +#ifdef _KERNEL + +/* + * Typical usage: + * + * writers: + * lock_exclusive(&obj->lock); + * seq_write_begin(&obj->seq); + * ..... + * seq_write_end(&obj->seq); + * unlock_exclusive(&obj->unlock); + * + * readers: + * obj_t lobj; + * seq_t seq; + * + * for (;;) { + * seq = seq_read(&gobj->seq); + * lobj = gobj; + * if (seq_consistent(&gobj->seq, seq)) + * break; + * cpu_spinwait(); + * } + * foo(lobj); + */ + +typedef uint32_t seq_t; + +/* A hack to get MPASS macro */ +#include +#include + +#include + +/* + * This is a temporary hack until memory barriers are cleaned up. + * + * atomic_load_acq_int at least on amd64 provides a full memory barrier, + * in a way which affects perforance. + * + * Hack below covers all architectures and avoids most of the penalty at least + * on amd64. + */ +static __inline int +atomic_load_acq_rmb_int(volatile u_int *p) +{ + volatile u_int v; + + v = *p; + atomic_load_acq_int(&v); + return (v); +} + +static __inline bool +seq_in_modify(seq_t seqp) +{ + + return (seqp & 1); +} + +static __inline void +seq_write_begin(seq_t *seqp) +{ + + MPASS(!seq_in_modify(*seqp)); + atomic_add_acq_int(seqp, 1); +} + +static __inline void +seq_write_end(seq_t *seqp) +{ + + atomic_add_rel_int(seqp, 1); + MPASS(!seq_in_modify(*seqp)); +} + +static __inline seq_t +seq_read(seq_t *seqp) +{ + seq_t ret; + + for (;;) { + ret = atomic_load_acq_rmb_int(seqp); + if (seq_in_modify(ret)) { + cpu_spinwait(); + continue; + } + break; + } + + return (ret); +} + +static __inline seq_t +seq_consistent(seq_t *seqp, seq_t oldseq) +{ + + return (atomic_load_acq_rmb_int(seqp) == oldseq); +} + +static __inline seq_t +seq_consistent_nomb(seq_t *seqp, seq_t oldseq) +{ + + return (*seqp == oldseq); +} + +#endif /* _KERNEL */ +#endif /* _SYS_SEQ_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 08:05:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BADBA8F7; Sat, 4 Oct 2014 08:05:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D6E3E6; Sat, 4 Oct 2014 08:05: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 s9485el0098741; Sat, 4 Oct 2014 08:05:40 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9485dtx098736; Sat, 4 Oct 2014 08:05:39 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410040805.s9485dtx098736@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 4 Oct 2014 08:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272504 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 08:05:40 -0000 Author: delphij Date: Sat Oct 4 08:05:39 2014 New Revision: 272504 URL: https://svnweb.freebsd.org/changeset/base/272504 Log: MFV r272494: Make space_map_truncate() always do space_map_reallocate(). Without this, setting space_map_max_blksz would cause panic for existing pool, as dmu_objset_set_blocksize would fail if the object have multiple blocks. Illumos issues: 5164 space_map_max_blksz causes panic, does not work 5165 zdb fails assertion when run on pool with recently-enabled spacemap_histogram feature MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Oct 4 08:03:52 2014 (r272503) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Oct 4 08:05:39 2014 (r272504) @@ -75,7 +75,7 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_ /* * Condensing a metaslab is not guaranteed to actually reduce the amount of * space used on disk. In particular, a space map uses data in increments of - * MAX(1 << ashift, SPACE_MAP_INITIAL_BLOCKSIZE), so a metaslab might use the + * MAX(1 << ashift, space_map_blksize), so a metaslab might use the * same number of blocks after condensing. Since the goal of condensing is to * reduce the number of IOPs required to read the space map, we only want to * condense when we can be sure we will reduce the number of blocks used by the @@ -1470,10 +1470,12 @@ metaslab_fragmentation(metaslab_t *msp) uint64_t txg = spa_syncing_txg(spa); vdev_t *vd = msp->ms_group->mg_vd; - msp->ms_condense_wanted = B_TRUE; - vdev_dirty(vd, VDD_METASLAB, msp, txg + 1); - spa_dbgmsg(spa, "txg %llu, requesting force condense: " - "msp %p, vd %p", txg, msp, vd); + if (spa_writeable(spa)) { + msp->ms_condense_wanted = B_TRUE; + vdev_dirty(vd, VDD_METASLAB, msp, txg + 1); + spa_dbgmsg(spa, "txg %llu, requesting force condense: " + "msp %p, vd %p", txg, msp, vd); + } return (ZFS_FRAG_INVALID); } @@ -1917,6 +1919,15 @@ metaslab_sync(metaslab_t *msp, uint64_t mutex_enter(&msp->ms_lock); + /* + * Note: metaslab_condense() clears the space_map's histogram. + * Therefore we must verify and remove this histogram before + * condensing. + */ + metaslab_group_histogram_verify(mg); + metaslab_class_histogram_verify(mg->mg_class); + metaslab_group_histogram_remove(mg, msp); + if (msp->ms_loaded && spa_sync_pass(spa) == 1 && metaslab_should_condense(msp)) { metaslab_condense(msp, txg, tx); @@ -1925,9 +1936,6 @@ metaslab_sync(metaslab_t *msp, uint64_t space_map_write(msp->ms_sm, *freetree, SM_FREE, tx); } - metaslab_group_histogram_verify(mg); - metaslab_class_histogram_verify(mg->mg_class); - metaslab_group_histogram_remove(mg, msp); if (msp->ms_loaded) { /* * When the space map is loaded, we have an accruate Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Sat Oct 4 08:03:52 2014 (r272503) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Sat Oct 4 08:05:39 2014 (r272504) @@ -38,15 +38,12 @@ #include /* - * This value controls how the space map's block size is allowed to grow. - * If the value is set to the same size as SPACE_MAP_INITIAL_BLOCKSIZE then - * the space map block size will remain fixed. Setting this value to something - * greater than SPACE_MAP_INITIAL_BLOCKSIZE will allow the space map to - * increase its block size as needed. To maintain backwards compatibilty the - * space map's block size must be a power of 2 and SPACE_MAP_INITIAL_BLOCKSIZE - * or larger. + * The data for a given space map can be kept on blocks of any size. + * Larger blocks entail fewer i/o operations, but they also cause the + * DMU to keep more data in-core, and also to waste more i/o bandwidth + * when only a few blocks have changed since the last transaction group. */ -int space_map_max_blksz = (1 << 12); +int space_map_blksz = (1 << 12); /* * Load the space map disk into the specified range tree. Segments of maptype @@ -233,58 +230,6 @@ space_map_entries(space_map_t *sm, range return (entries); } -void -space_map_set_blocksize(space_map_t *sm, uint64_t size, dmu_tx_t *tx) -{ - uint32_t blksz; - u_longlong_t blocks; - - ASSERT3U(sm->sm_blksz, !=, 0); - ASSERT3U(space_map_object(sm), !=, 0); - ASSERT(sm->sm_dbuf != NULL); - VERIFY(ISP2(space_map_max_blksz)); - - if (sm->sm_blksz >= space_map_max_blksz) - return; - - /* - * The object contains more than one block so we can't adjust - * its size. - */ - if (sm->sm_phys->smp_objsize > sm->sm_blksz) - return; - - if (size > sm->sm_blksz) { - uint64_t newsz; - - /* - * Older software versions treat space map blocks as fixed - * entities. The DMU is capable of handling different block - * sizes making it possible for us to increase the - * block size and maintain backwards compatibility. The - * caveat is that the new block sizes must be a - * power of 2 so that old software can append to the file, - * adding more blocks. The block size can grow until it - * reaches space_map_max_blksz. - */ - newsz = ISP2(size) ? size : 1ULL << highbit64(size); - if (newsz > space_map_max_blksz) - newsz = space_map_max_blksz; - - VERIFY0(dmu_object_set_blocksize(sm->sm_os, - space_map_object(sm), newsz, 0, tx)); - dmu_object_size_from_db(sm->sm_dbuf, &blksz, &blocks); - - zfs_dbgmsg("txg %llu, spa %s, increasing blksz from %d to %d", - dmu_tx_get_txg(tx), spa_name(dmu_objset_spa(sm->sm_os)), - sm->sm_blksz, blksz); - - VERIFY3U(newsz, ==, blksz); - VERIFY3U(sm->sm_blksz, <, blksz); - sm->sm_blksz = blksz; - } -} - /* * Note: space_map_write() will drop sm_lock across dmu_write() calls. */ @@ -298,7 +243,7 @@ space_map_write(space_map_t *sm, range_t range_seg_t *rs; uint64_t size, total, rt_space, nodes; uint64_t *entry, *entry_map, *entry_map_end; - uint64_t newsz, expected_entries, actual_entries = 1; + uint64_t expected_entries, actual_entries = 1; ASSERT(MUTEX_HELD(rt->rt_lock)); ASSERT(dsl_pool_sync_context(dmu_objset_pool(os))); @@ -324,13 +269,6 @@ space_map_write(space_map_t *sm, range_t expected_entries = space_map_entries(sm, rt); - /* - * Calculate the new size for the space map on-disk and see if - * we can grow the block size to accommodate the new size. - */ - newsz = sm->sm_phys->smp_objsize + expected_entries * sizeof (uint64_t); - space_map_set_blocksize(sm, newsz, tx); - entry_map = zio_buf_alloc(sm->sm_blksz); entry_map_end = entry_map + (sm->sm_blksz / sizeof (uint64_t)); entry = entry_map; @@ -457,46 +395,48 @@ space_map_close(space_map_t *sm) kmem_free(sm, sizeof (*sm)); } -static void -space_map_reallocate(space_map_t *sm, dmu_tx_t *tx) -{ - ASSERT(dmu_tx_is_syncing(tx)); - - space_map_free(sm, tx); - dmu_buf_rele(sm->sm_dbuf, sm); - - sm->sm_object = space_map_alloc(sm->sm_os, tx); - VERIFY0(space_map_open_impl(sm)); -} - void space_map_truncate(space_map_t *sm, dmu_tx_t *tx) { objset_t *os = sm->sm_os; spa_t *spa = dmu_objset_spa(os); dmu_object_info_t doi; - int bonuslen; ASSERT(dsl_pool_sync_context(dmu_objset_pool(os))); ASSERT(dmu_tx_is_syncing(tx)); - VERIFY0(dmu_free_range(os, space_map_object(sm), 0, -1ULL, tx)); dmu_object_info_from_db(sm->sm_dbuf, &doi); - if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { - bonuslen = sizeof (space_map_phys_t); - ASSERT3U(bonuslen, <=, dmu_bonus_max()); - } else { - bonuslen = SPACE_MAP_SIZE_V0; - } - - if (bonuslen != doi.doi_bonus_size || - doi.doi_data_block_size != SPACE_MAP_INITIAL_BLOCKSIZE) { + /* + * If the space map has the wrong bonus size (because + * SPA_FEATURE_SPACEMAP_HISTOGRAM has recently been enabled), or + * the wrong block size (because space_map_blksz has changed), + * free and re-allocate its object with the updated sizes. + * + * Otherwise, just truncate the current object. + */ + if ((spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM) && + doi.doi_bonus_size != sizeof (space_map_phys_t)) || + doi.doi_data_block_size != space_map_blksz) { zfs_dbgmsg("txg %llu, spa %s, reallocating: " "old bonus %u, old blocksz %u", dmu_tx_get_txg(tx), spa_name(spa), doi.doi_bonus_size, doi.doi_data_block_size); - space_map_reallocate(sm, tx); - VERIFY3U(sm->sm_blksz, ==, SPACE_MAP_INITIAL_BLOCKSIZE); + + space_map_free(sm, tx); + dmu_buf_rele(sm->sm_dbuf, sm); + + sm->sm_object = space_map_alloc(sm->sm_os, tx); + VERIFY0(space_map_open_impl(sm)); + } else { + VERIFY0(dmu_free_range(os, space_map_object(sm), 0, -1ULL, tx)); + + /* + * If the spacemap is reallocated, its histogram + * will be reset. Do the same in the common case so that + * bugs related to the uncommon case do not go unnoticed. + */ + bzero(sm->sm_phys->smp_histogram, + sizeof (sm->sm_phys->smp_histogram)); } dmu_buf_will_dirty(sm->sm_dbuf, tx); @@ -535,7 +475,7 @@ space_map_alloc(objset_t *os, dmu_tx_t * } object = dmu_object_alloc(os, - DMU_OT_SPACE_MAP, SPACE_MAP_INITIAL_BLOCKSIZE, + DMU_OT_SPACE_MAP, space_map_blksz, DMU_OT_SPACE_MAP_HEADER, bonuslen, tx); return (object); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Sat Oct 4 08:03:52 2014 (r272503) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Sat Oct 4 08:05:39 2014 (r272504) @@ -133,17 +133,6 @@ typedef enum { SM_FREE } maptype_t; -/* - * The data for a given space map can be kept on blocks of any size. - * Larger blocks entail fewer i/o operations, but they also cause the - * DMU to keep more data in-core, and also to waste more i/o bandwidth - * when only a few blocks have changed since the last transaction group. - * Rather than having a fixed block size for all space maps the block size - * can adjust as needed (see space_map_max_blksz). Set the initial block - * size for the space map to 4k. - */ -#define SPACE_MAP_INITIAL_BLOCKSIZE (1ULL << 12) - int space_map_load(space_map_t *sm, range_tree_t *rt, maptype_t maptype); void space_map_histogram_clear(space_map_t *sm); From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 08:08:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58A64A95; Sat, 4 Oct 2014 08:08: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 44BC811E; Sat, 4 Oct 2014 08:08: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 s9488vge099168; Sat, 4 Oct 2014 08:08:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9488uAI099166; Sat, 4 Oct 2014 08:08:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410040808.s9488uAI099166@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 4 Oct 2014 08:08:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272505 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 08:08:57 -0000 Author: mjg Date: Sat Oct 4 08:08:56 2014 New Revision: 272505 URL: https://svnweb.freebsd.org/changeset/base/272505 Log: Plug capability races. fp and appropriate capability lookups were not atomic, which could result in improper capabilities being checked. This could result either in protection bypass or in a spurious ENOTCAPABLE. Make fp + capability check atomic with the help of sequence counters. Reviewed by: kib MFC after: 3 weeks Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Oct 4 08:05:39 2014 (r272504) +++ head/sys/kern/kern_descrip.c Sat Oct 4 08:08:56 2014 (r272505) @@ -288,11 +288,18 @@ _fdfree(struct filedesc *fdp, int fd, in struct filedescent *fde; fde = &fdp->fd_ofiles[fd]; +#ifdef CAPABILITIES + if (!last) + seq_write_begin(&fde->fde_seq); +#endif filecaps_free(&fde->fde_caps); if (last) return; - bzero(fde, sizeof(*fde)); + bzero(fde_change(fde), fde_change_size); fdunused(fdp, fd); +#ifdef CAPABILITIES + seq_write_end(&fde->fde_seq); +#endif } static inline void @@ -883,13 +890,19 @@ do_dup(struct thread *td, int flags, int /* * Duplicate the source descriptor. */ +#ifdef CAPABILITIES + seq_write_begin(&newfde->fde_seq); +#endif filecaps_free(&newfde->fde_caps); - *newfde = *oldfde; + memcpy(fde_change(newfde), fde_change(oldfde), fde_change_size); filecaps_copy(&oldfde->fde_caps, &newfde->fde_caps); if ((flags & DUP_CLOEXEC) != 0) newfde->fde_flags = oldfde->fde_flags | UF_EXCLOSE; else newfde->fde_flags = oldfde->fde_flags & ~UF_EXCLOSE; +#ifdef CAPABILITIES + seq_write_end(&newfde->fde_seq); +#endif *retval = new; if (delfp != NULL) { @@ -1756,6 +1769,9 @@ finstall(struct thread *td, struct file } fhold(fp); fde = &fdp->fd_ofiles[*fd]; +#ifdef CAPABILITIES + seq_write_begin(&fde->fde_seq); +#endif fde->fde_file = fp; if ((flags & O_CLOEXEC) != 0) fde->fde_flags |= UF_EXCLOSE; @@ -1763,6 +1779,9 @@ finstall(struct thread *td, struct file filecaps_move(fcaps, &fde->fde_caps); else filecaps_fill(&fde->fde_caps); +#ifdef CAPABILITIES + seq_write_end(&fde->fde_seq); +#endif FILEDESC_XUNLOCK(fdp); return (0); } @@ -2294,6 +2313,7 @@ fget_unlocked(struct filedesc *fdp, int struct file *fp; u_int count; #ifdef CAPABILITIES + seq_t seq; cap_rights_t haverights; int error; #endif @@ -2314,7 +2334,12 @@ fget_unlocked(struct filedesc *fdp, int */ for (;;) { #ifdef CAPABILITIES + seq = seq_read(fd_seq(fdp, fd)); fde = fdp->fd_ofiles[fd]; + if (!seq_consistent(fd_seq(fdp, fd), seq)) { + cpu_spinwait(); + continue; + } fp = fde.fde_file; #else fp = fdp->fd_ofiles[fd].fde_file; @@ -2343,7 +2368,11 @@ fget_unlocked(struct filedesc *fdp, int */ if (atomic_cmpset_acq_int(&fp->f_count, count, count + 1) != 1) continue; +#ifdef CAPABILITIES + if (seq_consistent_nomb(fd_seq(fdp, fd), seq)) +#else if (fp == fdp->fd_ofiles[fd].fde_file) +#endif break; fdrop(fp, curthread); } @@ -2700,6 +2729,7 @@ int dupfdopen(struct thread *td, struct filedesc *fdp, int dfd, int mode, int openerror, int *indxp) { + struct filedescent *newfde, *oldfde; struct file *fp; int error, indx; @@ -2743,17 +2773,32 @@ dupfdopen(struct thread *td, struct file return (EACCES); } fhold(fp); - fdp->fd_ofiles[indx] = fdp->fd_ofiles[dfd]; - filecaps_copy(&fdp->fd_ofiles[dfd].fde_caps, - &fdp->fd_ofiles[indx].fde_caps); + newfde = &fdp->fd_ofiles[indx]; + oldfde = &fdp->fd_ofiles[dfd]; +#ifdef CAPABILITIES + seq_write_begin(&newfde->fde_seq); +#endif + memcpy(fde_change(newfde), fde_change(oldfde), fde_change_size); + filecaps_copy(&oldfde->fde_caps, &newfde->fde_caps); +#ifdef CAPABILITIES + seq_write_end(&newfde->fde_seq); +#endif break; case ENXIO: /* * Steal away the file pointer from dfd and stuff it into indx. */ - fdp->fd_ofiles[indx] = fdp->fd_ofiles[dfd]; - bzero(&fdp->fd_ofiles[dfd], sizeof(fdp->fd_ofiles[dfd])); + newfde = &fdp->fd_ofiles[indx]; + oldfde = &fdp->fd_ofiles[dfd]; +#ifdef CAPABILITIES + seq_write_begin(&newfde->fde_seq); +#endif + memcpy(fde_change(newfde), fde_change(oldfde), fde_change_size); + bzero(fde_change(oldfde), fde_change_size); fdunused(fdp, dfd); +#ifdef CAPABILITIES + seq_write_end(&newfde->fde_seq); +#endif break; } FILEDESC_XUNLOCK(fdp); Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Sat Oct 4 08:05:39 2014 (r272504) +++ head/sys/sys/filedesc.h Sat Oct 4 08:08:56 2014 (r272505) @@ -33,11 +33,14 @@ #ifndef _SYS_FILEDESC_H_ #define _SYS_FILEDESC_H_ +#include "opt_capsicum.h" + #include #include #include #include #include +#include #include #include @@ -50,6 +53,9 @@ struct filecaps { }; struct filedescent { +#ifdef CAPABILITIES + seq_t fde_seq; /* if you need fde_file and fde_caps in sync */ +#endif struct file *fde_file; /* file structure for open file */ struct filecaps fde_caps; /* per-descriptor rights */ uint8_t fde_flags; /* per-process open file flags */ @@ -58,6 +64,13 @@ struct filedescent { #define fde_fcntls fde_caps.fc_fcntls #define fde_ioctls fde_caps.fc_ioctls #define fde_nioctls fde_caps.fc_nioctls +#ifdef CAPABILITIES +#define fde_change(fde) ((char *)(fde) + sizeof(seq_t)) +#define fde_change_size (sizeof(struct filedescent) - sizeof(seq_t)) +#else +#define fde_change(fde) ((fde)) +#define fde_change_size (sizeof(struct filedescent)) +#endif /* * This structure is used for the management of descriptors. It may be @@ -82,6 +95,9 @@ struct filedesc { int fd_holdleaderscount; /* block fdfree() for shared close() */ int fd_holdleaderswakeup; /* fdfree() needs wakeup */ }; +#ifdef CAPABILITIES +#define fd_seq(fdp, fd) (&(fdp)->fd_ofiles[(fd)].fde_seq) +#endif /* * Structure to keep track of (process leader, struct fildedesc) tuples. From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 08:14:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF15BC9D; Sat, 4 Oct 2014 08:14:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAE781C4; Sat, 4 Oct 2014 08:14: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 s948EBsB003549; Sat, 4 Oct 2014 08:14:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s948EBH0003546; Sat, 4 Oct 2014 08:14:11 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410040814.s948EBH0003546@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 4 Oct 2014 08:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272506 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 08:14:12 -0000 Author: delphij Date: Sat Oct 4 08:14:10 2014 New Revision: 272506 URL: https://svnweb.freebsd.org/changeset/base/272506 Log: MFV r272495: In arc_kmem_reap_now(), reap range_seg_cache too to reclaim memory in response of memory pressure. Illumos issue: 5163 arc should reap range_seg_cache MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Oct 4 08:08:56 2014 (r272505) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Oct 4 08:14:10 2014 (r272506) @@ -2591,6 +2591,7 @@ arc_kmem_reap_now(arc_reclaim_strategy_t size_t i; kmem_cache_t *prev_cache = NULL; kmem_cache_t *prev_data_cache = NULL; + extern kmem_cache_t *range_seg_cache; DTRACE_PROBE(arc__kmem_reap_start); #ifdef _KERNEL @@ -2628,6 +2629,7 @@ arc_kmem_reap_now(arc_reclaim_strategy_t } kmem_cache_reap_now(buf_cache); kmem_cache_reap_now(hdr_cache); + kmem_cache_reap_now(range_seg_cache); #ifdef sun /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Sat Oct 4 08:08:56 2014 (r272505) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Sat Oct 4 08:14:10 2014 (r272506) @@ -33,7 +33,7 @@ #include #include -static kmem_cache_t *range_seg_cache; +kmem_cache_t *range_seg_cache; void range_tree_init(void) From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 08:29:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DEFAF61; Sat, 4 Oct 2014 08:29:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69EC92D8; Sat, 4 Oct 2014 08:29: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 s948Tnp3008985; Sat, 4 Oct 2014 08:29:49 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s948Tnof008984; Sat, 4 Oct 2014 08:29:49 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410040829.s948Tnof008984@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 4 Oct 2014 08:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272507 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 08:29:49 -0000 Author: delphij Date: Sat Oct 4 08:29:48 2014 New Revision: 272507 URL: https://svnweb.freebsd.org/changeset/base/272507 Log: MFV r272496: Add tunable for number of metaslabs per vdev (vfs.zfs.vdev.metaslabs_per_vdev). The default remains at 200. Illumos issue: 5161 add tunable for number of metaslabs per vdev MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sat Oct 4 08:14:10 2014 (r272506) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sat Oct 4 08:29:48 2014 (r272507) @@ -156,6 +156,15 @@ static vdev_ops_t *vdev_ops_table[] = { /* + * When a vdev is added, it will be divided into approximately (but no + * more than) this number of metaslabs. + */ +int metaslabs_per_vdev = 200; +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, metaslabs_per_vdev, CTLFLAG_RDTUN, + &metaslabs_per_vdev, 0, + "When a vdev is added, how many metaslabs the vdev should be divided into"); + +/* * Given a vdev type, return the appropriate ops vector. */ static vdev_ops_t * @@ -1663,9 +1672,9 @@ void vdev_metaslab_set_size(vdev_t *vd) { /* - * Aim for roughly 200 metaslabs per vdev. + * Aim for roughly metaslabs_per_vdev (default 200) metaslabs per vdev. */ - vd->vdev_ms_shift = highbit64(vd->vdev_asize / 200); + vd->vdev_ms_shift = highbit64(vd->vdev_asize / metaslabs_per_vdev); vd->vdev_ms_shift = MAX(vd->vdev_ms_shift, SPA_MAXBLOCKSHIFT); } From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 08:32:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDD6C485; Sat, 4 Oct 2014 08:32: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 C9A09399; Sat, 4 Oct 2014 08:32: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 s948WFpl012784; Sat, 4 Oct 2014 08:32:15 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s948WFCw012783; Sat, 4 Oct 2014 08:32:15 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201410040832.s948WFCw012783@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 4 Oct 2014 08:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272508 - head/tools/tools/ath/athalq X-SVN-Group: head MIME-Version: 1.0 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, 04 Oct 2014 08:32:16 -0000 Author: adrian Date: Sat Oct 4 08:32:15 2014 New Revision: 272508 URL: https://svnweb.freebsd.org/changeset/base/272508 Log: Add in decode for the AR9300 RX descriptor. Modified: head/tools/tools/ath/athalq/ar9300_ds.c Modified: head/tools/tools/ath/athalq/ar9300_ds.c ============================================================================== --- head/tools/tools/ath/athalq/ar9300_ds.c Sat Oct 4 08:29:48 2014 (r272507) +++ head/tools/tools/ath/athalq/ar9300_ds.c Sat Oct 4 08:32:15 2014 (r272508) @@ -317,6 +317,80 @@ ar9300_decode_rxstatus(struct if_ath_alq (unsigned int) be32toh(a->hdr.tstamp_sec), (unsigned int) be32toh(a->hdr.tstamp_usec), (unsigned long long) be64toh(a->hdr.threadid)); + + /* status1 */ + /* .. and status5 */ + printf(" RSSI %d/%d/%d / %d/%d/%d; combined: %d; rate=0x%02x\n", + MS(rxs.status1, AR_rx_rssi_ant00), + MS(rxs.status1, AR_rx_rssi_ant01), + MS(rxs.status1, AR_rx_rssi_ant02), + MS(rxs.status5, AR_rx_rssi_ant10), + MS(rxs.status5, AR_rx_rssi_ant11), + MS(rxs.status5, AR_rx_rssi_ant12), + MS(rxs.status5, AR_rx_rssi_combined), + MS(rxs.status1, AR_rx_rate)); + + /* status2 */ + printf(" Len: %d; more=%d, delim=%d, upload=%d\n", + MS(rxs.status2, AR_data_len), + MF(rxs.status2, AR_rx_more), + MS(rxs.status2, AR_num_delim), + MS(rxs.status2, AR_hw_upload_data)); + + /* status3 */ + printf(" RX timestamp: %d\n", rxs.status3); + + /* status4 */ + printf(" GI: %d, 2040: %d, parallel40: %d, stbc=%d\n", + MF(rxs.status4, AR_gi), + MF(rxs.status4, AR_2040), + MF(rxs.status4, AR_parallel40), + MF(rxs.status4, AR_rx_stbc)); + printf(" Not sounding: %d, ness: %d, upload_valid: %d\n", + MF(rxs.status4, AR_rx_not_sounding), + MS(rxs.status4, AR_rx_ness), + MS(rxs.status4, AR_hw_upload_data_valid)); + printf(" RX antenna: 0x%08x\n", + MS(rxs.status4, AR_rx_antenna)); + + /* EVM */ + /* status6 - 9 */ + printf(" EVM: 0x%08x; 0x%08x; 0x%08x; 0x%08x\n", + rxs.status6, + rxs.status7, + rxs.status8, + rxs.status9); + + /* status10 - ? */ + + /* status11 */ + printf(" RX done: %d, RX frame ok: %d, CRC error: %d\n", + MF(rxs.status11, AR_rx_done), + MF(rxs.status11, AR_rx_frame_ok), + MF(rxs.status11, AR_crc_err)); + printf(" Decrypt CRC err: %d, PHY err: %d, MIC err: %d\n", + MF(rxs.status11, AR_decrypt_crc_err), + MF(rxs.status11, AR_phyerr), + MF(rxs.status11, AR_michael_err)); + printf(" Pre delim CRC err: %d, uAPSD Trig: %d\n", + MF(rxs.status11, AR_pre_delim_crc_err), + MF(rxs.status11, AR_apsd_trig)); + printf(" RXKeyIdxValid: %d, KeyIdx: %d, PHY error: %d\n", + MF(rxs.status11, AR_rx_key_idx_valid), + MS(rxs.status11, AR_key_idx), + MS(rxs.status11, AR_phy_err_code)); + printf(" RX more Aggr: %d, RX aggr %d, post delim CRC err: %d\n", + MF(rxs.status11, AR_rx_more_aggr), + MF(rxs.status11, AR_rx_aggr), + MF(rxs.status11, AR_post_delim_crc_err)); + printf(" hw upload data type: %d; position bit: %d\n", + MS(rxs.status11, AR_hw_upload_data_type), + MF(rxs.status11, AR_position_bit)); + printf(" Hi RX chain: %d, RxFirstAggr: %d, DecryptBusy: %d, KeyMiss: %d\n", + MF(rxs.status11, AR_hi_rx_chain), + MF(rxs.status11, AR_rx_first_aggr), + MF(rxs.status11, AR_decrypt_busy_err), + MF(rxs.status11, AR_key_miss)); } void From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 08:41:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 432F9663; Sat, 4 Oct 2014 08: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 27C6E650; Sat, 4 Oct 2014 08: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 s948fNwm016265; Sat, 4 Oct 2014 08:41:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s948fNVE016264; Sat, 4 Oct 2014 08:41:23 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410040841.s948fNVE016264@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 4 Oct 2014 08:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272509 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 08:41:24 -0000 Author: delphij Date: Sat Oct 4 08:41:23 2014 New Revision: 272509 URL: https://svnweb.freebsd.org/changeset/base/272509 Log: Diff reduction with upstream. The code change is not really applicable to FreeBSD. Illumos issue: 5148 zvol's DKIOCFREE holds zfsdev_state_lock too long MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Oct 4 08:32:15 2014 (r272508) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Oct 4 08:41:23 2014 (r272509) @@ -1983,8 +1983,8 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t */ if (df.df_start >= zv->zv_volsize) break; /* No need to do anything... */ - if (df.df_start + df.df_length > zv->zv_volsize) - df.df_length = DMU_OBJECT_END; + + mutex_exit(&spa_namespace_lock); rl = zfs_range_lock(&zv->zv_znode, df.df_start, df.df_length, RL_WRITER); @@ -2023,7 +2023,7 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t dmu_objset_pool(zv->zv_objset), 0); } } - break; + return (error); } default: From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 08:51:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31A258A2; Sat, 4 Oct 2014 08:51:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DF50767; Sat, 4 Oct 2014 08:51: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 s948pvJ4022066; Sat, 4 Oct 2014 08:51:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s948pviu022065; Sat, 4 Oct 2014 08:51:57 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410040851.s948pviu022065@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 4 Oct 2014 08:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272510 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 08:51:58 -0000 Author: delphij Date: Sat Oct 4 08:51:57 2014 New Revision: 272510 URL: https://svnweb.freebsd.org/changeset/base/272510 Log: Add a new sysctl, vfs.zfs.vol.unmap_enabled, which allows the system administrator to toggle whether ZFS should ignore UNMAP requests. Illumos issue: 5149 zvols need a way to ignore DKIOCFREE MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Oct 4 08:41:23 2014 (r272509) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Oct 4 08:51:57 2014 (r272510) @@ -167,6 +167,14 @@ static LIST_HEAD(, zvol_state) all_zvols */ int zvol_maxphys = DMU_MAX_ACCESS/2; +/* + * Toggle unmap functionality. + */ +boolean_t zvol_unmap_enabled = B_TRUE; +SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, unmap_enabled, CTLFLAG_RWTUN, + &zvol_unmap_enabled, 0, + "Enable UNMAP functionality"); + static d_open_t zvol_d_open; static d_close_t zvol_d_close; static d_read_t zvol_read; @@ -1971,6 +1979,9 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t dkioc_free_t df; dmu_tx_t *tx; + if (!zvol_unmap_enabled) + break; + if (ddi_copyin((void *)arg, &df, sizeof (df), flag)) { error = SET_ERROR(EFAULT); break; @@ -2815,6 +2826,9 @@ zvol_d_ioctl(struct cdev *dev, u_long cm zil_commit(zv->zv_zilog, ZVOL_OBJ); break; case DIOCGDELETE: + if (!zvol_unmap_enabled) + break; + offset = ((off_t *)data)[0]; length = ((off_t *)data)[1]; if ((offset % DEV_BSIZE) != 0 || (length % DEV_BSIZE) != 0 || From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 08:55:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AF5EBF2; Sat, 4 Oct 2014 08:55: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 EABD7794; Sat, 4 Oct 2014 08:55: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 s948t8nC022563; Sat, 4 Oct 2014 08:55:08 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s948t84r022562; Sat, 4 Oct 2014 08:55:08 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410040855.s948t84r022562@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 4 Oct 2014 08:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272511 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 08:55:09 -0000 Author: delphij Date: Sat Oct 4 08:55:08 2014 New Revision: 272511 URL: https://svnweb.freebsd.org/changeset/base/272511 Log: MFV r272499: Illumos issue: 5174 add sdt probe for blocked read in dbuf_read() MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Oct 4 08:51:57 2014 (r272510) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Oct 4 08:55:08 2014 (r272511) @@ -671,6 +671,8 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio db->db_state == DB_FILL) { ASSERT(db->db_state == DB_READ || (flags & DB_RF_HAVESTRUCT) == 0); + DTRACE_PROBE2(blocked__read, dmu_buf_impl_t *, + db, zio_t *, zio); cv_wait(&db->db_changed, &db->db_mtx); } if (db->db_state == DB_UNCACHED) From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 09:37:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11ABC367; Sat, 4 Oct 2014 09:37:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2573AFB; Sat, 4 Oct 2014 09:37: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 s949bfBF041351; Sat, 4 Oct 2014 09:37:41 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s949bf0h041348; Sat, 4 Oct 2014 09:37:41 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410040937.s949bf0h041348@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 4 Oct 2014 09:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272512 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 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, 04 Oct 2014 09:37:42 -0000 Author: trasz Date: Sat Oct 4 09:37:40 2014 New Revision: 272512 URL: https://svnweb.freebsd.org/changeset/base/272512 Log: Make autofs use shared vnode locks. Reviewed by: kib MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs.h head/sys/fs/autofs/autofs_vfsops.c head/sys/fs/autofs/autofs_vnops.c Modified: head/sys/fs/autofs/autofs.h ============================================================================== --- head/sys/fs/autofs/autofs.h Sat Oct 4 08:55:08 2014 (r272511) +++ head/sys/fs/autofs/autofs.h Sat Oct 4 09:37:40 2014 (r272512) @@ -138,6 +138,6 @@ int autofs_node_find(struct autofs_node const char *name, int namelen, struct autofs_node **anpp); void autofs_node_delete(struct autofs_node *anp); int autofs_node_vn(struct autofs_node *anp, struct mount *mp, - struct vnode **vpp); + int flags, struct vnode **vpp); #endif /* !AUTOFS_H */ Modified: head/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- head/sys/fs/autofs/autofs_vfsops.c Sat Oct 4 08:55:08 2014 (r272511) +++ head/sys/fs/autofs/autofs_vfsops.c Sat Oct 4 09:37:40 2014 (r272512) @@ -88,6 +88,10 @@ autofs_mount(struct mount *mp) vfs_getnewfsid(mp); + MNT_ILOCK(mp); + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; + MNT_IUNLOCK(mp); + AUTOFS_XLOCK(amp); error = autofs_node_new(NULL, amp, ".", -1, &->am_root); if (error != 0) { @@ -177,7 +181,7 @@ autofs_root(struct mount *mp, int flags, amp = VFSTOAUTOFS(mp); - error = autofs_node_vn(amp->am_root, mp, vpp); + error = autofs_node_vn(amp->am_root, mp, flags, vpp); return (error); } Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Sat Oct 4 08:55:08 2014 (r272511) +++ head/sys/fs/autofs/autofs_vnops.c Sat Oct 4 09:37:40 2014 (r272512) @@ -198,12 +198,12 @@ mounted: } static int -autofs_vget_callback(struct mount *mp, void *arg, int lkflags __unused, +autofs_vget_callback(struct mount *mp, void *arg, int flags, struct vnode **vpp) { - return (autofs_node_vn(arg, mp, vpp)); + return (autofs_node_vn(arg, mp, flags, vpp)); } static int @@ -233,7 +233,7 @@ autofs_lookup(struct vop_lookup_args *ap * use vn_vget_ino_gen() which takes care of all that. */ error = vn_vget_ino_gen(dvp, autofs_vget_callback, - anp->an_parent, 0, vpp); + anp->an_parent, cnp->cn_lkflags, vpp); if (error != 0) { AUTOFS_WARN("vn_vget_ino_gen() failed with error %d", error); @@ -294,7 +294,7 @@ autofs_lookup(struct vop_lookup_args *ap */ AUTOFS_SUNLOCK(amp); - error = autofs_node_vn(child, mp, vpp); + error = autofs_node_vn(child, mp, cnp->cn_lkflags, vpp); if (error != 0) { if ((cnp->cn_flags & ISLASTCN) && cnp->cn_nameiop == CREATE) return (EJUSTRETURN); @@ -334,7 +334,7 @@ autofs_mkdir(struct vop_mkdir_args *ap) } AUTOFS_XUNLOCK(amp); - error = autofs_node_vn(child, vp->v_mount, ap->a_vpp); + error = autofs_node_vn(child, vp->v_mount, LK_EXCLUSIVE, ap->a_vpp); return (error); } @@ -581,7 +581,8 @@ autofs_node_delete(struct autofs_node *a } int -autofs_node_vn(struct autofs_node *anp, struct mount *mp, struct vnode **vpp) +autofs_node_vn(struct autofs_node *anp, struct mount *mp, int flags, + struct vnode **vpp) { struct vnode *vp; int error; @@ -592,7 +593,7 @@ autofs_node_vn(struct autofs_node *anp, vp = anp->an_vnode; if (vp != NULL) { - error = vget(vp, LK_EXCLUSIVE | LK_RETRY, curthread); + error = vget(vp, flags | LK_RETRY, curthread); if (error != 0) { AUTOFS_WARN("vget failed with error %d", error); sx_xunlock(&anp->an_vnode_lock); @@ -632,6 +633,8 @@ autofs_node_vn(struct autofs_node *anp, vp->v_vflag |= VV_ROOT; vp->v_data = anp; + VN_LOCK_ASHARE(vp); + error = insmntque(vp, mp); if (error != 0) { AUTOFS_WARN("insmntque() failed with error %d", error); From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 12:46:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 483CEA13; Sat, 4 Oct 2014 12:46: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 34D7BEC1; Sat, 4 Oct 2014 12:46: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 s94CkRY2032089; Sat, 4 Oct 2014 12:46:27 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94CkR5M032088; Sat, 4 Oct 2014 12:46:27 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201410041246.s94CkR5M032088@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 4 Oct 2014 12:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272518 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 12:46:27 -0000 Author: melifaro Date: Sat Oct 4 12:46:26 2014 New Revision: 272518 URL: https://svnweb.freebsd.org/changeset/base/272518 Log: Bump max rule size to 512 opcodes. Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Sat Oct 4 12:42:37 2014 (r272517) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Sat Oct 4 12:46:26 2014 (r272518) @@ -940,7 +940,7 @@ ipfw_getrules(struct ip_fw_chain *chain, int ipfw_ctl(struct sockopt *sopt) { -#define RULE_MAXSIZE (256*sizeof(u_int32_t)) +#define RULE_MAXSIZE (512*sizeof(u_int32_t)) int error; size_t size, len, valsize; struct ip_fw *buf, *rule; From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 13:14:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECF48D03; Sat, 4 Oct 2014 13:14: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 D9E47183; Sat, 4 Oct 2014 13:14: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 s94DEbYA045806; Sat, 4 Oct 2014 13:14:37 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94DEbrq045805; Sat, 4 Oct 2014 13:14:37 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410041314.s94DEbrq045805@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 4 Oct 2014 13:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272519 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 04 Oct 2014 13:14:38 -0000 Author: andrew Date: Sat Oct 4 13:14:37 2014 New Revision: 272519 URL: https://svnweb.freebsd.org/changeset/base/272519 Log: Add movw and movt relocations to the list of relocations against function names that must nnot be adjusted. This fixes a bug where code such as: movw r2, :lower16:symbol movt r2, :upper16:symbol It is common for clang to generate such code when targeting armv7. Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Sat Oct 4 12:46:26 2014 (r272518) +++ head/contrib/binutils/gas/config/tc-arm.c Sat Oct 4 13:14:37 2014 (r272519) @@ -19395,6 +19395,12 @@ arm_fix_adjustable (fixS * fixP) || fixP->fx_r_type == BFD_RELOC_ARM_LDR_PC_G0) return 0; + if (fixP->fx_r_type == BFD_RELOC_ARM_MOVW + || fixP->fx_r_type == BFD_RELOC_ARM_MOVT + || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVW + || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVT) + return 0; + return 1; } #endif /* defined (OBJ_ELF) || defined (OBJ_COFF) */ From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 14:17:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84B13448; Sat, 4 Oct 2014 14:17:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71B7092A; Sat, 4 Oct 2014 14:17: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 s94EHVqo075442; Sat, 4 Oct 2014 14:17:31 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94EHVos075441; Sat, 4 Oct 2014 14:17:31 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201410041417.s94EHVos075441@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 4 Oct 2014 14:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272523 - 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: Sat, 04 Oct 2014 14:17:31 -0000 Author: bz Date: Sat Oct 4 14:17:30 2014 New Revision: 272523 URL: https://svnweb.freebsd.org/changeset/base/272523 Log: Put and #ifdef _KERNEL around the #include for opt_capsicum.h to hopefully allow the build to finish after r272505. Modified: head/sys/sys/filedesc.h Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Sat Oct 4 14:00:25 2014 (r272522) +++ head/sys/sys/filedesc.h Sat Oct 4 14:17:30 2014 (r272523) @@ -33,7 +33,9 @@ #ifndef _SYS_FILEDESC_H_ #define _SYS_FILEDESC_H_ +#ifdef _KERNEL #include "opt_capsicum.h" +#endif #include #include From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 14:22:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 853B05BC; Sat, 4 Oct 2014 14:22:33 +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 0D00B9D6; Sat, 4 Oct 2014 14:22:32 +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 8B5DF25D3A97; Sat, 4 Oct 2014 14:22: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 9B4F1C770EF; Sat, 4 Oct 2014 14:22: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 oO0Ie_4HyLlh; Sat, 4 Oct 2014 14:22:20 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:e57f:1550:28b1:4a3] (unknown [IPv6:fde9:577b:c1a9:4410:e57f:1550:28b1:4a3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 2030EC770DA; Sat, 4 Oct 2014 14:22:17 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r272505 - in head/sys: kern sys From: "Bjoern A. Zeeb" In-Reply-To: <201410040808.s9488uAI099166@svn.freebsd.org> Date: Sat, 4 Oct 2014 14:21:54 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <42180557-0119-4597-9492-662E1671A840@FreeBSD.org> References: <201410040808.s9488uAI099166@svn.freebsd.org> To: Mateusz Guzik , Konstantin Belousov X-Mailer: Apple Mail (2.1878.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, 04 Oct 2014 14:22:33 -0000 On 04 Oct 2014, at 08:08 , Mateusz Guzik wrote: > Author: mjg > Date: Sat Oct 4 08:08:56 2014 > New Revision: 272505 > URL: https://svnweb.freebsd.org/changeset/base/272505 >=20 > Log: > Plug capability races. >=20 > fp and appropriate capability lookups were not atomic, which could = result in > improper capabilities being checked. >=20 > This could result either in protection bypass or in a spurious = ENOTCAPABLE. >=20 > Make fp + capability check atomic with the help of sequence counters. >=20 > Reviewed by: kib > MFC after: 3 weeks >=20 > Modified: > head/sys/kern/kern_descrip.c > head/sys/sys/filedesc.h > =85 This file is included from user space. There is no opt_capsicum.h = there. Including an opt_* in the header file seems wrong in a lot of ways = usually. I tried to add a bandaid for the moment with r272523 which (to be = honest) makes it worse. This needs a better fix. I also wonder why the (conditional) fde_seq ended up at the beginning of = the structure rather than the end? > Modified: head/sys/sys/filedesc.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/filedesc.h Sat Oct 4 08:05:39 2014 = (r272504) > +++ head/sys/sys/filedesc.h Sat Oct 4 08:08:56 2014 = (r272505) > @@ -33,11 +33,14 @@ > #ifndef _SYS_FILEDESC_H_ > #define _SYS_FILEDESC_H_ >=20 > +#include "opt_capsicum.h" > + > #include > #include > #include > #include > #include > +#include > #include >=20 > #include > @@ -50,6 +53,9 @@ struct filecaps { > }; >=20 > struct filedescent { > +#ifdef CAPABILITIES > + seq_t fde_seq; /* if you need fde_file = and fde_caps in sync */ > +#endif > struct file *fde_file; /* file structure for = open file */ > struct filecaps fde_caps; /* per-descriptor rights = */ > uint8_t fde_flags; /* per-process open file = flags */ > @@ -58,6 +64,13 @@ struct filedescent { > #define fde_fcntls fde_caps.fc_fcntls > #define fde_ioctls fde_caps.fc_ioctls > #define fde_nioctls fde_caps.fc_nioctls > +#ifdef CAPABILITIES > +#define fde_change(fde) ((char *)(fde) + sizeof(seq_t)) > +#define fde_change_size (sizeof(struct filedescent) - = sizeof(seq_t)) > +#else > +#define fde_change(fde) ((fde)) > +#define fde_change_size (sizeof(struct filedescent)) > +#endif >=20 > /* > * This structure is used for the management of descriptors. It may = be > @@ -82,6 +95,9 @@ struct filedesc { > int fd_holdleaderscount; /* block fdfree() for shared = close() */ > int fd_holdleaderswakeup; /* fdfree() needs wakeup */ > }; > +#ifdef CAPABILITIES > +#define fd_seq(fdp, fd) (&(fdp)->fd_ofiles[(fd)].fde_seq) > +#endif >=20 > /* > * Structure to keep track of (process leader, struct fildedesc) = tuples. >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 14:30:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8D9880E; Sat, 4 Oct 2014 14:30:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5A7AA17; Sat, 4 Oct 2014 14:30: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 s94EUH7f080633; Sat, 4 Oct 2014 14:30:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94EUHJe080631; Sat, 4 Oct 2014 14:30:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410041430.s94EUHJe080631@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 4 Oct 2014 14:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272524 - in head/contrib/binutils: bfd include/elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 14:30:17 -0000 Author: andrew Date: Sat Oct 4 14:30:16 2014 New Revision: 272524 URL: https://svnweb.freebsd.org/changeset/base/272524 Log: Silence a warning about Tag_Virtualization_use being unknown. We don't handle merging this tag correctly, however it's unused. Modified: head/contrib/binutils/bfd/elf32-arm.c head/contrib/binutils/include/elf/arm.h Modified: head/contrib/binutils/bfd/elf32-arm.c ============================================================================== --- head/contrib/binutils/bfd/elf32-arm.c Sat Oct 4 14:17:30 2014 (r272523) +++ head/contrib/binutils/bfd/elf32-arm.c Sat Oct 4 14:30:16 2014 (r272524) @@ -6965,7 +6965,8 @@ elf32_arm_merge_eabi_attributes (bfd *ib for (; in_list; in_list = in_list->next) { - if ((in_list->tag & 128) < 64) + if ((in_list->tag & 128) < 64 + && in_list->tag != Tag_Virtualization_use) { _bfd_error_handler (_("Warning: %B: Unknown EABI object attribute %d"), Modified: head/contrib/binutils/include/elf/arm.h ============================================================================== --- head/contrib/binutils/include/elf/arm.h Sat Oct 4 14:17:30 2014 (r272523) +++ head/contrib/binutils/include/elf/arm.h Sat Oct 4 14:30:16 2014 (r272524) @@ -271,6 +271,8 @@ enum Tag_ABI_optimization_goals, Tag_ABI_FP_optimization_goals, /* 32 is generic. */ + + Tag_Virtualization_use = 68, }; #endif From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 14:32:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4360968; Sat, 4 Oct 2014 14:32:48 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77ADFAEB; Sat, 4 Oct 2014 14:32:48 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XaQO6-000Nx6-Go; Sat, 04 Oct 2014 14:32:46 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s94EWj4T023931; Sat, 4 Oct 2014 08:32:45 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/LefhVMwvBRdUJDN18Dvei X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r272506 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Ian Lepore To: Xin LI In-Reply-To: <201410040814.s948EBH0003546@svn.freebsd.org> References: <201410040814.s948EBH0003546@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 04 Oct 2014 08:32:45 -0600 Message-ID: <1412433165.12052.106.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 14:32:48 -0000 On Sat, 2014-10-04 at 08:14 +0000, Xin LI wrote: > Author: delphij > Date: Sat Oct 4 08:14:10 2014 > New Revision: 272506 > URL: https://svnweb.freebsd.org/changeset/base/272506 > > Log: > MFV r272495: > > In arc_kmem_reap_now(), reap range_seg_cache too to reclaim memory in > response of memory pressure. > > Illumos issue: > 5163 arc should reap range_seg_cache > > MFC after: 1 week > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c > Directory Properties: > head/sys/cddl/contrib/opensolaris/ (props changed) > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Oct 4 08:08:56 2014 (r272505) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Oct 4 08:14:10 2014 (r272506) > @@ -2591,6 +2591,7 @@ arc_kmem_reap_now(arc_reclaim_strategy_t > size_t i; > kmem_cache_t *prev_cache = NULL; > kmem_cache_t *prev_data_cache = NULL; > + extern kmem_cache_t *range_seg_cache; > I get this when compiling sparc64 GENERIC, must be different warnings enabled... cc1: warnings being treated as errors /local/build/staging/freebsd/head/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c: In function 'arc_kmem_reap_now': /local/build/staging/freebsd/head/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:2594: warning: nested extern declaration of 'range_seg_cache' [-Wnested-externs] -- Ian > DTRACE_PROBE(arc__kmem_reap_start); > #ifdef _KERNEL > @@ -2628,6 +2629,7 @@ arc_kmem_reap_now(arc_reclaim_strategy_t > } > kmem_cache_reap_now(buf_cache); > kmem_cache_reap_now(hdr_cache); > + kmem_cache_reap_now(range_seg_cache); > > #ifdef sun > /* > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Sat Oct 4 08:08:56 2014 (r272505) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Sat Oct 4 08:14:10 2014 (r272506) > @@ -33,7 +33,7 @@ > #include > #include > > -static kmem_cache_t *range_seg_cache; > +kmem_cache_t *range_seg_cache; > > void > range_tree_init(void) > From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 14:45:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F35BFF8B; Sat, 4 Oct 2014 14:45:04 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 65FE4BDA; Sat, 4 Oct 2014 14:45:04 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 6376620E7089B; Sat, 4 Oct 2014 14:45:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: * X-Spam-Status: No, score=2.0 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id C4CDD20E70899; Sat, 4 Oct 2014 14:45:00 +0000 (UTC) Message-ID: From: "Steven Hartland" To: "Ian Lepore" , "Xin LI" References: <201410040814.s948EBH0003546@svn.freebsd.org> <1412433165.12052.106.camel@revolution.hippie.lan> Subject: Re: svn commit: r272506 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Sat, 4 Oct 2014 15:44:55 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_00D8_01CFDFEA.24FE9880" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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, 04 Oct 2014 14:45:05 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_00D8_01CFDFEA.24FE9880 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Does the attached patch fix this for your Ian? Regards Steve ----- Original Message ----- From: "Ian Lepore" To: "Xin LI" Cc: ; ; Sent: Saturday, October 04, 2014 3:32 PM Subject: Re: svn commit: r272506 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs > On Sat, 2014-10-04 at 08:14 +0000, Xin LI wrote: >> Author: delphij >> Date: Sat Oct 4 08:14:10 2014 >> New Revision: 272506 >> URL: https://svnweb.freebsd.org/changeset/base/272506 >> >> Log: >> MFV r272495: >> >> In arc_kmem_reap_now(), reap range_seg_cache too to reclaim memory in >> response of memory pressure. >> >> Illumos issue: >> 5163 arc should reap range_seg_cache >> >> MFC after: 1 week >> >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c >> Directory Properties: >> head/sys/cddl/contrib/opensolaris/ (props changed) >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Oct 4 08:08:56 2014 (r272505) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Oct 4 08:14:10 2014 (r272506) >> @@ -2591,6 +2591,7 @@ arc_kmem_reap_now(arc_reclaim_strategy_t >> size_t i; >> kmem_cache_t *prev_cache = NULL; >> kmem_cache_t *prev_data_cache = NULL; >> + extern kmem_cache_t *range_seg_cache; >> > > I get this when compiling sparc64 GENERIC, must be different warnings > enabled... > > cc1: warnings being treated as errors > /local/build/staging/freebsd/head/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c: In function 'arc_kmem_reap_now': > /local/build/staging/freebsd/head/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:2594: warning: nested extern > declaration of 'range_seg_cache' [-Wnested-externs] > > -- Ian > >> DTRACE_PROBE(arc__kmem_reap_start); >> #ifdef _KERNEL >> @@ -2628,6 +2629,7 @@ arc_kmem_reap_now(arc_reclaim_strategy_t >> } >> kmem_cache_reap_now(buf_cache); >> kmem_cache_reap_now(hdr_cache); >> + kmem_cache_reap_now(range_seg_cache); >> >> #ifdef sun >> /* >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Sat Oct 4 08:08:56 2014 (r272505) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Sat Oct 4 08:14:10 2014 (r272506) >> @@ -33,7 +33,7 @@ >> #include >> #include >> >> -static kmem_cache_t *range_seg_cache; >> +kmem_cache_t *range_seg_cache; >> >> void >> range_tree_init(void) >> > > > > ------=_NextPart_000_00D8_01CFDFEA.24FE9880 Content-Type: application/octet-stream; name="range_seg.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="range_seg.patch" Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c (revision = 272525)=0A= +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c (working copy)=0A= @@ -2584,6 +2584,7 @@ arc_reclaim_needed(void)=0A= =0A= extern kmem_cache_t *zio_buf_cache[];=0A= extern kmem_cache_t *zio_data_buf_cache[];=0A= +extern kmem_cache_t *range_seg_cache;=0A= =0A= static void __noinline=0A= arc_kmem_reap_now(arc_reclaim_strategy_t strat)=0A= @@ -2591,7 +2592,6 @@ arc_kmem_reap_now(arc_reclaim_strategy_t strat)=0A= size_t i;=0A= kmem_cache_t *prev_cache =3D NULL;=0A= kmem_cache_t *prev_data_cache =3D NULL;=0A= - extern kmem_cache_t *range_seg_cache;=0A= =0A= DTRACE_PROBE(arc__kmem_reap_start);=0A= #ifdef _KERNEL=0A= ------=_NextPart_000_00D8_01CFDFEA.24FE9880-- From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 15:42:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3676A4; Sat, 4 Oct 2014 15:42:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF5FA18F; Sat, 4 Oct 2014 15:42: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 s94Fgrho018560; Sat, 4 Oct 2014 15:42:53 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94Fgrhk018552; Sat, 4 Oct 2014 15:42:53 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410041542.s94Fgrhk018552@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 4 Oct 2014 15:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272527 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 15:42:53 -0000 Author: delphij Date: Sat Oct 4 15:42:52 2014 New Revision: 272527 URL: https://svnweb.freebsd.org/changeset/base/272527 Log: Don't make nested definition for range_seg_cache. Reported by: ian MFC after: 1 week X-MFC-With: r272506 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Oct 4 14:40:12 2014 (r272526) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Oct 4 15:42:52 2014 (r272527) @@ -2584,6 +2584,7 @@ arc_reclaim_needed(void) extern kmem_cache_t *zio_buf_cache[]; extern kmem_cache_t *zio_data_buf_cache[]; +extern kmem_cache_t *range_seg_cache; static void __noinline arc_kmem_reap_now(arc_reclaim_strategy_t strat) @@ -2591,7 +2592,6 @@ arc_kmem_reap_now(arc_reclaim_strategy_t size_t i; kmem_cache_t *prev_cache = NULL; kmem_cache_t *prev_data_cache = NULL; - extern kmem_cache_t *range_seg_cache; DTRACE_PROBE(arc__kmem_reap_start); #ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 15:59:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 955D99A5; Sat, 4 Oct 2014 15:59:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 765D72FA; Sat, 4 Oct 2014 15:59: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 s94FxGlR024430; Sat, 4 Oct 2014 15:59:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94FxGXn024427; Sat, 4 Oct 2014 15:59:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410041559.s94FxGXn024427@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 4 Oct 2014 15:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272528 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 15:59:16 -0000 Author: ian Date: Sat Oct 4 15:59:15 2014 New Revision: 272528 URL: https://svnweb.freebsd.org/changeset/base/272528 Log: Make kevent(2) periodic timer events more reliably periodic. The event callout is now scheduled using the C_ABSOLUTE flag, and the absolute time of each event is calculated as the time the previous event was scheduled for plus the interval. This ensures that latency in processing a given event doesn't perturb the arrival time of any subsequent events. Reviewed by: jhb Modified: head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Oct 4 15:42:52 2014 (r272527) +++ head/sys/kern/kern_event.c Sat Oct 4 15:59:15 2014 (r272528) @@ -569,9 +569,10 @@ filt_timerexpire(void *knx) if ((kn->kn_flags & EV_ONESHOT) != EV_ONESHOT) { calloutp = (struct callout *)kn->kn_hook; - callout_reset_sbt_on(calloutp, - timer2sbintime(kn->kn_sdata, kn->kn_sfflags), 0, - filt_timerexpire, kn, PCPU_GET(cpuid), 0); + *kn->kn_ptr.p_nexttime += timer2sbintime(kn->kn_sdata, + kn->kn_sfflags); + callout_reset_sbt_on(calloutp, *kn->kn_ptr.p_nexttime, 0, + filt_timerexpire, kn, PCPU_GET(cpuid), C_ABSOLUTE); } } @@ -607,11 +608,13 @@ filt_timerattach(struct knote *kn) kn->kn_flags |= EV_CLEAR; /* automatically set */ kn->kn_status &= ~KN_DETACHED; /* knlist_add clears it */ + kn->kn_ptr.p_nexttime = malloc(sizeof(sbintime_t), M_KQUEUE, M_WAITOK); calloutp = malloc(sizeof(*calloutp), M_KQUEUE, M_WAITOK); callout_init(calloutp, CALLOUT_MPSAFE); kn->kn_hook = calloutp; - callout_reset_sbt_on(calloutp, to, 0, - filt_timerexpire, kn, PCPU_GET(cpuid), 0); + *kn->kn_ptr.p_nexttime = to + sbinuptime(); + callout_reset_sbt_on(calloutp, *kn->kn_ptr.p_nexttime, 0, + filt_timerexpire, kn, PCPU_GET(cpuid), C_ABSOLUTE); return (0); } @@ -625,6 +628,7 @@ filt_timerdetach(struct knote *kn) calloutp = (struct callout *)kn->kn_hook; callout_drain(calloutp); free(calloutp, M_KQUEUE); + free(kn->kn_ptr.p_nexttime, M_KQUEUE); old = atomic_fetch_sub_explicit(&kq_ncallouts, 1, memory_order_relaxed); KASSERT(old > 0, ("Number of callouts cannot become negative")); kn->kn_status |= KN_DETACHED; /* knlist_remove sets it */ Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Sat Oct 4 15:42:52 2014 (r272527) +++ head/sys/sys/event.h Sat Oct 4 15:59:15 2014 (r272528) @@ -221,6 +221,7 @@ struct knote { struct proc *p_proc; /* proc pointer */ struct aiocblist *p_aio; /* AIO job pointer */ struct aioliojob *p_lio; /* LIO job pointer */ + sbintime_t *p_nexttime; /* next timer event fires at */ void *p_v; /* generic other pointer */ } kn_ptr; struct filterops *kn_fop; From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 16:36:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FAD93FB; Sat, 4 Oct 2014 16:36:39 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86FF18D6; Sat, 4 Oct 2014 16:36:38 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s94GaXki043686 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Oct 2014 19:36:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s94GaXki043686 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s94GaXvM043685; Sat, 4 Oct 2014 19:36:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 4 Oct 2014 19:36:33 +0300 From: Konstantin Belousov To: "Bjoern A. Zeeb" Subject: Re: svn commit: r272505 - in head/sys: kern sys Message-ID: <20141004163633.GT26076@kib.kiev.ua> References: <201410040808.s9488uAI099166@svn.freebsd.org> <42180557-0119-4597-9492-662E1671A840@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42180557-0119-4597-9492-662E1671A840@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, Mateusz Guzik 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, 04 Oct 2014 16:36:39 -0000 On Sat, Oct 04, 2014 at 02:21:54PM +0000, Bjoern A. Zeeb wrote: > > On 04 Oct 2014, at 08:08 , Mateusz Guzik wrote: > > > Author: mjg > > Date: Sat Oct 4 08:08:56 2014 > > New Revision: 272505 > > URL: https://svnweb.freebsd.org/changeset/base/272505 > > > > Log: > > Plug capability races. > > > > fp and appropriate capability lookups were not atomic, which could result in > > improper capabilities being checked. > > > > This could result either in protection bypass or in a spurious ENOTCAPABLE. > > > > Make fp + capability check atomic with the help of sequence counters. > > > > Reviewed by: kib > > MFC after: 3 weeks > > > > Modified: > > head/sys/kern/kern_descrip.c > > head/sys/sys/filedesc.h > > ? > > > This file is included from user space. There is no opt_capsicum.h there. > Including an opt_* in the header file seems wrong in a lot of ways usually. I think that easiest, and probably the most correct, fix is to include the fde_seq member unconditionally. > > I tried to add a bandaid for the moment with r272523 which (to be honest) makes it worse. > > This needs a better fix. Hm, I do see inclusion of sys/filedesc.h in the usermode programs, most worrying is libprocstat. But, there is nothing useful for usermode in the header, except possibly for the code with inspects KVA. > > > I also wonder why the (conditional) fde_seq ended up at the beginning of the structure rather than the end? > Why not ? From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 18:00:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD088F2C; Sat, 4 Oct 2014 18:00:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8E95D4; Sat, 4 Oct 2014 18:00: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 s94I0Gj5083587; Sat, 4 Oct 2014 18:00:16 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94I0G9O083586; Sat, 4 Oct 2014 18:00:16 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201410041800.s94I0G9O083586@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 4 Oct 2014 18:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272533 - head/lib/libc/stdtime X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 18:00:16 -0000 Author: pfg Date: Sat Oct 4 18:00:15 2014 New Revision: 272533 URL: https://svnweb.freebsd.org/changeset/base/272533 Log: Minor doc format fix. Submitted by: Yonghyeon PYUN Modified: head/lib/libc/stdtime/strptime.3 Modified: head/lib/libc/stdtime/strptime.3 ============================================================================== --- head/lib/libc/stdtime/strptime.3 Sat Oct 4 17:49:36 2014 (r272532) +++ head/lib/libc/stdtime/strptime.3 Sat Oct 4 18:00:15 2014 (r272533) @@ -79,7 +79,8 @@ and .Fa \&%D , are now interpreted as beginning at 1969 per POSIX requirements. Years 69-00 are interpreted in the 20th century (1969-2000), years -01-68 in the 21st century (2001-2068). The +01-68 in the 21st century (2001-2068). +The .Fa \&%U and .Fa %W From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 18:28:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15A0866D; Sat, 4 Oct 2014 18:28: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 0175F390; Sat, 4 Oct 2014 18:28: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 s94ISSI8099604; Sat, 4 Oct 2014 18:28:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94ISSaf099602; Sat, 4 Oct 2014 18:28:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410041828.s94ISSaf099602@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 4 Oct 2014 18:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272534 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 18:28:29 -0000 Author: kib Date: Sat Oct 4 18:28:27 2014 New Revision: 272534 URL: https://svnweb.freebsd.org/changeset/base/272534 Log: Add IO_RANGELOCKED flag for vn_rdwr(9), which specifies that vnode is not locked, but range is. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat Oct 4 18:00:15 2014 (r272533) +++ head/sys/kern/vfs_vnops.c Sat Oct 4 18:28:27 2014 (r272534) @@ -504,13 +504,16 @@ vn_rdwr(enum uio_rw rw, struct vnode *vp error = 0; if ((ioflg & IO_NODELOCKED) == 0) { - if (rw == UIO_READ) { - rl_cookie = vn_rangelock_rlock(vp, offset, - offset + len); - } else { - rl_cookie = vn_rangelock_wlock(vp, offset, - offset + len); - } + if ((ioflg & IO_RANGELOCKED) == 0) { + if (rw == UIO_READ) { + rl_cookie = vn_rangelock_rlock(vp, offset, + offset + len); + } else { + rl_cookie = vn_rangelock_wlock(vp, offset, + offset + len); + } + } else + rl_cookie = NULL; mp = NULL; if (rw == UIO_WRITE) { if (vp->v_type != VCHR && Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat Oct 4 18:00:15 2014 (r272533) +++ head/sys/sys/vnode.h Sat Oct 4 18:28:27 2014 (r272534) @@ -305,6 +305,7 @@ struct vattr { #define IO_NORMAL 0x0800 /* operate on regular data */ #define IO_NOMACCHECK 0x1000 /* MAC checks unnecessary */ #define IO_BUFLOCKED 0x2000 /* ffs flag; indir buf is locked */ +#define IO_RANGELOCKED 0x4000 /* range locked */ #define IO_SEQMAX 0x7F /* seq heuristic max value */ #define IO_SEQSHIFT 16 /* seq heuristic in upper 16 bits */ From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 18:35:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B182A09; Sat, 4 Oct 2014 18:35:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67068637; Sat, 4 Oct 2014 18:35: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 s94IZ1XU004061; Sat, 4 Oct 2014 18:35:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94IZ1Pd004053; Sat, 4 Oct 2014 18:35:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410041835.s94IZ1Pd004053@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 4 Oct 2014 18:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272535 - 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, 04 Oct 2014 18:35:01 -0000 Author: kib Date: Sat Oct 4 18:35:00 2014 New Revision: 272535 URL: https://svnweb.freebsd.org/changeset/base/272535 Log: Fixes for i/o during coredumping: - Do not dump into system files. - Do not acquire write reference to the mount point where img.core is written, in the coredump(). The vn_rdwr() calls from ELF imgact request the write ref from vn_rdwr(). Recursive acqusition of the write ref deadlocks with the unmount. - Instead, take the range lock for the whole core file. This prevents parallel dumping from two processes executing the same image, converting the useless interleaved dump into sequential dumping, with second core overwriting the first. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/imgact_elf.c head/sys/kern/kern_sig.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sat Oct 4 18:28:27 2014 (r272534) +++ head/sys/kern/imgact_elf.c Sat Oct 4 18:35:00 2014 (r272535) @@ -1112,8 +1112,8 @@ core_output(struct vnode *vp, void *base #endif } else { error = vn_rdwr_inchunks(UIO_WRITE, vp, base, len, offset, - UIO_USERSPACE, IO_UNIT | IO_DIRECT, active_cred, file_cred, - NULL, td); + UIO_USERSPACE, IO_UNIT | IO_DIRECT | IO_RANGELOCKED, + active_cred, file_cred, NULL, td); } return (error); } @@ -1160,8 +1160,8 @@ sbuf_drain_core_output(void *arg, const #endif error = vn_rdwr_inchunks(UIO_WRITE, p->vp, __DECONST(void *, data), len, p->offset, UIO_SYSSPACE, - IO_UNIT | IO_DIRECT, p->active_cred, p->file_cred, NULL, - p->td); + IO_UNIT | IO_DIRECT | IO_RANGELOCKED, p->active_cred, + p->file_cred, NULL, p->td); if (locked) PROC_LOCK(p->td->td_proc); if (error != 0) Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sat Oct 4 18:28:27 2014 (r272534) +++ head/sys/kern/kern_sig.c Sat Oct 4 18:35:00 2014 (r272535) @@ -3214,8 +3214,8 @@ coredump(struct thread *td) struct flock lf; struct vattr vattr; int error, error1, locked; - struct mount *mp; char *name; /* name of corefile */ + void *rl_cookie; off_t limit; int compress; @@ -3248,39 +3248,33 @@ coredump(struct thread *td) } PROC_UNLOCK(p); -restart: error = corefile_open(p->p_comm, cred->cr_uid, p->p_pid, td, compress, &vp, &name); if (error != 0) return (error); - /* Don't dump to non-regular files or files with links. */ + /* + * Don't dump to non-regular files or files with links. + * Do not dump into system files. + */ if (vp->v_type != VREG || VOP_GETATTR(vp, &vattr, cred) != 0 || - vattr.va_nlink != 1) { + vattr.va_nlink != 1 || (vp->v_vflag & VV_SYSTEM) != 0) { VOP_UNLOCK(vp, 0); error = EFAULT; goto close; } VOP_UNLOCK(vp, 0); + + /* Postpone other writers, including core dumps of other processes. */ + rl_cookie = vn_rangelock_wlock(vp, 0, OFF_MAX); + lf.l_whence = SEEK_SET; lf.l_start = 0; lf.l_len = 0; lf.l_type = F_WRLCK; locked = (VOP_ADVLOCK(vp, (caddr_t)p, F_SETLK, &lf, F_FLOCK) == 0); - if (vn_start_write(vp, &mp, V_NOWAIT) != 0) { - lf.l_type = F_UNLCK; - if (locked) - VOP_ADVLOCK(vp, (caddr_t)p, F_UNLCK, &lf, F_FLOCK); - if ((error = vn_close(vp, FWRITE, cred, td)) != 0) - goto out; - if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0) - goto out; - free(name, M_TEMP); - goto restart; - } - VATTR_NULL(&vattr); vattr.va_size = 0; if (set_core_nodump_flag) @@ -3288,7 +3282,6 @@ restart: vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); VOP_SETATTR(vp, &vattr, cred); VOP_UNLOCK(vp, 0); - vn_finished_write(mp); PROC_LOCK(p); p->p_acflag |= ACORE; PROC_UNLOCK(p); @@ -3304,11 +3297,11 @@ restart: lf.l_type = F_UNLCK; VOP_ADVLOCK(vp, (caddr_t)p, F_UNLCK, &lf, F_FLOCK); } + vn_rangelock_unlock(vp, rl_cookie); close: error1 = vn_close(vp, FWRITE, cred, td); if (error == 0) error = error1; -out: #ifdef AUDIT audit_proc_coredump(td, name, error); #endif From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 18:38:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47158C61; Sat, 4 Oct 2014 18:38: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 272F566B; Sat, 4 Oct 2014 18:38: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 s94IcGKc004494; Sat, 4 Oct 2014 18:38:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94IcEYm004488; Sat, 4 Oct 2014 18:38:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410041838.s94IcEYm004488@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 4 Oct 2014 18:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272536 - in head/sys: conf kern sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 18:38:16 -0000 Author: kib Date: Sat Oct 4 18:38:14 2014 New Revision: 272536 URL: https://svnweb.freebsd.org/changeset/base/272536 Log: Add kernel option KSTACK_USAGE_PROF to sample the stack depth on interrupts and report the largest value seen as sysctl debug.max_kstack_used. Useful to estimate how close the kernel stack size is to overflow. In collaboration with: Larry Baird Sponsored by: The FreeBSD Foundation (kib) MFC after: 1 week Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/kern/kern_intr.c head/sys/sys/systm.h head/sys/vm/vm_glue.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Oct 4 18:35:00 2014 (r272535) +++ head/sys/conf/NOTES Sat Oct 4 18:38:14 2014 (r272536) @@ -2958,6 +2958,7 @@ options SC_RENDER_DEBUG # syscons rende options VFS_BIO_DEBUG # VFS buffer I/O debugging options KSTACK_MAX_PAGES=32 # Maximum pages to give the kernel stack +options KSTACK_USAGE_PROF # Adaptec Array Controller driver options options AAC_DEBUG # Debugging levels: Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Oct 4 18:35:00 2014 (r272535) +++ head/sys/conf/options Sat Oct 4 18:38:14 2014 (r272536) @@ -136,6 +136,7 @@ KDTRACE_FRAME opt_kdtrace.h KN_HASHSIZE opt_kqueue.h KSTACK_MAX_PAGES KSTACK_PAGES +KSTACK_USAGE_PROF KTRACE KTRACE_REQUEST_POOL opt_ktrace.h LIBICONV Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Sat Oct 4 18:35:00 2014 (r272535) +++ head/sys/kern/kern_intr.c Sat Oct 4 18:38:14 2014 (r272536) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_kstack_usage_prof.h" #include #include @@ -1396,6 +1397,10 @@ intr_event_handle(struct intr_event *ie, td = curthread; +#ifdef KSTACK_USAGE_PROF + intr_prof_stack_use(td, frame); +#endif + /* An interrupt with no event or handlers is a stray interrupt. */ if (ie == NULL || TAILQ_EMPTY(&ie->ie_handlers)) return (EINVAL); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sat Oct 4 18:35:00 2014 (r272535) +++ head/sys/sys/systm.h Sat Oct 4 18:38:14 2014 (r272536) @@ -443,4 +443,6 @@ bitcount16(uint32_t x) return (x); } +void intr_prof_stack_use(struct thread *td, struct trapframe *frame); + #endif /* !_SYS_SYSTM_H_ */ Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Sat Oct 4 18:35:00 2014 (r272535) +++ head/sys/vm/vm_glue.c Sat Oct 4 18:38:14 2014 (r272536) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include "opt_vm.h" #include "opt_kstack_pages.h" #include "opt_kstack_max_pages.h" +#include "opt_kstack_usage_prof.h" #include #include @@ -98,6 +99,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #ifndef NO_SWAPPING static int swapout(struct proc *); static void swapclear(struct proc *); @@ -486,6 +489,52 @@ kstack_cache_init(void *nulll) SYSINIT(vm_kstacks, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, kstack_cache_init, NULL); +#ifdef KSTACK_USAGE_PROF +/* + * Track maximum stack used by a thread in kernel. + */ +static int max_kstack_used; + +SYSCTL_INT(_debug, OID_AUTO, max_kstack_used, CTLFLAG_RD, + &max_kstack_used, 0, + "Maxiumum stack depth used by a thread in kernel"); + +void +intr_prof_stack_use(struct thread *td, struct trapframe *frame) +{ + vm_offset_t stack_top; + vm_offset_t current; + int used, prev_used; + + /* + * Testing for interrupted kernel mode isn't strictly + * needed. It optimizes the execution, since interrupts from + * usermode will have only the trap frame on the stack. + */ + if (TRAPF_USERMODE(frame)) + return; + + stack_top = td->td_kstack + td->td_kstack_pages * PAGE_SIZE; + current = (vm_offset_t)(uintptr_t)&stack_top; + + /* + * Try to detect if interrupt is using kernel thread stack. + * Hardware could use a dedicated stack for interrupt handling. + */ + if (stack_top <= current || current < td->td_kstack) + return; + + used = stack_top - current; + for (;;) { + prev_used = max_kstack_used; + if (prev_used >= used) + break; + if (atomic_cmpset_int(&max_kstack_used, prev_used, used)) + break; + } +} +#endif /* KSTACK_USAGE_PROF */ + #ifndef NO_SWAPPING /* * Allow a thread's kernel stack to be paged out. From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 18:40:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A038DC0; Sat, 4 Oct 2014 18:40: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 BC842679; Sat, 4 Oct 2014 18:40: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 s94Ieees005485; Sat, 4 Oct 2014 18:40:40 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94IeeQD005484; Sat, 4 Oct 2014 18:40:40 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201410041840.s94IeeQD005484@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Sat, 4 Oct 2014 18:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272537 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 18:40:41 -0000 Author: dumbbell Date: Sat Oct 4 18:40:40 2014 New Revision: 272537 URL: https://svnweb.freebsd.org/changeset/base/272537 Log: vt(4): Don't recalculate buffer size if we don't know screen size When the screen size is unknown, it's set to 0x0. We can't use that as the buffer size, otherwise, functions such as vtbuf_fill() will fail. This fixes a panic on RaspberryPi, where there's no vt(4) backend configured early in boot. PR: 193981 Tested by: danilo@ MFC after: 3 days Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Sat Oct 4 18:38:14 2014 (r272536) +++ head/sys/dev/vt/vt_core.c Sat Oct 4 18:40:40 2014 (r272537) @@ -1269,7 +1269,8 @@ vtterm_cnprobe(struct terminal *tm, stru * that we have the real viewable size, fix it in the static * buffer. */ - vt_termsize(vd, vw->vw_font, &vw->vw_buf.vb_scr_size); + if (vd->vd_width != 0 && vd->vd_height != 0) + vt_termsize(vd, vw->vw_font, &vw->vw_buf.vb_scr_size); vtbuf_init_early(&vw->vw_buf); vt_winsize(vd, vw->vw_font, &wsz); From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 18:51:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DF6EFA2; Sat, 4 Oct 2014 18:51: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 89E79829; Sat, 4 Oct 2014 18:51: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 s94Ipu4S013039; Sat, 4 Oct 2014 18:51:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94Ipu56013038; Sat, 4 Oct 2014 18:51:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410041851.s94Ipu56013038@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 4 Oct 2014 18:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272538 - 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, 04 Oct 2014 18:51:56 -0000 Author: kib Date: Sat Oct 4 18:51:55 2014 New Revision: 272538 URL: https://svnweb.freebsd.org/changeset/base/272538 Log: Slightly reword comment. Move code, which is described by the comment, after it. Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat Oct 4 18:40:40 2014 (r272537) +++ head/sys/kern/vfs_vnops.c Sat Oct 4 18:51:55 2014 (r272538) @@ -2237,12 +2237,10 @@ vn_utimes_perm(struct vnode *vp, struct { int error; - error = VOP_ACCESSX(vp, VWRITE_ATTRIBUTES, cred, td); - /* - * From utimes(2): - * Grant permission if the caller is the owner of the file or - * the super-user. If the time pointer is null, then write + * Grant permission if the caller is the owner of the file, or + * the super-user, or has ACL_WRITE_ATTRIBUTES permission on + * on the file. If the time pointer is null, then write * permission on the file is also sufficient. * * From NFSv4.1, draft 21, 6.2.1.3.1, Discussion of Mask Attributes: @@ -2250,6 +2248,7 @@ vn_utimes_perm(struct vnode *vp, struct * will be allowed to set the times [..] to the current * server time. */ + error = VOP_ACCESSX(vp, VWRITE_ATTRIBUTES, cred, td); if (error != 0 && (vap->va_vaflags & VA_UTIMES_NULL) != 0) error = VOP_ACCESS(vp, VWRITE, cred, td); return (error); From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 19:25:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DB57658; Sat, 4 Oct 2014 19:25:56 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 110C2B1C; Sat, 4 Oct 2014 19:25:56 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 9069125D3892; Sat, 4 Oct 2014 19:25:52 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id ABD73C770DA; Sat, 4 Oct 2014 19:25:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id SNa-xSBPHaF6; Sat, 4 Oct 2014 19:25:50 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:e57f:1550:28b1:4a3] (unknown [IPv6:fde9:577b:c1a9:4410:e57f:1550:28b1:4a3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 92D5DC770F0; Sat, 4 Oct 2014 19:25:47 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r272505 - in head/sys: kern sys From: "Bjoern A. Zeeb" In-Reply-To: <20141004163633.GT26076@kib.kiev.ua> Date: Sat, 4 Oct 2014 19:25:23 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <23D87C79-1101-4E37-AA49-1C7FA8AC5C0F@FreeBSD.org> References: <201410040808.s9488uAI099166@svn.freebsd.org> <42180557-0119-4597-9492-662E1671A840@FreeBSD.org> <20141004163633.GT26076@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-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, 04 Oct 2014 19:25:56 -0000 On 04 Oct 2014, at 16:36 , Konstantin Belousov = wrote: > On Sat, Oct 04, 2014 at 02:21:54PM +0000, Bjoern A. Zeeb wrote: >>=20 >> On 04 Oct 2014, at 08:08 , Mateusz Guzik wrote: >>=20 >>> Author: mjg >>> Date: Sat Oct 4 08:08:56 2014 >>> New Revision: 272505 >>> URL: https://svnweb.freebsd.org/changeset/base/272505 >>>=20 >>> Log: >>> Plug capability races. >>>=20 >>> fp and appropriate capability lookups were not atomic, which could = result in >>> improper capabilities being checked. >>>=20 >>> This could result either in protection bypass or in a spurious = ENOTCAPABLE. >>>=20 >>> Make fp + capability check atomic with the help of sequence = counters. >>>=20 >>> Reviewed by: kib >>> MFC after: 3 weeks >>>=20 >>> Modified: >>> head/sys/kern/kern_descrip.c >>> head/sys/sys/filedesc.h >>> ? >>=20 >>=20 >> This file is included from user space. There is no opt_capsicum.h = there. >> Including an opt_* in the header file seems wrong in a lot of ways = usually. > I think that easiest, and probably the most correct, fix is to include > the fde_seq member unconditionally. >=20 >>=20 >> I tried to add a bandaid for the moment with r272523 which (to be = honest) makes it worse. >>=20 >> This needs a better fix. > Hm, I do see inclusion of sys/filedesc.h in the usermode programs, = most > worrying is libprocstat. But, there is nothing useful for usermode in = the > header, except possibly for the code with inspects KVA. It=92s included indirectly imho through other sys/* header files if I = am not mistaken. >=20 >>=20 >>=20 >> I also wonder why the (conditional) fde_seq ended up at the beginning = of the structure rather than the end? >>=20 > Why not ? Because it guarantees the structure layout (offsets) to change for = either way, where-as at the end things would at least be deterministic = for the beginning; it might not make a change in reality, but it=92s = nice anyway (also for debugging). =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Sat Oct 4 21:50:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7E5653E; Sat, 4 Oct 2014 21:50:35 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 686EEA5F; Sat, 4 Oct 2014 21:50:35 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XaTEN-00051r-OW; Sat, 04 Oct 2014 21:34:55 +0400 Message-ID: <54306B2A.2040702@FreeBSD.org> Date: Sun, 05 Oct 2014 01:48:26 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r271207 - head/sys/dev/ahci References: <201409061943.s86JhmK4084402@svn.freebsd.org> In-Reply-To: <201409061943.s86JhmK4084402@svn.freebsd.org> X-Enigmail-Version: 1.6 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, 04 Oct 2014 21:50:35 -0000 On 06.09.2014 23:43, Alexander Motin wrote: > Author: mav > Date: Sat Sep 6 19:43:48 2014 > New Revision: 271207 > URL: http://svnweb.freebsd.org/changeset/base/271207 > > Log: > Save one register read (AHCI_IS) for AHCI controllers with only one port. > > For controllers with only one port (like PCIe or M.2 SSDs) interrupt can > come from only one source, and skipping read saves few percents of CPU time. > > MFC after: 1 month > H/W donated by: I/O Switch This one causes tons of "Interrupt storm" messages (and inability to boot) for SATA AHCI VirtualBox disk controller. > > Modified: > head/sys/dev/ahci/ahci.c > > Modified: head/sys/dev/ahci/ahci.c > ============================================================================== > --- head/sys/dev/ahci/ahci.c Sat Sep 6 19:39:12 2014 (r271206) > +++ head/sys/dev/ahci/ahci.c Sat Sep 6 19:43:48 2014 (r271207) > @@ -359,7 +359,9 @@ ahci_setup_interrupt(device_t dev) > for (i = 0; i < ctlr->numirqs; i++) { > ctlr->irqs[i].ctlr = ctlr; > ctlr->irqs[i].r_irq_rid = i + (ctlr->msi ? 1 : 0); > - if (ctlr->numirqs == 1 || i >= ctlr->channels || > + if (ctlr->channels == 1 && !ctlr->ccc) > + ctlr->irqs[i].mode = AHCI_IRQ_MODE_ONE; > + else if (ctlr->numirqs == 1 || i >= ctlr->channels || > (ctlr->ccc && i == ctlr->cccv)) > ctlr->irqs[i].mode = AHCI_IRQ_MODE_ALL; > else if (i == ctlr->numirqs - 1) > >