From owner-svn-src-head@freebsd.org Sun May 22 00:07:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09E05B457D0; Sun, 22 May 2016 00:07:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id BFFE813DF; Sun, 22 May 2016 00:07:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 6ADD51A7BA4; Sun, 22 May 2016 10:06:48 +1000 (AEST) Date: Sun, 22 May 2016 10:06:48 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pedro Giffuni cc: cem@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300377 - head/sys/compat/ndis In-Reply-To: <262938a6-50bd-b6f4-24c9-895b837a368e@FreeBSD.org> Message-ID: <20160522091455.A1014@besplex.bde.org> References: <201605211752.u4LHqiHQ031457@repo.freebsd.org> <262938a6-50bd-b6f4-24c9-895b837a368e@FreeBSD.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=CwWljFd69-WAYMiV5OEA:9 a=45ClL6m2LaAA:10 a=IjZwj45LgO3ly-622nXo:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 00:07:02 -0000 On Sat, 21 May 2016, Pedro Giffuni wrote: > On 05/21/16 16:55, Conrad Meyer wrote: >> On Sat, May 21, 2016 at 1:40 PM, Pedro Giffuni wrote: >>>=20 >>>=20 >>> On 05/21/16 14:05, Conrad Meyer wrote: >>>> Won't this still return a negative integer in many cases? >>>>=20 >>>> random(9) returns u_long, whereas this rand() routine returns 'int'. >>>>=20 >>>> Even on architectures where long is the same size as ordinary >>>> integers, the range of possible results of the 'random() / 2 + 1' >>>> expression, before implicit cast to signed, is [1, 2^31] (inclusive). >>>=20 >>> According to: >>> sys/libkern/random.c >>>=20 >>> The result is uniform on [0, 2^31 - 1]. >>=20 >> Ah, I missed that. Sorry! In that case, I'm not sure why this is >> needed =E2=80=94 the result fits in a non-negative 2's complement signed >> integer. > > Actually, I had missed it too. And I also had no idea we were working aro= und=20 > the zero singularity. > > I will revert the change and will do an adjustment for the case where > we use 0 as a seed (which in MS should be equivalent to 1). The libc version has complications related to this. The libkern version has rotted by not being kept up to date with the libc version. 4.4BSD-Lite has sort of the reverse bitrot -- in libc, it only has the bad LCG that copied from an example in the 1990 C standard, while it has the better LCG copied from 1988 Communications in the ACM in libkern= =2E FreeBSD still has the ACM version in libkern, and has a fixed copy of that in libc, with the bad old version under an ifdef. The libc version now adjusts the range from [0, 0x7fffffff] to 0, 0x7ffffffd] and reduces RAND_MAX by 2 to match. The claimed uniformity for the larger range is very wrong, since the ACM algorithm can only produce numbers in the range [1(or is it 0?), 0x7ffffffe] starting from a seed in the range [1, 0x7ffffffe(or is it 1 higher?)]. There are problems at both extremities, and it isn't clear if the new or old adjustments to avoid them preserve uniformity. It is clear that the range was at least 1 too high, since the ACM algorithm does a modulo by 0x7fffffff. Bruce From owner-svn-src-head@freebsd.org Sun May 22 00:18:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13390B459FB; Sun, 22 May 2016 00:18:46 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F4A41A7D; Sun, 22 May 2016 00:18:45 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lb0-f174.google.com with SMTP id k7so24830044lbm.0; Sat, 21 May 2016 17:18:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=mpZEUB2IAz8c49r7+L9IniXA/4F8THQZDDFsBde6e6o=; b=jKzIr2dvaGlkEUm8JztjyqzakSx7YrVDip5KS1wmMdf9qtlZI05ATQBzKfyFaE3np7 qZNIW8+jW59vQSZUEdN6+SMKDc7eVccyzM3/IZsl21qox94AC023IO3zF8gU84iLXZjQ xKyjxS4k/+KhmwjBS+tGofpOUDCbR35iVa6/MkOiQDQpHfpuD3TOMMbclNAsniRztGF0 vJhKHnruSJq4lbyrP1BLuIGCmbSefrQs7RvJC2VyqtTKFJTg0NU/8cV/MVWw7sbcK+Jx Aj2itQ6cL2cZ7Z2132ZINgaSpCdNtl8LcYU7sMFwRjTjgdhbb1lQP9h8RqcpQB9aBAfQ lNsg== X-Gm-Message-State: AOPr4FV7LXJFai3RRh/1nBF7Uh9p4+2ImewIGQU/1Suhq0/ysBtq2/ZCFvfKutREwZi+WA== X-Received: by 10.112.154.5 with SMTP id vk5mr3530789lbb.126.1463873048615; Sat, 21 May 2016 16:24:08 -0700 (PDT) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id d63sm2977547lfb.48.2016.05.21.16.24.07 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 21 May 2016 16:24:08 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, "svn-src-head@freebsd.org" Subject: Re: svn commit: r300383 - head/sys/net80211 References: <201605212321.u4LNLgDI029432@repo.freebsd.org> Date: Sun, 22 May 2016 02:24:03 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201605212321.u4LNLgDI029432@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 00:18:46 -0000 Tested with wpi(4) and urtwn(4) in STA mode. From owner-svn-src-head@freebsd.org Sun May 22 00:29:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0345B45B51; Sun, 22 May 2016 00:29:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDBFD1EDC; Sun, 22 May 2016 00:29:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M0TPsZ050124; Sun, 22 May 2016 00:29:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M0TPI6050123; Sun, 22 May 2016 00:29:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605220029.u4M0TPI6050123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 22 May 2016 00:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300384 - head/sys/compat/ndis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 00:29:27 -0000 Author: pfg Date: Sun May 22 00:29:25 2016 New Revision: 300384 URL: https://svnweb.freebsd.org/changeset/base/300384 Log: ndis(4): adjustments for our random() specific implementation. - Revert r300377: The implementation claims to return a value within the range. [1] - Adjust the value for the case of a zero seed, whihc according to standards should be equivalent to a seed of value 1. Pointed out by: cem Modified: head/sys/compat/ndis/subr_ntoskrnl.c Modified: head/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- head/sys/compat/ndis/subr_ntoskrnl.c Sat May 21 23:21:42 2016 (r300383) +++ head/sys/compat/ndis/subr_ntoskrnl.c Sun May 22 00:29:25 2016 (r300384) @@ -3189,13 +3189,15 @@ static int rand(void) { - return (random() / 2 + 1); + return (random()); } static void srand(unsigned int seed) { + if (seed == 0) + seed = 1; srandom(seed); } From owner-svn-src-head@freebsd.org Sun May 22 00:58:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6030B3B2DF; Sun, 22 May 2016 00:58:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 9D6F81D73; Sun, 22 May 2016 00:58:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 87C631047D8C; Sun, 22 May 2016 10:58:06 +1000 (AEST) Date: Sun, 22 May 2016 10:58:05 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Bruce Evans , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300332 - in head/sys: amd64/amd64 i386/i386 In-Reply-To: Message-ID: <20160522101943.U1190@besplex.bde.org> References: <201605201950.u4KJoWA5028092@repo.freebsd.org> <20160521081930.I1098@besplex.bde.org> <20160521103528.I1539@besplex.bde.org> <20160521123908.V1914@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=M8SwUHEs c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=hCGAsxolkOEVDU5JMAgA:9 a=CjuIK1q_8ugA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 00:58:17 -0000 On Sat, 21 May 2016, Conrad Meyer wrote: > On Fri, May 20, 2016 at 9:13 PM, Bruce Evans wrote: >> On Fri, 20 May 2016, Conrad Meyer wrote: >> >>> On Fri, May 20, 2016 at 6:10 PM, Bruce Evans wrote: >>>> >>>> >>>> Signed integers are easier to understand provided calculations with them >>>> don't overflow. >>> >>> How? >> >> For the same reasons as in applying mathematics. Applying mathematics >> ... >> Ordinary (real) numbers (including negative ones) also have good ordering >> properties for all operations. >> >> Computer arithmetic can't represent all ordinary numbers, but gets closest >> by representing ordinary integers as C signed integers perfectly when no >> overflow occurs. >> >> By using C unsigned integers unnecessarily, you throw out invention of >> negative numbers and might have to work with the unfamiliar and badly >> behaved ordering on them. C programmers have some experience with this >> ordering, but apparently not enough to usually avoid bugs. >> ... > Thanks for explaining. > > Can you explain a little bit about the badly behaved ordering of > unsigned integers? I am not familiar with that. The strongest ordering properties for real numbers depend on the existence of negative numbers (and zero). E.g., x >= y if and only if x - y >= 0. To apply that, you need the more basic property that the ordering keeps negative numbers separate from strictly positive numbers and zero. Without negative numbers, we can hope for weaker properties. One is that x1 <= x2 implies x1 + y <= x2 + y. The is true for C signed and unsigned integers if there is no overflow, but for the unsigned case overflow is often considered normal and is technically not described as overflow. Ordering for multiplication breaks down similarly. Division has complications before considering ordering, so don't consider it. Ordering for subtraction breaks down more than for addition, despite it working perfectly as a (reversible) algebraic operator for the unsigned case. Overflow causes problems as usual, and subtraction of unsigned values x - y always "overflows" if y is larger. Signed integers work especially well for subtraction if the operands are non-negative, since then it never overflows. Bruce From owner-svn-src-head@freebsd.org Sun May 22 01:29:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E30A5B3BBF4; Sun, 22 May 2016 01:29:58 +0000 (UTC) (envelope-from torek@torek.net) Received: from elf.torek.net (mail.torek.net [96.90.199.121]) (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 CD28A1F30; Sun, 22 May 2016 01:29:58 +0000 (UTC) (envelope-from torek@torek.net) Received: from elf.torek.net (localhost [127.0.0.1]) by elf.torek.net (8.14.9/8.14.9) with ESMTP id u4M1Topw010808; Sat, 21 May 2016 18:29:51 -0700 (PDT) (envelope-from torek@torek.net) Message-Id: <201605220129.u4M1Topw010808@elf.torek.net> From: Chris Torek To: Bruce Evans cc: Conrad Meyer , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300332 - in head/sys: amd64/amd64 i386/i386 In-reply-to: Your message of "Sun, 22 May 2016 10:58:05 +1000." <20160522101943.U1190@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10806.1463880590.1@elf.torek.net> Date: Sat, 21 May 2016 18:29:50 -0700 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (elf.torek.net [127.0.0.1]); Sat, 21 May 2016 18:29:51 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 01:29:59 -0000 >> Can you explain a little bit about the badly behaved ordering of >> unsigned integers? I am not familiar with that. > >The strongest ordering properties for real numbers depend on the existence >of negative numbers (and zero). E.g., x >= y if and only if x - y >= 0. >To apply that, you need the more basic property that the ordering keeps >negative numbers separate from strictly positive numbers and zero. > >Without negative numbers, we can hope for weaker properties. One is >that x1 <= x2 implies x1 + y <= x2 + y. The is true for C signed and >unsigned integers if there is no overflow, but for the unsigned case >overflow is often considered normal and is technically not described >as overflow. On the other hand, since most C compilers don't bother to trap signed integer overflow, but some can, signed integers may behave just as badly. :-) Overall I personally find the rules simpler for unsigned integers (occasionally surprising, but predictable and provable behavior in the mod-2^k ring) than for signed integers (occasionally surprising, possible trap on overflow, possible nonsense on overflow, unpredictable and hence unprovable in general). The ANSI C folks in 1989 made a mess with the "value preserving" rules where unsigned integers become signed integers if the widened type is capable of representing all the values of the narrower type, but become wider unsigned integers if the widened type is not capable of representing all these values. Even restricting operation to two's complement, 8-bit-byte, conventional systems, this means we have several realistic cases: * 16-bit int, 32-bit long, 64-bit long long ("I16L32"): unsigned char widens to signed int, but unsigned short widens to unsigned int. (This model is does not run BSD but is still used in some embedded systems.) * 32-bit int, 32-bit long, 64-bit long long ("IL32"): unsigned char and unsigned short widen to signed int; unsigned int stays unsigned. Mixing unsigned int or unsigned long with signed long long gives you signed behavior. * 32-bit int, 64-bit long, 64-bit long long ("I32L64"): mostly behaves like IL32, but mixing unsigned long with signed long long gives you unsigned behavior. The byte length of pointers may be any of these, and the short-hand notation names usually have a "P" in there, e.g., ILP32 means all are 32 bit, I32LP64 means 32-bit int but 64-bit long and pointers, and so on. Exotic machines with variable-length or variable-format pointers (depending on the data type) are rarer now, although some still make code pointers much longer than data pointers. (Some bypass the problem by using data pointers to descriptors instead of raw code pointers. That is, for void (*fp)(), fp need not point directly to the code to run: it can point instead to a data descriptor that may include both a raw code address and some sort of context, for instance.) --- Ultimately, assuming "i" and "limit" are (a) both signed, or have the same type except that "limit" is unsigned, and (b) "limit" is sane (is nonnegative), using: if (i >= 0 && i < limit) and: if ((unsigned T)i < (unsigned T)limit) do the same thing. But the second form obviously requires knowing what type-name T to insert, and knowing something about "limit" (that it is nonnegative). It used to generate significantly better code to write just the one unsigned-cast test, but these days it's better to just spell out the ">= 0" and let the compiler optimize when possible. Chris From owner-svn-src-head@freebsd.org Sun May 22 01:45:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC28CB4305A; Sun, 22 May 2016 01:45:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 962471767; Sun, 22 May 2016 01:45:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M1jFxl074851; Sun, 22 May 2016 01:45:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M1jFaS074850; Sun, 22 May 2016 01:45:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605220145.u4M1jFaS074850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 May 2016 01:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300385 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 01:45:16 -0000 Author: ngie Date: Sun May 22 01:45:15 2016 New Revision: 300385 URL: https://svnweb.freebsd.org/changeset/base/300385 Log: Don't leak `tmp` if `p->nc_lookups` can't be malloced MFC after: 1 week Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/getnetconfig.c Modified: head/lib/libc/rpc/getnetconfig.c ============================================================================== --- head/lib/libc/rpc/getnetconfig.c Sun May 22 00:29:25 2016 (r300384) +++ head/lib/libc/rpc/getnetconfig.c Sun May 22 01:45:15 2016 (r300385) @@ -722,6 +722,7 @@ dup_ncp(struct netconfig *ncp) if (p->nc_lookups == NULL) { free(p->nc_netid); free(p); + free(tmp); return(NULL); } for (i=0; i < p->nc_nlookups; i++) { From owner-svn-src-head@freebsd.org Sun May 22 02:02:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 833A4B433B2; Sun, 22 May 2016 02:02:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53BA61F10; Sun, 22 May 2016 02:02:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M22IZN080751; Sun, 22 May 2016 02:02:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M22IYe080750; Sun, 22 May 2016 02:02:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605220202.u4M22IYe080750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 May 2016 02:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300386 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 02:02:19 -0000 Author: ngie Date: Sun May 22 02:02:18 2016 New Revision: 300386 URL: https://svnweb.freebsd.org/changeset/base/300386 Log: Don't leak `handle` if svc_tp_create(..) succeeds and allocating a new struct xlist object fails MFC after: 1 week Reported by: Coverity CID: 978277 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/svc_generic.c Modified: head/lib/libc/rpc/svc_generic.c ============================================================================== --- head/lib/libc/rpc/svc_generic.c Sun May 22 01:45:15 2016 (r300385) +++ head/lib/libc/rpc/svc_generic.c Sun May 22 02:02:18 2016 (r300386) @@ -122,7 +122,8 @@ svc_create(void (*dispatch)(struct svc_r if (l == NULL) { warnx("svc_create: no memory"); mutex_unlock(&xprtlist_lock); - return (0); + num = 0; + goto done; } l->xprt = xprt; l->next = xprtlist; @@ -132,6 +133,7 @@ svc_create(void (*dispatch)(struct svc_r } mutex_unlock(&xprtlist_lock); } +done: __rpc_endconf(handle); /* * In case of num == 0; the error messages are generated by the From owner-svn-src-head@freebsd.org Sun May 22 02:15:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83392B436C9; Sun, 22 May 2016 02:15:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 4F36B1450; Sun, 22 May 2016 02:15:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 2FB56782F47; Sun, 22 May 2016 12:15:41 +1000 (AEST) Date: Sun, 22 May 2016 12:15:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300384 - head/sys/compat/ndis In-Reply-To: <201605220029.u4M0TPI6050123@repo.freebsd.org> Message-ID: <20160522112323.N1388@besplex.bde.org> References: <201605220029.u4M0TPI6050123@repo.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=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=E5bWiKrETEzLNUIpf3EA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 02:15:52 -0000 On Sun, 22 May 2016, Pedro F. Giffuni wrote: > Log: > ndis(4): adjustments for our random() specific implementation. > > - Revert r300377: The implementation claims to return a value > within the range. [1] > - Adjust the value for the case of a zero seed, whihc according > to standards should be equivalent to a seed of value 1. This was already correct. Standards don't say that a seed of 0 for srand() means the same as a seed of 1 passed to srand(). They say that if srand() is not called, then the sequence shall be the same as if it had been called with a seed of 1. This is already implemented by using an internal initial value of the seed that is the result of srand(1). The commit gives the following bugs: - srand() is less random. srand(0) now gives the same sequence as srand(0) - srand(0) is not binary compatible. My previous mail pointed out the version in libc is the kernel version with some bugs fixed. It also has some regressions. In the libc version, srand(seed) sets the internal seed almost directly (it just adds 1 for technical reasons). The kernel version advances the seed through 50 iterations of random(). This doesn't really increase randomness but it makes the linearity relation in the LCG less obvious. Bruce From owner-svn-src-head@freebsd.org Sun May 22 02:24:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9505EB43A30; Sun, 22 May 2016 02:24:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BC301A3E; Sun, 22 May 2016 02:24:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M2OcAG087001; Sun, 22 May 2016 02:24:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M2Ocs2087000; Sun, 22 May 2016 02:24:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605220224.u4M2Ocs2087000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 May 2016 02:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300387 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 02:24:39 -0000 Author: ngie Date: Sun May 22 02:24:38 2016 New Revision: 300387 URL: https://svnweb.freebsd.org/changeset/base/300387 Log: getnetid(..): consistently fclose fd at the end of the function This mutes a false positive with cppcheck, but also helps eliminate future potential issues with this variable MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/netnamer.c Modified: head/lib/libc/rpc/netnamer.c ============================================================================== --- head/lib/libc/rpc/netnamer.c Sun May 22 02:02:18 2016 (r300386) +++ head/lib/libc/rpc/netnamer.c Sun May 22 02:24:38 2016 (r300387) @@ -243,6 +243,9 @@ getnetid(char *key, char *ret) char *lookup; int len; #endif + int rv; + + rv = 0; fd = fopen(NETIDFILE, "r"); if (fd == NULL) { @@ -253,13 +256,11 @@ getnetid(char *key, char *ret) return (0); #endif } - for (;;) { - if (fd == NULL) - return (0); /* getnetidyp brings us here */ + while (fd != NULL) { res = fgets(buf, sizeof(buf), fd); if (res == NULL) { - fclose(fd); - return (0); + rv = 0; + goto done; } if (res[0] == '#') continue; @@ -282,9 +283,8 @@ getnetid(char *key, char *ret) lookup[len] = 0; strcpy(ret, lookup); free(lookup); - if (fd != NULL) - fclose(fd); - return (2); + rv = 2; + goto done; #else /* YP */ #ifdef DEBUG fprintf(stderr, @@ -310,10 +310,14 @@ getnetid(char *key, char *ret) } if (strcmp(mkey, key) == 0) { strcpy(ret, mval); - fclose(fd); - return (1); - + rv = 1; + goto done; } } } + +done: + if (fd != NULL) + fclose(fd); + return (rv); } From owner-svn-src-head@freebsd.org Sun May 22 02:43:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5536CB43DC8 for ; Sun, 22 May 2016 02:43:31 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F259112D3 for ; Sun, 22 May 2016 02:43:30 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f65.google.com with SMTP id p10so4590086lfb.2 for ; Sat, 21 May 2016 19:43: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:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=CuZHZSSB4p1fh5P81EYerCM+1/6rCj2QECk3nZLMt0c=; b=gGCPywCHRwOox/UCoQehPLR3QAM23KQH9TroSX5WDXjPX6IAxNz9r2kL+P4eSHZV17 XRLyTRHPZ8/Veqjj9yuYolQ3s0q46iD9Zie2DcMCnRqpUH9vhLoRKUjQl5KkvWUrtkXO rZN/qWCIMJMrKuzY+x1J795INft8dT9pxjTuMkEIQuaIo2+ycXmIGkYqLFzFUdhj3Nys Dn4yQIE/oUsap/AA4vtcuI9Laz9fMHtqE4xEquhuHdDemhrvO6nqZ8TIQVOqGAbogHFa m6bEp8Ho0JDlT6vUXhqKa4z+jBPOC3pB3GOVicjFF4ClEggCt3dArsUbfOWatPqfPMrY CZgw== X-Gm-Message-State: ALyK8tIXIVx6eCM/xtQMZRTm32Shv4SnBfWBFeTk3uIPytZ4UVIDODWGrALfhDrTD7wBSQ== X-Received: by 10.25.77.195 with SMTP id a186mr2263990lfb.159.1463885003394; Sat, 21 May 2016 19:43:23 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id d63sm3069447lfb.48.2016.05.21.19.43.22 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 May 2016 19:43:22 -0700 (PDT) Subject: Re: svn commit: r300377 - head/sys/compat/ndis To: Bruce Evans , Pedro Giffuni References: <201605211752.u4LHqiHQ031457@repo.freebsd.org> <262938a6-50bd-b6f4-24c9-895b837a368e@FreeBSD.org> <20160522091455.A1014@besplex.bde.org> Cc: cem@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <8bd5428f-6955-72c3-0294-72f7ef936e16@freebsd.org> Date: Sun, 22 May 2016 05:43:20 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160522091455.A1014@besplex.bde.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 02:43:31 -0000 On 22.05.2016 3:06, Bruce Evans wrote: > On Sat, 21 May 2016, Pedro Giffuni wrote: > >> On 05/21/16 16:55, Conrad Meyer wrote: >>> On Sat, May 21, 2016 at 1:40 PM, Pedro Giffuni wrote: >>>> >>>> >>>> On 05/21/16 14:05, Conrad Meyer wrote: >>>>> Won't this still return a negative integer in many cases? >>>>> >>>>> random(9) returns u_long, whereas this rand() routine returns 'int'. >>>>> >>>>> Even on architectures where long is the same size as ordinary >>>>> integers, the range of possible results of the 'random() / 2 + 1' >>>>> expression, before implicit cast to signed, is [1, 2^31] (inclusive). >>>> >>>> According to: >>>> sys/libkern/random.c >>>> >>>> The result is uniform on [0, 2^31 - 1]. >>> >>> Ah, I missed that. Sorry! In that case, I'm not sure why this is >>> needed — the result fits in a non-negative 2's complement signed >>> integer. >> >> Actually, I had missed it too. And I also had no idea we were working >> around the zero singularity. >> >> I will revert the change and will do an adjustment for the case where >> we use 0 as a seed (which in MS should be equivalent to 1). > > The libc version has complications related to this. The libkern > version has rotted by not being kept up to date with the libc version. > 4.4BSD-Lite has sort of the reverse bitrot -- in libc, it only has the > bad LCG that copied from an example in the 1990 C standard, while > it has the better LCG copied from 1988 Communications in the ACM in > libkern. > FreeBSD still has the ACM version in libkern, and has a fixed copy > of that in libc, with the bad old version under an ifdef. > > The libc version now adjusts the range from [0, 0x7fffffff] to > 0, 0x7ffffffd] and reduces RAND_MAX by 2 to match. The claimed uniformity > for the larger range is very wrong, since the ACM algorithm can only > produce numbers in the range [1(or is it 0?), 0x7ffffffe] starting from a > seed in the range [1, 0x7ffffffe(or is it 1 higher?)]. There are problems > at both extremities, and it isn't clear if the new or old adjustments to > avoid them preserve uniformity. It is clear that the range was at least > 1 too high, since the ACM algorithm does a modulo by 0x7fffffff. libc version does range adjustment for better uniformity only for rand(3), not for random(3). There is no RAND_MAX constant in the random(3) API. POSIX require that random(3) should stay in [0, 2^31-1]. From owner-svn-src-head@freebsd.org Sun May 22 02:52:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE80BB3B0BF for ; Sun, 22 May 2016 02:52:19 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lb0-f193.google.com (mail-lb0-f193.google.com [209.85.217.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 435F019C2 for ; Sun, 22 May 2016 02:52:18 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lb0-f193.google.com with SMTP id mx9so7414841lbb.2 for ; Sat, 21 May 2016 19:52:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=cm2CZxXkYU2IicJHMe6FExtcQ1nEhROEagDaHKmLTy8=; b=NiQ4t7hByhsU5qEZQqar1S6rVnI0I+xYkHP9hIKNrxA3HJybvqAKttE070DkSN5/bK axXFlNIMV9YDgDru2G3UxhUgR7aDurrNX4N8ckVmq2MTB/aXpr31Oh+EspC21MUtMcty LomfwnD3BDMVJ4QLtDwyz7/6MsGqFIqoo50zeVwjyXlDoEy/6Dcl/9a00FA8qHY+oeBm bnnfIAMHOzFZrE+S/APRPNIHclaWlSt5Mwe6Au+c3kIvDpQqMETYEF2QoZaTVnoPMXPq jX7K4NIY2an+W5EMQbD79HhGytI7ahigO6TUkwlewiBm9TDOj7UUbns/e8sMWUsPnlr7 p5dQ== X-Gm-Message-State: AOPr4FUJcSSoEz7wFzsbzn77axi8zHhLh/nYGB3JPYpD03exMlX38NgIF0eHIM/EATYELA== X-Received: by 10.112.65.71 with SMTP id v7mr3655138lbs.52.1463881566943; Sat, 21 May 2016 18:46:06 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id dw6sm4466361lbc.10.2016.05.21.18.46.05 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 May 2016 18:46:06 -0700 (PDT) Subject: Re: svn commit: r300384 - head/sys/compat/ndis To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605220029.u4M0TPI6050123@repo.freebsd.org> From: Andrey Chernov Message-ID: <82b74a0b-7551-31ed-6b89-42925e072900@freebsd.org> Date: Sun, 22 May 2016 04:46:03 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605220029.u4M0TPI6050123@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 02:52:19 -0000 On 22.05.2016 3:29, Pedro F. Giffuni wrote: > static void > srand(unsigned int seed) > { > > + if (seed == 0) > + seed = 1; > srandom(seed); > } IMHO it is not needed. srandom() already handles seed == 0 case, there is no point to remap it to another constant. From owner-svn-src-head@freebsd.org Sun May 22 02:53:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD237B3B0EF; Sun, 22 May 2016 02:53:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AE971A0D; Sun, 22 May 2016 02:53:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M2rBHZ095911; Sun, 22 May 2016 02:53:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M2rBIS095910; Sun, 22 May 2016 02:53:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605220253.u4M2rBIS095910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 May 2016 02:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300388 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 02:53:12 -0000 Author: ngie Date: Sun May 22 02:53:11 2016 New Revision: 300388 URL: https://svnweb.freebsd.org/changeset/base/300388 Log: Call endnetconfig on nc_handle sooner to avoid leaking nc_handle if tmpnconf was NULL This would theoretically happen if the netconfig protocol family and protocol semantics were never matched. MFC after: 2 weeks Reported by: Coverity CID: 978179 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/rpcb_clnt.c Modified: head/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- head/lib/libc/rpc/rpcb_clnt.c Sun May 22 02:24:38 2016 (r300387) +++ head/lib/libc/rpc/rpcb_clnt.c Sun May 22 02:53:11 2016 (r300388) @@ -499,6 +499,7 @@ try_nconf: hostname = IN6_LOCALHOST_STRING; } } + endnetconfig(nc_handle); if (tmpnconf == NULL) { rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; mutex_unlock(&loopnconf_lock); @@ -506,7 +507,6 @@ try_nconf: } loopnconf = getnetconfigent(tmpnconf->nc_netid); /* loopnconf is never freed */ - endnetconfig(nc_handle); } mutex_unlock(&loopnconf_lock); client = getclnthandle(hostname, loopnconf, NULL); From owner-svn-src-head@freebsd.org Sun May 22 02:54:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C91B3B154 for ; Sun, 22 May 2016 02:54:33 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1.freebsd.org (Postfix) with SMTP id 0DFC91BA6 for ; Sun, 22 May 2016 02:54:32 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: (qmail 63232 invoked by uid 99); 22 May 2016 02:54:26 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 May 2016 02:54:26 +0000 Received: from [192.168.0.100] (unknown [181.55.232.163]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id D2BB31A0118; Sun, 22 May 2016 02:54:24 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r300384 - head/sys/compat/ndis From: Pedro Giffuni In-Reply-To: <20160522112323.N1388@besplex.bde.org> Date: Sat, 21 May 2016 21:54:22 -0500 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <214223B1-89C7-403B-84F1-8F9B539D29C5@freebsd.org> References: <201605220029.u4M0TPI6050123@repo.freebsd.org> <20160522112323.N1388@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 02:54:33 -0000 > Il giorno 21/mag/2016, alle ore 21:15, Bruce Evans = ha scritto: >=20 > On Sun, 22 May 2016, Pedro F. Giffuni wrote: >=20 >> Log: >> ndis(4): adjustments for our random() specific implementation. >>=20 >> - Revert r300377: The implementation claims to return a value >> within the range. [1] >> - Adjust the value for the case of a zero seed, whihc according >> to standards should be equivalent to a seed of value 1. >=20 > This was already correct. Standards don't say that a seed of 0 for > srand() means the same as a seed of 1 passed to srand(). They say > that if srand() is not called, then the sequence shall be the same > as if it had been called with a seed of 1. This is already > implemented by using an internal initial value of the seed that is > the result of srand(1). >=20 OK. I misunderstood the standard. I will revert the if seed thing. (Tomorrow). > The commit gives the following bugs: > - srand() is less random. srand(0) now gives the same sequence as > srand(0) > - srand(0) is not binary compatible. >=20 > My previous mail pointed out the version in libc is the kernel version > with some bugs fixed. It also has some regressions. In the libc > version, srand(seed) sets the internal seed almost directly (it just > adds 1 for technical reasons). The kernel version advances the seed > through 50 iterations of random(). This doesn't really increase > randomness but it makes the linearity relation in the LCG less = obvious. >=20 Merging both is out of scope from what I expected to be a much simpler cleanup for ndis(4). I would have liked to replace completely random() with something like Mersenne Twister + unpredictable seed but that is basically a waste of time: developers seem sufficiently happy with random() and when not arc4random() can be used. :-/ Thanks for all this feedback. Pedro. >=20 From owner-svn-src-head@freebsd.org Sun May 22 03:05:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8966CB3B503; Sun, 22 May 2016 03:05:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A3DF16AC; Sun, 22 May 2016 03:05:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M35RVH099531; Sun, 22 May 2016 03:05:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M35RTW099530; Sun, 22 May 2016 03:05:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605220305.u4M35RTW099530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 May 2016 03:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300389 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 03:05:28 -0000 Author: ngie Date: Sun May 22 03:05:27 2016 New Revision: 300389 URL: https://svnweb.freebsd.org/changeset/base/300389 Log: nis_rpcent: don't leak resultbuf from yp_first(..)/yp_next(..) If the buffer couldn't be adequately resized to accomodate an additional "\n", it would leak resultbuf by breaking from the loop early MFC after: 2 weeks Reported by: Coverity CID: 1016702 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/getrpcent.c Modified: head/lib/libc/rpc/getrpcent.c ============================================================================== --- head/lib/libc/rpc/getrpcent.c Sun May 22 02:53:11 2016 (r300388) +++ head/lib/libc/rpc/getrpcent.c Sun May 22 03:05:27 2016 (r300389) @@ -511,6 +511,7 @@ nis_rpcent(void *retval, void *mdata, va sizeof(char *)) { *errnop = ERANGE; rv = NS_RETURN; + free(resultbuf); break; } @@ -520,6 +521,7 @@ nis_rpcent(void *retval, void *mdata, va if (aliases_size < 1) { *errnop = ERANGE; rv = NS_RETURN; + free(resultbuf); break; } From owner-svn-src-head@freebsd.org Sun May 22 03:10:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED116B3B57B; Sun, 22 May 2016 03:10:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id A6A29186D; Sun, 22 May 2016 03:10:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 521241A28E2; Sun, 22 May 2016 13:10:10 +1000 (AEST) Date: Sun, 22 May 2016 13:10:09 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Bruce Evans , Pedro Giffuni , cem@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300377 - head/sys/compat/ndis In-Reply-To: <8bd5428f-6955-72c3-0294-72f7ef936e16@freebsd.org> Message-ID: <20160522124923.I1697@besplex.bde.org> References: <201605211752.u4LHqiHQ031457@repo.freebsd.org> <262938a6-50bd-b6f4-24c9-895b837a368e@FreeBSD.org> <20160522091455.A1014@besplex.bde.org> <8bd5428f-6955-72c3-0294-72f7ef936e16@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=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=8wdhbwkFtMgtjcdClAAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 03:10:13 -0000 On Sun, 22 May 2016, Andrey Chernov wrote: > On 22.05.2016 3:06, Bruce Evans wrote: >> ... >> FreeBSD still has the ACM version in libkern, and has a fixed copy >> of that in libc, with the bad old version under an ifdef. >> >> The libc version now adjusts the range from [0, 0x7fffffff] to >> 0, 0x7ffffffd] and reduces RAND_MAX by 2 to match. The claimed uniformity >> for the larger range is very wrong, since the ACM algorithm can only >> produce numbers in the range [1(or is it 0?), 0x7ffffffe] starting from a >> seed in the range [1, 0x7ffffffe(or is it 1 higher?)]. There are problems >> at both extremities, and it isn't clear if the new or old adjustments to >> avoid them preserve uniformity. It is clear that the range was at least >> 1 too high, since the ACM algorithm does a modulo by 0x7fffffff. > > libc version does range adjustment for better uniformity only for > rand(3), not for random(3). There is no RAND_MAX constant in the > random(3) API. POSIX require that random(3) should stay in [0, 2^31-1]. The one in the kernel is random(9) being used to implement rand(9). This doesn't have to conform to POSIX or be very good. random(9) is actually really rand(9) under a different name. It uses a LCG with a small period, but random(3) is specified to be the BSD one, with wording too similar to that in the FreeBSD man page -- it must use a nonlinear method with a default period of 16 times larger than 2**31-1, and must give a period larger than 2**69 with a state table size of 256. The default should have been changed to much more than 16 times larger long before POSIX standardized the 1980's default. Bruce From owner-svn-src-head@freebsd.org Sun May 22 03:12:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54AB1B3B724; Sun, 22 May 2016 03:12:50 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 220DC1CFB; Sun, 22 May 2016 03:12:50 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M3CnDN002553; Sun, 22 May 2016 03:12:49 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M3CnMb002552; Sun, 22 May 2016 03:12:49 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201605220312.u4M3CnMb002552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 22 May 2016 03:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300390 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 03:12:50 -0000 Author: loos Date: Sun May 22 03:12:49 2016 New Revision: 300390 URL: https://svnweb.freebsd.org/changeset/base/300390 Log: Fix probe routine to return BUS_PROBE_DEFAULT instead of BUS_PROBE_SPECIFIC. While here fix a few style(9) issues. Modified: head/sys/dev/gpio/gpioled.c Modified: head/sys/dev/gpio/gpioled.c ============================================================================== --- head/sys/dev/gpio/gpioled.c Sun May 22 03:05:27 2016 (r300389) +++ head/sys/dev/gpio/gpioled.c Sun May 22 03:12:49 2016 (r300390) @@ -54,12 +54,11 @@ __FBSDID("$FreeBSD$"); */ #define GPIOLED_PIN 0 -#define GPIOLED_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define GPIOLED_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define GPIOLED_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define GPIOLED_LOCK_INIT(_sc) \ - mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ - "gpioled", MTX_DEF) -#define GPIOLED_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define GPIOLED_LOCK_INIT(_sc) mtx_init(&(_sc)->sc_mtx, \ + device_get_nameunit((_sc)->sc_dev), "gpioled", MTX_DEF) +#define GPIOLED_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) struct gpioled_softc { @@ -159,7 +158,7 @@ gpioled_probe(device_t dev) #endif device_set_desc(dev, "GPIO led"); - return (0); + return (BUS_PROBE_DEFAULT); } static int From owner-svn-src-head@freebsd.org Sun May 22 03:34:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16C20B3BB25; Sun, 22 May 2016 03:34:20 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B51A614FF; Sun, 22 May 2016 03:34:19 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M3YI2u008753; Sun, 22 May 2016 03:34:18 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M3YIgG008752; Sun, 22 May 2016 03:34:18 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201605220334.u4M3YIgG008752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 22 May 2016 03:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300391 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 03:34:20 -0000 Author: loos Date: Sun May 22 03:34:18 2016 New Revision: 300391 URL: https://svnweb.freebsd.org/changeset/base/300391 Log: Use a better prefix for defines, return BUS_PROBE_DEFAULT for probe routine. Refuse to attach if the number of given pins is not enough for our needs. Modified: head/sys/dev/gpio/gpioiic.c Modified: head/sys/dev/gpio/gpioiic.c ============================================================================== --- head/sys/dev/gpio/gpioiic.c Sun May 22 03:12:49 2016 (r300390) +++ head/sys/dev/gpio/gpioiic.c Sun May 22 03:34:18 2016 (r300391) @@ -53,8 +53,9 @@ __FBSDID("$FreeBSD$"); #include "iicbb_if.h" -#define SCL_PIN_DEFAULT 0 /* default index of SCL pin on gpiobus */ -#define SDA_PIN_DEFAULT 1 +#define GPIOIIC_SCL_DFLT 0 +#define GPIOIIC_SDA_DFLT 1 +#define GPIOIIC_MIN_PINS 2 struct gpioiic_softc { @@ -79,14 +80,24 @@ static int gpioiic_reset(device_t, u_cha static int gpioiic_probe(device_t dev) { + struct gpiobus_ivar *devi; #ifdef FDT + if (!ofw_bus_status_okay(dev)) + return (ENXIO); if (!ofw_bus_is_compatible(dev, "gpioiic")) return (ENXIO); #endif + devi = GPIOBUS_IVAR(dev); + if (devi->npins < GPIOIIC_MIN_PINS) { + device_printf(dev, + "gpioiic needs at least %d GPIO pins (only %d given).\n", + GPIOIIC_MIN_PINS, devi->npins); + return (ENXIO); + } device_set_desc(dev, "GPIO I2C bit-banging driver"); - return (0); + return (BUS_PROBE_DEFAULT); } static int @@ -105,10 +116,10 @@ gpioiic_attach(device_t dev) sc->sc_busdev = device_get_parent(dev); if (resource_int_value(device_get_name(dev), device_get_unit(dev), "scl", &sc->scl_pin)) - sc->scl_pin = SCL_PIN_DEFAULT; + sc->scl_pin = GPIOIIC_SCL_DFLT; if (resource_int_value(device_get_name(dev), device_get_unit(dev), "sda", &sc->sda_pin)) - sc->sda_pin = SDA_PIN_DEFAULT; + sc->sda_pin = GPIOIIC_SDA_DFLT; #ifdef FDT if ((node = ofw_bus_get_node(dev)) == -1) @@ -120,9 +131,9 @@ gpioiic_attach(device_t dev) #endif if (sc->scl_pin < 0 || sc->scl_pin > 1) - sc->scl_pin = SCL_PIN_DEFAULT; + sc->scl_pin = GPIOIIC_SCL_DFLT; if (sc->sda_pin < 0 || sc->sda_pin > 1) - sc->sda_pin = SDA_PIN_DEFAULT; + sc->sda_pin = GPIOIIC_SDA_DFLT; devi = GPIOBUS_IVAR(dev); device_printf(dev, "SCL pin: %d, SDA pin: %d\n", From owner-svn-src-head@freebsd.org Sun May 22 03:55:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAB67B410B1; Sun, 22 May 2016 03:55:58 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DEA91DDE; Sun, 22 May 2016 03:55:58 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M3tvss014895; Sun, 22 May 2016 03:55:57 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M3tvsM014893; Sun, 22 May 2016 03:55:57 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201605220355.u4M3tvsM014893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 22 May 2016 03:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300392 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 03:55:59 -0000 Author: loos Date: Sun May 22 03:55:57 2016 New Revision: 300392 URL: https://svnweb.freebsd.org/changeset/base/300392 Log: Get rid of two consumers of gpiobus acquire/release. The GPIO hardware should not be owned by a single device, this defeats any chance of use of the GPIO controller as an interrupt source. ow(4) is now the only consumer of this 'feature' before we can remove it for good. Discussed with: ian, bsdimp Modified: head/sys/dev/gpio/gpioiic.c head/sys/dev/gpio/gpioled.c Modified: head/sys/dev/gpio/gpioiic.c ============================================================================== --- head/sys/dev/gpio/gpioiic.c Sun May 22 03:34:18 2016 (r300391) +++ head/sys/dev/gpio/gpioiic.c Sun May 22 03:55:57 2016 (r300392) @@ -70,7 +70,6 @@ static int gpioiic_attach(device_t); /* iicbb interface */ static void gpioiic_reset_bus(device_t); -static int gpioiic_callback(device_t, int, caddr_t); static void gpioiic_setsda(device_t, int); static void gpioiic_setscl(device_t, int); static int gpioiic_getsda(device_t); @@ -161,30 +160,6 @@ gpioiic_reset_bus(device_t dev) GPIO_PIN_INPUT); } -static int -gpioiic_callback(device_t dev, int index, caddr_t data) -{ - struct gpioiic_softc *sc = device_get_softc(dev); - int error, how; - - how = GPIOBUS_DONTWAIT; - if (data != NULL && *(int*)data == IIC_WAIT) - how = GPIOBUS_WAIT; - error = 0; - switch (index) { - case IIC_REQUEST_BUS: - error = GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev, how); - break; - case IIC_RELEASE_BUS: - GPIOBUS_RELEASE_BUS(sc->sc_busdev, sc->sc_dev); - break; - default: - error = EINVAL; - } - - return (error); -} - static void gpioiic_setsda(device_t dev, int val) { @@ -271,7 +246,6 @@ static device_method_t gpioiic_methods[] DEVMETHOD(device_detach, bus_generic_detach), /* iicbb interface */ - DEVMETHOD(iicbb_callback, gpioiic_callback), DEVMETHOD(iicbb_setsda, gpioiic_setsda), DEVMETHOD(iicbb_setscl, gpioiic_setscl), DEVMETHOD(iicbb_getsda, gpioiic_getsda), Modified: head/sys/dev/gpio/gpioled.c ============================================================================== --- head/sys/dev/gpio/gpioled.c Sun May 22 03:34:18 2016 (r300391) +++ head/sys/dev/gpio/gpioled.c Sun May 22 03:55:57 2016 (r300392) @@ -76,23 +76,15 @@ static int gpioled_detach(device_t); static void gpioled_control(void *priv, int onoff) { - int error; struct gpioled_softc *sc; sc = (struct gpioled_softc *)priv; GPIOLED_LOCK(sc); - error = GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev, - GPIOBUS_DONTWAIT); - if (error != 0) { - GPIOLED_UNLOCK(sc); - return; - } - error = GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, - GPIOLED_PIN, GPIO_PIN_OUTPUT); - if (error == 0) + if (GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, GPIOLED_PIN, + GPIO_PIN_OUTPUT) == 0) { GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, GPIOLED_PIN, onoff ? GPIO_PIN_HIGH : GPIO_PIN_LOW); - GPIOBUS_RELEASE_BUS(sc->sc_busdev, sc->sc_dev); + } GPIOLED_UNLOCK(sc); } From owner-svn-src-head@freebsd.org Sun May 22 04:02:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35C5FB41237; Sun, 22 May 2016 04:02:36 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF4FB1193; Sun, 22 May 2016 04:02:35 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M42Z3Y017779; Sun, 22 May 2016 04:02:35 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M42Z2u017778; Sun, 22 May 2016 04:02:35 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201605220402.u4M42Z2u017778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 22 May 2016 04:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300393 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 04:02:36 -0000 Author: loos Date: Sun May 22 04:02:34 2016 New Revision: 300393 URL: https://svnweb.freebsd.org/changeset/base/300393 Log: Sort and remove a couple of unnecessary headers. Modified: head/sys/dev/gpio/gpioiic.c Modified: head/sys/dev/gpio/gpioiic.c ============================================================================== --- head/sys/dev/gpio/gpioiic.c Sun May 22 03:55:57 2016 (r300392) +++ head/sys/dev/gpio/gpioiic.c Sun May 22 04:02:34 2016 (r300393) @@ -33,24 +33,20 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include -#include -#include "gpiobus_if.h" - #ifdef FDT -#include -#include #include +#include #endif #include - #include #include +#include "gpiobus_if.h" #include "iicbb_if.h" #define GPIOIIC_SCL_DFLT 0 From owner-svn-src-head@freebsd.org Sun May 22 04:09:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ABEBB414CF; Sun, 22 May 2016 04:09:07 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBEC0166A; Sun, 22 May 2016 04:09:06 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M496V0018034; Sun, 22 May 2016 04:09:06 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M495ZP018032; Sun, 22 May 2016 04:09:05 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201605220409.u4M495ZP018032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 22 May 2016 04:09:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300394 - head/sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 04:09:07 -0000 Author: loos Date: Sun May 22 04:09:05 2016 New Revision: 300394 URL: https://svnweb.freebsd.org/changeset/base/300394 Log: Remove a couple of extra blank lines. Modified: head/sys/dev/iicbus/iicbb_if.m head/sys/dev/iicbus/iiconf.c Modified: head/sys/dev/iicbus/iicbb_if.m ============================================================================== --- head/sys/dev/iicbus/iicbb_if.m Sun May 22 04:02:34 2016 (r300393) +++ head/sys/dev/iicbus/iicbb_if.m Sun May 22 04:09:05 2016 (r300394) @@ -42,7 +42,6 @@ CODE { static void null_post_xfer(device_t dev) - { } Modified: head/sys/dev/iicbus/iiconf.c ============================================================================== --- head/sys/dev/iicbus/iiconf.c Sun May 22 04:02:34 2016 (r300393) +++ head/sys/dev/iicbus/iiconf.c Sun May 22 04:09:05 2016 (r300394) @@ -136,7 +136,6 @@ iicbus_request_bus(device_t bus, device_ } } - IICBUS_UNLOCK(sc); return (error); From owner-svn-src-head@freebsd.org Sun May 22 04:17:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41E3BB417E8; Sun, 22 May 2016 04:17:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EDCE1ACB; Sun, 22 May 2016 04:17:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M4H25b020953; Sun, 22 May 2016 04:17:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M4H12O020940; Sun, 22 May 2016 04:17:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605220417.u4M4H12O020940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 May 2016 04:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300395 - head/contrib/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 04:17:03 -0000 Author: ngie Date: Sun May 22 04:17:00 2016 New Revision: 300395 URL: https://svnweb.freebsd.org/changeset/base/300395 Log: Silence top(1) compiler warnings The contrib/top code is no longer maintained upstream (last pulled 16 years ago). The K&R-style followed by the code spews -Wimplicit-int and -Wreturn-type warnings, amongst others. This silences 131 warnings with as little modification as possible by adding necessary return types, definitions, headers, and header guards, and missing header includes. The 5 warnings that remain are due to undeclared ncurses references. I didn't include curses.h and term.h because there are several local functions and macros that conflict with those definitions. MFC after: 3 weeks Reviewed by: cem, ngie Submitted by: Randy Westlund Differential Revision: https://reviews.freebsd.org/D6468 Added: head/contrib/top/commands.h (contents, props changed) head/contrib/top/username.h (contents, props changed) Modified: head/contrib/top/commands.c head/contrib/top/display.c head/contrib/top/display.h head/contrib/top/machine.h head/contrib/top/screen.c head/contrib/top/screen.h head/contrib/top/top.c head/contrib/top/top.h head/contrib/top/username.c head/contrib/top/utils.h head/contrib/top/version.c Modified: head/contrib/top/commands.c ============================================================================== --- head/contrib/top/commands.c Sun May 22 04:09:05 2016 (r300394) +++ head/contrib/top/commands.c Sun May 22 04:17:00 2016 (r300395) @@ -19,16 +19,21 @@ */ #include "os.h" -#include -#include -#include + #include #include +#include +#include +#include +#include + +#include "commands.h" #include "sigdesc.h" /* generated automatically */ #include "top.h" #include "boolean.h" #include "utils.h" +#include "machine.h" extern int errno; @@ -39,12 +44,15 @@ extern int overstrike; int err_compar(); char *err_string(); +static int str_adderr(char *str, int len, int err); +static int str_addarg(char *str, int len, char *arg, int first); /* * show_help() - display the help screen; invoked in response to * either 'h' or '?'. */ +void show_help() { @@ -123,6 +131,7 @@ register char *str; return(*str == '\0' ? NULL : str); } +int scanint(str, intp) char *str; @@ -262,6 +271,7 @@ char *err_string() * the string "str". */ +static int str_adderr(str, len, err) char *str; @@ -289,6 +299,7 @@ int err; * is set (indicating that a comma should NOT be added to the front). */ +static int str_addarg(str, len, arg, first) char *str; @@ -321,6 +332,7 @@ int first; * for sorting errors. */ +int err_compar(p1, p2) register struct errs *p1, *p2; @@ -339,6 +351,7 @@ register struct errs *p1, *p2; * error_count() - return the number of errors currently logged. */ +int error_count() { @@ -349,6 +362,7 @@ error_count() * show_errors() - display on stdout the current log of errors. */ +void show_errors() { Added: head/contrib/top/commands.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/top/commands.h Sun May 22 04:17:00 2016 (r300395) @@ -0,0 +1,21 @@ +/* + * Top users/processes display for Unix + * Version 3 + * + * This program may be freely redistributed, + * but this entire comment MUST remain intact. + * + * Copyright (c) 1984, 1989, William LeFebvre, Rice University + * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University + * Copyright (c) 2016, Randy Westlund + * + * $FreeBSD$ + */ +#ifndef COMMANDS_H +#define COMMANDS_H + +void show_errors(void); +int error_count(void); +void show_help(void); + +#endif /* COMMANDS_H */ Modified: head/contrib/top/display.c ============================================================================== --- head/contrib/top/display.c Sun May 22 04:09:05 2016 (r300394) +++ head/contrib/top/display.c Sun May 22 04:17:00 2016 (r300395) @@ -29,9 +29,12 @@ */ #include "os.h" + +#include + #include #include -#include +#include #include "screen.h" /* interface to screen package */ #include "layout.h" /* defines for screen position layout */ @@ -56,7 +59,6 @@ static int display_width = MAX_COLS; #define lineindex(l) ((l)*display_width) -char *printable(); /* things initialized by display_init and used thruout */ @@ -239,6 +241,7 @@ struct statics *statics; return(lines); } +void i_loadave(mpid, avenrun) int mpid; @@ -267,6 +270,7 @@ double *avenrun; lmpid = mpid; } +void u_loadave(mpid, avenrun) int mpid; @@ -306,6 +310,7 @@ double *avenrun; } } +void i_timeofday(tod) time_t *tod; @@ -351,6 +356,7 @@ static char procstates_buffer[MAX_COLS]; * lastline is valid */ +void i_procstates(total, brkdn) int total; @@ -378,6 +384,7 @@ int *brkdn; memcpy(lprocstates, brkdn, num_procstates * sizeof(int)); } +void u_procstates(total, brkdn) int total; @@ -460,9 +467,10 @@ char *cpustates_tag() } #endif +void i_cpustates(states) -register int *states; +int *states; { register int i = 0; @@ -505,9 +513,10 @@ for (cpu = 0; cpu < num_cpus; cpu++) { memcpy(lcpustates, states, num_cpustates * sizeof(int) * num_cpus); } +void u_cpustates(states) -register int *states; +int *states; { register int value; @@ -557,6 +566,7 @@ for (cpu = 0; cpu < num_cpus; cpu++) { } } +void z_cpustates() { @@ -606,6 +616,7 @@ for (cpu = 0; cpu < num_cpus; cpu++) { char memory_buffer[MAX_COLS]; +void i_memory(stats) int *stats; @@ -619,6 +630,7 @@ int *stats; fputs(memory_buffer, stdout); } +void u_memory(stats) int *stats; @@ -639,13 +651,14 @@ int *stats; */ char arc_buffer[MAX_COLS]; +void i_arc(stats) int *stats; { if (arc_names == NULL) - return (0); + return; fputs("\nARC: ", stdout); lastline++; @@ -655,6 +668,7 @@ int *stats; fputs(arc_buffer, stdout); } +void u_arc(stats) int *stats; @@ -663,7 +677,7 @@ int *stats; static char new[MAX_COLS]; if (arc_names == NULL) - return (0); + return; /* format the new line */ summary_format(new, stats, arc_names); @@ -680,6 +694,7 @@ int *stats; char swap_buffer[MAX_COLS]; +void i_swap(stats) int *stats; @@ -693,6 +708,7 @@ int *stats; fputs(swap_buffer, stdout); } +void u_swap(stats) int *stats; @@ -724,6 +740,7 @@ static int msglen = 0; /* Invariant: msglen is always the length of the message currently displayed on the screen (even when next_msg doesn't contain that message). */ +void i_message() { @@ -745,6 +762,7 @@ i_message() } } +void u_message() { @@ -786,6 +804,7 @@ char *text; * Assumptions: cursor is on the previous line and lastline is consistent */ +void i_header(text) char *text; @@ -811,9 +830,10 @@ char *text; } /*ARGSUSED*/ +void u_header(text) -char *text; /* ignored */ +char *text __unused; /* ignored */ { @@ -832,6 +852,7 @@ char *text; /* ignored */ * Assumptions: lastline is consistent */ +void i_process(line, thisline) int line; @@ -862,6 +883,7 @@ char *thisline; memzero(p, display_width - (p - base)); } +void u_process(line, newline) int line; @@ -909,9 +931,10 @@ char *newline; } } +void u_endscreen(hi) -register int hi; +int hi; { register int screen_line = hi + Header_lines; @@ -969,6 +992,7 @@ register int hi; } } +void display_header(t) int t; @@ -985,6 +1009,7 @@ int t; } /*VARARGS2*/ +void new_message(type, msgfmt, a1, a2, a3) int type; @@ -1025,6 +1050,7 @@ caddr_t a1, a2, a3; } } +void clear_message() { @@ -1034,6 +1060,7 @@ clear_message() } } +int readline(buffer, size, numeric) char *buffer; @@ -1336,6 +1363,7 @@ char *str; return(str); } +void i_uptime(bt, tod) struct timeval* bt; Modified: head/contrib/top/display.h ============================================================================== --- head/contrib/top/display.h Sun May 22 04:09:05 2016 (r300394) +++ head/contrib/top/display.h Sun May 22 04:17:00 2016 (r300395) @@ -5,3 +5,37 @@ #define MT_standout 1 #define MT_delayed 2 +#include "machine.h" + +int display_updatecpus(struct statics *statics); +void clear_message(void); +int display_resize(void); +void i_header(char *text); +char *printable(char *string); +char *cpustates_tag(void); +void display_header(int t); +int display_init(struct statics *statics); +void i_arc(int *stats); +void i_cpustates(int *states); +void i_loadave(int mpid, double *avenrun); +void i_memory(int *stats); +void i_message(void); +void i_process(int line, char *thisline); +void i_procstates(int total, int *brkdn); +void i_swap(int *stats); +void i_timeofday(time_t *tod); +void i_uptime(struct timeval *bt, time_t *tod); +void new_message(); +int readline(char *buffer, int size, int numeric); +char *trim_header(char *text); +void u_arc(int *stats); +void u_cpustates(int *states); +void u_endscreen(int hi); +void u_header(char *text); +void u_loadave(int mpid, double *avenrun); +void u_memory(int *stats); +void u_message(void); +void u_process(int line, char *newline); +void u_procstates(int total, int *brkdn); +void u_swap(int *stats); +void z_cpustates(void); Modified: head/contrib/top/machine.h ============================================================================== --- head/contrib/top/machine.h Sun May 22 04:09:05 2016 (r300394) +++ head/contrib/top/machine.h Sun May 22 04:17:00 2016 (r300395) @@ -7,6 +7,10 @@ * module. It is NOT machine dependent and should not need to be changed * for any specific machine. */ +#ifndef MACHINE_H +#define MACHINE_H + +#include "top.h" /* * the statics struct is filled in by machine_init @@ -74,8 +78,14 @@ struct process_select /* routines defined by the machine dependent module */ -char *format_header(); -char *format_next_process(); +char *format_header(); +char *format_next_process(); +void toggle_pcpustats(void); +void get_system_info(struct system_info *si); +int machine_init(struct statics *statics, char do_unames); +int proc_owner(int pid); /* non-int routines typically used by the machine dependent module */ -char *printable(); +char *printable(); + +#endif /* MACHINE_H */ Modified: head/contrib/top/screen.c ============================================================================== --- head/contrib/top/screen.c Sun May 22 04:09:05 2016 (r300394) +++ head/contrib/top/screen.c Sun May 22 04:17:00 2016 (r300395) @@ -50,7 +50,6 @@ extern char *myname; -int putstdout(); int overstrike; int screen_length; @@ -236,6 +235,7 @@ int interactive; #endif } +void init_screen() { @@ -326,6 +326,7 @@ init_screen() } } +void end_screen() { @@ -356,6 +357,7 @@ end_screen() } } +void reinit_screen() { @@ -383,6 +385,7 @@ reinit_screen() } } +void get_screensize() { @@ -428,6 +431,7 @@ get_screensize() lower_left[sizeof(lower_left) - 1] = '\0'; } +void standout(msg) char *msg; @@ -445,6 +449,7 @@ char *msg; } } +void clear() { @@ -454,6 +459,7 @@ clear() } } +int clear_eol(len) int len; @@ -478,6 +484,7 @@ int len; return(-1); } +void go_home() { @@ -489,6 +496,7 @@ go_home() /* This has to be defined as a subroutine for tputs (instead of a macro) */ +void putstdout(ch) char ch; Modified: head/contrib/top/screen.h ============================================================================== --- head/contrib/top/screen.h Sun May 22 04:09:05 2016 (r300394) +++ head/contrib/top/screen.h Sun May 22 04:17:00 2016 (r300395) @@ -28,4 +28,14 @@ extern int screen_length; extern int screen_width; /* a function that puts a single character on stdout */ -int putstdout(); +void putstdout(char ch); +int clear_eol(int len); +void standout(char *msg); +void clear(void); +void go_home(void); +void reinit_screen(void); +void get_screensize(void); +void init_termcap(int interactive); +void end_screen(void); +void init_screen(void); + Modified: head/contrib/top/top.c ============================================================================== --- head/contrib/top/top.c Sun May 22 04:09:05 2016 (r300394) +++ head/contrib/top/top.c Sun May 22 04:17:00 2016 (r300395) @@ -34,15 +34,19 @@ char *copyright = */ #include "os.h" -#include -#include -#include -#include + #include #include + +#include +#include #include +#include +#include +#include /* includes specific to top */ +#include "commands.h" #include "display.h" /* interface to display package */ #include "screen.h" /* interface to screen package */ #include "top.h" @@ -50,6 +54,7 @@ char *copyright = #include "boolean.h" #include "machine.h" #include "utils.h" +#include "username.h" /* Size of the stdio buffer given to stdout */ #define Buffersize 2048 @@ -114,38 +119,21 @@ caddr_t get_process_info(); char *username(); char *itoa7(); -/* display routines that need to be predeclared */ -int i_loadave(); -int u_loadave(); -int i_procstates(); -int u_procstates(); -int i_cpustates(); -int u_cpustates(); -int i_memory(); -int u_memory(); -int i_arc(); -int u_arc(); -int i_swap(); -int u_swap(); -int i_message(); -int u_message(); -int i_header(); -int u_header(); -int i_process(); -int u_process(); - /* pointers to display routines */ -int (*d_loadave)() = i_loadave; -int (*d_procstates)() = i_procstates; -int (*d_cpustates)() = i_cpustates; -int (*d_memory)() = i_memory; -int (*d_arc)() = i_arc; -int (*d_swap)() = i_swap; -int (*d_message)() = i_message; -int (*d_header)() = i_header; -int (*d_process)() = i_process; +void (*d_loadave)() = i_loadave; +void (*d_procstates)() = i_procstates; +void (*d_cpustates)() = i_cpustates; +void (*d_memory)() = i_memory; +void (*d_arc)() = i_arc; +void (*d_swap)() = i_swap; +void (*d_message)() = i_message; +void (*d_header)() = i_header; +void (*d_process)() = i_process; + +void reset_display(void); +int main(argc, argv) int argc; @@ -1178,6 +1166,7 @@ restart: * screen will get redrawn. */ +void reset_display() { Modified: head/contrib/top/top.h ============================================================================== --- head/contrib/top/top.h Sun May 22 04:09:05 2016 (r300394) +++ head/contrib/top/top.h Sun May 22 04:17:00 2016 (r300395) @@ -7,6 +7,9 @@ * General (global) definitions */ +#ifndef TOP_H +#define TOP_H + /* Current major version number */ #define VERSION 3 @@ -47,3 +50,5 @@ enum displaymodes { DISP_CPU = 0, DISP_I extern enum displaymodes displaymode; extern int pcpu_stats; + +#endif /* TOP_H */ Modified: head/contrib/top/username.c ============================================================================== --- head/contrib/top/username.c Sun May 22 04:09:05 2016 (r300394) +++ head/contrib/top/username.c Sun May 22 04:17:00 2016 (r300395) @@ -32,11 +32,15 @@ #include #include -#include + #include +#include +#include +#include #include "top.local.h" #include "utils.h" +#include "username.h" struct hash_el { int uid; @@ -55,6 +59,8 @@ struct hash_el { /* We depend on that for hash_table and YOUR compiler had BETTER do it! */ struct hash_el hash_table[Table_size]; + +void init_hash() { @@ -67,7 +73,7 @@ init_hash() char *username(uid) -register int uid; +int uid; { register int hashindex; @@ -106,8 +112,8 @@ char *username; int enter_user(uid, name, wecare) -register int uid; -register char *name; +int uid; +char *name; int wecare; /* 1 = enter it always, 0 = nice to have */ { @@ -142,7 +148,7 @@ int wecare; /* 1 = enter it always, 0 = int get_user(uid) -register int uid; +int uid; { struct passwd *pwd; Added: head/contrib/top/username.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/top/username.h Sun May 22 04:17:00 2016 (r300395) @@ -0,0 +1,23 @@ +/* + * Top users/processes display for Unix + * Version 3 + * + * This program may be freely redistributed, + * but this entire comment MUST remain intact. + * + * Copyright (c) 1984, 1989, William LeFebvre, Rice University + * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University + * Copyright (c) 2016, Randy Westlund + * + * $FreeBSD$ + */ +#ifndef USERNAME_H +#define USERNAME_H + +int enter_user(int uid, char *name, int wecare); +int get_user(int uid); +void init_hash(void); +char *username(int uid); +int userid(char *username); + +#endif /* USERNAME_H */ Modified: head/contrib/top/utils.h ============================================================================== --- head/contrib/top/utils.h Sun May 22 04:09:05 2016 (r300394) +++ head/contrib/top/utils.h Sun May 22 04:17:00 2016 (r300395) @@ -22,3 +22,5 @@ char *errmsg(); char *format_time(); char *format_k(); char *format_k2(unsigned long long); +int string_index(char *string, char **array); + Modified: head/contrib/top/version.c ============================================================================== --- head/contrib/top/version.c Sun May 22 04:09:05 2016 (r300394) +++ head/contrib/top/version.c Sun May 22 04:17:00 2016 (r300395) @@ -9,6 +9,9 @@ * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University */ +#include +#include + #include "top.h" #include "patchlevel.h" From owner-svn-src-head@freebsd.org Sun May 22 05:36:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7FB7B43480; Sun, 22 May 2016 05:36:06 +0000 (UTC) (envelope-from joel@vnode.se) Received: from smtp.vnode.se (smtp.vnode.se [IPv6:2a07:6c0:1::3]) by mx1.freebsd.org (Postfix) with ESMTP id A294E1519; Sun, 22 May 2016 05:36:06 +0000 (UTC) (envelope-from joel@vnode.se) Received: from ymer.vnode.se (81-235-218-96-no20.tbcn.telia.com [81.235.218.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.vnode.se (Postfix) with ESMTPSA id 401517569; Sun, 22 May 2016 07:36:04 +0200 (CEST) Date: Sun, 22 May 2016 07:36:03 +0200 From: Joel Dahl To: Garrett Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300395 - head/contrib/top Message-ID: <20160522053603.GA61694@ymer.vnode.se> Mail-Followup-To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605220417.u4M4H12O020940@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605220417.u4M4H12O020940@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 05:36:07 -0000 On Sun, May 22, 2016 at 04:17:01AM +0000, Garrett Cooper wrote: > Author: ngie > Date: Sun May 22 04:17:00 2016 > New Revision: 300395 > URL: https://svnweb.freebsd.org/changeset/base/300395 > > Log: > Silence top(1) compiler warnings > > The contrib/top code is no longer maintained upstream (last pulled 16 years > ago). Move it out of contrib/? -- Joel From owner-svn-src-head@freebsd.org Sun May 22 05:40:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C90BBB43577; Sun, 22 May 2016 05:40:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AEEE17FE; Sun, 22 May 2016 05:40:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x232.google.com with SMTP id g64so885115pfb.2; Sat, 21 May 2016 22:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=m75vq6c4NUa2aWzZ7g1+auVm/IggiPddDetJqlIsb48=; b=Js5WwDaU7SIDbfegLw9vsORo8UOOgoef+MTcp4iPxk1ROl7sDI6IXjStn9q55e4JcE 3x5v8j32YMXfwQKJ/iViFWdBWd717Qj36Dk+ty/C6rkETFPLG1pKJ69i60YgtmhiEVnO 8DkI6sg8pJyy5nI4LPhFHrJDB+tx+SUh2j3K9W01N1LhMpy3KMRKx4Rnd8cqSZONNTum JORCcIULK3rVbqPfB41SmPVbVf0xbTqELBfcSHTIwGfXZdYyMkQdss3F1PWr8yECTl/J ksL2SqG1BeYU6x+iYflWf8A4/f2zfAmrsypM3GAtPEQJsNtolTyjfkm5i6CYRqxFX/or 8NHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=m75vq6c4NUa2aWzZ7g1+auVm/IggiPddDetJqlIsb48=; b=BwFsxT0pTw0blebzVxogtqpnw8/5Kesrnkj2g8EchSjA1396FLduNoIbH8iObrKWnh sXjiro3uiyfqfz5JwLZhrxaDzxXDB1+AoOpte7eqEEBYjOct48nbXkspDeCcLYOsCns+ TV3VzMchulq3HYxHpj3DXpktl7EK+3MJSID5/bMbRcDWIn0liarnS8llP4h6Yfm+L7uM S5rte6mKdtqllwWbBMrU45Xssi9MS51+6blyVm6NCHedw5wLrvuw5Z4IUnyHswIhLM/w wsFtJ74MbUPfHtmBmnIXdp4OlTb/2qVfHo/Z+j4eY7bWYfMZplJNd8KQsxL12IOYo3vs 2Rig== X-Gm-Message-State: AOPr4FWuW4vfgVLIRMiv/xVe695f3ZwGL6dheEvXiTnYmPO46KzyYq5rlXvUEkQ92pTl+w== X-Received: by 10.98.83.199 with SMTP id h190mr17322380pfb.15.1463895657104; Sat, 21 May 2016 22:40:57 -0700 (PDT) Received: from [192.168.20.7] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id u127sm37522373pfb.82.2016.05.21.22.40.56 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 May 2016 22:40:56 -0700 (PDT) Subject: Re: svn commit: r300395 - head/contrib/top Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_B05A0B46-C33F-40FE-B9C6-FA8FF7C2F377"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20160522053603.GA61694@ymer.vnode.se> Date: Sat, 21 May 2016 22:40:55 -0700 Cc: Garrett Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <69236DC0-9A88-4B80-A66E-52F90EB0BB0F@gmail.com> References: <201605220417.u4M4H12O020940@repo.freebsd.org> <20160522053603.GA61694@ymer.vnode.se> To: Joel Dahl X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 05:40:57 -0000 --Apple-Mail=_B05A0B46-C33F-40FE-B9C6-FA8FF7C2F377 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 21, 2016, at 22:36, Joel Dahl wrote: >=20 > On Sun, May 22, 2016 at 04:17:01AM +0000, Garrett Cooper wrote: >> Author: ngie >> Date: Sun May 22 04:17:00 2016 >> New Revision: 300395 >> URL: https://svnweb.freebsd.org/changeset/base/300395 >>=20 >> Log: >> Silence top(1) compiler warnings >>=20 >> The contrib/top code is no longer maintained upstream (last pulled = 16 years >> ago). >=20 > Move it out of contrib/? Hi Joel, I spoke with the submitter and after doing some combined = research, it turns out the project is very much still alive on = SourceForge: http://www.unixtop.org . I=E2=80=99m working with the = submitter on reconciling our changes and upgrading the version to the = latest release copy. Thanks! -Ngie --Apple-Mail=_B05A0B46-C33F-40FE-B9C6-FA8FF7C2F377 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 iQIcBAEBCgAGBQJXQUZoAAoJEPWDqSZpMIYVIb8P/2JnMtyA9KUWR4Mn4ODUhIuI YwRsfWNnScL4QqSjRfvrC6Kt/NMclequQXntz9AkLMSFNemmFvO41pJUfna0WNle tATX7ZL7AOPAbV/UG/ST5si1QaW5/h65pwqy0z5BCsz2qEsOq2icPKxCNXpMaxyh MjgEiat+xlrvf/4seUi4wuC22Sj/kyVZml1NKzmGO9uq33OybVSYjjslZ+z+GERq iPQ7EirrKSgbr85T/A5AOVmGGQK5O0+pjbLHMqvTZp6gNUP84c1BZyDtUzB+p2lA iEl0VambJzteTg/2gsnvohSobZMN/tKy2hVG8qJ1k0C+KXRObraRa1eP0cyEGM5L bEAsSzoDa7x602LggP/9AGyMFC28yTQhJwT6swGQ0Ql0myTyQ1SJbPxU/AWcuT6R 0RzP5fGGMscrW1PJ/VNp60rvlMO0fUoiiltZPdEy8MyS91wfLVQzZTOnYrx8t5cR xFJpArgKB27vyd4SKJaeexKfeHjptkD1amnV1Y97HAwZmO3B3UqUEjhr2wH0LFmB B++lqYJU0SvTvTlHizagrl5yuHdH9DkVnMers4zxW71kfEahQR7nj/4mZrjJbjtP vgJ+aqQAyo6o8bVjcqHjk2AtI0OeXIOQDI7xDNifWfe8bH1ORkKycbL9r9FryGho m1KdJ/tjF+C0sq8lUT9U =K6Gw -----END PGP SIGNATURE----- --Apple-Mail=_B05A0B46-C33F-40FE-B9C6-FA8FF7C2F377-- From owner-svn-src-head@freebsd.org Sun May 22 06:19:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DAC5B43AEE; Sun, 22 May 2016 06:19:00 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 334121353; Sun, 22 May 2016 06:19:00 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M6IxXB056870; Sun, 22 May 2016 06:18:59 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M6Ixif056869; Sun, 22 May 2016 06:18:59 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201605220618.u4M6Ixif056869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 22 May 2016 06:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300397 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 06:19:00 -0000 Author: ache Date: Sun May 22 06:18:59 2016 New Revision: 300397 URL: https://svnweb.freebsd.org/changeset/base/300397 Log: 1) POSIX prohibits printing errors to stderr here and require returning NULL: "Upon successful completion, initstate() and setstate() shall return a pointer to the previous state array; otherwise, a null pointer shall be returned. Although some implementations of random() have written messages to standard error, such implementations do not conform to POSIX.1-2008." 2) Move error detections earlier to prevent state modifying. MFC after: 1 week Modified: head/lib/libc/stdlib/random.c Modified: head/lib/libc/stdlib/random.c ============================================================================== --- head/lib/libc/stdlib/random.c Sun May 22 04:28:55 2016 (r300396) +++ head/lib/libc/stdlib/random.c Sun May 22 06:18:59 2016 (r300397) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "un-namespace.h" @@ -341,15 +340,12 @@ initstate(unsigned long seed, char *arg_ char *ostate = (char *)(&state[-1]); uint32_t *int_arg_state = (uint32_t *)arg_state; + if (n < BREAK_0) + return (NULL); if (rand_type == TYPE_0) state[-1] = rand_type; else state[-1] = MAX_TYPES * (rptr - state) + rand_type; - if (n < BREAK_0) { - (void)fprintf(stderr, - "random: not enough state (%ld bytes); ignored.\n", n); - return (0); - } if (n < BREAK_1) { rand_type = TYPE_0; rand_deg = DEG_0; @@ -408,24 +404,23 @@ setstate(char *arg_state) uint32_t rear = new_state[0] / MAX_TYPES; char *ostate = (char *)(&state[-1]); - if (rand_type == TYPE_0) - state[-1] = rand_type; - else - state[-1] = MAX_TYPES * (rptr - state) + rand_type; switch(type) { case TYPE_0: case TYPE_1: case TYPE_2: case TYPE_3: case TYPE_4: - rand_type = type; - rand_deg = degrees[type]; - rand_sep = seps[type]; break; default: - (void)fprintf(stderr, - "random: state info corrupted; not changed.\n"); + return (NULL); } + if (rand_type == TYPE_0) + state[-1] = rand_type; + else + state[-1] = MAX_TYPES * (rptr - state) + rand_type; + rand_type = type; + rand_deg = degrees[type]; + rand_sep = seps[type]; state = new_state + 1; if (rand_type != TYPE_0) { rptr = &state[rear]; From owner-svn-src-head@freebsd.org Sun May 22 07:58:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4907BB44045; Sun, 22 May 2016 07:58:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 BEAFF13D3; Sun, 22 May 2016 07:58:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u4M7vuON011666 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 22 May 2016 10:57:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u4M7vuON011666 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u4M7vsOI011665; Sun, 22 May 2016 10:57:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 22 May 2016 10:57:54 +0300 From: Konstantin Belousov To: Chris Torek Cc: Bruce Evans , Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300332 - in head/sys: amd64/amd64 i386/i386 Message-ID: <20160522075754.GH89104@kib.kiev.ua> References: <20160522101943.U1190@besplex.bde.org> <201605220129.u4M1Topw010808@elf.torek.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605220129.u4M1Topw010808@elf.torek.net> User-Agent: Mutt/1.6.1 (2016-04-27) 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.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 07:58:02 -0000 On Sat, May 21, 2016 at 06:29:50PM -0700, Chris Torek wrote: > On the other hand, since most C compilers don't bother to trap > signed integer overflow, but some can, signed integers may behave > just as badly. :-) > > Overall I personally find the rules simpler for unsigned integers > (occasionally surprising, but predictable and provable behavior in > the mod-2^k ring) than for signed integers (occasionally > surprising, possible trap on overflow, possible nonsense on > overflow, unpredictable and hence unprovable in general). > > The ANSI C folks in 1989 made a mess with the "value preserving" > rules where unsigned integers become signed integers if the > widened type is capable of representing all the values of the > narrower type, but become wider unsigned integers if the widened > type is not capable of representing all these values. The biggest mess in ANSI C is that STD left signed arithmetic undefined on overflow for 2-complement machines. It might be too bold, but IMO significant number, if not all, programmers have a model of signed integer operations on the typical modern real-machine (x86 or riscs) where signed op is done by bit-preserving convertion to unsigned and then doing unsigned op. It is quite possible that standard authors did not even considered that a practically useful compiler could do this differently. The hole was used by one of the compilers to get ever important additional .5% in an artifical benchmarks. Unfortunately gcc went the same route, adopting both undef behaviour claim and colored error messages. We use -fwrapv for kernel. From owner-svn-src-head@freebsd.org Sun May 22 08:20:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E80E7B4478F; Sun, 22 May 2016 08:20:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B91031033; Sun, 22 May 2016 08:20:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M8KU6C093579; Sun, 22 May 2016 08:20:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M8KUXZ093578; Sun, 22 May 2016 08:20:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605220820.u4M8KUXZ093578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 22 May 2016 08:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300406 - head/lib/csu/aarch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 08:20:32 -0000 Author: andrew Date: Sun May 22 08:20:30 2016 New Revision: 300406 URL: https://svnweb.freebsd.org/changeset/base/300406 Log: Stop dereferencing _end in crt1.c. This was only needed for brk/sbrk so is no longer needed. Sponsored by: ABT Systems Ltd Modified: head/lib/csu/aarch64/crt1.c Modified: head/lib/csu/aarch64/crt1.c ============================================================================== --- head/lib/csu/aarch64/crt1.c Sun May 22 07:50:10 2016 (r300405) +++ head/lib/csu/aarch64/crt1.c Sun May 22 08:20:30 2016 (r300406) @@ -71,17 +71,8 @@ __start(int argc, char *argv[], char *en if (&_DYNAMIC != NULL) atexit(cleanup); - else { - /* - * Hack to resolve _end so we read the correct symbol. - * Without this it will resolve to the copy in the library - * that firsts requests it. We should fix the toolchain, - * however this is is needed until this can take place. - */ - *(volatile long *)&_end; - + else _init_tls(); - } #ifdef GCRT atexit(_mcleanup); From owner-svn-src-head@freebsd.org Sun May 22 09:59:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C255EB4330F; Sun, 22 May 2016 09:59:44 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B343170F; Sun, 22 May 2016 09:59:44 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M9xhxa023918; Sun, 22 May 2016 09:59:43 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M9xhsY023917; Sun, 22 May 2016 09:59:43 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201605220959.u4M9xhsY023917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Sun, 22 May 2016 09:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300409 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 09:59:44 -0000 Author: skra Date: Sun May 22 09:59:43 2016 New Revision: 300409 URL: https://svnweb.freebsd.org/changeset/base/300409 Log: Fix some format strings to make them either correct or uniform. No functional change. Modified: head/sys/arm/freescale/imx/imx_gpio.c Modified: head/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpio.c Sun May 22 08:43:36 2016 (r300408) +++ head/sys/arm/freescale/imx/imx_gpio.c Sun May 22 09:59:43 2016 (r300409) @@ -179,14 +179,14 @@ gpio_pic_map_fdt(device_t dev, u_int nce */ if (ncells != 2) { - device_printf(sc->dev, "Invalid #interrupt-cells"); + device_printf(sc->dev, "Invalid #interrupt-cells\n"); return (EINVAL); } irq = cells[0]; tripol = cells[1]; if (irq >= sc->gpio_npins) { - device_printf(sc->dev, "Invalid interrupt number %d", irq); + device_printf(sc->dev, "Invalid interrupt number %u\n", irq); return (EINVAL); } switch (tripol) { @@ -207,7 +207,7 @@ gpio_pic_map_fdt(device_t dev, u_int nce pol = INTR_POLARITY_LOW; break; default: - device_printf(sc->dev, "unsupported trigger/polarity 0x%2x\n", + device_printf(sc->dev, "Unsupported trigger/polarity 0x%2x\n", tripol); return (ENOTSUP); } From owner-svn-src-head@freebsd.org Sun May 22 11:42:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C51B0B4486A; Sun, 22 May 2016 11:42:35 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96CD01E89; Sun, 22 May 2016 11:42:35 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MBgY18057597; Sun, 22 May 2016 11:42:34 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MBgY3i057596; Sun, 22 May 2016 11:42:34 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201605221142.u4MBgY3i057596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Sun, 22 May 2016 11:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300410 - head/sys/arm/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 11:42:35 -0000 Author: skra Date: Sun May 22 11:42:34 2016 New Revision: 300410 URL: https://svnweb.freebsd.org/changeset/base/300410 Log: INTRNG - implement pic_post_filter method. This method is fundamental one and must always be implemented for a PIC. There is no default for it intentionally. Modified: head/sys/arm/mv/mpic.c Modified: head/sys/arm/mv/mpic.c ============================================================================== --- head/sys/arm/mv/mpic.c Sun May 22 09:59:43 2016 (r300409) +++ head/sys/arm/mv/mpic.c Sun May 22 11:42:34 2016 (r300410) @@ -368,6 +368,11 @@ mpic_post_ithread(device_t dev, struct i mpic_enable_intr(dev, isrc); } + +static void +mpic_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ +} #endif static device_method_t mv_mpic_methods[] = { @@ -378,6 +383,7 @@ static device_method_t mv_mpic_methods[] DEVMETHOD(pic_disable_intr, mpic_disable_intr), DEVMETHOD(pic_enable_intr, mpic_enable_intr), DEVMETHOD(pic_map_intr, mpic_map_intr), + DEVMETHOD(pic_post_filter, mpic_post_filter), DEVMETHOD(pic_post_ithread, mpic_post_ithread), DEVMETHOD(pic_pre_ithread, mpic_pre_ithread), #endif From owner-svn-src-head@freebsd.org Sun May 22 12:26:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFAC0B3BD9A; Sun, 22 May 2016 12:26:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A134F13C9; Sun, 22 May 2016 12:26:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MCQ3os069851; Sun, 22 May 2016 12:26:03 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MCQ3Qg069850; Sun, 22 May 2016 12:26:03 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605221226.u4MCQ3Qg069850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 22 May 2016 12:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300411 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 12:26:05 -0000 Author: dchagin Date: Sun May 22 12:26:03 2016 New Revision: 300411 URL: https://svnweb.freebsd.org/changeset/base/300411 Log: Minor style(9) cleanup, no functional changes. MFC after: 1 week Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Sun May 22 11:42:34 2016 (r300410) +++ head/sys/compat/linux/linux_file.c Sun May 22 12:26:03 2016 (r300411) @@ -69,108 +69,106 @@ __FBSDID("$FreeBSD$"); int linux_creat(struct thread *td, struct linux_creat_args *args) { - char *path; - int error; - - LCONVPATHEXIST(td, args->path, &path); + char *path; + int error; + LCONVPATHEXIST(td, args->path, &path); #ifdef DEBUG if (ldebug(creat)) printf(ARGS(creat, "%s, %d"), path, args->mode); #endif - error = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE, - O_WRONLY | O_CREAT | O_TRUNC, args->mode); - LFREEPATH(path); - return (error); + error = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE, + O_WRONLY | O_CREAT | O_TRUNC, args->mode); + LFREEPATH(path); + return (error); } static int linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, int mode) { - cap_rights_t rights; - struct proc *p = td->td_proc; - struct file *fp; - int fd; - int bsd_flags, error; - - bsd_flags = 0; - switch (l_flags & LINUX_O_ACCMODE) { - case LINUX_O_WRONLY: - bsd_flags |= O_WRONLY; - break; - case LINUX_O_RDWR: - bsd_flags |= O_RDWR; - break; - default: - bsd_flags |= O_RDONLY; - } - if (l_flags & LINUX_O_NDELAY) - bsd_flags |= O_NONBLOCK; - if (l_flags & LINUX_O_APPEND) - bsd_flags |= O_APPEND; - if (l_flags & LINUX_O_SYNC) - bsd_flags |= O_FSYNC; - if (l_flags & LINUX_O_NONBLOCK) - bsd_flags |= O_NONBLOCK; - if (l_flags & LINUX_FASYNC) - bsd_flags |= O_ASYNC; - if (l_flags & LINUX_O_CREAT) - bsd_flags |= O_CREAT; - if (l_flags & LINUX_O_TRUNC) - bsd_flags |= O_TRUNC; - if (l_flags & LINUX_O_EXCL) - bsd_flags |= O_EXCL; - if (l_flags & LINUX_O_NOCTTY) - bsd_flags |= O_NOCTTY; - if (l_flags & LINUX_O_DIRECT) - bsd_flags |= O_DIRECT; - if (l_flags & LINUX_O_NOFOLLOW) - bsd_flags |= O_NOFOLLOW; - if (l_flags & LINUX_O_DIRECTORY) - bsd_flags |= O_DIRECTORY; - /* XXX LINUX_O_NOATIME: unable to be easily implemented. */ - - error = kern_openat(td, dirfd, path, UIO_SYSSPACE, bsd_flags, mode); - if (error != 0) - goto done; - - if (bsd_flags & O_NOCTTY) - goto done; - - /* - * XXX In between kern_open() and fget(), another process - * having the same filedesc could use that fd without - * checking below. - */ - fd = td->td_retval[0]; - if (fget(td, fd, cap_rights_init(&rights, CAP_IOCTL), &fp) == 0) { - if (fp->f_type != DTYPE_VNODE) { - fdrop(fp, td); - goto done; - } - sx_slock(&proctree_lock); - PROC_LOCK(p); - if (SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { - PROC_UNLOCK(p); - sx_sunlock(&proctree_lock); - /* XXXPJD: Verify if TIOCSCTTY is allowed. */ - (void) fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, - td->td_ucred, td); - } else { - PROC_UNLOCK(p); - sx_sunlock(&proctree_lock); - } - fdrop(fp, td); - } + cap_rights_t rights; + struct proc *p = td->td_proc; + struct file *fp; + int fd; + int bsd_flags, error; + + bsd_flags = 0; + switch (l_flags & LINUX_O_ACCMODE) { + case LINUX_O_WRONLY: + bsd_flags |= O_WRONLY; + break; + case LINUX_O_RDWR: + bsd_flags |= O_RDWR; + break; + default: + bsd_flags |= O_RDONLY; + } + if (l_flags & LINUX_O_NDELAY) + bsd_flags |= O_NONBLOCK; + if (l_flags & LINUX_O_APPEND) + bsd_flags |= O_APPEND; + if (l_flags & LINUX_O_SYNC) + bsd_flags |= O_FSYNC; + if (l_flags & LINUX_O_NONBLOCK) + bsd_flags |= O_NONBLOCK; + if (l_flags & LINUX_FASYNC) + bsd_flags |= O_ASYNC; + if (l_flags & LINUX_O_CREAT) + bsd_flags |= O_CREAT; + if (l_flags & LINUX_O_TRUNC) + bsd_flags |= O_TRUNC; + if (l_flags & LINUX_O_EXCL) + bsd_flags |= O_EXCL; + if (l_flags & LINUX_O_NOCTTY) + bsd_flags |= O_NOCTTY; + if (l_flags & LINUX_O_DIRECT) + bsd_flags |= O_DIRECT; + if (l_flags & LINUX_O_NOFOLLOW) + bsd_flags |= O_NOFOLLOW; + if (l_flags & LINUX_O_DIRECTORY) + bsd_flags |= O_DIRECTORY; + /* XXX LINUX_O_NOATIME: unable to be easily implemented. */ + + error = kern_openat(td, dirfd, path, UIO_SYSSPACE, bsd_flags, mode); + if (error != 0) + goto done; + if (bsd_flags & O_NOCTTY) + goto done; + + /* + * XXX In between kern_open() and fget(), another process + * having the same filedesc could use that fd without + * checking below. + */ + fd = td->td_retval[0]; + if (fget(td, fd, cap_rights_init(&rights, CAP_IOCTL), &fp) == 0) { + if (fp->f_type != DTYPE_VNODE) { + fdrop(fp, td); + goto done; + } + sx_slock(&proctree_lock); + PROC_LOCK(p); + if (SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { + PROC_UNLOCK(p); + sx_sunlock(&proctree_lock); + /* XXXPJD: Verify if TIOCSCTTY is allowed. */ + (void) fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, + td->td_ucred, td); + } else { + PROC_UNLOCK(p); + sx_sunlock(&proctree_lock); + } + fdrop(fp, td); + } done: #ifdef DEBUG - if (ldebug(open)) - printf(LMSG("open returns error %d"), error); + if (ldebug(open)) + printf(LMSG("open returns error %d"), error); #endif - LFREEPATH(path); - return (error); + LFREEPATH(path); + return (error); } int @@ -195,44 +193,41 @@ linux_openat(struct thread *td, struct l int linux_open(struct thread *td, struct linux_open_args *args) { - char *path; - - if (args->flags & LINUX_O_CREAT) - LCONVPATHCREAT(td, args->path, &path); - else - LCONVPATHEXIST(td, args->path, &path); + char *path; + if (args->flags & LINUX_O_CREAT) + LCONVPATHCREAT(td, args->path, &path); + else + LCONVPATHEXIST(td, args->path, &path); #ifdef DEBUG if (ldebug(open)) printf(ARGS(open, "%s, 0x%x, 0x%x"), path, args->flags, args->mode); #endif - return (linux_common_open(td, AT_FDCWD, path, args->flags, args->mode)); } int linux_lseek(struct thread *td, struct linux_lseek_args *args) { - - struct lseek_args /* { - int fd; - int pad; - off_t offset; - int whence; - } */ tmp_args; - int error; + struct lseek_args /* { + int fd; + int pad; + off_t offset; + int whence; + } */ tmp_args; + int error; #ifdef DEBUG if (ldebug(lseek)) printf(ARGS(lseek, "%d, %ld, %d"), args->fdes, (long)args->off, args->whence); #endif - tmp_args.fd = args->fdes; - tmp_args.offset = (off_t)args->off; - tmp_args.whence = args->whence; - error = sys_lseek(td, &tmp_args); - return error; + tmp_args.fd = args->fdes; + tmp_args.offset = (off_t)args->off; + tmp_args.whence = args->whence; + error = sys_lseek(td, &tmp_args); + return (error); } #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) @@ -255,13 +250,13 @@ linux_llseek(struct thread *td, struct l bsd_args.whence = args->whence; if ((error = sys_lseek(td, &bsd_args))) - return error; + return (error); if ((error = copyout(td->td_retval, args->res, sizeof (off_t)))) - return error; + return (error); td->td_retval[0] = 0; - return 0; + return (0); } int @@ -272,7 +267,7 @@ linux_readdir(struct thread *td, struct lda.fd = args->fd; lda.dent = args->dent; lda.count = 1; - return linux_getdents(td, &lda); + return (linux_getdents(td, &lda)); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ @@ -949,7 +944,7 @@ linux_ftruncate(struct thread *td, struc int pad; off_t length; } */ nuap; - + nuap.fd = args->fd; nuap.length = args->length; return (sys_ftruncate(td, &nuap)); @@ -1021,7 +1016,7 @@ linux_fdatasync(td, uap) struct fsync_args bsd; bsd.fd = uap->fd; - return sys_fsync(td, &bsd); + return (sys_fsync(td, &bsd)); } int @@ -1038,9 +1033,7 @@ linux_pread(td, uap) bsd.buf = uap->buf; bsd.nbyte = uap->nbyte; bsd.offset = uap->offset; - error = sys_pread(td, &bsd); - if (error == 0) { /* This seems to violate POSIX but linux does it */ error = fgetvp(td, uap->fd, @@ -1053,7 +1046,6 @@ linux_pread(td, uap) } vrele(vp); } - return (error); } @@ -1068,7 +1060,7 @@ linux_pwrite(td, uap) bsd.buf = uap->buf; bsd.nbyte = uap->nbyte; bsd.offset = uap->offset; - return sys_pwrite(td, &bsd); + return (sys_pwrite(td, &bsd)); } int From owner-svn-src-head@freebsd.org Sun May 22 12:28:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83BE8B3BE6B; Sun, 22 May 2016 12:28:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55F67172D; Sun, 22 May 2016 12:28:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MCSt8H070020; Sun, 22 May 2016 12:28:55 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MCStAT070019; Sun, 22 May 2016 12:28:55 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605221228.u4MCStAT070019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 22 May 2016 12:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300412 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 12:28:56 -0000 Author: dchagin Date: Sun May 22 12:28:55 2016 New Revision: 300412 URL: https://svnweb.freebsd.org/changeset/base/300412 Log: Add my copyright as I rewrote most of the futex code. Minor style(9) cleanup while here. MFC after: 1 week Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sun May 22 12:26:03 2016 (r300411) +++ head/sys/compat/linux/linux_futex.c Sun May 22 12:28:55 2016 (r300412) @@ -1,7 +1,9 @@ /* $NetBSD: linux_futex.c,v 1.7 2006/07/24 19:01:49 manu Exp $ */ /*- - * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved. + * Copyright (c) 2009-2016 Dmitry Chagin + * Copyright (c) 2005 Emmanuel Dreyfus + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -604,7 +606,7 @@ futex_atomic_op(struct thread *td, int e LIN_SDT_PROBE4(futex, futex_atomic_op, decoded_op, op, cmp, oparg, cmparg); - + /* XXX: Linux verifies access here and returns EFAULT */ LIN_SDT_PROBE0(futex, futex_atomic_op, missing_access_check); @@ -996,7 +998,6 @@ linux_sys_futex(struct thread *td, struc return (ENOSYS); case LINUX_FUTEX_REQUEUE: - /* * Glibc does not use this operation since version 2.3.3, * as it is racy and replaced by FUTEX_CMP_REQUEUE operation. From owner-svn-src-head@freebsd.org Sun May 22 12:35:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79F40B4502B; Sun, 22 May 2016 12:35:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9BE1CA4; Sun, 22 May 2016 12:35:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MCZoD2073116; Sun, 22 May 2016 12:35:50 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MCZolo073115; Sun, 22 May 2016 12:35:50 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605221235.u4MCZolo073115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 22 May 2016 12:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300413 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 12:35:51 -0000 Author: dchagin Date: Sun May 22 12:35:50 2016 New Revision: 300413 URL: https://svnweb.freebsd.org/changeset/base/300413 Log: Due to lack the priority propagation feature replace sx by mutex. WIth this commit NPTL tests are ends in 1 minute faster. MFC after: 1 week Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sun May 22 12:28:55 2016 (r300412) +++ head/sys/compat/linux/linux_futex.c Sun May 22 12:35:50 2016 (r300413) @@ -54,9 +54,10 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include #include -#include #include +#include + #ifdef COMPAT_LINUX32 #include #include @@ -196,7 +197,7 @@ struct waiting_proc { }; struct futex { - struct sx f_lck; + struct mtx f_lck; uint32_t *f_uaddr; /* user-supplied value, for debug */ struct umtx_key f_key; uint32_t f_refcount; @@ -207,20 +208,22 @@ struct futex { struct futex_list futex_list; -#define FUTEX_LOCK(f) sx_xlock(&(f)->f_lck) -#define FUTEX_UNLOCK(f) sx_xunlock(&(f)->f_lck) +#define FUTEX_LOCK(f) mtx_lock(&(f)->f_lck) +#define FUTEX_LOCKED(f) mtx_owned(&(f)->f_lck) +#define FUTEX_UNLOCK(f) mtx_unlock(&(f)->f_lck) #define FUTEX_INIT(f) do { \ - sx_init_flags(&(f)->f_lck, "ftlk", \ - SX_DUPOK); \ + mtx_init(&(f)->f_lck, "ftlk", NULL, \ + MTX_DUPOK); \ LIN_SDT_PROBE1(futex, futex, create, \ &(f)->f_lck); \ } while (0) #define FUTEX_DESTROY(f) do { \ LIN_SDT_PROBE1(futex, futex, destroy, \ &(f)->f_lck); \ - sx_destroy(&(f)->f_lck); \ + mtx_destroy(&(f)->f_lck); \ } while (0) -#define FUTEX_ASSERT_LOCKED(f) sx_assert(&(f)->f_lck, SA_XLOCKED) +#define FUTEX_ASSERT_LOCKED(f) mtx_assert(&(f)->f_lck, MA_OWNED) +#define FUTEX_ASSERT_UNLOCKED(f) mtx_assert(&(f)->f_lck, MA_NOTOWNED) struct mtx futex_mtx; /* protects the futex list */ #define FUTEXES_LOCK do { \ @@ -239,6 +242,7 @@ struct mtx futex_mtx; /* protects the #define FUTEX_DONTCREATE 0x2 /* don't create futex if not exists */ #define FUTEX_DONTEXISTS 0x4 /* return EINVAL if futex exists */ #define FUTEX_SHARED 0x8 /* shared futex */ +#define FUTEX_DONTLOCK 0x10 /* don't lock futex */ /* wp_flags */ #define FUTEX_WP_REQUEUED 0x1 /* wp requeued - wp moved from wp_list @@ -258,6 +262,8 @@ static int futex_wake(struct futex *, in static int futex_requeue(struct futex *, int, struct futex *, int); static int futex_wait(struct futex *, struct waiting_proc *, int, uint32_t); +static void futex_lock(struct futex *); +static void futex_unlock(struct futex *); static int futex_atomic_op(struct thread *, int, uint32_t *); static int handle_futex_death(struct linux_emuldata *, uint32_t *, unsigned int); @@ -277,7 +283,6 @@ futex_put(struct futex *f, struct waitin { LIN_SDT_PROBE2(futex, futex_put, entry, f, wp); - FUTEX_ASSERT_LOCKED(f); if (wp != NULL) { if ((wp->wp_flags & FUTEX_WP_REMOVED) == 0) TAILQ_REMOVE(&f->f_waiting_proc, wp, wp_list); @@ -288,7 +293,8 @@ futex_put(struct futex *f, struct waitin if (--f->f_refcount == 0) { LIST_REMOVE(f, f_list); FUTEXES_UNLOCK; - FUTEX_UNLOCK(f); + if (FUTEX_LOCKED(f)) + futex_unlock(f); LIN_SDT_PROBE3(futex, futex_put, destroy, f->f_uaddr, f->f_refcount, f->f_key.shared); @@ -307,7 +313,8 @@ futex_put(struct futex *f, struct waitin LINUX_CTR3(sys_futex, "futex_put uaddr %p ref %d shared %d", f->f_uaddr, f->f_refcount, f->f_key.shared); FUTEXES_UNLOCK; - FUTEX_UNLOCK(f); + if (FUTEX_LOCKED(f)) + futex_unlock(f); LIN_SDT_PROBE0(futex, futex_put, return); } @@ -335,7 +342,8 @@ retry: LIST_FOREACH(f, &futex_list, f_list) { if (umtx_key_match(&f->f_key, &key)) { if (tmpf != NULL) { - FUTEX_UNLOCK(tmpf); + if (FUTEX_LOCKED(tmpf)) + futex_unlock(tmpf); FUTEX_DESTROY(tmpf); free(tmpf, M_FUTEX); } @@ -356,7 +364,8 @@ retry: FUTEXES_UNLOCK; umtx_key_release(&key); - FUTEX_LOCK(f); + if ((flags & FUTEX_DONTLOCK) == 0) + futex_lock(f); *newf = f; LIN_SDT_PROBE3(futex, futex_get0, shared, uaddr, f->f_refcount, f->f_key.shared); @@ -392,7 +401,8 @@ retry: * Lock the new futex before an insert into the futex_list * to prevent futex usage by other. */ - FUTEX_LOCK(tmpf); + if ((flags & FUTEX_DONTLOCK) == 0) + futex_lock(tmpf); goto retry; } @@ -440,6 +450,26 @@ futex_get(uint32_t *uaddr, struct waitin return (error); } +static inline void +futex_lock(struct futex *f) +{ + + LINUX_CTR3(sys_futex, "futex_lock uaddr %p ref %d shared %d", + f->f_uaddr, f->f_refcount, f->f_key.shared); + FUTEX_ASSERT_UNLOCKED(f); + FUTEX_LOCK(f); +} + +static inline void +futex_unlock(struct futex *f) +{ + + LINUX_CTR3(sys_futex, "futex_unlock uaddr %p ref %d shared %d", + f->f_uaddr, f->f_refcount, f->f_key.shared); + FUTEX_ASSERT_LOCKED(f); + FUTEX_UNLOCK(f); +} + static int futex_sleep(struct futex *f, struct waiting_proc *wp, int timeout) { @@ -449,7 +479,7 @@ futex_sleep(struct futex *f, struct wait LIN_SDT_PROBE3(futex, futex_sleep, entry, f, wp, timeout); LINUX_CTR4(sys_futex, "futex_sleep enter uaddr %p wp %p timo %d ref %d", f->f_uaddr, wp, timeout, f->f_refcount); - error = sx_sleep(wp, &f->f_lck, PCATCH, "futex", timeout); + error = mtx_sleep(wp, &f->f_lck, PCATCH, "futex", timeout); if (wp->wp_flags & FUTEX_WP_REQUEUED) { KASSERT(f != wp->wp_futex, ("futex != wp_futex")); @@ -465,7 +495,7 @@ futex_sleep(struct futex *f, struct wait wp->wp_futex->f_refcount); futex_put(f, NULL); f = wp->wp_futex; - FUTEX_LOCK(f); + futex_lock(f); } else { if (error) { LIN_SDT_PROBE3(futex, futex_sleep, sleep_error, error, @@ -676,7 +706,7 @@ linux_sys_futex(struct thread *td, struc struct timespec timeout; struct timeval utv, ctv; int timeout_hz; - int error; + int error, save; uint32_t flags, val; LIN_SDT_PROBE2(futex, linux_sys_futex, entry, td, args); @@ -749,6 +779,7 @@ linux_sys_futex(struct thread *td, struc } else timeout_hz = 0; +retry0: error = futex_get(args->uaddr, &wp, &f, flags | FUTEX_CREATE_WP); if (error) { @@ -756,14 +787,16 @@ linux_sys_futex(struct thread *td, struc return (error); } - error = copyin(args->uaddr, &val, sizeof(val)); + error = copyin_nofault(args->uaddr, &val, sizeof(val)); if (error) { + futex_put(f, wp); + error = copyin(args->uaddr, &val, sizeof(val)); + if (error == 0) + goto retry0; LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, error); LINUX_CTR1(sys_futex, "WAIT copyin failed %d", error); - futex_put(f, wp); - LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } @@ -831,7 +864,8 @@ linux_sys_futex(struct thread *td, struc return (EINVAL); } - error = futex_get(args->uaddr, NULL, &f, flags); +retry1: + error = futex_get(args->uaddr, NULL, &f, flags | FUTEX_DONTLOCK); if (error) { LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); @@ -845,22 +879,26 @@ linux_sys_futex(struct thread *td, struc * returned by FUTEX_CMP_REQUEUE. */ error = futex_get(args->uaddr2, NULL, &f2, - flags | FUTEX_DONTEXISTS); + flags | FUTEX_DONTEXISTS | FUTEX_DONTLOCK); if (error) { futex_put(f, NULL); LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } - error = copyin(args->uaddr, &val, sizeof(val)); + futex_lock(f); + futex_lock(f2); + error = copyin_nofault(args->uaddr, &val, sizeof(val)); if (error) { + futex_put(f2, NULL); + futex_put(f, NULL); + error = copyin(args->uaddr, &val, sizeof(val)); + if (error == 0) + goto retry1; LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, error); LINUX_CTR1(sys_futex, "CMP_REQUEUE copyin failed %d", error); - futex_put(f2, NULL); - futex_put(f, NULL); - LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } @@ -890,50 +928,45 @@ linux_sys_futex(struct thread *td, struc args->uaddr, args->val, args->uaddr2, args->val3, args->timeout); - error = futex_get(args->uaddr, NULL, &f, flags); +retry2: + error = futex_get(args->uaddr, NULL, &f, flags | FUTEX_DONTLOCK); if (error) { LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } if (args->uaddr != args->uaddr2) - error = futex_get(args->uaddr2, NULL, &f2, flags); + error = futex_get(args->uaddr2, NULL, &f2, + flags | FUTEX_DONTLOCK); if (error) { futex_put(f, NULL); LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } + futex_lock(f); + futex_lock(f2); /* * This function returns positive number as results and * negative as errors */ + save = vm_fault_disable_pagefaults(); op_ret = futex_atomic_op(td, args->val3, args->uaddr2); + vm_fault_enable_pagefaults(save); LINUX_CTR2(sys_futex, "WAKE_OP atomic_op uaddr %p ret 0x%x", args->uaddr, op_ret); if (op_ret < 0) { - /* XXX: We don't handle the EFAULT yet. */ - if (op_ret != -EFAULT) { - if (f2 != NULL) - futex_put(f2, NULL); - futex_put(f, NULL); - - LIN_SDT_PROBE1(futex, linux_sys_futex, return, - -op_ret); - return (-op_ret); - } else { - LIN_SDT_PROBE0(futex, linux_sys_futex, - unhandled_efault); - } if (f2 != NULL) futex_put(f2, NULL); futex_put(f, NULL); - - LIN_SDT_PROBE1(futex, linux_sys_futex, return, EFAULT); - return (EFAULT); + error = copyin(args->uaddr2, &val, sizeof(val)); + if (error == 0) + goto retry2; + LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); + return (error); } ret = futex_wake(f, args->val, args->val3); From owner-svn-src-head@freebsd.org Sun May 22 12:37:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB646B45091; Sun, 22 May 2016 12:37:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E96A1E0D; Sun, 22 May 2016 12:37:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MCbeld073223; Sun, 22 May 2016 12:37:40 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MCbeQn073222; Sun, 22 May 2016 12:37:40 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605221237.u4MCbeQn073222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 22 May 2016 12:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300414 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 12:37:41 -0000 Author: dchagin Date: Sun May 22 12:37:40 2016 New Revision: 300414 URL: https://svnweb.freebsd.org/changeset/base/300414 Log: For future use move futex timeout code to the separate function and switch to the high resolution sbintime_t. MFC after: 1 week Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sun May 22 12:35:50 2016 (r300413) +++ head/sys/compat/linux/linux_futex.c Sun May 22 12:37:40 2016 (r300414) @@ -109,7 +109,7 @@ LIN_SDT_PROBE_DEFINE3(futex, futex_get, LIN_SDT_PROBE_DEFINE0(futex, futex_get, error); LIN_SDT_PROBE_DEFINE1(futex, futex_get, return, "int"); LIN_SDT_PROBE_DEFINE3(futex, futex_sleep, entry, "struct futex *", - "struct waiting_proc **", "int"); + "struct waiting_proc **", "struct timespec *"); LIN_SDT_PROBE_DEFINE5(futex, futex_sleep, requeue_error, "int", "uint32_t *", "struct waiting_proc *", "uint32_t *", "uint32_t"); LIN_SDT_PROBE_DEFINE3(futex, futex_sleep, sleep_error, "int", "uint32_t *", @@ -128,7 +128,7 @@ LIN_SDT_PROBE_DEFINE3(futex, futex_reque "struct waiting_proc *", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_requeue, return, "int"); LIN_SDT_PROBE_DEFINE4(futex, futex_wait, entry, "struct futex *", - "struct waiting_proc **", "int", "uint32_t"); + "struct waiting_proc **", "struct timespec *", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_wait, sleep_error, "int"); LIN_SDT_PROBE_DEFINE1(futex, futex_wait, return, "int"); LIN_SDT_PROBE_DEFINE3(futex, futex_atomic_op, entry, "struct thread *", @@ -142,7 +142,6 @@ LIN_SDT_PROBE_DEFINE1(futex, futex_atomi LIN_SDT_PROBE_DEFINE2(futex, linux_sys_futex, entry, "struct thread *", "struct linux_sys_futex_args *"); LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_clockswitch); -LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, itimerfix_error, "int"); LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, copyin_error, "int"); LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, invalid_cmp_requeue_use); LIN_SDT_PROBE_DEFINE3(futex, linux_sys_futex, debug_wait, "uint32_t *", @@ -257,10 +256,12 @@ static void futex_put(struct futex *, st static int futex_get0(uint32_t *, struct futex **f, uint32_t); static int futex_get(uint32_t *, struct waiting_proc **, struct futex **, uint32_t); -static int futex_sleep(struct futex *, struct waiting_proc *, int); +static int futex_sleep(struct futex *, struct waiting_proc *, struct timespec *); static int futex_wake(struct futex *, int, uint32_t); static int futex_requeue(struct futex *, int, struct futex *, int); -static int futex_wait(struct futex *, struct waiting_proc *, int, +static int futex_copyin_timeout(int, struct l_timespec *, int, + struct timespec *); +static int futex_wait(struct futex *, struct waiting_proc *, struct timespec *, uint32_t); static void futex_lock(struct futex *); static void futex_unlock(struct futex *); @@ -278,6 +279,34 @@ int futex_andl(int oparg, uint32_t *uadd int futex_xorl(int oparg, uint32_t *uaddr, int *oldval); +static int +futex_copyin_timeout(int op, struct l_timespec *luts, int clockrt, + struct timespec *ts) +{ + struct l_timespec lts; + struct timespec kts; + int error; + + error = copyin(luts, <s, sizeof(lts)); + if (error) + return (error); + + error = linux_to_native_timespec(ts, <s); + if (error) + return (error); + if (ts->tv_nsec < 0 || ts->tv_nsec >= 1000000000) + return (EINVAL); + + if (clockrt) { + nanotime(&kts); + timespecsub(ts, &kts); + } else if (op == LINUX_FUTEX_WAIT_BITSET) { + nanouptime(&kts); + timespecsub(ts, &kts); + } + return (error); +} + static void futex_put(struct futex *f, struct waiting_proc *wp) { @@ -471,15 +500,35 @@ futex_unlock(struct futex *f) } static int -futex_sleep(struct futex *f, struct waiting_proc *wp, int timeout) +futex_sleep(struct futex *f, struct waiting_proc *wp, struct timespec *ts) { + struct timespec uts; + sbintime_t sbt, prec, tmp; + time_t over; int error; FUTEX_ASSERT_LOCKED(f); - LIN_SDT_PROBE3(futex, futex_sleep, entry, f, wp, timeout); - LINUX_CTR4(sys_futex, "futex_sleep enter uaddr %p wp %p timo %d ref %d", - f->f_uaddr, wp, timeout, f->f_refcount); - error = mtx_sleep(wp, &f->f_lck, PCATCH, "futex", timeout); + if (ts != NULL) { + uts = *ts; + if (uts.tv_sec > INT32_MAX / 2) { + over = uts.tv_sec - INT32_MAX / 2; + uts.tv_sec -= over; + } + tmp = tstosbt(uts); + if (TIMESEL(&sbt, tmp)) + sbt += tc_tick_sbt; + sbt += tmp; + prec = tmp; + prec >>= tc_precexp; + } else { + sbt = 0; + prec = 0; + } + LIN_SDT_PROBE3(futex, futex_sleep, entry, f, wp, sbt); + LINUX_CTR4(sys_futex, "futex_sleep enter uaddr %p wp %p timo %ld ref %d", + f->f_uaddr, wp, sbt, f->f_refcount); + + error = msleep_sbt(wp, &f->f_lck, PCATCH, "futex", sbt, prec, C_ABSOLUTE); if (wp->wp_flags & FUTEX_WP_REQUEUED) { KASSERT(f != wp->wp_futex, ("futex != wp_futex")); @@ -597,12 +646,12 @@ futex_requeue(struct futex *f, int n, st } static int -futex_wait(struct futex *f, struct waiting_proc *wp, int timeout_hz, +futex_wait(struct futex *f, struct waiting_proc *wp, struct timespec *ts, uint32_t bitset) { int error; - LIN_SDT_PROBE4(futex, futex_wait, entry, f, wp, timeout_hz, bitset); + LIN_SDT_PROBE4(futex, futex_wait, entry, f, wp, ts, bitset); if (bitset == 0) { LIN_SDT_PROBE1(futex, futex_wait, return, EINVAL); @@ -610,7 +659,7 @@ futex_wait(struct futex *f, struct waiti } f->f_bitset = bitset; - error = futex_sleep(f, wp, timeout_hz); + error = futex_sleep(f, wp, ts); if (error) LIN_SDT_PROBE1(futex, futex_wait, sleep_error, error); if (error == EWOULDBLOCK) @@ -702,10 +751,7 @@ linux_sys_futex(struct thread *td, struc struct linux_pemuldata *pem; struct waiting_proc *wp; struct futex *f, *f2; - struct l_timespec ltimeout; - struct timespec timeout; - struct timeval utv, ctv; - int timeout_hz; + struct timespec uts, *ts; int error, save; uint32_t flags, val; @@ -748,36 +794,17 @@ linux_sys_futex(struct thread *td, struc args->uaddr, args->val, args->val3); if (args->timeout != NULL) { - error = copyin(args->timeout, <imeout, sizeof(ltimeout)); + error = futex_copyin_timeout(args->op, args->timeout, + clockrt, &uts); if (error) { LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, error); LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } - error = linux_to_native_timespec(&timeout, <imeout); - if (error) - return (error); - TIMESPEC_TO_TIMEVAL(&utv, &timeout); - error = itimerfix(&utv); - if (error) { - LIN_SDT_PROBE1(futex, linux_sys_futex, itimerfix_error, - error); - LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); - return (error); - } - if (clockrt) { - microtime(&ctv); - timevalsub(&utv, &ctv); - } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { - microuptime(&ctv); - timevalsub(&utv, &ctv); - } - if (utv.tv_sec < 0) - timevalclear(&utv); - timeout_hz = tvtohz(&utv); + ts = &uts; } else - timeout_hz = 0; + ts = NULL; retry0: error = futex_get(args->uaddr, &wp, &f, @@ -814,7 +841,7 @@ retry0: return (EWOULDBLOCK); } - error = futex_wait(f, wp, timeout_hz, args->val3); + error = futex_wait(f, wp, ts, args->val3); break; case LINUX_FUTEX_WAKE: From owner-svn-src-head@freebsd.org Sun May 22 12:46:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D31AB4532A; Sun, 22 May 2016 12:46:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49AF013AC; Sun, 22 May 2016 12:46:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MCkZ08076155; Sun, 22 May 2016 12:46:35 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MCkZfH076150; Sun, 22 May 2016 12:46:35 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605221246.u4MCkZfH076150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 22 May 2016 12:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300415 - in head/sys: amd64/amd64 i386/i386 powerpc/powerpc sparc64/sparc64 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 12:46:36 -0000 Author: dchagin Date: Sun May 22 12:46:34 2016 New Revision: 300415 URL: https://svnweb.freebsd.org/changeset/base/300415 Log: Add macro to convert errno and use it when appropriate. MFC after: 1 week Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/i386/i386/vm_machdep.c head/sys/powerpc/powerpc/exec_machdep.c head/sys/sparc64/sparc64/vm_machdep.c head/sys/sys/sysent.h Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Sun May 22 12:37:40 2016 (r300414) +++ head/sys/amd64/amd64/vm_machdep.c Sun May 22 12:46:34 2016 (r300415) @@ -414,13 +414,7 @@ cpu_set_syscall_retval(struct thread *td break; default: - if (td->td_proc->p_sysent->sv_errsize) { - if (error >= td->td_proc->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = td->td_proc->p_sysent->sv_errtbl[error]; - } - td->td_frame->tf_rax = error; + td->td_frame->tf_rax = SV_ABI_ERRNO(td->td_proc, error); td->td_frame->tf_rflags |= PSL_C; break; } Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Sun May 22 12:37:40 2016 (r300414) +++ head/sys/i386/i386/vm_machdep.c Sun May 22 12:46:34 2016 (r300415) @@ -451,13 +451,7 @@ cpu_set_syscall_retval(struct thread *td break; default: - if (td->td_proc->p_sysent->sv_errsize) { - if (error >= td->td_proc->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = td->td_proc->p_sysent->sv_errtbl[error]; - } - td->td_frame->tf_eax = error; + td->td_frame->tf_eax = SV_ABI_ERRNO(td->td_proc, error); td->td_frame->tf_eflags |= PSL_C; break; } Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Sun May 22 12:37:40 2016 (r300414) +++ head/sys/powerpc/powerpc/exec_machdep.c Sun May 22 12:46:34 2016 (r300415) @@ -908,11 +908,7 @@ cpu_set_syscall_retval(struct thread *td tf->srr0 -= 4; break; default: - if (p->p_sysent->sv_errsize) { - error = (error < p->p_sysent->sv_errsize) ? - p->p_sysent->sv_errtbl[error] : -1; - } - tf->fixreg[FIRSTARG] = error; + tf->fixreg[FIRSTARG] = SV_ABI_ERRNO(p, error); tf->cr |= 0x10000000; /* Set summary overflow */ break; } Modified: head/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c Sun May 22 12:37:40 2016 (r300414) +++ head/sys/sparc64/sparc64/vm_machdep.c Sun May 22 12:46:34 2016 (r300415) @@ -167,13 +167,7 @@ cpu_set_syscall_retval(struct thread *td break; default: - if (td->td_proc->p_sysent->sv_errsize) { - if (error >= td->td_proc->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = td->td_proc->p_sysent->sv_errtbl[error]; - } - td->td_frame->tf_out[0] = error; + td->td_frame->tf_out[0] = SV_ABI_ERRNO(td->td_proc, error); td->td_frame->tf_tstate |= TSTATE_XCC_C; break; } Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Sun May 22 12:37:40 2016 (r300414) +++ head/sys/sys/sysent.h Sun May 22 12:46:34 2016 (r300415) @@ -141,6 +141,8 @@ struct sysentvec { #define SV_TIMEKEEP 0x040000 #define SV_ABI_MASK 0xff +#define SV_ABI_ERRNO(p, e) ((p)->p_sysent->sv_errsize <= 0 ? e : \ + ((e) >= (p)->p_sysent->sv_errsize ? -1 : (p)->p_sysent->sv_errtbl[e])) #define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x)) #define SV_PROC_ABI(p) ((p)->p_sysent->sv_flags & SV_ABI_MASK) #define SV_CURPROC_FLAG(x) SV_PROC_FLAG(curproc, x) From owner-svn-src-head@freebsd.org Sun May 22 12:49:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C726EB4552A; Sun, 22 May 2016 12:49:09 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97EEB1887; Sun, 22 May 2016 12:49:09 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MCn80k076511; Sun, 22 May 2016 12:49:08 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MCn8Fb076510; Sun, 22 May 2016 12:49:08 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605221249.u4MCn8Fb076510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 22 May 2016 12:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300416 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 12:49:09 -0000 Author: dchagin Date: Sun May 22 12:49:08 2016 New Revision: 300416 URL: https://svnweb.freebsd.org/changeset/base/300416 Log: Add a missing errno translation for SO_ERROR optname. PR: 135458 Reported by: Stefan Schmidt @ stadtbuch.de MFC after: 1 week Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun May 22 12:46:34 2016 (r300415) +++ head/sys/compat/linux/linux_socket.c Sun May 22 12:49:08 2016 (r300416) @@ -1608,10 +1608,10 @@ linux_getsockopt(struct thread *td, stru } */ bsd_args; l_timeval linux_tv; struct timeval tv; - socklen_t tv_len, xulen; + socklen_t tv_len, xulen, len; struct xucred xu; struct l_ucred lxu; - int error, name; + int error, name, newval; bsd_args.s = args->s; bsd_args.level = linux_to_bsd_sockopt_level(args->level); @@ -1650,6 +1650,15 @@ linux_getsockopt(struct thread *td, stru return (copyout(&lxu, PTRIN(args->optval), sizeof(lxu))); /* NOTREACHED */ break; + case SO_ERROR: + len = sizeof(newval); + error = kern_getsockopt(td, args->s, bsd_args.level, + name, &newval, UIO_SYSSPACE, &len); + if (error) + return (error); + newval = -SV_ABI_ERRNO(td->td_proc, newval); + return (copyout(&newval, PTRIN(args->optval), len)); + /* NOTREACHED */ default: break; } From owner-svn-src-head@freebsd.org Sun May 22 12:59:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F428B456FB; Sun, 22 May 2016 12:59:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69A7E1E56; Sun, 22 May 2016 12:59:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MCx7RS079482; Sun, 22 May 2016 12:59:07 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MCx7Ot079481; Sun, 22 May 2016 12:59:07 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605221259.u4MCx7Ot079481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 22 May 2016 12:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300417 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 12:59:08 -0000 Author: bapt Date: Sun May 22 12:59:07 2016 New Revision: 300417 URL: https://svnweb.freebsd.org/changeset/base/300417 Log: Fix typo in comments for the zfsboot script Submitted by: Colby Swandale (via github) Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sun May 22 12:49:08 2016 (r300416) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sun May 22 12:59:07 2016 (r300417) @@ -55,7 +55,7 @@ f_include $BSDCFG_SHARE/variable.subr : ${ZFSBOOT_BEROOT_NAME:=ROOT} # -# Default name for the primany boot environment +# Default name for the primary boot environment # : ${ZFSBOOT_BOOTFS_NAME:=default} From owner-svn-src-head@freebsd.org Sun May 22 13:04:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D875B45850; Sun, 22 May 2016 13:04:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 314951245; Sun, 22 May 2016 13:04:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MD4jwD082493; Sun, 22 May 2016 13:04:45 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MD4j6H082492; Sun, 22 May 2016 13:04:45 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605221304.u4MD4j6H082492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 22 May 2016 13:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300418 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 13:04:46 -0000 Author: bapt Date: Sun May 22 13:04:45 2016 New Revision: 300418 URL: https://svnweb.freebsd.org/changeset/base/300418 Log: Fix typos in the comments Submitted by: cipherwraith666@gmail.com (via github) Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun May 22 12:59:07 2016 (r300417) +++ head/sys/kern/uipc_socket.c Sun May 22 13:04:45 2016 (r300418) @@ -550,7 +550,7 @@ SYSCTL_INT(_regression, OID_AUTO, sonewc /* * When an attempt at a new connection is noted on a socket which accepts * connections, sonewconn is called. If the connection is possible (subject - * to space constraints, etc.) then we allocate a new structure, propoerly + * to space constraints, etc.) then we allocate a new structure, properly * linked into the data structure of the original socket, and return this. * Connstatus may be 0, or SS_ISCONFIRMING, or SS_ISCONNECTED. * @@ -1164,7 +1164,7 @@ sosend_dgram(struct socket *so, struct s } /* * XXX all the SBS_CANTSENDMORE checks previously done could be out - * of date. We could have received a reset packet in an interrupt or + * of date. We could have recived a reset packet in an interrupt or * maybe we slept while doing page faults in uiomove() etc. We could * probably recheck again inside the locking protection here, but * there are probably other places that this also happens. We must @@ -2711,7 +2711,7 @@ sooptcopyout(struct sockopt *sopt, const * that we always tell the user precisely how much we copied, rather * than something useful like the total amount we had available for * her. Note that this interface is not idempotent; the entire - * answer must generated ahead of time. + * answer must be generated ahead of time. */ valsize = min(len, sopt->sopt_valsize); sopt->sopt_valsize = valsize; From owner-svn-src-head@freebsd.org Sun May 22 13:10:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E895B458C4; Sun, 22 May 2016 13:10:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12530145A; Sun, 22 May 2016 13:10:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MDAmpE082738; Sun, 22 May 2016 13:10:48 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MDAmub082737; Sun, 22 May 2016 13:10:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605221310.u4MDAmub082737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 22 May 2016 13:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300419 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 13:10:49 -0000 Author: bapt Date: Sun May 22 13:10:48 2016 New Revision: 300419 URL: https://svnweb.freebsd.org/changeset/base/300419 Log: Fix typo introduced by me (not the submitter) when fixing typos Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun May 22 13:04:45 2016 (r300418) +++ head/sys/kern/uipc_socket.c Sun May 22 13:10:48 2016 (r300419) @@ -1164,7 +1164,7 @@ sosend_dgram(struct socket *so, struct s } /* * XXX all the SBS_CANTSENDMORE checks previously done could be out - * of date. We could have recived a reset packet in an interrupt or + * of date. We could have received a reset packet in an interrupt or * maybe we slept while doing page faults in uiomove() etc. We could * probably recheck again inside the locking protection here, but * there are probably other places that this also happens. We must From owner-svn-src-head@freebsd.org Sun May 22 13:32:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDD8EB45DD5; Sun, 22 May 2016 13:32:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85ED61F3B; Sun, 22 May 2016 13:32:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MDWjUI091278; Sun, 22 May 2016 13:32:45 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MDWjGn091277; Sun, 22 May 2016 13:32:45 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201605221332.u4MDWjGn091277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 22 May 2016 13:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300420 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 13:32:46 -0000 Author: jilles Date: Sun May 22 13:32:45 2016 New Revision: 300420 URL: https://svnweb.freebsd.org/changeset/base/300420 Log: vfork(2): Mention some risks of calling vfork() from application code. MFC after: 1 week Modified: head/lib/libc/sys/vfork.2 Modified: head/lib/libc/sys/vfork.2 ============================================================================== --- head/lib/libc/sys/vfork.2 Sun May 22 13:10:48 2016 (r300419) +++ head/lib/libc/sys/vfork.2 Sun May 22 13:32:45 2016 (r300420) @@ -28,7 +28,7 @@ .\" @(#)vfork.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 6, 2015 +.Dd May 22, 2016 .Dt VFORK 2 .Os .Sh NAME @@ -41,11 +41,20 @@ .Ft pid_t .Fn vfork void .Sh DESCRIPTION +.Bf -symbolic +Since this function is hard to use correctly from application software, +it is recommended to use +.Xr posix_spawn 3 +or +.Xr fork 2 +instead. +.Ef +.Pp The .Fn vfork system call can be used to create new processes without fully copying the address -space of the old process, which is horrendously inefficient in a paged +space of the old process, which is inefficient in a paged environment. It is useful when the purpose of .Xr fork 2 @@ -56,13 +65,15 @@ The system call differs from .Xr fork 2 -in that the child borrows the parent's memory and thread of -control until a call to +in that the child borrows the parent process's address space and the +calling thread's stack +until a call to .Xr execve 2 or an exit (either by a call to .Xr _exit 2 or abnormally). -The parent process is suspended while the child is using its resources. +The calling thread is suspended while the child is using its resources. +Other threads continue to run. .Pp The .Fn vfork @@ -70,17 +81,21 @@ system call returns 0 in the child's context and (later) the pid of the child in the parent's context. .Pp -The -.Fn vfork -system call -can normally be used just like -.Xr fork 2 . -It does not work, however, to return while running in the child's context +Many problems can occur when replacing +.Xr fork 2 +with +.Fn vfork . +For example, it does not work to return while running in the child's context from the procedure that called .Fn vfork since the eventual return from .Fn vfork would then return to a no longer existent stack frame. +Also, changing process state which is partially implemented in user space +such as signal handlers with +.Xr libthr 3 +will corrupt the parent's state. +.Pp Be careful, also, to call .Xr _exit 2 rather than @@ -106,7 +121,8 @@ Same as for .Xr rfork 2 , .Xr sigaction 2 , .Xr wait 2 , -.Xr exit 3 +.Xr exit 3 , +.Xr posix_spawn 3 .Sh HISTORY The .Fn vfork From owner-svn-src-head@freebsd.org Sun May 22 13:58:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CFD5B451C0; Sun, 22 May 2016 13:58:35 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8AC31A93; Sun, 22 May 2016 13:58:34 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MDwYkd097525; Sun, 22 May 2016 13:58:34 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MDwW8u097510; Sun, 22 May 2016 13:58:32 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201605221358.u4MDwW8u097510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 22 May 2016 13:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300421 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/mv dev/acpi_support dev/acpica dev/amdtemp dev/coretemp dev/iicbus powerpc/powermac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 13:58:35 -0000 Author: loos Date: Sun May 22 13:58:32 2016 New Revision: 300421 URL: https://svnweb.freebsd.org/changeset/base/300421 Log: Fix the deciKelvin to Celsius conversion in kernel. After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C reference and as result, the temperature read in sysctl(8) now exibits a +0.1C difference. This commit fix the kernel references to match the reference value used in sysctl(8) after r285994. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/allwinner/axp209.c head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c head/sys/arm/freescale/imx/imx6_anatop.c head/sys/arm/mv/mv_ts.c head/sys/dev/acpi_support/acpi_asus_wmi.c head/sys/dev/acpi_support/acpi_ibm.c head/sys/dev/acpi_support/atk0110.c head/sys/dev/acpica/acpi_thermal.c head/sys/dev/amdtemp/amdtemp.c head/sys/dev/coretemp/coretemp.c head/sys/dev/iicbus/ds3231reg.h head/sys/dev/iicbus/lm75.c head/sys/powerpc/powermac/powermac_thermal.h head/sys/powerpc/powermac/smu.c head/sys/powerpc/powermac/smusat.c Modified: head/sys/arm/allwinner/axp209.c ============================================================================== --- head/sys/arm/allwinner/axp209.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/arm/allwinner/axp209.c Sun May 22 13:58:32 2016 (r300421) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #define AXP209_TEMPMON_L(a) ((a) & 0xf) #define AXP209_TEMPMON_MIN 1447 /* -144.7C */ -#define AXP209_0C_TO_K 2732 +#define AXP209_0C_TO_K 2731 struct axp209_softc { uint32_t addr; Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Sun May 22 13:58:32 2016 (r300421) @@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$"); #define MSG_ERROR -999999999 #define MHZSTEP 100 #define HZSTEP (MHZ2HZ(MHZSTEP)) -#define TZ_ZEROC 2732 +#define TZ_ZEROC 2731 #define VC_LOCK(sc) do { \ sema_wait(&vc_sema); \ Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/arm/freescale/imx/imx6_anatop.c Sun May 22 13:58:32 2016 (r300421) @@ -139,7 +139,7 @@ static struct oppt { */ static uint32_t imx6_ocotp_mhz_tab[] = {792, 852, 996, 1200}; -#define TZ_ZEROC 2732 /* deci-Kelvin <-> deci-Celcius offset. */ +#define TZ_ZEROC 2731 /* deci-Kelvin <-> deci-Celcius offset. */ uint32_t imx6_anatop_read_4(bus_size_t offset) Modified: head/sys/arm/mv/mv_ts.c ============================================================================== --- head/sys/arm/mv/mv_ts.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/arm/mv/mv_ts.c Sun May 22 13:58:32 2016 (r300421) @@ -80,7 +80,7 @@ ts_probe(device_t dev) #define MV_TEMP_SENS_OFFS 10 #define MV_TEMP_SENS_MASK 0x1ff #define MV_TEMP_SENS_READ_MAX 16 -#define TZ_ZEROC 2732 +#define TZ_ZEROC 2731 #define MV_TEMP_CONVERT(x) ((((322 - x) * 100000) / 13625) + TZ_ZEROC) /* Modified: head/sys/dev/acpi_support/acpi_asus_wmi.c ============================================================================== --- head/sys/dev/acpi_support/acpi_asus_wmi.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/dev/acpi_support/acpi_asus_wmi.c Sun May 22 13:58:32 2016 (r300421) @@ -498,7 +498,7 @@ acpi_asus_wmi_sysctl_get(struct acpi_asu switch(dev_id) { case ASUS_WMI_DEVID_THERMAL_CTRL: - val = (val - 2732 + 5) / 10; + val = (val - 2731 + 5) / 10; break; case ASUS_WMI_DEVID_PROCESSOR_STATE: case ASUS_WMI_DEVID_FAN_CTRL: Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/dev/acpi_support/acpi_ibm.c Sun May 22 13:58:32 2016 (r300421) @@ -941,7 +941,7 @@ acpi_ibm_thermal_sysctl(SYSCTL_HANDLER_A temp[i] = -1; else if (sc->thermal_updt_supported) /* Temperature is reported in tenth of Kelvin */ - temp[i] = (temp[i] - 2732 + 5) / 10; + temp[i] = (temp[i] - 2731 + 5) / 10; } error = sysctl_handle_opaque(oidp, &temp, 8*sizeof(int), req); Modified: head/sys/dev/acpi_support/atk0110.c ============================================================================== --- head/sys/dev/acpi_support/atk0110.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/dev/acpi_support/atk0110.c Sun May 22 13:58:32 2016 (r300421) @@ -344,9 +344,9 @@ aibs_sysctl(SYSCTL_HANDLER_ARGS) case AIBS_VOLT: break; case AIBS_TEMP: - v += 2732; - l += 2732; - h += 2732; + v += 2731; + l += 2731; + h += 2731; break; case AIBS_FAN: break; Modified: head/sys/dev/acpica/acpi_thermal.c ============================================================================== --- head/sys/dev/acpica/acpi_thermal.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/dev/acpica/acpi_thermal.c Sun May 22 13:58:32 2016 (r300421) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #define _COMPONENT ACPI_THERMAL ACPI_MODULE_NAME("THERMAL") -#define TZ_ZEROC 2732 +#define TZ_ZEROC 2731 #define TZ_KELVTOC(x) (((x) - TZ_ZEROC) / 10), abs(((x) - TZ_ZEROC) % 10) #define TZ_NOTIFY_TEMPERATURE 0x80 /* Temperature changed. */ Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/dev/amdtemp/amdtemp.c Sun May 22 13:58:32 2016 (r300421) @@ -505,7 +505,7 @@ amdtemp_sysctl(SYSCTL_HANDLER_ARGS) return (error); } -#define AMDTEMP_ZERO_C_TO_K 2732 +#define AMDTEMP_ZERO_C_TO_K 2731 static int32_t amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) Modified: head/sys/dev/coretemp/coretemp.c ============================================================================== --- head/sys/dev/coretemp/coretemp.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/dev/coretemp/coretemp.c Sun May 22 13:58:32 2016 (r300421) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define TZ_ZEROC 2732 +#define TZ_ZEROC 2731 #define THERM_STATUS_LOG 0x02 #define THERM_STATUS 0x01 Modified: head/sys/dev/iicbus/ds3231reg.h ============================================================================== --- head/sys/dev/iicbus/ds3231reg.h Sun May 22 13:32:45 2016 (r300420) +++ head/sys/dev/iicbus/ds3231reg.h Sun May 22 13:58:32 2016 (r300421) @@ -73,6 +73,6 @@ #define DS3231_0250C 0x40 #define DS3231_MSB 0x8000 #define DS3231_NEG_BIT DS3231_MSB -#define TZ_ZEROC 2732 +#define TZ_ZEROC 2731 #endif /* _DS3231REG_H_ */ Modified: head/sys/dev/iicbus/lm75.c ============================================================================== --- head/sys/dev/iicbus/lm75.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/dev/iicbus/lm75.c Sun May 22 13:58:32 2016 (r300421) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #define LM75_0125C 0x20 #define LM75_MSB 0x8000 #define LM75_NEG_BIT LM75_MSB -#define TZ_ZEROC 2732 +#define TZ_ZEROC 2731 /* LM75 supported models. */ #define HWTYPE_LM75 1 Modified: head/sys/powerpc/powermac/powermac_thermal.h ============================================================================== --- head/sys/powerpc/powermac/powermac_thermal.h Sun May 22 13:32:45 2016 (r300420) +++ head/sys/powerpc/powermac/powermac_thermal.h Sun May 22 13:58:32 2016 (r300421) @@ -29,7 +29,7 @@ #ifndef _POWERPC_POWERMAC_POWERMAC_THERMAL_H #define _POWERPC_POWERMAC_POWERMAC_THERMAL_H -#define ZERO_C_TO_K 2732 +#define ZERO_C_TO_K 2731 struct pmac_fan { int min_rpm, max_rpm, default_rpm; Modified: head/sys/powerpc/powermac/smu.c ============================================================================== --- head/sys/powerpc/powermac/smu.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/powerpc/powermac/smu.c Sun May 22 13:58:32 2016 (r300421) @@ -1110,7 +1110,7 @@ smu_sensor_read(struct smu_sensor *sens) value <<= 1; /* Convert from 16.16 fixed point degC into integer 0.1 K. */ - value = 10*(value >> 16) + ((10*(value & 0xffff)) >> 16) + 2732; + value = 10*(value >> 16) + ((10*(value & 0xffff)) >> 16) + 2731; break; case SMU_VOLTAGE_SENSOR: value *= sc->sc_cpu_volt_scale; @@ -1245,8 +1245,8 @@ smu_attach_sensors(device_t dev, phandle if (sens->type == SMU_TEMP_SENSOR) { /* Make up some numbers */ - sens->therm.target_temp = 500 + 2732; /* 50 C */ - sens->therm.max_temp = 900 + 2732; /* 90 C */ + sens->therm.target_temp = 500 + 2731; /* 50 C */ + sens->therm.max_temp = 900 + 2731; /* 90 C */ sens->therm.read = (int (*)(struct pmac_therm *))smu_sensor_read; Modified: head/sys/powerpc/powermac/smusat.c ============================================================================== --- head/sys/powerpc/powermac/smusat.c Sun May 22 13:32:45 2016 (r300420) +++ head/sys/powerpc/powermac/smusat.c Sun May 22 13:58:32 2016 (r300421) @@ -184,8 +184,8 @@ smusat_attach(device_t dev) if (sens->type == SMU_TEMP_SENSOR) { /* Make up some numbers */ - sens->therm.target_temp = 500 + 2732; /* 50 C */ - sens->therm.max_temp = 900 + 2732; /* 90 C */ + sens->therm.target_temp = 500 + 2731; /* 50 C */ + sens->therm.max_temp = 900 + 2731; /* 90 C */ sens->therm.read = (int (*)(struct pmac_therm *))smusat_sensor_read; pmac_thermal_sensor_register(&sens->therm); @@ -248,7 +248,7 @@ smusat_sensor_read(struct smu_sensor *se /* 16.16 */ value <<= 10; /* From 16.16 to 0.1 C */ - value = 10*(value >> 16) + ((10*(value & 0xffff)) >> 16) + 2732; + value = 10*(value >> 16) + ((10*(value & 0xffff)) >> 16) + 2731; break; case SMU_VOLTAGE_SENSOR: /* 16.16 */ From owner-svn-src-head@freebsd.org Sun May 22 14:13:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3643B456F6; Sun, 22 May 2016 14:13:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5AFF12D1; Sun, 22 May 2016 14:13:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MEDKoa003582; Sun, 22 May 2016 14:13:20 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MEDKYR003581; Sun, 22 May 2016 14:13:20 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605221413.u4MEDKYR003581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 22 May 2016 14:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300422 - head/sys/compat/ndis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 14:13:22 -0000 Author: pfg Date: Sun May 22 14:13:20 2016 New Revision: 300422 URL: https://svnweb.freebsd.org/changeset/base/300422 Log: ndis(4): Undo unneeded workarounds in ndis' rand(). - Revert the change for seed(0) in r300384. I misunderstood the standard and while our random() implementation in libkern may be improved, it handles the seed(0) case fine. Pointed out by: bde, ache Modified: head/sys/compat/ndis/subr_ntoskrnl.c Modified: head/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- head/sys/compat/ndis/subr_ntoskrnl.c Sun May 22 13:58:32 2016 (r300421) +++ head/sys/compat/ndis/subr_ntoskrnl.c Sun May 22 14:13:20 2016 (r300422) @@ -3196,8 +3196,6 @@ static void srand(unsigned int seed) { - if (seed == 0) - seed = 1; srandom(seed); } From owner-svn-src-head@freebsd.org Sun May 22 14:31:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2E5AB45916; Sun, 22 May 2016 14:31:21 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90CB21A43; Sun, 22 May 2016 14:31:21 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MEVK0N007528; Sun, 22 May 2016 14:31:20 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MEVKXC007524; Sun, 22 May 2016 14:31:20 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201605221431.u4MEVKXC007524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sun, 22 May 2016 14:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300423 - in head/sys: fs/ext2fs ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 14:31:21 -0000 Author: kevlo Date: Sun May 22 14:31:20 2016 New Revision: 300423 URL: https://svnweb.freebsd.org/changeset/base/300423 Log: arc4random() returns 0 to (2**32)−1, use an alternative to initialize i_gen if it's zero rather than a divide by 2. With inputs from delphij, mckusick, rmacklem Reviewed by: mckusick Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sun May 22 14:13:20 2016 (r300422) +++ head/sys/fs/ext2fs/ext2_alloc.c Sun May 22 14:31:20 2016 (r300423) @@ -408,7 +408,8 @@ ext2_valloc(struct vnode *pvp, int mode, /* * Set up a new generation number for this inode. */ - ip->i_gen = arc4random(); + while (ip->i_gen == 0 || ++ip->i_gen == 0) + ip->i_gen = arc4random(); vfs_timestamp(&ts); ip->i_birthtime = ts.tv_sec; Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Sun May 22 14:13:20 2016 (r300422) +++ head/sys/fs/ext2fs/ext2_vfsops.c Sun May 22 14:31:20 2016 (r300423) @@ -998,7 +998,8 @@ ext2_vget(struct mount *mp, ino_t ino, i * already have one. This should only happen on old filesystems. */ if (ip->i_gen == 0) { - ip->i_gen = random() + 1; + while (ip->i_gen == 0) + ip->i_gen = arc4random(); if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) ip->i_flag |= IN_MODIFIED; } Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun May 22 14:13:20 2016 (r300422) +++ head/sys/ufs/ffs/ffs_alloc.c Sun May 22 14:31:20 2016 (r300423) @@ -1102,8 +1102,8 @@ dup_alloc: /* * Set up a new generation number for this inode. */ - if (ip->i_gen == 0 || ++ip->i_gen == 0) - ip->i_gen = arc4random() / 2 + 1; + while (ip->i_gen == 0 || ++ip->i_gen == 0) + ip->i_gen = arc4random(); DIP_SET(ip, i_gen, ip->i_gen); if (fs->fs_magic == FS_UFS2_MAGIC) { vfs_timestamp(&ts); @@ -2080,7 +2080,8 @@ gotit: bzero(ibp->b_data, (int)fs->fs_bsize); dp2 = (struct ufs2_dinode *)(ibp->b_data); for (i = 0; i < INOPB(fs); i++) { - dp2->di_gen = arc4random() / 2 + 1; + while (dp2->di_gen == 0) + dp2->di_gen = arc4random(); dp2++; } /* Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sun May 22 14:13:20 2016 (r300422) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun May 22 14:31:20 2016 (r300423) @@ -1768,7 +1768,8 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags * already have one. This should only happen on old filesystems. */ if (ip->i_gen == 0) { - ip->i_gen = arc4random() / 2 + 1; + while (ip->i_gen == 0) + ip->i_gen = arc4random(); if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { ip->i_flag |= IN_MODIFIED; DIP_SET(ip, i_gen, ip->i_gen); From owner-svn-src-head@freebsd.org Sun May 22 15:22:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2FC5B4557A; Sun, 22 May 2016 15:22:46 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B338A107A; Sun, 22 May 2016 15:22:46 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MFMjYZ024748; Sun, 22 May 2016 15:22:45 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MFMjrj024747; Sun, 22 May 2016 15:22:45 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201605221522.u4MFMjrj024747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 22 May 2016 15:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300424 - head/sys/dev/cpuctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 15:22:47 -0000 Author: ache Date: Sun May 22 15:22:45 2016 New Revision: 300424 URL: https://svnweb.freebsd.org/changeset/base/300424 Log: Improve panic message by specifying on which cpu it really is. Modified: head/sys/dev/cpuctl/cpuctl.c Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Sun May 22 14:31:20 2016 (r300423) +++ head/sys/dev/cpuctl/cpuctl.c Sun May 22 15:22:45 2016 (r300424) @@ -126,7 +126,7 @@ set_cpu(int cpu, struct thread *td) sched_bind(td, cpu); thread_unlock(td); KASSERT(td->td_oncpu == cpu, - ("[cpuctl,%d]: cannot bind to target cpu %d", __LINE__, cpu)); + ("[cpuctl,%d]: cannot bind to target cpu %d on cpu %d", __LINE__, cpu, td->td_oncpu)); } static void From owner-svn-src-head@freebsd.org Sun May 22 16:24:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13389B45FF5; Sun, 22 May 2016 16:24:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3B261A99; Sun, 22 May 2016 16:24:22 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MGOLVf043429; Sun, 22 May 2016 16:24:21 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MGOLou043428; Sun, 22 May 2016 16:24:21 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605221624.u4MGOLou043428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 22 May 2016 16:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300425 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 16:24:23 -0000 Author: allanjude Date: Sun May 22 16:24:21 2016 New Revision: 300425 URL: https://svnweb.freebsd.org/changeset/base/300425 Log: Fix default ZFS layout to work better by default with sysutils/beadm The root file system is mounted early via vfs.root.mountfrom. The canmount=noauto property only affects the zfs rc.d script. This ensures that the 'default' BE is not mounted overtop of another BE when one is selected from the beastie menu 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 May 22 15:22:45 2016 (r300424) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sun May 22 16:24:21 2016 (r300425) @@ -143,7 +143,7 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA # Boot Environment [BE] root and default boot dataset /$ZFSBOOT_BEROOT_NAME mountpoint=none - /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME mountpoint=/ + /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME mountpoint=/,canmount=noauto # Compress /tmp, allow exec but not setuid /tmp mountpoint=/tmp,exec=on,setuid=off From owner-svn-src-head@freebsd.org Sun May 22 18:16:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E0ACB45BE9; Sun, 22 May 2016 18:16:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06CC010F5; Sun, 22 May 2016 18:16:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MIGQ9i077481; Sun, 22 May 2016 18:16:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MIGQDo077479; Sun, 22 May 2016 18:16:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605221816.u4MIGQDo077479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 22 May 2016 18:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300427 - in head/sys/fs: cd9660 udf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 18:16:27 -0000 Author: kib Date: Sun May 22 18:16:25 2016 New Revision: 300427 URL: https://svnweb.freebsd.org/changeset/base/300427 Log: Remove drop/reacquire of Giant around geom calls for cd9660 and udf. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/udf/udf_vfsops.c Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Sun May 22 18:16:04 2016 (r300426) +++ head/sys/fs/cd9660/cd9660_vfsops.c Sun May 22 18:16:25 2016 (r300427) @@ -226,11 +226,9 @@ iso_mountfs(devvp, mp) dev = devvp->v_rdev; dev_ref(dev); - DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "cd9660", 0); g_topology_unlock(); - PICKUP_GIANT(); VOP_UNLOCK(devvp, 0); if (error) goto out; @@ -481,11 +479,9 @@ out: if (supbp != NULL) brelse(supbp); if (cp != NULL) { - DROP_GIANT(); g_topology_lock(); g_vfs_close(cp); g_topology_unlock(); - PICKUP_GIANT(); } if (isomp) { free(isomp, M_ISOFSMNT); @@ -519,11 +515,9 @@ cd9660_unmount(mp, mntflags) if (isomp->im_l2d) cd9660_iconv->close(isomp->im_l2d); } - DROP_GIANT(); g_topology_lock(); g_vfs_close(isomp->im_cp); g_topology_unlock(); - PICKUP_GIANT(); vrele(isomp->im_devvp); dev_rel(isomp->im_dev); free(isomp, M_ISOFSMNT); Modified: head/sys/fs/udf/udf_vfsops.c ============================================================================== --- head/sys/fs/udf/udf_vfsops.c Sun May 22 18:16:04 2016 (r300426) +++ head/sys/fs/udf/udf_vfsops.c Sun May 22 18:16:25 2016 (r300427) @@ -325,11 +325,9 @@ udf_mountfs(struct vnode *devvp, struct dev = devvp->v_rdev; dev_ref(dev); - DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "udf", 0); g_topology_unlock(); - PICKUP_GIANT(); VOP_UNLOCK(devvp, 0); if (error) goto bail; @@ -500,11 +498,9 @@ bail: if (bp != NULL) brelse(bp); if (cp != NULL) { - DROP_GIANT(); g_topology_lock(); g_vfs_close(cp); g_topology_unlock(); - PICKUP_GIANT(); } dev_rel(dev); return error; @@ -533,11 +529,9 @@ udf_unmount(struct mount *mp, int mntfla #endif } - DROP_GIANT(); g_topology_lock(); g_vfs_close(udfmp->im_cp); g_topology_unlock(); - PICKUP_GIANT(); vrele(udfmp->im_devvp); dev_rel(udfmp->im_dev); From owner-svn-src-head@freebsd.org Sun May 22 18:20:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED564B45DD1; Sun, 22 May 2016 18:20:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAFC113D2; Sun, 22 May 2016 18:20:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MIKj74079665; Sun, 22 May 2016 18:20:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MIKjDd079664; Sun, 22 May 2016 18:20:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605221820.u4MIKjDd079664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 May 2016 18:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300428 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 18:20:47 -0000 Author: ngie Date: Sun May 22 18:20:45 2016 New Revision: 300428 URL: https://svnweb.freebsd.org/changeset/base/300428 Log: Fix humanized decoding of struct stat with respect to .st_mtim st_mtim was being incorrectly described as "stime=", not "mtime=". This was introduced with the original feature commit (r176471). MFC after: 1 week PR: 209699 Submitted by: naddy Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sun May 22 18:16:25 2016 (r300427) +++ head/usr.bin/kdump/kdump.c Sun May 22 18:20:45 2016 (r300428) @@ -1688,7 +1688,7 @@ ktrstat(struct stat *statp) printf(".%09ld, ", statp->st_atim.tv_nsec); else printf(", "); - printf("stime="); + printf("mtime="); if (resolv == 0) printf("%jd", (intmax_t)statp->st_mtim.tv_sec); else { From owner-svn-src-head@freebsd.org Sun May 22 18:51:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E3E7B457F6; Sun, 22 May 2016 18:51:38 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DC0317A2; Sun, 22 May 2016 18:51:38 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp003.me.com by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) id <0O7L00300DOMTK00@mr11p00im-asmtp003.me.com>; Sun, 22 May 2016 18:51:32 +0000 (GMT) Received: from [192.168.1.4] (c-67-169-142-6.hsd1.ca.comcast.net [67.169.142.6]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O7L004EDDPUPC30@mr11p00im-asmtp003.me.com>; Sun, 22 May 2016 18:51:31 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-05-22_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1605220246 User-Agent: Microsoft-MacOutlook/f.16.0.160506 Date: Sun, 22 May 2016 11:51:37 -0700 Subject: Re: svn commit: r300421 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/mv dev/acpi_support dev/acpica dev/amdtemp dev/coretemp dev/iicbus powerpc/powermac From: Ravi Pokala Sender: "Pokala, Ravi" To: Luiz Otavio O Souza , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r300421 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/mv dev/acpi_support dev/acpica dev/amdtemp dev/coretemp dev/iicbus powerpc/powermac References: <201605221358.u4MDwW8u097510@repo.freebsd.org> In-reply-to: <201605221358.u4MDwW8u097510@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1463943092; bh=yAGSMmFeMzoe+4Hql8WSB1MK8oqC+x0heJ5z/yaa548=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=gNow/NPSnlTCJ7nAIBFWF0rd2ivQyy4hrSBLDS956ZhvKXOkZi9DXyYgst8y4MG14 WglEHdtXy3tyCSU8QtYzZ9RC9Bu0PqFBF0PsP2kTPE/b0sJgWafTSu3kaK9usKnrH5 r+fneU1CZb9w6KaUtXGNOlMGq9HsVwP1Aoxo5gmP29oVKjKzdSZZ2kkupGama0T84F RY3nbDNtA7xLJj4ZOEsoI5TJrAthWNqYG2JW9bdGxSdRA6ynbrk/MLgpIv6xJwB/0Y OdKqU6wYPJHrYdIN/ENDSyQbtf+tDDPm5GL4TD8b6xqAJ6YAZ1PGdkKVKf8TpxGjSl RUlq68OCfDQWA== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 18:51:38 -0000 -----Original Message----- From: on behalf of Luiz Otavio O Souza Date: 2016-05-22, Sunday at 06:58 To: , , Subject: svn commit: r300421 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/mv dev/acpi_support dev/acpica dev/amdtemp dev/coretemp dev/iicbus powerpc/powermac >Author: loos >Date: Sun May 22 13:58:32 2016 >New Revision: 300421 >URL: https://svnweb.freebsd.org/changeset/base/300421 > >Log: > Fix the deciKelvin to Celsius conversion in kernel. > > After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C > reference and as result, the temperature read in sysctl(8) now exibits a > +0.1C difference. Out of morbid curiosity, why do these things report in deciKelvin anyway? Are there sensors we support out there which report native Kelvin, or that report sub-degree precision? Thanks, Ravi (rpokala@) From owner-svn-src-head@freebsd.org Sun May 22 19:04:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13027B45C62; Sun, 22 May 2016 19:04:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4CAF1FCC; Sun, 22 May 2016 19:04:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MJ4YNf092344; Sun, 22 May 2016 19:04:34 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MJ4YbY092343; Sun, 22 May 2016 19:04:34 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605221904.u4MJ4YbY092343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 22 May 2016 19:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300429 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 19:04:36 -0000 Author: dchagin Date: Sun May 22 19:04:34 2016 New Revision: 300429 URL: https://svnweb.freebsd.org/changeset/base/300429 Log: Remove a now unused global declaration of some sysentvec struct. MFC after: 2 week Modified: head/sys/sys/sysent.h Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Sun May 22 18:20:45 2016 (r300428) +++ head/sys/sys/sysent.h Sun May 22 19:04:34 2016 (r300429) @@ -155,8 +155,6 @@ struct sysentvec { #ifdef _KERNEL extern struct sysentvec aout_sysvec; -extern struct sysentvec elf_freebsd_sysvec; -extern struct sysentvec null_sysvec; extern struct sysent sysent[]; extern const char *syscallnames[]; From owner-svn-src-head@freebsd.org Sun May 22 19:06:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3714FB45CFB; Sun, 22 May 2016 19:06:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 077951168; Sun, 22 May 2016 19:06:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MJ6chF092458; Sun, 22 May 2016 19:06:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MJ6cMA092457; Sun, 22 May 2016 19:06:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605221906.u4MJ6cMA092457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 22 May 2016 19:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300430 - head/usr.sbin/rpc.yppasswdd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 19:06:39 -0000 Author: ngie Date: Sun May 22 19:06:38 2016 New Revision: 300430 URL: https://svnweb.freebsd.org/changeset/base/300430 Log: Wrap EXPAND(..) macro with a do-while(0) loop and put a single statement on each line As a positive side-effect, this eliminates the double semicolons reported by Coverity: the macro contained a trailing semicolon, in addition to the semicolon placed on each line where EXPAND(..) was called. MFC after: 1 week Reported by: Coverity CID: 1194269 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Modified: head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c ============================================================================== --- head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Sun May 22 19:04:34 2016 (r300429) +++ head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Sun May 22 19:06:38 2016 (r300430) @@ -103,7 +103,10 @@ copy_yp_pass(char *p, int x, int m) } t = buf; -#define EXPAND(e) e = t; while ((*t++ = *p++)); +#define EXPAND(e) do { \ + e = t; \ + while ((*t++ = *p++)); \ +} while (0) EXPAND(yp_password.pw_name); yp_password.pw_fields |= _PWF_NAME; EXPAND(yp_password.pw_passwd); From owner-svn-src-head@freebsd.org Sun May 22 19:08:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7A37B45DA9; Sun, 22 May 2016 19:08:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A2381350; Sun, 22 May 2016 19:08:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MJ8TVd092561; Sun, 22 May 2016 19:08:29 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MJ8Ti7092560; Sun, 22 May 2016 19:08:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605221908.u4MJ8Ti7092560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 22 May 2016 19:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300431 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 19:08:30 -0000 Author: dchagin Date: Sun May 22 19:08:29 2016 New Revision: 300431 URL: https://svnweb.freebsd.org/changeset/base/300431 Log: Convert proto family in both directions. The linux and native values for local and inet are identical, but for inet6 values differ. PR: 155040 Reported by: Simon Walton MFC after: 2 week Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun May 22 19:06:38 2016 (r300430) +++ head/sys/compat/linux/linux_socket.c Sun May 22 19:08:29 2016 (r300431) @@ -462,12 +462,16 @@ bsd_to_linux_sockaddr(struct sockaddr *a { struct sockaddr sa; size_t sa_len = sizeof(struct sockaddr); - int error; + int error, bdom; if ((error = copyin(arg, &sa, sa_len))) return (error); - *(u_short *)&sa = sa.sa_family; + bdom = bsd_to_linux_domain(sa.sa_family); + if (bdom == -1) + return (EAFNOSUPPORT); + + *(u_short *)&sa = bdom; return (copyout(&sa, arg, sa_len)); } @@ -476,12 +480,16 @@ linux_to_bsd_sockaddr(struct sockaddr *a { struct sockaddr sa; size_t sa_len = sizeof(struct sockaddr); - int error; + int error, bdom; if ((error = copyin(arg, &sa, sa_len))) return (error); - sa.sa_family = *(sa_family_t *)&sa; + bdom = linux_to_bsd_domain(*(sa_family_t *)&sa); + if (bdom == -1) + return (EAFNOSUPPORT); + + sa.sa_family = bdom; sa.sa_len = len; return (copyout(&sa, arg, sa_len)); } From owner-svn-src-head@freebsd.org Sun May 22 19:12:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6947B45FAE; Sun, 22 May 2016 19:12:26 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80BF41A19; Sun, 22 May 2016 19:12:26 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-oi0-x229.google.com with SMTP id j1so11543186oih.3; Sun, 22 May 2016 12:12:26 -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; bh=rzDkVK2+csrdK7owQU4ebAmGmtAgRdFFHgX1+JTw960=; b=jeunP/7VtKBHMGyTXTyuYhS0cbiJt7Y6lF9RI4DlQsvmZLPexLVFC16+Asl6PBggqt F/eF248l5jXAmohqyRnyFgS6QrBhhfXlsI8O//+6vxRTKk7hVYXEspKriBxEkc2dyJCQ ei202/MM5n/1uRonZ2EVTdTlJ2JfLXHv7LhhqdnSDrxh47m1sN19unduaDL17T+2vdUO ZDU0e4PdESyGN0U7Q54RL3ogm9zs8SrrIjtvh1SjXtDzJYMNS79abLJF76liF2DMSF5L Tb5xWA47kTkjwDRsUPfQbgL8APlwsoQcxAvkDETBFoi7AXUtk95I1tTmrYpFvTLme8uK 0BYA== 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; bh=rzDkVK2+csrdK7owQU4ebAmGmtAgRdFFHgX1+JTw960=; b=bp3iBcVezrLZM8bWrrPZO6UWA5SMwYvlOLD5rwrI7Zvy77Id7g4ekXVNezHdujAvBs CFgsnEU+bAY8yxT7aVbEJVEJlmwZTezswvbRKIY/D0zU68dD1ciFUSkOOUL9dlLteth3 FhfMU0RAcDYvJMZqjYKjEKS8VSoEsHerIK44nedm3rtd4SxfD/aPvQnYYA7x1VvotOau mb/sjmv7Gc1yEgNvpbXqM4DlEqHiRcaiU47hS6SpSkCJbeQCn+PR8F7w9NSauAO7ucde e9eU6SD9tA4hDzcuwdZOG2sNrsMZyp27jhCtXLUYrtcDl4AzSMfLYsRc6K6vDfa9SLyC oQNg== X-Gm-Message-State: ALyK8tJI49R1PqDGxSGv7PnlXmEylj97hFZBhfWd4Z7a9R0B2IaTOGbtDLfBtsgAOwFABVkOizr7gAQbSyNCSA== MIME-Version: 1.0 X-Received: by 10.157.47.181 with SMTP id r50mr3180590otb.51.1463944345211; Sun, 22 May 2016 12:12:25 -0700 (PDT) Received: by 10.182.105.74 with HTTP; Sun, 22 May 2016 12:12:24 -0700 (PDT) Received: by 10.182.105.74 with HTTP; Sun, 22 May 2016 12:12:24 -0700 (PDT) In-Reply-To: References: <201605221358.u4MDwW8u097510@repo.freebsd.org> Date: Sun, 22 May 2016 14:12:24 -0500 Message-ID: Subject: Re: svn commit: r300421 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/mv dev/acpi_support dev/acpica dev/amdtemp dev/coretemp dev/iicbus powerpc/powermac From: Justin Hibbits To: Ravi Pokala Cc: src-committers , svn-src-head@freebsd.org, Luiz Otavio O Souza , svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 19:12:26 -0000 On May 22, 2016 13:51, "Ravi Pokala" wrote: > > -----Original Message----- > From: on behalf of Luiz Otavio O Souza > Date: 2016-05-22, Sunday at 06:58 > To: , , < svn-src-head@freebsd.org> > Subject: svn commit: r300421 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/mv dev/acpi_support dev/acpica dev/amdtemp dev/coretemp dev/iicbus powerpc/powermac > > >Author: loos > >Date: Sun May 22 13:58:32 2016 > >New Revision: 300421 > >URL: https://svnweb.freebsd.org/changeset/base/300421 > > > >Log: > > Fix the deciKelvin to Celsius conversion in kernel. > > > > After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C > > reference and as result, the temperature read in sysctl(8) now exibits a > > +0.1C difference. > > Out of morbid curiosity, why do these things report in deciKelvin anyway? Are there sensors we support out there which report native Kelvin, or that report sub-degree precision? > > Thanks, > > Ravi (rpokala@) > There are many i2c sensors which report in sub-degree centigrade. Though some of them are in 1/8 (or other power of 2) degree precision, not 1/10. - Justin From owner-svn-src-head@freebsd.org Sun May 22 19:25:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2583CB46449; Sun, 22 May 2016 19:25:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2C6C1241; Sun, 22 May 2016 19:25:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MJPstc098719; Sun, 22 May 2016 19:25:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MJPsDF098718; Sun, 22 May 2016 19:25:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605221925.u4MJPsDF098718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 22 May 2016 19:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300432 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 19:25:55 -0000 Author: kib Date: Sun May 22 19:25:53 2016 New Revision: 300432 URL: https://svnweb.freebsd.org/changeset/base/300432 Log: Remove false claim. Giant is dropped by mi_startup() before passing the control to swapper. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/vm/vm_glue.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Sun May 22 19:08:29 2016 (r300431) +++ head/sys/vm/vm_glue.c Sun May 22 19:25:53 2016 (r300432) @@ -731,8 +731,6 @@ faultin(p) * This swapin algorithm attempts to swap-in processes only if there * is enough space for them. Of course, if a process waits for a long * time, it will be swapped in anyway. - * - * Giant is held on entry. */ void swapper(void) From owner-svn-src-head@freebsd.org Sun May 22 19:43:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59AC5B466F8; Sun, 22 May 2016 19:43:42 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA7E1AA3; Sun, 22 May 2016 19:43:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MJhfLB004645; Sun, 22 May 2016 19:43:41 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MJhftZ004642; Sun, 22 May 2016 19:43:41 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605221943.u4MJhftZ004642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 22 May 2016 19:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300433 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 19:43:42 -0000 Author: avos Date: Sun May 22 19:43:40 2016 New Revision: 300433 URL: https://svnweb.freebsd.org/changeset/base/300433 Log: urtwn: setup per-frame retry limit. Override global retry limit (which is set in R92C_RL) via per-frame TX descriptor field. Obsoletes D3840 (should work better with 2+ vaps). Tested with RTL8188EU and RTL8192CUS in STA mode (maxretry = [3-9]). Modified: head/sys/dev/urtwn/if_urtwn.c head/sys/dev/urtwn/if_urtwnreg.h Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Sun May 22 19:25:53 2016 (r300432) +++ head/sys/dev/urtwn/if_urtwn.c Sun May 22 19:43:40 2016 (r300433) @@ -2838,7 +2838,7 @@ urtwn_tx_data(struct urtwn_softc *sc, st struct ieee80211_channel *chan; struct ieee80211_frame *wh; struct r92c_tx_desc *txd; - uint8_t macid, raid, rate, ridx, subtype, type, tid, qsel; + uint8_t macid, raid, rate, ridx, subtype, type, tid, qos, qsel; int hasqos, ismcast; URTWN_ASSERT_LOCKED(sc); @@ -2854,10 +2854,12 @@ urtwn_tx_data(struct urtwn_softc *sc, st /* Select TX ring for this frame. */ if (hasqos) { - tid = ((const struct ieee80211_qosframe *)wh)->i_qos[0]; - tid &= IEEE80211_QOS_TID; - } else + qos = ((const struct ieee80211_qosframe *)wh)->i_qos[0]; + tid = qos & IEEE80211_QOS_TID; + } else { + qos = 0; tid = 0; + } chan = (ni->ni_chan != IEEE80211_CHAN_ANYC) ? ni->ni_chan : ic->ic_curchan; @@ -2923,6 +2925,14 @@ urtwn_tx_data(struct urtwn_softc *sc, st txd->txdw0 |= htole32(R92C_TXDW0_BMCAST); if (!ismcast) { + /* Unicast frame, check if an ACK is expected. */ + if (!qos || (qos & IEEE80211_QOS_ACKPOLICY) != + IEEE80211_QOS_ACKPOLICY_NOACK) { + txd->txdw5 |= htole32(R92C_TXDW5_RTY_LMT_ENA); + txd->txdw5 |= htole32(SM(R92C_TXDW5_RTY_LMT, + tp->maxretry)); + } + if (sc->chip & URTWN_CHIP_88E) { struct urtwn_node *un = URTWN_NODE(ni); macid = un->id; @@ -3102,6 +3112,11 @@ urtwn_tx_raw(struct urtwn_softc *sc, str if (IEEE80211_IS_MULTICAST(wh->i_addr1)) txd->txdw0 |= htole32(R92C_TXDW0_BMCAST); + if ((params->ibp_flags & IEEE80211_BPF_NOACK) == 0) { + txd->txdw5 |= htole32(R92C_TXDW5_RTY_LMT_ENA); + txd->txdw5 |= htole32(SM(R92C_TXDW5_RTY_LMT, + params->ibp_try0)); + } if (params->ibp_flags & IEEE80211_BPF_RTS) txd->txdw4 |= htole32(R92C_TXDW4_RTSEN); if (params->ibp_flags & IEEE80211_BPF_CTS) Modified: head/sys/dev/urtwn/if_urtwnreg.h ============================================================================== --- head/sys/dev/urtwn/if_urtwnreg.h Sun May 22 19:25:53 2016 (r300432) +++ head/sys/dev/urtwn/if_urtwnreg.h Sun May 22 19:43:40 2016 (r300433) @@ -1198,6 +1198,9 @@ struct r92c_tx_desc { #define R92C_TXDW5_DATARATE_M 0x0000003f #define R92C_TXDW5_DATARATE_S 0 #define R92C_TXDW5_SGI 0x00000040 +#define R92C_TXDW5_RTY_LMT_ENA 0x00020000 +#define R92C_TXDW5_RTY_LMT_M 0x00fc0000 +#define R92C_TXDW5_RTY_LMT_S 18 #define R92C_TXDW5_AGGNUM_M 0xff000000 #define R92C_TXDW5_AGGNUM_S 24 From owner-svn-src-head@freebsd.org Sun May 22 19:48:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92A5AB467FB; Sun, 22 May 2016 19:48:44 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 211AA1D5A; Sun, 22 May 2016 19:48:43 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lb0-f170.google.com with SMTP id h1so49556895lbj.3; Sun, 22 May 2016 12:48:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=Ne88Juo6W9iI0s+ofteUhyr05H5O2a8AHh5yj46aF2k=; b=QDrGgmAemt8J+gs8psqMy+E/LmD9FlripgETs1+k85gbd7AZ3R3AO6C1TqqJyGbGjF i9MBbVEYF+oVFQNqG852dNif+utCJRjH9b2Mc76Rgvj3GX7OI7LyaN6+2DJ8+q9IOf+l 445N2Kdv1L4x1TD8gFgpj0oetRCPkyXboLcEMih/10JurUMkjvMOTIhEFsy1uI2NlXiY BZmxPVtLpFvfsJaCDAqXFuAfJn+X1+qF88Q5/Vs0ts2YzfDfMG0z5hYvtuyNN6DQhy2Y asNVfItO4Qw65QOk9K6rg+iPLC1HuR9f5UbAhoGTz5NVvw4BJK6ABMUkMaUTRKcXghqN 6zEA== X-Gm-Message-State: ALyK8tIbhSAVepIOtwbSWf3VcpgW1Jv8RWZ4TM69j6XXiRSSTMWb6TyS9kV5llbtBEyXSA== X-Received: by 10.112.6.231 with SMTP id e7mr428767lba.45.1463946516568; Sun, 22 May 2016 12:48:36 -0700 (PDT) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id a131sm5279665lfe.1.2016.05.22.12.48.35 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 22 May 2016 12:48:36 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300433 - head/sys/dev/urtwn References: <201605221943.u4MJhftZ004642@repo.freebsd.org> Date: Sun, 22 May 2016 22:48:29 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201605221943.u4MJhftZ004642@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 19:48:44 -0000 > RTL8192CUS RTL8188CUS of course. From owner-svn-src-head@freebsd.org Sun May 22 20:12:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3725DB46B59; Sun, 22 May 2016 20:12:09 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0478018C1; Sun, 22 May 2016 20:12:08 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MKC8dm013755; Sun, 22 May 2016 20:12:08 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MKC8lF013754; Sun, 22 May 2016 20:12:08 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605222012.u4MKC8lF013754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 22 May 2016 20:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300434 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 20:12:09 -0000 Author: avos Date: Sun May 22 20:12:07 2016 New Revision: 300434 URL: https://svnweb.freebsd.org/changeset/base/300434 Log: urtwn: cleanup some unused code in urtwn_tx_data(). - Drop unused 'subtype' variable. - Remove obsolete comment (hardware crypto support was added in r292175). Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Sun May 22 19:43:40 2016 (r300433) +++ head/sys/dev/urtwn/if_urtwn.c Sun May 22 20:12:07 2016 (r300434) @@ -2838,17 +2838,13 @@ urtwn_tx_data(struct urtwn_softc *sc, st struct ieee80211_channel *chan; struct ieee80211_frame *wh; struct r92c_tx_desc *txd; - uint8_t macid, raid, rate, ridx, subtype, type, tid, qos, qsel; + uint8_t macid, raid, rate, ridx, type, tid, qos, qsel; int hasqos, ismcast; URTWN_ASSERT_LOCKED(sc); - /* - * Software crypto. - */ wh = mtod(m, struct ieee80211_frame *); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; - subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; hasqos = IEEE80211_QOS_HAS_SEQ(wh); ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); From owner-svn-src-head@freebsd.org Sun May 22 20:17:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BFC3B46CE6; Sun, 22 May 2016 20:17:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E01BA1CA6; Sun, 22 May 2016 20:17:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MKHua6013977; Sun, 22 May 2016 20:17:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MKHudV013976; Sun, 22 May 2016 20:17:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605222017.u4MKHudV013976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 22 May 2016 20:17:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300435 - head/gnu/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 20:17:57 -0000 Author: pfg Date: Sun May 22 20:17:55 2016 New Revision: 300435 URL: https://svnweb.freebsd.org/changeset/base/300435 Log: gnugrep: Update the configuration. The only effect is that it will use our native iconv(3). Relnotes: yes Modified: head/gnu/usr.bin/grep/config.h Modified: head/gnu/usr.bin/grep/config.h ============================================================================== --- head/gnu/usr.bin/grep/config.h Sun May 22 20:12:07 2016 (r300434) +++ head/gnu/usr.bin/grep/config.h Sun May 22 20:17:55 2016 (r300435) @@ -98,7 +98,7 @@ #define HAVE_GETUID 1 /* Define if you have the iconv() function. */ -/* #undef HAVE_ICONV */ +#define HAVE_ICONV 1 /* Define if exists, doesn't clash with , and declares uintmax_t. */ @@ -260,7 +260,7 @@ /* #undef HAVE___ARGZ_STRINGIFY */ /* Define as const if the declaration of iconv() needs const. */ -/* #undef ICONV_CONST */ +#define ICONV_CONST /* Name of package */ #define PACKAGE "grep" From owner-svn-src-head@freebsd.org Sun May 22 20:31:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 167E8B451FE; Sun, 22 May 2016 20:31:54 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9F4E1939; Sun, 22 May 2016 20:31:53 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MKVqq1017740; Sun, 22 May 2016 20:31:52 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MKVqDv017739; Sun, 22 May 2016 20:31:52 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605222031.u4MKVqDv017739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 22 May 2016 20:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300436 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 20:31:54 -0000 Author: allanjude Date: Sun May 22 20:31:52 2016 New Revision: 300436 URL: https://svnweb.freebsd.org/changeset/base/300436 Log: bsdinstall/zfsboot GPT+BIOS+GELI installs now make use of GELIBOOT In this configuration, a separate bootpool is not required. This allows ZFS Boot Environments to be used with GELI encrypted ZFS pools. Support for GPT+EFI+GELI is planned for the future. Tested by: Joseph Mingrone, HardenedBSD Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D5869 Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sun May 22 20:17:55 2016 (r300435) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sun May 22 20:31:52 2016 (r300436) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2013-2015 Allan Jude +# Copyright (c) 2013-2016 Allan Jude # Copyright (c) 2013-2015 Devin Teske # All rights reserved. # @@ -189,8 +189,10 @@ CHMOD_MODE='chmod %s "%s"' DD_WITH_OPTIONS='dd if="%s" of="%s" %s' ECHO_APPEND='echo "%s" >> "%s"' GELI_ATTACH='geli attach -j - -k "%s" "%s"' +GELI_ATTACH_NOKEY='geli attach -j - "%s"' GELI_DETACH_F='geli detach -f "%s"' GELI_PASSWORD_INIT='geli init -b -B "%s" -e %s -J - -K "%s" -l 256 -s 4096 "%s"' +GELI_PASSWORD_GELIBOOT_INIT='geli init -bg -e %s -J - -l 256 -s 4096 "%s"' GPART_ADD_ALIGN='gpart add %s -t %s "%s"' GPART_ADD_ALIGN_INDEX='gpart add %s -i %s -t %s "%s"' GPART_ADD_ALIGN_INDEX_WITH_SIZE='gpart add %s -i %s -t %s -s %s "%s"' @@ -205,6 +207,7 @@ GPART_SET_ACTIVE='gpart set -a active -i GPART_SET_LENOVOFIX='gpart set -a lenovofix "%s"' GPART_SET_PMBR_ACTIVE='gpart set -a active "%s"' GRAID_DELETE='graid delete "%s"' +KLDLOAD='kldload %s' LN_SF='ln -sf "%s" "%s"' MKDIR_P='mkdir -p "%s"' MOUNT_TYPE='mount -t %s "%s" "%s"' @@ -755,21 +758,6 @@ zfs_create_diskpart() esac # - # Enable boot pool if encryption is desired - # - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && ZFSBOOT_BOOT_POOL=1 - - # - # ZFSBOOT_BOOT_POOL and BIOS+UEFI boot type are incompatible - # - if [ "$ZFSBOOT_BOOT_POOL" -a "$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ]; then - f_dprintf "$funcname: ZFSBOOT_BOOT_POOL is incompatible with BIOS+UEFI boot type" - msg_error="$msg_error: $funcname" f_show_err \ - "ZFSBOOT_BOOT_POOL is incompatible with BIOS+UEFI boot type" - return $FAILURE - fi - - # # Destroy whatever partition layout is currently on disk. # NOTE: `-F' required to destroy if partitions still exist. # NOTE: Failure is ok here, blank disk will have nothing to destroy. @@ -821,9 +809,14 @@ zfs_create_diskpart() fi # - # 2. Add small freebsd-boot or efi partition + # 2. Add small freebsd-boot and/or efi partition # if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" -o "$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ]; then + # + # Enable boot pool if encryption is desired + # + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && ZFSBOOT_BOOT_POOL=1 + f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ "$align_small" efiboot$index efi 800k $disk || @@ -916,6 +909,10 @@ zfs_create_diskpart() MBR) f_dprintf "$funcname: Creating MBR layout..." # + # Enable boot pool if encryption is desired + # + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && ZFSBOOT_BOOT_POOL=1 + # # 1. Create MBR layout (no labels) # f_eval_catch $funcname gpart "$GPART_CREATE" mbr $disk || @@ -1190,6 +1187,10 @@ zfs_create_boot() # Create the geli(8) GEOMS # if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # + # Load the AES-NI kernel module to accelerate encryption + # + f_eval_catch -d $funcname kldload "$KLDLOAD" "aesni" # Prompt user for password (twice) if ! msg_enter_new_password="$msg_geli_password" \ f_dialog_input_password @@ -1203,27 +1204,51 @@ zfs_create_boot() for disk in $disks; do f_dialog_info "$msg_geli_setup" \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD - if ! echo "$pw_password" | f_eval_catch \ - $funcname geli "$GELI_PASSWORD_INIT" \ - "$bootpool/boot/$disk$targetpart.eli" \ - AES-XTS "$bootpool/$zroot_key" \ - $disk$targetpart - then - f_interactive || f_die - unset pw_password # Sensitive info - return $FAILURE - fi - if ! echo "$pw_password" | f_eval_catch \ - $funcname geli "$GELI_ATTACH" \ - "$bootpool/$zroot_key" $disk$targetpart - then - f_interactive || f_die - unset pw_password # Sensitive info - return $FAILURE + if [ "$ZFSBOOT_BOOT_POOL" ]; then + if ! echo "$pw_password" | f_eval_catch \ + $funcname geli "$GELI_PASSWORD_INIT" \ + "$bootpool/boot/$disk$targetpart.eli" \ + AES-XTS "$bootpool/$zroot_key" \ + $disk$targetpart + then + f_interactive || f_die + unset pw_password # Sensitive info + return $FAILURE + fi + if ! echo "$pw_password" | f_eval_catch \ + $funcname geli "$GELI_ATTACH" \ + "$bootpool/$zroot_key" $disk$targetpart + then + f_interactive || f_die + unset pw_password # Sensitive info + return $FAILURE + fi + else + # With no bootpool, there is no place to store + # the key files, use only a password + if ! echo "$pw_password" | f_eval_catch \ + $funcname geli \ + "$GELI_PASSWORD_GELIBOOT_INIT" AES-XTS \ + $disk$targetpart + then + f_interactive || f_die + unset pw_password # Sensitive info + return $FAILURE + fi + if ! echo "$pw_password" | f_eval_catch \ + $funcname geli "$GELI_ATTACH_NOKEY" \ + $disk$targetpart + then + f_interactive || f_die + unset pw_password # Sensitive info + return $FAILURE + fi fi done unset pw_password # Sensitive info + fi + if [ "$ZFSBOOT_BOOT_POOL" ]; then # Clean up f_eval_catch $funcname zfs "$ZFS_UNMOUNT" "$bootpool_name" || return $FAILURE @@ -1369,29 +1394,6 @@ zfs_create_boot() return $FAILURE fi - # We're all done unless we should go on for boot pool - [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS - - # Set cachefile for boot pool so it auto-imports at system start - f_dprintf "$funcname: Configuring zpool.cache for boot pool..." - f_eval_catch $funcname zpool "$ZPOOL_SET" \ - "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ - "$bootpool_name" || return $FAILURE - - # Some additional geli(8) requirements for loader.conf(5) - for option in \ - 'zpool_cache_load=\"YES\"' \ - 'zpool_cache_type=\"/boot/zfs/zpool.cache\"' \ - 'zpool_cache_name=\"/boot/zfs/zpool.cache\"' \ - ; do - f_eval_catch $funcname echo "$ECHO_APPEND" "$option" \ - $BSDINSTALL_TMPBOOT/loader.conf.zfs || - return $FAILURE - done - f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - "\"zfs:$zroot_name/$zroot_bootfs\"" \ - $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE - # We're all done unless we should go on to do encryption [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS @@ -1403,9 +1405,10 @@ zfs_create_boot() $BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_eli_load=\"YES\"' \ $BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE - f_eval_catch $funcname echo "$ECHO_APPEND" \ - 'geom_eli_passphrase_prompt=\"YES\"' \ - $BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE + + # We're all done unless we should go on for boot pool + [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS + for disk in $disks; do f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_load "$disk$targetpart YES" \ @@ -1423,6 +1426,27 @@ zfs_create_boot() return $FAILURE done + # Set cachefile for boot pool so it auto-imports at system start + f_dprintf "$funcname: Configuring zpool.cache for boot pool..." + f_eval_catch $funcname zpool "$ZPOOL_SET" \ + "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ + "$bootpool_name" || return $FAILURE + + # Some additional geli(8) requirements for loader.conf(5) + for option in \ + 'zpool_cache_load=\"YES\"' \ + 'zpool_cache_type=\"/boot/zfs/zpool.cache\"' \ + 'zpool_cache_name=\"/boot/zfs/zpool.cache\"' \ + 'geom_eli_passphrase_prompt=\"YES\"' \ + ; do + f_eval_catch $funcname echo "$ECHO_APPEND" "$option" \ + $BSDINSTALL_TMPBOOT/loader.conf.zfs || + return $FAILURE + done + f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ + "\"zfs:$zroot_name/$zroot_bootfs\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE + return $SUCCESS } From owner-svn-src-head@freebsd.org Sun May 22 21:31:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72759B46A4A; Sun, 22 May 2016 21:31:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38BFC16FD; Sun, 22 May 2016 21:31:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MLVKM0037129; Sun, 22 May 2016 21:31:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MLVKLV037128; Sun, 22 May 2016 21:31:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605222131.u4MLVKLV037128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 22 May 2016 21:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300438 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 21:31:21 -0000 Author: ian Date: Sun May 22 21:31:20 2016 New Revision: 300438 URL: https://svnweb.freebsd.org/changeset/base/300438 Log: Restore the translation of armv6hf->arm when generating MACHINE_CPUARCH. It turns out we need to leave this in place for a while so that people running self-hosting armv6hf systems can do the builds necessary to update to armv6 (which is now hardfloat by default). Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sun May 22 20:44:11 2016 (r300437) +++ head/share/mk/sys.mk Sun May 22 21:31:20 2016 (r300438) @@ -13,7 +13,7 @@ unix ?= We run FreeBSD, not UNIX. # and/or endian. This is called MACHINE_CPU in NetBSD, but that's used # for something different in FreeBSD. # -MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/:C/riscv64/riscv/} +MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/:C/riscv64/riscv/} .endif From owner-svn-src-head@freebsd.org Sun May 22 23:25:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80BC8B3BCAE; Sun, 22 May 2016 23:25:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ADE11BF5; Sun, 22 May 2016 23:25:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MNP1A9071365; Sun, 22 May 2016 23:25:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MNP1vo071364; Sun, 22 May 2016 23:25:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605222325.u4MNP1vo071364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 22 May 2016 23:25:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300439 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 23:25:02 -0000 Author: kib Date: Sun May 22 23:25:01 2016 New Revision: 300439 URL: https://svnweb.freebsd.org/changeset/base/300439 Log: Replace hand-made exclusive lock, protecting against parallel swapon/swapoff invocations, with sx. Reviewed by: alc (as part of larger patch) Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sun May 22 21:31:20 2016 (r300438) +++ head/sys/vm/swap_pager.c Sun May 22 23:25:01 2016 (r300439) @@ -152,7 +152,7 @@ static TAILQ_HEAD(, swdevt) swtailq = TA static struct swdevt *swdevhd; /* Allocate from here next */ static int nswapdev; /* Number of swap devices */ int swap_pager_avail; -static int swdev_syscall_active = 0; /* serialize swap(on|off) */ +static struct sx swdev_syscall_lock; /* serialize swap(on|off) */ static vm_ooffset_t swap_total; SYSCTL_QUAD(_vm, OID_AUTO, swap_total, CTLFLAG_RD, &swap_total, 0, @@ -487,6 +487,7 @@ swap_pager_init(void) TAILQ_INIT(&swap_pager_object_list[i]); mtx_init(&sw_alloc_mtx, "swap_pager list", NULL, MTX_DEF); mtx_init(&sw_dev_mtx, "swapdev", NULL, MTX_DEF); + sx_init(&swdev_syscall_lock, "swsysc"); /* * Device Stripe, in PAGE_SIZE'd blocks @@ -1664,7 +1665,7 @@ swap_pager_swapoff(struct swdevt *sp) struct swblock *swap; int i, j, retries; - GIANT_REQUIRED; + sx_assert(&swdev_syscall_lock, SA_XLOCKED); retries = 0; full_rescan: @@ -2005,10 +2006,7 @@ sys_swapon(struct thread *td, struct swa if (error) return (error); - mtx_lock(&Giant); - while (swdev_syscall_active) - tsleep(&swdev_syscall_active, PUSER - 1, "swpon", 0); - swdev_syscall_active = 1; + sx_xlock(&swdev_syscall_lock); /* * Swap metadata may not fit in the KVM if we have physical @@ -2043,9 +2041,7 @@ sys_swapon(struct thread *td, struct swa if (error) vrele(vp); done: - swdev_syscall_active = 0; - wakeup_one(&swdev_syscall_active); - mtx_unlock(&Giant); + sx_xunlock(&swdev_syscall_lock); return (error); } @@ -2175,10 +2171,7 @@ sys_swapoff(struct thread *td, struct sw if (error) return (error); - mtx_lock(&Giant); - while (swdev_syscall_active) - tsleep(&swdev_syscall_active, PUSER - 1, "swpoff", 0); - swdev_syscall_active = 1; + sx_xlock(&swdev_syscall_lock); NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->name, td); @@ -2200,9 +2193,7 @@ sys_swapoff(struct thread *td, struct sw } error = swapoff_one(sp, td->td_ucred); done: - swdev_syscall_active = 0; - wakeup_one(&swdev_syscall_active); - mtx_unlock(&Giant); + sx_xunlock(&swdev_syscall_lock); return (error); } @@ -2214,7 +2205,7 @@ swapoff_one(struct swdevt *sp, struct uc int error; #endif - mtx_assert(&Giant, MA_OWNED); + sx_assert(&swdev_syscall_lock, SA_XLOCKED); #ifdef MAC (void) vn_lock(sp->sw_vp, LK_EXCLUSIVE | LK_RETRY); error = mac_system_check_swapoff(cred, sp->sw_vp); @@ -2276,10 +2267,7 @@ swapoff_all(void) const char *devname; int error; - mtx_lock(&Giant); - while (swdev_syscall_active) - tsleep(&swdev_syscall_active, PUSER - 1, "swpoff", 0); - swdev_syscall_active = 1; + sx_xlock(&swdev_syscall_lock); mtx_lock(&sw_dev_mtx); TAILQ_FOREACH_SAFE(sp, &swtailq, sw_list, spt) { @@ -2299,9 +2287,7 @@ swapoff_all(void) } mtx_unlock(&sw_dev_mtx); - swdev_syscall_active = 0; - wakeup_one(&swdev_syscall_active); - mtx_unlock(&Giant); + sx_xunlock(&swdev_syscall_lock); } void From owner-svn-src-head@freebsd.org Sun May 22 23:28:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93B3CB3BE8D; Sun, 22 May 2016 23:28:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 654741F60; Sun, 22 May 2016 23:28:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MNSNxF071513; Sun, 22 May 2016 23:28:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4MNSNgM071512; Sun, 22 May 2016 23:28:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605222328.u4MNSNgM071512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 22 May 2016 23:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300440 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 23:28:24 -0000 Author: kib Date: Sun May 22 23:28:23 2016 New Revision: 300440 URL: https://svnweb.freebsd.org/changeset/base/300440 Log: Mark swap-related proc sysctls as not requiring Giant. Reviewed by: alc (as part of larger patch) Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sun May 22 23:25:01 2016 (r300439) +++ head/sys/vm/swap_pager.c Sun May 22 23:28:23 2016 (r300440) @@ -325,8 +325,9 @@ static int nsw_wcount_async_max;/* assig static int nsw_cluster_max; /* maximum VOP I/O allowed */ static int sysctl_swap_async_max(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_vm, OID_AUTO, swap_async_max, CTLTYPE_INT | CTLFLAG_RW, - NULL, 0, sysctl_swap_async_max, "I", "Maximum running async swap ops"); +SYSCTL_PROC(_vm, OID_AUTO, swap_async_max, CTLTYPE_INT | CTLFLAG_RW | + CTLFLAG_MPSAFE, NULL, 0, sysctl_swap_async_max, "I", + "Maximum running async swap ops"); static struct swblock **swhash; static int swhash_mask; @@ -2356,7 +2357,8 @@ sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) SYSCTL_INT(_vm, OID_AUTO, nswapdev, CTLFLAG_RD, &nswapdev, 0, "Number of swap devices"); -SYSCTL_NODE(_vm, OID_AUTO, swap_info, CTLFLAG_RD, sysctl_vm_swap_info, +SYSCTL_NODE(_vm, OID_AUTO, swap_info, CTLFLAG_RD | CTLFLAG_MPSAFE, + sysctl_vm_swap_info, "Swap statistics by device"); /* From owner-svn-src-head@freebsd.org Mon May 23 01:01:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 107B7B45682; Mon, 23 May 2016 01:01:25 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE59419D7; Mon, 23 May 2016 01:01:24 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N11NIV098623; Mon, 23 May 2016 01:01:23 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N11Nr9098622; Mon, 23 May 2016 01:01:23 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605230101.u4N11Nr9098622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 23 May 2016 01:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300442 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 01:01:25 -0000 Author: truckman Date: Mon May 23 01:01:23 2016 New Revision: 300442 URL: https://svnweb.freebsd.org/changeset/base/300442 Log: Hopefully fix Coverity CID 1008328 (Out-of-bounds write) in /bin/sh. Replace the magic constant 127 in the loop interation count with "PROMPTLEN - 1". gethostname() is not guaranteed to NUL terminate the destination string if it is too short. Decrease the length passed to gethostname() by one, and add a NUL at the end of the buffer to make sure the following loop to find the end of the name properly terminates. The default: case is the likely cause of Coverity CID 1008328. If i is 126 at the top of the loop interation where the default case is triggered, i will be incremented to 127 by the default case, then incremented to 128 at the top of the loop before being compared to 127 (PROMPTLENT - 1) and terminating the loop. Then the NUL termination code after the loop will write to ps[128]. Fix by checking for overflow before incrementing the index and storing the second character in the buffer. These fixes are not guaranteed to satisfy Coverity. The code that increments i in the 'h'/'H' and 'w'/'W' cases may be beyond its capability to analyze, but the code appears to be safe. Reported by: Coverity CID: 1008328 Reviewed by: jilles, cem MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6482 Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Mon May 23 00:58:52 2016 (r300441) +++ head/bin/sh/parser.c Mon May 23 01:01:23 2016 (r300442) @@ -1998,7 +1998,7 @@ getprompt(void *unused __unused) /* * Format prompt string. */ - for (i = 0; (i < 127) && (*fmt != '\0'); i++, fmt++) + for (i = 0; (i < PROMPTLEN - 1) && (*fmt != '\0'); i++, fmt++) if (*fmt == '\\') switch (*++fmt) { @@ -2011,7 +2011,8 @@ getprompt(void *unused __unused) case 'h': case 'H': ps[i] = '\0'; - gethostname(&ps[i], PROMPTLEN - i); + gethostname(&ps[i], PROMPTLEN - i - 1); + ps[PROMPTLEN - 1] = '\0'; /* Skip to end of hostname. */ trim = (*fmt == 'h') ? '.' : '\0'; while ((ps[i] != '\0') && (ps[i] != trim)) @@ -2061,8 +2062,9 @@ getprompt(void *unused __unused) * Emit unrecognized formats verbatim. */ default: - ps[i++] = '\\'; - ps[i] = *fmt; + ps[i] = '\\'; + if (i < PROMPTLEN - 1) + ps[++i] = *fmt; break; } else From owner-svn-src-head@freebsd.org Mon May 23 03:29:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C72FB46225; Mon, 23 May 2016 03:29:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3FC91366; Mon, 23 May 2016 03:29:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N3ThrQ043998; Mon, 23 May 2016 03:29:43 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N3ThxB043997; Mon, 23 May 2016 03:29:43 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605230329.u4N3ThxB043997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 23 May 2016 03:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300443 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 03:29:45 -0000 Author: adrian Date: Mon May 23 03:29:43 2016 New Revision: 300443 URL: https://svnweb.freebsd.org/changeset/base/300443 Log: [bhnd] Fix DEFINE_CLASS_(2|3) multiple inheritance support. This diff updates DEFINE_CLASS_2/_3 to support the specification of class name separately from the class variable name, bringing them into sync with their API documentation, as well as the behavior of DEFINE_CLASS_0/_1. Nothing in the tree currently uses the _2/_3 variants, and I can't find any references to the API outside of commits to the kobj.h header itself; given the limitation that currently exists, I'd be surprised if they've ever been used. Submitted by: Landon Fuller Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D6491 Modified: head/sys/sys/kobj.h Modified: head/sys/sys/kobj.h ============================================================================== --- head/sys/sys/kobj.h Mon May 23 01:01:23 2016 (r300442) +++ head/sys/sys/kobj.h Mon May 23 03:29:43 2016 (r300443) @@ -146,13 +146,13 @@ struct kobj_class classvar = { \ * DEFINE_CLASS_2(foo, foo_class, foo_methods, sizeof(foo_softc), * bar, baz); */ -#define DEFINE_CLASS_2(name, methods, size, \ +#define DEFINE_CLASS_2(name, classvar, methods, size, \ base1, base2) \ \ static kobj_class_t name ## _baseclasses[] = \ { &base1, \ &base2, NULL }; \ -struct kobj_class name ## _class = { \ +struct kobj_class classvar = { \ #name, methods, size, name ## _baseclasses \ } @@ -162,14 +162,14 @@ struct kobj_class name ## _class = { \ * DEFINE_CLASS_3(foo, foo_class, foo_methods, sizeof(foo_softc), * bar, baz, foobar); */ -#define DEFINE_CLASS_3(name, methods, size, \ +#define DEFINE_CLASS_3(name, classvar, methods, size, \ base1, base2, base3) \ \ static kobj_class_t name ## _baseclasses[] = \ { &base1, \ &base2, \ &base3, NULL }; \ -struct kobj_class name ## _class = { \ +struct kobj_class classvar = { \ #name, methods, size, name ## _baseclasses \ } From owner-svn-src-head@freebsd.org Mon May 23 03:46:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69E40B466FC; Mon, 23 May 2016 03:46:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39A4D1F94; Mon, 23 May 2016 03:46:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N3ka6S049859; Mon, 23 May 2016 03:46:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N3kaih049858; Mon, 23 May 2016 03:46:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605230346.u4N3kaih049858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 23 May 2016 03:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300444 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 03:46:37 -0000 Author: adrian Date: Mon May 23 03:46:36 2016 New Revision: 300444 URL: https://svnweb.freebsd.org/changeset/base/300444 Log: [ixl] fix build for RSS. Untested. Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Mon May 23 03:29:43 2016 (r300443) +++ head/sys/dev/ixl/if_ixl.c Mon May 23 03:46:36 2016 (r300444) @@ -2264,6 +2264,10 @@ ixl_setup_queue_tqs(struct ixl_vsi *vsi) { struct ixl_queue *que = vsi->queues; device_t dev = vsi->dev; +#ifdef RSS + cpuset_t cpu_mask; + int cpu_id; +#endif /* Create queue tasks and start queue taskqueues */ for (int i = 0; i < vsi->num_queues; i++, que++) { @@ -2272,6 +2276,7 @@ ixl_setup_queue_tqs(struct ixl_vsi *vsi) que->tq = taskqueue_create_fast("ixl_que", M_NOWAIT, taskqueue_thread_enqueue, &que->tq); #ifdef RSS + cpu_id = rss_getcpu(i % rss_getnumbuckets()); CPU_SETOF(cpu_id, &cpu_mask); taskqueue_start_threads_cpuset(&que->tq, 1, PI_NET, &cpu_mask, "%s (bucket %d)", @@ -2355,9 +2360,6 @@ ixl_setup_queue_msix(struct ixl_vsi *vsi struct ixl_queue *que = vsi->queues; struct tx_ring *txr; int error, rid, vector = 1; -#ifdef RSS - cpuset_t cpu_mask; -#endif /* Queue interrupt vector numbers start at 1 (adminq intr is 0) */ for (int i = 0; i < vsi->num_queues; i++, vector++, que++) { From owner-svn-src-head@freebsd.org Mon May 23 03:47:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14CD9B46828; Mon, 23 May 2016 03:47:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E53E71159; Mon, 23 May 2016 03:47:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N3ljng050020; Mon, 23 May 2016 03:47:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N3lihA050009; Mon, 23 May 2016 03:47:44 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605230347.u4N3lihA050009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 23 May 2016 03:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300445 - in head/sys: conf dev/bhnd dev/bhnd/bcma dev/bhnd/bhndb dev/bhnd/siba dev/bhnd/soc modules/bhnd/bhndb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 03:47:46 -0000 Author: adrian Date: Mon May 23 03:47:44 2016 New Revision: 300445 URL: https://svnweb.freebsd.org/changeset/base/300445 Log: [bhnd] Add support for querying the attachment type of the bhnd bus. This adds a BHND_BUS_GET_ATTACH_TYPE(); the primary use-case is to let chipc make a coarse-grained determination as to whether UART, SPI, etc drivers ought to be attached, and on fullmac devices, whether a real CPU driver ought to be skipped for the ARM core, etc. Tested: * BCM4331 (BHND) * BCM4312 (SIBA) Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6492 Added: head/sys/dev/bhnd/bhndb/bhnd_bhndb.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/bhnd/bcma/bcma_bhndb.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_types.h head/sys/dev/bhnd/bhndb/bhndb.h head/sys/dev/bhnd/siba/siba_bhndb.c head/sys/dev/bhnd/soc/bhnd_soc.c head/sys/modules/bhnd/bhndb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 23 03:46:36 2016 (r300444) +++ head/sys/conf/files Mon May 23 03:47:44 2016 (r300445) @@ -1125,6 +1125,7 @@ dev/bge/if_bge.c optional bge dev/bhnd/bhnd.c optional bhndbus | bhnd dev/bhnd/bhnd_subr.c optional bhndbus | bhnd dev/bhnd/bhnd_bus_if.m optional bhndbus | bhnd +dev/bhnd/bhndb/bhnd_bhndb.c optional bhndbus | bhndb dev/bhnd/bhndb/bhndb.c optional bhndbus | bhndb dev/bhnd/bhndb/bhndb_bus_if.m optional bhndbus | bhndb dev/bhnd/bhndb/bhndb_hwdata.c optional bhndbus | bhndb Modified: head/sys/dev/bhnd/bcma/bcma_bhndb.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_bhndb.c Mon May 23 03:46:36 2016 (r300444) +++ head/sys/dev/bhnd/bcma/bcma_bhndb.c Mon May 23 03:47:44 2016 (r300445) @@ -166,20 +166,6 @@ bcma_bhndb_resume_child(device_t dev, de return (0); } -static int -bcma_bhndb_read_board_info(device_t dev, device_t child, - struct bhnd_board_info *info) -{ - int error; - - /* Initialize with NVRAM-derived values */ - if ((error = bhnd_bus_generic_read_board_info(dev, child, info))) - return (error); - - /* Let the bridge fill in any additional data */ - return (BHNDB_POPULATE_BOARD_INFO(device_get_parent(dev), dev, info)); -} - static device_method_t bcma_bhndb_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bcma_bhndb_probe), @@ -189,14 +175,11 @@ static device_method_t bcma_bhndb_method DEVMETHOD(bus_suspend_child, bcma_bhndb_suspend_child), DEVMETHOD(bus_resume_child, bcma_bhndb_resume_child), - /* BHND interface */ - DEVMETHOD(bhnd_bus_read_board_info, bcma_bhndb_read_board_info), - DEVMETHOD_END }; -DEFINE_CLASS_1(bhnd, bcma_bhndb_driver, bcma_bhndb_methods, - sizeof(struct bcma_softc), bcma_driver); +DEFINE_CLASS_2(bhnd, bcma_bhndb_driver, bcma_bhndb_methods, + sizeof(struct bcma_softc), bhnd_bhndb_driver, bcma_driver); DRIVER_MODULE(bcma_bhndb, bhndb, bcma_bhndb_driver, bhnd_devclass, NULL, NULL); Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Mon May 23 03:46:36 2016 (r300444) +++ head/sys/dev/bhnd/bhnd.h Mon May 23 03:47:44 2016 (r300445) @@ -561,6 +561,21 @@ bhnd_get_chipid(device_t dev) { }; /** + * Return the BHND attachment type of the parent bhnd bus. + * + * @param dev A bhnd bus child device. + * + * @retval BHND_ATTACH_ADAPTER if the bus is resident on a bridged adapter, + * such as a WiFi chipset. + * @retval BHND_ATTACH_NATIVE if the bus provides hardware services (clock, + * CPU, etc) to a directly attached native host. + */ +static inline bhnd_attach_type +bhnd_get_attach_type (device_t dev) { + return (BHND_BUS_GET_ATTACH_TYPE(device_get_parent(dev), dev)); +} + +/** * Attempt to read the BHND board identification from the bhnd bus. * * This relies on NVRAM access, and will fail if a valid NVRAM device cannot Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Mon May 23 03:46:36 2016 (r300444) +++ head/sys/dev/bhnd/bhnd_bus_if.m Mon May 23 03:47:44 2016 (r300445) @@ -55,6 +55,12 @@ CODE { panic("bhnd_bus_get_chipid unimplemented"); } + static bhnd_attach_type + bhnd_bus_null_get_attach_type(device_t dev, device_t child) + { + panic("bhnd_bus_get_attach_type unimplemented"); + } + static int bhnd_bus_null_read_board_info(device_t dev, device_t child, struct bhnd_board_info *info) @@ -184,6 +190,22 @@ METHOD const struct bhnd_chipid * get_ch } DEFAULT bhnd_bus_null_get_chipid; /** + * Return the BHND attachment type of the parent bus. + * + * @param dev The device whose child is being examined. + * @param child The child device. + * + * @retval BHND_ATTACH_ADAPTER if the bus is resident on a bridged adapter, + * such as a WiFi chipset. + * @retval BHND_ATTACH_NATIVE if the bus provides hardware services (clock, + * CPU, etc) to a directly attached native host. + */ +METHOD bhnd_attach_type get_attach_type { + device_t dev; + device_t child; +} DEFAULT bhnd_bus_null_get_attach_type; + +/** * Attempt to read the BHND board identification from the parent bus. * * This relies on NVRAM access, and will fail if a valid NVRAM device cannot Modified: head/sys/dev/bhnd/bhnd_types.h ============================================================================== --- head/sys/dev/bhnd/bhnd_types.h Mon May 23 03:46:36 2016 (r300444) +++ head/sys/dev/bhnd/bhnd_types.h Mon May 23 03:47:44 2016 (r300445) @@ -73,6 +73,15 @@ typedef enum { BHND_PORT_AGENT = 2, /**< interconnect agent/wrapper */ } bhnd_port_type; +/** + * bhnd(4) attachment types. + */ +typedef enum { + BHND_ATTACH_ADAPTER = 0, /**< A bridged card, such as a PCI WiFi chipset */ + BHND_ATTACH_NATIVE = 1 /**< A bus resident on the native host, such as + * the primary or secondary bus of an embedded + * SoC */ +} bhnd_attach_type; /** Evaluates to true if @p cls is a device class that can be configured * as a host bridge device. */ Added: head/sys/dev/bhnd/bhndb/bhnd_bhndb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/bhndb/bhnd_bhndb.c Mon May 23 03:47:44 2016 (r300445) @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 2015-2016 Landon Fuller + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include "bhndbvar.h" + +/* + * bhnd(4) driver mix-in providing a shared common methods for + * bhnd devices attached via a bhndb bridge. + */ + +static int +bhnd_bhndb_read_board_info(device_t dev, device_t child, + struct bhnd_board_info *info) +{ + int error; + + /* Initialize with NVRAM-derived values */ + if ((error = bhnd_bus_generic_read_board_info(dev, child, info))) + return (error); + + /* Let the bridge fill in any additional data */ + return (BHNDB_POPULATE_BOARD_INFO(device_get_parent(dev), dev, info)); +} + +static bhnd_attach_type +bhnd_bhndb_get_attach_type(device_t dev, device_t child) +{ + /* It's safe to assume that a bridged device is always an adapter */ + return (BHND_ATTACH_ADAPTER); +} + +static device_method_t bhnd_bhndb_methods[] = { + /* BHND interface */ + DEVMETHOD(bhnd_bus_get_attach_type, bhnd_bhndb_get_attach_type), + DEVMETHOD(bhnd_bus_read_board_info, bhnd_bhndb_read_board_info), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(bhnd, bhnd_bhndb_driver, bhnd_bhndb_methods, 0); Modified: head/sys/dev/bhnd/bhndb/bhndb.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.h Mon May 23 03:46:36 2016 (r300444) +++ head/sys/dev/bhnd/bhndb/bhndb.h Mon May 23 03:47:44 2016 (r300445) @@ -44,6 +44,7 @@ #include "bhndb_bus_if.h" extern devclass_t bhndb_devclass; +DECLARE_CLASS(bhnd_bhndb_driver); int bhndb_attach_bridge(device_t parent, device_t *bhndb, int unit); Modified: head/sys/dev/bhnd/siba/siba_bhndb.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_bhndb.c Mon May 23 03:46:36 2016 (r300444) +++ head/sys/dev/bhnd/siba/siba_bhndb.c Mon May 23 03:47:44 2016 (r300445) @@ -205,20 +205,6 @@ siba_bhndb_resume_child(device_t dev, de return (0); } -static int -siba_bhndb_read_board_info(device_t dev, device_t child, - struct bhnd_board_info *info) -{ - int error; - - /* Initialize with NVRAM-derived values */ - if ((error = bhnd_bus_generic_read_board_info(dev, child, info))) - return (error); - - /* Let the bridge fill in any additional data */ - return (BHNDB_POPULATE_BOARD_INFO(device_get_parent(dev), dev, info)); -} - /* Work-around implementation for SIBA_QUIRK_PCIE_D11_SB_TIMEOUT */ static int siba_bhndb_wars_pcie_clear_d11_timeout(struct siba_softc *sc) @@ -285,14 +271,11 @@ static device_method_t siba_bhndb_method DEVMETHOD(bus_suspend_child, siba_bhndb_suspend_child), DEVMETHOD(bus_resume_child, siba_bhndb_resume_child), - /* BHND interface */ - DEVMETHOD(bhnd_bus_read_board_info, siba_bhndb_read_board_info), - DEVMETHOD_END }; -DEFINE_CLASS_1(bhnd, siba_bhndb_driver, siba_bhndb_methods, - sizeof(struct siba_softc), siba_driver); +DEFINE_CLASS_2(bhnd, siba_bhndb_driver, siba_bhndb_methods, + sizeof(struct siba_softc), bhnd_bhndb_driver, siba_driver); DRIVER_MODULE(siba_bhndb, bhndb, siba_bhndb_driver, bhnd_devclass, NULL, NULL); Modified: head/sys/dev/bhnd/soc/bhnd_soc.c ============================================================================== --- head/sys/dev/bhnd/soc/bhnd_soc.c Mon May 23 03:46:36 2016 (r300444) +++ head/sys/dev/bhnd/soc/bhnd_soc.c Mon May 23 03:47:44 2016 (r300445) @@ -216,6 +216,12 @@ bhnd_soc_is_hw_disabled(device_t dev, de return false; } +static int +bhnd_soc_get_attach_type(device_t dev, device_t child) +{ + return (BHND_ATTACH_NATIVE); +} + /* * **************************** DRIVER METADATA **************************** */ @@ -247,6 +253,7 @@ static device_method_t bhnd_soc_methods[ DEVMETHOD(bhnd_bus_activate_resource, bhnd_soc_activate_resource), DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_soc_is_hw_disabled), DEVMETHOD(bhnd_bus_get_chipid, bhnd_soc_get_chipid), + DEVMETHOD(bhnd_bus_get_attach_type, bhnd_soc_get_attach_type), DEVMETHOD_END }; Modified: head/sys/modules/bhnd/bhndb/Makefile ============================================================================== --- head/sys/modules/bhnd/bhndb/Makefile Mon May 23 03:46:36 2016 (r300444) +++ head/sys/modules/bhnd/bhndb/Makefile Mon May 23 03:47:44 2016 (r300445) @@ -4,6 +4,7 @@ KMOD= bhndb SRCS= bhndb.c bhndb_subr.c bhndb_hwdata.c \ + bhnd_bhndb.c \ bhndb_bus_if.c bhndb_bus_if.h \ bhndb_if.c bhndb_if.h SRCS+= bhnd_bus_if.h \ From owner-svn-src-head@freebsd.org Mon May 23 03:51:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76187B46D75; Mon, 23 May 2016 03:51:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A5731BF2; Mon, 23 May 2016 03:51:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N3pFBH055075; Mon, 23 May 2016 03:51:15 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N3pFZF055074; Mon, 23 May 2016 03:51:15 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605230351.u4N3pFZF055074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 23 May 2016 03:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300446 - head/sys/dev/nvram2env X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 03:51:16 -0000 Author: adrian Date: Mon May 23 03:51:15 2016 New Revision: 300446 URL: https://svnweb.freebsd.org/changeset/base/300446 Log: [nvram2env] fix nvram2env to scan all of memory, not 1/4th The variable "size" stores number of words (4bytes). But the loop over memory uses size as number of bytes to scan memory. As result it fetches only 1/4th of memory. This patch solves this problem and nvram2env fetches all NVRAM variables. Test plan: Pre-requisites: any MIPS board with ASCII-based NVRAM mapped into memory * Add "device nvram2env" into kernel configuration * Specify hints: base is mandatory (according to nvram2env(4)) hint.nvram.0.base=0x1c7f8000 (it's valid address for Asus RT-N53 with flags = 0x4) * Build & load kernel with bootverbose Actual result: only part of nvram variables are found Expected result: all variables are found Submitted by: Michael Zhilin Differential Revision: https://reviews.freebsd.org/D6466 Modified: head/sys/dev/nvram2env/nvram2env.c Modified: head/sys/dev/nvram2env/nvram2env.c ============================================================================== --- head/sys/dev/nvram2env/nvram2env.c Mon May 23 03:47:44 2016 (r300445) +++ head/sys/dev/nvram2env/nvram2env.c Mon May 23 03:51:15 2016 (r300446) @@ -193,10 +193,12 @@ static uint32_t read_4(struct nvram2env_ static int nvram2env_attach(device_t dev) { - struct nvram2env_softc * sc = device_get_softc(dev); - struct nvram * nv; + struct nvram2env_softc *sc; + struct nvram *nv; char *pair, *value, *assign; - uint32_t sig, size, i; + uint32_t sig, size, i, *tmp; + + sc = device_get_softc(dev); if (sc->bst == 0 || sc->addr == 0) return (ENXIO); @@ -217,16 +219,22 @@ nvram2env_attach(device_t dev) if (sig == sc->sig || (sc->flags & NVRAM_FLAGS_UBOOT)) { - /* align and shift size to 32bit size*/ + /* align size to 32bit size*/ size += 3; - size >>= 2; + size &= ~3; - nv = malloc(size<<2, M_DEVBUF, M_WAITOK | M_ZERO); + nv = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); if (!nv) return (ENOMEM); + /* set tmp pointer to begin of NVRAM */ + tmp = (uint32_t *) nv; - for (i = 0; i < size; i ++) - ((uint32_t *)nv)[i] = read_4(sc, i<<2); + /* use read_4 to swap bytes if it's required */ + for (i = 0; i < size; i += 4) { + *tmp = read_4(sc, i); + tmp++; + } + /* now tmp pointer is end of NVRAM */ if (sc->flags & NVRAM_FLAGS_BROADCOM) { device_printf(dev, "sig = %#x\n", nv->sig); @@ -246,49 +254,47 @@ nvram2env_attach(device_t dev) else pair = (char*)nv+4; - for ( ; - (u_int32_t)pair < ((u_int32_t)nv + size - 4); - pair = pair + strlen(pair) + 1 + strlen(value) + 1 ) { + /* iterate over buffer till end. tmp points to end of NVRAM */ + for ( ; pair < (char*)tmp; + pair += strlen(pair) + strlen(value) + 2 ) { - if (pair && strlen(pair)) { + if (!pair || (strlen(pair) == 0)) + break; -#if 0 - printf("ENV: %s\n", pair); -#endif - /* hint.nvram.0. */ - assign = strchr(pair,'='); - assign[0] = '\0'; - value = assign+1; + /* hint.nvram.0. */ + assign = strchr(pair,'='); + assign[0] = '\0'; + value = assign+1; #if 1 - if (bootverbose) - printf("ENV: %s=%s\n", pair, value); + if (bootverbose) + printf("ENV: %s=%s\n", pair, value); +#else + printf("ENV: %s\n", pair); #endif - kern_setenv(pair, value); + kern_setenv(pair, value); - if (strcasecmp(pair, "WAN_MAC_ADDR") == 0) { - /* Alias for MAC address of eth0 */ - if (bootverbose) - printf("ENV: aliasing " - "WAN_MAC_ADDR to ethaddr" - " = %s\n", value); - kern_setenv("ethaddr", value); - } - else if (strcasecmp(pair, "LAN_MAC_ADDR") == 0){ - /* Alias for MAC address of eth1 */ - if (bootverbose) - printf("ENV: aliasing " - "LAN_MAC_ADDR to eth1addr" - " = %s\n", value); - kern_setenv("eth1addr", value); - } - - if (strcmp(pair, "bootverbose") == 0) - bootverbose = strtoul(value, 0, 0); - if (strcmp(pair, "boothowto" ) == 0) - boothowto = strtoul(value, 0, 0); + if (strcasecmp(pair, "WAN_MAC_ADDR") == 0) { + /* Alias for MAC address of eth0 */ + if (bootverbose) + printf("ENV: aliasing " + "WAN_MAC_ADDR to ethaddr" + " = %s\n", value); + kern_setenv("ethaddr", value); } - else - break; + else if (strcasecmp(pair, "LAN_MAC_ADDR") == 0){ + /* Alias for MAC address of eth1 */ + if (bootverbose) + printf("ENV: aliasing " + "LAN_MAC_ADDR to eth1addr" + " = %s\n", value); + kern_setenv("eth1addr", value); + } + + if (strcmp(pair, "bootverbose") == 0) + bootverbose = strtoul(value, 0, 0); + if (strcmp(pair, "boothowto" ) == 0) + boothowto = strtoul(value, 0, 0); + } free(nv, M_DEVBUF); } From owner-svn-src-head@freebsd.org Mon May 23 04:07:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CE38B448C8; Mon, 23 May 2016 04:07:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A6CF106C; Mon, 23 May 2016 04:07:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N47fva062980; Mon, 23 May 2016 04:07:41 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N47fvb062979; Mon, 23 May 2016 04:07:41 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605230407.u4N47fvb062979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 23 May 2016 04:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300447 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 04:07:42 -0000 Author: ian Date: Mon May 23 04:07:41 2016 New Revision: 300447 URL: https://svnweb.freebsd.org/changeset/base/300447 Log: Add a note on how to update a self-hosted armv6hf system to the entry describing the armv6hf->armv6 change. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon May 23 03:51:15 2016 (r300446) +++ head/UPDATING Mon May 23 04:07:41 2016 (r300447) @@ -45,6 +45,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 and packages may fail or need manual intervention to run. New packages will be needed. + To update an existing self-hosted armv6hf system, you must add + TARGET_ARCH=armv6 on the make command line for both the build + and the install steps. + 20160510: Kernel modules compiled outside of a kernel build now default to installing to /boot/modules instead of /boot/kernel. Many kernel From owner-svn-src-head@freebsd.org Mon May 23 04:17:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA410B44C72; Mon, 23 May 2016 04:17:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C67416A2; Mon, 23 May 2016 04:17:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N4HRoL065936; Mon, 23 May 2016 04:17:27 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N4HRKl065935; Mon, 23 May 2016 04:17:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605230417.u4N4HRKl065935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 23 May 2016 04:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300448 - head/sys/gnu/dev/bwn/phy_n X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 04:17:28 -0000 Author: adrian Date: Mon May 23 04:17:27 2016 New Revision: 300448 URL: https://svnweb.freebsd.org/changeset/base/300448 Log: [bwn] convert another PHY-N workaround to the freebsd bwn format. These were hidden behind an #ifdef that we weren't setting. I don't have the hardware in question to check. Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Mon May 23 04:07:41 2016 (r300447) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Mon May 23 04:17:27 2016 (r300448) @@ -6635,16 +6635,12 @@ bwn_nphy_op_prepare_structs(struct bwn_m if (mac->mac_phy.rev >= 2 && (siba_sprom_get_bf2_lo(sc->sc_dev) & BWN_BFL2_TXPWRCTRL_EN)) { nphy->txpwrctrl = true; -#ifdef CONFIG_BWN_SSB - if (dev->dev->bus_type == BWN_BUS_SSB && - dev->dev->sdev->bus->bustype == SSB_BUSTYPE_PCI) { - struct pci_dev *pdev = - dev->dev->sdev->bus->host_pci; - if (pdev->device == 0x4328 || - pdev->device == 0x432a) + if (bwn_is_bus_siba(mac) && + (siba_get_type(sc->sc_dev) == SIBA_TYPE_PCI)) { + if ((siba_get_pci_device(sc->sc_dev) == 0x4328) || + (siba_get_pci_device(sc->sc_dev) == 0x432a)) nphy->pwg_gain_5ghz = true; } -#endif } else if (siba_sprom_get_bf2_lo(sc->sc_dev) & BWN_BFL2_5G_PWRGAIN) { nphy->pwg_gain_5ghz = true; } From owner-svn-src-head@freebsd.org Mon May 23 04:49:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADE84B4631F; Mon, 23 May 2016 04:49:24 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 9309E12EB; Mon, 23 May 2016 04:49:24 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 70400D3D4; Mon, 23 May 2016 04:49:23 +0000 (UTC) Subject: Re: svn commit: r298946 - head/usr.sbin/bsdinstall/scripts To: Andriy Voskoboinyk , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605022140.u42LeYFK051507@repo.freebsd.org> From: Allan Jude Message-ID: <186c070f-eb81-370d-b215-1d9f370918b8@freebsd.org> Date: Mon, 23 May 2016 00:49:22 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201605022140.u42LeYFK051507@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 04:49:24 -0000 On 2016-05-02 17:40, Andriy Voskoboinyk wrote: > Author: avos > Date: Mon May 2 21:40:34 2016 > New Revision: 298946 > URL: https://svnweb.freebsd.org/changeset/base/298946 > > Log: > bsdinstall: fix static address assignment for protected wireless networks. > > Filter out IFCONFIG_PREFIX variable (which may contain WPA keyword) > from ifconfig parameters. > > PR: 169199 > > Modified: > head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 > > Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 > ============================================================================== > --- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Mon May 2 21:23:05 2016 (r298945) > +++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Mon May 2 21:40:34 2016 (r298946) > @@ -84,7 +84,7 @@ retval=$? > > if [ "$BSDINSTALL_CONFIGCURRENT" ]; then > . $BSDINSTALL_TMPETC/._rc.conf.net > - ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE` > + ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE | sed "s|$2||"` > if [ "$defaultrouter" ]; then > route delete -inet default > route add -inet default $defaultrouter > This breaks static assignment of IP addresses to wired interfaces: sed: first RE may not be empty -- Allan Jude From owner-svn-src-head@freebsd.org Mon May 23 05:00:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A99AEB46591; Mon, 23 May 2016 05:00:29 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 7A1E41B44; Mon, 23 May 2016 05:00:29 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 69782D402; Mon, 23 May 2016 05:00:28 +0000 (UTC) Subject: Re: svn commit: r298946 - head/usr.sbin/bsdinstall/scripts To: Andriy Voskoboinyk , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605022140.u42LeYFK051507@repo.freebsd.org> <186c070f-eb81-370d-b215-1d9f370918b8@freebsd.org> From: Allan Jude Message-ID: Date: Mon, 23 May 2016 01:00:27 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <186c070f-eb81-370d-b215-1d9f370918b8@freebsd.org> Content-Type: multipart/mixed; boundary="------------26E0DFE394FD6CFD610C9DF3" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 05:00:29 -0000 This is a multi-part message in MIME format. --------------26E0DFE394FD6CFD610C9DF3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 2016-05-23 00:49, Allan Jude wrote: > On 2016-05-02 17:40, Andriy Voskoboinyk wrote: >> Author: avos >> Date: Mon May 2 21:40:34 2016 >> New Revision: 298946 >> URL: https://svnweb.freebsd.org/changeset/base/298946 >> >> Log: >> bsdinstall: fix static address assignment for protected wireless networks. >> >> Filter out IFCONFIG_PREFIX variable (which may contain WPA keyword) >> from ifconfig parameters. >> >> PR: 169199 >> >> Modified: >> head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 >> >> Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 >> ============================================================================== >> --- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Mon May 2 21:23:05 2016 (r298945) >> +++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Mon May 2 21:40:34 2016 (r298946) >> @@ -84,7 +84,7 @@ retval=$? >> >> if [ "$BSDINSTALL_CONFIGCURRENT" ]; then >> . $BSDINSTALL_TMPETC/._rc.conf.net >> - ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE` >> + ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE | sed "s|$2||"` >> if [ "$defaultrouter" ]; then >> route delete -inet default >> route add -inet default $defaultrouter >> > > This breaks static assignment of IP addresses to wired interfaces: > > sed: first RE may not be empty > > I wrote this patch for the issue. Unless you see a better way to do it? -- Allan Jude --------------26E0DFE394FD6CFD610C9DF3 Content-Type: text/plain; charset=UTF-8; name="bsdinstall_netif.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bsdinstall_netif.patch" SW5kZXg6IHVzci5zYmluL2JzZGluc3RhbGwvc2NyaXB0cy9uZXRjb25maWdfaXB2NAo9PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09Ci0tLSB1c3Iuc2Jpbi9ic2RpbnN0YWxsL3NjcmlwdHMvbmV0Y29uZmlnX2lw djQJKHJldmlzaW9uIDMwMDQzNikKKysrIHVzci5zYmluL2JzZGluc3RhbGwvc2NyaXB0cy9u ZXRjb25maWdfaXB2NAkod29ya2luZyBjb3B5KQpAQCAtODQsNyArODQsMTEgQEAKIAogaWYg WyAiJEJTRElOU1RBTExfQ09ORklHQ1VSUkVOVCIgXTsgdGhlbgogCS4gJEJTRElOU1RBTExf VE1QRVRDLy5fcmMuY29uZi5uZXQKLQlpZmNvbmZpZyAkSU5URVJGQUNFIGBldmFsIGVjaG8g XFxcJGlmY29uZmlnXyRJTlRFUkZBQ0UgfCBzZWQgInN8JDJ8fCJgCisJaWYgWyAtbiAiJDIi IF07IHRoZW4KKwkJaWZjb25maWcgJElOVEVSRkFDRSBgZXZhbCBlY2hvIFxcXCRpZmNvbmZp Z18kSU5URVJGQUNFIHwgc2VkICJzfCQyfHwiYAorCWVsc2UKKwkJaWZjb25maWcgJElOVEVS RkFDRSBgZXZhbCBlY2hvIFxcXCRpZmNvbmZpZ18kSU5URVJGQUNFYAorCWZpCiAJaWYgWyAi JGRlZmF1bHRyb3V0ZXIiIF07IHRoZW4KIAkJcm91dGUgZGVsZXRlIC1pbmV0IGRlZmF1bHQK IAkJcm91dGUgYWRkIC1pbmV0IGRlZmF1bHQgJGRlZmF1bHRyb3V0ZXIK --------------26E0DFE394FD6CFD610C9DF3-- From owner-svn-src-head@freebsd.org Mon May 23 05:11:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 269DDB468F2; Mon, 23 May 2016 05:11:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF42814E6; Mon, 23 May 2016 05:11:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N5BcIp082232; Mon, 23 May 2016 05:11:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N5Bcp8082230; Mon, 23 May 2016 05:11:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605230511.u4N5Bcp8082230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 23 May 2016 05:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300455 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 05:11:40 -0000 Author: sephe Date: Mon May 23 05:11:38 2016 New Revision: 300455 URL: https://svnweb.freebsd.org/changeset/base/300455 Log: hyperv: Move guest id setup to early place And - Rework the guest id composition. - Nuke useless saved guest_id. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6430 Modified: head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon May 23 05:11:31 2016 (r300454) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon May 23 05:11:38 2016 (r300455) @@ -50,6 +50,35 @@ __FBSDID("$FreeBSD$"); #define HYPERV_INTERFACE 0x31237648 /* HV#1 */ +/* + * The guest OS needs to register the guest ID with the hypervisor. + * The guest ID is a 64 bit entity and the structure of this ID is + * specified in the Hyper-V specification: + * + * http://msdn.microsoft.com/en-us/library/windows/ + * hardware/ff542653%28v=vs.85%29.aspx + * + * While the current guideline does not specify how FreeBSD guest ID(s) + * need to be generated, our plan is to publish the guidelines for + * FreeBSD and other guest operating systems that currently are hosted + * on Hyper-V. The implementation here conforms to this yet + * unpublished guidelines. + * + * Bit(s) + * 63 - Indicates if the OS is Open Source or not; 1 is Open Source + * 62:56 - Os Type: FreeBSD is 0x02 + * 55:48 - Distro specific identification + * 47:16 - FreeBSD kernel version number + * 15:0 - Distro specific identification + */ +#define HYPERV_GUESTID_OSS (0x1ULL << 63) +#define HYPERV_GUESTID_FREEBSD (0x02ULL << 56) +#define HYPERV_GUESTID(id) \ + (HYPERV_GUESTID_OSS | HYPERV_GUESTID_FREEBSD | \ + (((uint64_t)(((id) & 0xff0000) >> 16)) << 48) |\ + (((uint64_t)__FreeBSD_version) << 16) | \ + ((uint64_t)((id) & 0x00ffff))) + static u_int hv_get_timecount(struct timecounter *tc); u_int hyperv_features; @@ -143,13 +172,6 @@ hv_vmbus_init(void) goto cleanup; /* - * Write our OS info - */ - uint64_t os_guest_info = HV_FREEBSD_GUEST_ID; - wrmsr(HV_X64_MSR_GUEST_OS_ID, os_guest_info); - hv_vmbus_g_context.guest_id = os_guest_info; - - /* * See if the hypercall page is already set */ hypercall_msr.as_uint64_t = rdmsr(HV_X64_MSR_HYPERCALL); @@ -192,16 +214,13 @@ hv_vmbus_init(void) void hv_vmbus_cleanup(void) { - hv_vmbus_x64_msr_hypercall_contents hypercall_msr; + if (hv_vmbus_g_context.hypercall_page != NULL) { + hv_vmbus_x64_msr_hypercall_contents hypercall_msr; - if (hv_vmbus_g_context.guest_id == HV_FREEBSD_GUEST_ID) { - if (hv_vmbus_g_context.hypercall_page != NULL) { hypercall_msr.as_uint64_t = 0; - wrmsr(HV_X64_MSR_HYPERCALL, - hypercall_msr.as_uint64_t); + wrmsr(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64_t); free(hv_vmbus_g_context.hypercall_page, M_DEVBUF); hv_vmbus_g_context.hypercall_page = NULL; - } } } @@ -508,6 +527,9 @@ hyperv_init(void *dummy __unused) return; } + /* Write guest id */ + wrmsr(HV_X64_MSR_GUEST_OS_ID, HYPERV_GUESTID(0)); + if (hyperv_features & HV_FEATURE_MSR_TIME_REFCNT) { /* Register virtual timecount */ tc_init(&hv_timecounter); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon May 23 05:11:31 2016 (r300454) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon May 23 05:11:38 2016 (r300455) @@ -198,7 +198,6 @@ enum { #define HV_HYPERCALL_PARAM_ALIGN sizeof(uint64_t) typedef struct { - uint64_t guest_id; void* hypercall_page; hv_bool_uint8_t syn_ic_initialized; @@ -763,44 +762,6 @@ void hv_et_intr(struct trapframe*); /* Wait for device creation */ void vmbus_scan(void); -/* - * The guest OS needs to register the guest ID with the hypervisor. - * The guest ID is a 64 bit entity and the structure of this ID is - * specified in the Hyper-V specification: - * - * http://msdn.microsoft.com/en-us/library/windows/ - * hardware/ff542653%28v=vs.85%29.aspx - * - * While the current guideline does not specify how FreeBSD guest ID(s) - * need to be generated, our plan is to publish the guidelines for - * FreeBSD and other guest operating systems that currently are hosted - * on Hyper-V. The implementation here conforms to this yet - * unpublished guidelines. - * - * Bit(s) - * 63 - Indicates if the OS is Open Source or not; 1 is Open Source - * 62:56 - Os Type; Linux is 0x100, FreeBSD is 0x200 - * 55:48 - Distro specific identification - * 47:16 - FreeBSD kernel version number - * 15:0 - Distro specific identification - * - */ - -#define HV_FREEBSD_VENDOR_ID 0x8200 -#define HV_FREEBSD_GUEST_ID hv_generate_guest_id(0,0) - -static inline uint64_t hv_generate_guest_id( - uint8_t distro_id_part1, - uint16_t distro_id_part2) -{ - uint64_t guest_id; - guest_id = (((uint64_t)HV_FREEBSD_VENDOR_ID) << 48); - guest_id |= (((uint64_t)(distro_id_part1)) << 48); - guest_id |= (((uint64_t)(__FreeBSD_version)) << 16); /* in param.h */ - guest_id |= ((uint64_t)(distro_id_part2)); - return guest_id; -} - typedef struct { unsigned int vector; void *page_buffers[2 * MAXCPU]; From owner-svn-src-head@freebsd.org Mon May 23 05:52:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBF9FB469C9; Mon, 23 May 2016 05:52:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE9E81313; Mon, 23 May 2016 05:52:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N5qlLI097784; Mon, 23 May 2016 05:52:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N5ql1O097783; Mon, 23 May 2016 05:52:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605230552.u4N5ql1O097783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 23 May 2016 05:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300474 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 05:52:49 -0000 Author: adrian Date: Mon May 23 05:52:47 2016 New Revision: 300474 URL: https://svnweb.freebsd.org/changeset/base/300474 Log: [siba] update device ids. Tested: * BCM4322 11abgn, STA mode Modified: head/sys/dev/siba/siba_bwn.c Modified: head/sys/dev/siba/siba_bwn.c ============================================================================== --- head/sys/dev/siba/siba_bwn.c Mon May 23 05:45:52 2016 (r300473) +++ head/sys/dev/siba/siba_bwn.c Mon May 23 05:52:47 2016 (r300474) @@ -93,9 +93,9 @@ static const struct siba_dev { { PCI_VENDOR_BROADCOM, 0x4324, "Broadcom BCM4309 802.11a/b/g Wireless" }, { PCI_VENDOR_BROADCOM, 0x4325, "Broadcom BCM4306 802.11b/g Wireless" }, - { PCI_VENDOR_BROADCOM, 0x4328, "Broadcom BCM4321 802.11a/b/g Wireless" }, + { PCI_VENDOR_BROADCOM, 0x4328, "Broadcom BCM4321 802.11a/b/g/n Wireless" }, { PCI_VENDOR_BROADCOM, 0x4329, "Unknown" }, - { PCI_VENDOR_BROADCOM, 0x432b, "Unknown" } + { PCI_VENDOR_BROADCOM, 0x432b, "Broadcom BCM4322 802.11a/b/g/n Wireless" } }; int siba_core_attach(struct siba_softc *); From owner-svn-src-head@freebsd.org Mon May 23 06:35:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E68A0B464B0; Mon, 23 May 2016 06:35:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9DB51AD2; Mon, 23 May 2016 06:35:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N6ZBpx010726; Mon, 23 May 2016 06:35:11 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N6ZBQJ010721; Mon, 23 May 2016 06:35:11 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605230635.u4N6ZBQJ010721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 23 May 2016 06:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300478 - in head/sys: conf dev/hyperv/include dev/hyperv/vmbus modules/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 06:35:13 -0000 Author: sephe Date: Mon May 23 06:35:11 2016 New Revision: 300478 URL: https://svnweb.freebsd.org/changeset/base/300478 Log: hyperv: Add helpers for busdma(9) operation MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6443 Added: head/sys/dev/hyperv/include/hyperv_busdma.h (contents, props changed) head/sys/dev/hyperv/vmbus/hyperv_busdma.c (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/modules/hyperv/vmbus/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon May 23 06:13:35 2016 (r300477) +++ head/sys/conf/files.amd64 Mon May 23 06:35:11 2016 (r300478) @@ -277,6 +277,7 @@ dev/hyperv/vmbus/hv_hv.c optional hyp dev/hyperv/vmbus/hv_et.c optional hyperv dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv +dev/hyperv/vmbus/hyperv_busdma.c optional hyperv dev/hyperv/vmbus/amd64/hv_vector.S optional hyperv dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon May 23 06:13:35 2016 (r300477) +++ head/sys/conf/files.i386 Mon May 23 06:35:11 2016 (r300478) @@ -252,6 +252,7 @@ dev/hyperv/vmbus/hv_hv.c optional hyp dev/hyperv/vmbus/hv_et.c optional hyperv dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv +dev/hyperv/vmbus/hyperv_busdma.c optional hyperv dev/hyperv/vmbus/i386/hv_vector.S optional hyperv dev/ichwd/ichwd.c optional ichwd dev/if_ndis/if_ndis.c optional ndis Added: head/sys/dev/hyperv/include/hyperv_busdma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/include/hyperv_busdma.h Mon May 23 06:35:11 2016 (r300478) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _HYPERV_BUSDMA_H_ +#define _HYPERV_BUSDMA_H_ + +struct hyperv_dma { + bus_addr_t hv_paddr; + bus_dma_tag_t hv_dtag; + bus_dmamap_t hv_dmap; +}; + +void hyperv_dma_map_paddr(void *arg, bus_dma_segment_t *segs, int nseg, + int error); +void *hyperv_dmamem_alloc(bus_dma_tag_t parent_dtag, bus_size_t alignment, + bus_addr_t boundary, bus_size_t size, struct hyperv_dma *dma, + int flags); +void hyperv_dmamem_free(struct hyperv_dma *dma, void *ptr); + +#endif /* !_HYPERV_BUSDMA_H_ */ Added: head/sys/dev/hyperv/vmbus/hyperv_busdma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/hyperv_busdma.c Mon May 23 06:35:11 2016 (r300478) @@ -0,0 +1,98 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include + +#define HYPERV_DMA_WAITMASK (BUS_DMA_WAITOK | BUS_DMA_NOWAIT) + +void +hyperv_dma_map_paddr(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + bus_addr_t *paddr = arg; + + if (error) + return; + + KASSERT(nseg == 1, ("too many segments %d!", nseg)); + *paddr = segs->ds_addr; +} + +void * +hyperv_dmamem_alloc(bus_dma_tag_t parent_dtag, bus_size_t alignment, + bus_addr_t boundary, bus_size_t size, struct hyperv_dma *dma, int flags) +{ + void *ret; + int error; + + error = bus_dma_tag_create(parent_dtag, /* parent */ + alignment, /* alignment */ + boundary, /* boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + size, /* maxsize */ + 1, /* nsegments */ + size, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockfuncarg */ + &dma->hv_dtag); + if (error) + return NULL; + + error = bus_dmamem_alloc(dma->hv_dtag, &ret, + (flags & HYPERV_DMA_WAITMASK) | BUS_DMA_COHERENT, &dma->hv_dmap); + if (error) { + bus_dma_tag_destroy(dma->hv_dtag); + return NULL; + } + + error = bus_dmamap_load(dma->hv_dtag, dma->hv_dmap, ret, size, + hyperv_dma_map_paddr, &dma->hv_paddr, BUS_DMA_NOWAIT); + if (error) { + bus_dmamem_free(dma->hv_dtag, ret, dma->hv_dmap); + bus_dma_tag_destroy(dma->hv_dtag); + return NULL; + } + return ret; +} + +void +hyperv_dmamem_free(struct hyperv_dma *dma, void *ptr) +{ + bus_dmamap_unload(dma->hv_dtag, dma->hv_dmap); + bus_dmamem_free(dma->hv_dtag, ptr, dma->hv_dmap); + bus_dma_tag_destroy(dma->hv_dtag); +} Modified: head/sys/modules/hyperv/vmbus/Makefile ============================================================================== --- head/sys/modules/hyperv/vmbus/Makefile Mon May 23 06:13:35 2016 (r300477) +++ head/sys/modules/hyperv/vmbus/Makefile Mon May 23 06:35:11 2016 (r300478) @@ -11,7 +11,8 @@ SRCS= hv_channel.c \ hv_hv.c \ hv_ring_buffer.c \ hv_vmbus_drv_freebsd.c \ - hv_vmbus_priv.h + hv_vmbus_priv.h \ + hyperv_busdma.c SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h # XXX: for assym.s From owner-svn-src-head@freebsd.org Mon May 23 06:52:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 482BFB46811; Mon, 23 May 2016 06:52:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1553911C6; Mon, 23 May 2016 06:52:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N6qgmE016503; Mon, 23 May 2016 06:52:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N6qgXo016502; Mon, 23 May 2016 06:52:42 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605230652.u4N6qgXo016502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 23 May 2016 06:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300479 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 06:52:43 -0000 Author: sephe Date: Mon May 23 06:52:42 2016 New Revision: 300479 URL: https://svnweb.freebsd.org/changeset/base/300479 Log: hyperv/hn: Use hyperv busdma(9) helper. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6444 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon May 23 06:35:11 2016 (r300478) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon May 23 06:52:42 2016 (r300479) @@ -113,6 +113,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "hv_net_vsc.h" #include "hv_rndis.h" #include "hv_rndis_filter.h" @@ -2171,18 +2172,6 @@ hn_check_iplen(const struct mbuf *m, int } static void -hn_dma_map_paddr(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - bus_addr_t *paddr = arg; - - if (error) - return; - - KASSERT(nseg == 1, ("too many segments %d!", nseg)); - *paddr = segs->ds_addr; -} - -static void hn_create_rx_data(struct hn_softc *sc, int ring_cnt) { struct sysctl_oid_list *child; @@ -2472,7 +2461,7 @@ hn_create_tx_ring(struct hn_softc *sc, i error = bus_dmamap_load(txr->hn_tx_rndis_dtag, txd->rndis_msg_dmap, txd->rndis_msg, HN_RNDIS_MSG_LEN, - hn_dma_map_paddr, &txd->rndis_msg_paddr, + hyperv_dma_map_paddr, &txd->rndis_msg_paddr, BUS_DMA_NOWAIT); if (error) { device_printf(sc->hn_dev, From owner-svn-src-head@freebsd.org Mon May 23 07:06:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECFEEB469FB; Mon, 23 May 2016 07:06:54 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D4431807; Mon, 23 May 2016 07:06:54 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N76rAK019745; Mon, 23 May 2016 07:06:53 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N76rov019741; Mon, 23 May 2016 07:06:53 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605230706.u4N76rov019741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 23 May 2016 07:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300480 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 07:06:55 -0000 Author: sephe Date: Mon May 23 07:06:53 2016 New Revision: 300480 URL: https://svnweb.freebsd.org/changeset/base/300480 Log: hyperv: Move Hypercall setup to an early place. It does not belong to the vmbus. While I'm here rework the Hypercall setup, e.g. use busdma(9) and avoid bit fields. Discussed with: Jun Su MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6445 Added: head/sys/dev/hyperv/vmbus/hyperv_reg.h (contents, props changed) Modified: head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon May 23 06:52:42 2016 (r300479) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon May 23 07:06:53 2016 (r300480) @@ -43,8 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include - -#include "hv_vmbus_priv.h" +#include +#include +#include #define HV_NANOSECONDS_PER_SEC 1000000000L @@ -79,6 +80,13 @@ __FBSDID("$FreeBSD$"); (((uint64_t)__FreeBSD_version) << 16) | \ ((uint64_t)((id) & 0x00ffff))) +struct hypercall_ctx { + void *hc_addr; + struct hyperv_dma hc_dma; +}; + +static struct hypercall_ctx hypercall_context; + static u_int hv_get_timecount(struct timecounter *tc); u_int hyperv_features; @@ -92,7 +100,6 @@ static u_int hyperv_features3; */ hv_vmbus_context hv_vmbus_g_context = { .syn_ic_initialized = FALSE, - .hypercall_page = NULL, }; static struct timecounter hv_timecounter = { @@ -116,7 +123,7 @@ hv_vmbus_do_hypercall(uint64_t control, uint64_t hv_status = 0; uint64_t input_address = (input) ? hv_get_phys_addr(input) : 0; uint64_t output_address = (output) ? hv_get_phys_addr(output) : 0; - volatile void* hypercall_page = hv_vmbus_g_context.hypercall_page; + volatile void *hypercall_page = hypercall_context.hc_addr; __asm__ __volatile__ ("mov %0, %%r8" : : "r" (output_address): "r8"); __asm__ __volatile__ ("call *%3" : "=a"(hv_status): @@ -134,7 +141,7 @@ hv_vmbus_do_hypercall(uint64_t control, uint64_t output_address = (output) ? hv_get_phys_addr(output) : 0; uint32_t output_address_high = output_address >> 32; uint32_t output_address_low = output_address & 0xFFFFFFFF; - volatile void* hypercall_page = hv_vmbus_g_context.hypercall_page; + volatile void *hypercall_page = hypercall_context.hc_addr; __asm__ __volatile__ ("call *%8" : "=d"(hv_status_high), "=a"(hv_status_low) : "d" (control_high), @@ -147,84 +154,6 @@ hv_vmbus_do_hypercall(uint64_t control, } /** - * @brief Main initialization routine. - * - * This routine must be called - * before any other routines in here are called - */ -int -hv_vmbus_init(void) -{ - hv_vmbus_x64_msr_hypercall_contents hypercall_msr; - void* virt_addr = NULL; - - memset( - hv_vmbus_g_context.syn_ic_event_page, - 0, - sizeof(hv_vmbus_handle) * MAXCPU); - - memset( - hv_vmbus_g_context.syn_ic_msg_page, - 0, - sizeof(hv_vmbus_handle) * MAXCPU); - - if (vm_guest != VM_GUEST_HV) - goto cleanup; - - /* - * See if the hypercall page is already set - */ - hypercall_msr.as_uint64_t = rdmsr(HV_X64_MSR_HYPERCALL); - virt_addr = malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK | M_ZERO); - - hypercall_msr.u.enable = 1; - hypercall_msr.u.guest_physical_address = - (hv_get_phys_addr(virt_addr) >> PAGE_SHIFT); - wrmsr(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64_t); - - /* - * Confirm that hypercall page did get set up - */ - hypercall_msr.as_uint64_t = 0; - hypercall_msr.as_uint64_t = rdmsr(HV_X64_MSR_HYPERCALL); - - if (!hypercall_msr.u.enable) - goto cleanup; - - hv_vmbus_g_context.hypercall_page = virt_addr; - - return (0); - - cleanup: - if (virt_addr != NULL) { - if (hypercall_msr.u.enable) { - hypercall_msr.as_uint64_t = 0; - wrmsr(HV_X64_MSR_HYPERCALL, - hypercall_msr.as_uint64_t); - } - - free(virt_addr, M_DEVBUF); - } - return (ENOTSUP); -} - -/** - * @brief Cleanup routine, called normally during driver unloading or exiting - */ -void -hv_vmbus_cleanup(void) -{ - if (hv_vmbus_g_context.hypercall_page != NULL) { - hv_vmbus_x64_msr_hypercall_contents hypercall_msr; - - hypercall_msr.as_uint64_t = 0; - wrmsr(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64_t); - free(hv_vmbus_g_context.hypercall_page, M_DEVBUF); - hv_vmbus_g_context.hypercall_page = NULL; - } -} - -/** * @brief Post a message using the hypervisor message IPC. * (This involves a hypercall.) */ @@ -304,9 +233,6 @@ hv_vmbus_synic_init(void *arg) cpu = PCPU_GET(cpuid); - if (hv_vmbus_g_context.hypercall_page == NULL) - return; - /* * TODO: Check the version */ @@ -537,3 +463,74 @@ hyperv_init(void *dummy __unused) } SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, NULL); + +static void +hypercall_memfree(void) +{ + hyperv_dmamem_free(&hypercall_context.hc_dma, + hypercall_context.hc_addr); + hypercall_context.hc_addr = NULL; +} + +static void +hypercall_create(void *arg __unused) +{ + uint64_t hc, hc_orig; + + if (vm_guest != VM_GUEST_HV) + return; + + hypercall_context.hc_addr = hyperv_dmamem_alloc(NULL, PAGE_SIZE, 0, + PAGE_SIZE, &hypercall_context.hc_dma, BUS_DMA_WAITOK); + if (hypercall_context.hc_addr == NULL) { + printf("hyperv: Hypercall page allocation failed\n"); + /* Can't perform any Hyper-V specific actions */ + vm_guest = VM_GUEST_VM; + return; + } + + /* Get the 'reserved' bits, which requires preservation. */ + hc_orig = rdmsr(MSR_HV_HYPERCALL); + + /* + * Setup the Hypercall page. + * + * NOTE: 'reserved' bits MUST be preserved. + */ + hc = ((hypercall_context.hc_dma.hv_paddr >> PAGE_SHIFT) << + MSR_HV_HYPERCALL_PGSHIFT) | + (hc_orig & MSR_HV_HYPERCALL_RSVD_MASK) | + MSR_HV_HYPERCALL_ENABLE; + wrmsr(MSR_HV_HYPERCALL, hc); + + /* + * Confirm that Hypercall page did get setup. + */ + hc = rdmsr(MSR_HV_HYPERCALL); + if ((hc & MSR_HV_HYPERCALL_ENABLE) == 0) { + printf("hyperv: Hypercall setup failed\n"); + hypercall_memfree(); + /* Can't perform any Hyper-V specific actions */ + vm_guest = VM_GUEST_VM; + return; + } + if (bootverbose) + printf("hyperv: Hypercall created\n"); +} +SYSINIT(hypercall_ctor, SI_SUB_DRIVERS, SI_ORDER_FIRST, hypercall_create, NULL); + +static void +hypercall_destroy(void *arg __unused) +{ + if (hypercall_context.hc_addr == NULL) + return; + + /* Disable Hypercall */ + wrmsr(MSR_HV_HYPERCALL, 0); + hypercall_memfree(); + + if (bootverbose) + printf("hyperv: Hypercall destroyed\n"); +} +SYSUNINIT(hypercall_dtor, SI_SUB_DRIVERS, SI_ORDER_FIRST, hypercall_destroy, + NULL); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon May 23 06:52:42 2016 (r300479) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon May 23 07:06:53 2016 (r300480) @@ -349,7 +349,7 @@ static int vmbus_probe(device_t dev) { if (ACPI_ID_PROBE(device_get_parent(dev), dev, vmbus_ids) == NULL || - device_get_unit(dev) != 0) + device_get_unit(dev) != 0 || vm_guest != VM_GUEST_HV) return (ENXIO); device_set_desc(dev, "Hyper-V Vmbus"); @@ -385,14 +385,6 @@ vmbus_bus_init(void) vmbus_inited = 1; sc = vmbus_get_softc(); - ret = hv_vmbus_init(); - - if (ret) { - if(bootverbose) - printf("Error VMBUS: Hypervisor Initialization Failed!\n"); - return (ret); - } - /* * Find a free IDT slot for vmbus callback. */ @@ -401,6 +393,7 @@ vmbus_bus_init(void) if(bootverbose) printf("Error VMBUS: Cannot find free IDT slot for " "vmbus callback!\n"); + ret = ENXIO; goto cleanup; } @@ -504,8 +497,6 @@ vmbus_bus_init(void) lapic_ipi_free(hv_vmbus_g_context.hv_cb_vector); cleanup: - hv_vmbus_cleanup(); - return (ret); } @@ -578,8 +569,6 @@ vmbus_detach(device_t dev) free(setup_args.page_buffers[i], M_DEVBUF); } - hv_vmbus_cleanup(); - /* remove swi */ CPU_FOREACH(i) { if (hv_vmbus_g_context.hv_event_queue[i] != NULL) { Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon May 23 06:52:42 2016 (r300479) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon May 23 07:06:53 2016 (r300480) @@ -198,7 +198,6 @@ enum { #define HV_HYPERCALL_PARAM_ALIGN sizeof(uint64_t) typedef struct { - void* hypercall_page; hv_bool_uint8_t syn_ic_initialized; hv_vmbus_handle syn_ic_msg_page[MAXCPU]; @@ -722,8 +721,6 @@ hv_vmbus_channel* hv_vmbus_allocate_chan void hv_vmbus_free_vmbus_channel(hv_vmbus_channel *channel); int hv_vmbus_request_channel_offers(void); void hv_vmbus_release_unattached_channels(void); -int hv_vmbus_init(void); -void hv_vmbus_cleanup(void); uint16_t hv_vmbus_post_msg_via_msg_ipc( hv_vmbus_connection_id connection_id, Added: head/sys/dev/hyperv/vmbus/hyperv_reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/hyperv_reg.h Mon May 23 07:06:53 2016 (r300480) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _HYPERV_REG_H_ +#define _HYPERV_REG_H_ + +#define MSR_HV_HYPERCALL 0x40000001 +#define MSR_HV_HYPERCALL_ENABLE 0x0001ULL +#define MSR_HV_HYPERCALL_RSVD_MASK 0x0ffeULL +#define MSR_HV_HYPERCALL_PGSHIFT 12 + +#endif /* !_HYPERV_REG_H_ */ From owner-svn-src-head@freebsd.org Mon May 23 07:14:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF4BCB46C43; Mon, 23 May 2016 07:14:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6BE41C8D; Mon, 23 May 2016 07:14:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N7E4TF022668; Mon, 23 May 2016 07:14:04 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N7E4LE022665; Mon, 23 May 2016 07:14:04 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605230714.u4N7E4LE022665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 23 May 2016 07:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300481 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 07:14:05 -0000 Author: sephe Date: Mon May 23 07:14:04 2016 New Revision: 300481 URL: https://svnweb.freebsd.org/changeset/base/300481 Log: hyperv/vmbus: Declare Synic message and event w/ proper types Avoid ugly casts. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6446 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 23 07:06:53 2016 (r300480) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 23 07:14:04 2016 (r300481) @@ -333,8 +333,8 @@ vmbus_event_proc(struct vmbus_softc *sc, { hv_vmbus_synic_event_flags *event; - event = ((hv_vmbus_synic_event_flags *) - hv_vmbus_g_context.syn_ic_event_page[cpu]) + HV_VMBUS_MESSAGE_SINT; + event = hv_vmbus_g_context.syn_ic_event_page[cpu] + + HV_VMBUS_MESSAGE_SINT; /* * On Host with Win8 or above, the event page can be checked directly @@ -349,8 +349,8 @@ vmbus_event_proc_compat(struct vmbus_sof { hv_vmbus_synic_event_flags *event; - event = ((hv_vmbus_synic_event_flags *) - hv_vmbus_g_context.syn_ic_event_page[cpu]) + HV_VMBUS_MESSAGE_SINT; + event = hv_vmbus_g_context.syn_ic_event_page[cpu] + + HV_VMBUS_MESSAGE_SINT; if (atomic_testandclear_int(&event->flags32[0], 0)) { vmbus_event_flags_proc( Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon May 23 07:06:53 2016 (r300480) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon May 23 07:14:04 2016 (r300481) @@ -79,8 +79,9 @@ vmbus_msg_task(void *arg __unused, int p { hv_vmbus_message *msg; - msg = ((hv_vmbus_message *)hv_vmbus_g_context.syn_ic_msg_page[curcpu]) + + msg = hv_vmbus_g_context.syn_ic_msg_page[curcpu] + HV_VMBUS_MESSAGE_SINT; + for (;;) { const hv_vmbus_channel_msg_table_entry *entry; hv_vmbus_channel_msg_header *hdr; @@ -134,9 +135,8 @@ static inline int hv_vmbus_isr(struct trapframe *frame) { struct vmbus_softc *sc = vmbus_get_softc(); + hv_vmbus_message *msg, *msg_base; int cpu = curcpu; - hv_vmbus_message *msg; - void *page_addr; /* * The Windows team has advised that we check for events @@ -146,8 +146,8 @@ hv_vmbus_isr(struct trapframe *frame) sc->vmbus_event_proc(sc, cpu); /* Check if there are actual msgs to be process */ - page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu]; - msg = ((hv_vmbus_message *)page_addr) + HV_VMBUS_TIMER_SINT; + msg_base = hv_vmbus_g_context.syn_ic_msg_page[cpu]; + msg = msg_base + HV_VMBUS_TIMER_SINT; /* we call eventtimer process the message */ if (msg->header.message_type == HV_MESSAGE_TIMER_EXPIRED) { @@ -178,7 +178,7 @@ hv_vmbus_isr(struct trapframe *frame) } } - msg = ((hv_vmbus_message *)page_addr) + HV_VMBUS_MESSAGE_SINT; + msg = msg_base + HV_VMBUS_MESSAGE_SINT; if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { taskqueue_enqueue(hv_vmbus_g_context.hv_msg_tq[cpu], &hv_vmbus_g_context.hv_msg_task[cpu]); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon May 23 07:06:53 2016 (r300480) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon May 23 07:14:04 2016 (r300481) @@ -197,11 +197,14 @@ enum { #define HV_HYPERCALL_PARAM_ALIGN sizeof(uint64_t) +struct vmbus_message; +union vmbus_event_flags; + typedef struct { hv_bool_uint8_t syn_ic_initialized; - hv_vmbus_handle syn_ic_msg_page[MAXCPU]; - hv_vmbus_handle syn_ic_event_page[MAXCPU]; + struct vmbus_message *syn_ic_msg_page[MAXCPU]; + union vmbus_event_flags *syn_ic_event_page[MAXCPU]; /* * For FreeBSD cpuid to Hyper-V vcpuid mapping. */ @@ -303,7 +306,7 @@ typedef struct { /* * Define synthetic interrupt controller message format */ -typedef struct { +typedef struct vmbus_message { hv_vmbus_msg_header header; union { uint64_t payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT]; @@ -578,7 +581,7 @@ typedef struct { /* * Define the synthetic interrupt controller event flags format */ -typedef union { +typedef union vmbus_event_flags { uint8_t flags8[HV_EVENT_FLAGS_BYTE_COUNT]; uint32_t flags32[HV_EVENT_FLAGS_DWORD_COUNT]; unsigned long flagsul[HV_EVENT_FLAGS_ULONG_COUNT]; From owner-svn-src-head@freebsd.org Mon May 23 07:23:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A311CB460F3; Mon, 23 May 2016 07:23:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66121198C; Mon, 23 May 2016 07:23:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N7NJgA025875; Mon, 23 May 2016 07:23:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N7NJUA025873; Mon, 23 May 2016 07:23:19 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605230723.u4N7NJUA025873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 23 May 2016 07:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300486 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 07:23:20 -0000 Author: sephe Date: Mon May 23 07:23:19 2016 New Revision: 300486 URL: https://svnweb.freebsd.org/changeset/base/300486 Log: hyperv/vmbus: Get rid of vmbus_devp While I'm here, nuke useless print in vmbus_attach(). MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6447 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon May 23 07:21:16 2016 (r300485) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon May 23 07:23:19 2016 (r300486) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); struct vmbus_softc *vmbus_sc; -static device_t vmbus_devp; static int vmbus_inited; static hv_setup_args setup_args; /* only CPU 0 supported at this time */ @@ -324,7 +323,7 @@ hv_vmbus_child_device_register(struct hv printf("VMBUS: Class ID: %s\n", name); } - child = device_add_child(vmbus_devp, NULL, -1); + child = device_add_child(vmbus_get_device(), NULL, -1); child_dev->device = child; device_set_ivars(child, child_dev); @@ -340,7 +339,7 @@ hv_vmbus_child_device_unregister(struct * device_add_child() */ mtx_lock(&Giant); - ret = device_delete_child(vmbus_devp, child_dev->device); + ret = device_delete_child(vmbus_get_device(), child_dev->device); mtx_unlock(&Giant); return(ret); } @@ -471,8 +470,8 @@ vmbus_bus_init(void) hv_vmbus_request_channel_offers(); vmbus_scan(); - bus_generic_attach(vmbus_devp); - device_printf(vmbus_devp, "device scan, probe and attach done\n"); + bus_generic_attach(sc->vmbus_dev); + device_printf(sc->vmbus_dev, "device scan, probe and attach done\n"); return (ret); @@ -508,11 +507,8 @@ vmbus_event_proc_dummy(struct vmbus_soft static int vmbus_attach(device_t dev) { - if(bootverbose) - device_printf(dev, "VMBUS: attach dev: %p\n", dev); - - vmbus_devp = dev; vmbus_sc = device_get_softc(dev); + vmbus_sc->vmbus_dev = dev; /* * Event processing logic will be configured: Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Mon May 23 07:21:16 2016 (r300485) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Mon May 23 07:23:19 2016 (r300486) @@ -38,6 +38,7 @@ struct vmbus_pcpu_data { struct vmbus_softc { void (*vmbus_event_proc)(struct vmbus_softc *, int); struct vmbus_pcpu_data vmbus_pcpu[MAXCPU]; + device_t vmbus_dev; }; extern struct vmbus_softc *vmbus_sc; @@ -48,6 +49,12 @@ vmbus_get_softc(void) return vmbus_sc; } +static __inline device_t +vmbus_get_device(void) +{ + return vmbus_sc->vmbus_dev; +} + #define VMBUS_SC_PCPU_GET(sc, field, cpu) (sc)->vmbus_pcpu[(cpu)].field #define VMBUS_SC_PCPU_PTR(sc, field, cpu) &(sc)->vmbus_pcpu[(cpu)].field #define VMBUS_PCPU_GET(field, cpu) \ From owner-svn-src-head@freebsd.org Mon May 23 07:32:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79017B463AA; Mon, 23 May 2016 07:32:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37DCE1E01; Mon, 23 May 2016 07:32:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4N7WZvn028805; Mon, 23 May 2016 07:32:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4N7WZRG028801; Mon, 23 May 2016 07:32:35 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605230732.u4N7WZRG028801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 23 May 2016 07:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300487 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 07:32:36 -0000 Author: sephe Date: Mon May 23 07:32:34 2016 New Revision: 300487 URL: https://svnweb.freebsd.org/changeset/base/300487 Log: hyperv/vmbus: Move IDT vector to vmbus_softc Prepare to get rid of the hv_setup_arg. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6449 Modified: head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Mon May 23 07:23:19 2016 (r300486) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Mon May 23 07:32:34 2016 (r300487) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define HV_NANOSECONDS_PER_SEC 1000000000L @@ -220,8 +221,8 @@ hv_vmbus_signal_event(void *con_id) */ void hv_vmbus_synic_init(void *arg) - { + struct vmbus_softc *sc = vmbus_get_softc(); int cpu; uint64_t hv_vcpu_index; hv_vmbus_synic_simp simp; @@ -266,7 +267,7 @@ hv_vmbus_synic_init(void *arg) /*HV_SHARED_SINT_IDT_VECTOR + 0x20; */ shared_sint.as_uint64_t = 0; - shared_sint.u.vector = setup_args->vector; + shared_sint.u.vector = sc->vmbus_idtvec; shared_sint.u.masked = FALSE; shared_sint.u.auto_eoi = TRUE; Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon May 23 07:23:19 2016 (r300486) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon May 23 07:32:34 2016 (r300487) @@ -385,25 +385,18 @@ vmbus_bus_init(void) sc = vmbus_get_softc(); /* - * Find a free IDT slot for vmbus callback. + * Find a free IDT vector for vmbus messages/events. */ - hv_vmbus_g_context.hv_cb_vector = lapic_ipi_alloc(IDTVEC(hv_vmbus_callback)); - if (hv_vmbus_g_context.hv_cb_vector < 0) { - if(bootverbose) - printf("Error VMBUS: Cannot find free IDT slot for " - "vmbus callback!\n"); + sc->vmbus_idtvec = lapic_ipi_alloc(IDTVEC(hv_vmbus_callback)); + if (sc->vmbus_idtvec < 0) { + device_printf(sc->vmbus_dev, "cannot find free IDT vector\n"); ret = ENXIO; goto cleanup; } - - if(bootverbose) - printf("VMBUS: vmbus callback vector %d\n", - hv_vmbus_g_context.hv_cb_vector); - - /* - * Notify the hypervisor of our vector. - */ - setup_args.vector = hv_vmbus_g_context.hv_cb_vector; + if(bootverbose) { + device_printf(sc->vmbus_dev, "vmbus IDT vector %d\n", + sc->vmbus_idtvec); + } CPU_FOREACH(j) { snprintf(buf, sizeof(buf), "cpu%d:hyperv", j); @@ -493,7 +486,7 @@ vmbus_bus_init(void) } } - lapic_ipi_free(hv_vmbus_g_context.hv_cb_vector); + lapic_ipi_free(sc->vmbus_idtvec); cleanup: return (ret); @@ -553,6 +546,7 @@ vmbus_sysinit(void *arg __unused) static int vmbus_detach(device_t dev) { + struct vmbus_softc *sc = device_get_softc(dev); int i; hv_vmbus_release_unattached_channels(); @@ -573,7 +567,7 @@ vmbus_detach(device_t dev) } } - lapic_ipi_free(hv_vmbus_g_context.hv_cb_vector); + lapic_ipi_free(sc->vmbus_idtvec); return (0); } Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon May 23 07:23:19 2016 (r300486) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon May 23 07:32:34 2016 (r300487) @@ -216,11 +216,6 @@ typedef struct { struct taskqueue *hv_event_queue[MAXCPU]; struct taskqueue *hv_msg_tq[MAXCPU]; struct task hv_msg_task[MAXCPU]; - /* - * Host use this vector to interrupt guest for vmbus channel - * event and msg. - */ - int hv_cb_vector; } hv_vmbus_context; /* @@ -763,7 +758,6 @@ void hv_et_intr(struct trapframe*); void vmbus_scan(void); typedef struct { - unsigned int vector; void *page_buffers[2 * MAXCPU]; } hv_setup_args; Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Mon May 23 07:23:19 2016 (r300486) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Mon May 23 07:32:34 2016 (r300487) @@ -39,6 +39,7 @@ struct vmbus_softc { void (*vmbus_event_proc)(struct vmbus_softc *, int); struct vmbus_pcpu_data vmbus_pcpu[MAXCPU]; device_t vmbus_dev; + int vmbus_idtvec; }; extern struct vmbus_softc *vmbus_sc; From owner-svn-src-head@freebsd.org Mon May 23 10:31:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72233B4770B; Mon, 23 May 2016 10:31:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41D341036; Mon, 23 May 2016 10:31:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NAVsb2081313; Mon, 23 May 2016 10:31:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NAVspJ081312; Mon, 23 May 2016 10:31:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231031.u4NAVspJ081312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 10:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300489 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 10:31:55 -0000 Author: hselasky Date: Mon May 23 10:31:54 2016 New Revision: 300489 URL: https://svnweb.freebsd.org/changeset/base/300489 Log: Use DELAY() instead of _sleep() when SCHEDULER_STOPPED() is set inside pause_sbt(). This allows pause() to continue working during a panic() which is not invoking KDB. This is useful when debugging graphics drivers using the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Modified: head/sys/kern/kern_synch.c Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Mon May 23 09:44:06 2016 (r300488) +++ head/sys/kern/kern_synch.c Mon May 23 10:31:54 2016 (r300489) @@ -327,7 +327,7 @@ pause_sbt(const char *wmesg, sbintime_t if (sbt == 0) sbt = tick_sbt; - if (cold || kdb_active) { + if (cold || kdb_active || SCHEDULER_STOPPED()) { /* * We delay one second at a time to avoid overflowing the * system specific DELAY() function(s): From owner-svn-src-head@freebsd.org Mon May 23 10:34:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81437B477D9; Mon, 23 May 2016 10:34:39 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9E31241; Mon, 23 May 2016 10:34:38 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-144.nat-2.net.cam.ac.uk [131.111.5.144]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 37786D78FE; Mon, 23 May 2016 10:34:02 +0000 (UTC) Date: Mon, 23 May 2016 11:34:00 +0100 From: Andrew Turner To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300348 - head Message-ID: <20160523113400.349b8bdc@zapp> In-Reply-To: <201605210132.u4L1W43X033151@repo.freebsd.org> References: <201605210132.u4L1W43X033151@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 10:34:39 -0000 On Sat, 21 May 2016 01:32:04 +0000 (UTC) Bryan Drewery wrote: > Author: bdrewery > Date: Sat May 21 01:32:04 2016 > New Revision: 300348 > URL: https://svnweb.freebsd.org/changeset/base/300348 > > Log: > Move external toolchain support earlier. > > This is to consolidate external toolchain and > WITHOUT_CROSS_COMPILER support. > Reviewed by: brooks, bapt > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D6353 > This seems to have broken the arm64 build. My guess is the wrong linker is being used, but I haven't looked into the issue too far. Andrew -------------------------------------------------------------- >>> stage 4.2: building libraries -------------------------------------------------------------- ===> gnu/lib/libssp/libssp_nonshared (obj,all,install) ===> gnu/lib/libgcc (obj,all,install) ===> lib/libcompiler_rt (obj,all,install) ===> gnu/lib/csu (obj,all,install) ===> lib/csu (obj,all,install) ===> lib/libcompiler_rt (obj,all,install) ===> lib/libc (obj,all,install) ===> lib/libc_nonshared (obj,all,install) ===> lib/csu/aarch64 (obj) ===> lib/csu/aarch64 (all) ===> lib/csu/aarch64 (install) /scratch/tmp/andrew/obj/arm64.aarch64/scratch/tmp/andrew/head-git/tmp/usr/lib/crti.o: file not recognized: File format not recognized cc: error: linker command failed with exit code 1 (use -v to see invocation) --- libc.so.7.full --- *** [libc.so.7.full] Error code 1 make[4]: stopped in /scratch/tmp/andrew/head-git/lib/libc 1 error make[4]: stopped in /scratch/tmp/andrew/head-git/lib/libc --- lib/libc__L --- *** [lib/libc__L] Error code 2 make[3]: stopped in /scratch/tmp/andrew/head-git 1 error make[3]: stopped in /scratch/tmp/andrew/head-git --- libraries --- *** [libraries] Error code 2 make[2]: stopped in /scratch/tmp/andrew/head-git From owner-svn-src-head@freebsd.org Mon May 23 11:02:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A064BB47C89; Mon, 23 May 2016 11:02:06 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 71E5B1E8C; Mon, 23 May 2016 11:02:06 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-144.nat-2.net.cam.ac.uk [131.111.5.144]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id D069ED78FE; Mon, 23 May 2016 11:01:35 +0000 (UTC) Date: Mon, 23 May 2016 12:01:34 +0100 From: Andrew Turner To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300348 - head Message-ID: <20160523120134.7d4c127d@zapp> In-Reply-To: <20160523113400.349b8bdc@zapp> References: <201605210132.u4L1W43X033151@repo.freebsd.org> <20160523113400.349b8bdc@zapp> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 11:02:06 -0000 On Mon, 23 May 2016 11:34:00 +0100 Andrew Turner wrote: > On Sat, 21 May 2016 01:32:04 +0000 (UTC) > Bryan Drewery wrote: > > > Author: bdrewery > > Date: Sat May 21 01:32:04 2016 > > New Revision: 300348 > > URL: https://svnweb.freebsd.org/changeset/base/300348 > > > > Log: > > Move external toolchain support earlier. > > > > This is to consolidate external toolchain and > > WITHOUT_CROSS_COMPILER support. > > Reviewed by: brooks, bapt > > Sponsored by: EMC / Isilon Storage Division > > Differential Revision: https://reviews.freebsd.org/D6353 > > > > This seems to have broken the arm64 build. My guess is the wrong > linker is being used, but I haven't looked into the issue too far. The issue is you moved a block that depends on BROKEN_OPTIONS being defined to before the point we include share/mk/src.opts.mk, the place it is defined. Andrew From owner-svn-src-head@freebsd.org Mon May 23 11:41:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C52C5B474AB; Mon, 23 May 2016 11:41:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 974E310A0; Mon, 23 May 2016 11:41:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NBfZth004145; Mon, 23 May 2016 11:41:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NBfZ8c004144; Mon, 23 May 2016 11:41:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231141.u4NBfZ8c004144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 11:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300490 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 11:41:36 -0000 Author: hselasky Date: Mon May 23 11:41:35 2016 New Revision: 300490 URL: https://svnweb.freebsd.org/changeset/base/300490 Log: Add support for atomic_long_inc_not_zero() to the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 23 10:31:54 2016 (r300489) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 23 11:41:35 2016 (r300490) @@ -46,7 +46,7 @@ #define BITS_TO_LONGS(n) howmany((n), BITS_PER_LONG) #define BIT_MASK(nr) (1UL << ((nr) & (BITS_PER_LONG - 1))) #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) -#define GENMASK(lo, hi) (((2UL << ((hi) - (lo))) - 1UL) << (lo)) +#define GENMASK(h, l) (((~0UL) >> (BITS_PER_LONG - (h) - 1)) & ((~0UL) << (l))) #define BITS_PER_BYTE 8 static inline int From owner-svn-src-head@freebsd.org Mon May 23 11:44:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF422B47524; Mon, 23 May 2016 11:44:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BAAE12F2; Mon, 23 May 2016 11:44:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id CEAAD1FE024; Mon, 23 May 2016 13:44:15 +0200 (CEST) Subject: Re: svn commit: r300490 - head/sys/compat/linuxkpi/common/include/linux To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605231141.u4NBfZ8c004144@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Mon, 23 May 2016 13:47:37 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201605231141.u4NBfZ8c004144@repo.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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 11:44:18 -0000 On 05/23/16 13:41, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon May 23 11:41:35 2016 > New Revision: 300490 > URL: https://svnweb.freebsd.org/changeset/base/300490 > > Log: > Add support for atomic_long_inc_not_zero() to the LinuxKPI. > > Obtained from: kmacy @ > MFC after: 1 week > Sponsored by: Mellanox Technologies > > Modified: > head/sys/compat/linuxkpi/common/include/linux/bitops.h > Correct commit message: Correct GENMASK() macro in the LinuxKPI. Else the same. --HPS From owner-svn-src-head@freebsd.org Mon May 23 11:44:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF150B47567; Mon, 23 May 2016 11:44:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 720AD1497; Mon, 23 May 2016 11:44:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NBikeD004955; Mon, 23 May 2016 11:44:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NBikhD004954; Mon, 23 May 2016 11:44:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231144.u4NBikhD004954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 11:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300491 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 11:44:47 -0000 Author: hselasky Date: Mon May 23 11:44:46 2016 New Revision: 300491 URL: https://svnweb.freebsd.org/changeset/base/300491 Log: Add support for atomic_long_inc_not_zero() to the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 23 11:41:35 2016 (r300490) +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 23 11:44:46 2016 (r300491) @@ -41,6 +41,7 @@ typedef struct { #define atomic_long_add(i, v) atomic_long_add_return((i), (v)) #define atomic_long_inc_return(v) atomic_long_add_return(1, (v)) +#define atomic_long_inc_not_zero(v) atomic_long_inc_not_zero(v) static inline long atomic_long_add_return(long i, atomic_long_t *v) From owner-svn-src-head@freebsd.org Mon May 23 11:47:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E04AB4760D; Mon, 23 May 2016 11:47:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E99A1785; Mon, 23 May 2016 11:47:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NBlsFg005100; Mon, 23 May 2016 11:47:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NBlsr0005099; Mon, 23 May 2016 11:47:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231147.u4NBlsr0005099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 11:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300492 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 11:47:55 -0000 Author: hselasky Date: Mon May 23 11:47:54 2016 New Revision: 300492 URL: https://svnweb.freebsd.org/changeset/base/300492 Log: Add more GFP related defines to the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/gfp.h Mon May 23 11:44:46 2016 (r300491) +++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Mon May 23 11:47:54 2016 (r300492) @@ -46,6 +46,14 @@ #define __GFP_NOWARN 0 #define __GFP_HIGHMEM 0 #define __GFP_ZERO M_ZERO +#define __GFP_NORETRY 0 +#define __GFP_RECLAIM 0 +#define __GFP_RECLAIMABLE 0 + +#define __GFP_IO 0 +#define __GFP_NO_KSWAPD 0 +#define __GFP_WAIT M_WAITOK +#define __GFP_DMA32 0 #define GFP_NOWAIT M_NOWAIT #define GFP_ATOMIC (M_NOWAIT | M_USE_RESERVE) @@ -55,6 +63,8 @@ #define GFP_HIGHUSER_MOVABLE M_WAITOK #define GFP_IOFS M_NOWAIT #define GFP_NOIO M_NOWAIT +#define GFP_DMA32 0 +#define GFP_TEMPORARY 0 static inline void * page_address(struct page *page) @@ -147,4 +157,7 @@ static inline uintptr_t __get_free_pages #define kmalloc_node(chunk, mask, node) kmalloc(chunk, mask) +#define SetPageReserved(page) do { } while (0) /* NOP */ +#define ClearPageReserved(page) do { } while (0) /* NOP */ + #endif /* _LINUX_GFP_H_ */ From owner-svn-src-head@freebsd.org Mon May 23 11:50:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85B33B476BB; Mon, 23 May 2016 11:50:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F91B1A13; Mon, 23 May 2016 11:50:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NBo5ZE005228; Mon, 23 May 2016 11:50:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NBo56Y005227; Mon, 23 May 2016 11:50:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231150.u4NBo56Y005227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 11:50:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300493 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 11:50:06 -0000 Author: hselasky Date: Mon May 23 11:50:05 2016 New Revision: 300493 URL: https://svnweb.freebsd.org/changeset/base/300493 Log: Add support for "cdev_add_ext()" to the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/cdev.h Mon May 23 11:47:54 2016 (r300492) +++ head/sys/compat/linuxkpi/common/include/linux/cdev.h Mon May 23 11:50:05 2016 (r300493) @@ -91,6 +91,18 @@ cdev_add(struct linux_cdev *cdev, dev_t return (0); } +static inline int +cdev_add_ext(struct linux_cdev *cdev, dev_t dev, uid_t uid, gid_t gid, int mode) +{ + cdev->cdev = make_dev(&linuxcdevsw, MINOR(dev), uid, gid, mode, + "%s/%d", kobject_name(&cdev->kobj), MINOR(dev)); + cdev->dev = dev; + cdev->cdev->si_drv1 = cdev; + + kobject_get(cdev->kobj.parent); + return (0); +} + static inline void cdev_del(struct linux_cdev *cdev) { From owner-svn-src-head@freebsd.org Mon May 23 11:53:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E939B47874; Mon, 23 May 2016 11:53:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2DB31E20; Mon, 23 May 2016 11:53:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NBr1wt007952; Mon, 23 May 2016 11:53:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NBr1M8007951; Mon, 23 May 2016 11:53:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231153.u4NBr1M8007951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 11:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300494 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 11:53:02 -0000 Author: hselasky Date: Mon May 23 11:53:00 2016 New Revision: 300494 URL: https://svnweb.freebsd.org/changeset/base/300494 Log: Implement "_outb()" to the LinuxKPI for i386 and amd64 only. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/io.h Modified: head/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/io.h Mon May 23 11:50:05 2016 (r300493) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Mon May 23 11:53:00 2016 (r300494) @@ -172,6 +172,14 @@ readl(const volatile void *addr) } #if defined(__i386__) || defined(__amd64__) +static inline void +_outb(u_char data, u_int port) +{ + __asm __volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); +} +#endif + +#if defined(__i386__) || defined(__amd64__) void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr); #else #define _ioremap_attr(...) NULL From owner-svn-src-head@freebsd.org Mon May 23 11:57:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84F8BB479A5; Mon, 23 May 2016 11:57:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54F8710E9; Mon, 23 May 2016 11:57:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NBvNqa008139; Mon, 23 May 2016 11:57:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NBvN14008138; Mon, 23 May 2016 11:57:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231157.u4NBvN14008138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 11:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300495 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 11:57:24 -0000 Author: hselasky Date: Mon May 23 11:57:23 2016 New Revision: 300495 URL: https://svnweb.freebsd.org/changeset/base/300495 Log: Make header file standalone by including definitions for needed linux_wait_xxx() functions. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/completion.h Modified: head/sys/compat/linuxkpi/common/include/linux/completion.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/completion.h Mon May 23 11:53:00 2016 (r300494) +++ head/sys/compat/linuxkpi/common/include/linux/completion.h Mon May 23 11:57:23 2016 (r300495) @@ -32,6 +32,7 @@ #define _LINUX_COMPLETION_H_ #include +#include struct completion { unsigned int done; From owner-svn-src-head@freebsd.org Mon May 23 12:03:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C672DB451AC; Mon, 23 May 2016 12:03:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A10D418F8; Mon, 23 May 2016 12:03:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NC3e6E010993; Mon, 23 May 2016 12:03:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NC3eHI010991; Mon, 23 May 2016 12:03:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231203.u4NC3eHI010991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 12:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300496 - in head/sys/compat/linuxkpi/common: include/linux 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 12:03:41 -0000 Author: hselasky Date: Mon May 23 12:03:40 2016 New Revision: 300496 URL: https://svnweb.freebsd.org/changeset/base/300496 Log: Add more list_xxx() functions to the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/list.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/list.h Mon May 23 11:57:23 2016 (r300495) +++ head/sys/compat/linuxkpi/common/include/linux/list.h Mon May 23 12:03:40 2016 (r300496) @@ -109,6 +109,13 @@ list_replace(struct list_head *old, stru } static inline void +list_replace_init(struct list_head *old, struct list_head *new) +{ + list_replace(old, new); + INIT_LIST_HEAD(old); +} + +static inline void linux_list_add(struct list_head *new, struct list_head *prev, struct list_head *next) { @@ -132,9 +139,18 @@ list_del_init(struct list_head *entry) #define list_first_entry(ptr, type, member) \ list_entry((ptr)->next, type, member) +#define list_last_entry(ptr, type, member) \ + list_entry((ptr)->prev, type, member) + +#define list_first_entry_or_null(ptr, type, member) \ + (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) + #define list_next_entry(ptr, member) \ list_entry(((ptr)->member.next), typeof(*(ptr)), member) +#define list_prev_entry(ptr, member) \ + list_entry(((ptr)->member.prev), typeof(*(ptr)), member) + #define list_for_each(p, head) \ for (p = (head)->next; p != (head); p = (p)->next) @@ -436,4 +452,7 @@ static inline int list_is_last(const str (pos) && ({ n = (pos)->member.next; 1; }); \ pos = hlist_entry_safe(n, typeof(*(pos)), member)) +extern void list_sort(void *priv, struct list_head *head, int (*cmp)(void *priv, + struct list_head *a, struct list_head *b)); + #endif /* _LINUX_LIST_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 23 11:57:23 2016 (r300495) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 23 12:03:40 2016 (r300496) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -1358,6 +1359,47 @@ unregister_inetaddr_notifier(struct noti return (0); } +struct list_sort_thunk { + int (*cmp)(void *, struct list_head *, struct list_head *); + void *priv; +}; + +static inline int +linux_le_cmp(void *priv, const void *d1, const void *d2) +{ + struct list_head *le1, *le2; + struct list_sort_thunk *thunk; + + thunk = priv; + le1 = *(__DECONST(struct list_head **, d1)); + le2 = *(__DECONST(struct list_head **, d2)); + return ((thunk->cmp)(thunk->priv, le1, le2)); +} + +void +list_sort(void *priv, struct list_head *head, int (*cmp)(void *priv, + struct list_head *a, struct list_head *b)) +{ + struct list_sort_thunk thunk; + struct list_head **ar, *le; + size_t count, i; + + count = 0; + list_for_each(le, head) + count++; + ar = malloc(sizeof(struct list_head *) * count, M_KMALLOC, M_WAITOK); + i = 0; + list_for_each(le, head) + ar[i++] = le; + thunk.cmp = cmp; + thunk.priv = priv; + qsort_r(ar, count, sizeof(struct list_head *), &thunk, linux_le_cmp); + INIT_LIST_HEAD(head); + for (i = 0; i < count; i++) + list_add_tail(ar[i], head); + free(ar, M_KMALLOC); +} + void linux_irq_handler(void *ent) { From owner-svn-src-head@freebsd.org Mon May 23 12:06:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68B26B452F4; Mon, 23 May 2016 12:06:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 393D21BFE; Mon, 23 May 2016 12:06:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NC6YND011311; Mon, 23 May 2016 12:06:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NC6YHC011310; Mon, 23 May 2016 12:06:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231206.u4NC6YHC011310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 12:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300497 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 12:06:35 -0000 Author: hselasky Date: Mon May 23 12:06:34 2016 New Revision: 300497 URL: https://svnweb.freebsd.org/changeset/base/300497 Log: Implement "kref_put_mutex()" for the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kref.h Modified: head/sys/compat/linuxkpi/common/include/linux/kref.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kref.h Mon May 23 12:03:40 2016 (r300496) +++ head/sys/compat/linuxkpi/common/include/linux/kref.h Mon May 23 12:06:34 2016 (r300497) @@ -36,6 +36,9 @@ #include #include +#include +#include + #include struct kref { @@ -88,4 +91,20 @@ kref_get_unless_zero(struct kref *kref) return atomic_add_unless(&kref->refcount, 1, 0); } +static inline int kref_put_mutex(struct kref *kref, + void (*release)(struct kref *kref), struct mutex *lock) +{ + WARN_ON(release == NULL); + if (unlikely(!atomic_add_unless(&kref->refcount, -1, 1))) { + mutex_lock(lock); + if (unlikely(!atomic_dec_and_test(&kref->refcount))) { + mutex_unlock(lock); + return 0; + } + release(kref); + return 1; + } + return 0; +} + #endif /* _LINUX_KREF_H_ */ From owner-svn-src-head@freebsd.org Mon May 23 12:10:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E959B454F7; Mon, 23 May 2016 12:10:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 601661EC6; Mon, 23 May 2016 12:10:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NCASs1011653; Mon, 23 May 2016 12:10:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NCASQG011652; Mon, 23 May 2016 12:10:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231210.u4NCASQG011652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 12:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300498 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 12:10:29 -0000 Author: hselasky Date: Mon May 23 12:10:28 2016 New Revision: 300498 URL: https://svnweb.freebsd.org/changeset/base/300498 Log: Add more ktime related functions to the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/ktime.h Mon May 23 12:06:34 2016 (r300497) +++ head/sys/compat/linuxkpi/common/include/linux/ktime.h Mon May 23 12:10:28 2016 (r300498) @@ -51,6 +51,24 @@ ktime_to_ns(ktime_t kt) return kt.tv64; } +static inline int64_t +ktime_divns(const ktime_t kt, int64_t div) +{ + return kt.tv64 / div; +} + +static inline int64_t +ktime_to_us(ktime_t kt) +{ + return ktime_divns(kt, NSEC_PER_USEC); +} + +static inline int64_t +ktime_to_ms(ktime_t kt) +{ + return ktime_divns(kt, NSEC_PER_MSEC); +} + static inline struct timeval ktime_to_timeval(ktime_t kt) { @@ -89,6 +107,20 @@ ktime_sub(ktime_t lhs, ktime_t rhs) return (lhs); } +static inline int64_t +ktime_us_delta(ktime_t later, ktime_t earlier) +{ + ktime_t diff = ktime_sub(later, earlier); + return ktime_to_us(diff); +} + +static inline int64_t +ktime_ms_delta(ktime_t later, ktime_t earlier) +{ + ktime_t diff = ktime_sub(later, earlier); + return ktime_to_ms(diff); +} + static inline ktime_t ktime_add(ktime_t lhs, ktime_t rhs) { From owner-svn-src-head@freebsd.org Mon May 23 12:13:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12811B45719; Mon, 23 May 2016 12:13:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3ECC1320; Mon, 23 May 2016 12:13:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NCDGEG014393; Mon, 23 May 2016 12:13:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NCDGEc014392; Mon, 23 May 2016 12:13:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231213.u4NCDGEc014392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 12:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300499 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 12:13:18 -0000 Author: hselasky Date: Mon May 23 12:13:16 2016 New Revision: 300499 URL: https://svnweb.freebsd.org/changeset/base/300499 Log: Set an invalid IRQ number when no PCI IRQ is available in the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Mon May 23 12:10:28 2016 (r300498) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Mon May 23 12:13:16 2016 (r300499) @@ -139,7 +139,7 @@ linux_pci_attach(device_t dev) if (rle) pdev->dev.irq = rle->start; else - pdev->dev.irq = 0; + pdev->dev.irq = 255; pdev->irq = pdev->dev.irq; mtx_unlock(&Giant); spin_lock(&pci_lock); From owner-svn-src-head@freebsd.org Mon May 23 12:35:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CC69B45E0C; Mon, 23 May 2016 12:35:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32BB01039; Mon, 23 May 2016 12:35:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NCZ7Bl020534; Mon, 23 May 2016 12:35:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NCZ7s9020533; Mon, 23 May 2016 12:35:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231235.u4NCZ7s9020533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 12:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300500 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 12:35:08 -0000 Author: hselasky Date: Mon May 23 12:35:07 2016 New Revision: 300500 URL: https://svnweb.freebsd.org/changeset/base/300500 Log: Add more printf() related functions to the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 23 12:13:16 2016 (r300499) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 23 12:35:07 2016 (r300500) @@ -52,6 +52,8 @@ #include #include +#include + #define KERN_CONT "" #define KERN_EMERG "<0>" #define KERN_ALERT "<1>" @@ -124,7 +126,37 @@ #define DIV_ROUND_UP_ULL(x, n) DIV_ROUND_UP((unsigned long long)(x), (n)) #define FIELD_SIZEOF(t, f) sizeof(((t *)0)->f) -#define printk(X...) printf(X) +#define printk(...) printf(__VA_ARGS__) +#define vprintk(f, a) vprintf(f, a) + +struct va_format { + const char *fmt; + va_list *va; +}; + +static inline int +vscnprintf(char *buf, size_t size, const char *fmt, va_list args) +{ + ssize_t ssize = size; + int i; + + i = vsnprintf(buf, size, fmt, args); + + return ((i >= ssize) ? (ssize - 1) : i); +} + +static inline int +scnprintf(char *buf, size_t size, const char *fmt, ...) +{ + va_list args; + int i; + + va_start(args, fmt); + i = vscnprintf(buf, size, fmt, args); + va_end(args); + + return (i); +} /* * The "pr_debug()" and "pr_devel()" macros should produce zero code From owner-svn-src-head@freebsd.org Mon May 23 12:41:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B412B45FB6; Mon, 23 May 2016 12:41:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 558C613A2; Mon, 23 May 2016 12:41:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NCfTEt022763; Mon, 23 May 2016 12:41:29 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NCfTHd022762; Mon, 23 May 2016 12:41:29 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201605231241.u4NCfTHd022762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 23 May 2016 12:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300501 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 12:41:30 -0000 Author: kp Date: Mon May 23 12:41:29 2016 New Revision: 300501 URL: https://svnweb.freebsd.org/changeset/base/300501 Log: pf: Fix ICMP translation Fix ICMP source address rewriting in rdr scenarios. PR: 201519 Submitted by: Max MFC after: 1 week Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon May 23 12:35:07 2016 (r300500) +++ head/sys/netpfil/pf/pf.c Mon May 23 12:41:29 2016 (r300501) @@ -4784,8 +4784,7 @@ pf_test_state_icmp(struct pf_state **sta &nk->addr[pd2.didx], pd2.af) || nk->port[pd2.didx] != th.th_dport) pf_change_icmp(pd2.dst, &th.th_dport, - NULL, /* XXX Inbound NAT? */ - &nk->addr[pd2.didx], + saddr, &nk->addr[pd2.didx], nk->port[pd2.didx], NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, pd2.af); @@ -4857,8 +4856,7 @@ pf_test_state_icmp(struct pf_state **sta &nk->addr[pd2.didx], pd2.af) || nk->port[pd2.didx] != uh.uh_dport) pf_change_icmp(pd2.dst, &uh.uh_dport, - NULL, /* XXX Inbound NAT? */ - &nk->addr[pd2.didx], + saddr, &nk->addr[pd2.didx], nk->port[pd2.didx], &uh.uh_sum, pd2.ip_sum, icmpsum, pd->ip_sum, 1, pd2.af); @@ -4925,8 +4923,7 @@ pf_test_state_icmp(struct pf_state **sta &nk->addr[pd2.didx], pd2.af) || nk->port[pd2.didx] != iih.icmp_id) pf_change_icmp(pd2.dst, &iih.icmp_id, - NULL, /* XXX Inbound NAT? */ - &nk->addr[pd2.didx], + saddr, &nk->addr[pd2.didx], nk->port[pd2.didx], NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET); @@ -4978,8 +4975,7 @@ pf_test_state_icmp(struct pf_state **sta &nk->addr[pd2.didx], pd2.af) || nk->port[pd2.didx] != iih.icmp6_id) pf_change_icmp(pd2.dst, &iih.icmp6_id, - NULL, /* XXX Inbound NAT? */ - &nk->addr[pd2.didx], + saddr, &nk->addr[pd2.didx], nk->port[pd2.didx], NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET6); @@ -5018,8 +5014,7 @@ pf_test_state_icmp(struct pf_state **sta if (PF_ANEQ(pd2.dst, &nk->addr[pd2.didx], pd2.af)) - pf_change_icmp(pd2.src, NULL, - NULL, /* XXX Inbound NAT? */ + pf_change_icmp(pd2.src, NULL, saddr, &nk->addr[pd2.didx], 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, pd2.af); From owner-svn-src-head@freebsd.org Mon May 23 12:52:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E96AB4645D; Mon, 23 May 2016 12:52:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3A4D1EF3; Mon, 23 May 2016 12:52:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NCqNOp026675; Mon, 23 May 2016 12:52:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NCqNae026674; Mon, 23 May 2016 12:52:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231252.u4NCqNae026674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 12:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300502 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 12:52:24 -0000 Author: hselasky Date: Mon May 23 12:52:22 2016 New Revision: 300502 URL: https://svnweb.freebsd.org/changeset/base/300502 Log: Define more copy to/from userspace functions in the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/uaccess.h Modified: head/sys/compat/linuxkpi/common/include/asm/uaccess.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/uaccess.h Mon May 23 12:41:29 2016 (r300501) +++ head/sys/compat/linuxkpi/common/include/asm/uaccess.h Mon May 23 12:52:22 2016 (r300502) @@ -40,6 +40,7 @@ copy_to_user(void *to, const void *from, return n; return 0; } +#define __copy_to_user(...) copy_to_user(__VA_ARGS__) static inline long copy_from_user(void *to, const void *from, unsigned long n) @@ -48,5 +49,7 @@ copy_from_user(void *to, const void *fro return n; return 0; } +#define __copy_from_user(...) copy_from_user(__VA_ARGS__) +#define __copy_in_user(...) copy_from_user(__VA_ARGS__) #endif /* _ASM_UACCESS_H_ */ From owner-svn-src-head@freebsd.org Mon May 23 12:53:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CDBBB464DF; Mon, 23 May 2016 12:53:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F042C10C0; Mon, 23 May 2016 12:53:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NCrIFc026748; Mon, 23 May 2016 12:53:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NCrIdI026747; Mon, 23 May 2016 12:53:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231253.u4NCrIdI026747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 12:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300503 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 12:53:19 -0000 Author: hselasky Date: Mon May 23 12:53:17 2016 New Revision: 300503 URL: https://svnweb.freebsd.org/changeset/base/300503 Log: Implement ror32() in the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 23 12:52:22 2016 (r300502) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 23 12:53:17 2016 (r300503) @@ -73,6 +73,12 @@ __flsl(long mask) return (flsl(mask) - 1); } +static inline uint32_t +ror32(uint32_t word, unsigned int shift) +{ + + return ((word >> shift) | (word << (32 - shift))); +} #define ffz(mask) __ffs(~(mask)) From owner-svn-src-head@freebsd.org Mon May 23 12:58:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1996B46663; Mon, 23 May 2016 12:58:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81E43141E; Mon, 23 May 2016 12:58:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NCwO4F026967; Mon, 23 May 2016 12:58:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NCwOFd026966; Mon, 23 May 2016 12:58:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605231258.u4NCwOFd026966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 23 May 2016 12:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300504 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 12:58:25 -0000 Author: trasz Date: Mon May 23 12:58:24 2016 New Revision: 300504 URL: https://svnweb.freebsd.org/changeset/base/300504 Log: Build iscsid(8) with ICL_KERNEL_PROXY defined by default, as required for iSER. Obtained from: Mellanox Technologies MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/iscsid/Makefile Modified: head/usr.sbin/iscsid/Makefile ============================================================================== --- head/usr.sbin/iscsid/Makefile Mon May 23 12:53:17 2016 (r300503) +++ head/usr.sbin/iscsid/Makefile Mon May 23 12:58:24 2016 (r300504) @@ -6,7 +6,7 @@ SRCS= chap.c discovery.c iscsid.c keys. CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.CURDIR}/../../sys/cam CFLAGS+= -I${.CURDIR}/../../sys/dev/iscsi -#CFLAGS+= -DICL_KERNEL_PROXY +CFLAGS+= -DICL_KERNEL_PROXY MAN= iscsid.8 LIBADD= md util From owner-svn-src-head@freebsd.org Mon May 23 13:17:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DE85B46BC0; Mon, 23 May 2016 13:17:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E446E1EE1; Mon, 23 May 2016 13:17:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NDHcJv033019; Mon, 23 May 2016 13:17:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NDHchV033018; Mon, 23 May 2016 13:17:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605231317.u4NDHchV033018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 23 May 2016 13:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300505 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 13:17:39 -0000 Author: arybchik Date: Mon May 23 13:17:37 2016 New Revision: 300505 URL: https://svnweb.freebsd.org/changeset/base/300505 Log: sfxge(4): cleanup: remove unused EFX preempt macros The EFSYS_PREEMPT_DISABLE() and EFSYS_PREEMPT_ENABLE() macros were used to ensure correct timing of I2C operations. The APIs for I2C operations have been removed, so these macros have no callers. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efsys.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Mon May 23 12:58:24 2016 (r300504) +++ head/sys/dev/sfxge/common/efsys.h Mon May 23 13:17:37 2016 (r300505) @@ -1110,22 +1110,6 @@ typedef struct efsys_lock_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) -/* PREEMPT */ - -#define EFSYS_PREEMPT_DISABLE(_state) \ - do { \ - (_state) = (_state); \ - critical_enter(); \ - _NOTE(CONSTANTCONDITION) \ - } while (B_FALSE) - -#define EFSYS_PREEMPT_ENABLE(_state) \ - do { \ - (_state) = (_state); \ - critical_exit(_state); \ - _NOTE(CONSTANTCONDITION) \ - } while (B_FALSE) - /* STAT */ typedef uint64_t efsys_stat_t; From owner-svn-src-head@freebsd.org Mon May 23 13:18:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B821B46C3D; Mon, 23 May 2016 13:18:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 363851083; Mon, 23 May 2016 13:18:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NDIFfe033088; Mon, 23 May 2016 13:18:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NDIFsO033087; Mon, 23 May 2016 13:18:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231318.u4NDIFsO033087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 13:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300506 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 13:18:16 -0000 Author: hselasky Date: Mon May 23 13:18:15 2016 New Revision: 300506 URL: https://svnweb.freebsd.org/changeset/base/300506 Log: Fix some data types and add "inline" keyword for __reg_op() function. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 23 13:17:37 2016 (r300505) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 23 13:18:15 2016 (r300506) @@ -93,7 +93,7 @@ static inline int get_count_order(unsign } static inline unsigned long -find_first_bit(unsigned long *addr, unsigned long size) +find_first_bit(const unsigned long *addr, unsigned long size) { long mask; int bit; @@ -115,7 +115,7 @@ find_first_bit(unsigned long *addr, unsi } static inline unsigned long -find_first_zero_bit(unsigned long *addr, unsigned long size) +find_first_zero_bit(const unsigned long *addr, unsigned long size) { long mask; int bit; @@ -137,7 +137,7 @@ find_first_zero_bit(unsigned long *addr, } static inline unsigned long -find_last_bit(unsigned long *addr, unsigned long size) +find_last_bit(const unsigned long *addr, unsigned long size) { long mask; int offs; @@ -163,7 +163,7 @@ find_last_bit(unsigned long *addr, unsig } static inline unsigned long -find_next_bit(unsigned long *addr, unsigned long size, unsigned long offset) +find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset) { long mask; int offs; @@ -202,7 +202,7 @@ find_next_bit(unsigned long *addr, unsig } static inline unsigned long -find_next_zero_bit(unsigned long *addr, unsigned long size, +find_next_zero_bit(const unsigned long *addr, unsigned long size, unsigned long offset) { long mask; @@ -306,23 +306,23 @@ bitmap_empty(unsigned long *addr, int si } #define __set_bit(i, a) \ - atomic_set_long(&((volatile long *)(a))[BIT_WORD(i)], BIT_MASK(i)) + atomic_set_long(&((volatile unsigned long *)(a))[BIT_WORD(i)], BIT_MASK(i)) #define set_bit(i, a) \ - atomic_set_long(&((volatile long *)(a))[BIT_WORD(i)], BIT_MASK(i)) + atomic_set_long(&((volatile unsigned long *)(a))[BIT_WORD(i)], BIT_MASK(i)) #define __clear_bit(i, a) \ - atomic_clear_long(&((volatile long *)(a))[BIT_WORD(i)], BIT_MASK(i)) + atomic_clear_long(&((volatile unsigned long *)(a))[BIT_WORD(i)], BIT_MASK(i)) #define clear_bit(i, a) \ - atomic_clear_long(&((volatile long *)(a))[BIT_WORD(i)], BIT_MASK(i)) + atomic_clear_long(&((volatile unsigned long *)(a))[BIT_WORD(i)], BIT_MASK(i)) #define test_bit(i, a) \ - !!(atomic_load_acq_long(&((volatile long *)(a))[BIT_WORD(i)]) & \ + !!(atomic_load_acq_long(&((volatile unsigned long *)(a))[BIT_WORD(i)]) & \ BIT_MASK(i)) -static inline long -test_and_clear_bit(long bit, long *var) +static inline int +test_and_clear_bit(long bit, volatile unsigned long *var) { long val; @@ -330,14 +330,14 @@ test_and_clear_bit(long bit, long *var) bit %= BITS_PER_LONG; bit = (1UL << bit); do { - val = *(volatile long *)var; + val = *var; } while (atomic_cmpset_long(var, val, val & ~bit) == 0); return !!(val & bit); } -static inline long -test_and_set_bit(long bit, long *var) +static inline int +test_and_set_bit(long bit, volatile unsigned long *var) { long val; @@ -345,7 +345,7 @@ test_and_set_bit(long bit, long *var) bit %= BITS_PER_LONG; bit = (1UL << bit); do { - val = *(volatile long *)var; + val = *var; } while (atomic_cmpset_long(var, val, val | bit) == 0); return !!(val & bit); @@ -399,7 +399,8 @@ enum { REG_OP_RELEASE, }; -static int __reg_op(unsigned long *bitmap, int pos, int order, int reg_op) +static inline int +__reg_op(unsigned long *bitmap, int pos, int order, int reg_op) { int nbits_reg; int index; From owner-svn-src-head@freebsd.org Mon May 23 13:19:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96B5CB46CA8; Mon, 23 May 2016 13:19:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 675D31212; Mon, 23 May 2016 13:19:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NDJKBV033166; Mon, 23 May 2016 13:19:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NDJKst033165; Mon, 23 May 2016 13:19:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231319.u4NDJKst033165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 13:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300507 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 13:19:21 -0000 Author: hselasky Date: Mon May 23 13:19:20 2016 New Revision: 300507 URL: https://svnweb.freebsd.org/changeset/base/300507 Log: A missing definition needed by ktime_to_ms(). Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/time.h Modified: head/sys/compat/linuxkpi/common/include/linux/time.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/time.h Mon May 23 13:18:15 2016 (r300506) +++ head/sys/compat/linuxkpi/common/include/linux/time.h Mon May 23 13:19:20 2016 (r300507) @@ -29,6 +29,7 @@ #define _LINUX_TIME_H_ #define NSEC_PER_USEC 1000L +#define NSEC_PER_MSEC 1000000L #define NSEC_PER_SEC 1000000000L #include From owner-svn-src-head@freebsd.org Mon May 23 13:59:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0059AB468DC; Mon, 23 May 2016 13:59:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB0551A7B; Mon, 23 May 2016 13:59:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NDxmxP045632; Mon, 23 May 2016 13:59:48 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NDxmaU045631; Mon, 23 May 2016 13:59:48 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201605231359.u4NDxmaU045631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 23 May 2016 13:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300508 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 13:59:50 -0000 Author: kp Date: Mon May 23 13:59:48 2016 New Revision: 300508 URL: https://svnweb.freebsd.org/changeset/base/300508 Log: pf: Fix more ICMP mistranslation In the default case fix the substitution of the destination address. PR: 201519 Submitted by: Max MFC after: 1 week Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon May 23 13:19:20 2016 (r300507) +++ head/sys/netpfil/pf/pf.c Mon May 23 13:59:48 2016 (r300508) @@ -5014,7 +5014,7 @@ pf_test_state_icmp(struct pf_state **sta if (PF_ANEQ(pd2.dst, &nk->addr[pd2.didx], pd2.af)) - pf_change_icmp(pd2.src, NULL, saddr, + pf_change_icmp(pd2.dst, NULL, saddr, &nk->addr[pd2.didx], 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, pd2.af); From owner-svn-src-head@freebsd.org Mon May 23 15:11:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E87BB47965; Mon, 23 May 2016 15:11:02 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F81111C9; Mon, 23 May 2016 15:11:02 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NFB1kI068765; Mon, 23 May 2016 15:11:01 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NFB1l9068764; Mon, 23 May 2016 15:11:01 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605231511.u4NFB1l9068764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 23 May 2016 15:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300509 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 15:11:02 -0000 Author: allanjude Date: Mon May 23 15:11:01 2016 New Revision: 300509 URL: https://svnweb.freebsd.org/changeset/base/300509 Log: Fix error in bsdinstall where additional filesystems cannot be mounted Do not set canmount=noauto on the boot environment at create time, because this causes / to not be mounted, and since the chroot is read only, new mountpoints cannot be created. The property is set later, when other properties are adjusted Reported by: HardenedBSD Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon May 23 13:59:48 2016 (r300508) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon May 23 15:11:01 2016 (r300509) @@ -143,7 +143,7 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA # Boot Environment [BE] root and default boot dataset /$ZFSBOOT_BEROOT_NAME mountpoint=none - /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME mountpoint=/,canmount=noauto + /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME mountpoint=/ # Compress /tmp, allow exec but not setuid /tmp mountpoint=/tmp,exec=on,setuid=off @@ -1310,6 +1310,10 @@ zfs_create_boot() "mountpoint=/$zroot_name" "$zroot_name" || return $FAILURE + f_dprintf "$funcname: Set canmount=noauto for the root of the pool..." + f_eval_catch $funcname zfs "$ZFS_SET" "canmount=noauto" \ + "$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" + # Touch up permissions on the tmp directories f_dprintf "$funcname: Modifying directory permissions..." local dir From owner-svn-src-head@freebsd.org Mon May 23 15:26:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2109BB47037; Mon, 23 May 2016 15:26:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DED691082; Mon, 23 May 2016 15:26:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NFQZo0072659; Mon, 23 May 2016 15:26:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NFQZH1072658; Mon, 23 May 2016 15:26:35 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605231526.u4NFQZH1072658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 23 May 2016 15:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300510 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 15:26:37 -0000 Author: andrew Date: Mon May 23 15:26:35 2016 New Revision: 300510 URL: https://svnweb.freebsd.org/changeset/base/300510 Log: Add the needed hwpmc hooks to subr_intr.c. This is needed for the correct operation of hwpmc on, for example, arm64 with intrng. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/subr_intr.c Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Mon May 23 15:11:01 2016 (r300509) +++ head/sys/kern/subr_intr.c Mon May 23 15:26:35 2016 (r300510) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" #include "opt_ddb.h" +#include "opt_hwpmc_hooks.h" #include "opt_platform.h" #include @@ -53,6 +54,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef HWPMC_HOOKS +#include +#endif + #include #include #include @@ -311,6 +316,10 @@ intr_irq_handler(struct trapframe *tf) irq_root_filter(irq_root_arg); td->td_intr_frame = oldframe; critical_exit(); +#ifdef HWPMC_HOOKS + if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) + pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, tf); +#endif } /* From owner-svn-src-head@freebsd.org Mon May 23 15:27:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7D48B47112; Mon, 23 May 2016 15:27:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1E8912A3; Mon, 23 May 2016 15:27:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ig0-x22b.google.com with SMTP id bi2so35538217igb.0; Mon, 23 May 2016 08:27:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8HUi/Krffc5+KNutmRGQwQZZAOgj0XdsyYq3ZMxTfhU=; b=NEr+5FJ+zZzvTdKiJGoIVb9C5Vm3EyLXjz7tTrdDon3ouQfxu9klEX9djCvxczbdOc 94raYj29ioWtyhLCfXuZvQF/0SThWyI/VIxfxYpdjycBhBugR+7JsfJnwKsDF/N3AUq8 ZYlSICPd9O+Mk46c/mrXc6jfgL7TQLKq6thrNL2ckW84wd63zu3QEpFiuCw9FINsJj8I mybCev1GpuZLUI9sQPjcIHoliVkuvOlDcSSq40Q2qSF1weibWcdtPgN0PRNENn1wsB00 w5DtJTZ2FqLCyDd7MEMse2XabDxa1w1cvXda8Gl8kT6LMgorE1LKcTwIBODis6dGw9rT xosQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8HUi/Krffc5+KNutmRGQwQZZAOgj0XdsyYq3ZMxTfhU=; b=OdqWltCBjfuzQcyLD1zy55qj3rd0aAJbfS45fufXAedf/S4r+oNYtB7sHrSxd78LTo qB6zIemVY756BI/GoFG6USze25hFEkOgQMOcjPYxCPG8Ourc7WM2mo1XckQtLRE2lGkV PT64cwoXVWgjjBoK9gkgUP7CffsZhWYHJiVBkka0rvuwVlgKYjByk3Yz2bbpfugCLrtM 1p96G1yVQLJskUjWJTsdhimmPH7+IJB1yq0wtB3GGR68AvSsC/EPpKnlPs4KbNycIeIJ 0fuonHl04XBTSDitYnio4I+nkAIdoe3vk3GlkkpGvTbpiC6GddmRjY5xIm+Evko71Oeq lEIg== X-Gm-Message-State: AOPr4FWII/6XplF/hOIGKrQsPpagOHRJ87HMLQs4l3tko+FfnlP/d0hLp9Hib8vCEepsOg== X-Received: by 10.50.79.130 with SMTP id j2mr13585976igx.89.1464017241008; Mon, 23 May 2016 08:27:21 -0700 (PDT) Received: from [192.168.20.14] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id w25sm653033ioi.1.2016.05.23.08.27.19 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 May 2016 08:27:19 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r300491 - head/sys/compat/linuxkpi/common/include/asm From: Ngie Cooper X-Mailer: iPhone Mail (13F69) In-Reply-To: <201605231144.u4NBikhD004954@repo.freebsd.org> Date: Mon, 23 May 2016 08:27:18 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0B789C60-3EF9-4553-BD19-3245B451FB0A@gmail.com> References: <201605231144.u4NBikhD004954@repo.freebsd.org> To: Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 15:27:21 -0000 > On May 23, 2016, at 04:44, Hans Petter Selasky wrot= e: >=20 > Author: hselasky > Date: Mon May 23 11:44:46 2016 > New Revision: 300491 > URL: https://svnweb.freebsd.org/changeset/base/300491 >=20 > Log: > Add support for atomic_long_inc_not_zero() to the LinuxKPI. >=20 > Obtained from: kmacy @ > MFC after: 1 week > Sponsored by: Mellanox Technologies >=20 > Modified: > head/sys/compat/linuxkpi/common/include/asm/atomic-long.h >=20 > Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.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/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 2= 3 11:41:35 2016 (r300490) > +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 2= 3 11:44:46 2016 (r300491) > @@ -41,6 +41,7 @@ typedef struct { >=20 > #define atomic_long_add(i, v) atomic_long_add_return((i), (v)) > #define atomic_long_inc_return(v) atomic_long_add_return(1, (v)) > +#define atomic_long_inc_not_zero(v) atomic_long_inc_not_zero(v) The same function name is used twice..? This seems a bit odd... > static inline long > atomic_long_add_return(long i, atomic_long_t *v) >=20 From owner-svn-src-head@freebsd.org Mon May 23 15:31:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87A80B472F1; Mon, 23 May 2016 15:31:50 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from webmail2.jnielsen.NET (webmail2.jnielsen.net [50.114.224.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "webmail2.jnielsen.net", Issuer "freebsdsolutions.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D6691A1E; Mon, 23 May 2016 15:31:50 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from [192.168.2.210] (c-73-65-219-132.hsd1.ut.comcast.net [73.65.219.132]) (authenticated bits=0) by webmail2.jnielsen.NET (8.15.2/8.15.2) with ESMTPSA id u4NFVkRN081358 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 May 2016 09:31:49 -0600 (MDT) (envelope-from lists@jnielsen.net) X-Authentication-Warning: webmail2.jnielsen.NET: Host c-73-65-219-132.hsd1.ut.comcast.net [73.65.219.132] claimed to be [192.168.2.210] Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300418 - head/sys/kern From: John Nielsen In-Reply-To: <2A5AB488-4FA5-4262-A7BA-BFF391A4B03A@jnielsen.net> Date: Mon, 23 May 2016 09:31:45 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3102F837-63C4-4B97-BC78-9DD114228C18@jnielsen.net> References: <201605221304.u4MD4j6H082492@repo.freebsd.org> <2A5AB488-4FA5-4262-A7BA-BFF391A4B03A@jnielsen.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 15:31:50 -0000 > On May 23, 2016, at 9:20 AM, John Nielsen wrote: >=20 >> On May 22, 2016, at 7:04 AM, Baptiste Daroussin = wrote: >>=20 >> - * of date. We could have received a reset packet in an = interrupt or >> + * of date. We could have recived a reset packet in an = interrupt or >=20 > Not sure if there's another error in this line that I'm not seeing but = "received" was spelled right to begin with and is now incorrect. Oops, already fixed in a subsequent commit. Thanks and sorry for the = noise. JN From owner-svn-src-head@freebsd.org Mon May 23 15:33:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE0FCB4742B; Mon, 23 May 2016 15:33:57 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AFE71C7F; Mon, 23 May 2016 15:33:57 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NFXuVh075564; Mon, 23 May 2016 15:33:56 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NFXuwx075563; Mon, 23 May 2016 15:33:56 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201605231533.u4NFXuwx075563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Mon, 23 May 2016 15:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300511 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 15:33:57 -0000 Author: skreuzer (doc,ports committer) Date: Mon May 23 15:33:56 2016 New Revision: 300511 URL: https://svnweb.freebsd.org/changeset/base/300511 Log: Document r298192, file(1) updated to 5.26. Approved by: gjb@ (implicit with re@ hat on) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 23 15:26:35 2016 (r300510) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 23 15:33:56 2016 (r300511) @@ -579,8 +579,8 @@ &man.jemalloc.3; has been updated to version 4.0.2. - The &man.file.1; utility has been - updated to version 5.25. + The &man.file.1; utility has been + updated to version 5.26. The &man.nc.1; utility has been updated to the OpenBSD 5.8 version. From owner-svn-src-head@freebsd.org Mon May 23 15:37:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06011B474E7; Mon, 23 May 2016 15:37:14 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA1851F11; Mon, 23 May 2016 15:37:13 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NFbCDN075840; Mon, 23 May 2016 15:37:12 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NFbCFO075839; Mon, 23 May 2016 15:37:12 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201605231537.u4NFbCFO075839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Mon, 23 May 2016 15:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300512 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 15:37:14 -0000 Author: skreuzer (doc,ports committer) Date: Mon May 23 15:37:12 2016 New Revision: 300512 URL: https://svnweb.freebsd.org/changeset/base/300512 Log: Document r298161, sqlite3 updated to 3.12.1. Approved by: gjb@ (implicit with re@ hat on) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 23 15:33:56 2016 (r300511) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 23 15:37:12 2016 (r300512) @@ -563,9 +563,9 @@ The &man.svnlite.1; utility has been updated to version 1.8.14. - The sqlite3 + The sqlite3 library used by &man.svnlite.1; and &man.kerberos.8; has been - updated to version 3.8.11.1. + updated to version 3.12.1. Timezone data files have been updated to version 2015f. From owner-svn-src-head@freebsd.org Mon May 23 15:39:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7259AB475FD; Mon, 23 May 2016 15:39:16 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from webmail2.jnielsen.NET (webmail2.jnielsen.net [50.114.224.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "webmail2.jnielsen.net", Issuer "freebsdsolutions.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A08711AF; Mon, 23 May 2016 15:39:16 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from [192.168.2.210] (c-73-65-219-132.hsd1.ut.comcast.net [73.65.219.132]) (authenticated bits=0) by webmail2.jnielsen.NET (8.15.2/8.15.2) with ESMTPSA id u4NFKXtc070061 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 May 2016 09:20:36 -0600 (MDT) (envelope-from lists@jnielsen.net) X-Authentication-Warning: webmail2.jnielsen.NET: Host c-73-65-219-132.hsd1.ut.comcast.net [73.65.219.132] claimed to be [192.168.2.210] Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300418 - head/sys/kern From: John Nielsen In-Reply-To: <201605221304.u4MD4j6H082492@repo.freebsd.org> Date: Mon, 23 May 2016 09:20:32 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2A5AB488-4FA5-4262-A7BA-BFF391A4B03A@jnielsen.net> References: <201605221304.u4MD4j6H082492@repo.freebsd.org> To: Baptiste Daroussin X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 15:39:16 -0000 > On May 22, 2016, at 7:04 AM, Baptiste Daroussin = wrote: >=20 > - * of date. We could have received a reset packet in an = interrupt or > + * of date. We could have recived a reset packet in an = interrupt or Not sure if there's another error in this line that I'm not seeing but = "received" was spelled right to begin with and is now incorrect. JN From owner-svn-src-head@freebsd.org Mon May 23 15:44:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 073C1B47760; Mon, 23 May 2016 15:44:41 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDBCD1717; Mon, 23 May 2016 15:44:40 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NFieMQ078718; Mon, 23 May 2016 15:44:40 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NFieAs078717; Mon, 23 May 2016 15:44:40 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201605231544.u4NFieAs078717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Mon, 23 May 2016 15:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300513 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 15:44:41 -0000 Author: skreuzer (doc,ports committer) Date: Mon May 23 15:44:39 2016 New Revision: 300513 URL: https://svnweb.freebsd.org/changeset/base/300513 Log: Document r296190, openresolv updated to 3.7.3. Approved by: gjb@ (implicit with re@ hat on) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 23 15:37:12 2016 (r300512) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 23 15:44:39 2016 (r300513) @@ -514,9 +514,9 @@ &man.hostapd.8; utilities have been updated to version 2.4. - The + The &man.resolvconf.8; utility has been updated to version - 3.7.0. + 3.7.3. bmake has been updated to version 20150606. From owner-svn-src-head@freebsd.org Mon May 23 16:04:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42679B47D5E; Mon, 23 May 2016 16:04:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 32FD1167F; Mon, 23 May 2016 16:04:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 2BE141B7F; Mon, 23 May 2016 16:04:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id C29091C2DE; Mon, 23 May 2016 16:04:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id AlnCew9cSU2P; Mon, 23 May 2016 16:04:51 +0000 (UTC) Subject: Re: svn commit: r300348 - head DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 230601C2D4 To: Andrew Turner References: <201605210132.u4L1W43X033151@repo.freebsd.org> <20160523113400.349b8bdc@zapp> <20160523120134.7d4c127d@zapp> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: <199286da-0b3f-cf0e-cc12-48bdf1910af4@FreeBSD.org> Date: Mon, 23 May 2016 09:04:48 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160523120134.7d4c127d@zapp> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 16:04:59 -0000 On 5/23/16 4:01 AM, Andrew Turner wrote: > On Mon, 23 May 2016 11:34:00 +0100 > Andrew Turner wrote: > >> On Sat, 21 May 2016 01:32:04 +0000 (UTC) >> Bryan Drewery wrote: >> >>> Author: bdrewery >>> Date: Sat May 21 01:32:04 2016 >>> New Revision: 300348 >>> URL: https://svnweb.freebsd.org/changeset/base/300348 >>> >>> Log: >>> Move external toolchain support earlier. >>> >>> This is to consolidate external toolchain and >>> WITHOUT_CROSS_COMPILER support. >>> Reviewed by: brooks, bapt >>> Sponsored by: EMC / Isilon Storage Division >>> Differential Revision: https://reviews.freebsd.org/D6353 >>> >> >> This seems to have broken the arm64 build. My guess is the wrong >> linker is being used, but I haven't looked into the issue too far. > > The issue is you moved a block that depends on BROKEN_OPTIONS being > defined to before the point we include share/mk/src.opts.mk, the place > it is defined. > Looking at it now. -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Mon May 23 16:19:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2A18B460CD; Mon, 23 May 2016 16:19:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF9F8105C; Mon, 23 May 2016 16:19:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NGJpcC088310; Mon, 23 May 2016 16:19:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NGJpki088309; Mon, 23 May 2016 16:19:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605231619.u4NGJpki088309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 23 May 2016 16:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300517 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 16:19:53 -0000 Author: hselasky Date: Mon May 23 16:19:51 2016 New Revision: 300517 URL: https://svnweb.freebsd.org/changeset/base/300517 Log: Implement "atomic_long_add_unless()" in the LinuxKPI and fix the implementation of "atomic_long_inc_not_zero()". Found by: ngie @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 23 16:12:11 2016 (r300516) +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 23 16:19:51 2016 (r300517) @@ -41,7 +41,7 @@ typedef struct { #define atomic_long_add(i, v) atomic_long_add_return((i), (v)) #define atomic_long_inc_return(v) atomic_long_add_return(1, (v)) -#define atomic_long_inc_not_zero(v) atomic_long_inc_not_zero(v) +#define atomic_long_inc_not_zero(v) atomic_long_add_unless((v), 1, 0) static inline long atomic_long_add_return(long i, atomic_long_t *v) @@ -73,6 +73,21 @@ atomic_long_dec(atomic_long_t *v) return atomic_fetchadd_long(&v->counter, -1) - 1; } +static inline int +atomic_long_add_unless(atomic_long_t *v, long a, long u) +{ + long c; + + for (;;) { + c = atomic_long_read(v); + if (unlikely(c == u)) + break; + if (likely(atomic_cmpset_long(&v->counter, c, c + a))) + break; + } + return (c != u); +} + static inline long atomic_long_dec_and_test(atomic_long_t *v) { From owner-svn-src-head@freebsd.org Mon May 23 16:21:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C19E2B46183; Mon, 23 May 2016 16:21:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A578136C; Mon, 23 May 2016 16:21:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 3B2911FE024; Mon, 23 May 2016 18:20:54 +0200 (CEST) Subject: Re: svn commit: r300491 - head/sys/compat/linuxkpi/common/include/asm To: Ngie Cooper References: <201605231144.u4NBikhD004954@repo.freebsd.org> <0B789C60-3EF9-4553-BD19-3245B451FB0A@gmail.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <9d6fc2d2-e748-4b94-b77d-4cd56e7bd9bf@selasky.org> Date: Mon, 23 May 2016 18:24:15 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <0B789C60-3EF9-4553-BD19-3245B451FB0A@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 16:21:02 -0000 On 05/23/16 17:27, Ngie Cooper wrote: > >> On May 23, 2016, at 04:44, Hans Petter Selasky wrote: >> >> Author: hselasky >> Date: Mon May 23 11:44:46 2016 >> New Revision: 300491 >> URL: https://svnweb.freebsd.org/changeset/base/300491 >> >> Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h >> ============================================================================== >> --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 23 11:41:35 2016 (r300490) >> +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 23 11:44:46 2016 (r300491) >> @@ -41,6 +41,7 @@ typedef struct { >> >> #define atomic_long_add(i, v) atomic_long_add_return((i), (v)) >> #define atomic_long_inc_return(v) atomic_long_add_return(1, (v)) >> +#define atomic_long_inc_not_zero(v) atomic_long_inc_not_zero(v) > > The same function name is used twice..? This seems a bit odd... > Yes, it is odd. Fixed by r300517. Thank you! --HPS From owner-svn-src-head@freebsd.org Mon May 23 16:24:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2FB0B463C8; Mon, 23 May 2016 16:24:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE0C51B15; Mon, 23 May 2016 16:24:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NGOYRu091388; Mon, 23 May 2016 16:24:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NGOYgT091387; Mon, 23 May 2016 16:24:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605231624.u4NGOYgT091387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 23 May 2016 16:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300519 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 16:24:35 -0000 Author: bdrewery Date: Mon May 23 16:24:34 2016 New Revision: 300519 URL: https://svnweb.freebsd.org/changeset/base/300519 Log: Move binutils handling after src.opts.mk. This fixes the arm64 build after r300348. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon May 23 16:20:50 2016 (r300518) +++ head/Makefile.inc1 Mon May 23 16:24:34 2016 (r300519) @@ -59,20 +59,6 @@ CROSSENV+=CROSS_TOOLCHAIN="${CROSS_TOOLC .endif .if defined(CROSS_TOOLCHAIN_PREFIX) CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} -CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} -.endif -# If we do not have a bootstrap binutils (because the in-tree one does not -# support the target architecture), provide a default cross-binutils prefix. -# This allows aarch64 builds, for example, to automatically use the -# aarch64-binutils port or package. -.if !make(showconfig) -.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ - !defined(CROSS_BINUTILS_PREFIX) -CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ -.if !exists(${CROSS_BINUTILS_PREFIX}) -.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. -.endif -.endif .endif XCOMPILERS= CC CXX CPP @@ -83,15 +69,6 @@ X${COMPILER}?= ${CROSS_COMPILER_PREFIX}$ X${COMPILER}?= ${${COMPILER}} .endif .endfor -XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS -.for BINUTIL in ${XBINUTILS} -.if defined(CROSS_BINUTILS_PREFIX) && \ - exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}}) -X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}} -.else -X${BINUTIL}?= ${${BINUTIL}} -.endif -.endfor # If a full path to an external cross compiler is given, don't build # a cross compiler. .if ${XCC:N${CCACHE_BIN}:M/*} @@ -151,6 +128,33 @@ CROSSENV+= COMPILER_VERSION=${COMPILER_V .endif # ${_expected_compiler_type} == ${COMPILER_TYPE} .endif # ${XCC:N${CCACHE_BIN}:M/*} +# Handle external binutils. +.if defined(CROSS_TOOLCHAIN_PREFIX) +CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} +.endif +# If we do not have a bootstrap binutils (because the in-tree one does not +# support the target architecture), provide a default cross-binutils prefix. +# This allows aarch64 builds, for example, to automatically use the +# aarch64-binutils port or package. +.if !make(showconfig) +.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ + !defined(CROSS_BINUTILS_PREFIX) +CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ +.if !exists(${CROSS_BINUTILS_PREFIX}) +.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. +.endif +.endif +.endif +XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS +.for BINUTIL in ${XBINUTILS} +.if defined(CROSS_BINUTILS_PREFIX) && \ + exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}}) +X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}} +.else +X${BINUTIL}?= ${${BINUTIL}} +.endif +.endfor + # We must do lib/ and libexec/ before bin/ in case of a mid-install error to # keep the users system reasonably usable. For static->dynamic root upgrades, From owner-svn-src-head@freebsd.org Mon May 23 16:25:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDECEB46426; Mon, 23 May 2016 16:25:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id BDF861CE1; Mon, 23 May 2016 16:25:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id B6DF81939; Mon, 23 May 2016 16:25:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 701531C3B5; Mon, 23 May 2016 16:25:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id cWeu5oo99lbe; Mon, 23 May 2016 16:25:06 +0000 (UTC) Subject: Re: svn commit: r300348 - head DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 874111C3AD To: Andrew Turner References: <201605210132.u4L1W43X033151@repo.freebsd.org> <20160523113400.349b8bdc@zapp> <20160523120134.7d4c127d@zapp> <199286da-0b3f-cf0e-cc12-48bdf1910af4@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: <6f29d844-50df-3f62-e8fd-f467a2c61922@FreeBSD.org> Date: Mon, 23 May 2016 09:25:05 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <199286da-0b3f-cf0e-cc12-48bdf1910af4@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 16:25:09 -0000 On 5/23/16 9:04 AM, Bryan Drewery wrote: > On 5/23/16 4:01 AM, Andrew Turner wrote: >> On Mon, 23 May 2016 11:34:00 +0100 >> Andrew Turner wrote: >> >>> On Sat, 21 May 2016 01:32:04 +0000 (UTC) >>> Bryan Drewery wrote: >>> >>>> Author: bdrewery >>>> Date: Sat May 21 01:32:04 2016 >>>> New Revision: 300348 >>>> URL: https://svnweb.freebsd.org/changeset/base/300348 >>>> >>>> Log: >>>> Move external toolchain support earlier. >>>> >>>> This is to consolidate external toolchain and >>>> WITHOUT_CROSS_COMPILER support. >>>> Reviewed by: brooks, bapt >>>> Sponsored by: EMC / Isilon Storage Division >>>> Differential Revision: https://reviews.freebsd.org/D6353 >>>> >>> >>> This seems to have broken the arm64 build. My guess is the wrong >>> linker is being used, but I haven't looked into the issue too far. >> >> The issue is you moved a block that depends on BROKEN_OPTIONS being >> defined to before the point we include share/mk/src.opts.mk, the place >> it is defined. >> > > Looking at it now. > > Fixed in r300519. Sorry about that. I've installed the aarch64-binutils now to be sure I'm testing it as well. -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Mon May 23 16:49:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C58BDB476DF; Mon, 23 May 2016 16:49:27 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 953811152; Mon, 23 May 2016 16:49:27 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NGnQOH098119; Mon, 23 May 2016 16:49:26 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NGnQaZ098118; Mon, 23 May 2016 16:49:26 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605231649.u4NGnQaZ098118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 23 May 2016 16:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300521 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 16:49:27 -0000 Author: allanjude Date: Mon May 23 16:49:26 2016 New Revision: 300521 URL: https://svnweb.freebsd.org/changeset/base/300521 Log: Fix missing pool name in zfs set command Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon May 23 16:37:04 2016 (r300520) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon May 23 16:49:26 2016 (r300521) @@ -1312,7 +1312,7 @@ zfs_create_boot() f_dprintf "$funcname: Set canmount=noauto for the root of the pool..." f_eval_catch $funcname zfs "$ZFS_SET" "canmount=noauto" \ - "$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" + "$zroot_name/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" # Touch up permissions on the tmp directories f_dprintf "$funcname: Modifying directory permissions..." From owner-svn-src-head@freebsd.org Mon May 23 16:59:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8209DB478DC; Mon, 23 May 2016 16:59:06 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 397E91715; Mon, 23 May 2016 16:59:06 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NGx5lN001177; Mon, 23 May 2016 16:59:05 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NGx5jU001176; Mon, 23 May 2016 16:59:05 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201605231659.u4NGx5jU001176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 23 May 2016 16:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300522 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 16:59:06 -0000 Author: alc Date: Mon May 23 16:59:05 2016 New Revision: 300522 URL: https://svnweb.freebsd.org/changeset/base/300522 Log: Correct an error in a comment: One of the conditions for page allocation is actually the opposite of that stated in the comment. Remove an unnecessary assignment. Use an assertion to document the fact that no assignment is needed. Rewrite another comment to clarify that the page is not completely valid. Reviewed by: kib Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon May 23 16:49:26 2016 (r300521) +++ head/sys/vm/vm_fault.c Mon May 23 16:59:05 2016 (r300522) @@ -496,11 +496,13 @@ fast_failed: goto readrest; break; } + KASSERT(fs.m == NULL, ("fs.m should be NULL, not %p", fs.m)); /* - * Page is not resident. If this is the search termination - * or the pager might contain the page, allocate a new page. - * Default objects are zero-fill, there is no real pager. + * Page is not resident. If the pager might contain the page + * or this is the beginning of the search, allocate a new + * page. (Default objects are zero-fill, so there is no real + * pager for them.) */ if (fs.object->type != OBJT_DEFAULT || fs.object == fs.first_object) { @@ -517,7 +519,6 @@ fast_failed: * there, and allocation can fail, causing * restart and new reading of the p_flag. */ - fs.m = NULL; if (!vm_page_count_severe() || P_KILLED(curproc)) { #if VM_NRESERVLEVEL > 0 vm_object_color(fs.object, atop(vaddr) - @@ -541,14 +542,12 @@ fast_failed: readrest: /* - * We have found a valid page or we have allocated a new page. - * The page thus may not be valid or may not be entirely - * valid. + * We have either allocated a new page or found an existing + * page that is only partially valid. * * Attempt to fault-in the page if there is a chance that the * pager has it, and potentially fault in additional pages - * at the same time. For default objects simply provide - * zero-filled pages. + * at the same time. */ if (fs.object->type != OBJT_DEFAULT) { int rv; From owner-svn-src-head@freebsd.org Mon May 23 17:04:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D28BB47B19; Mon, 23 May 2016 17:04:15 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBD1F1BBE; Mon, 23 May 2016 17:04:14 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NH4ETW004311; Mon, 23 May 2016 17:04:14 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NH4Etf004310; Mon, 23 May 2016 17:04:14 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605231704.u4NH4Etf004310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 23 May 2016 17:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300523 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 17:04:15 -0000 Author: allanjude Date: Mon May 23 17:04:13 2016 New Revision: 300523 URL: https://svnweb.freebsd.org/changeset/base/300523 Log: Only export and re-import the root pool if installing on MBR This step is required in order to dd the boot2 bits into the ZFS partition Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon May 23 16:59:05 2016 (r300522) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon May 23 17:04:13 2016 (r300523) @@ -1310,10 +1310,6 @@ zfs_create_boot() "mountpoint=/$zroot_name" "$zroot_name" || return $FAILURE - f_dprintf "$funcname: Set canmount=noauto for the root of the pool..." - f_eval_catch $funcname zfs "$ZFS_SET" "canmount=noauto" \ - "$zroot_name/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" - # Touch up permissions on the tmp directories f_dprintf "$funcname: Modifying directory permissions..." local dir @@ -1338,17 +1334,17 @@ zfs_create_boot() "bootfs=\"$zroot_name/$zroot_bootfs\"" "$zroot_name" || return $FAILURE - # Export the pool(s) - f_dprintf "$funcname: Temporarily exporting ZFS pool(s)..." - f_eval_catch $funcname zpool "$ZPOOL_EXPORT" "$zroot_name" || - return $FAILURE - if [ "$ZFSBOOT_BOOT_POOL" ]; then - f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \ - "$bootpool_name" || return $FAILURE - fi - # MBR boot loader touch-up if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then + # Export the pool(s) + f_dprintf "$funcname: Temporarily exporting ZFS pool(s)..." + f_eval_catch $funcname zpool "$ZPOOL_EXPORT" "$zroot_name" || + return $FAILURE + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \ + "$bootpool_name" || return $FAILURE + fi + f_dprintf "$funcname: Updating MBR boot loader on disks..." # Stick the ZFS boot loader in the "convenient hole" after # the ZFS internal metadata @@ -1357,17 +1353,17 @@ zfs_create_boot() /boot/zfsboot /dev/$disk$bootpart \ "skip=1 seek=1024" || return $FAILURE done - fi - # Re-import the ZFS pool(s) - f_dprintf "$funcname: Re-importing ZFS pool(s)..." - f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"$BSDINSTALL_CHROOT\"" "$zroot_name" || - return $FAILURE - if [ "$ZFSBOOT_BOOT_POOL" ]; then + # Re-import the ZFS pool(s) + f_dprintf "$funcname: Re-importing ZFS pool(s)..." f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"$BSDINSTALL_CHROOT\"" \ - "$bootpool_name" || return $FAILURE + "-o altroot=\"$BSDINSTALL_CHROOT\"" "$zroot_name" || + return $FAILURE + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ + "-o altroot=\"$BSDINSTALL_CHROOT\"" \ + "$bootpool_name" || return $FAILURE + fi fi # While this is apparently not needed, it seems to help MBR @@ -1378,6 +1374,14 @@ zfs_create_boot() "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ "$zroot_name" || return $FAILURE + # + # Set canmount=noauto so that the default Boot Environment (BE) does not + # get mounted if a different BE is selected from the beastie menu + # + f_dprintf "$funcname: Set canmount=noauto for the root of the pool..." + f_eval_catch $funcname zfs "$ZFS_SET" "canmount=noauto" \ + "$zroot_name/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" + # Last, but not least... required lines for rc.conf(5)/loader.conf(5) # NOTE: We later concatenate these into their destination f_dprintf "%s: Configuring rc.conf(5)/loader.conf(5) additions..." \ From owner-svn-src-head@freebsd.org Mon May 23 17:06:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A4CAB47BB9; Mon, 23 May 2016 17:06:47 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 371951D8F; Mon, 23 May 2016 17:06:47 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NH6kkc004448; Mon, 23 May 2016 17:06:46 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NH6kFC004447; Mon, 23 May 2016 17:06:46 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201605231706.u4NH6kFC004447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Mon, 23 May 2016 17:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300524 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 17:06:47 -0000 Author: skreuzer (doc,ports committer) Date: Mon May 23 17:06:46 2016 New Revision: 300524 URL: https://svnweb.freebsd.org/changeset/base/300524 Log: Document r298998, OpenSSL updated to 1.0.2h. Approved by: gjb@ (implicit with re@ hat on) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 23 17:04:13 2016 (r300523) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 23 17:06:46 2016 (r300524) @@ -540,8 +540,8 @@ The &man.tcpdump.1; utility has been updated to version 4.7.4. - OpenSSL has - been updated to version 1.0.1p. + OpenSSL has + been updated to version 1.0.2h. The &man.ssh.1; utility has been updated to re-implement hostname From owner-svn-src-head@freebsd.org Mon May 23 17:11:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F0E2B47D42; Mon, 23 May 2016 17:11:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0CDB1035; Mon, 23 May 2016 17:11:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NHBXB0005299; Mon, 23 May 2016 17:11:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NHBXR4005298; Mon, 23 May 2016 17:11:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605231711.u4NHBXR4005298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 23 May 2016 17:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300525 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 17:11:34 -0000 Author: bdrewery Date: Mon May 23 17:11:32 2016 New Revision: 300525 URL: https://svnweb.freebsd.org/changeset/base/300525 Log: Use sed(1) to determine cc version rather than tail(1) since it is already in ITOOLS. This fixes 'tail: not found' warnings in installworld after r300351. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Mon May 23 17:06:46 2016 (r300524) +++ head/share/mk/bsd.compiler.mk Mon May 23 17:11:32 2016 (r300525) @@ -156,7 +156,7 @@ ${X_}COMPILER_VERSION!=echo "${_v:M[1-9] .undef _v .endif .if !defined(${X_}COMPILER_FREEBSD_VERSION) -${X_}COMPILER_FREEBSD_VERSION!= { echo "__FreeBSD_cc_version" | ${${cc}} -E - 2>/dev/null || echo __FreeBSD_cc_version; } | tail -n 1 +${X_}COMPILER_FREEBSD_VERSION!= { echo "__FreeBSD_cc_version" | ${${cc}} -E - 2>/dev/null || echo __FreeBSD_cc_version; } | sed -n '$$p' # If we get a literal "__FreeBSD_cc_version" back then the compiler # is a non-FreeBSD build that doesn't support it or some other error # occurred. From owner-svn-src-head@freebsd.org Mon May 23 17:17:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 270D6B47E62; Mon, 23 May 2016 17:17:26 +0000 (UTC) (envelope-from jhb@freebsd.org) 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 07FAF1520; Mon, 23 May 2016 17:17:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1B449B95B; Mon, 23 May 2016 13:17:25 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300493 - head/sys/compat/linuxkpi/common/include/linux Date: Mon, 23 May 2016 10:00:20 -0700 Message-ID: <3455323.tBydyU5thm@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605231150.u4NBo56Y005227@repo.freebsd.org> References: <201605231150.u4NBo56Y005227@repo.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, 23 May 2016 13:17:25 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 17:17:26 -0000 On Monday, May 23, 2016 11:50:05 AM Hans Petter Selasky wrote: > Author: hselasky > Date: Mon May 23 11:50:05 2016 > New Revision: 300493 > URL: https://svnweb.freebsd.org/changeset/base/300493 > > Log: > Add support for "cdev_add_ext()" to the LinuxKPI. > > Obtained from: kmacy @ > MFC after: 1 week > Sponsored by: Mellanox Technologies > > Modified: > head/sys/compat/linuxkpi/common/include/linux/cdev.h > > Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/linux/cdev.h Mon May 23 11:47:54 2016 (r300492) > +++ head/sys/compat/linuxkpi/common/include/linux/cdev.h Mon May 23 11:50:05 2016 (r300493) > @@ -91,6 +91,18 @@ cdev_add(struct linux_cdev *cdev, dev_t > return (0); > } > > +static inline int > +cdev_add_ext(struct linux_cdev *cdev, dev_t dev, uid_t uid, gid_t gid, int mode) > +{ > + cdev->cdev = make_dev(&linuxcdevsw, MINOR(dev), uid, gid, mode, > + "%s/%d", kobject_name(&cdev->kobj), MINOR(dev)); > + cdev->dev = dev; > + cdev->cdev->si_drv1 = cdev; > + > + kobject_get(cdev->kobj.parent); > + return (0); This should use make_dev_s() instead? -- John Baldwin From owner-svn-src-head@freebsd.org Mon May 23 17:27:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 171B2B47047; Mon, 23 May 2016 17:27:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC4FE1B16; Mon, 23 May 2016 17:27:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NHRheH010611; Mon, 23 May 2016 17:27:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NHRhnt010610; Mon, 23 May 2016 17:27:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605231727.u4NHRhnt010610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 23 May 2016 17:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300526 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 17:27:44 -0000 Author: bdrewery Date: Mon May 23 17:27:42 2016 New Revision: 300526 URL: https://svnweb.freebsd.org/changeset/base/300526 Log: Properly allow META_MODE to be set from environment. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Mon May 23 17:11:32 2016 (r300525) +++ head/share/mk/sys.mk Mon May 23 17:27:42 2016 (r300526) @@ -46,7 +46,7 @@ __ENV_ONLY_OPTIONS:= \ .sinclude .elif ${MK_META_MODE} == "yes" && defined(.MAKEFLAGS) && ${.MAKEFLAGS:M-B} == "" # verbose will show .MAKE.META.PREFIX for each target. -META_MODE= meta verbose +META_MODE+= meta verbose # silent will hide command output if a .meta file is created. .if !defined(NO_SILENT) META_MODE+= silent=yes From owner-svn-src-head@freebsd.org Mon May 23 17:37:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9C5BB4727D for ; Mon, 23 May 2016 17:37:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A80B11CF for ; Mon, 23 May 2016 17:37:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x229.google.com with SMTP id 190so198114761iow.1 for ; Mon, 23 May 2016 10:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=TxwWGyvNyaGcfUtQNa0/4P7WDAFjJUWcTtmnYHjn9uA=; b=zqHX5OVupk5xSLWrCrVZXqBelLvvxZVT0H9/x3KpwUfbHu0qlHx6wy9R1fJEuHYqU7 91mfRRZTKoig6xiVjqvPnuMfENPvj7dwae3hHXhC0cEHfaIQbrqcq6wQWHlUHqwdEDHe fXL7nmH+/GiJFWWujd7Z8AaoyfZweTk7xWcyeNaQBMrP8X9Yzg4UUf6utz8KtZJA4yjF E0WRievyQVFmGNn2jxysoIT4wMmh2JiYtVy2sAfv179VQujLezcRAS84jM/CXA4hBW3u 22xiaGZCXgd1ei/ghYMBP4rTzr1gDqQM7CBDh+bGLH/XimPOccus6Dn6ygcp+HzB3p10 gqdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=TxwWGyvNyaGcfUtQNa0/4P7WDAFjJUWcTtmnYHjn9uA=; b=JtPeAq3AqS6nHsdA1DlbvJ27woDV1M9uPwaBeGx47lWQ7gw/yNWAvP+pykDfW9zfjX tZrYm0TJw2++UYM3P4NCIXKG0KTHLVcYiD3S5dxMtVRuE1D6exU+za+2WRR6SGPmnbAo 3XUGO9QlTLh0ev6gfkaogbLMsqhxfpk9bh4nUALzVQ80R7UEytkkHSqwPESbNWjZgj5G 2O/o9dON5cyJXmhM74zVZANpSCmvMxHiQikXEvAnpzmxx7o4LH0De/WvYmSjwAEbuP7/ P1JdKFHup4uhMEjfQDUGHzqcYBQjIVSJ4EQh28DNGTMGZ7ZD5bF4yxBSP7h4icuV63wq UgVA== X-Gm-Message-State: AOPr4FXCFDdGfXizFSF55iTnD3zBPdLgPwaYtuzn5aBU7Ij9Ac3HmwWiBSm0cO/JZmj7i3o7qAZWk04sozmOSA== MIME-Version: 1.0 X-Received: by 10.107.40.201 with SMTP id o192mr12647534ioo.183.1464025071558; Mon, 23 May 2016 10:37:51 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.79.75.68 with HTTP; Mon, 23 May 2016 10:37:51 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201605221358.u4MDwW8u097510@repo.freebsd.org> Date: Mon, 23 May 2016 11:37:51 -0600 X-Google-Sender-Auth: q1vk_GwQclxYQ5e4Zb6bIExvMC4 Message-ID: Subject: Re: svn commit: r300421 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/mv dev/acpi_support dev/acpica dev/amdtemp dev/coretemp dev/iicbus powerpc/powermac From: Warner Losh To: Justin Hibbits Cc: Ravi Pokala , src-committers , "svn-src-head@freebsd.org" , Luiz Otavio O Souza , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 17:37:52 -0000 On Sun, May 22, 2016 at 1:12 PM, Justin Hibbits wrote: > > On May 22, 2016 13:51, "Ravi Pokala" wrote: >> >> -----Original Message----- >> From: on behalf of Luiz Otavio O Souza >> >> Date: 2016-05-22, Sunday at 06:58 >> To: , , >> >> Subject: svn commit: r300421 - in head/sys: arm/allwinner >> arm/broadcom/bcm2835 arm/freescale/imx arm/mv dev/acpi_support dev/acpica >> dev/amdtemp dev/coretemp dev/iicbus powerpc/powermac >> >> >Author: loos >> >Date: Sun May 22 13:58:32 2016 >> >New Revision: 300421 >> >URL: https://svnweb.freebsd.org/changeset/base/300421 >> > >> >Log: >> > Fix the deciKelvin to Celsius conversion in kernel. >> > >> > After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as >> > 0C >> > reference and as result, the temperature read in sysctl(8) now exibits >> > a >> > +0.1C difference. >> >> Out of morbid curiosity, why do these things report in deciKelvin anyway? >> Are there sensors we support out there which report native Kelvin, or that >> report sub-degree precision? >> >> Thanks, >> >> Ravi (rpokala@) >> > > There are many i2c sensors which report in sub-degree centigrade. Though > some of them are in 1/8 (or other power of 2) degree precision, not 1/10. ACPI reports in decikelvin, and it was the first thing we supported. Some 1 wire devices support 1/16th a degree, and we support it in millikelvin since 1/16th is 0.0625. So the precision needed is actually greater than what we're reporting. However, the accuracy of the measurement isn't +/- 0.001, it's closer to +/1 0.063 or so (well, that's a relative accuracy, absolute accuracy is closer to +/- 1 degree). We report the higher level of precision so that applications that use the relative temperature can use it to inform a control loop. We have no good way to report relative precision for a measurement, or the absolute accuracy. Warner From owner-svn-src-head@freebsd.org Mon May 23 18:12:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 811F4B47B24; Mon, 23 May 2016 18:12:53 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 451231A7D; Mon, 23 May 2016 18:12:53 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NICqf7026084; Mon, 23 May 2016 18:12:52 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NICqmM026083; Mon, 23 May 2016 18:12:52 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201605231812.u4NICqmM026083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 23 May 2016 18:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300528 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 18:12:53 -0000 Author: skra Date: Mon May 23 18:12:52 2016 New Revision: 300528 URL: https://svnweb.freebsd.org/changeset/base/300528 Log: INTRNG - use gpio generic interrupt modes definitions added in r298738. Reviewed by: ian Modified: head/sys/arm/freescale/imx/imx_gpio.c Modified: head/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpio.c Mon May 23 17:41:53 2016 (r300527) +++ head/sys/arm/freescale/imx/imx_gpio.c Mon May 23 18:12:52 2016 (r300528) @@ -95,8 +95,7 @@ __FBSDID("$FreeBSD$"); struct gpio_irqsrc { struct intr_irqsrc gi_isrc; u_int gi_irq; - enum intr_polarity gi_pol; - enum intr_trigger gi_trig; + uint32_t gi_mode; }; #endif @@ -158,12 +157,11 @@ static int imx51_gpio_pin_toggle(device_ #ifdef INTRNG static int gpio_pic_map_fdt(device_t dev, u_int ncells, pcell_t *cells, u_int *irqp, - enum intr_polarity *polp, enum intr_trigger *trigp) + uint32_t *modep) { struct imx51_gpio_softc *sc; u_int irq, tripol; - enum intr_polarity pol; - enum intr_trigger trig; + uint32_t mode; sc = device_get_softc(dev); @@ -191,31 +189,25 @@ gpio_pic_map_fdt(device_t dev, u_int nce } switch (tripol) { case 1: - trig = INTR_TRIGGER_EDGE; - pol = INTR_POLARITY_HIGH; + mode = GPIO_INTR_EDGE_RISING; break; case 2: - trig = INTR_TRIGGER_EDGE; - pol = INTR_POLARITY_LOW; + mode = GPIO_INTR_EDGE_FALLING; break; case 4: - trig = INTR_TRIGGER_LEVEL; - pol = INTR_POLARITY_HIGH; + mode = GPIO_INTR_LEVEL_HIGH; break; case 8: - trig = INTR_TRIGGER_LEVEL; - pol = INTR_POLARITY_LOW; + mode = GPIO_INTR_LEVEL_LOW; break; default: - device_printf(sc->dev, "Unsupported trigger/polarity 0x%2x\n", + device_printf(sc->dev, "Unsupported interrupt mode 0x%2x\n", tripol); return (ENOTSUP); } *irqp = irq; - if (polp != NULL) - *polp = pol; - if (trigp != NULL) - *trigp = trig; + if (modep != NULL) + *modep = mode; return (0); } @@ -232,8 +224,7 @@ gpio_pic_map_intr(device_t dev, struct i return (ENOTSUP); daf = (struct intr_map_data_fdt *)data; - error = gpio_pic_map_fdt(dev, daf->ncells, daf->cells, &irq, NULL, - NULL); + error = gpio_pic_map_fdt(dev, daf->ncells, daf->cells, &irq, NULL); if (error == 0) { sc = device_get_softc(dev); *isrcp = &sc->gpio_pic_irqsrc[irq].gi_isrc; @@ -251,8 +242,7 @@ gpio_pic_teardown_intr(device_t dev, str sc = device_get_softc(dev); if (isrc->isrc_handlers == 0) { gi = (struct gpio_irqsrc *)isrc; - gi->gi_pol = INTR_POLARITY_CONFORM; - gi->gi_trig = INTR_TRIGGER_CONFORM; + gi->gi_mode = GPIO_INTR_CONFORM; // XXX Not sure this is necessary mtx_lock_spin(&sc->sc_mtx); @@ -272,8 +262,7 @@ gpio_pic_setup_intr(device_t dev, struct struct gpio_irqsrc *gi; int error, icfg; u_int irq, reg, shift, wrk; - enum intr_trigger trig; - enum intr_polarity pol; + uint32_t mode; sc = device_get_softc(dev); gi = (struct gpio_irqsrc *)isrc; @@ -282,34 +271,30 @@ gpio_pic_setup_intr(device_t dev, struct if (data == NULL || data->type != INTR_MAP_DATA_FDT) return (ENOTSUP); daf = (struct intr_map_data_fdt *)data; - error = gpio_pic_map_fdt(dev, daf->ncells, daf->cells, &irq, &pol, - &trig); + error = gpio_pic_map_fdt(dev, daf->ncells, daf->cells, &irq, &mode); if (error != 0) return (error); if (gi->gi_irq != irq) return (EINVAL); /* Compare config if this is not first setup. */ - if (isrc->isrc_handlers != 0) { - if (pol != gi->gi_pol || trig != gi->gi_trig) - return (EINVAL); - else - return (0); - } + if (isrc->isrc_handlers != 0) + return (gi->gi_mode == mode ? 0 : EINVAL); - gi->gi_pol = pol; - gi->gi_trig = trig; - - if (trig == INTR_TRIGGER_LEVEL) { - if (pol == INTR_POLARITY_LOW) - icfg = GPIO_ICR_COND_LOW; - else - icfg = GPIO_ICR_COND_HIGH; - } else { - if (pol == INTR_POLARITY_HIGH) - icfg = GPIO_ICR_COND_FALL; - else - icfg = GPIO_ICR_COND_RISE; + gi->gi_mode = mode; + switch (mode) { + case GPIO_INTR_LEVEL_LOW: + icfg = GPIO_ICR_COND_LOW; + break; + case GPIO_INTR_LEVEL_HIGH: + icfg = GPIO_ICR_COND_HIGH; + break; + case GPIO_INTR_EDGE_RISING: + icfg = GPIO_ICR_COND_RISE; + break; + case GPIO_INTR_EDGE_FALLING: + icfg = GPIO_ICR_COND_FALL; + break; } if (irq < 16) { @@ -433,8 +418,7 @@ gpio_pic_register_isrcs(struct imx51_gpi name = device_get_nameunit(sc->dev); for (irq = 0; irq < NGPIO; irq++) { sc->gpio_pic_irqsrc[irq].gi_irq = irq; - sc->gpio_pic_irqsrc[irq].gi_pol = INTR_POLARITY_CONFORM; - sc->gpio_pic_irqsrc[irq].gi_trig = INTR_TRIGGER_CONFORM; + sc->gpio_pic_irqsrc[irq].gi_mode = GPIO_INTR_CONFORM; error = intr_isrc_register(&sc->gpio_pic_irqsrc[irq].gi_isrc, sc->dev, 0, "%s,%u", name, irq); From owner-svn-src-head@freebsd.org Mon May 23 18:16:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBAA7B47BFA; Mon, 23 May 2016 18:16:22 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F3571CB3; Mon, 23 May 2016 18:16:22 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NIGLJd026262; Mon, 23 May 2016 18:16:21 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NIGLwO026261; Mon, 23 May 2016 18:16:21 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201605231816.u4NIGLwO026261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 23 May 2016 18:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300529 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 18:16:22 -0000 Author: skra Date: Mon May 23 18:16:21 2016 New Revision: 300529 URL: https://svnweb.freebsd.org/changeset/base/300529 Log: INTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO introduced in r298738. Reviewed by: ian Modified: head/sys/arm/freescale/imx/imx_gpio.c Modified: head/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpio.c Mon May 23 18:12:52 2016 (r300528) +++ head/sys/arm/freescale/imx/imx_gpio.c Mon May 23 18:16:21 2016 (r300529) @@ -88,7 +88,14 @@ __FBSDID("$FreeBSD$"); #define IMX_GPIO_ISR_REG 0x018 /* Interrupt Status Register */ #define IMX_GPIO_EDGE_REG 0x01C /* Edge Detect Register */ +#ifdef INTRNG +#define DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ + GPIO_INTR_LEVEL_LOW | GPIO_INTR_LEVEL_HIGH | GPIO_INTR_EDGE_RISING | \ + GPIO_INTR_EDGE_FALLING ) +#else #define DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) +#endif + #define NGPIO 32 #ifdef INTRNG @@ -156,15 +163,12 @@ static int imx51_gpio_pin_toggle(device_ #ifdef INTRNG static int -gpio_pic_map_fdt(device_t dev, u_int ncells, pcell_t *cells, u_int *irqp, - uint32_t *modep) +gpio_pic_map_fdt(struct imx51_gpio_softc *sc, struct intr_map_data_fdt *daf, + u_int *irqp, uint32_t *modep) { - struct imx51_gpio_softc *sc; - u_int irq, tripol; + u_int irq; uint32_t mode; - sc = device_get_softc(dev); - /* * From devicetree/bindings/gpio/fsl-imx-gpio.txt: * #interrupt-cells: 2. The first cell is the GPIO number. The second @@ -176,18 +180,17 @@ gpio_pic_map_fdt(device_t dev, u_int nce * We can do any single one of these modes, but nothing in combo. */ - if (ncells != 2) { + if (daf->ncells != 2) { device_printf(sc->dev, "Invalid #interrupt-cells\n"); return (EINVAL); } - irq = cells[0]; - tripol = cells[1]; + irq = daf->cells[0]; if (irq >= sc->gpio_npins) { device_printf(sc->dev, "Invalid interrupt number %u\n", irq); return (EINVAL); } - switch (tripol) { + switch (daf->cells[1]) { case 1: mode = GPIO_INTR_EDGE_RISING; break; @@ -202,7 +205,7 @@ gpio_pic_map_fdt(device_t dev, u_int nce break; default: device_printf(sc->dev, "Unsupported interrupt mode 0x%2x\n", - tripol); + daf->cells[1]); return (ENOTSUP); } *irqp = irq; @@ -212,23 +215,61 @@ gpio_pic_map_fdt(device_t dev, u_int nce } static int +gpio_pic_map_gpio(struct imx51_gpio_softc *sc, struct intr_map_data_gpio *dag, + u_int *irqp, uint32_t *modep) +{ + u_int irq; + uint32_t mode; + + irq = dag->gpio_pin_num; + if (irq >= sc->gpio_npins) { + device_printf(sc->dev, "Invalid interrupt number %u\n", irq); + return (EINVAL); + } + + mode = dag->gpio_intr_mode; + if (mode != GPIO_INTR_LEVEL_LOW && mode != GPIO_INTR_LEVEL_HIGH && + mode != GPIO_INTR_EDGE_RISING && mode != GPIO_INTR_EDGE_FALLING) { + device_printf(sc->dev, "Unsupported interrupt mode 0x%8x\n", + mode); + return (EINVAL); + } + + *irqp = irq; + if (modep != NULL) + *modep = mode; + return (0); +} + +static int +gpio_pic_map(struct imx51_gpio_softc *sc, struct intr_map_data *data, + u_int *irqp, uint32_t *modep) +{ + + switch (data->type) { + case INTR_MAP_DATA_FDT: + return (gpio_pic_map_fdt(sc, (struct intr_map_data_fdt *)data, + irqp, modep)); + case INTR_MAP_DATA_GPIO: + return (gpio_pic_map_gpio(sc, (struct intr_map_data_gpio *)data, + irqp, modep)); + default: + return (ENOTSUP); + } +} + +static int gpio_pic_map_intr(device_t dev, struct intr_map_data *data, struct intr_irqsrc **isrcp) { int error; u_int irq; - struct intr_map_data_fdt *daf; struct imx51_gpio_softc *sc; - if (data->type != INTR_MAP_DATA_FDT) - return (ENOTSUP); - - daf = (struct intr_map_data_fdt *)data; - error = gpio_pic_map_fdt(dev, daf->ncells, daf->cells, &irq, NULL); - if (error == 0) { - sc = device_get_softc(dev); + sc = device_get_softc(dev); + error = gpio_pic_map(sc, data, &irq, NULL); + if (error == 0) *isrcp = &sc->gpio_pic_irqsrc[irq].gi_isrc; - } return (error); } @@ -257,21 +298,20 @@ static int gpio_pic_setup_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { - struct intr_map_data_fdt *daf; struct imx51_gpio_softc *sc; struct gpio_irqsrc *gi; int error, icfg; u_int irq, reg, shift, wrk; uint32_t mode; + if (data == NULL) + return (ENOTSUP); + sc = device_get_softc(dev); gi = (struct gpio_irqsrc *)isrc; /* Get config for interrupt. */ - if (data == NULL || data->type != INTR_MAP_DATA_FDT) - return (ENOTSUP); - daf = (struct intr_map_data_fdt *)data; - error = gpio_pic_map_fdt(dev, daf->ncells, daf->cells, &irq, &mode); + error = gpio_pic_map(sc, data, &irq, &mode); if (error != 0) return (error); if (gi->gi_irq != irq) From owner-svn-src-head@freebsd.org Mon May 23 18:43:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89836B4727C; Mon, 23 May 2016 18:43:31 +0000 (UTC) (envelope-from jhb@freebsd.org) 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 6B14B1DB7; Mon, 23 May 2016 18:43:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 493A8B95B; Mon, 23 May 2016 14:43:30 -0400 (EDT) From: John Baldwin To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300372 - in head/sys: kern sys Date: Mon, 23 May 2016 11:43:27 -0700 Message-ID: <8562415.t0UfIz1aLk@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605211451.u4LEpopu074806@repo.freebsd.org> References: <201605211451.u4LEpopu074806@repo.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, 23 May 2016 14:43:30 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 18:43:31 -0000 On Saturday, May 21, 2016 02:51:50 PM Andriy Gapon wrote: > Author: avg > Date: Sat May 21 14:51:49 2016 > New Revision: 300372 > URL: https://svnweb.freebsd.org/changeset/base/300372 > > Log: > fix loss of taskqueue wakeups (introduced in r300113) > > Submitted by: kmacy > Tested by: dchagin > > Modified: head/sys/sys/taskqueue.h > ============================================================================== > --- head/sys/sys/taskqueue.h Sat May 21 11:40:41 2016 (r300371) > +++ head/sys/sys/taskqueue.h Sat May 21 14:51:49 2016 (r300372) > @@ -114,7 +113,6 @@ void taskqueue_thread_enqueue(void *cont > */ > #define TASK_INIT(task, priority, func, context) do { \ > (task)->ta_pending = 0; \ > - (task)->ta_flags = 0; \ > (task)->ta_priority = (priority); \ > (task)->ta_func = (func); \ > (task)->ta_context = (context); \ > @@ -224,7 +222,6 @@ int taskqgroup_adjust(struct taskqgroup > > #define GTASK_INIT(task, priority, func, context) do { \ > (task)->ta_pending = 0; \ > - (task)->ta_flags = TASK_SKIP_WAKEUP; \ > (task)->ta_priority = (priority); \ > (task)->ta_func = (func); \ > (task)->ta_context = (context); \ Do we still need GTASK_INIT() now or can relevant tasks now use TASK_INIT instead and GTASK_INIT be retired? -- John Baldwin From owner-svn-src-head@freebsd.org Mon May 23 19:03:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5134B4763A; Mon, 23 May 2016 19:03:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ig0-f171.google.com (mail-ig0-f171.google.com [209.85.213.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8E33188F; Mon, 23 May 2016 19:03:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ig0-f171.google.com with SMTP id c3so5821821igl.0; Mon, 23 May 2016 12:03:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=vyCqyFRbs/7p1PjvMd31H5vrSYoiYzvVx1ohLJ7VR2E=; b=A5gZJhFQ6aZm/qq0eN3YG9JheFb0kSdzN7y/TAFnoKT4JD05tfGLWN46TaNtT0DTiG HmvtgA24UOTeFcncneQD5c3dur/Mye9uF+6zPOWt3zUvPSrVLP6p4yD5TyH70rFyTSiN A/SX1SPTDw9BQoubTJG6Qj958+XWlKTyZG2WXeThiO8f3OxGgqfP+5sA7PsX+BjxEpKV J2PDKcpF3Vxj5JyRuvlVdlKOWB3Z7lQUJyDRoUO0PeODWx6kDRW0xyKWUQ06qCG7LTuM Oyyj8Xi8+tWUB+FM4aWgZubMp7ko3badCodNuCijZ6jnMc3sPS4teW/9vKizGhdqbhFJ Cpzg== X-Gm-Message-State: AOPr4FV+J6H8sKSJAox1m/4oMBudFtTVc6iV8ND2hSxAI5W0g1wYWo/hKTlxR3pPNt5QeA== X-Received: by 10.50.17.197 with SMTP id q5mr13925989igd.57.1464030222983; Mon, 23 May 2016 12:03:42 -0700 (PDT) Received: from mail-ig0-f173.google.com (mail-ig0-f173.google.com. [209.85.213.173]) by smtp.gmail.com with ESMTPSA id o206sm4182546itg.9.2016.05.23.12.03.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 May 2016 12:03:42 -0700 (PDT) Received: by mail-ig0-f173.google.com with SMTP id fh2so28090479igd.1; Mon, 23 May 2016 12:03:42 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.50.244.180 with SMTP id xh20mr13559857igc.48.1464030222353; Mon, 23 May 2016 12:03:42 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Mon, 23 May 2016 12:03:42 -0700 (PDT) In-Reply-To: <201605231203.u4NC3eHI010991@repo.freebsd.org> References: <201605231203.u4NC3eHI010991@repo.freebsd.org> Date: Mon, 23 May 2016 12:03:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300496 - in head/sys/compat/linuxkpi/common: include/linux src From: Conrad Meyer To: Hans Petter Selasky Cc: 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 19:03:50 -0000 Didn't we already have list_sort in linuxkpi? Maybe I'm confused. On Mon, May 23, 2016 at 5:03 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon May 23 12:03:40 2016 > New Revision: 300496 > URL: https://svnweb.freebsd.org/changeset/base/300496 > > Log: > Add more list_xxx() functions to the LinuxKPI. > > Obtained from: kmacy @ > MFC after: 1 week > Sponsored by: Mellanox Technologies > > Modified: > head/sys/compat/linuxkpi/common/include/linux/list.h > head/sys/compat/linuxkpi/common/src/linux_compat.c > > Modified: head/sys/compat/linuxkpi/common/include/linux/list.h > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/linux/list.h Mon May 23 11:57:23 2016 (r300495) > +++ head/sys/compat/linuxkpi/common/include/linux/list.h Mon May 23 12:03:40 2016 (r300496) > @@ -109,6 +109,13 @@ list_replace(struct list_head *old, stru > } > > static inline void > +list_replace_init(struct list_head *old, struct list_head *new) > +{ > + list_replace(old, new); > + INIT_LIST_HEAD(old); > +} > + > +static inline void > linux_list_add(struct list_head *new, struct list_head *prev, > struct list_head *next) > { > @@ -132,9 +139,18 @@ list_del_init(struct list_head *entry) > #define list_first_entry(ptr, type, member) \ > list_entry((ptr)->next, type, member) > > +#define list_last_entry(ptr, type, member) \ > + list_entry((ptr)->prev, type, member) > + > +#define list_first_entry_or_null(ptr, type, member) \ > + (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) > + > #define list_next_entry(ptr, member) \ > list_entry(((ptr)->member.next), typeof(*(ptr)), member) > > +#define list_prev_entry(ptr, member) \ > + list_entry(((ptr)->member.prev), typeof(*(ptr)), member) > + > #define list_for_each(p, head) \ > for (p = (head)->next; p != (head); p = (p)->next) > > @@ -436,4 +452,7 @@ static inline int list_is_last(const str > (pos) && ({ n = (pos)->member.next; 1; }); \ > pos = hlist_entry_safe(n, typeof(*(pos)), member)) > > +extern void list_sort(void *priv, struct list_head *head, int (*cmp)(void *priv, > + struct list_head *a, struct list_head *b)); > + > #endif /* _LINUX_LIST_H_ */ > > Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c > ============================================================================== > --- head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 23 11:57:23 2016 (r300495) > +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 23 12:03:40 2016 (r300496) > @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include > > @@ -1358,6 +1359,47 @@ unregister_inetaddr_notifier(struct noti > return (0); > } > > +struct list_sort_thunk { > + int (*cmp)(void *, struct list_head *, struct list_head *); > + void *priv; > +}; > + > +static inline int > +linux_le_cmp(void *priv, const void *d1, const void *d2) > +{ > + struct list_head *le1, *le2; > + struct list_sort_thunk *thunk; > + > + thunk = priv; > + le1 = *(__DECONST(struct list_head **, d1)); > + le2 = *(__DECONST(struct list_head **, d2)); > + return ((thunk->cmp)(thunk->priv, le1, le2)); > +} > + > +void > +list_sort(void *priv, struct list_head *head, int (*cmp)(void *priv, > + struct list_head *a, struct list_head *b)) > +{ > + struct list_sort_thunk thunk; > + struct list_head **ar, *le; > + size_t count, i; > + > + count = 0; > + list_for_each(le, head) > + count++; > + ar = malloc(sizeof(struct list_head *) * count, M_KMALLOC, M_WAITOK); > + i = 0; > + list_for_each(le, head) > + ar[i++] = le; > + thunk.cmp = cmp; > + thunk.priv = priv; > + qsort_r(ar, count, sizeof(struct list_head *), &thunk, linux_le_cmp); > + INIT_LIST_HEAD(head); > + for (i = 0; i < count; i++) > + list_add_tail(ar[i], head); > + free(ar, M_KMALLOC); > +} > + > void > linux_irq_handler(void *ent) > { > From owner-svn-src-head@freebsd.org Mon May 23 19:32:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96E0DB46019; Mon, 23 May 2016 19:32:26 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 788BE18DE; Mon, 23 May 2016 19:32:26 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) id <0O7N00500A3MDS00@mr11p00im-asmtp004.me.com>; Mon, 23 May 2016 19:32:20 +0000 (GMT) Received: from [172.17.133.77] (dip-cali.panasas.com [64.80.217.3]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O7N002DPA9UT630@mr11p00im-asmtp004.me.com>; Mon, 23 May 2016 19:32:19 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-05-23_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1605230231 User-Agent: Microsoft-MacOutlook/f.16.0.160506 Date: Mon, 23 May 2016 12:32:31 -0700 Subject: Re: svn commit: r300421 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/mv dev/acpi_support dev/acpica dev/amdtemp dev/coretemp dev/iicbus powerpc/powermac From: Ravi Pokala Sender: "Pokala, Ravi" To: Warner Losh , Justin Hibbits Cc: src-committers , "svn-src-head@freebsd.org" , Luiz Otavio O Souza , "svn-src-all@freebsd.org" Message-id: Thread-topic: svn commit: r300421 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/mv dev/acpi_support dev/acpica dev/amdtemp dev/coretemp dev/iicbus powerpc/powermac References: <201605221358.u4MDwW8u097510@repo.freebsd.org> In-reply-to: MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1464031940; bh=T1jlCeEx0Mge6HqjjJgxHiXbNfXsM0Z1gGlkn6xzdHo=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=TYHkD7MRfvsI7VM52bb+TW8+4+ljuGnHFkFzr5UGBCt83gr3tRwsjcfYVxRWdVfse /ULkNLXotpehKmy+aAQ4r6BERejwb2uW1YVpWLT9pNqTQ7ArCMM24EWNyvsYUqDfnO HWJ0Vw1miEEEgYpifDvB410PoA1AvG+B0eZYlYzUyd/1UXT2eHiPJxnL6GqfXevEhM nXd3GEsatde623g7isVTa4YmPzocbLwPisF2fgJy4uKGBHqmO4/qtWMxo6KxU5T+SY PmAf6bBlm0uS7LtlqFH6Qt++vFl8A0IzzrL1Q15ASUhWn3H1zVQmpoZmv5Aj8yd9Va x6N3Sd7IC1xpg== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 19:32:26 -0000 -----Original Message----- From: on behalf of Warner Losh Date: 2016-05-23, Monday at 10:37 To: Justin Hibbits Cc: Ravi Pokala , src-committers , "svn-src-head@freebsd.org" , Luiz Otavio O Souza , "svn-src-all@freebsd.org" Subject: Re: svn commit: r300421 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/mv dev/acpi_support dev/acpica dev/amdtemp dev/coretemp dev/iicbus powerpc/powermac >On Sun, May 22, 2016 at 1:12 PM, Justin Hibbits wrote: >> >> On May 22, 2016 13:51, "Ravi Pokala" wrote: >>> >>> Out of morbid curiosity, why do these things report in deciKelvin anyway? >>> Are there sensors we support out there which report native Kelvin, or that >>> report sub-degree precision? >>> >>> Thanks, >>> >>> Ravi (rpokala@) >>> >> >> There are many i2c sensors which report in sub-degree centigrade. Though >> some of them are in 1/8 (or other power of 2) degree precision, not 1/10. > >ACPI reports in decikelvin, and it was the first thing we supported. Some 1 wire >devices support 1/16th a degree, and we support it in millikelvin since 1/16th >is 0.0625. So the precision needed is actually greater than what we're >reporting. >However, the accuracy of the measurement isn't +/- 0.001, it's closer >to +/1 0.063 >or so (well, that's a relative accuracy, absolute accuracy is closer >to +/- 1 degree). >We report the higher level of precision so that applications that use >the relative >temperature can use it to inform a control loop. We have no good way to report >relative precision for a measurement, or the absolute accuracy. > >Warner Good to know. Thanks guys. -Ravi From owner-svn-src-head@freebsd.org Mon May 23 19:46:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81ECEB4653A; Mon, 23 May 2016 19:46:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ABE9105A; Mon, 23 May 2016 19:46:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NJkw7j060460; Mon, 23 May 2016 19:46:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NJkw0v060459; Mon, 23 May 2016 19:46:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605231946.u4NJkw0v060459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 23 May 2016 19:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300531 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 19:46:59 -0000 Author: cem Date: Mon May 23 19:46:58 2016 New Revision: 300531 URL: https://svnweb.freebsd.org/changeset/base/300531 Log: ntb_hw(4): Only record the first three MSIX vectors Don't overrun the msix_data array by reading the (unused) link state interrupt information. Reported by: mav (earlier version) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6489 Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Mon May 23 18:20:15 2016 (r300530) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Mon May 23 19:46:58 2016 (r300531) @@ -333,7 +333,7 @@ static inline void db_iowrite(struct ntb static inline void db_iowrite_raw(struct ntb_softc *, uint64_t regoff, uint64_t); static int ntb_create_msix_vec(struct ntb_softc *ntb, uint32_t num_vectors); static void ntb_free_msix_vec(struct ntb_softc *ntb); -static void ntb_get_msix_info(struct ntb_softc *ntb, uint32_t num_vectors); +static void ntb_get_msix_info(struct ntb_softc *ntb); static void ntb_exchange_msix(void *); static struct ntb_hw_info *ntb_get_device_info(uint32_t device_id); static void ntb_detect_max_mw(struct ntb_softc *ntb); @@ -1067,10 +1067,18 @@ ntb_init_isr(struct ntb_softc *ntb) ntb->db_vec_shift = XEON_DB_TOTAL_SHIFT; rc = ntb_setup_legacy_interrupt(ntb); } else { + if (num_vectors - 1 != XEON_NONLINK_DB_MSIX_BITS && + HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + device_printf(ntb->device, + "Errata workaround expects %d doorbell bits\n", + XEON_NONLINK_DB_MSIX_BITS); + return (EINVAL); + } + ntb_create_msix_vec(ntb, num_vectors); rc = ntb_setup_msix(ntb, num_vectors); if (rc == 0 && HAS_FEATURE(NTB_SB01BASE_LOCKUP)) - ntb_get_msix_info(ntb, num_vectors); + ntb_get_msix_info(ntb); } if (rc != 0) { device_printf(ntb->device, @@ -1335,7 +1343,7 @@ ntb_free_msix_vec(struct ntb_softc *ntb) } static void -ntb_get_msix_info(struct ntb_softc *ntb, uint32_t num_vectors) +ntb_get_msix_info(struct ntb_softc *ntb) { struct pci_devinfo *dinfo; struct pcicfg_msix *msix; @@ -1346,7 +1354,9 @@ ntb_get_msix_info(struct ntb_softc *ntb, laddr = data = 0; - for (i = 0; i < num_vectors; i++) { + CTASSERT(XEON_NONLINK_DB_MSIX_BITS == nitems(ntb->msix_data)); + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { offset = msix->msix_table_offset + i * PCI_MSIX_ENTRY_SIZE; laddr = bus_read_4(msix->msix_table_res, offset + From owner-svn-src-head@freebsd.org Mon May 23 19:52:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFC2EB466D1; Mon, 23 May 2016 19:52:09 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81A1D14D2; Mon, 23 May 2016 19:52:09 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NJq8jB062659; Mon, 23 May 2016 19:52:08 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NJq8YH062658; Mon, 23 May 2016 19:52:08 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201605231952.u4NJq8YH062658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Mon, 23 May 2016 19:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300532 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 19:52:09 -0000 Author: ken Date: Mon May 23 19:52:08 2016 New Revision: 300532 URL: https://svnweb.freebsd.org/changeset/base/300532 Log: Fix ada(4) trim support quirk setting. I broke broke the quirk in the ada(4) driver disabling NCQ trim support in revision 300207. The support flags were set before the quirks were loaded. sys/cam/ata/ata_da.c: Call adasetflags() after loading quirks, so that we'll set the flags accurately. Sponsored by: Spectra Logic Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon May 23 19:46:58 2016 (r300531) +++ head/sys/cam/ata/ata_da.c Mon May 23 19:52:08 2016 (r300532) @@ -1639,11 +1639,6 @@ adaregister(struct cam_periph *periph, v return(CAM_REQ_CMP_ERR); } - /* - * Set support flags based on the Identify data. - */ - adasetflags(softc, cgd); - periph->softc = softc; /* @@ -1683,6 +1678,12 @@ adaregister(struct cam_periph *periph, v snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.write_cache", periph->unit_number); TUNABLE_INT_FETCH(announce_buf, &softc->write_cache); + + /* + * Set support flags based on the Identify data and quirks. + */ + adasetflags(softc, cgd); + /* Disable queue sorting for non-rotational media by default. */ if (cgd->ident_data.media_rotation_rate == ATA_RATE_NON_ROTATING) { softc->rotating = 0; From owner-svn-src-head@freebsd.org Mon May 23 20:06:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C99B0B468CC; Mon, 23 May 2016 20:06:31 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lb0-f195.google.com (mail-lb0-f195.google.com [209.85.217.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DC0F1C0A; Mon, 23 May 2016 20:06:31 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lb0-f195.google.com with SMTP id sh2so1621602lbb.2; Mon, 23 May 2016 13:06: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:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=oEd4QYafbz9z3Xl+1dLHnAPuIU/dbYTVhxxMT5oSAmw=; b=de02PmPjSMjC6O0jX5+ZfBnxmWaONzdetSgcQx1GT3tL3E4kFEPciO+2hD/M9qunS9 gFxiM3ZtDtsOVLLhKPqHRJMAb3BlENPL1Q3qms1FdrkNO5oHMyQLC57eY6GhrJ9tuyz2 JmFHn6CZKHQzQsN8pr1tFd29o329Cd5pMFRwtns2+pMlW37u9F1ryyd7HvRzba+5A6pv vCaORYwM2V+y+UPQP0RfkON4B9BLS/1oNpViFETbzWmaH2Po09Hoy1Xwk65uU4OIXA29 V0ixfcAFXtGa9I+CC+W3NI/8BKIXKLMSfz32KhhfAmmXl/4U4iUnvyrIQBrC/JRaGhtV W34w== X-Gm-Message-State: ALyK8tL5C2aUkWixsgRMWO8wb4BEoaOYGdZbQ2SCV0LaWWsCk5XRgZZLfElY6dTvSEaOgw== X-Received: by 10.112.170.161 with SMTP id an1mr2071787lbc.44.1464033982907; Mon, 23 May 2016 13:06:22 -0700 (PDT) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id r3sm6017528lbj.26.2016.05.23.13.06.21 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 23 May 2016 13:06:22 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Allan Jude" Subject: Re: svn commit: r298946 - head/usr.sbin/bsdinstall/scripts References: <201605022140.u42LeYFK051507@repo.freebsd.org> <186c070f-eb81-370d-b215-1d9f370918b8@freebsd.org> Date: Mon, 23 May 2016 23:06:16 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 20:06:31 -0000 Mon, 23 May 2016 08:00:27 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Allan Jude = : > On 2016-05-23 00:49, Allan Jude wrote: >> On 2016-05-02 17:40, Andriy Voskoboinyk wrote: >>> Author: avos >>> Date: Mon May 2 21:40:34 2016 >>> New Revision: 298946 >>> URL: https://svnweb.freebsd.org/changeset/base/298946 >>> >>> Log: >>> bsdinstall: fix static address assignment for protected wireless = >>> networks. >>> >>> Filter out IFCONFIG_PREFIX variable (which may contain WPA keyword= ) >>> from ifconfig parameters. >>> >>> PR: 169199 >>> >>> Modified: >>> head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 >>> >>> Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >>> --- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Mon May 2 = >>> 21:23:05 2016 (r298945) >>> +++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Mon May 2 = >>> 21:40:34 2016 (r298946) >>> @@ -84,7 +84,7 @@ retval=3D$? >>> >>> if [ "$BSDINSTALL_CONFIGCURRENT" ]; then >>> . $BSDINSTALL_TMPETC/._rc.conf.net >>> - ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE` >>> + ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE | sed = >>> "s|$2||"` >>> if [ "$defaultrouter" ]; then >>> route delete -inet default >>> route add -inet default $defaultrouter >>> >> >> This breaks static assignment of IP addresses to wired interfaces: >> >> sed: first RE may not be empty >> >> > > I wrote this patch for the issue. Unless you see a better way to do it= ? > > No, I have no better ideas. From owner-svn-src-head@freebsd.org Mon May 23 20:07:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 860E3B4692D; Mon, 23 May 2016 20:07:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CDC31D7A; Mon, 23 May 2016 20:07:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NK7IQS066431; Mon, 23 May 2016 20:07:18 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NK7HO7066421; Mon, 23 May 2016 20:07:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605232007.u4NK7HO7066421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 23 May 2016 20:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300533 - in head/sys/arm: arm at91 cavium/cns11xx include mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 20:07:19 -0000 Author: ian Date: Mon May 23 20:07:17 2016 New Revision: 300533 URL: https://svnweb.freebsd.org/changeset/base/300533 Log: Use the new(-ish) CP15_SCTLR macro to generate system control reg accesses where possible. In the places that doesn't work (multi-line inline asm, and places where the old armv4 cpufuncs mechanism is used), annotate the accesses with a comment that includes SCTLR. Now a grep -i sctlr can find all the system control register manipulations. No functional changes. Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/cpufunc_asm.S head/sys/arm/arm/cpufunc_asm_xscale.S head/sys/arm/arm/elf_trampoline.c head/sys/arm/arm/locore-v4.S head/sys/arm/arm/machdep.c head/sys/arm/at91/at91_machdep.c head/sys/arm/cavium/cns11xx/econa_machdep.c head/sys/arm/include/cpu-v4.h head/sys/arm/mv/mv_machdep.c Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Mon May 23 19:52:08 2016 (r300532) +++ head/sys/arm/arm/cpufunc.c Mon May 23 20:07:17 2016 (r300533) @@ -886,7 +886,7 @@ arm9_setup(void) /* Clear out the cache */ cpu_idcache_wbinv_all(); - /* Set the control register */ + /* Set the control register (SCTLR) */ cpu_control(cpuctrlmask, cpuctrl); } Modified: head/sys/arm/arm/cpufunc_asm.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm.S Mon May 23 19:52:08 2016 (r300532) +++ head/sys/arm/arm/cpufunc_asm.S Mon May 23 20:07:17 2016 (r300533) @@ -68,7 +68,7 @@ ENTRY(cpu_ident) END(cpu_ident) ENTRY(cpu_get_control) - mrc p15, 0, r0, c1, c0, 0 + mrc CP15_SCTLR(r0) RET END(cpu_get_control) @@ -98,13 +98,6 @@ END(cpu_faultaddress) * All other registers are CPU architecture specific */ -#if 0 /* See below. */ -ENTRY(cpufunc_control) - mcr p15, 0, r0, c1, c0, 0 - RET -END(cpufunc_control) -#endif - ENTRY(cpu_domains) mcr p15, 0, r0, c3, c0, 0 RET @@ -121,13 +114,13 @@ END(cpu_domains) */ ENTRY(cpufunc_control) - mrc p15, 0, r3, c1, c0, 0 /* Read the control register */ + mrc CP15_SCTLR(r3) /* Read the control register */ bic r2, r3, r0 /* Clear bits */ eor r2, r2, r1 /* XOR bits */ teq r2, r3 /* Only write if there is a change */ - mcrne p15, 0, r2, c1, c0, 0 /* Write new control register */ + mcrne CP15_SCTLR(r2) /* Write new control register */ mov r0, r3 /* Return old value */ RET Modified: head/sys/arm/arm/cpufunc_asm_xscale.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_xscale.S Mon May 23 19:52:08 2016 (r300532) +++ head/sys/arm/arm/cpufunc_asm_xscale.S Mon May 23 20:07:17 2016 (r300533) @@ -111,13 +111,13 @@ END(xscale_cpwait) * changes in the control register. */ ENTRY(xscale_control) - mrc p15, 0, r3, c1, c0, 0 /* Read the control register */ + mrc CP15_SCTLR(r3) /* Read the control register */ bic r2, r3, r0 /* Clear bits */ eor r2, r2, r1 /* XOR bits */ teq r2, r3 /* Only write if there was a change */ mcrne p15, 0, r0, c7, c5, 6 /* Invalidate the BTB */ - mcrne p15, 0, r2, c1, c0, 0 /* Write new control register */ + mcrne CP15_SCTLR(r3) /* Write new control register */ mov r0, r3 /* Return old value */ CPWAIT_AND_RETURN(r1) Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Mon May 23 19:52:08 2016 (r300532) +++ head/sys/arm/arm/elf_trampoline.c Mon May 23 20:07:17 2016 (r300533) @@ -227,14 +227,14 @@ _startC(void) "bic %0, %0, #0xff000000\n" "and %1, %1, #0xff000000\n" "orr %0, %0, %1\n" - "mrc p15, 0, %1, c1, c0, 0\n" + "mrc p15, 0, %1, c1, c0, 0\n" /* CP15_SCTLR(%1)*/ "bic %1, %1, #1\n" /* Disable MMU */ "orr %1, %1, #(4 | 8)\n" /* Add DC enable, WBUF enable */ "orr %1, %1, #0x1000\n" /* Add IC enable */ "orr %1, %1, #(0x800)\n" /* BPRD enable */ - "mcr p15, 0, %1, c1, c0, 0\n" + "mcr p15, 0, %1, c1, c0, 0\n" /* CP15_SCTLR(%1)*/ "nop\n" "nop\n" "nop\n" @@ -599,9 +599,9 @@ load_kernel(unsigned int kstart, unsigne __asm __volatile("mcr p15, 0, %0, c7, c5, 0\n" "mcr p15, 0, %0, c7, c10, 4\n" : : "r" (curaddr)); - __asm __volatile("mrc p15, 0, %0, c1, c0, 0\n" + __asm __volatile("mrc p15, 0, %0, c1, c0, 0\n" /* CP15_SCTLR(%0)*/ "bic %0, %0, #1\n" /* MMU_ENABLE */ - "mcr p15, 0, %0, c1, c0, 0\n" + "mcr p15, 0, %0, c1, c0, 0\n" /* CP15_SCTLR(%0)*/ : "=r" (ssym)); /* Jump to the entry point. */ ((void(*)(void))(entry_point - KERNVIRTADDR + curaddr))(); @@ -643,9 +643,9 @@ setup_pagetables(unsigned int pt_addr, v __asm __volatile("mcr p15, 0, %1, c2, c0, 0\n" /* set TTB */ "mcr p15, 0, %1, c8, c7, 0\n" /* Flush TTB */ "mcr p15, 0, %2, c3, c0, 0\n" /* Set DAR */ - "mrc p15, 0, %0, c1, c0, 0\n" + "mrc p15, 0, %0, c1, c0, 0\n" /* CP15_SCTLR(%0)*/ "orr %0, %0, #1\n" /* MMU_ENABLE */ - "mcr p15, 0, %0, c1, c0, 0\n" + "mcr p15, 0, %0, c1, c0, 0\n" /* CP15_SCTLR(%0)*/ "mrc p15, 0, %0, c2, c0, 0\n" /* CPWAIT */ "mov r0, r0\n" "sub pc, pc, #4\n" : @@ -700,9 +700,9 @@ __start(void) */ cpu_idcache_wbinv_all(); cpu_l2cache_wbinv_all(); - __asm __volatile("mrc p15, 0, %0, c1, c0, 0\n" + __asm __volatile("mrc p15, 0, %0, c1, c0, 0\n" /* CP15_SCTLR(%0)*/ "bic %0, %0, #1\n" /* MMU_DISABLE */ - "mcr p15, 0, %0, c1, c0, 0\n" + "mcr p15, 0, %0, c1, c0, 0\n" /* CP15_SCTLR(%0)*/ :"=r" (pt_addr)); } else #endif Modified: head/sys/arm/arm/locore-v4.S ============================================================================== --- head/sys/arm/arm/locore-v4.S Mon May 23 19:52:08 2016 (r300532) +++ head/sys/arm/arm/locore-v4.S Mon May 23 20:07:17 2016 (r300533) @@ -114,7 +114,7 @@ ASENTRY_NP(_start) * If we're running with MMU disabled, test against the * physical address instead. */ - mrc p15, 0, r2, c1, c0, 0 + mrc CP15_SCTLR(r2) ands r2, r2, #CPU_CONTROL_MMU_ENABLE ldreq r6, =PHYSADDR ldrne r6, =LOADERRAMADDR @@ -146,12 +146,12 @@ from_ram: disable_mmu: /* Disable MMU for a while */ - mrc p15, 0, r2, c1, c0, 0 + mrc CP15_SCTLR(r2) bic r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ CPU_CONTROL_WBUF_ENABLE) bic r2, r2, #(CPU_CONTROL_IC_ENABLE) bic r2, r2, #(CPU_CONTROL_BPRD_ENABLE) - mcr p15, 0, r2, c1, c0, 0 + mcr CP15_SCTLR(r2) nop nop @@ -213,9 +213,9 @@ Lunmapped: /* * Enable MMU. */ - mrc p15, 0, r0, c1, c0, 0 + mrc CP15_SCTLR(r0) orr r0, r0, #(CPU_CONTROL_MMU_ENABLE) - mcr p15, 0, r0, c1, c0, 0 + mcr CP15_SCTLR(r0) nop nop nop @@ -398,7 +398,7 @@ ENTRY_NP(cpu_halt) * Hurl ourselves into the ROM */ mov r0, #(CPU_CONTROL_32BP_ENABLE | CPU_CONTROL_32BD_ENABLE) - mcr p15, 0, r0, c1, c0, 0 + mcr CP15_SCTLR(r0) mcrne p15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */ mov pc, r4 Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon May 23 19:52:08 2016 (r300532) +++ head/sys/arm/arm/machdep.c Mon May 23 20:07:17 2016 (r300533) @@ -416,20 +416,15 @@ arm_vector_init(vm_offset_t va, int whic if (va == ARM_VECTORS_HIGH) { /* - * Assume the MD caller knows what it's doing here, and - * really does want the vector page relocated. + * Enable high vectors in the system control reg (SCTLR). + * + * Assume the MD caller knows what it's doing here, and really + * does want the vector page relocated. * * Note: This has to be done here (and not just in * cpu_setup()) because the vector page needs to be * accessible *before* cpu_startup() is called. * Think ddb(9) ... - * - * NOTE: If the CPU control register is not readable, - * this will totally fail! We'll just assume that - * any system that has high vector support has a - * readable CPU control register, for now. If we - * ever encounter one that does not, we'll have to - * rethink this. */ cpu_control(CPU_CONTROL_VECRELOC, CPU_CONTROL_VECRELOC); } Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Mon May 23 19:52:08 2016 (r300532) +++ head/sys/arm/at91/at91_machdep.c Mon May 23 20:07:17 2016 (r300533) @@ -584,6 +584,10 @@ initarm(struct arm_boot_params *abp) memsize = 16 * 1024 * 1024; } + /* Enable MMU (set SCTLR), and do other cpu-specific setup. */ + cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); + cpu_setup(); + /* * Pages were allocated during the secondary bootstrap for the * stacks for different CPU modes. @@ -592,9 +596,6 @@ initarm(struct arm_boot_params *abp) * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - cpu_setup(); - set_stackptrs(0); /* Modified: head/sys/arm/cavium/cns11xx/econa_machdep.c ============================================================================== --- head/sys/arm/cavium/cns11xx/econa_machdep.c Mon May 23 19:52:08 2016 (r300532) +++ head/sys/arm/cavium/cns11xx/econa_machdep.c Mon May 23 20:07:17 2016 (r300533) @@ -272,6 +272,9 @@ initarm(struct arm_boot_params *abp) mem_info = ((*ddr) >> 4) & 0x3; memsize = (8< #include +#include #include #include #include #include +#if __ARM_ARCH < 6 +#include +#else +#include +#endif + #include /* XXX */ #include /* XXX eventually this should be eliminated */ #include @@ -453,9 +460,9 @@ DB_SHOW_COMMAND(cp15, db_show_cp15) __asm __volatile("mrc p15, 0, %0, c0, c0, 1" : "=r" (reg)); db_printf("Current Cache Lvl ID: 0x%08x\n",reg); - __asm __volatile("mrc p15, 0, %0, c1, c0, 0" : "=r" (reg)); + reg = cp15_sctlr_get(); db_printf("Ctrl: 0x%08x\n",reg); - __asm __volatile("mrc p15, 0, %0, c1, c0, 1" : "=r" (reg)); + reg = cp15_actlr_get(); db_printf("Aux Ctrl: 0x%08x\n",reg); __asm __volatile("mrc p15, 0, %0, c0, c1, 0" : "=r" (reg)); From owner-svn-src-head@freebsd.org Mon May 23 20:12:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE6D8B46B98; Mon, 23 May 2016 20:12:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0CEB128A; Mon, 23 May 2016 20:12:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NKCcJ1069291; Mon, 23 May 2016 20:12:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NKCcS1069290; Mon, 23 May 2016 20:12:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605232012.u4NKCcS1069290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 23 May 2016 20:12:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300534 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 20:12:39 -0000 Author: ian Date: Mon May 23 20:12:38 2016 New Revision: 300534 URL: https://svnweb.freebsd.org/changeset/base/300534 Log: Oops, fix a paste-o commited in r300533. Modified: head/sys/arm/arm/cpufunc_asm_xscale.S Modified: head/sys/arm/arm/cpufunc_asm_xscale.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_xscale.S Mon May 23 20:07:17 2016 (r300533) +++ head/sys/arm/arm/cpufunc_asm_xscale.S Mon May 23 20:12:38 2016 (r300534) @@ -117,7 +117,7 @@ ENTRY(xscale_control) teq r2, r3 /* Only write if there was a change */ mcrne p15, 0, r0, c7, c5, 6 /* Invalidate the BTB */ - mcrne CP15_SCTLR(r3) /* Write new control register */ + mcrne CP15_SCTLR(r2) /* Write new control register */ mov r0, r3 /* Return old value */ CPWAIT_AND_RETURN(r1) From owner-svn-src-head@freebsd.org Mon May 23 20:13:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93953B46C0E; Mon, 23 May 2016 20:13:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6398C1471; Mon, 23 May 2016 20:13:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NKDHDx069360; Mon, 23 May 2016 20:13:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NKDHif069359; Mon, 23 May 2016 20:13:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605232013.u4NKDHif069359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 23 May 2016 20:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300535 - head/sys/arm/cavium/cns11xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 20:13:18 -0000 Author: ian Date: Mon May 23 20:13:17 2016 New Revision: 300535 URL: https://svnweb.freebsd.org/changeset/base/300535 Log: Spaces->tab in comment. Modified: head/sys/arm/cavium/cns11xx/econa_machdep.c Modified: head/sys/arm/cavium/cns11xx/econa_machdep.c ============================================================================== --- head/sys/arm/cavium/cns11xx/econa_machdep.c Mon May 23 20:12:38 2016 (r300534) +++ head/sys/arm/cavium/cns11xx/econa_machdep.c Mon May 23 20:13:17 2016 (r300535) @@ -272,7 +272,7 @@ initarm(struct arm_boot_params *abp) mem_info = ((*ddr) >> 4) & 0x3; memsize = (8< Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54CCFB46C7C; Mon, 23 May 2016 20:15:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2613E1731; Mon, 23 May 2016 20:15:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NKF8WN069488; Mon, 23 May 2016 20:15:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NKF8Vn069487; Mon, 23 May 2016 20:15:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605232015.u4NKF8Vn069487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 23 May 2016 20:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300536 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 20:15:09 -0000 Author: markj Date: Mon May 23 20:15:08 2016 New Revision: 300536 URL: https://svnweb.freebsd.org/changeset/base/300536 Log: Acquire the nd6 lock in the prefix list sysctl handler. The nd6 lock will be used to synchronize access to the NDP prefix list. MFC after: 2 weeks Tested by: Jason Wolfe (as part of a larger change) Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon May 23 20:13:17 2016 (r300535) +++ head/sys/netinet6/nd6.c Mon May 23 20:15:08 2016 (r300536) @@ -2610,15 +2610,17 @@ nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) if (req->newptr) return (EPERM); + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + bzero(&p, sizeof(p)); p.origin = PR_ORIG_RA; bzero(&s6, sizeof(s6)); s6.sin6_family = AF_INET6; s6.sin6_len = sizeof(s6); - /* - * XXX locking - */ + ND6_RLOCK(); LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { p.prefix = pr->ndpr_prefix; if (sa6_recoverscope(&p.prefix)) { @@ -2651,7 +2653,7 @@ nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) p.advrtrs++; error = SYSCTL_OUT(req, &p, sizeof(p)); if (error != 0) - return (error); + break; LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { s6.sin6_addr = pfr->router->rtaddr; if (sa6_recoverscope(&s6)) @@ -2660,8 +2662,9 @@ nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) ip6_sprintf(ip6buf, &pfr->router->rtaddr)); error = SYSCTL_OUT(req, &s6, sizeof(s6)); if (error != 0) - return (error); + break; } } - return (0); + ND6_RUNLOCK(); + return (error); } From owner-svn-src-head@freebsd.org Mon May 23 20:18:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69C24B46CF8; Mon, 23 May 2016 20:18:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C3051AE7; Mon, 23 May 2016 20:18:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NKIBWH069623; Mon, 23 May 2016 20:18:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NKIBfR069622; Mon, 23 May 2016 20:18:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605232018.u4NKIBfR069622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 23 May 2016 20:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300537 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 20:18:12 -0000 Author: markj Date: Mon May 23 20:18:11 2016 New Revision: 300537 URL: https://svnweb.freebsd.org/changeset/base/300537 Log: Mark the prefix and default router list sysctl handlers MPSAFE. MFC after: 2 weeks Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon May 23 20:15:08 2016 (r300536) +++ head/sys/netinet6/nd6.c Mon May 23 20:18:11 2016 (r300537) @@ -2548,13 +2548,16 @@ clear_llinfo_pqueue(struct llentry *ln) static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS); static int nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS); -#ifdef SYSCTL_DECL + SYSCTL_DECL(_net_inet6_icmp6); -#endif -SYSCTL_NODE(_net_inet6_icmp6, ICMPV6CTL_ND6_DRLIST, nd6_drlist, - CTLFLAG_RD, nd6_sysctl_drlist, ""); -SYSCTL_NODE(_net_inet6_icmp6, ICMPV6CTL_ND6_PRLIST, nd6_prlist, - CTLFLAG_RD, nd6_sysctl_prlist, ""); +SYSCTL_PROC(_net_inet6_icmp6, ICMPV6CTL_ND6_DRLIST, nd6_drlist, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, nd6_sysctl_drlist, "S,in6_defrouter", + "NDP default router list"); +SYSCTL_PROC(_net_inet6_icmp6, ICMPV6CTL_ND6_PRLIST, nd6_prlist, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, nd6_sysctl_prlist, "S,in6_prefix", + "NDP prefix list"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXQLEN, nd6_maxqueuelen, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_maxqueuelen), 1, ""); SYSCTL_INT(_net_inet6_icmp6, OID_AUTO, nd6_gctimer, From owner-svn-src-head@freebsd.org Mon May 23 20:19:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57188B46E53; Mon, 23 May 2016 20:19:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 298241D64; Mon, 23 May 2016 20:19:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NKJ7DU069886; Mon, 23 May 2016 20:19:07 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NKJ7ad069885; Mon, 23 May 2016 20:19:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605232019.u4NKJ7ad069885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 23 May 2016 20:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300538 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 20:19:08 -0000 Author: asomers Date: Mon May 23 20:19:07 2016 New Revision: 300538 URL: https://svnweb.freebsd.org/changeset/base/300538 Log: Commit a missing change from 299090 tests/sys/kern/Makefile Reenable a disabled compiler warning, the need for which was eliminated by r299090. Reviewed by: ngie MFC after: 4 weeks X-MFC-With: 299090 Sponsored by: Spectra Logic Corp Modified: head/tests/sys/kern/Makefile Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Mon May 23 20:18:11 2016 (r300537) +++ head/tests/sys/kern/Makefile Mon May 23 20:19:07 2016 (r300538) @@ -26,8 +26,6 @@ LIBADD.mqueue_test+= rt # included in userland. But as far as subr_unit_test goes, they're effectively # static. So it's ok to disable -Wmissing-prototypes for this program. CFLAGS.subr_unit.c+= -Wno-missing-prototypes -# XXX: -Wno-sign-compare will be eliminated as part of D6004 -CFLAGS.subr_unit.c+= -Wno-sign-compare SRCS.subr_unit_test+= subr_unit.c WARNS?= 5 From owner-svn-src-head@freebsd.org Mon May 23 20:28:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1556B470C8; Mon, 23 May 2016 20:28:53 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99BA31333; Mon, 23 May 2016 20:28:52 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 336021FE024; Mon, 23 May 2016 22:28:50 +0200 (CEST) Subject: Re: svn commit: r300496 - in head/sys/compat/linuxkpi/common: include/linux src To: cem@FreeBSD.org References: <201605231203.u4NC3eHI010991@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <0d27a519-b1ca-d6da-b3e3-8a7776c5e9e3@selasky.org> Date: Mon, 23 May 2016 22:32:10 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 20:28:53 -0000 On 05/23/16 21:03, Conrad Meyer wrote: > Didn't we already have list_sort in linuxkpi? Maybe I'm confused. No, it is new from what I can see. --HPS From owner-svn-src-head@freebsd.org Mon May 23 20:29:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 701A2B4711B; Mon, 23 May 2016 20:29:19 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39852164E; Mon, 23 May 2016 20:29:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 242F31FE024; Mon, 23 May 2016 22:29:17 +0200 (CEST) Subject: Re: svn commit: r300493 - head/sys/compat/linuxkpi/common/include/linux To: John Baldwin References: <201605231150.u4NBo56Y005227@repo.freebsd.org> <3455323.tBydyU5thm@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <28d6d086-7195-fd81-12b5-125e6b99000a@selasky.org> Date: Mon, 23 May 2016 22:32:38 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <3455323.tBydyU5thm@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 20:29:19 -0000 On 05/23/16 19:00, John Baldwin wrote: > On Monday, May 23, 2016 11:50:05 AM Hans Petter Selasky wrote: >> Author: hselasky >> Date: Mon May 23 11:50:05 2016 >> New Revision: 300493 >> URL: https://svnweb.freebsd.org/changeset/base/300493 >> >> Log: >> Add support for "cdev_add_ext()" to the LinuxKPI. >> >> Obtained from: kmacy @ >> MFC after: 1 week >> Sponsored by: Mellanox Technologies >> >> Modified: >> head/sys/compat/linuxkpi/common/include/linux/cdev.h >> >> Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h >> ============================================================================== >> --- head/sys/compat/linuxkpi/common/include/linux/cdev.h Mon May 23 11:47:54 2016 (r300492) >> +++ head/sys/compat/linuxkpi/common/include/linux/cdev.h Mon May 23 11:50:05 2016 (r300493) >> @@ -91,6 +91,18 @@ cdev_add(struct linux_cdev *cdev, dev_t >> return (0); >> } >> >> +static inline int >> +cdev_add_ext(struct linux_cdev *cdev, dev_t dev, uid_t uid, gid_t gid, int mode) >> +{ >> + cdev->cdev = make_dev(&linuxcdevsw, MINOR(dev), uid, gid, mode, >> + "%s/%d", kobject_name(&cdev->kobj), MINOR(dev)); >> + cdev->dev = dev; >> + cdev->cdev->si_drv1 = cdev; >> + >> + kobject_get(cdev->kobj.parent); >> + return (0); > > This should use make_dev_s() instead? > Good idea. I'll fix it. --HPS From owner-svn-src-head@freebsd.org Mon May 23 20:29:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4593BB47120; Mon, 23 May 2016 20:29:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FE4D1652; Mon, 23 May 2016 20:29:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NKTJvH072947; Mon, 23 May 2016 20:29:19 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NKTIjK072941; Mon, 23 May 2016 20:29:18 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605232029.u4NKTIjK072941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 23 May 2016 20:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300539 - in head: . share/man/man3 sys/kern sys/sys tests/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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 20:29:20 -0000 Author: asomers Date: Mon May 23 20:29:18 2016 New Revision: 300539 URL: https://svnweb.freebsd.org/changeset/base/300539 Log: Add bit_count to the bitstring(3) api Add a bit_count function, which efficiently counts the number of bits set in a bitstring. sys/sys/bitstring.h tests/sys/sys/bitstring_test.c share/man/man3/bitstring.3 Add bit_alloc sys/kern/subr_unit.c Use bit_count instead of a naive counting loop in check_unrhdr, used when INVARIANTS are enabled. The userland test runs about 6x faster in a generic build, or 8.5x faster when built for Nehalem, which has the POPCNT instruction. sys/sys/param.h Bump __FreeBSD_version due to the addition of bit_alloc UPDATING Add a note about the ABI incompatibility of the bitstring(3) changes, as suggested by lidl. Suggested by: gibbs Reviewed by: gibbs, ngie MFC after: 9 days X-MFC-With: 299090, 300538 Relnotes: yes Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6255 Modified: head/UPDATING head/share/man/man3/bitstring.3 head/sys/kern/subr_unit.c head/sys/sys/bitstring.h head/sys/sys/param.h head/tests/sys/sys/bitstring_test.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon May 23 20:19:07 2016 (r300538) +++ head/UPDATING Mon May 23 20:29:18 2016 (r300539) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160523: + The bitstring(3) API has been updated with new functionality and + improved performance. But it is binary-incompatible with the old API. + Objects built with the new headers may not be linked against objects + built with the old headers. + 20160520: The brk and sbrk functions have been removed from libc on arm64. Binutils from ports has been updated to not link to these Modified: head/share/man/man3/bitstring.3 ============================================================================== --- head/share/man/man3/bitstring.3 Mon May 23 20:19:07 2016 (r300538) +++ head/share/man/man3/bitstring.3 Mon May 23 20:29:18 2016 (r300539) @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" Copyright (c) 2014 Spectra Logic Corporation +.\" Copyright (c) 2014,2016 Spectra Logic Corporation .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -58,12 +58,13 @@ .\" @(#)bitstring.3 8.1 (Berkeley) 7/19/93 .\" $FreeBSD$ .\" -.Dd May 4, 2016 +.Dd May 23, 2016 .Dt BITSTRING 3 .Os .Sh NAME .Nm bit_alloc , .Nm bit_clear , +.Nm bit_count , .Nm bit_decl , .Nm bit_ffc , .Nm bit_ffs , @@ -84,6 +85,8 @@ .Ft void .Fn bit_clear "bitstr_t *name" "int bit" .Ft void +.Fn bit_count "bitstr_t *name" "int count" "int nbits" "int *value" +.Ft void .Fn bit_ffc "bitstr_t *name" "int nbits" "int *value" .Ft void .Fn bit_ffs "bitstr_t *name" "int nbits" "int *value" @@ -225,6 +228,17 @@ the location referenced by .Fa value is set to \-1. .Pp +The +.Fn bit_count +function stores in the location referenced by +.Fa value +the number of bits set in the array of +.Fa nbits +bits referenced by +.Fa name , +at or after the zero-based bit index +.Fa start . +.Pp The arguments in bit string macros are evaluated only once and may safely have side effects. .Sh EXAMPLES Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Mon May 23 20:19:07 2016 (r300538) +++ head/sys/kern/subr_unit.c Mon May 23 20:29:18 2016 (r300539) @@ -224,7 +224,8 @@ check_unrhdr(struct unrhdr *uh, int line { struct unr *up; struct unrb *ub; - u_int x, y, z, w; + int w; + u_int y, z; y = uh->first; z = 0; @@ -237,9 +238,7 @@ check_unrhdr(struct unrhdr *uh, int line up->len, NBITS, line)); z++; w = 0; - for (x = 0; x < up->len; x++) - if (bit_test(ub->map, x)) - w++; + bit_count(ub->map, 0, up->len, &w); y += w; } else if (up->ptr != NULL) y += up->len; Modified: head/sys/sys/bitstring.h ============================================================================== --- head/sys/sys/bitstring.h Mon May 23 20:19:07 2016 (r300538) +++ head/sys/sys/bitstring.h Mon May 23 20:29:18 2016 (r300539) @@ -65,6 +65,7 @@ #ifdef _KERNEL #include #include +#include #endif typedef unsigned long bitstr_t; @@ -202,7 +203,7 @@ bit_ffs_at(bitstr_t *_bitstr, int _start _test &= _bit_make_mask(_start, _BITSTR_BITS - 1); while (_test == 0 && _curbitstr < _stopbitstr) _test = *(++_curbitstr); - + _offset = ffsl(_test); _value = ((_curbitstr - _bitstr) * _BITSTR_BITS) + _offset - 1; if (_offset == 0 || _value >= _nbits) @@ -231,7 +232,7 @@ bit_ffc_at(bitstr_t *_bitstr, int _start _test |= _bit_make_mask(0, _start - 1); while (_test == _BITSTR_MASK && _curbitstr < _stopbitstr) _test = *(++_curbitstr); - + _offset = ffsl(~_test); _value = ((_curbitstr - _bitstr) * _BITSTR_BITS) + _offset - 1; if (_offset == 0 || _value >= _nbits) @@ -256,4 +257,40 @@ bit_ffc(bitstr_t *_bitstr, int _nbits, i bit_ffc_at(_bitstr, /*start*/0, _nbits, _result); } +/* Count the number of bits set in a bitstr of size _nbits at or after _start */ +static inline void +bit_count(bitstr_t *_bitstr, int _start, int _nbits, int *_result) +{ + bitstr_t *_curbitstr, mask; + int _value = 0, curbitstr_len; + + if (_start >= _nbits) + goto out; + + _curbitstr = _bitstr + _bit_idx(_start); + _nbits -= _BITSTR_BITS * _bit_idx(_start); + _start -= _BITSTR_BITS * _bit_idx(_start); + + if (_start > 0) { + curbitstr_len = (int)_BITSTR_BITS < _nbits ? + (int)_BITSTR_BITS : _nbits; + mask = _bit_make_mask(_start, _bit_offset(curbitstr_len - 1)); + _value += __bitcountl(*_curbitstr & mask); + _curbitstr++; + _nbits -= _BITSTR_BITS; + } + while (_nbits >= (int)_BITSTR_BITS) { + _value += __bitcountl(*_curbitstr); + _curbitstr++; + _nbits -= _BITSTR_BITS; + } + if (_nbits > 0) { + mask = _bit_make_mask(0, _bit_offset(_nbits - 1)); + _value += __bitcountl(*_curbitstr & mask); + } + +out: + *_result = _value; +} + #endif /* _SYS_BITSTRING_H_ */ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon May 23 20:19:07 2016 (r300538) +++ head/sys/sys/param.h Mon May 23 20:29:18 2016 (r300539) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100111 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100112 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/tests/sys/sys/bitstring_test.c ============================================================================== --- head/tests/sys/sys/bitstring_test.c Mon May 23 20:19:07 2016 (r300538) +++ head/tests/sys/sys/bitstring_test.c Mon May 23 20:29:18 2016 (r300539) @@ -342,6 +342,67 @@ BITSTRING_TC_DEFINE(bit_nset) } } +BITSTRING_TC_DEFINE(bit_count) +/* bitstr_t *bitstr, int nbits, const char *memloc */ +{ + int result, s, e, expected; + + /* Empty bitstr */ + memset(bitstr, 0, bitstr_size(nbits)); + bit_count(bitstr, 0, nbits, &result); + ATF_CHECK_MSG(0 == result, + "bit_count_%d_%s_%s: Failed with result %d", + nbits, "clear", memloc, result); + + /* Full bitstr */ + memset(bitstr, 0xFF, bitstr_size(nbits)); + bit_count(bitstr, 0, nbits, &result); + ATF_CHECK_MSG(nbits == result, + "bit_count_%d_%s_%s: Failed with result %d", + nbits, "set", memloc, result); + + /* Invalid _start value */ + memset(bitstr, 0xFF, bitstr_size(nbits)); + bit_count(bitstr, nbits, nbits, &result); + ATF_CHECK_MSG(0 == result, + "bit_count_%d_%s_%s: Failed with result %d", + nbits, "invalid_start", memloc, result); + + /* Alternating bitstr, starts with 0 */ + memset(bitstr, 0xAA, bitstr_size(nbits)); + bit_count(bitstr, 0, nbits, &result); + ATF_CHECK_MSG(nbits / 2 == result, + "bit_count_%d_%s_%d_%s: Failed with result %d", + nbits, "alternating", 0, memloc, result); + + /* Alternating bitstr, starts with 1 */ + memset(bitstr, 0x55, bitstr_size(nbits)); + bit_count(bitstr, 0, nbits, &result); + ATF_CHECK_MSG((nbits + 1) / 2 == result, + "bit_count_%d_%s_%d_%s: Failed with result %d", + nbits, "alternating", 1, memloc, result); + + /* Varying start location */ + memset(bitstr, 0xAA, bitstr_size(nbits)); + for (s = 0; s < nbits; s++) { + expected = s % 2 == 0 ? (nbits - s) / 2 : (nbits - s + 1) / 2; + bit_count(bitstr, s, nbits, &result); + ATF_CHECK_MSG(expected == result, + "bit_count_%d_%s_%d_%s: Failed with result %d", + nbits, "vary_start", s, memloc, result); + } + + /* Varying end location */ + memset(bitstr, 0xAA, bitstr_size(nbits)); + for (e = 0; e < nbits; e++) { + bit_count(bitstr, 0, e, &result); + ATF_CHECK_MSG(e / 2 == result, + "bit_count_%d_%s_%d_%s: Failed with result %d", + nbits, "vary_end", e, memloc, result); + } + +} + ATF_TP_ADD_TCS(tp) { @@ -354,6 +415,7 @@ ATF_TP_ADD_TCS(tp) BITSTRING_TC_ADD(tp, bit_ffc_at); BITSTRING_TC_ADD(tp, bit_nclear); BITSTRING_TC_ADD(tp, bit_nset); + BITSTRING_TC_ADD(tp, bit_count); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Mon May 23 20:30:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A03C7B471EF; Mon, 23 May 2016 20:30:17 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x22a.google.com (mail-oi0-x22a.google.com [IPv6:2607:f8b0:4003:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63AA519B5; Mon, 23 May 2016 20:30:17 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x22a.google.com with SMTP id b65so152444488oia.1; Mon, 23 May 2016 13:30:17 -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; bh=EzJGHdNFwfJRUF+LeiBAXy5nx39idkDpEf1UYkH7eUc=; b=aiyfpFPJhv7vE/vuk/DIP7MjQLeh5THKMusQcfXUChM4S383m/R19NBXJNweNjJZaG hh7EqK01Zt/jADBYGSYfZr9fJPkYalkBUIFOE/FB07VauxN6YKSeEkfdCSvfHKd9iEBt 0lC/lZ02UBcLh/qpxsgXu13Y52JrucBgMovoGTgelGgPNT2Evo2xMdL/GOZvxHW8U5S0 UwTk8W+u3Gzu2Vy1/xJtlNYH4JXL1O/HRMyg4mStSIQp32Mb0jpKtpx7qIouzwYmB7lV gr25Iico7x7/siq7BICqnTAduwWf1LgP/Jg/tq7h1BxYA/49p2OFBqDMH++Y+9Ui0sed imwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=EzJGHdNFwfJRUF+LeiBAXy5nx39idkDpEf1UYkH7eUc=; b=CGmIaQxRx87C7fWXocDD90Y+xs0SJ2ZmacmdaRN8HUqEWK1u+H88ZBxacviGaBRM6v 3AOeoroBDreo6w4HcstV4jIza9HbgBr22Pz3Xa23BQz89Sxl9WTbaAKAYIYozIXHVhoF kxPtuLxvvtRkPTUcLd+ulGX0JTlyi12szCp0i6u2FYq0WkFbOc+6tFjWresj70EtOrdI +l6aXQBYXqqpCWCQzOPJscfV/vOb47bwpX+svNpL0ihLwDD/bPzM09Xht6HWhlDWA7dI ZqWRCrCjtgkxrrvJQIC1BZ5adGd06jIcXLfEpQSUxpJegVsLf8fXzN1FTlZQnCx+YgeO xvIg== X-Gm-Message-State: ALyK8tIH1KQ0wNDao5ih2wcPrASvgJam9mdS6rrLFlvUbwYK24kaOGwxB11dc/iCqri1goNpfBOMxmD2yOT+Mg== MIME-Version: 1.0 X-Received: by 10.157.27.173 with SMTP id z42mr493194otd.192.1464035416580; Mon, 23 May 2016 13:30:16 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.4.200 with HTTP; Mon, 23 May 2016 13:30:16 -0700 (PDT) In-Reply-To: <684f4a82-f48c-b2bb-6a72-5c1dfea11a39@pix.net> References: <201605042234.u44MYBMX054443@repo.freebsd.org> <2368543.Vvp613SNcD@ralph.baldwin.cx> <684f4a82-f48c-b2bb-6a72-5c1dfea11a39@pix.net> Date: Mon, 23 May 2016 14:30:16 -0600 X-Google-Sender-Auth: uNB6gvzIkIIOrgOc5nyA8TuCFDM Message-ID: Subject: Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol From: Alan Somers To: Kurt Lidl Cc: John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 20:30:17 -0000 On Fri, May 6, 2016 at 8:45 AM, Kurt Lidl wrote: > On 5/5/16 12:31 PM, John Baldwin wrote: > >> On Wednesday, May 04, 2016 10:34:11 PM Alan Somers wrote: >> >>> Author: asomers >>> Date: Wed May 4 22:34:11 2016 >>> New Revision: 299090 >>> URL: https://svnweb.freebsd.org/changeset/base/299090 >>> >>> Log: >>> Improve performance and functionality of the bitstring(3) api >>> >>> Two new functions are provided, bit_ffs_at() and bit_ffc_at(), which >>> allow >>> for efficient searching of set or cleared bits starting from any bit >>> offset >>> within the bit string. >>> >>> Performance is improved by operating on longs instead of bytes and >>> using >>> ffsl() for searches within a long. ffsl() is a compiler builtin in both >>> clang and gcc for most architectures, converting what was a brute force >>> while loop search into a couple of instructions. >>> >>> All of the bitstring(3) API continues to be contained in the header >>> file. >>> Some of the functions are large enough that perhaps they should be >>> uninlined >>> and moved to a library, but that is beyond the scope of this commit. >>> >> >> Doesn't switching from bytes to longs break the ABI? That is, setting >> bit 9 >> now has a different representation on big-endian systems (0x00 0x01 >> before, >> now 0x00 0x00 0x01 0x00 on 32-bit BE, and 4 more leading 0 bytes on >> 64-bit). >> This means you can't have an object file compiled against the old header >> pass a bitstring to an object file compiled against the new header on >> big-endian >> systems. >> >> Even on little-endian systems if an old object file allocates storage for >> a >> bitstring the new code might read off the end of it and fault (or return >> garbage if bits are set in the extra bytes it reads off the end)? >> >> Is the API is so little used we don't care? >> >> > Just as a note - at my prior job (Pi-Coral, now defunct) we used this > API everywhere in the dataplane code of our product. Since the company > is gone, that particular use-case doesn't matter anymore. > > At the very least, this deserves a mention in the release notes, and > also UPDATING! > > -Kurt > > UPDATING is updated as of r300539. Any objection to merging this to stable/10? From owner-svn-src-head@freebsd.org Mon May 23 20:47:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29281B47940; Mon, 23 May 2016 20:47:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D8CC4186D; Mon, 23 May 2016 20:47:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA13134; Mon, 23 May 2016 23:47:10 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1b4wko-0002ya-4p; Mon, 23 May 2016 23:47:10 +0300 Subject: Re: svn commit: r300372 - in head/sys: kern sys To: John Baldwin References: <201605211451.u4LEpopu074806@repo.freebsd.org> <8562415.t0UfIz1aLk@ralph.baldwin.cx> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Andriy Gapon Message-ID: Date: Mon, 23 May 2016 23:46:14 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <8562415.t0UfIz1aLk@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 20:47:19 -0000 I don't know, I was just a proxy. Kip is the author. On 23/05/2016 21:43, John Baldwin wrote: > On Saturday, May 21, 2016 02:51:50 PM Andriy Gapon wrote: >> Author: avg >> Date: Sat May 21 14:51:49 2016 >> New Revision: 300372 >> URL: https://svnweb.freebsd.org/changeset/base/300372 >> >> Log: >> fix loss of taskqueue wakeups (introduced in r300113) >> >> Submitted by: kmacy >> Tested by: dchagin >> >> Modified: head/sys/sys/taskqueue.h >> ============================================================================== >> --- head/sys/sys/taskqueue.h Sat May 21 11:40:41 2016 (r300371) >> +++ head/sys/sys/taskqueue.h Sat May 21 14:51:49 2016 (r300372) >> @@ -114,7 +113,6 @@ void taskqueue_thread_enqueue(void *cont >> */ >> #define TASK_INIT(task, priority, func, context) do { \ >> (task)->ta_pending = 0; \ >> - (task)->ta_flags = 0; \ >> (task)->ta_priority = (priority); \ >> (task)->ta_func = (func); \ >> (task)->ta_context = (context); \ >> @@ -224,7 +222,6 @@ int taskqgroup_adjust(struct taskqgroup >> >> #define GTASK_INIT(task, priority, func, context) do { \ >> (task)->ta_pending = 0; \ >> - (task)->ta_flags = TASK_SKIP_WAKEUP; \ >> (task)->ta_priority = (priority); \ >> (task)->ta_func = (func); \ >> (task)->ta_context = (context); \ > > Do we still need GTASK_INIT() now or can relevant tasks now use > TASK_INIT instead and GTASK_INIT be retired? > -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon May 23 21:29:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2034AB47531; Mon, 23 May 2016 21:29:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E57791A2D; Mon, 23 May 2016 21:29:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NLTw0i094361; Mon, 23 May 2016 21:29:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NLTwpF094360; Mon, 23 May 2016 21:29:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605232129.u4NLTwpF094360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 23 May 2016 21:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300540 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 21:29:59 -0000 Author: bdrewery Date: Mon May 23 21:29:57 2016 New Revision: 300540 URL: https://svnweb.freebsd.org/changeset/base/300540 Log: Be more clear about LOCKLEAF being exclusive and add LOCKSHARED. Modified: head/share/man/man9/namei.9 Modified: head/share/man/man9/namei.9 ============================================================================== --- head/share/man/man9/namei.9 Mon May 23 20:29:18 2016 (r300539) +++ head/share/man/man9/namei.9 Mon May 23 21:29:57 2016 (r300540) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2015 +.Dd May 23, 2015 .Dt NAMEI 9 .Os .Sh NAME @@ -121,8 +121,12 @@ function takes the following set of that influence its operation: .Bl -tag -width ".Dv WANTPARENT" .It Dv LOCKLEAF -Lock vnode on return. -This is a full lock of the vnode; the +Lock vnode on return with +.Dv LK_EXCLUSIVE +unless +.Dv LOCKSHARED +is also set. +The .Xr VOP_UNLOCK 9 should be used to release the lock (or @@ -149,6 +153,19 @@ or .Xr VOP_UNLOCK 9 and .Xr vrele 9 . +.It Dv LOCKSHARED +Lock vnode on return with +.Dv LK_SHARED . +The +.Xr VOP_UNLOCK 9 +should be used +to release the lock (or +.Xr vput 9 +which is equivalent to calling +.Xr VOP_UNLOCK 9 +followed by +.Xr vrele 9 , +all in one). .It Dv WANTPARENT This flag allows the .Fn namei From owner-svn-src-head@freebsd.org Mon May 23 22:01:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 112E7B471D5; Mon, 23 May 2016 22:01:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A53811863; Mon, 23 May 2016 22:01:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NM16fr005767; Mon, 23 May 2016 22:01:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NM1639005766; Mon, 23 May 2016 22:01:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605232201.u4NM1639005766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 23 May 2016 22:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300542 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 22:01:08 -0000 Author: bapt Date: Mon May 23 22:01:06 2016 New Revision: 300542 URL: https://svnweb.freebsd.org/changeset/base/300542 Log: Update pci_vendors to 2016.05.23 Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Mon May 23 21:58:47 2016 (r300541) +++ head/share/misc/pci_vendors Mon May 23 22:01:06 2016 (r300542) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2016.02.27 -# Date: 2016-02-27 03:15:01 +# Version: 2016.05.23 +# Date: 2016-05-23 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -273,6 +273,7 @@ 103c 12c5 Ultra320 SCSI [A7173A] 103c 1323 Core I/O LAN/SCSI Combo [AB314A] 103c 3108 Single Channel Ultra320 SCSI HBA G2 + 103c 322a SC11Xe Ultra320 Single Channel PCIe x4 SCSI Host Bus Adapter (412911-B21) 124b 1170 PMC-USCSI320 # VMware's emulation of this device. Was missing from the list. 15ad 1976 LSI Logic Parallel SCSI Controller @@ -480,6 +481,21 @@ 007c MegaRAID SAS 1078DE 1014 0395 ServeRAID-AR10is SAS/SATA Controller 007e SSS6200 PCI-Express Flash SSD + 1000 0504 Nytro NWD-BLP4-800 + 1000 0507 Nytro NWD-BLP4-1600 + 1000 0581 Nytro NWD-BLP4-400 + 1000 100d Nytro NWD-BFH6-1200 + 1000 100e Nytro NWD-BFH8-1600 + 1000 107e Nytro NWD-BFH8-3200 + 1000 1310 Nytro XP6302-8B1536 + 1000 1311 Nytro XP6302-8B2048 + 1000 1314 Nytro XP6302-8B4096 + 1000 150c Nytro XP6210-4A2048 + 1000 150f Nytro XP6210-4B2048 + 1000 160b Nytro XP6209-4A1024 + 1000 1613 Nytro XP6209-4B2048 + 108e 050a Nytro ELP4x200_4d_n + 108e 0581 Nytro ELP4x100_4d_n 0080 SAS2208 PCI-Express Fusion-MPT SAS-2 0081 SAS2208 PCI-Express Fusion-MPT SAS-2 0082 SAS2208 PCI-Express Fusion-MPT SAS-2 @@ -1509,6 +1525,8 @@ 6646 Bonaire XT [Radeon R9 M280X] 6647 Bonaire PRO [Radeon R9 M270X] 6649 Bonaire [FirePro W5100] + 1002 0b0c FirePro W4300 + 103c 0b0c Bonaire [FirePro W4300] 6650 Bonaire 6651 Bonaire 6658 Bonaire XTX [Radeon R7 260X/360] @@ -2085,6 +2103,7 @@ 679f Tahiti 67a0 Hawaii XT GL [FirePro W9100] 1002 0335 FirePro S9150 + 1002 0735 FirePro S9170 1028 031f FirePro W9100 1028 0335 FirePro S9150 67a1 Hawaii PRO GL [FirePro W8100] @@ -2094,30 +2113,53 @@ 67a8 Hawaii 67a9 Hawaii 67aa Hawaii - 67b0 Hawaii XT [Radeon R9 290X] + 67b0 Hawaii XT / Grenada XT [Radeon R9 290X/390X] + 1028 0b00 Grenada XT [Radeon R9 390X] + 103c 6566 Radeon R9 390X 1043 046a R9 290X DirectCU II 1043 046c R9 290X DirectCU II OC 1043 0474 Matrix R9 290X Platinum 1043 0476 ARES III + 1043 04d7 Radeon R9 390X + 1043 04db Radeon R9 390X + 1043 04df Radeon R9 390X + 1043 04e9 Radeon R9 390X 1458 227c R9 290X WindForce 3X OC 1458 2281 R9 290X WindForce 3X OC 1458 228c R9 290X WindForce 3X 1458 228d R9 290X WindForce 3X OC 1458 2290 R9 290X WindForce 3X + 1458 22bc Radeon R9 390X 1458 22c1 Grenada PRO [Radeon R9 390] + 1462 2015 Radeon R9 390X 1462 3070 R9 290X Lightning 1462 3071 R9 290X Lightning 1462 3072 R9 290X Lightning LE 1462 3080 R9 290X Gaming 1462 3082 R9 290X Gaming OC 148c 2347 Devil 13 Dual Core R9 290X + 148c 2357 Grenada XT [Radeon R9 390X] 1682 9290 Double Dissipation R9 290X + 1682 9395 Grenada XT [Radeon R9 390X] + 174b 0e34 Radeon R9 390X 174b e282 Vapor-X R9 290X Tri-X OC 174b e285 R9 290X Tri-X OC + 174b e324 Grenada XT2 [Radeon R9 390X] 1787 2020 R9 290X IceQ X² Turbo - 67b1 Hawaii PRO [Radeon R9 290] + 1787 2357 Grenada XT [Radeon R9 390X] + 67b1 Hawaii PRO [Radeon R9 290/390] + 1043 04dd STRIX R9 390 + 148c 2358 Radeon R9 390 67b9 Vesuvius [Radeon R9 295X2] 67be Hawaii LE + 67c0 Ellesmere [Polaris10] + 67df Ellesmere [Polaris10] + 67e0 Baffin [Polaris11] + 67e1 Baffin [Polaris11] + 67e8 Baffin [Polaris11] + 67e9 Baffin [Polaris11] + 67eb Baffin [Polaris11] + 67ff Baffin [Polaris11] 6800 Wimbledon XT [Radeon HD 7970M] 1002 0124 Radeon HD 7970M 8086 2110 Radeon HD 7970M @@ -2803,8 +2845,15 @@ 6929 Tonga XT GL [FirePro S7150] 692b Tonga PRO GL [FirePro W7100] 692f Tonga XTV GL [FirePro S7150V] - 6938 Tonga XT / Amethyst XT [Radeon R9 380X / R9 M295X Mac Edition] + 6938 Tonga XT / Amethyst XT [Radeon R9 380X / R9 M295X] + 1043 04f5 Radeon R9 380X + 1043 04f7 Radeon R9 380X + 106b 013a Radeon R9 M295X Mac Edition + 1458 22c8 Radeon R9 380X + 148c 2350 Radeon R9 380X + 1682 9385 Radeon R9 380X 174b e308 Radeon R9 380X Nitro 4G D5 + 17af 2006 Radeon R9 380X 6939 Tonga PRO [Radeon R9 285/380] 148c 9380 Radeon R9 380 # Make naming scheme consistent @@ -3279,6 +3328,7 @@ # I have a Tonga card and this is the HDMI Audio part aad8 Tonga HDMI Audio [Radeon R9 285/380] 174b aad8 Radeon R9 285/380 HDMI Audio + aae8 Fiji HDMI/DP Audio Controller ac00 Theater 600 Pro ac02 TV Wonder HD 600 PCIe ac12 Theater HD T507 (DVB-T) TV tuner/capture device @@ -5860,6 +5910,7 @@ 1644 FastLinQ QL45000 Series 100GbE Controller 1077 e4f8 FastLinQ QL45611H 100GbE Adapter 1656 FastLinQ QL45000 Series 25GbE Controller + 1077 02a7 QL45212-DE 25GbE Adapter 1077 e4f6 FastLinQ QL45211H 25GbE Adapter 1077 e4f7 FastLinQ QL45212H 25GbE Adapter 165c FastLinQ QL45000 Series 40GbE Controller (FCoE) @@ -5910,6 +5961,7 @@ 103c 7040 FC1142SR 4Gb 1-port PCIe Fibre Channel Host Bus Adapter [HPAE311A] 2532 ISP2532-based 8Gb Fibre Channel to PCI Express HBA 103c 3262 StorageWorks 81Q + 103c 3263 StorageWorks 82Q 1077 0167 QME2572 Dual Port FC8 HBA Mezzanine 1590 00fc HPE StoreFabric 84Q 8Gb Quad Port Fibre Channel Host Bus Adapter 3022 ISP4022-based Ethernet NIC @@ -7383,7 +7435,7 @@ 10b5 1123 Sectra KK631 encryption board 10b5 9080 9080 [real subsystem ID not set] 12d9 0002 PCI Prosody Card - 12df 4422 4422PCI ["Do-All" Telemetry Data Aquisition System] + 12df 4422 4422PCI ["Do-All" Telemetry Data Acquisition System] 1369 9601 PCX822np 1369 a102 PCX822v2 1369 a201 PCX442 @@ -8079,7 +8131,7 @@ 1043 0c11 A7N8X Mainboard a0a0 03b4 UK79G-1394 motherboard 006a nForce2 AC97 Audio Controler (MCP) - 1043 8095 nForce2 AC97 Audio Controler (MCP) + 1043 8095 nForce2 AC97 Audio Controller (MCP) a0a0 0304 UK79G-1394 motherboard 006b nForce Audio Processing Unit 10de 006b nForce2 MCP Audio Processing Unit @@ -9766,6 +9818,7 @@ 0f01 GF108 [GeForce GT 620] 0f02 GF108 [GeForce GT 730] 0f06 GF108 [GeForce GT 730] + 0fb0 GM200 High Definition Audio 0fbb GM204 High Definition Audio Controller 0fc0 GK107 [GeForce GT 640 OEM] 0fc1 GK107 [GeForce GT 640] @@ -9907,6 +9960,7 @@ 103c 2afb GeForce 705A 17aa 309d GeForce 705A 17aa 30b1 GeForce 800A + 17aa 30f3 GeForce 705A 17aa 36a1 GeForce 800A 107c GF119 [NVS 315] 107d GF119 [NVS 310] @@ -10385,7 +10439,7 @@ 1287 GK208 [GeForce GT 730] 1288 GK208 [GeForce GT 720] 1289 GK208 [GeForce GT 710] - 128b GK208 [GeForce GT 710] + 128b GK208 [GeForce GT 710B] 1290 GK208M [GeForce GT 730M] 103c 2afa GeForce GT 730A 103c 2b04 GeForce GT 730A @@ -10410,6 +10464,9 @@ 1296 GK208M [GeForce 825M] 1298 GK208M [GeForce GT 720M] 1299 GK208M [GeForce 920M] + 17aa 30bb GeForce 920A + 17aa 36a7 GeForce 920A + 17aa 36af GeForce 920M 129a GK208M [GeForce 910M] 12a0 GK208 12b9 GK208GLM [Quadro K610M] @@ -10423,10 +10480,13 @@ 1344 GM108M [GeForce 845M] 1346 GM108M [GeForce 930M] 1347 GM108M [GeForce 940M] - 1348 GM108M [GeForce 945A] + 1348 GM108M [GeForce 945M / 945A] 1349 GM108M [GeForce 930M] 134d GM108M [GeForce 940MX] - 137a GM108GLM [Quadro K620M] + 134e GM108M [GeForce 930MX] + 134f GM108M [GeForce 920MX] + 137a GM108GLM [Quadro K620M / Quadro M500M] + 17aa 505a Quadro M500M 137d GM108M [GeForce 940A] 1380 GM107 [GeForce GTX 750 Ti] 1381 GM107 [GeForce GTX 750] @@ -10444,10 +10504,12 @@ 17aa 362f GeForce GTX 950A 17aa 363f GeForce GTX 950A 17aa 3640 GeForce GTX 950A + 17aa 3647 GeForce GTX 950A 17aa 36b9 GeForce GTX 950A 139b GM107M [GeForce GTX 960M] 103c 2b4c GeForce GTX 960A 139c GM107M [GeForce 940M] + 139d GM107M [GeForce GTX 750 Ti] 13b0 GM107GLM [Quadro M2000M] 13b1 GM107GLM [Quadro M1000M] 13b2 GM107GLM [Quadro M600M] @@ -10473,10 +10535,13 @@ 13f8 GM204GLM [Quadro M5000M] 13f9 GM204GLM [Quadro M4000M] 13fa GM204GLM [Quadro M3000M] + 13fb GM204GLM [Quadro M5500] 1401 GM206 [GeForce GTX 960] 1402 GM206 [GeForce GTX 950] + 1406 GM206 [GeForce GTX 960] 1407 GM206 [GeForce GTX 750 v2] 1427 GM206M [GeForce GTX 965M] + 1430 GM206GL [Quadro M2000] 1431 GM206GL [Tesla M4] 1617 GM204M [GeForce GTX 980M] 1618 GM204M [GeForce GTX 970M] @@ -10486,7 +10551,9 @@ 17c2 GM200 [GeForce GTX TITAN X] 17c8 GM200 [GeForce GTX 980 Ti] 17f0 GM200GL [Quadro M6000] + 17f1 GM200GL [Quadro M6000 24GB] 17fd GM200GL [Tesla M40] + 1b80 GP104 [GeForce GTX 1080] 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -10517,6 +10584,7 @@ e240 OneConnect iSCSI Initiator (Lancer) e260 OneConnect FCoE Initiator (Lancer) e268 OneConnect 10Gb FCoE Converged Network Adapter (Lancer-VF) + e300 Lancer Gen6: LPe32000 Fibre Channel Host Adapter f011 Saturn: LightPulse Fibre Channel Host Adapter f015 Saturn: LightPulse Fibre Channel Host Adapter f085 LP850 Fibre Channel Host Adapter @@ -10739,7 +10807,6 @@ 103c 1611 Pavilion DM1Z-3000 103c 1950 ProBook 450/455 103c 2a6f Asus IPIBL-LB Motherboard - 1043 11f5 A6J-Q008 1043 16d5 U6V/U31J laptop 1043 81aa P5B 1043 82c6 M3A78 Series Motherboard @@ -12982,6 +13049,7 @@ 2a55 88W8864 [Avastar] 802.11ac Wireless 2b36 88W8764 [Avastar] 802.11n Wireless 2b38 88W8897 [AVASTAR] 802.11ac Wireless + 2b40 88W8964 [Avastar] 802.11ac Wireless 4101 OLPC Cafe Controller Secure Digital Controller 4320 88E8001 Gigabit Ethernet Controller 1019 0f38 Marvell 88E8001 Gigabit Ethernet Controller (ECS) @@ -15712,6 +15780,7 @@ 5099 T580-5099 Unified Wire Ethernet Controller 509a T520-509A Unified Wire Ethernet Controller 509b T540-509B Unified Wire Ethernet Controller + 509c T520-509C Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -15757,6 +15826,7 @@ 5499 T580-5099 Unified Wire Ethernet Controller 549a T520-509A Unified Wire Ethernet Controller 549b T540-509B Unified Wire Ethernet Controller + 549c T520-509C Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -15802,6 +15872,7 @@ 5599 T580-5099 Unified Wire Storage Controller 559a T520-509A Unified Wire Storage Controller 559b T540-509B Unified Wire Storage Controller + 559c T520-509C Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -15847,6 +15918,7 @@ 5699 T580-5099 Unified Wire Storage Controller 569a T520-509A Unified Wire Storage Controller 569b T540-509B Unified Wire Storage Controller + 569c T520-509C Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -15931,6 +16003,7 @@ 5899 T580-5099 Unified Wire Ethernet Controller [VF] 589a T520-509A Unified Wire Ethernet Controller [VF] 589b T540-509B Unified Wire Ethernet Controller [VF] + 589c T520-509C Unified Wire Ethernet Controller [VF] a000 PE10K Unified Wire Ethernet Controller 1426 Storage Technology Corp. 1427 Better On-Line Solutions @@ -16115,6 +16188,7 @@ 3064 TPCI100 (2 Slot IndustryPack PCI Carrier) 30c8 TPCI200 4 Slot IndustryPack PCI Carrier 70c8 TPCE200 4 Slot IndustryPack PCIe Carrier + 9177 TXMC375 8 channel RS232/RS422/RS485 programmable serial interface 1499 EMTEC CO., Ltd 149a ANDOR Technology Ltd 149b SEIKO Instruments Inc @@ -16292,7 +16366,7 @@ 1028 0236 PowerEdge R610 BCM5709 Gigabit Ethernet 1028 0237 PowerEdge T610 BCM5709 Gigabit Ethernet 103c 7055 NC382i Integrated Multi-port PCI Express Gigabit Server Adapter - 103c 7059 NC382T PCI Express Dual Port Multifunction Gigabit Server Adapter + 103c 7059 NC382T PCIe Dual Port Multifunction Gigabit Server Adapter 10a9 8027 Quad port Gigabit Ethernet Controller 163a NetXtreme II BCM5709S Gigabit Ethernet 1028 027b PowerEdge M805 Broadcom NetXtreme II BCM5709S @@ -16363,7 +16437,7 @@ 1647 NetXtreme BCM5703 Gigabit Ethernet 0e11 0099 NC7780 1000BaseTX 0e11 009a NC7770 1000BaseTX - 10a9 8010 SGI IO9 Gigabit Ethernet (Copper) + 10a9 8010 IO9 Gigabit Ethernet (Copper) 14e4 0009 BCM5703 1000BaseTX 14e4 000a BCM5703 1000BaseSX 14e4 000b BCM5703 1000BaseTX @@ -16420,6 +16494,7 @@ 1657 NetXtreme BCM5719 Gigabit Ethernet PCIe 103c 169d Ethernet 1Gb 4-port 331FLR Adapter 103c 22be Ethernet 1Gb 4-port 331i Adapter + 103c 3383 Ethernet 1Gb 4-port 331T Adapter 1659 NetXtreme BCM5721 Gigabit Ethernet PCI Express 1014 02c6 eServer xSeries server mainboard 1028 01e6 PowerEdge 860 @@ -16861,6 +16936,7 @@ 43a3 BCM4350 802.11ac Wireless Network Adapter 43a9 BCM43217 802.11b/g/n 43aa BCM43131 802.11b/g/n + 43ae BCM43162 802.11ac Wireless Network Adapter 43b1 BCM4352 802.11ac Wireless Network Adapter 43ba BCM43602 802.11ac Wireless LAN SoC 43bb BCM43602 802.11ac Wireless LAN SoC @@ -17217,6 +17293,7 @@ 4254 980c T980C 8880 CX23887/8 PCIe Broadcast Audio and Video Decoder with 3D Comb 0070 2259 WinTV HVR-1250 + 0070 6a18 WinTV-quadHD 0070 c108 WinTV-HVR-4400-HD model 1278 5654 2389 GoTView X5 DVD Hybrid PCI-E 5654 2390 GoTView X5 3D HYBRID PCI-E @@ -17550,6 +17627,7 @@ 15aa Moreton Bay 15ab Bluesteel Networks Inc 15ac North Atlantic Instruments + 6893 3U OpenVPX Multi-function I/O Board [Model 68C3] 15ad VMware 0405 SVGA II Adapter 0710 SVGA Adapter @@ -17566,6 +17644,7 @@ 07e0 SATA AHCI controller 0801 Virtual Machine Interface 15ad 0800 Hypervisor ROM Interface + 0820 Paravirtual RDMA controller 1977 HD Audio Controller 15ae Amersham Pharmacia Biotech 15b0 Zoltrix International Ltd @@ -17659,6 +17738,9 @@ 7123 NPS-600 network interface VF # SwitchX-2, 40GbE switch c738 MT51136 + c739 MT51136 GW + c838 MT52236 + c839 MT52236 router caf1 ConnectX-4 CAPI Function # Spectrum, 100GbE Switch cb84 MT52100 @@ -18192,6 +18274,7 @@ 1a56 1525 Killer N1525 Wireless-AC 0040 QCA9980/9990 802.11ac Wireless Network Adapter 0041 QCA6164 802.11ac Wireless Network Adapter + 0042 QCA9377 802.11ac Wireless Network Adapter 0050 QCA9887 802.11ac Wireless Network Adapter 0207 AR5210 Wireless Network Adapter [AR5000 802.11a] 1014 AR5212 802.11abg NIC @@ -18403,6 +18486,13 @@ 0095 Octeon III CN78XX Network Processor 0096 Octeon III CN70XX Network Processor 9700 Octeon III CN73XX Network Processor + 9702 CN23XX [LiquidIO II] Intelligent Adapter + 177d 0003 CN2350 [LiquidIO II] 2-port 10GbE Intelligent adapter + 177d 0004 CN2350 [LiquidIO II] 2-port 25GbE Intelligent adapter + 9703 CN23XX [LiquidIO II] NVMe Controller + 9712 CN23XX [LiquidIO II] SRIOV Virtual Function + 177d 0003 CN2350 [LiquidIO II] 2-port 10GbE SRIOV Virtual Function + 9713 CN23XX [LiquidIO II] NVMe SRIOV Virtual Function 9800 Octeon Fusion CNF75XX Processor a001 THUNDERX MRML Bridge a002 THUNDERX PCC Bridge @@ -19065,13 +19155,20 @@ 1924 800c SFN7x22F-R3 Flareon Ultra 7000 Series 10G Adapter 1924 800d SFN7x02F-R3 Flareon 7000 Series 10G Adapter 1924 8010 SFA7942Q-R1 QSFP+ AOE Adapter + 1924 8015 SFA7942Q-A5-0-R1 QSFP+ AOE Adapter 0923 SFC9140 1924 800b SFN7x42Q-R1 Flareon Ultra 7000 Series 10/40G Adapter 1924 800e SFN7x42Q-R2 Flareon Ultra 7000 Series 10/40G Adapter 1924 800f SFN7xx4F-R1 Flareon Ultra 7000 Series 10G Adapter 0a03 SFC9220 + 1924 8011 SFN 8022-R1 Solarflare Flareon 8000 Series 10G Adapter 1924 8012 SFN8522-R1 Flareon Ultra 8000 Series 10G Adapter + 1924 8013 SFN8042-R1 Solarflare Flareon 8000 Series 10/40G Adapter 1924 8014 SFN8542-R1 Flareon Ultra 8000 Series 10/40G Adapter + 1924 8016 SFN8022-R2 Flareon 8000 Series 10G Adapter + 1924 8017 SFN8522-R2 Flareon Ultra 8000 Series 10G Adapter + 1924 8018 SFN8042-R2 Flareon 8000 Series 10/40G Adapter + 1924 8019 SFN8542-R2 Flareon Ultra 8000 Series 10/40G Adapter 1803 SFC9020 Virtual Function [Solarstorm] 1813 SFL9021 Virtual Function [Solarstorm] 1903 SFC9120 Virtual Function @@ -19096,15 +19193,19 @@ 000c Qualcomm MSM6275 UMTS chip 1932 DiBcom 193c MAXIM Integrated Products -193f Comtech AHA Corp. +193f AHA Products Group 0001 AHA36x-PCIX 0360 AHA360-PCIe 0363 AHA363-PCIe 0364 AHA364-PCIe 0367 AHA367-PCIe 0370 AHA370-PCIe + 0604 AHA604 + 0605 AHA605 3641 AHA3641 3642 AHA3642 + 6101 AHA6101 + 6102 AHA6102 1942 ClearSpeed Technology plc e511 Advance X620 accelerator card e521 Advance e620 accelerator card @@ -19188,6 +19289,7 @@ 0401 P4080 0408 P4040E 0409 P4040 + 041f P3041 0440 T4240 with security 0441 T4240 without security 0446 T4160 with security @@ -19481,6 +19583,9 @@ 9100 TPRO-PCI-66U Timecode Reader/Generator 1ade Spin Master Ltd. 1501 Swipetech barcode scanner + 3038 PCIe Video Bridge + 13c2 3016 TT-budget S2-4200 Twin + 4254 0552 S952 v3 1ae0 Google, Inc. 1ae7 First Wise Media GmbH 0520 HFC-S PCI A [X-TENSIONS XC-520] @@ -19527,8 +19632,24 @@ 1004 Virtio SCSI 1005 Virtio RNG 1009 Virtio filesystem - 1010 Virtio GPU - 1012 Virtio input device +# virtio 1.0 + 1041 Virtio network device +# virtio 1.0 + 1042 Virtio block device +# virtio 1.0 + 1043 Virtio console +# virtio 1.0 + 1044 Virtio RNG +# virtio 1.0 + 1045 Virtio memory balloon +# virtio 1.0 + 1048 Virtio SCSI +# virtio 1.0 + 1049 Virtio filesystem +# virtio 1.0 + 1050 Virtio GPU +# virtio 1.0 + 1052 Virtio input 1110 Inter-VM shared memory 1af4 1100 QEMU Virtual Machine 1af5 Netezza Corp. @@ -19618,6 +19739,7 @@ 9485 88SE9485 SAS/SATA 6Gb/s controller 1b55 NetUP Inc. 18f6 Dual DVB Universal CI card + 18f7 Dual DVB Universal CI card rev 1.4 2a2c Dual DVB-S2-CI card e2e4 Dual DVB-T/C-CI RF card # 2xHDMI and 2xHD-SDI inputs @@ -19640,6 +19762,7 @@ d230 D230 Dual-port E1/T1 card (2nd generation) d410 D410/430 Quad-port E1/T1 card d430 D410/430 Quad-port E1/T1 card +1b79 Absolute Analysis 1b85 OCZ Technology Group, Inc. 1041 RevoDrive 3 X2 PCI-Express SSD 240 GB (Marvell Controller) 8788 RevoDrive Hybrid @@ -19700,6 +19823,7 @@ 4254 10G-PCIE3-8D-2S 4255 10G-PCIE3-8D-Q 4256 10G-PCIE3-8D-2S + 4258 10G-PCIE3-8E-2S 1c1c Symphony 0001 82C101 1c28 Lite-On IT Corp. / Plextor @@ -19728,8 +19852,8 @@ # A Western Digital Subsidiary 1c58 HGST, Inc. 0003 Ultrastar SN100 Series NVMe SSD - 1014 04f5 PCIe3 1.6TB NVMe Adapter - 1014 04f6 PCIe3 3.2TB NVMe Adapter + 1014 04f5 PCIe3 1.6TB NVMe Flash Adapter + 1014 04f6 PCIe3 3.2TB NVMe Flash Adapter # http://www.nicevt.ru/ (in Russian) 1c63 Science and Research Centre of Computer Technology (JSC "NICEVT") # http://www.radiotec.ru/catalog.php?cat=jr8&art=14109 @@ -19743,6 +19867,9 @@ 1cb1 Collion UG & Co.KG 1cc5 Embedded Intelligence, Inc. 0100 CAN-PCIe-02 +1cc7 Radian Memory Systems Inc. + 0200 RMS-200 + 0250 RMS-250 1cd2 SesKion GmbH 0301 Simulyzer-RT CompactPCI Serial DIO-1 card 0302 Simulyzer-RT CompactPCI Serial PSI5-ECU-1 card @@ -19782,6 +19909,11 @@ 1005 ZC706-Z045 1006 KCU105-KU040 1007 XUSP3S-VU095 [Jasper] + 1008 XUSPL4-VU065 [Mustang UltraScale] + 1009 XUSPL4-VU3P [Mustang UltraScale+] + 100a A10PL4-A10GX115 + 100b K35-2SFP + 100c K35-4SFP 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] 1de1 Tekram Technology Co.,Ltd. 0391 TRM-S1040 [DC-315 / DC-395 series] @@ -19823,11 +19955,15 @@ 4010 TN4010 Clean SROM 4020 TN9030 10GbE CX4 Ethernet Adapter 4022 TN9310 10GbE SFP+ Ethernet Adapter + 1043 8709 XG-C100F 10GbE SFP+ Ethernet Adapter 1186 4d00 DXE-810S 10GbE SFP+ Ethernet Adapter + 1432 8103 EN-8102PF 10GbE SPF+ Ethernet Adapter 1fc9 3015 Ethernet Adapter 4024 TN9210 10GBase-T Ethernet Adapter 4025 TN9510 10GBase-T/NBASE-T Ethernet Adapter + 105a 7203 SANLink3 NBase-T1 1186 2900 DXE-810T 10GBase-T Ethernet Adapter + 1432 8102 EN-8102P 10GbE Ethernet Adapter 1fc9 3015 Ethernet Adapter 4026 TN9610 10GbE SFP+ Ethernet Adapter 4027 TN9710 10GBase-T/NBASE-T Ethernet Adapter @@ -20091,58 +20227,128 @@ 1960 RedCreek PCI adapter 4943 Growth Networks 494f ACCES I/O Products, Inc. - 0520 PCI-IDO-48 - 0920 PCI-IDI-48 - 0c50 PCI-DIO-24H - 0c51 PCI-DIO-24D - 0c60 PCI-DIO-48(H) - 0c68 PCI-DIO-72 - 0c70 PCI-DIO-96 - 0c78 PCI-DIO-120 - 0dc8 PCI-IDIO-16 - 0e50 PCI-DIO-24S - 0e51 PCI-DIO-24H(C) - 0e52 PCI-DIO-24D(C) - 0e60 PCI-DIO-48S(H) - 0e61 P104-DIO-24S - 0f00 PCI-IIRO-8 - 0f01 LPCI-IIRO-8 - 0f08 PCI-IIRO-16 - 1050 PCI-422/485-2 - 1058 PCI-COM422/4 - 1059 PCI-COM485/4 - 1068 PCI-COM422/8 - 1069 PCI-COM485/8 - 1088 PCI-COM232/1 - 1090 PCI-COM232/2 - 10a8 P104-COM232-8 - 10c9 PCI-COM-1S - 10d0 PCI-COM2S - 10e8 PCI-COM-8SM - 1148 PCI-ICM-1S - 1150 PCI-ICM-2S - 1158 PCI-ICM422/4 - 1159 PCI-ICM485/4 - 1250 PCI-WDG-2S + 0508 PCI-IDO-16A FET Output Card + 0518 PCI-IDO-32A FET Output Card + 0520 PCI-IDO-48 FET Output Card + 0521 PCI-IDO-48A FET Output Card + 0703 PCIe-RO-4 Electromechanical Relay Output Card + 07d0 PCIe-IDO-24 FET Output Card + 0920 PCI-IDI-48 Isolated Digital Input Card + 0bd0 PCIe-IDI-24 Isolated Digital Input Card + 0c50 PCI-DIO-24H 1x 8255 Digital Input / Output Card + 0c51 PCI-DIO-24D 1x 8255 Digital Input / Output Card + 0c52 PCIe-DIO-24 1x 8255 Digital Input / Output Card + 0c53 PCIe-DIO-24H 8255 Digital Input / Output Card + 0c57 mPCIe-DIO-24 8255 Digital Input / Output Card + 0c60 PCI-DIO-48H 8255 Digital Input / Output Card + 0c61 PCIe-DIO-48 8255 Digital Input / Output Card + 0c62 P104-DIO-48 8255 Digital Input / Output Card + 0c68 PCI-DIO-72 8255 Digital Input / Output Card + 0c69 P104-DIO-96 8255 Digital Input / Output Card + 0c70 PCI-DIO-96 8255 Digital Input / Output Card + 0c78 PCI-DIO-120 8255 Digital Input / Output Card + 0dc8 PCI-IDIO-16 Isolated Digital Input / FET Output Card + 0e50 PCI-DIO-24S 8255 Digital Input / Output Card + 0e51 PCI-DIO-24H(C) 8255 Digital Input / Output Card + 0e52 PCI-DIO-24D(C) 8255 Digital Input / Output Card + 0e53 PCIe-DIO-24S 8255 Digital Input / Output Card + 0e54 PCIe-DIO-24HS 8255 Digital Input / Output Card + 0e55 PCIe-DIO-24DC 8255 Digital Input / Output Card + 0e56 PCIe-DIO-24DCS 8255 Digital Input / Output Card + 0e57 mPCIe-DIO-24S 8255 Digital Input / Output Card + 0e60 PCI-DIO-48S 2x 8255 Digital Input / Output Card + 0e61 PCIe-DIO-48S 2x 8255 Digital Input / Output Card + 0e62 P104-DIO-48S 2x 8255 Digital Input / Output Card + 0f00 PCI-IIRO-8 Isolated Digital / Relay Output Card + 0f01 LPCI-IIRO-8 Isolated Digital / Relay Output Card + 0f02 PCIe-IIRO-8 Isolated Digital / Relay Output Card + 0f08 PCI-IIRO-16 Isolated Digital / Relay Output Card + 0f09 PCIe-IIRO-16 Isolated Digital / Relay Output Card + 0fc0 PCIe-IDIO-12 Isolated Digital Input / FET Output Card + 0fc1 PCIe-IDI-12 Isolated Digital Input Card + 0fc2 PCIe-IDO-12 FET Output Card + 0fd0 PCIe-IDIO-24 Isolated Digital Input / FET Output Card + 1050 PCI-422/485-2 2x RS422/RS484 Card + 1051 PCIe-COM-2SRJ 2x RS422/RS484 Card w/RJ45 Connectors + 1052 104I-COM-2S 2x RS422/RS484 PCI/104 Board + 1053 mPCIe-COM-2S 2x RS422/RS484 PCI Express Mini Card + 1058 PCI-COM422/4 4x RS422 Card + 1059 PCI-COM485/4 4x RS485 Card + 105a PCIe-COM422-4 4x RS422 Card + 105b PCIe-COM485-4 4x RS485 Card + 105c PCIe-COM-4SRJ 4x RS422/RS485 Card w/RJ45 Connectors + 105d 104I-COM-4S 4x RS422/RS484 PCI/104 Board + 105e mPCIe-COM-4S 4x RS422/RS484 PCI Express Mini Card + 1068 PCI-COM422/8 8x RS422 Card + 1069 PCI-COM485/8 8x RS485 Card + 106a PCIe-COM422-8 8x RS422 Card + 106b PCIe-COM485-8 8x RS485 Card + 106c 104I-COM-8S 8x RS422/RS485 PCI/104 Board + 1088 PCI-COM232/1 1x RS232 Card + 1090 PCI-COM232/2 2x RS232 Card + 1091 PCIe-COM232-2RJ 2x RS232 Card w/RJ45 Connectors + 1093 mPCIe-COM232-2 2x RS232 PCI Express Mini Card + 1098 PCIe-COM232-4 4x RS232 Card + 1099 PCIe-COM232-4RJ 4x RS232 Card w/RJ45 Connectors + 109b mPCIe-COM232-4 4x RS232 PCI Express Mini Card + 10a8 P104-COM232-8 8x RS232 PC-104+ Board + 10a9 PCIe-COM232-8 8x RS232 Card + 10c9 PCI-COM-1S 1x RS422/RS485 Card + 10d0 PCI-COM2S 2x RS422/RS485 Card + 10d1 PCIe-COM-2SMRJ 2x RS232/RS422/RS485 Card w/RJ45 Connectors + 10d2 104I-COM-2SM 2x RS232/RS422/RS485 PCI/104 Board + 10d3 mPCIe-COM-2SM 2x RS232/RS422/RS485 PCI Express Mini Card + 10d8 PCI-COM-4SM 4x RS232/RS422/RS485 Card + 10d9 PCIe-COM-4SM 4x RS232/RS422/RS485 Card + 10da PCIe-COM-4SMRJ 4x RS232/RS422/RS485 Card w/RJ45 Connectors + 10db 104I-COM-4SM 4x RS232/RS422/RS485 PCI/104 Board + 10dc mPCIe-COM-4SM 4x RS232/RS422/RS485 PCI Express Mini Card + 10e8 PCI-COM-8SM 8x RS232/RS422/RS485 Card + 10e9 PCIe-COM-8SM 8x RS232/RS422/RS485 Card + 10ea 104I-COM-8SM 8x RS232/RS422/RS485 PCI-104 Board + 1108 mPCIe-ICM485-1 1x Isolated RS485 PCI Express Mini Card + 1110 mPCIe-ICM422-2 2x Isolated RS422 PCI Express Mini Card + 1111 mPCIe-ICM485-2 2x Isolated RS485 PCI Express Mini Card + 1118 mPCIe-ICM422-4 4x Isolated RS422 PCI Express Mini Card + 1119 mPCIe-ICM485-4 4x Isolated RS485 PCI Express Mini Card + 1148 PCI-ICM-1S 1x Isolated RS422/RS485 Card + 1150 PCI-ICM-2S 2x Isolated RS422/RS485 Card + 1152 PCIe-ICM-2S 2x Isolated RS422/RS485 Card + 1158 PCI-ICM422/4 4x Isolated RS422 Card + 1159 PCI-ICM485/4 4x Isolated RS485 Card + 115a PCIe-ICM-4S 4x Isolated RS422/RS485 Card + 1190 PCIe-ICM232-2 2x Isolated RS232 Card + 1191 mPCIe-ICM232-2 2x Isolated RS232 PCI Express Mini Card + 1198 PCIe-ICM232-4 4x Isolated RS232 Card + 1199 mPCIe-ICM232-4 4x Isolated RS422 PCI Express Mini Card + 11d0 PCIe-ICM-2SM 2x Isolated RS232/RS422/RS485 Card + 11d8 PCIe-ICM-4SM 4x Isolated RS232/RS422/RS485 Card + 1250 PCI-WDG-2S Watchdog and 2x Serial Card 12d0 PCI-WDG-IMPAC - 22c0 PCI-WDG-CSM - 2c50 PCI-DIO-96CT - 2c58 PCI-DIO-96C3 + 2230 PCI-QUAD-8 8x Quadrature Input Card + 2231 PCI-QUAD-4 4x Quadrature Input Card + 22c0 PCI-WDG-CSM Watchdog Card + 25c0 P104-WDG-E Watchdog PC/104+ Board + 2c50 PCI-DIO-96CT 96x Digital Input / Output Card + 2c58 PCI-DIO-96C3 96x Digital Input / Output Card w/3x 8254 Counter Card + 2ee0 PCIe-DIO24S-CTR12 24x Digital Input / Output Card w/4x 8254 Counter Card + 2fc0 P104-WDG-CSM Watchdog PC/104+ Board + 2fc1 P104-WDG-CSMA Advanced Watchdog PC/104+ Board 5ed0 PCI-DAC - 6c90 PCI-DA12-2 - 6c98 PCI-DA12-4 - 6ca0 PCI-DA12-6 - 6ca8 PCI-DA12-8 + 6c90 PCI-DA12-2 2x 12-bit Analog Output Card + 6c98 PCI-DA12-4 4x 12-bit Analog Output Card + 6ca0 PCI-DA12-6 6x 12-bit Analog Output Card + 6ca8 PCI-DA12-8 8x 12-bit Analog Output Card 6ca9 PCI-DA12-8V - 6cb0 PCI-DA12-16 + 6cb0 PCI-DA12-16 16x 12-bit Analog Output Card 6cb1 PCI-DA12-16V 8ef0 P104-FAS16-16 - aca8 PCI-AI12-16 - aca9 PCI-AI12-16A - eca8 PCI-AIO12-16 - eca9 PCI-A12-16 - ecaa PCI-A12-16A - ece8 PCI-A16-16 + aca8 PCI-AI12-16 12-bit 100kHz Analog Input Card + aca9 PCI-AI12-16A 12-bit 100kHz Analog Input w/FIFO Card + eca8 PCI-AIO12-16 12-bit 100kHz Analog Input w/2x Analog Output and FIFO Card + ecaa PCI-A12-16A 12-bit 100kHz Analog Input w/2x Analog Output and FIFO Card + ece8 LPCI-A16-16A 16-bit 500kHz Analog Input low-profile Card + ece9 LPCI-AIO16A 16-bit 500kHz Analog Input low-profile Card 4978 Axil Computer Inc 4a14 NetVin 5000 NV5000SC @@ -22042,6 +22248,7 @@ 1093 76b1 PCIe-8237R-S Ethernet Adapter 1093 775b PCIe-8237 Ethernet Adapter 10a9 802a UV2-BaseIO dual-port GbE + 15d9 0652 Dual Port i350 GbE MicroLP [AOC-CGP-i2] 17aa 1074 ThinkServer I350-T4 AnyFabric 17aa 4005 I350 Gigabit Network Connection 8086 0001 Ethernet Server Adapter I350-T4 @@ -22143,6 +22350,8 @@ 1563 Ethernet Controller 10G X550T 8086 0001 Ethernet Converged Network Adapter X550-T2 8086 001a Ethernet Converged Network Adapter X550-T2 + 8086 0022 Ethernet Converged Network Adapter X550-T2 + 1565 X550 Virtual Function 1566 DSL4410 Thunderbolt NHI [Redwood Ridge 2C 2013] 1567 DSL4410 Thunderbolt Bridge [Redwood Ridge 2C 2013] 1568 DSL4510 Thunderbolt NHI [Redwood Ridge 4C 2013] @@ -22192,14 +22401,16 @@ 1028 0000 Ethernet 10G X710-k bNDC 1028 1f98 Ethernet 10G 4P X710-k bNDC 1028 1f9e Ethernet 10G 2P X710-k bNDC + 1590 0000 Ethernet 2-port 563i Adapter + 1590 00f8 Ethernet 2-port 563i Adapter 8086 0000 Ethernet Converged Network Adapter XL710-Q2 1583 Ethernet Controller XL710 for 40GbE QSFP+ 1028 0000 Ethernet 40G 2P XL710 QSFP+ rNDC 1028 1f9f Ethernet 40G 2P XL710 QSFP+ rNDC 108e 0000 10 Gb/40 Gb Ethernet Adapter 108e 7b1b 10 Gb/40 Gb Ethernet Adapter - 1137 0000 Ethernet Converged NIC XL710-Q2 - 1137 013c Ethernet Converged NIC XL710-Q2 + 1137 0000 Ethernet Converged NIC XL710-QDA2 + 1137 013c Ethernet Converged NIC XL710-QDA2 8086 0000 Ethernet Converged Network Adapter XL710-Q2 8086 0001 Ethernet Converged Network Adapter XL710-Q2 8086 0002 Ethernet Converged Network Adapter XL710-Q2 @@ -22223,6 +22434,8 @@ 103c 0000 HP Flex-20 20Gb 2-port 660M Adapter 103c 22ff HP Flex-20 20Gb 2-port 660M Adapter 1589 Ethernet Controller X710/X557-AT 10GBASE-T + 108e 0000 Quad Port 10GBase-T Adapter + 108e 7b1c Quad Port 10GBase-T Adapter 8086 0000 Ethernet Converged Network Adapter X710-T 8086 0001 Ethernet Converged Network Adapter X710-T4 8086 0002 Ethernet Converged Network Adapter X710-T4 @@ -22243,9 +22456,12 @@ 15b7 Ethernet Connection (2) I219-LM 15b8 Ethernet Connection (2) I219-V 15b9 Ethernet Connection (3) I219-LM + 15d0 Ethernet SDI Adapter FM10420-100GbE-QDA2 15d1 Ethernet Controller 10G X550T 8086 0002 Ethernet Converged Network Adapter X550-T1 + 8086 0021 Ethernet Converged Network Adapter X550-T1 8086 00a2 Ethernet Converged Network Adapter X550-T1 + 15d5 Ethernet SDI Adapter FM10420-25GbE-DA2 15d6 Ethernet Connection (5) I219-V 15d7 Ethernet Connection (4) I219-LM 15d8 Ethernet Connection (4) I219-V @@ -22256,7 +22472,7 @@ 1603 Broadwell-U Processor Thermal Subsystem 1604 Broadwell-U Host Bridge -OPI 1605 Broadwell-U PCI Express x8 Controller - 1606 Broadwell-U Integrated Graphics + 1606 HD Graphics 1607 Broadwell-U CHAPS Device 1608 Broadwell-U Host Bridge -OPI 1609 Broadwell-U x4 PCIe @@ -22267,19 +22483,19 @@ 160e Broadwell-U Integrated Graphics 160f Broadwell-U SoftSKU 1610 Broadwell-U Host Bridge - DMI - 1612 Broadwell-U Integrated Graphics + 1612 HD Graphics 5600 1614 Broadwell-U Host Bridge - DMI - 1616 Broadwell-U Integrated Graphics + 1616 HD Graphics 5500 103c 2216 ZBook 15u G2 Mobile Workstation 1618 Broadwell-U Host Bridge - DMI 161a Broadwell-U Integrated Graphics 161b Broadwell-U Integrated Graphics 161d Broadwell-U Integrated Graphics - 161e Broadwell-U Integrated Graphics - 1622 Broadwell-U Integrated Graphics - 1626 Broadwell-U Integrated Graphics - 162a Broadwell-U Integrated Graphics - 162b Broadwell-U Integrated Graphics + 161e HD Graphics 5300 + 1622 Iris Pro Graphics 6200 + 1626 HD Graphics 6000 + 162a Iris Pro Graphics P6300 + 162b Iris Graphics 6100 162d Broadwell-U Integrated Graphics 162e Broadwell-U Integrated Graphics 1632 Broadwell-U Integrated Graphics @@ -22290,25 +22506,34 @@ 163e Broadwell-U Integrated Graphics 1900 Skylake Host Bridge/DRAM Registers 1901 Skylake PCIe Controller (x16) + 1902 HD Graphics 510 1903 Skylake Processor Thermal Subsystem 1904 Skylake Host Bridge/DRAM Registers 1905 Skylake PCIe Controller (x8) + 1906 HD Graphics 510 1908 Skylake Host Bridge/DRAM Registers 1909 Skylake PCIe Controller (x4) 190c Skylake Host Bridge/DRAM Registers 190f Skylake Host Bridge/DRAM Registers 1910 Skylake Host Bridge/DRAM Registers 1911 Skylake Gaussian Mixture Model - 1912 Skylake Integrated Graphics - 1916 Skylake Integrated Graphics + 1912 HD Graphics 530 + 1916 HD Graphics 520 1918 Skylake Host Bridge/DRAM Registers 1919 Skylake Imaging Unit - 191b Skylake Integrated Graphics - 191e Skylake Integrated Graphics + 191b HD Graphics 530 + 191d HD Graphics P530 + 191e HD Graphics 515 191f Skylake Host Bridge/DRAM Registers - 1926 Skylake Integrated Graphics - 1932 Skylake Integrated Graphics - 193b Skylake Integrated Graphics + 1921 HD Graphics 520 + 1926 Iris Graphics 540 + 1927 Iris Graphics 550 + 192b Iris Graphics 555 + 192d Iris Graphics P555 + 1932 Iris Pro Graphics 580 + 193a Iris Pro Graphics P580 + 193b Iris Pro Graphics 580 + 193d Iris Pro Graphics P580 1960 80960RP (i960RP) Microprocessor 101e 0431 MegaRAID 431 RAID Controller 101e 0438 MegaRAID 438 Ultra2 LVD RAID Controller @@ -22766,6 +22991,37 @@ 225c Xeon Phi coprocessor SE10/7120 series 225d Xeon Phi coprocessor 3120 series 225e Xeon Phi coprocessor 31S1 + 2280 Braswell SoC Transaction Router + 2284 Braswell HD Audio Controller + 2286 Braswell Serial I/O DMA + 228a Braswell Serial I/O HSUART Port 1 + 228c Braswell Serial I/O HSUART Port 2 + 2292 Braswell Platform Controller Unit SMBus + 2294 Braswell Storage Cluster Control MMC Port + 2295 Braswell Storage Cluster Control SDIO Port + 2296 Braswell Storage Cluster Control SD Port + 2298 Braswell Trusted Execution Engine Interface + 229c Braswell Platform Controller Unit LPC + 22a3 Braswell SATA Controller + 22a4 Braswell SATA AHCI Controller + 22a8 Braswell Low Power Engine Audio + 22b0 Braswell PCI Configuration Registers + 22b1 Braswell Integrated Graphics Controller + 22b5 Braswell USB xHCI Host Controller + 22b8 Braswell ISP Camera + 22c0 Braswell Serial I/O DMA + 22c1 Braswell Serial I/O I2C Port 1 + 22c2 Braswell Serial I/O I2C Port 2 + 22c3 Braswell Serial I/O I2C Port 3 + 22c4 Braswell Serial I/O I2C Port 4 + 22c5 Braswell Serial I/O I2C Port 5 + 22c6 Braswell Serial I/O I2C Port 6 + 22c7 Braswell Serial I/O I2C Port 7 + 22c8 Braswell PCIe Port 1 + 22ca Braswell PCIe Port 2 + 22cc Braswell PCIe Port 3 + 22ce Braswell PCIe Port 4 + 22dc Braswell P-Unit Power Management 2310 DH89xxCC LPC Controller 2323 DH89xxCC 4 Port SATA AHCI Controller 2330 DH89xxCC SMBus Controller @@ -23433,8 +23689,11 @@ 24df 82801ER (ICH5R) SATA Controller 1028 0168 Precision Workstation 670 Mainboard 24f0 Omni-Path HFI Silicon 100 Series [discrete] - 10a9 802e Omni-path HFI 100 Series, 1-port - 10a9 802f Omni-path HFI 100 Series, 2-port + 10a9 802e Omni-path HFI 100 Series, 1-port A-board + 10a9 802f Omni-path HFI 100 Series, 2-port A-board + 10a9 8030 Omni-path HFI 100 Series, 1-port B-board + 10a9 8031 Omni-path HFI 100 Series, 2-port B-board + 15d9 0934 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x16, SIOM Module 8086 2628 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x16 8086 2629 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x8 8086 262a Omni-Path HFI Adapter 100 Series, 2 Ports, Split PCIe x16 @@ -23849,7 +24108,7 @@ 103c 0934 Compaq nw8240/nx8220 103c 099c NX6110/NC6120 266e 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller - 1014 0581 ThinkPad X41 + 1014 0581 ThinkPad X41 (Analog Devices AD1981B codec) 1025 006a Realtek ALC 655 codec (in Acer TravelMate 2410 serie laptop) 1028 0177 Dimension 8400 1028 0179 Optiplex GX280 @@ -25546,6 +25805,14 @@ 372b Xeon C5500/C3500 Core 372c Xeon C5500/C3500 Reserved 373f Xeon C5500/C3500 IOxAPIC + 37cd X722 Virtual Function + 37ce Ethernet Connection X722 for 10GbE backplane + 37cf Ethernet Connection X722 for 10GbE QSFP+ + 37d0 Ethernet Connection X722 for 10GbE SFP+ + 37d1 Ethernet Connection X722 for 1GbE + 37d2 Ethernet Connection X722 for 10GBASE-T + 37d3 Ethernet Connection X722 for 10GbE SFP+ + 37d4 Ethernet Connection X722 for 10GbE QSFP+ 3a00 82801JD/DO (ICH10 Family) 4-port SATA IDE Controller 3a02 82801JD/DO (ICH10 Family) SATA AHCI Controller 3a05 82801JD/DO (ICH10 Family) SATA RAID Controller @@ -26931,7 +27198,8 @@ 8384 SigmaTel 8401 TRENDware International Inc. 8686 ScaleMP - 1010 vSMPowered system controller [vSMP CTL] + 1010 vSMP Foundation controller [vSMP CTL] + 1011 vSMP Foundation MEX/FLX controller [vSMP CTL] 8800 Trigem Computer Inc. 2008 Video assistant component 8866 T-Square Design Inc. @@ -27436,6 +27704,11 @@ bdbd Blackmagic Design a137 DeckLink Studio 4K a138 Decklink SDI 4K a139 Intensity Pro 4K + a13b DeckLink Micro Recorder + a13d DeckLink 4K Pro + a13e UltraStudio 4K Extreme + a13f DeckLink Quad 2 + a140 DeckLink Duo 2 c001 TSI Telsys c0a9 Micron/Crucial Technology c0de Motorola From owner-svn-src-head@freebsd.org Mon May 23 22:27:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 124B7B477AC; Mon, 23 May 2016 22:27:46 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED60C194C; Mon, 23 May 2016 22:27:45 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 98996EE4; Mon, 23 May 2016 15:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1464042464; bh=aeD062kFsckSsq4/DslITD9O+y0vRUzoAuzgNvCGnPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=t995pXJ4kT1tbj/gQyGnMZTFg3aAg0cCNokcDcy90GqpiU9pfua2SWyg148zW9YUt R59IoGIq8CCwlwNwoIEG64yp/+CHdQU/Nozm4zkC6TqOUy0PX4ct4tf+EpLAQSnDjf mIE0kl/RI1xmo9+iW0OPHnGI0d9TTRsMHfTlGvrE= From: Peter Wemm To: svn-src-head@freebsd.org Cc: Ed Maste , Alan Somers , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol Date: Mon, 23 May 2016 15:27:38 -0700 Message-ID: <1800889.cA7PpKnr6e@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201605042234.u44MYBMX054443@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1751466.a2GuLocyWL"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 22:27:46 -0000 --nextPart1751466.a2GuLocyWL Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Thursday, May 05, 2016 10:57:16 AM Ed Maste wrote: > On 4 May 2016 at 18:34, Alan Somers wrote: > > Author: asomers > > Date: Wed May 4 22:34:11 2016 > > New Revision: 299090 > > URL: https://svnweb.freebsd.org/changeset/base/299090 > >=20 > > Log: > > Improve performance and functionality of the bitstring(3) api >=20 > tinderbox is failing on (at least) powerpc now with: >=20 > --- all_subdir_tests --- > cc1: warnings being treated as errors > /scratch/tmp/emaste/freebsd/sys/kern/subr_unit.c: In function 'main':= > /scratch/tmp/emaste/freebsd/sys/kern/subr_unit.c:1029: warning: forma= t > '%lu' expects type 'long unsigned int', but argument 2 has type > 'unsigned int' > *** [subr_unit.o] Error code 1 > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.or= g" It also breaks i386: In file included from /usr/src/usr.sbin/apmd/apmd.c:36: In file included from /usr/obj/usr/src/tmp/usr/include/bitstring.h:34: /usr/obj/usr/src/tmp/usr/include/sys/bitstring.h:278:13: error: implici= t=20 declaration of function '__bitcountl' is invalid in C99 [-Werror,-Wimpl= icit- function-declaration] _value +=3D __bitcountl(*_curbitstr & mask); ^ =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart1751466.a2GuLocyWL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJXQ4PbAAoJEDXWlwnsgJ4EgGEH/jUA3AtPrf4exugTuO7ClIv3 DjFKJDg9eRmwHI1I6fJZ8lZKOGvKNkycykv8p0umWtrmwSPLTEItpISrN7EHiRPj yYuimEkcpCdRgt0CGe6n0O8IDxxlzs92R5O8icOVdfF8MYeTs/+3uyWCFjj4ytYV u/GR0rvW2gwb4Wn1+DAtzxDaqUAnZ/wbESP1N/t3VIF+LRAX1Vqf2qFSh8Gt0Qr5 /umQD1U64Yus7HQ5bUtktRgEK13YYqGsKEu4QDLVg3QDC/dFBR0NjikBUhToUeLr xmkEWQzQqg8kdvIFuMPezLRDtnwQhtJbPm06YIObBKUMbUHON8ouNdvJgiBkfus= =M3rj -----END PGP SIGNATURE----- --nextPart1751466.a2GuLocyWL-- From owner-svn-src-head@freebsd.org Mon May 23 22:31:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77F18B478AB; Mon, 23 May 2016 22:31:29 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 646A51C4C; Mon, 23 May 2016 22:31:29 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 0DC7DEEA; Mon, 23 May 2016 15:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1464042689; bh=bQ9lw4U1CZE297HIStMo3HQLqg2E6u60OIhmL20Ukfo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ILgvxYRN8S4HrKdDscYxrjmnyKzuxfVpodjebBryN8A4fFLZ9fY7XWzTkI6Fbu07m xw/t/2Z0JRKNYUu3rEsO5h71v9WCkRaTcAtB8S92GlPHznd1oZHpFElLvkXaBr2Z0X kvvz5Ulq2rimRpRbK/9PxTS3eJT6uKVdDmaqU8I4= From: Peter Wemm To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300539 - in head: . share/man/man3 sys/kern sys/sys tests/sys/sys Date: Mon, 23 May 2016 15:31:28 -0700 Message-ID: <1554849.4hxx0PqhhX@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605232029.u4NKTIjK072941@repo.freebsd.org> References: <201605232029.u4NKTIjK072941@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1508528.SQmjUx9Luv"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 22:31:29 -0000 --nextPart1508528.SQmjUx9Luv Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Monday, May 23, 2016 08:29:18 PM Alan Somers wrote: > Author: asomers > Date: Mon May 23 20:29:18 2016 > New Revision: 300539 > URL: https://svnweb.freebsd.org/changeset/base/300539 >=20 > Log: > Add bit_count to the bitstring(3) api >=20 (My aplogies, I replied to the wrong commit.) This breaks i386: In file included from /usr/src/usr.sbin/apmd/apmd.c:36: In file included from /usr/obj/usr/src/tmp/usr/include/bitstring.h:34: /usr/obj/usr/src/tmp/usr/include/sys/bitstring.h:278:13: error: implici= t=20 declaration of function '__bitcountl' is invalid in C99 [-Werror,-Wimpl= icit- function-declaration] _value +=3D __bitcountl(*_curbitstr & mask); ... This is coming from the inline below: > @@ -256,4 +257,40 @@ bit_ffc(bitstr_t *_bitstr, int _nbits, i > =09bit_ffc_at(_bitstr, /*start*/0, _nbits, _result); > } >=20 > +/* Count the number of bits set in a bitstr of size _nbits at or aft= er > _start */ +static inline void > +bit_count(bitstr_t *_bitstr, int _start, int _nbits, int *_result) > +{ > +=09bitstr_t *_curbitstr, mask; > +=09int _value =3D 0, curbitstr_len; > + > +=09if (_start >=3D _nbits) > +=09=09goto out; > + > +=09_curbitstr =3D _bitstr + _bit_idx(_start); > +=09_nbits -=3D _BITSTR_BITS * _bit_idx(_start); > +=09_start -=3D _BITSTR_BITS * _bit_idx(_start); > + > +=09if (_start > 0) { > +=09=09curbitstr_len =3D (int)_BITSTR_BITS < _nbits ? > +=09=09=09=09(int)_BITSTR_BITS : _nbits; > +=09=09mask =3D _bit_make_mask(_start, _bit_offset(curbitstr_len - 1)= ); > +=09=09_value +=3D __bitcountl(*_curbitstr & mask); > +=09=09_curbitstr++; > +=09=09_nbits -=3D _BITSTR_BITS; > +=09} > +=09while (_nbits >=3D (int)_BITSTR_BITS) { > +=09=09_value +=3D __bitcountl(*_curbitstr); > +=09=09_curbitstr++; > +=09=09_nbits -=3D _BITSTR_BITS; > +=09} > +=09if (_nbits > 0) { > +=09=09mask =3D _bit_make_mask(0, _bit_offset(_nbits - 1)); > +=09=09_value +=3D __bitcountl(*_curbitstr & mask); > +=09} > + > +out: > +=09*_result =3D _value; > +} =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart1508528.SQmjUx9Luv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJXQ4TAAAoJEDXWlwnsgJ4E+dwIANI2Tq8KFlSlsAffqN5BIj3N tpNOYrz2TEQ+Ix/30b7CKhOUC0Q+RHEvX2J8UPEYOCIrVvIxlk1sEZfqp2JCfgzt eaU2ynhVypjSIItBaT8ClHypFBgYjTiPclc0Km7e0FV8Ueq4wP5RCC8Yll5aDMMJ vgmnEbszdOG6sNlOqWTthe+5hdSgCt+eAntiLH5I3NroQSjiEy/skLV9gMvqAGZA U1Np7j8+9UQ4FEMhJLqBNH6idOChlZ4iT4EDT7if5SEHuh52RrNeMta/AM5EcfEd QZcrGbJayT9UwcMK6XL1S6bxfIim7EcW2KOGlQMrYnooBNMkS33hhhYOU/dEm8s= =6uJL -----END PGP SIGNATURE----- --nextPart1508528.SQmjUx9Luv-- From owner-svn-src-head@freebsd.org Mon May 23 22:33:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D822B479D6; Mon, 23 May 2016 22:33:17 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x22f.google.com (mail-oi0-x22f.google.com [IPv6:2607:f8b0:4003:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 028271E87; Mon, 23 May 2016 22:33:17 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x22f.google.com with SMTP id j1so63389243oih.3; Mon, 23 May 2016 15:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=gNOtNrPU8yNJXoEP/yeGx1yCNrVZ+Nn2tSwW1sY2IYI=; b=Y1nMF/TerFluMtFTangDdknsqZxZaWtwlf22H37KeDdCH5Gb5xL1agi6Xrvff+PcEP GFlgp3PFq9g6swVHXp8Vis2XuD6wKlspt/wxPR8L34jhH5lperJTeH2HZPs11dX14BgK iK4eRyqyn+xT7K3/4L/KPbQ7vwzQV+vR61hpVcUFk+vZYGGzU/n46HtPWXuEbuZ5DhkZ 0xvWHb6rKq5A9ND3VT9rXvbXk3yayV9k4A93rkLTKI3oTCzUzczkpXRBvyx/0RwILZq0 G72/Ehfo+C5VBozTdm2uIDmiMrTVJPxrlTkSVd8745scU7fLpAgABlaP3BpywJl9FzVR 6+Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=gNOtNrPU8yNJXoEP/yeGx1yCNrVZ+Nn2tSwW1sY2IYI=; b=I+5jtnEt9C+zGB2aQb+VA5jUDXvORLMUiKO8KkzwAn7QmSuwZBdzh8NEpwzLdKKfzY +BW2ud+5ySwIKAGHSOLe4BwObSSTx+SfIBEMgXHx9powgrmxsf2znRjlDlbsU5i4He16 vr5WxUuW4nOQPoi1K9rXkLVETRIdb8APRKa2oZntiTnpDeEs3tasv8TqTDaAjmEtYPFb XUfodkVuVWbSePf4U+pbgagADeVr9zH93dW4FCfhBZkENIJrbLcHeECcktg1MyyEKsxQ BKwC49ZJFzoCeMUnBJEWuG/FaOWkmHPjUh9AMlcJcnV3n0Li5QLDjKvq5mLEntek+2QZ zAvw== X-Gm-Message-State: AOPr4FXpzjmzZdFGNPS6qQN86kredo9HF76FZYZJijoOnv/Xa/EFvgXaDVr522nxh6jMGm4xSiLuLiwhyaNHlg== MIME-Version: 1.0 X-Received: by 10.202.73.72 with SMTP id w69mr10791552oia.176.1464042796464; Mon, 23 May 2016 15:33:16 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.4.200 with HTTP; Mon, 23 May 2016 15:33:16 -0700 (PDT) In-Reply-To: <1554849.4hxx0PqhhX@overcee.wemm.org> References: <201605232029.u4NKTIjK072941@repo.freebsd.org> <1554849.4hxx0PqhhX@overcee.wemm.org> Date: Mon, 23 May 2016 16:33:16 -0600 X-Google-Sender-Auth: A1EcGHcuHB08G7tr3RDy2cL8A4M Message-ID: Subject: Re: svn commit: r300539 - in head: . share/man/man3 sys/kern sys/sys tests/sys/sys From: Alan Somers To: Peter Wemm Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 22:33:17 -0000 On Mon, May 23, 2016 at 4:31 PM, Peter Wemm wrote: > On Monday, May 23, 2016 08:29:18 PM Alan Somers wrote: > > Author: asomers > > Date: Mon May 23 20:29:18 2016 > > New Revision: 300539 > > URL: https://svnweb.freebsd.org/changeset/base/300539 > > > > Log: > > Add bit_count to the bitstring(3) api > > > > (My aplogies, I replied to the wrong commit.) > > > This breaks i386: > > In file included from /usr/src/usr.sbin/apmd/apmd.c:36: > In file included from /usr/obj/usr/src/tmp/usr/include/bitstring.h:34: > /usr/obj/usr/src/tmp/usr/include/sys/bitstring.h:278:13: error: implicit > declaration of function '__bitcountl' is invalid in C99 > [-Werror,-Wimplicit- > function-declaration] > _value += __bitcountl(*_curbitstr & mask); > ... > Oops. I'll fix it. From owner-svn-src-head@freebsd.org Mon May 23 22:59:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D368AB4715F; Mon, 23 May 2016 22:59:08 +0000 (UTC) (envelope-from lidl@pix.net) Received: from hydra.pix.net (hydra.pix.net [IPv6:2001:470:e254::4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.pix.net", Issuer "Pix.Com Technologies, LLC CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ADDD11D32; Mon, 23 May 2016 22:59:08 +0000 (UTC) (envelope-from lidl@pix.net) Received: from torb.pix.net (torb.pix.net [192.168.16.32]) (authenticated bits=0) by hydra.pix.net (8.15.2/8.15.2) with ESMTPA id u4NMx7KZ030783; Mon, 23 May 2016 18:59:07 -0400 (EDT) (envelope-from lidl@pix.net) Subject: Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol To: Alan Somers References: <201605042234.u44MYBMX054443@repo.freebsd.org> <2368543.Vvp613SNcD@ralph.baldwin.cx> <684f4a82-f48c-b2bb-6a72-5c1dfea11a39@pix.net> Cc: John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Kurt Lidl Message-ID: Date: Mon, 23 May 2016 18:59:07 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 22:59:08 -0000 On 5/23/16 4:30 PM, Alan Somers wrote: > On Fri, May 6, 2016 at 8:45 AM, Kurt Lidl > wrote: > > On 5/5/16 12:31 PM, John Baldwin wrote: > > On Wednesday, May 04, 2016 10:34:11 PM Alan Somers wrote: > > Author: asomers > Date: Wed May 4 22:34:11 2016 > New Revision: 299090 > URL: https://svnweb.freebsd.org/changeset/base/299090 > > Log: > Improve performance and functionality of the bitstring(3) api > > Two new functions are provided, bit_ffs_at() and > bit_ffc_at(), which allow > for efficient searching of set or cleared bits starting > from any bit offset > within the bit string. > > Performance is improved by operating on longs instead of > bytes and using > ffsl() for searches within a long. ffsl() is a compiler > builtin in both > clang and gcc for most architectures, converting what was > a brute force > while loop search into a couple of instructions. > > All of the bitstring(3) API continues to be contained in > the header file. > Some of the functions are large enough that perhaps they > should be uninlined > and moved to a library, but that is beyond the scope of > this commit. > > > Doesn't switching from bytes to longs break the ABI? That is, > setting bit 9 > now has a different representation on big-endian systems (0x00 > 0x01 before, > now 0x00 0x00 0x01 0x00 on 32-bit BE, and 4 more leading 0 bytes > on 64-bit). > This means you can't have an object file compiled against the > old header > pass a bitstring to an object file compiled against the new > header on big-endian > systems. > > Even on little-endian systems if an old object file allocates > storage for a > bitstring the new code might read off the end of it and fault > (or return > garbage if bits are set in the extra bytes it reads off the end)? > > Is the API is so little used we don't care? > > > Just as a note - at my prior job (Pi-Coral, now defunct) we used this > API everywhere in the dataplane code of our product. Since the company > is gone, that particular use-case doesn't matter anymore. > > At the very least, this deserves a mention in the release notes, and > also UPDATING! > > -Kurt > > > UPDATING is updated as of r300539. Any objection to merging this to > stable/10? Not to me - as I mentioned, the company went out of business, so catering to its needs is a NOP. Go for it! -Kurt From owner-svn-src-head@freebsd.org Mon May 23 23:00:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26834B47294; Mon, 23 May 2016 23:00:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8BEB1ED6; Mon, 23 May 2016 23:00:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NN0mHm022466; Mon, 23 May 2016 23:00:48 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NN0m3v022465; Mon, 23 May 2016 23:00:48 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605232300.u4NN0m3v022465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 23 May 2016 23:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300543 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 23:00:49 -0000 Author: jkim Date: Mon May 23 23:00:47 2016 New Revision: 300543 URL: https://svnweb.freebsd.org/changeset/base/300543 Log: Document POPCNT erratum for 6th Generation Intel Core processors. Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon May 23 22:01:06 2016 (r300542) +++ head/sys/amd64/amd64/pmap.c Mon May 23 23:00:47 2016 (r300543) @@ -3139,6 +3139,7 @@ retry: * Reference numbers for erratas are * 4th Gen Core: HSD146 * 5th Gen Core: BDM85 + * 6th Gen Core: SKL029 */ static int popcnt_pc_map_elem_pq(uint64_t elem) From owner-svn-src-head@freebsd.org Mon May 23 23:13:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FE87B475AA; Mon, 23 May 2016 23:13:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 5CB41196E; Mon, 23 May 2016 23:13:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 569C51827; Mon, 23 May 2016 23:13:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 12A541CEA8; Mon, 23 May 2016 23:13:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id JwrG2wbtvTnT; Mon, 23 May 2016 23:13:11 +0000 (UTC) Subject: Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 047331CEA0 To: Alan Somers , Kurt Lidl References: <201605042234.u44MYBMX054443@repo.freebsd.org> <2368543.Vvp613SNcD@ralph.baldwin.cx> <684f4a82-f48c-b2bb-6a72-5c1dfea11a39@pix.net> Cc: John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Organization: FreeBSD Message-ID: <8074ef26-cb70-2397-b71e-b897a1270d22@FreeBSD.org> Date: Mon, 23 May 2016 16:13:08 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 23:13:14 -0000 On 5/23/16 1:30 PM, Alan Somers wrote: > UPDATING is updated as of r300539. Any objection to merging this to > stable/10? If any port uses it then yes. Binaries are built from 10.1 and expected to work on 10.1, 10.2, 10.3, 10.4, etc. -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Mon May 23 23:34:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F22EB47B1E; Mon, 23 May 2016 23:34:42 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x233.google.com (mail-oi0-x233.google.com [IPv6:2607:f8b0:4003:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F52812DA; Mon, 23 May 2016 23:34:42 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x233.google.com with SMTP id k23so961547oih.0; Mon, 23 May 2016 16:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=/04Rh7AcMXLau9xbrToIzd2Xa4nz7pcnZ4VtqDBeRa4=; b=tDioSeepRZJAK0m1lNyYxj+Nj4DTip5dVRYLrJHBBF6lgfOtZ+mUoFaltaZqzQWWm/ 7wZZa6NuoTvsZWfBOE4ivvzMowmyFrWC0mdvBCKWVQ/jdMBUV6JkDAccLRzfYDWrYq/g Lj1SKAmKV7VAjkfdD+T3hMSCvhC7YjHK7dh6XthAz1tHlz8JpyrKByX2psHwp0dehgQc i4m1nxczDnLhkAFXXxvIf0SLuynHAlBbR5JZ5FKpW305yWaoRuhJOpBr65qrmSCQYTWy Kw9xmPPnEUHtzdIQVlSJwRm7OX32p+weByIPiflZEbS5Jks3jwWMPfuX+pXEXOuGyJ6p Yc+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=/04Rh7AcMXLau9xbrToIzd2Xa4nz7pcnZ4VtqDBeRa4=; b=DEx2rRdaqqawkjQpO5Tbe4cSPXiMff1EnyO7RTzLGmxt+XVwmcgwygydLFri/HkSJr k+bY0zjug19YQK0PQ0yVxdGtCKIVHBZ3FDwwZgOKg0OdY7Rnlfg7iyJSSPK7iTDuZTPy aipFZ4RN30rZbYtrwJHKlfF16Im/iHz9CEHP96haAuy6n4cINrServSmFkUNOhXQa5Xg gNyOd79ZM6ukOsLfuORwju3lcGpxQTArlJij6io/77S8xquvUklbr/t/SfcJAn8+Uk1X 23U0ShB0ELemVFaoncQYp2fMDWSaKW+erMLkWO5jYIqjnN9sv4syCzkafg64xU3u2/5J kbTg== X-Gm-Message-State: ALyK8tI9vR8kgu9c7C5z+jG2SCpk1uLB3Wx3whvE/PCwqenzM4lnCh1ArSTgdcD4xy+cJAvnFoyp+S5eFZHW0w== MIME-Version: 1.0 X-Received: by 10.157.34.12 with SMTP id o12mr948254ota.55.1464046481509; Mon, 23 May 2016 16:34:41 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.4.200 with HTTP; Mon, 23 May 2016 16:34:41 -0700 (PDT) In-Reply-To: <8074ef26-cb70-2397-b71e-b897a1270d22@FreeBSD.org> References: <201605042234.u44MYBMX054443@repo.freebsd.org> <2368543.Vvp613SNcD@ralph.baldwin.cx> <684f4a82-f48c-b2bb-6a72-5c1dfea11a39@pix.net> <8074ef26-cb70-2397-b71e-b897a1270d22@FreeBSD.org> Date: Mon, 23 May 2016 17:34:41 -0600 X-Google-Sender-Auth: WE6t_rpuZlYsCRxRAjqkar7yTEo Message-ID: Subject: Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol From: Alan Somers To: Bryan Drewery Cc: Kurt Lidl , John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 23:34:42 -0000 On Mon, May 23, 2016 at 5:13 PM, Bryan Drewery wrote: > On 5/23/16 1:30 PM, Alan Somers wrote: > > UPDATING is updated as of r300539. Any objection to merging this to > > stable/10? > > If any port uses it then yes. Binaries are built from 10.1 and expected > to work on 10.1, 10.2, 10.3, 10.4, etc. > > -- > Regards, > Bryan Drewery > Most ports that use bitstring should work. The only ports that won't are ports that either store bitstrings on disk or transmit them across a network without an explicit serialization step. A few other weird cases would break too, like building a port on 10.3, updating sys/bitstring.h, then rebuilding some object files but not others. Is there any way to figure out what ports might be using this header? OpenHub code search didn't turn up anything. -Alan From owner-svn-src-head@freebsd.org Mon May 23 23:53:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72230B47EB2; Mon, 23 May 2016 23:53:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ig0-f193.google.com (mail-ig0-f193.google.com [209.85.213.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 429331CC8; Mon, 23 May 2016 23:53:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ig0-f193.google.com with SMTP id c3so379792igl.3; Mon, 23 May 2016 16:53:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=XMiH53Ea3uvy8C2dw1mMB38Hyx4iMOXuZGhCVaSdLAI=; b=X5YLfPUZaMvDMyOirFRsFzDQXFvnQNefLzIvUW43YZ2ZExVKq6YXH3qxXepD/lLCyg 0kA4ihI7YKzvOcLwt7AoLa+pL+GHrSlUsD0Ae6i++KiTu0wp7tgfLZJ9LhNq/yDEtilm 9+RGRI/KfRGJrJ08gOcF86qZjSQt/HhCEffO87/H0PxfEhNDD0CC4NfDeZMjRutVUzn5 2QMoLyct8FgO8KeoUr9Ckt82gblIhe+k6qABmYxIEZEzcLLE/k58V+GgKd74VUqqucmP 5CZt0e+x1NyFohv7uj43FeXKfP+bDntf/6SSgzHa2oSl9GP5CxAlMyEDX2juovT354dc 0chw== X-Gm-Message-State: ALyK8tJCDs0PRfkuP0Uq4oYR0TW27h2Lvj7+kvFmUXLQZp28/cVOaPlFFCGRu1LPc0ejiA== X-Received: by 10.50.228.47 with SMTP id sf15mr3680499igc.63.1464046938128; Mon, 23 May 2016 16:42:18 -0700 (PDT) Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com. [209.85.213.179]) by smtp.gmail.com with ESMTPSA id wh5sm4529189igb.19.2016.05.23.16.42.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 May 2016 16:42:17 -0700 (PDT) Received: by mail-ig0-f179.google.com with SMTP id bi2so43036295igb.0; Mon, 23 May 2016 16:42:17 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.50.4.101 with SMTP id j5mr15337130igj.8.1464046937141; Mon, 23 May 2016 16:42:17 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Mon, 23 May 2016 16:42:17 -0700 (PDT) In-Reply-To: References: <201605042234.u44MYBMX054443@repo.freebsd.org> <2368543.Vvp613SNcD@ralph.baldwin.cx> <684f4a82-f48c-b2bb-6a72-5c1dfea11a39@pix.net> <8074ef26-cb70-2397-b71e-b897a1270d22@FreeBSD.org> Date: Mon, 23 May 2016 16:42:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol From: Conrad Meyer To: Alan Somers Cc: Bryan Drewery , Kurt Lidl , John Baldwin , "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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 23:53:44 -0000 On Mon, May 23, 2016 at 4:34 PM, Alan Somers wrote: > On Mon, May 23, 2016 at 5:13 PM, Bryan Drewery wrote: >> >> On 5/23/16 1:30 PM, Alan Somers wrote: >> > UPDATING is updated as of r300539. Any objection to merging this to >> > stable/10? >> >> If any port uses it then yes. Binaries are built from 10.1 and expected >> to work on 10.1, 10.2, 10.3, 10.4, etc. > > > Most ports that use bitstring should work. The only ports that won't are > ports that either store bitstrings on disk or transmit them across a network > without an explicit serialization step. A few other weird cases would break > too, like building a port on 10.3, updating sys/bitstring.h, then rebuilding > some object files but not others. Is there any way to figure out what ports > might be using this header? OpenHub code search didn't turn up anything. It seems to me like this is exactly the sort of ABI breakage the stable/* branches promise not to make. On the other hand, it seems to me like the majority of the benefit of this patch could be gained without breaking ABI. (Optimistically iterate longs rather than bytes if the pointer's alignment is suitable.) Best, Conrad From owner-svn-src-head@freebsd.org Tue May 24 00:15:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A572B476E5; Tue, 24 May 2016 00:15:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D08EE1960; Tue, 24 May 2016 00:14:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O0Ex2V045500; Tue, 24 May 2016 00:14:59 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O0EwKT045498; Tue, 24 May 2016 00:14:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605240014.u4O0EwKT045498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 24 May 2016 00:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300544 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 00:15:00 -0000 Author: asomers Date: Tue May 24 00:14:58 2016 New Revision: 300544 URL: https://svnweb.freebsd.org/changeset/base/300544 Log: Fix build of kern/subr_unit.c, broken by r300539 Reported by: peter Pointyhat to: asomers Sponsored by: Spectra Logic Corp Modified: head/sys/kern/subr_unit.c head/sys/sys/bitstring.h Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Mon May 23 23:00:47 2016 (r300543) +++ head/sys/kern/subr_unit.c Tue May 24 00:14:58 2016 (r300544) @@ -984,9 +984,9 @@ main(int argc, char **argv) struct unrhdr *uh; char *a; long count = 10000; /* Number of unrs to test */ - long reps = 1; + long reps = 1, m; int ch; - u_int i, x, m, j; + u_int i, x, j; verbose = false; @@ -1043,7 +1043,7 @@ main(int argc, char **argv) print_unrhdr(uh); check_unrhdr(uh, __LINE__); } - for (i = 0; i < count; i++) { + for (i = 0; i < (u_int)count; i++) { if (a[i]) { if (verbose) { printf("C %u\n", i); Modified: head/sys/sys/bitstring.h ============================================================================== --- head/sys/sys/bitstring.h Mon May 23 23:00:47 2016 (r300543) +++ head/sys/sys/bitstring.h Tue May 24 00:14:58 2016 (r300544) @@ -65,9 +65,10 @@ #ifdef _KERNEL #include #include -#include #endif +#include + typedef unsigned long bitstr_t; /*---------------------- Private Implementation Details ----------------------*/ From owner-svn-src-head@freebsd.org Tue May 24 00:22:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F98EB47987; Tue, 24 May 2016 00:22:30 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17CEC1E0C; Tue, 24 May 2016 00:22:30 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O0MT2h048398; Tue, 24 May 2016 00:22:29 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O0MTTG048397; Tue, 24 May 2016 00:22:29 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605240022.u4O0MTTG048397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 24 May 2016 00:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300545 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 00:22:30 -0000 Author: allanjude Date: Tue May 24 00:22:29 2016 New Revision: 300545 URL: https://svnweb.freebsd.org/changeset/base/300545 Log: Add support for RAID 1+0 (striped mirrors) to bsdinstall/zfsboot Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Tue May 24 00:14:58 2016 (r300544) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Tue May 24 00:22:29 2016 (r300545) @@ -272,6 +272,7 @@ msg_not_enough_disks_selected="Not enoug msg_null_disk_argument="NULL disk argument" msg_null_index_argument="NULL index argument" msg_null_poolname="NULL poolname" +msg_odd_disk_selected="An even number of disks must be selected to create a RAID 1+0. (%u selected)" msg_ok="OK" msg_partition_scheme="Partition Scheme" msg_partition_scheme_help="Select partitioning scheme. GPT is recommended." @@ -284,6 +285,8 @@ msg_pool_name_help="Customize the name o msg_pool_type_disks="Pool Type/Disks:" msg_pool_type_disks_help="Choose type of ZFS Virtual Device and disks to use (Required)" msg_processing_selection="Processing selection..." +msg_raid10_desc="RAID 1+0 - n x 2-Way Mirrors" +msg_raid10_help="[4+ Disks] Striped Mirrors provides the best performance, but the least storage" msg_raidz1_desc="RAID-Z1 - Single Redundant RAID" msg_raidz1_help="[3+ Disks] Withstand failure of 1 disk. Recommended for: 3, 5 or 9 disks" msg_raidz2_desc="RAID-Z2 - Double Redundant RAID" @@ -478,6 +481,7 @@ dialog_menu_layout() local vdev_menu_list=" 'stripe' '$msg_stripe_desc' '$msg_stripe_help' 'mirror' '$msg_mirror_desc' '$msg_mirror_help' + 'raid10' '$msg_raid10_desc' '$msg_raid10_help' 'raidz1' '$msg_raidz1_desc' '$msg_raidz1_help' 'raidz2' '$msg_raidz2_desc' '$msg_raidz2_help' 'raidz3' '$msg_raidz3_desc' '$msg_raidz3_help' @@ -488,7 +492,7 @@ dialog_menu_layout() # Warn the user if vdev type is not valid case "$ZFSBOOT_VDEV_TYPE" in - stripe|mirror|raidz1|raidz2|raidz3) : known good ;; + stripe|mirror|raid10|raidz1|raidz2|raidz3) : known good ;; *) f_dprintf "%s: Invalid virtual device type \`%s'" \ $funcname "$ZFSBOOT_VDEV_TYPE" @@ -575,6 +579,7 @@ dialog_menu_layout() case "$ZFSBOOT_VDEV_TYPE" in stripe) want_disks=1 ;; mirror) want_disks=2 ;; + raid10) want_disks=4 ;; raidz1) want_disks=3 ;; raidz2) want_disks=4 ;; raidz3) want_disks=5 ;; @@ -683,6 +688,21 @@ dialog_menu_layout() "$ZFSBOOT_DISKS" f_count ndisks $ZFSBOOT_DISKS + + if [ "$ZFSBOOT_VDEV_TYPE" == "raid10" ] && + [ $(( $ndisks % 2 )) -ne 0 ]; then + f_dprintf "$funcname: %s: %s (%u %% 2 = %u)" \ + "$ZFSBOOT_VDEV_TYPE" \ + "Number of disks not even:" \ + $ndisks $(( $ndisks % 2 )) + msg_yes="$msg_change_selection" \ + msg_no="$msg_cancel" \ + f_yesno "%s: $msg_odd_disk_selected" \ + "$ZFSBOOT_VDEV_TYPE" $ndisks || + break + continue + fi + [ $ndisks -ge $want_disks ] && breakout=break && break @@ -1271,10 +1291,25 @@ zfs_create_boot() # f_dprintf "$funcname: Creating root pool..." create_options="$ZFSBOOT_POOL_CREATE_OPTIONS" - f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "-o altroot=$BSDINSTALL_CHROOT $create_options -m none -f" \ - "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" || - return $FAILURE + if [ "$zroot_vdevtype" == "raid10" ]; then + raid10_vdevs="" + for vdev in $zroot_vdevs; do + f_count nvdev $raid10_vdevs + if [ $(( $nvdev % 3 )) -eq 0 ]; then + raid10_vdevs="$raid10_vdevs mirror" + fi + raid10_vdevs="$raid10_vdevs $vdev" + done + f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ + "-o altroot=$BSDINSTALL_CHROOT $create_options -m none -f" \ + "$zroot_name" "" "$raid10_vdevs" || + return $FAILURE + else + f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ + "-o altroot=$BSDINSTALL_CHROOT $create_options -m none -f" \ + "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" || + return $FAILURE + fi # # Create ZFS dataset layout within the new root pool From owner-svn-src-head@freebsd.org Tue May 24 00:23:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54D21B47A50; Tue, 24 May 2016 00:23:40 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26CC81045; Tue, 24 May 2016 00:23:40 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O0Nd5v048478; Tue, 24 May 2016 00:23:39 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O0Ndws048477; Tue, 24 May 2016 00:23:39 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605240023.u4O0Ndws048477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 24 May 2016 00:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300546 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 00:23:40 -0000 Author: allanjude Date: Tue May 24 00:23:39 2016 New Revision: 300546 URL: https://svnweb.freebsd.org/changeset/base/300546 Log: Only set kern.geom.part.mbr.enforce_chs=0 once, instead of once per disk Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Tue May 24 00:22:29 2016 (r300545) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Tue May 24 00:23:39 2016 (r300546) @@ -806,7 +806,6 @@ zfs_create_diskpart() if [ "$ZFSBOOT_FORCE_4K_SECTORS" ]; then align_small="-a 4k" align_big="-a 1m" - sysctl kern.geom.part.mbr.enforce_chs=0 fi case "$ZFSBOOT_PARTITION_SCHEME" in @@ -1133,6 +1132,7 @@ zfs_create_boot() f_dprintf "$funcname: With 4K sectors..." f_eval_catch $funcname sysctl "$SYSCTL_ZFS_MIN_ASHIFT_12" \ || return $FAILURE + sysctl kern.geom.part.mbr.enforce_chs=0 fi local n=0 for disk in $disks; do From owner-svn-src-head@freebsd.org Tue May 24 00:57:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 719EFB4810E; Tue, 24 May 2016 00:57:13 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 376401F0E; Tue, 24 May 2016 00:57:13 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O0vCDW057684; Tue, 24 May 2016 00:57:12 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O0vBfL057675; Tue, 24 May 2016 00:57:11 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605240057.u4O0vBfL057675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Tue, 24 May 2016 00:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300547 - in head: lib/libcam sbin/camcontrol sbin/iscontrol sys/cam usr.sbin/camdd usr.sbin/mptutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 00:57:13 -0000 Author: truckman Date: Tue May 24 00:57:11 2016 New Revision: 300547 URL: https://svnweb.freebsd.org/changeset/base/300547 Log: Fix multiple Coverity Out-of-bounds access false postive issues in CAM The currently used idiom for clearing the part of a ccb after its header generates one or two Coverity errors for each time it is used. All instances generate an Out-of-bounds access (ARRAY_VS_SINGLETON) error because of the treatment of the header as a two element array, with a pointer to the non-existent second element being passed as the starting address to bzero(). Some instances also alsp generate Out-of-bounds access (OVERRUN) errors, probably because the space being cleared is larger than the sizeofstruct ccb_hdr). In addition, this idiom is difficult for humans to understand and it is error prone. The user has to chose the proper struct ccb_* type (which does not appear in the surrounding code) for the sizeof() in the length calculation. I found several instances where the length was incorrect, which could cause either an actual out of bounds write, or incompletely clear the ccb. A better way is to write the code to clear the ccb itself starting at sizeof(ccb_hdr) bytes from the start of the ccb, and calculate the length based on the specific type of struct ccb_* being cleared as specified by the union ccb member being used. The latter can normally be seen in the nearby code. This is friendlier for Coverity and other static analysis tools because they will see that the intent is to clear the trailing part of the ccb. Wrap all of the boilerplate code in a convenient macro that only requires a pointer to the desired union ccb member (or a pointer to the union ccb itself) as an argument. Reported by: Coverity CID: 1007578, 1008684, 1009724, 1009773, 1011304, 1011306 CID: 1011307, 1011308, 1011309, 1011310, 1011311, 1011312 CID: 1011313, 1011314, 1011315, 1011316, 1011317, 1011318 CID: 1011319, 1011320, 1011321, 1011322, 1011324, 1011325 CID: 1011326, 1011327, 1011328, 1011329, 1011330, 1011374 CID: 1011390, 1011391, 1011392, 1011393, 1011394, 1011395 CID: 1011396, 1011397, 1011398, 1011399, 1011400, 1011401 CID: 1011402, 1011403, 1011404, 1011405, 1011406, 1011408 CID: 1011409, 1011410, 1011411, 1011412, 1011413, 1011414 CID: 1017461, 1018387, 1086860, 1086874, 1194257, 1229897 CID: 1229968, 1306229, 1306234, 1331282, 1331283, 1331294 CID: 1331295, 1331535, 1331536, 1331539, 1331540, 1341623 CID: 1341624, 1341637, 1341638, 1355264, 1355324 Reviewed by: scottl, ken, delphij, imp MFH: 1 month Differential Revision: https://reviews.freebsd.org/D6496 Modified: head/lib/libcam/camlib.c head/sbin/camcontrol/attrib.c head/sbin/camcontrol/camcontrol.c head/sbin/camcontrol/fwdownload.c head/sbin/camcontrol/persist.c head/sbin/iscontrol/fsm.c head/sys/cam/cam_ccb.h head/usr.sbin/camdd/camdd.c head/usr.sbin/mptutil/mpt_cam.c Modified: head/lib/libcam/camlib.c ============================================================================== --- head/lib/libcam/camlib.c Tue May 24 00:23:39 2016 (r300546) +++ head/lib/libcam/camlib.c Tue May 24 00:57:11 2016 (r300547) @@ -619,7 +619,7 @@ cam_real_open_device(const char *path, i /* * Zero the payload, the kernel does look at the flags. */ - bzero(&(&ccb.ccb_h)[1], sizeof(struct ccb_trans_settings)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb.cts); /* * Get transfer settings for this device. Modified: head/sbin/camcontrol/attrib.c ============================================================================== --- head/sbin/camcontrol/attrib.c Tue May 24 00:23:39 2016 (r300546) +++ head/sbin/camcontrol/attrib.c Tue May 24 00:57:11 2016 (r300547) @@ -137,8 +137,7 @@ scsiattrib(struct cam_device *device, in goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); STAILQ_INIT(&write_attr_list); Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue May 24 00:23:39 2016 (r300546) +++ head/sbin/camcontrol/camcontrol.c Tue May 24 00:57:11 2016 (r300547) @@ -842,8 +842,7 @@ scsiinquiry(struct cam_device *device, i } /* cam_getccb cleans up the header, caller has to zero the payload */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); inq_buf = (struct scsi_inquiry_data *)malloc( sizeof(struct scsi_inquiry_data)); @@ -958,8 +957,7 @@ scsiserial(struct cam_device *device, in } /* cam_getccb cleans up the header, caller has to zero the payload */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); serial_buf = (struct scsi_vpd_unit_serial_number *) malloc(sizeof(*serial_buf)); @@ -1051,8 +1049,7 @@ camxferrate(struct cam_device *device) return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_trans_settings) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); ccb->ccb_h.func_code = XPT_GET_TRAN_SETTINGS; ccb->cts.type = CTS_TYPE_CURRENT_SETTINGS; @@ -1605,8 +1602,7 @@ ata_do_pass_16(struct cam_device *device ata_flags |= AP_FLAG_TLEN_NO_DATA; } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_ata_pass_16(&ccb->csio, retries, @@ -1667,8 +1663,7 @@ ata_do_28bit_cmd(struct cam_device *devi timeout, quiet); } - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_ataio) - - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->ataio); cam_fill_ataio(&ccb->ataio, retries, NULL, @@ -1737,8 +1732,7 @@ ata_do_cmd(struct cam_device *device, un return (error); } - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_ataio) - - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->ataio); cam_fill_ataio(&ccb->ataio, retries, NULL, @@ -3187,8 +3181,7 @@ rescan_or_reset_bus(path_id_t bus, int r * no-op, sending a rescan to the xpt bus would result in a status of * CAM_REQ_INVALID. */ - bzero(&(&matchccb.ccb_h)[1], - sizeof(struct ccb_dev_match) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&matchccb.cdm); matchccb.ccb_h.func_code = XPT_DEV_MATCH; matchccb.ccb_h.path_id = CAM_BUS_WILDCARD; bufsize = sizeof(struct dev_match_result) * 20; @@ -3536,8 +3529,7 @@ next_batch: * cam_getccb() zeros the CCB header only. So we need to zero the * payload portion of the ccb. */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_read_defects(&ccb->csio, /*retries*/ retry_count, @@ -3990,8 +3982,7 @@ mode_sense(struct cam_device *device, in if (ccb == NULL) errx(1, "mode_sense: couldn't allocate CCB"); - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_mode_sense(&ccb->csio, /* retries */ retry_count, @@ -4040,8 +4031,7 @@ mode_select(struct cam_device *device, i if (ccb == NULL) errx(1, "mode_select: couldn't allocate CCB"); - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_mode_select(&ccb->csio, /* retries */ retry_count, @@ -4158,8 +4148,7 @@ scsicmd(struct cam_device *device, int a return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(ccb); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { @@ -4660,8 +4649,7 @@ tagcontrol(struct cam_device *device, in cam_path_string(device, pathstr, sizeof(pathstr)); if (numtags >= 0) { - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_relsim) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->crs); ccb->ccb_h.func_code = XPT_REL_SIMQ; ccb->ccb_h.flags = CAM_DEV_QFREEZE; ccb->crs.release_flags = RELSIM_ADJUST_OPENINGS; @@ -4688,8 +4676,7 @@ tagcontrol(struct cam_device *device, in pathstr, ccb->crs.openings); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_getdevstats) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cgds); ccb->ccb_h.func_code = XPT_GDEV_STATS; @@ -4889,8 +4876,7 @@ get_cpi(struct cam_device *device, struc warnx("get_cpi: couldn't allocate CCB"); return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_pathinq) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cpi); ccb->ccb_h.func_code = XPT_PATH_INQ; if (cam_send_ccb(device, ccb) < 0) { warn("get_cpi: error sending Path Inquiry CCB"); @@ -4928,8 +4914,7 @@ get_cgd(struct cam_device *device, struc warnx("get_cgd: couldn't allocate CCB"); return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_pathinq) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cgd); ccb->ccb_h.func_code = XPT_GDEV_TYPE; if (cam_send_ccb(device, ccb) < 0) { warn("get_cgd: error sending Path Inquiry CCB"); @@ -4974,8 +4959,7 @@ dev_has_vpd_page(struct cam_device *dev, } /* cam_getccb cleans up the header, caller has to zero the payload */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); bzero(&sup_pages, sizeof(sup_pages)); @@ -5449,8 +5433,7 @@ get_print_cts(struct cam_device *device, return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_trans_settings) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); ccb->ccb_h.func_code = XPT_GET_TRAN_SETTINGS; @@ -5590,8 +5573,7 @@ ratecontrol(struct cam_device *device, i break; } } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_pathinq) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cpi); /* * Grab path inquiry information, so we can determine whether * or not the initiator is capable of the things that the user @@ -5617,8 +5599,7 @@ ratecontrol(struct cam_device *device, i goto ratecontrol_bailout; } bcopy(&ccb->cpi, &cpi, sizeof(struct ccb_pathinq)); - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_trans_settings) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); if (quiet == 0) { fprintf(stdout, "%s parameters:\n", user_settings ? "User" : "Current"); @@ -5871,8 +5852,7 @@ scsiformat(struct cam_device *device, in return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { @@ -6020,8 +6000,7 @@ doreport: do { cam_status status; - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); /* * There's really no need to do error recovery or @@ -6168,8 +6147,7 @@ scsisanitize(struct cam_device *device, return(1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { @@ -6430,8 +6408,7 @@ doreport: do { cam_status status; - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); /* * There's really no need to do error recovery or @@ -6573,8 +6550,7 @@ scsireportluns(struct cam_device *device return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); countonly = 0; lunsonly = 0; @@ -6822,8 +6798,7 @@ scsireadcapacity(struct cam_device *devi return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { @@ -7027,8 +7002,7 @@ smpcmd(struct cam_device *device, int ar return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { @@ -7221,8 +7195,7 @@ smpreportgeneral(struct cam_device *devi return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { @@ -7284,8 +7257,7 @@ try_long: if ((response->long_response & SMP_RG_LONG_RESPONSE) && (long_response == 0)) { ccb->ccb_h.status = CAM_REQ_INPROG; - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); long_response = 1; goto try_long; } @@ -7367,8 +7339,7 @@ smpphycontrol(struct cam_device *device, return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { @@ -7625,8 +7596,7 @@ smpmaninfo(struct cam_device *device, in return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { @@ -7720,8 +7690,7 @@ getdevid(struct cam_devitem *item) goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cdai); /* * On the first try, we just probe for the size of the data, and @@ -8006,8 +7975,7 @@ smpphylist(struct cam_device *device, in return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); STAILQ_INIT(&devlist.dev_queue); rgrequest = malloc(sizeof(*rgrequest)); @@ -8111,8 +8079,7 @@ smpphylist(struct cam_device *device, in char tmpstr[256]; int j; - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); ccb->ccb_h.status = CAM_REQ_INPROG; ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; @@ -8401,8 +8368,7 @@ scsigetopcodes(struct cam_device *device } /* cam_getccb cleans up the header, caller has to zero the payload */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); if (opcode_set != 0) { options |= RSO_OPTIONS_OC; @@ -8841,8 +8807,7 @@ scsireprobe(struct cam_device *device) return (1); } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); ccb->ccb_h.func_code = XPT_REPROBE_LUN; Modified: head/sbin/camcontrol/fwdownload.c ============================================================================== --- head/sbin/camcontrol/fwdownload.c Tue May 24 00:23:39 2016 (r300546) +++ head/sbin/camcontrol/fwdownload.c Tue May 24 00:57:11 2016 (r300547) @@ -459,8 +459,7 @@ fw_validate_ibm(struct cam_device *dev, } /* cam_getccb cleans up the header, caller has to zero the payload */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); bzero(&vpd_page, sizeof(vpd_page)); @@ -666,8 +665,7 @@ fw_check_device_ready(struct cam_device goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(ccb); if (devtype != CC_DT_SCSI) { dxfer_len = sizeof(struct ata_params); @@ -798,8 +796,7 @@ fw_download_img(struct cam_device *cam_d goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(ccb); max_pkt_size = vp->max_pkt_size; if (max_pkt_size == 0) @@ -830,8 +827,7 @@ fw_download_img(struct cam_device *cam_d vp->cdb_byte2; cdb.buffer_id = vp->inc_cdb_buffer_id ? pkt_count : 0; /* Zero out payload of ccb union after ccb header. */ - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); /* * Copy previously constructed cdb into ccb_scsiio * struct. Modified: head/sbin/camcontrol/persist.c ============================================================================== --- head/sbin/camcontrol/persist.c Tue May 24 00:23:39 2016 (r300546) +++ head/sbin/camcontrol/persist.c Tue May 24 00:57:11 2016 (r300547) @@ -450,8 +450,7 @@ scsipersist(struct cam_device *device, i goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { Modified: head/sbin/iscontrol/fsm.c ============================================================================== --- head/sbin/iscontrol/fsm.c Tue May 24 00:23:39 2016 (r300546) +++ head/sbin/iscontrol/fsm.c Tue May 24 00:57:11 2016 (r300547) @@ -372,7 +372,7 @@ doCAM(isess_t *sess) debug(2, "pathstr=%s", pathstr); ccb = cam_getccb(sess->camdev); - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_relsim) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->crs); ccb->ccb_h.func_code = XPT_REL_SIMQ; ccb->crs.release_flags = RELSIM_ADJUST_OPENINGS; ccb->crs.openings = sess->op->tags; Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Tue May 24 00:23:39 2016 (r300546) +++ head/sys/cam/cam_ccb.h Tue May 24 00:57:11 2016 (r300547) @@ -1230,6 +1230,10 @@ union ccb { struct ccb_async casync; }; +#define CCB_CLEAR_ALL_EXCEPT_HDR(ccbp) \ + bzero((char *)(ccbp) + sizeof((ccbp)->ccb_h), \ + sizeof(*(ccbp)) - sizeof((ccbp)->ccb_h)) + __BEGIN_DECLS static __inline void cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries, Modified: head/usr.sbin/camdd/camdd.c ============================================================================== --- head/usr.sbin/camdd/camdd.c Tue May 24 00:23:39 2016 (r300546) +++ head/usr.sbin/camdd/camdd.c Tue May 24 00:57:11 2016 (r300547) @@ -1305,8 +1305,7 @@ camdd_probe_pass(struct cam_device *cam_ goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_read_capacity(&ccb->csio, /*retries*/ probe_retry_count, @@ -1387,8 +1386,7 @@ rcap_done: goto bailout_error; } - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cpi); ccb->ccb_h.func_code = XPT_PATH_INQ; ccb->ccb_h.flags = CAM_DIR_NONE; @@ -2439,8 +2437,7 @@ camdd_pass_run(struct camdd_dev *dev) data = &buf->buf_type_spec.data; ccb = &data->ccb; - bzero(&(&ccb->ccb_h)[1], - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); /* * In almost every case the number of blocks should be the device Modified: head/usr.sbin/mptutil/mpt_cam.c ============================================================================== --- head/usr.sbin/mptutil/mpt_cam.c Tue May 24 00:23:39 2016 (r300546) +++ head/usr.sbin/mptutil/mpt_cam.c Tue May 24 00:57:11 2016 (r300547) @@ -241,8 +241,7 @@ fetch_scsi_capacity(struct cam_device *d return (ENOMEM); /* Zero the rest of the ccb. */ - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_scsiio) - - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_read_capacity(&ccb->csio, 1, NULL, MSG_SIMPLE_Q_TAG, &rcap, SSD_FULL_SIZE, 5000); @@ -273,8 +272,7 @@ fetch_scsi_capacity(struct cam_device *d } /* Zero the rest of the ccb. */ - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_scsiio) - - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); scsi_read_capacity_16(&ccb->csio, 1, NULL, MSG_SIMPLE_Q_TAG, 0, 0, 0, (uint8_t *)&rcaplong, sizeof(rcaplong), SSD_FULL_SIZE, 5000); @@ -355,8 +353,7 @@ fetch_scsi_inquiry(struct cam_device *de return (ENOMEM); /* Zero the rest of the ccb. */ - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_scsiio) - - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); inq_buf = calloc(1, sizeof(*inq_buf)); if (inq_buf == NULL) { From owner-svn-src-head@freebsd.org Tue May 24 01:12:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F823B4860C; Tue, 24 May 2016 01:12:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E8791BF5; Tue, 24 May 2016 01:12:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O1CKtP063658; Tue, 24 May 2016 01:12:20 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O1CJOt063645; Tue, 24 May 2016 01:12:19 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605240112.u4O1CJOt063645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 24 May 2016 01:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300548 - in head/sys: conf dev/bhnd dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/nvram dev/bhnd/siba modules/bhnd modules/bhnd/cores/bhnd_chipc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 01:12:21 -0000 Author: adrian Date: Tue May 24 01:12:19 2016 New Revision: 300548 URL: https://svnweb.freebsd.org/changeset/base/300548 Log: [bhnd] Implement pass-through resource management for ChipCommon. This patchset adds support to bhnd_chipc for sharing SYS_RES_MEMORY resources with its children, allowing us to hang devices off of bhnd_chipc that rely on access to a subset of the device register space that bhnd_chipc itself must also allocate. We could avoid most of this heavy lifting if RF_SHAREABLE+SYS_RES_MEMORY wasn't limited to use with allocations at the same size/offset. As a work-around, I implemented something similar to vga_pci.c, which implements similar reference counting of of PCI BAR resources for its children. With these changes, chipc will use reference counting of SYS_RES_MEMORY allocation/activation requests, to decide when to allocate/activate/ deactivate/release resources from the parent bhnd(4) bus. The requesting child device is allocated a new resource from chipc's rman, pointing to (possibly a subregion of) the refcounted bhnd resources allocated by chipc. Other resource types are just passed directly to the parent bhnd bus; RF_SHAREABLE works just fine with IRQs. I also lifted the SPROM device code out into a common driver, since this now allows me to hang simple subclasses off of a common driver off of both bhndb_pci and bhnd_chipc. Tested: * (landonf) Tested against BCM4331 and BCM4312, confirmed that SPROM still attaches and can be queried. Submitted by: Landon Fuller Reviewed by: mizkha@gmail.com Differential Revision: https://reviews.freebsd.org/D6471 Added: head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c (contents, props changed) head/sys/dev/bhnd/cores/chipc/chipc_private.h (contents, props changed) head/sys/dev/bhnd/cores/chipc/chipc_subr.c (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_sprom_subr.c - copied, changed from r300546, head/sys/dev/bhnd/nvram/bhnd_sprom.c Modified: head/sys/conf/files head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhndb/bhndb_pci_sprom.c head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/chipc/chipc.h head/sys/dev/bhnd/cores/chipc/chipcreg.h head/sys/dev/bhnd/cores/chipc/chipcvar.h head/sys/dev/bhnd/nvram/bhnd_nvram.h head/sys/dev/bhnd/nvram/bhnd_sprom.c head/sys/dev/bhnd/nvram/bhnd_spromvar.h head/sys/dev/bhnd/siba/siba.c head/sys/dev/bhnd/siba/siba_subr.c head/sys/dev/bhnd/siba/sibavar.h head/sys/modules/bhnd/Makefile head/sys/modules/bhnd/cores/bhnd_chipc/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 24 00:57:11 2016 (r300547) +++ head/sys/conf/files Tue May 24 01:12:19 2016 (r300548) @@ -1139,7 +1139,9 @@ dev/bhnd/bcma/bcma_bhndb.c optional bhn dev/bhnd/bcma/bcma_erom.c optional bhndbus | bcma dev/bhnd/bcma/bcma_subr.c optional bhndbus | bcma dev/bhnd/cores/chipc/chipc.c optional bhndbus | bhnd +dev/bhnd/cores/chipc/chipc_subr.c optional bhndbus | bhnd dev/bhnd/cores/chipc/bhnd_chipc_if.m optional bhndbus | bhnd +dev/bhnd/cores/chipc/bhnd_sprom_chipc.c optional bhndbus | bhnd dev/bhnd/cores/pci/bhnd_pci.c optional bhndbus pci | bhnd pci dev/bhnd/cores/pci/bhnd_pci_hostb.c optional bhndbus pci | bhndb pci dev/bhnd/cores/pci/bhnd_pcib.c optional bhnd_pcib bhnd pci @@ -1148,6 +1150,7 @@ dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c dev/bhnd/cores/pcie2/bhnd_pcie2b.c optional bhnd_pcie2b bhnd pci dev/bhnd/nvram/bhnd_nvram_if.m optional bhndbus | bhnd dev/bhnd/nvram/bhnd_sprom.c optional bhndbus | bhnd +dev/bhnd/nvram/bhnd_sprom_subr.c optional bhndbus | bhnd dev/bhnd/nvram/nvram_subr.c optional bhndbus | bhnd dev/bhnd/siba/siba.c optional bhndbus | siba dev/bhnd/siba/siba_bhndb.c optional bhndbus | siba bhndb Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Tue May 24 00:57:11 2016 (r300547) +++ head/sys/dev/bhnd/bhnd_subr.c Tue May 24 01:12:19 2016 (r300548) @@ -797,11 +797,11 @@ bhnd_parse_chipid(uint32_t idreg, bhnd_a struct bhnd_chipid result; /* Fetch the basic chip info */ - result.chip_id = CHIPC_GET_ATTR(idreg, ID_CHIP); - result.chip_pkg = CHIPC_GET_ATTR(idreg, ID_PKG); - result.chip_rev = CHIPC_GET_ATTR(idreg, ID_REV); - result.chip_type = CHIPC_GET_ATTR(idreg, ID_BUS); - result.ncores = CHIPC_GET_ATTR(idreg, ID_NUMCORE); + result.chip_id = CHIPC_GET_BITS(idreg, CHIPC_ID_CHIP); + result.chip_pkg = CHIPC_GET_BITS(idreg, CHIPC_ID_PKG); + result.chip_rev = CHIPC_GET_BITS(idreg, CHIPC_ID_REV); + result.chip_type = CHIPC_GET_BITS(idreg, CHIPC_ID_BUS); + result.ncores = CHIPC_GET_BITS(idreg, CHIPC_ID_NUMCORE); result.enum_addr = enum_addr; @@ -1020,15 +1020,11 @@ find_nvram_child(device_t dev) if (device_get_devclass(dev) != bhnd_devclass) return (NULL); - /* Look for a ChipCommon device */ + /* Look for a ChipCommon-attached NVRAM device */ if ((chipc = bhnd_find_child(dev, BHND_DEVCLASS_CC, -1)) != NULL) { - bhnd_nvram_src_t src; - - /* Query the NVRAM source and determine whether it's - * accessible via the ChipCommon device */ - src = BHND_CHIPC_NVRAM_SRC(chipc); - if (BHND_NVRAM_SRC_CC(src)) - return (chipc); + nvram = device_find_child(chipc, "bhnd_nvram", 0); + if (nvram != NULL) + return (nvram); } /* Not found */ Modified: head/sys/dev/bhnd/bhndb/bhndb_pci_sprom.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pci_sprom.c Tue May 24 00:57:11 2016 (r300547) +++ head/sys/dev/bhnd/bhndb/bhndb_pci_sprom.c Tue May 24 01:12:19 2016 (r300548) @@ -53,29 +53,15 @@ __FBSDID("$FreeBSD$"); #include #include "bhnd_nvram_if.h" + #include "bhndb_pcireg.h" #include "bhndb_pcivar.h" -struct bhndb_pci_sprom_softc { - device_t dev; - struct bhnd_resource *sprom_res; /**< SPROM resource */ - int sprom_rid; /**< SPROM RID */ - struct bhnd_sprom shadow; /**< SPROM shadow */ - struct mtx mtx; /**< SPROM shadow mutex */ -}; - -#define SPROM_LOCK_INIT(sc) \ - mtx_init(&(sc)->mtx, device_get_nameunit((sc)->dev), \ - "BHND PCI SPROM lock", MTX_DEF) -#define SPROM_LOCK(sc) mtx_lock(&(sc)->mtx) -#define SPROM_UNLOCK(sc) mtx_unlock(&(sc)->mtx) -#define SPROM_LOCK_ASSERT(sc, what) mtx_assert(&(sc)->mtx, what) -#define SPROM_LOCK_DESTROY(sc) mtx_destroy(&(sc)->mtx) - static int bhndb_pci_sprom_probe(device_t dev) { device_t bridge, bus; + int error; /* Our parent must be a PCI-BHND bridge with an attached bhnd bus */ bridge = device_get_parent(dev); @@ -86,125 +72,23 @@ bhndb_pci_sprom_probe(device_t dev) if (bus == NULL) return (ENXIO); - /* Found */ - device_set_desc(dev, "PCI-BHNDB SPROM/OTP"); - if (!bootverbose) - device_quiet(dev); + /* Defer to default driver implementation */ + if ((error = bhnd_sprom_probe(dev)) > 0) + return (error); - /* Refuse wildcard attachments */ return (BUS_PROBE_NOWILDCARD); } -static int -bhndb_pci_sprom_attach(device_t dev) -{ - struct bhndb_pci_sprom_softc *sc; - int error; - - sc = device_get_softc(dev); - sc->dev = dev; - - /* Allocate SPROM resource */ - sc->sprom_rid = 0; - sc->sprom_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->sprom_rid, RF_ACTIVE); - if (sc->sprom_res == NULL) { - device_printf(dev, "failed to allocate resources\n"); - return (ENXIO); - } - - /* Initialize SPROM shadow */ - if ((error = bhnd_sprom_init(&sc->shadow, sc->sprom_res, 0))) { - device_printf(dev, "unrecognized SPROM format\n"); - goto failed; - } - - /* Initialize mutex */ - SPROM_LOCK_INIT(sc); - - return (0); - -failed: - bhnd_release_resource(dev, SYS_RES_MEMORY, sc->sprom_rid, - sc->sprom_res); - return (error); -} - -static int -bhndb_pci_sprom_resume(device_t dev) -{ - return (0); -} - -static int -bhndb_pci_sprom_suspend(device_t dev) -{ - return (0); -} - -static int -bhndb_pci_sprom_detach(device_t dev) -{ - struct bhndb_pci_sprom_softc *sc; - - sc = device_get_softc(dev); - - bhnd_release_resource(dev, SYS_RES_MEMORY, sc->sprom_rid, - sc->sprom_res); - bhnd_sprom_fini(&sc->shadow); - SPROM_LOCK_DESTROY(sc); - - return (0); -} - -static int -bhndb_pci_sprom_getvar(device_t dev, const char *name, void *buf, size_t *len) -{ - struct bhndb_pci_sprom_softc *sc; - int error; - - sc = device_get_softc(dev); - - SPROM_LOCK(sc); - error = bhnd_sprom_getvar(&sc->shadow, name, buf, len); - SPROM_UNLOCK(sc); - - return (error); -} - -static int -bhndb_pci_sprom_setvar(device_t dev, const char *name, const void *buf, - size_t len) -{ - struct bhndb_pci_sprom_softc *sc; - int error; - - sc = device_get_softc(dev); - - SPROM_LOCK(sc); - error = bhnd_sprom_setvar(&sc->shadow, name, buf, len); - SPROM_UNLOCK(sc); - - return (error); -} static device_method_t bhndb_pci_sprom_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bhndb_pci_sprom_probe), - DEVMETHOD(device_attach, bhndb_pci_sprom_attach), - DEVMETHOD(device_resume, bhndb_pci_sprom_resume), - DEVMETHOD(device_suspend, bhndb_pci_sprom_suspend), - DEVMETHOD(device_detach, bhndb_pci_sprom_detach), - - /* NVRAM interface */ - DEVMETHOD(bhnd_nvram_getvar, bhndb_pci_sprom_getvar), - DEVMETHOD(bhnd_nvram_setvar, bhndb_pci_sprom_setvar), - DEVMETHOD_END }; -DEFINE_CLASS_0(bhnd_nvram, bhndb_pci_sprom_driver, bhndb_pci_sprom_methods, sizeof(struct bhndb_pci_sprom_softc)); +DEFINE_CLASS_1(bhnd_nvram, bhndb_pci_sprom_driver, bhndb_pci_sprom_methods, sizeof(struct bhnd_sprom_softc), bhnd_sprom_driver); DRIVER_MODULE(bhndb_pci_sprom, bhndb, bhndb_pci_sprom_driver, bhnd_nvram_devclass, NULL, NULL); MODULE_DEPEND(bhndb_pci_sprom, bhnd, 1, 1, 1); +MODULE_DEPEND(bhndb_pci_sprom, bhnd_sprom, 1, 1, 1); MODULE_VERSION(bhndb_pci_sprom, 1); Modified: head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m ============================================================================== --- head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m Tue May 24 00:57:11 2016 (r300547) +++ head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m Tue May 24 01:12:19 2016 (r300548) @@ -36,6 +36,11 @@ INTERFACE bhnd_chipc; # bhnd(4) ChipCommon interface. # +HEADER { + /* forward declarations */ + struct chipc_caps; +} + /** * Return the preferred NVRAM data source. * @@ -63,3 +68,35 @@ METHOD void write_chipctrl { uint32_t value; uint32_t mask; } + +/** + * Return a borrowed reference to ChipCommon's capability + * table. + * + * @param dev A bhnd(4) ChipCommon device + */ +METHOD struct chipc_caps * get_caps { + device_t dev; +} + +/** + * Enable hardware access to the SPROM. + * + * @param sc chipc driver state. + * + * @retval 0 success + * @retval EBUSY If enabling the hardware may conflict with + * other active devices. + */ +METHOD int enable_sprom { + device_t dev; +} + +/** + * Release hardware access to the SPROM. + * + * @param sc chipc driver state. + */ +METHOD void disable_sprom { + device_t dev; +} Added: head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c Tue May 24 01:12:19 2016 (r300548) @@ -0,0 +1,101 @@ +/*- + * Copyright (c) 2015-2016 Landon Fuller + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * ChipCommon SPROM driver. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "bhnd_chipc_if.h" +#include "bhnd_nvram_if.h" + +static int +chipc_sprom_probe(device_t dev) +{ + device_t chipc; + int error; + + chipc = device_get_parent(dev); + + /* Only match on SPROM devices */ + if (BHND_CHIPC_NVRAM_SRC(chipc) != BHND_NVRAM_SRC_SPROM) + return (ENXIO); + + /* Defer to default driver implementation */ + if ((error = bhnd_sprom_probe(dev)) > 0) + return (error); + + return (BUS_PROBE_NOWILDCARD); +} + +static int +chipc_sprom_attach(device_t dev) +{ + device_t chipc; + int error; + + /* Request that ChipCommon enable access to SPROM hardware before + * delegating attachment (and SPROM parsing) to the common driver */ + chipc = device_get_parent(dev); + if ((error = BHND_CHIPC_ENABLE_SPROM(chipc))) + return (error); + + error = bhnd_sprom_attach(dev); + BHND_CHIPC_DISABLE_SPROM(chipc); + return (error); +} + +static device_method_t chipc_sprom_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, chipc_sprom_probe), + DEVMETHOD(device_attach, chipc_sprom_attach), + DEVMETHOD_END +}; + +DEFINE_CLASS_1(bhnd_nvram, chipc_sprom_driver, chipc_sprom_methods, sizeof(struct bhnd_sprom_softc), bhnd_sprom_driver); +DRIVER_MODULE(bhnd_chipc_sprom, bhnd_chipc, chipc_sprom_driver, bhnd_nvram_devclass, NULL, NULL); + +MODULE_DEPEND(bhnd_chipc_sprom, bhnd, 1, 1, 1); +MODULE_DEPEND(bhnd_chipc_sprom, bhnd_chipc, 1, 1, 1); +MODULE_DEPEND(bhnd_chipc_sprom, bhnd_sprom, 1, 1, 1); +MODULE_VERSION(bhnd_chipc_sprom, 1); Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Tue May 24 00:57:11 2016 (r300547) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Tue May 24 01:12:19 2016 (r300548) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2015 Landon Fuller + * Copyright (c) 2015-2016 Landon Fuller + * Copyright (c) 2016 Michael Zhilin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,8 +43,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include +#include #include #include @@ -51,19 +55,14 @@ __FBSDID("$FreeBSD$"); #include #include - -#include "bhnd_nvram_if.h" +#include #include "chipcreg.h" #include "chipcvar.h" +#include "chipc_private.h" devclass_t bhnd_chipc_devclass; /**< bhnd(4) chipcommon device class */ -static const struct resource_spec chipc_rspec[CHIPC_MAX_RSPEC] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, - { -1, -1, 0 } -}; - static struct bhnd_device_quirk chipc_quirks[]; static struct bhnd_chip_quirk chipc_chip_quirks[]; @@ -77,7 +76,10 @@ static const struct bhnd_device chipc_de /* Device quirks table */ static struct bhnd_device_quirk chipc_quirks[] = { { BHND_HWREV_GTE (32), CHIPC_QUIRK_SUPPORTS_SPROM }, - { BHND_HWREV_GTE (35), CHIPC_QUIRK_SUPPORTS_NFLASH }, + { BHND_HWREV_GTE (35), CHIPC_QUIRK_SUPPORTS_CAP_EXT }, + { BHND_HWREV_EQ (38), CHIPC_QUIRK_4706_NFLASH }, /*BCM5357 ?*/ + { BHND_HWREV_GTE (49), CHIPC_QUIRK_IPX_OTPLAYOUT_SIZE }, + BHND_DEVICE_QUIRK_END }; @@ -111,15 +113,37 @@ static struct bhnd_chip_quirk chipc_chip {{ BHND_CHIP_IR(43602, HWREV_LTE(2)) }, CHIPC_QUIRK_4360_FEM_MUX_SPROM }, + /* BCM4706 */ + {{ BHND_CHIP_ID(4306) }, + CHIPC_QUIRK_4706_NFLASH }, + BHND_CHIP_QUIRK_END }; +static int chipc_try_activate_resource( + struct chipc_softc *sc, device_t child, + int type, int rid, struct resource *r, + bool req_direct); + +static int chipc_read_caps(struct chipc_softc *sc, + struct chipc_caps *caps); + +static int chipc_nvram_attach(struct chipc_softc *sc); +static bhnd_nvram_src_t chipc_nvram_identify(struct chipc_softc *sc); +static bool chipc_should_enable_sprom( + struct chipc_softc *sc); + +static int chipc_init_rman(struct chipc_softc *sc); +static void chipc_free_rman(struct chipc_softc *sc); +static struct rman *chipc_get_rman(struct chipc_softc *sc, + int type); + /* quirk and capability flag convenience macros */ #define CHIPC_QUIRK(_sc, _name) \ ((_sc)->quirks & CHIPC_QUIRK_ ## _name) #define CHIPC_CAP(_sc, _name) \ - ((_sc)->caps & CHIPC_ ## _name) + ((_sc)->caps._name) #define CHIPC_ASSERT_QUIRK(_sc, name) \ KASSERT(CHIPC_QUIRK((_sc), name), ("quirk " __STRING(_name) " not set")) @@ -127,12 +151,6 @@ static struct bhnd_chip_quirk chipc_chip #define CHIPC_ASSERT_CAP(_sc, name) \ KASSERT(CHIPC_CAP((_sc), name), ("capability " __STRING(_name) " not set")) -static bhnd_nvram_src_t chipc_nvram_identify(struct chipc_softc *sc); -static int chipc_sprom_init(struct chipc_softc *); -static int chipc_enable_sprom_pins(struct chipc_softc *); -static int chipc_disable_sprom_pins(struct chipc_softc *); - - static int chipc_probe(device_t dev) { @@ -159,19 +177,36 @@ chipc_attach(device_t dev) sc->dev = dev; sc->quirks = bhnd_device_quirks(dev, chipc_devices, sizeof(chipc_devices[0])); - + sc->sprom_refcnt = 0; + CHIPC_LOCK_INIT(sc); + STAILQ_INIT(&sc->mem_regions); - /* Allocate bus resources */ - memcpy(sc->rspec, chipc_rspec, sizeof(sc->rspec)); - if ((error = bhnd_alloc_resources(dev, sc->rspec, sc->res))) - return (error); + /* Set up resource management */ + if ((error = chipc_init_rman(sc))) { + device_printf(sc->dev, + "failed to initialize chipc resource state: %d\n", error); + goto failed; + } + + /* Allocate the region containing our core registers */ + if ((sc->core_region = chipc_find_region_by_rid(sc, 0)) == NULL) { + error = ENXIO; + goto failed; + } + + error = chipc_retain_region(sc, sc->core_region, + RF_ALLOCATED|RF_ACTIVE); + if (error) { + sc->core_region = NULL; + goto failed; + } else { + sc->core = sc->core_region->cr_res; + } - sc->core = sc->res[0]; - /* Fetch our chipset identification data */ ccid_reg = bhnd_bus_read_4(sc->core, CHIPC_ID); - chip_type = CHIPC_GET_ATTR(ccid_reg, ID_BUS); + chip_type = CHIPC_GET_BITS(ccid_reg, CHIPC_ID_BUS); switch (chip_type) { case BHND_CHIPTYPE_SIBA: @@ -185,44 +220,36 @@ chipc_attach(device_t dev) default: device_printf(dev, "unsupported chip type %hhu\n", chip_type); error = ENODEV; - goto cleanup; + goto failed; } sc->ccid = bhnd_parse_chipid(ccid_reg, enum_addr); - /* Fetch capability and status register values */ - sc->caps = bhnd_bus_read_4(sc->core, CHIPC_CAPABILITIES); - sc->cst = bhnd_bus_read_4(sc->core, CHIPC_CHIPST); - - /* Identify NVRAM source */ - sc->nvram_src = chipc_nvram_identify(sc); - - /* Read NVRAM data */ - switch (sc->nvram_src) { - case BHND_NVRAM_SRC_OTP: - // TODO (requires access to OTP hardware) - device_printf(sc->dev, "NVRAM-OTP unsupported\n"); - break; + /* Fetch and parse capability register(s) */ + if ((error = chipc_read_caps(sc, &sc->caps))) + goto failed; - case BHND_NVRAM_SRC_NFLASH: - // TODO (requires access to NFLASH hardware) - device_printf(sc->dev, "NVRAM-NFLASH unsupported\n"); - break; + if (bootverbose) + chipc_print_caps(sc->dev, &sc->caps); - case BHND_NVRAM_SRC_SPROM: - if ((error = chipc_sprom_init(sc))) - goto cleanup; - break; + /* Identify NVRAM source and add child device. */ + sc->nvram_src = chipc_nvram_identify(sc); + if ((error = chipc_nvram_attach(sc))) + goto failed; - case BHND_NVRAM_SRC_UNKNOWN: - /* Handled externally */ - break; - } + /* Standard bus probe */ + if ((error = bus_generic_attach(dev))) + goto failed; return (0); -cleanup: - bhnd_release_resources(dev, sc->rspec, sc->res); +failed: + if (sc->core_region != NULL) { + chipc_release_region(sc, sc->core_region, + RF_ALLOCATED|RF_ACTIVE); + } + + chipc_free_rman(sc); CHIPC_LOCK_DESTROY(sc); return (error); } @@ -231,9 +258,15 @@ static int chipc_detach(device_t dev) { struct chipc_softc *sc; + int error; sc = device_get_softc(dev); - bhnd_release_resources(dev, sc->rspec, sc->res); + + if ((error = bus_generic_detach(dev))) + return (error); + + chipc_release_region(sc, sc->core_region, RF_ALLOCATED|RF_ACTIVE); + chipc_free_rman(sc); bhnd_sprom_fini(&sc->sprom); CHIPC_LOCK_DESTROY(sc); @@ -241,58 +274,131 @@ chipc_detach(device_t dev) return (0); } +/* Read and parse chipc capabilities */ static int -chipc_suspend(device_t dev) +chipc_read_caps(struct chipc_softc *sc, struct chipc_caps *caps) { - return (0); -} + uint32_t cap_reg; + uint32_t cap_ext_reg; + uint32_t regval; + + /* Fetch cap registers */ + cap_reg = bhnd_bus_read_4(sc->core, CHIPC_CAPABILITIES); + cap_ext_reg = 0; + if (CHIPC_QUIRK(sc, SUPPORTS_CAP_EXT)) + cap_ext_reg = bhnd_bus_read_4(sc->core, CHIPC_CAPABILITIES_EXT); + + /* Extract values */ + caps->num_uarts = CHIPC_GET_BITS(cap_reg, CHIPC_CAP_NUM_UART); + caps->mipseb = CHIPC_GET_FLAG(cap_reg, CHIPC_CAP_MIPSEB); + caps->uart_gpio = CHIPC_GET_FLAG(cap_reg, CHIPC_CAP_UARTGPIO); + caps->uart_clock = CHIPC_GET_BITS(cap_reg, CHIPC_CAP_UCLKSEL); + + caps->extbus_type = CHIPC_GET_BITS(cap_reg, CHIPC_CAP_EXTBUS); + caps->power_control = CHIPC_GET_FLAG(cap_reg, CHIPC_CAP_PWR_CTL); + caps->jtag_master = CHIPC_GET_FLAG(cap_reg, CHIPC_CAP_JTAGP); + + caps->pll_type = CHIPC_GET_BITS(cap_reg, CHIPC_CAP_PLL); + caps->backplane_64 = CHIPC_GET_FLAG(cap_reg, CHIPC_CAP_BKPLN64); + caps->boot_rom = CHIPC_GET_FLAG(cap_reg, CHIPC_CAP_ROM); + caps->pmu = CHIPC_GET_FLAG(cap_reg, CHIPC_CAP_PMU); + caps->eci = CHIPC_GET_FLAG(cap_reg, CHIPC_CAP_ECI); + caps->sprom = CHIPC_GET_FLAG(cap_reg, CHIPC_CAP_SPROM); + caps->otp_size = CHIPC_GET_BITS(cap_reg, CHIPC_CAP_OTP_SIZE); + + caps->seci = CHIPC_GET_FLAG(cap_ext_reg, CHIPC_CAP2_SECI); + caps->gsio = CHIPC_GET_FLAG(cap_ext_reg, CHIPC_CAP2_GSIO); + caps->aob = CHIPC_GET_FLAG(cap_ext_reg, CHIPC_CAP2_AOB); + + /* Fetch OTP size for later IPX controller revisions */ + if (CHIPC_QUIRK(sc, IPX_OTPLAYOUT_SIZE)) { + regval = bhnd_bus_read_4(sc->core, CHIPC_OTPLAYOUT); + caps->otp_size = CHIPC_GET_BITS(regval, CHIPC_OTPL_SIZE); + } + + /* Determine flash type and paramters */ + caps->cfi_width = 0; + + switch (CHIPC_GET_BITS(cap_reg, CHIPC_CAP_FLASH)) { + case CHIPC_CAP_SFLASH_ST: + caps->flash_type = CHIPC_SFLASH_ST; + break; + case CHIPC_CAP_SFLASH_AT: + caps->flash_type = CHIPC_SFLASH_AT; + break; + case CHIPC_CAP_NFLASH: + caps->flash_type = CHIPC_NFLASH; + break; + case CHIPC_CAP_PFLASH: + caps->flash_type = CHIPC_PFLASH_CFI; + + /* determine cfi width */ + regval = bhnd_bus_read_4(sc->core, CHIPC_FLASH_CFG); + if (CHIPC_GET_FLAG(regval, CHIPC_FLASH_CFG_DS)) + caps->cfi_width = 2; + else + caps->cfi_width = 1; + + break; + case CHIPC_CAP_FLASH_NONE: + caps->flash_type = CHIPC_FLASH_NONE; + break; + + } + + /* Handle 4706_NFLASH fallback */ + if (CHIPC_QUIRK(sc, 4706_NFLASH) && + CHIPC_GET_FLAG(cap_reg, CHIPC_CAP_4706_NFLASH)) + { + caps->flash_type = CHIPC_NFLASH_4706; + } -static int -chipc_resume(device_t dev) -{ return (0); } /** - * Initialize local SPROM shadow, if required. - * - * @param sc chipc driver state. + * If supported, add an appropriate NVRAM child device. */ static int -chipc_sprom_init(struct chipc_softc *sc) +chipc_nvram_attach(struct chipc_softc *sc) { - int error; + device_t nvram_dev; + rman_res_t start; + int error; - KASSERT(sc->nvram_src == BHND_NVRAM_SRC_SPROM, - ("non-SPROM source (%u)\n", sc->nvram_src)); + switch (sc->nvram_src) { + case BHND_NVRAM_SRC_OTP: + // TODO OTP support + device_printf(sc->dev, "OTP nvram source unsupported\n"); + return (0); - /* Enable access to the SPROM */ - CHIPC_LOCK(sc); - if ((error = chipc_enable_sprom_pins(sc))) - goto failed; + case BHND_NVRAM_SRC_SPROM: + /* Add OTP/SPROM device */ + nvram_dev = BUS_ADD_CHILD(sc->dev, 0, "bhnd_nvram", -1); + if (nvram_dev == NULL) { + device_printf(sc->dev, "failed to add NVRAM device\n"); + return (ENXIO); + } + + start = rman_get_start(sc->core->res) + CHIPC_SPROM_OTP; + error = bus_set_resource(nvram_dev, SYS_RES_MEMORY, 0, start, + CHIPC_SPROM_OTP_SIZE); + return (error); - /* Initialize SPROM parser */ - error = bhnd_sprom_init(&sc->sprom, sc->core, CHIPC_SPROM_OTP); - if (error) { - device_printf(sc->dev, "SPROM identification failed: %d\n", - error); + case BHND_NVRAM_SRC_FLASH: + // TODO flash support + device_printf(sc->dev, "flash nvram source unsupported\n"); + return (0); - chipc_disable_sprom_pins(sc); - goto failed; - } + case BHND_NVRAM_SRC_UNKNOWN: + /* Handled externally */ + return (0); - /* Drop access to the SPROM lines */ - if ((error = chipc_disable_sprom_pins(sc))) { - bhnd_sprom_fini(&sc->sprom); - goto failed; + default: + device_printf(sc->dev, "invalid nvram source: %u\n", + sc->nvram_src); + return (ENXIO); } - CHIPC_UNLOCK(sc); - - return (0); - -failed: - CHIPC_UNLOCK(sc); - return (error); } /** @@ -317,27 +423,645 @@ chipc_nvram_identify(struct chipc_softc * We check for hardware presence in order of precedence. For example, * SPROM is is always used in preference to internal OTP if found. */ - if (CHIPC_CAP(sc, CAP_SPROM)) { + if (CHIPC_CAP(sc, sprom)) { srom_ctrl = bhnd_bus_read_4(sc->core, CHIPC_SPROM_CTRL); if (srom_ctrl & CHIPC_SRC_PRESENT) return (BHND_NVRAM_SRC_SPROM); } /* Check for OTP */ - if (CHIPC_CAP(sc, CAP_OTP_SIZE)) + if (CHIPC_CAP(sc, otp_size) != 0) return (BHND_NVRAM_SRC_OTP); - /* - * Finally, Northstar chipsets (and possibly other chipsets?) support - * external NAND flash. - */ - if (CHIPC_QUIRK(sc, SUPPORTS_NFLASH) && CHIPC_CAP(sc, CAP_NFLASH)) - return (BHND_NVRAM_SRC_NFLASH); + /* Check for flash */ + if (CHIPC_CAP(sc, flash_type) != CHIPC_FLASH_NONE) + return (BHND_NVRAM_SRC_FLASH); /* No NVRAM hardware capability declared */ return (BHND_NVRAM_SRC_UNKNOWN); } +static int +chipc_suspend(device_t dev) +{ + return (bus_generic_suspend(dev)); +} + +static int +chipc_resume(device_t dev) +{ + return (bus_generic_resume(dev)); +} + +static void +chipc_probe_nomatch(device_t dev, device_t child) +{ + struct resource_list *rl; + const char *name; + + name = device_get_name(child); + if (name == NULL) + name = "unknown device"; + + device_printf(dev, "<%s> at", name); + + rl = BUS_GET_RESOURCE_LIST(dev, child); + if (rl != NULL) { + resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); + } + + printf(" (no driver attached)\n"); +} + +static int +chipc_print_child(device_t dev, device_t child) +{ + struct resource_list *rl; + int retval = 0; + + retval += bus_print_child_header(dev, child); + + rl = BUS_GET_RESOURCE_LIST(dev, child); + if (rl != NULL) { + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, + "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, + "%jd"); + } + + retval += bus_print_child_domain(dev, child); + retval += bus_print_child_footer(dev, child); + + return (retval); +} + +static int +chipc_child_pnpinfo_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + if (buflen == 0) + return (EOVERFLOW); + + *buf = '\0'; + return (0); +} + +static int +chipc_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + if (buflen == 0) + return (EOVERFLOW); + + *buf = '\0'; + return (ENXIO); +} + +static device_t +chipc_add_child(device_t dev, u_int order, const char *name, int unit) +{ + struct chipc_devinfo *dinfo; + device_t child; + + child = device_add_child_ordered(dev, order, name, unit); + if (child == NULL) + return (NULL); + + dinfo = malloc(sizeof(struct chipc_devinfo), M_BHND, M_NOWAIT); + if (dinfo == NULL) { + device_delete_child(dev, child); + return (NULL); + } + + resource_list_init(&dinfo->resources); + + device_set_ivars(child, dinfo); + + return (child); +} + +static void +chipc_child_deleted(device_t dev, device_t child) +{ + struct chipc_devinfo *dinfo = device_get_ivars(child); + + if (dinfo != NULL) { + resource_list_free(&dinfo->resources); + free(dinfo, M_BHND); + } + + device_set_ivars(child, NULL); +} + +static struct resource_list * +chipc_get_resource_list(device_t dev, device_t child) +{ + struct chipc_devinfo *dinfo = device_get_ivars(child); + return (&dinfo->resources); +} + + +/* Allocate region records for the given port, and add the port's memory + * range to the mem_rman */ +static int +chipc_rman_init_regions (struct chipc_softc *sc, bhnd_port_type type, + u_int port) +{ + struct chipc_region *cr; + rman_res_t start, end; + u_int num_regions; + int error; + + num_regions = bhnd_get_region_count(sc->dev, port, port); + for (u_int region = 0; region < num_regions; region++) { + /* Allocate new region record */ + cr = chipc_alloc_region(sc, type, port, region); + if (cr == NULL) + return (ENODEV); + + /* Can't manage regions that cannot be allocated */ + if (cr->cr_rid < 0) { + BHND_DEBUG_DEV(sc->dev, "no rid for chipc region " + "%s%u.%u", bhnd_port_type_name(type), port, region); + chipc_free_region(sc, cr); + continue; + } + + /* Add to rman's managed range */ + start = cr->cr_addr; + end = cr->cr_end; + if ((error = rman_manage_region(&sc->mem_rman, start, end))) { + chipc_free_region(sc, cr); + return (error); + } + + /* Add to region list */ + STAILQ_INSERT_TAIL(&sc->mem_regions, cr, cr_link); + } + + return (0); +} + +/* Initialize memory state for all chipc port regions */ +static int +chipc_init_rman(struct chipc_softc *sc) +{ + u_int num_ports; + int error; + + /* Port types for which we'll register chipc_region mappings */ + bhnd_port_type types[] = { + BHND_PORT_DEVICE + }; + + /* Initialize resource manager */ + sc->mem_rman.rm_start = 0; + sc->mem_rman.rm_end = BUS_SPACE_MAXADDR; + sc->mem_rman.rm_type = RMAN_ARRAY; + sc->mem_rman.rm_descr = "ChipCommon Device Memory"; + if ((error = rman_init(&sc->mem_rman))) { + device_printf(sc->dev, "could not initialize mem_rman: %d\n", + error); + return (error); + } + + /* Populate per-port-region state */ + for (u_int i = 0; i < nitems(types); i++) { + num_ports = bhnd_get_port_count(sc->dev, types[i]); + for (u_int port = 0; port < num_ports; port++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue May 24 01:20:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72C6CB48772; Tue, 24 May 2016 01:20:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 280731F41; Tue, 24 May 2016 01:20:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O1KVhm064077; Tue, 24 May 2016 01:20:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O1KVOT064075; Tue, 24 May 2016 01:20:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605240120.u4O1KVOT064075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 24 May 2016 01:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300549 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 01:20:32 -0000 Author: adrian Date: Tue May 24 01:20:30 2016 New Revision: 300549 URL: https://svnweb.freebsd.org/changeset/base/300549 Log: [bwn] add extra debugging for non-SIBA devices. This is a no-op at the present moment, but will eventually remind me where the SIBA specific demons lie. Tested: * BCM4322, STA mode Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwn_phy_common.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue May 24 01:12:19 2016 (r300548) +++ head/sys/dev/bwn/if_bwn.c Tue May 24 01:20:30 2016 (r300549) @@ -4712,11 +4712,9 @@ bwn_rf_turnoff(struct bwn_mac *mac) /* * SSB PHY reset. - * - * XXX TODO: BCMA PHY reset. */ static void -bwn_phy_reset(struct bwn_mac *mac) +bwn_phy_reset_siba(struct bwn_mac *mac) { struct bwn_softc *sc = mac->mac_sc; @@ -4729,6 +4727,17 @@ bwn_phy_reset(struct bwn_mac *mac) DELAY(1000); } +static void +bwn_phy_reset(struct bwn_mac *mac) +{ + + if (bwn_is_bus_siba(mac)) { + bwn_phy_reset_siba(mac); + } else { + BWN_ERRPRINTF(mac->mac_sc, "%s: unknown bus!\n", __func__); + } +} + static int bwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { Modified: head/sys/dev/bwn/if_bwn_phy_common.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_common.c Tue May 24 01:12:19 2016 (r300548) +++ head/sys/dev/bwn/if_bwn_phy_common.c Tue May 24 01:20:30 2016 (r300549) @@ -157,6 +157,8 @@ bwn_phy_force_clock(struct bwn_mac *mac, else tmp &= ~SIBA_TGSLOW_FGC; siba_write_4(sc->sc_dev, SIBA_TGSLOW, tmp); + } else { + BWN_ERRPRINTF(sc, "%s: unknown bus!\n", __func__); } } @@ -190,6 +192,8 @@ bwn_mac_phy_clock_set(struct bwn_mac *ma else val &= ~BWN_TGSLOW_MACPHYCLKEN; siba_write_4(sc->sc_dev, SIBA_TGSLOW, val); + } else { + BWN_ERRPRINTF(sc, "%s: unknown bus!\n", __func__); } } @@ -205,5 +209,7 @@ bwn_wireless_core_phy_pll_reset(struct b siba_cc_mask32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, ~0x4); siba_cc_set32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, 0x4); siba_cc_mask32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, ~0x4); + } else { + BWN_ERRPRINTF(sc, "%s: unknown bus!\n", __func__); } } From owner-svn-src-head@freebsd.org Tue May 24 01:33:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25C78B48C68; Tue, 24 May 2016 01:33:51 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F14491887; Tue, 24 May 2016 01:33:50 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O1Xo2H069859; Tue, 24 May 2016 01:33:50 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O1XnFI069856; Tue, 24 May 2016 01:33:49 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201605240133.u4O1XnFI069856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 24 May 2016 01:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300550 - in head/sys: conf dev/iicbus dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 01:33:51 -0000 Author: loos Date: Tue May 24 01:33:49 2016 New Revision: 300550 URL: https://svnweb.freebsd.org/changeset/base/300550 Log: Move the OFW iicbus code to dev/iicbus to stop polluting dev/ofw with unrelated code. Discussed with: nwhitehorn (a long time ago) Added: head/sys/dev/iicbus/ofw_iicbus.c - copied unchanged from r300549, head/sys/dev/ofw/ofw_iicbus.c Deleted: head/sys/dev/ofw/ofw_iicbus.c Modified: head/sys/conf/files head/sys/conf/files.powerpc Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 24 01:20:30 2016 (r300549) +++ head/sys/conf/files Tue May 24 01:33:49 2016 (r300550) @@ -1575,6 +1575,7 @@ dev/iicbus/iicsmb.c optional iicsmb dependency "iicbus_if.h" dev/iicbus/iicoc.c optional iicoc dev/iicbus/lm75.c optional lm75 +dev/iicbus/ofw_iicbus.c optional fdt iicbus dev/iicbus/pcf8563.c optional pcf8563 dev/iicbus/s35390a.c optional s35390a dev/iir/iir.c optional iir @@ -2174,7 +2175,6 @@ dev/ofw/ofw_bus_if.m optional fdt dev/ofw/ofw_bus_subr.c optional fdt dev/ofw/ofw_fdt.c optional fdt dev/ofw/ofw_if.m optional fdt -dev/ofw/ofw_iicbus.c optional fdt iicbus dev/ofw/ofw_subr.c optional fdt dev/ofw/ofwbus.c optional fdt dev/ofw/openfirm.c optional fdt Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue May 24 01:20:30 2016 (r300549) +++ head/sys/conf/files.powerpc Tue May 24 01:33:49 2016 (r300550) @@ -44,6 +44,7 @@ dev/iicbus/adt746x.c optional ad dev/iicbus/ds1631.c optional ds1631 powermac dev/iicbus/ds1775.c optional ds1775 powermac dev/iicbus/max6690.c optional max6690 powermac +dev/iicbus/ofw_iicbus.c optional iicbus aim dev/nand/nfc_fsl.c optional nand mpc85xx dev/nand/nfc_rb.c optional nand mpc85xx # ofw can be either aim or fdt: fdt case handled in files. aim only powerpc specific. @@ -55,7 +56,6 @@ dev/ofw/ofw_if.m optional aim dev/ofw/ofw_bus_subr.c optional aim dev/ofw/ofw_console.c optional aim dev/ofw/ofw_disk.c optional ofwd aim -dev/ofw/ofw_iicbus.c optional iicbus aim dev/ofw/ofwbus.c optional aim | fdt dev/ofw/ofwpci.c optional pci dev/ofw/ofw_standard.c optional aim powerpc Copied: head/sys/dev/iicbus/ofw_iicbus.c (from r300549, head/sys/dev/ofw/ofw_iicbus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/ofw_iicbus.c Tue May 24 01:33:49 2016 (r300550, copy of r300549, head/sys/dev/ofw/ofw_iicbus.c) @@ -0,0 +1,238 @@ +/*- + * Copyright (c) 2009, Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "iicbus_if.h" + +/* Methods */ +static device_probe_t ofw_iicbus_probe; +static device_attach_t ofw_iicbus_attach; +static device_t ofw_iicbus_add_child(device_t dev, u_int order, + const char *name, int unit); +static const struct ofw_bus_devinfo *ofw_iicbus_get_devinfo(device_t bus, + device_t dev); + +static device_method_t ofw_iicbus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ofw_iicbus_probe), + DEVMETHOD(device_attach, ofw_iicbus_attach), + + /* Bus interface */ + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + DEVMETHOD(bus_add_child, ofw_iicbus_add_child), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, ofw_iicbus_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +struct ofw_iicbus_devinfo { + struct iicbus_ivar opd_dinfo; /* Must be the first. */ + struct ofw_bus_devinfo opd_obdinfo; +}; + +devclass_t ofwiicbus_devclass; + +DEFINE_CLASS_1(iicbus, ofw_iicbus_driver, ofw_iicbus_methods, + sizeof(struct iicbus_softc), iicbus_driver); +EARLY_DRIVER_MODULE(ofw_iicbus, iicbb, ofw_iicbus_driver, ofwiicbus_devclass, + 0, 0, BUS_PASS_BUS); +EARLY_DRIVER_MODULE(ofw_iicbus, iichb, ofw_iicbus_driver, ofwiicbus_devclass, + 0, 0, BUS_PASS_BUS); +MODULE_VERSION(ofw_iicbus, 1); +MODULE_DEPEND(ofw_iicbus, iicbus, 1, 1, 1); + +static int +ofw_iicbus_probe(device_t dev) +{ + + if (ofw_bus_get_node(dev) == -1) + return (ENXIO); + device_set_desc(dev, "OFW I2C bus"); + + return (0); +} + +static int +ofw_iicbus_attach(device_t dev) +{ + struct iicbus_softc *sc = IICBUS_SOFTC(dev); + struct ofw_iicbus_devinfo *dinfo; + phandle_t child, node, root; + pcell_t freq, paddr; + device_t childdev; + ssize_t compatlen; + char compat[255]; + char *curstr; + u_int iic_addr_8bit = 0; + + sc->dev = dev; + mtx_init(&sc->lock, "iicbus", NULL, MTX_DEF); + + /* + * If there is a clock-frequency property for the device node, use it as + * the starting value for the bus frequency. Then call the common + * routine that handles the tunable/sysctl which allows the FDT value to + * be overridden by the user. + */ + node = ofw_bus_get_node(dev); + freq = 0; + OF_getencprop(node, "clock-frequency", &freq, sizeof(freq)); + iicbus_init_frequency(dev, freq); + + iicbus_reset(dev, IIC_FASTEST, 0, NULL); + + bus_generic_probe(dev); + bus_enumerate_hinted_children(dev); + + /* + * Check if we're running on a PowerMac, needed for the I2C + * address below. + */ + root = OF_peer(0); + compatlen = OF_getprop(root, "compatible", compat, + sizeof(compat)); + if (compatlen != -1) { + for (curstr = compat; curstr < compat + compatlen; + curstr += strlen(curstr) + 1) { + if (strncmp(curstr, "MacRISC", 7) == 0) + iic_addr_8bit = 1; + } + } + + /* + * Attach those children represented in the device tree. + */ + for (child = OF_child(node); child != 0; child = OF_peer(child)) { + /* + * Try to get the I2C address first from the i2c-address + * property, then try the reg property. It moves around + * on different systems. + */ + if (OF_getencprop(child, "i2c-address", &paddr, + sizeof(paddr)) == -1) + if (OF_getencprop(child, "reg", &paddr, + sizeof(paddr)) == -1) + continue; + + /* + * Now set up the I2C and OFW bus layer devinfo and add it + * to the bus. + */ + dinfo = malloc(sizeof(struct ofw_iicbus_devinfo), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (dinfo == NULL) + continue; + /* + * FreeBSD drivers expect I2C addresses to be expressed as + * 8-bit values. Apple OFW data contains 8-bit values, but + * Linux FDT data contains 7-bit values, so shift them up to + * 8-bit format. + */ + if (iic_addr_8bit) + dinfo->opd_dinfo.addr = paddr; + else + dinfo->opd_dinfo.addr = paddr << 1; + + if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) != + 0) { + free(dinfo, M_DEVBUF); + continue; + } + + childdev = device_add_child(dev, NULL, -1); + resource_list_init(&dinfo->opd_dinfo.rl); + ofw_bus_intr_to_rl(childdev, child, + &dinfo->opd_dinfo.rl, NULL); + device_set_ivars(childdev, dinfo); + } + + /* Register bus */ + OF_device_register_xref(OF_xref_from_node(node), dev); + return (bus_generic_attach(dev)); +} + +static device_t +ofw_iicbus_add_child(device_t dev, u_int order, const char *name, int unit) +{ + device_t child; + struct ofw_iicbus_devinfo *devi; + + child = device_add_child_ordered(dev, order, name, unit); + if (child == NULL) + return (child); + devi = malloc(sizeof(struct ofw_iicbus_devinfo), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (devi == NULL) { + device_delete_child(dev, child); + return (0); + } + + /* + * NULL all the OFW-related parts of the ivars for non-OFW + * children. + */ + devi->opd_obdinfo.obd_node = -1; + devi->opd_obdinfo.obd_name = NULL; + devi->opd_obdinfo.obd_compat = NULL; + devi->opd_obdinfo.obd_type = NULL; + devi->opd_obdinfo.obd_model = NULL; + + device_set_ivars(child, devi); + + return (child); +} + +static const struct ofw_bus_devinfo * +ofw_iicbus_get_devinfo(device_t bus, device_t dev) +{ + struct ofw_iicbus_devinfo *dinfo; + + dinfo = device_get_ivars(dev); + return (&dinfo->opd_obdinfo); +} From owner-svn-src-head@freebsd.org Tue May 24 01:42:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9384B48E5C; Tue, 24 May 2016 01:42:22 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E7551DA4; Tue, 24 May 2016 01:42:22 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O1gLvi072955; Tue, 24 May 2016 01:42:21 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O1gLiH072954; Tue, 24 May 2016 01:42:21 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201605240142.u4O1gLiH072954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 24 May 2016 01:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300551 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 01:42:23 -0000 Author: sbruno Date: Tue May 24 01:42:21 2016 New Revision: 300551 URL: https://svnweb.freebsd.org/changeset/base/300551 Log: Update some of the TBD entries in ciss(4) to match what's in the pci IDS data. Submitted by: Dmitry Luhtionov MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Tue May 24 01:33:49 2016 (r300550) +++ head/sys/dev/ciss/ciss.c Tue May 24 01:42:21 2016 (r300551) @@ -345,21 +345,22 @@ static struct { 0x103C, 0x1928, CISS_BOARD_SA5, "HP Smart Array P230i" }, { 0x103C, 0x1929, CISS_BOARD_SA5, "HP Smart Array P530" }, { 0x103C, 0x192A, CISS_BOARD_SA5, "HP Smart Array P531" }, - { 0x103C, 0x21BD, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21BE, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21BF, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21C0, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21C2, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21C3, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21C5, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21C6, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21C7, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21C8, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21CA, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21CB, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21BD, CISS_BOARD_SA5, "HP Smart Array P244br" }, + { 0x103C, 0x21BE, CISS_BOARD_SA5, "HP Smart Array P741m" }, + { 0x103C, 0x21BF, CISS_BOARD_SA5, "HP Smart Array H240ar" }, + { 0x103C, 0x21C0, CISS_BOARD_SA5, "HP Smart Array P440ar" }, + { 0x103C, 0x21C1, CISS_BOARD_SA5, "HP Smart Array P840ar" }, + { 0x103C, 0x21C2, CISS_BOARD_SA5, "HP Smart Array P440" }, + { 0x103C, 0x21C3, CISS_BOARD_SA5, "HP Smart Array P441" }, + { 0x103C, 0x21C5, CISS_BOARD_SA5, "HP Smart Array P841" }, + { 0x103C, 0x21C6, CISS_BOARD_SA5, "HP Smart Array H244br" }, + { 0x103C, 0x21C7, CISS_BOARD_SA5, "HP Smart Array H240" }, + { 0x103C, 0x21C8, CISS_BOARD_SA5, "HP Smart Array H241" }, + { 0x103C, 0x21CA, CISS_BOARD_SA5, "HP Smart Array P246br" }, + { 0x103C, 0x21CB, CISS_BOARD_SA5, "HP Smart Array P840" }, { 0x103C, 0x21CC, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21CD, CISS_BOARD_SA5, "HP Smart Array TBD" }, - { 0x103C, 0x21CE, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21CD, CISS_BOARD_SA5, "HP Smart Array P240nr" }, + { 0x103C, 0x21CE, CISS_BOARD_SA5, "HP Smart Array H240nr" }, { 0, 0, 0, NULL } }; From owner-svn-src-head@freebsd.org Tue May 24 02:27:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDE32B47A93; Tue, 24 May 2016 02:27:27 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AFCA71767; Tue, 24 May 2016 02:27:27 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4O2RIOc099919; Mon, 23 May 2016 19:27:23 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605240227.u4O2RIOc099919@gw.catspoiler.org> Date: Mon, 23 May 2016 19:27:18 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r300547 - in head: lib/libcam sbin/camcontrol sbin/iscontrol sys/cam usr.sbin/camdd usr.sbin/mptutil To: src-committers@freebsd.org cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605240057.u4O0vBfL057675@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 02:27:28 -0000 On 24 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Tue May 24 00:57:11 2016 > New Revision: 300547 > URL: https://svnweb.freebsd.org/changeset/base/300547 > > Log: > Fix multiple Coverity Out-of-bounds access false postive issues in CAM > > The currently used idiom for clearing the part of a ccb after its > header generates one or two Coverity errors for each time it is > used. All instances generate an Out-of-bounds access (ARRAY_VS_SINGLETON) > error because of the treatment of the header as a two element array, > with a pointer to the non-existent second element being passed as > the starting address to bzero(). Some instances also alsp generate > Out-of-bounds access (OVERRUN) errors, probably because the space > being cleared is larger than the sizeofstruct ccb_hdr). > > In addition, this idiom is difficult for humans to understand and > it is error prone. The user has to chose the proper struct ccb_* > type (which does not appear in the surrounding code) for the sizeof() > in the length calculation. I found several instances where the > length was incorrect, which could cause either an actual out of > bounds write, or incompletely clear the ccb. > > A better way is to write the code to clear the ccb itself starting > at sizeof(ccb_hdr) bytes from the start of the ccb, and calculate > the length based on the specific type of struct ccb_* being cleared > as specified by the union ccb member being used. The latter can > normally be seen in the nearby code. This is friendlier for Coverity > and other static analysis tools because they will see that the > intent is to clear the trailing part of the ccb. > > Wrap all of the boilerplate code in a convenient macro that only > requires a pointer to the desired union ccb member (or a pointer > to the union ccb itself) as an argument. [snip] > Reviewed by: scottl, ken, delphij, imp > MFH: 1 month > Differential Revision: https://reviews.freebsd.org/D6496 grr ... that should be: MFC after: 1 month This mistake is too easy to make ... From owner-svn-src-head@freebsd.org Tue May 24 03:13:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B457B48721; Tue, 24 May 2016 03:13:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52F03167D; Tue, 24 May 2016 03:13:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O3DRQH001599; Tue, 24 May 2016 03:13:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O3DRMl001597; Tue, 24 May 2016 03:13:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605240313.u4O3DRMl001597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 May 2016 03:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300556 - in head: sys/kern tests/sys/aio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 03:13:28 -0000 Author: jhb Date: Tue May 24 03:13:27 2016 New Revision: 300556 URL: https://svnweb.freebsd.org/changeset/base/300556 Log: Don't prematurely return short completions on blocking sockets. Always requeue an AIO job at the head of the socket buffer's queue if sosend() or soreceive() returns EWOULDBLOCK on a blocking socket. Previously, requests were only requeued if they returned EWOULDBLOCK and completed no data. Now after a partial completion on a blocking socket the request is queued and the remaining request is retried when the socket is ready. This allows writes larger than the currently available space on a blocking socket to fully complete. Reads on a blocking socket that satifsy the low watermark can still return a short read (same as read()). In order to track previously completed data, the internal 'status' field of the AIO job is used to store the amount of previously computed data. Non-blocking sockets continue to return short completions for both reads and writes. Add a test for a "large" AIO write on a blocking socket that writes twice the socket buffer size to a UNIX domain socket. Sponsored by: Chelsio Communications Modified: head/sys/kern/sys_socket.c head/tests/sys/aio/aio_test.c Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Tue May 24 03:08:32 2016 (r300555) +++ head/sys/kern/sys_socket.c Tue May 24 03:13:27 2016 (r300556) @@ -556,7 +556,7 @@ soaio_process_job(struct socket *so, str struct file *fp; struct uio uio; struct iovec iov; - size_t cnt; + size_t cnt, done; int error, flags; SOCKBUF_UNLOCK(sb); @@ -567,8 +567,9 @@ retry: td_savedcred = td->td_ucred; td->td_ucred = job->cred; - cnt = job->uaiocb.aio_nbytes; - iov.iov_base = (void *)(uintptr_t)job->uaiocb.aio_buf; + done = job->uaiocb._aiocb_private.status; + cnt = job->uaiocb.aio_nbytes - done; + iov.iov_base = (void *)((uintptr_t)job->uaiocb.aio_buf + done); iov.iov_len = cnt; uio.uio_iov = &iov; uio.uio_iovcnt = 1; @@ -602,42 +603,52 @@ retry: } } - cnt -= uio.uio_resid; + done += cnt - uio.uio_resid; + job->uaiocb._aiocb_private.status = done; td->td_ucred = td_savedcred; - if (cnt != 0 && (error == ERESTART || error == EINTR || - error == EWOULDBLOCK)) - error = 0; if (error == EWOULDBLOCK) { /* - * A read() or write() on the socket raced with this - * request. If the socket is now ready, try again. - * If it is not, place this request at the head of the + * The request was either partially completed or not + * completed at all due to racing with a read() or + * write() on the socket. If the socket is + * non-blocking, return with any partial completion. + * If the socket is blocking or if no progress has + * been made, requeue this request at the head of the * queue to try again when the socket is ready. */ - SOCKBUF_LOCK(sb); - empty_results++; - if (soaio_ready(so, sb)) { - empty_retries++; - SOCKBUF_UNLOCK(sb); - goto retry; - } - - if (!aio_set_cancel_function(job, soo_aio_cancel)) { - MPASS(cnt == 0); - SOCKBUF_UNLOCK(sb); - aio_cancel(job); - SOCKBUF_LOCK(sb); - } else { - TAILQ_INSERT_HEAD(&sb->sb_aiojobq, job, list); - } - } else { - if (error) - aio_complete(job, -1, error); - else - aio_complete(job, cnt, 0); + MPASS(done != job->uaiocb.aio_nbytes); SOCKBUF_LOCK(sb); - } + if (done == 0 || !(so->so_state & SS_NBIO)) { + empty_results++; + if (soaio_ready(so, sb)) { + empty_retries++; + SOCKBUF_UNLOCK(sb); + goto retry; + } + + if (!aio_set_cancel_function(job, soo_aio_cancel)) { + SOCKBUF_UNLOCK(sb); + if (done != 0) + aio_complete(job, done, 0); + else + aio_cancel(job); + SOCKBUF_LOCK(sb); + } else { + TAILQ_INSERT_HEAD(&sb->sb_aiojobq, job, list); + } + return; + } + SOCKBUF_UNLOCK(sb); + } + if (done != 0 && (error == ERESTART || error == EINTR || + error == EWOULDBLOCK)) + error = 0; + if (error) + aio_complete(job, -1, error); + else + aio_complete(job, done, 0); + SOCKBUF_LOCK(sb); } static void @@ -758,6 +769,7 @@ soo_aio_queue(struct file *fp, struct ka if (!aio_set_cancel_function(job, soo_aio_cancel)) panic("new job was cancelled"); TAILQ_INSERT_TAIL(&sb->sb_aiojobq, job, list); + job->uaiocb._aiocb_private.status = 0; if (!(sb->sb_flags & SB_AIO_RUNNING)) { if (soaio_ready(so, sb)) sowakeup_aio(so, sb); Modified: head/tests/sys/aio/aio_test.c ============================================================================== --- head/tests/sys/aio/aio_test.c Tue May 24 03:08:32 2016 (r300555) +++ head/tests/sys/aio/aio_test.c Tue May 24 03:13:27 2016 (r300556) @@ -781,6 +781,70 @@ ATF_TC_BODY(aio_socket_two_reads, tc) close(s[0]); } +/* + * This test ensures that aio_write() on a blocking socket of a "large" + * buffer does not return a short completion. + */ +ATF_TC_WITHOUT_HEAD(aio_socket_blocking_short_write); +ATF_TC_BODY(aio_socket_blocking_short_write, tc) +{ + struct aiocb iocb, *iocbp; + char *buffer[2]; + ssize_t done; + int buffer_size, sb_size; + socklen_t len; + int s[2]; + + ATF_REQUIRE_KERNEL_MODULE("aio"); + + ATF_REQUIRE(socketpair(PF_UNIX, SOCK_STREAM, 0, s) != -1); + + len = sizeof(sb_size); + ATF_REQUIRE(getsockopt(s[0], SOL_SOCKET, SO_RCVBUF, &sb_size, &len) != + -1); + ATF_REQUIRE(len == sizeof(sb_size)); + buffer_size = sb_size; + + ATF_REQUIRE(getsockopt(s[1], SOL_SOCKET, SO_SNDBUF, &sb_size, &len) != + -1); + ATF_REQUIRE(len == sizeof(sb_size)); + if (sb_size > buffer_size) + buffer_size = sb_size; + + /* + * Use twice the size of the MAX(receive buffer, send buffer) + * to ensure that the write is split up into multiple writes + * internally. + */ + buffer_size *= 2; + + buffer[0] = malloc(buffer_size); + ATF_REQUIRE(buffer[0] != NULL); + buffer[1] = malloc(buffer_size); + ATF_REQUIRE(buffer[1] != NULL); + + srandomdev(); + aio_fill_buffer(buffer[1], buffer_size, random()); + + memset(&iocb, 0, sizeof(iocb)); + iocb.aio_fildes = s[1]; + iocb.aio_buf = buffer[1]; + iocb.aio_nbytes = buffer_size; + ATF_REQUIRE(aio_write(&iocb) == 0); + + done = recv(s[0], buffer[0], buffer_size, MSG_WAITALL); + ATF_REQUIRE(done == buffer_size); + + done = aio_waitcomplete(&iocbp, NULL); + ATF_REQUIRE(iocbp == &iocb); + ATF_REQUIRE(done == buffer_size); + + ATF_REQUIRE(memcmp(buffer[0], buffer[1], buffer_size) == 0); + + close(s[1]); + close(s[0]); +} + ATF_TP_ADD_TCS(tp) { @@ -792,6 +856,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, aio_md_test); ATF_TP_ADD_TC(tp, aio_large_read_test); ATF_TP_ADD_TC(tp, aio_socket_two_reads); + ATF_TP_ADD_TC(tp, aio_socket_blocking_short_write); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Tue May 24 03:15:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD10CB487B2; Tue, 24 May 2016 03:15:47 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A1E3185D; Tue, 24 May 2016 03:15:47 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O3Fk05001720; Tue, 24 May 2016 03:15:46 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O3FkMt001717; Tue, 24 May 2016 03:15:46 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201605240315.u4O3FkMt001717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Tue, 24 May 2016 03:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300557 - head/usr.sbin/apmd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 03:15:47 -0000 Author: peter Date: Tue May 24 03:15:46 2016 New Revision: 300557 URL: https://svnweb.freebsd.org/changeset/base/300557 Log: It seems is a new prerequisite for after r300539. Attempt to fix the build for i386. Modified: head/usr.sbin/apmd/apmd.c head/usr.sbin/apmd/apmdlex.l head/usr.sbin/apmd/apmdparse.y Modified: head/usr.sbin/apmd/apmd.c ============================================================================== --- head/usr.sbin/apmd/apmd.c Tue May 24 03:13:27 2016 (r300556) +++ head/usr.sbin/apmd/apmd.c Tue May 24 03:15:46 2016 (r300557) @@ -32,6 +32,7 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include #include #include #include @@ -45,7 +46,6 @@ static const char rcsid[] = #include #include #include -#include #include #include #include Modified: head/usr.sbin/apmd/apmdlex.l ============================================================================== --- head/usr.sbin/apmd/apmdlex.l Tue May 24 03:13:27 2016 (r300556) +++ head/usr.sbin/apmd/apmdlex.l Tue May 24 03:15:46 2016 (r300557) @@ -30,6 +30,7 @@ * $FreeBSD$ */ +#include #include #include #include Modified: head/usr.sbin/apmd/apmdparse.y ============================================================================== --- head/usr.sbin/apmd/apmdparse.y Tue May 24 03:13:27 2016 (r300556) +++ head/usr.sbin/apmd/apmdparse.y Tue May 24 03:15:46 2016 (r300557) @@ -30,6 +30,7 @@ * $FreeBSD$ */ +#include #include #include #include From owner-svn-src-head@freebsd.org Tue May 24 03:21:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA5D2B4897D; Tue, 24 May 2016 03:21:47 +0000 (UTC) (envelope-from jhb@freebsd.org) 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 8A50D1C2E; Tue, 24 May 2016 03:21:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6985EB94C; Mon, 23 May 2016 23:21:46 -0400 (EDT) From: John Baldwin To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300548 - in head/sys: conf dev/bhnd dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/nvram dev/bhnd/siba modules/bhnd modules/bhnd/cores/bhnd_chipc Date: Mon, 23 May 2016 20:18:26 -0700 Message-ID: <2018441.udrSCt4JcK@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605240112.u4O1CJOt063645@repo.freebsd.org> References: <201605240112.u4O1CJOt063645@repo.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, 23 May 2016 23:21:46 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 03:21:47 -0000 On Tuesday, May 24, 2016 01:12:19 AM Adrian Chadd wrote: > Author: adrian > Date: Tue May 24 01:12:19 2016 > New Revision: 300548 > URL: https://svnweb.freebsd.org/changeset/base/300548 > > Log: > [bhnd] Implement pass-through resource management for ChipCommon. > > This patchset adds support to bhnd_chipc for sharing SYS_RES_MEMORY > resources with its children, allowing us to hang devices off of > bhnd_chipc that rely on access to a subset of the device register space > that bhnd_chipc itself must also allocate. > > We could avoid most of this heavy lifting if RF_SHAREABLE+SYS_RES_MEMORY > wasn't limited to use with allocations at the same size/offset. > > As a work-around, I implemented something similar to vga_pci.c, which > implements similar reference counting of of PCI BAR resources for its > children. > > With these changes, chipc will use reference counting of SYS_RES_MEMORY > allocation/activation requests, to decide when to allocate/activate/ > deactivate/release resources from the parent bhnd(4) bus. > > The requesting child device is allocated a new resource from chipc's > rman, pointing to (possibly a subregion of) the refcounted bhnd resources > allocated by chipc. > > Other resource types are just passed directly to the parent bhnd bus; > RF_SHAREABLE works just fine with IRQs. > > I also lifted the SPROM device code out into a common driver, since this > now allows me to hang simple subclasses off of a common driver off of both > bhndb_pci and bhnd_chipc. Hmm, what the PCI-PCI bridge driver does with NEW_PCIB is to allocate a single resource from its parent bus for each I/O window it decodes. It then creates a rman that is populated with the addresses in that resource and suballocates from that rman. This allows child devices to allocate non-overlapping resources exclusively (they could also do shareable mappings for subsets if applicable). Right now NEW_PCIB assumes it can pass one of these "child" resources up to the nexus to have it "mapped" via bus_activate_resource(). However, the recently added bus_map_resource() provides a cleaner way to do this where a bridge device can request a mapping for the sub-range of the resource on its "upstream" side that corresponds to the range used by a resource for a child device. -- John Baldwin From owner-svn-src-head@freebsd.org Tue May 24 03:24:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2A82B489E0; Tue, 24 May 2016 03:24:42 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x233.google.com (mail-oi0-x233.google.com [IPv6:2607:f8b0:4003:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88D591F21; Tue, 24 May 2016 03:24:42 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x233.google.com with SMTP id b65so6923427oia.1; Mon, 23 May 2016 20:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=pwhdFgA/ZZOKCKi6dxfwuUjwmMa3J3f6JzkexjQuqcc=; b=dmFe5+gBEGKVAfOuXxQ9obuDVj7M+u0QLdD8/vXVqvS+5owcUs7n7JeKqxxq2dkzJG J6j/dRdOVEFiPVZYSBhqVfHkxf7Dche+zr20WIrHfbxUDcAka8gUhRnUrpk1r7MzZfid jRhYlA5kDigpURzKx2cL4FGHhoc/2Q+Kl6BRS1iDNNAhkk6yB5FB6xNV7RvFJrgD5MGE OHY5ZO2CidxOodAw9jOuTaP+QhNvh4dbZ9nAl33dHLyiSze4tj5AGglFH+bMxp1l6Brr tw8QdMnuBPzfGJraILsUh9d8o+p1sJTBkTcvK1kivtknUyvVhvkMgFfCUqNW4rd/Bngo 0XSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=pwhdFgA/ZZOKCKi6dxfwuUjwmMa3J3f6JzkexjQuqcc=; b=mKwXxALvpOZiTGX/C9zrw1fCjUKBS7Sci+3CUhJWL1rG3FGTxvgTW9uEbriIxt7yyb 0dx0XGnygRo9//30mZqCOshbvuyWv7aQBQ94B5TK9pPyJEbaDWbFK59B0f1UfUBwq/VJ n749U1G/WV+SmVt2vP18p8CJZoKN+Gs9GZsuidoBF/89gzwDyk77AI7Q7smlvaO6xUWm /xjm0zurpeBmilIUQjg1bpdF9k7lRJTly7pz5Ks0ZQ/LsQadq538wmn0qB5CJ1gZ/1aN L0l23wlawTPNjavDWqOrAIsoMISBblbmHFhXE77cjkq88v8YZhOH9w+YKkVnlwOHuORz jXTA== X-Gm-Message-State: AOPr4FWZugXDjkd0tWaSMU/v9I7/w3oD7vsCgzwsdIK3cvp9gXycu7eCHQcNrcaJkz3pRIqsJFj4rd2PErgzCg== MIME-Version: 1.0 X-Received: by 10.202.94.132 with SMTP id s126mr11623104oib.34.1464060281634; Mon, 23 May 2016 20:24:41 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.4.200 with HTTP; Mon, 23 May 2016 20:24:41 -0700 (PDT) In-Reply-To: <201605240315.u4O3FkMt001717@repo.freebsd.org> References: <201605240315.u4O3FkMt001717@repo.freebsd.org> Date: Mon, 23 May 2016 21:24:41 -0600 X-Google-Sender-Auth: 0HUOxK01NL7vz3sIZ5ITlyx7ZKM Message-ID: Subject: Re: svn commit: r300557 - head/usr.sbin/apmd From: Alan Somers To: Peter Wemm Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 03:24:42 -0000 On Mon, May 23, 2016 at 9:15 PM, Peter Wemm wrote: > Author: peter > Date: Tue May 24 03:15:46 2016 > New Revision: 300557 > URL: https://svnweb.freebsd.org/changeset/base/300557 > > Log: > It seems is a new prerequisite for after > r300539. Attempt to fix the build for i386. > > Modified: > head/usr.sbin/apmd/apmd.c > head/usr.sbin/apmd/apmdlex.l > head/usr.sbin/apmd/apmdparse.y > > Are you sure this is necessary, even after 300544? From owner-svn-src-head@freebsd.org Tue May 24 04:09:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D905B47080; Tue, 24 May 2016 04:09:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id EC56B129C; Tue, 24 May 2016 04:09:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id E4EA2135E; Tue, 24 May 2016 04:09:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 983D92036D; Tue, 24 May 2016 04:09:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id ecElPX2MXQAf; Tue, 24 May 2016 04:09:52 +0000 (UTC) Subject: Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com EEAB820364 To: cem@FreeBSD.org, Alan Somers References: <201605042234.u44MYBMX054443@repo.freebsd.org> <2368543.Vvp613SNcD@ralph.baldwin.cx> <684f4a82-f48c-b2bb-6a72-5c1dfea11a39@pix.net> <8074ef26-cb70-2397-b71e-b897a1270d22@FreeBSD.org> Cc: Kurt Lidl , John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Mon, 23 May 2016 21:09:49 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 04:09:56 -0000 On 5/23/16 4:42 PM, Conrad Meyer wrote: > On Mon, May 23, 2016 at 4:34 PM, Alan Somers wrote: >> On Mon, May 23, 2016 at 5:13 PM, Bryan Drewery wrote: >>> >>> On 5/23/16 1:30 PM, Alan Somers wrote: >>>> UPDATING is updated as of r300539. Any objection to merging this to >>>> stable/10? >>> >>> If any port uses it then yes. Binaries are built from 10.1 and expected >>> to work on 10.1, 10.2, 10.3, 10.4, etc. >> >> >> Most ports that use bitstring should work. The only ports that won't are >> ports that either store bitstrings on disk or transmit them across a network >> without an explicit serialization step. A few other weird cases would break >> too, like building a port on 10.3, updating sys/bitstring.h, then rebuilding >> some object files but not others. Is there any way to figure out what ports >> might be using this header? OpenHub code search didn't turn up anything. > > It seems to me like this is exactly the sort of ABI breakage the > stable/* branches promise not to make. I just noticed that this is not a library. It's only macros. So I take back what I said. -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Tue May 24 04:55:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1610B47CB9; Tue, 24 May 2016 04:55:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E6491CFC; Tue, 24 May 2016 04:55:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O4t0BS032129; Tue, 24 May 2016 04:55:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O4t0q5032128; Tue, 24 May 2016 04:55:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605240455.u4O4t0q5032128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 24 May 2016 04:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300562 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 04:55:02 -0000 Author: adrian Date: Tue May 24 04:55:00 2016 New Revision: 300562 URL: https://svnweb.freebsd.org/changeset/base/300562 Log: [bwn] add BCM43225 to the BHND device list. This is all for the bhnd(4) work in progress. It's enough to probe/attach all the bhnd internals, but we're missing OTP support and some cleanup code. And, well, all the rest of the bhnd(4) migration. So no, this won't give you BCM43225 support. Sorry! Modified: head/sys/dev/bwn/if_bwn_pci.c Modified: head/sys/dev/bwn/if_bwn_pci.c ============================================================================== --- head/sys/dev/bwn/if_bwn_pci.c Tue May 24 04:49:58 2016 (r300561) +++ head/sys/dev/bwn/if_bwn_pci.c Tue May 24 04:55:00 2016 (r300562) @@ -104,6 +104,7 @@ static const struct bwn_pci_device bcma_ BWN_BCM_DEV(BCM4331_D11N, "BCM4331 802.11n Dual-Band", 0), BWN_BCM_DEV(BCM4331_D11N2G, "BCM4331 802.11n 2GHz", 0), BWN_BCM_DEV(BCM4331_D11N5G, "BCM4331 802.11n 5GHz", 0), + BWN_BCM_DEV(BCM43225_D11N2G, "BCM43225 802.11n 2GHz", 0), { 0, 0, NULL, 0} }; From owner-svn-src-head@freebsd.org Tue May 24 04:59:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D64DB47D48; Tue, 24 May 2016 04:59:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4661A1EB8; Tue, 24 May 2016 04:59:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O4wwHe032267; Tue, 24 May 2016 04:58:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O4wweK032266; Tue, 24 May 2016 04:58:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605240458.u4O4wweK032266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 24 May 2016 04:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300563 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 04:59:03 -0000 Author: adrian Date: Tue May 24 04:58:58 2016 New Revision: 300563 URL: https://svnweb.freebsd.org/changeset/base/300563 Log: [bwn] begin separating out the attach path from the SIBA specific bits. * convert phy_getinfo() to take a "gmode" flag, rather than the siba TGSHIGH flags and then check for 2GHz. This should ensure that gmode is set correctly even on DUALPHY NICs. * move the siba_powerup() call and the TGSHIGH decoding into a call to bwn_is_bus_siba(), and return an error if it's called on anything else. We don't yet do anything else, but when we do.. Tested: * BCM4322, 11a STA Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue May 24 04:55:00 2016 (r300562) +++ head/sys/dev/bwn/if_bwn.c Tue May 24 04:58:58 2016 (r300563) @@ -1148,46 +1148,41 @@ bwn_attach_core(struct bwn_mac *mac) { struct bwn_softc *sc = mac->mac_sc; int error, have_bg = 0, have_a = 0; - uint32_t high; KASSERT(siba_get_revid(sc->sc_dev) >= 5, ("unsupported revision %d", siba_get_revid(sc->sc_dev))); - siba_powerup(sc->sc_dev, 0); + if (bwn_is_bus_siba(mac)) { + uint32_t high; - high = siba_read_4(sc->sc_dev, SIBA_TGSHIGH); + siba_powerup(sc->sc_dev, 0); + high = siba_read_4(sc->sc_dev, SIBA_TGSHIGH); + have_a = (high & BWN_TGSHIGH_HAVE_5GHZ) ? 1 : 0; + have_bg = (high & BWN_TGSHIGH_HAVE_2GHZ) ? 1 : 0; + if (high & BWN_TGSHIGH_DUALPHY) { + have_bg = 1; + have_a = 1; + } + } else { + device_printf(sc->sc_dev, "%s: not siba; bailing\n", __func__); + error = ENXIO; + goto fail; + } /* * Guess at whether it has A-PHY or G-PHY. * This is just used for resetting the core to probe things; * we will re-guess once it's all up and working. - * - * XXX TODO: there's the TGSHIGH DUALPHY flag based on - * the PHY revision. */ - bwn_reset_core(mac, !!(high & BWN_TGSHIGH_HAVE_2GHZ)); + bwn_reset_core(mac, have_bg); /* * Get the PHY version. */ - error = bwn_phy_getinfo(mac, high); + error = bwn_phy_getinfo(mac, have_bg); if (error) goto fail; - /* XXX TODO need bhnd */ - if (bwn_is_bus_siba(mac)) { - have_a = (high & BWN_TGSHIGH_HAVE_5GHZ) ? 1 : 0; - have_bg = (high & BWN_TGSHIGH_HAVE_2GHZ) ? 1 : 0; - if (high & BWN_TGSHIGH_DUALPHY) { - have_bg = 1; - have_a = 1; - } - } else { - device_printf(sc->sc_dev, "%s: not siba; bailing\n", __func__); - error = ENXIO; - goto fail; - } - #if 0 device_printf(sc->sc_dev, "%s: high=0x%08x, have_a=%d, have_bg=%d," " deviceid=0x%04x, siba_deviceid=0x%04x\n", @@ -1379,7 +1374,7 @@ bwn_reset_core(struct bwn_mac *mac, int } static int -bwn_phy_getinfo(struct bwn_mac *mac, int tgshigh) +bwn_phy_getinfo(struct bwn_mac *mac, int gmode) { struct bwn_phy *phy = &mac->mac_phy; struct bwn_softc *sc = mac->mac_sc; @@ -1387,7 +1382,7 @@ bwn_phy_getinfo(struct bwn_mac *mac, int /* PHY */ tmp = BWN_READ_2(mac, BWN_PHYVER); - phy->gmode = !! (tgshigh & BWN_TGSHIGH_HAVE_2GHZ); + phy->gmode = gmode; phy->rf_on = 1; phy->analog = (tmp & BWN_PHYVER_ANALOG) >> 12; phy->type = (tmp & BWN_PHYVER_TYPE) >> 8; From owner-svn-src-head@freebsd.org Tue May 24 05:02:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E655CB47EF1; Tue, 24 May 2016 05:02:25 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B539212AB; Tue, 24 May 2016 05:02:25 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O52Owi035034; Tue, 24 May 2016 05:02:24 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O52OPO035033; Tue, 24 May 2016 05:02:24 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605240502.u4O52OPO035033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Tue, 24 May 2016 05:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300564 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 05:02:26 -0000 Author: truckman Date: Tue May 24 05:02:24 2016 New Revision: 300564 URL: https://svnweb.freebsd.org/changeset/base/300564 Log: Fix CID 1006692 in /usr/sbin/pw pw_log() function and other fixes The length of the name returned from the $LOGNAME and $USER can be very long and it was being concatenated to a fixed length buffer with no bounds checking. Fix this problem by limiting the length of the name copied. Additionally, this name is actually used to create a format string to be used in adding log file entries so embedded % characters in the name could confuse *printf(), and embedded whitespace could confuse a log file parser. Handle the former by escaping each % with an additional %, and handle the latter by simply stripping it out. Clean up the code by moving the variable declarations to the top of the function, formatting them to conform with style, and moving intialization elsewhere. Reduce code indentation by returning early in a couple of places. Reported by: Coverity CID: 1006692 Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6490 Modified: head/usr.sbin/pw/pw_log.c Modified: head/usr.sbin/pw/pw_log.c ============================================================================== --- head/usr.sbin/pw/pw_log.c Tue May 24 04:58:58 2016 (r300563) +++ head/usr.sbin/pw/pw_log.c Tue May 24 05:02:24 2016 (r300564) @@ -29,40 +29,90 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include +#include #include #include #include #include "pw.h" -static FILE *logfile = NULL; +static FILE *logfile = NULL; void pw_log(struct userconf * cnf, int mode, int which, char const * fmt,...) { - if (cnf->logfile && *cnf->logfile) { - if (logfile == NULL) { /* With umask==0 we need to control file access modes on create */ - int fd = open(cnf->logfile, O_WRONLY | O_CREAT | O_APPEND, 0600); + va_list argp; + time_t now; + const char *cp, *name; + struct tm *t; + int fd, i, rlen; + char nfmt[256], sname[32]; - if (fd != -1) - logfile = fdopen(fd, "a"); + if (cnf->logfile == NULL || cnf->logfile[0] == '\0') { + return; + } + + if (logfile == NULL) { + /* With umask==0 we need to control file access modes on create */ + fd = open(cnf->logfile, O_WRONLY | O_CREAT | O_APPEND, 0600); + if (fd == -1) { + return; } - if (logfile != NULL) { - va_list argp; - time_t now = time(NULL); - struct tm *t = localtime(&now); - char nfmt[256]; - const char *name; - - if ((name = getenv("LOGNAME")) == NULL && (name = getenv("USER")) == NULL) - name = "unknown"; - /* ISO 8601 International Standard Date format */ - strftime(nfmt, sizeof nfmt, "%Y-%m-%d %T ", t); - sprintf(nfmt + strlen(nfmt), "[%s:%s%s] %s\n", name, Which[which], Modes[mode], fmt); - va_start(argp, fmt); - vfprintf(logfile, nfmt, argp); - va_end(argp); - fflush(logfile); + logfile = fdopen(fd, "a"); + if (logfile == NULL) { + return; } } + + if ((name = getenv("LOGNAME")) == NULL && + (name = getenv("USER")) == NULL) { + strcpy(sname, "unknown"); + } else { + /* + * Since "name" will be embedded in a printf-like format, + * we must sanitize it: + * + * Limit its length so other information in the message + * is not truncated + * + * Squeeze out embedded whitespace for the benefit of + * log file parsers + * + * Escape embedded % characters with another % + */ + for (i = 0, cp = name; + *cp != '\0' && i < (int)sizeof(sname) - 1; cp++) { + if (*cp == '%') { + if (i < (int)sizeof(sname) - 2) { + sname[i++] = '%'; + sname[i++] = '%'; + } else { + break; + } + } else if (!isspace(*cp)) { + sname[i++] = *cp; + } /* else do nothing */ + } + if (i == 0) { + strcpy(sname, "unknown"); + } else { + sname[i] = '\0'; + } + } + now = time(NULL); + t = localtime(&now); + /* ISO 8601 International Standard Date format */ + strftime(nfmt, sizeof nfmt, "%Y-%m-%d %T ", t); + rlen = sizeof(nfmt) - strlen(nfmt); + if (rlen <= 0 || snprintf(nfmt + strlen(nfmt), rlen, + "[%s:%s%s] %s\n", sname, Which[which], Modes[mode], + fmt) >= rlen) { + warnx("log format overflow, user name=%s", sname); + } else { + va_start(argp, fmt); + vfprintf(logfile, nfmt, argp); + va_end(argp); + fflush(logfile); + } } From owner-svn-src-head@freebsd.org Tue May 24 05:06:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C67C1B48060; Tue, 24 May 2016 05:06:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 762001794; Tue, 24 May 2016 05:06:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O561J2035180; Tue, 24 May 2016 05:06:01 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O5614t035178; Tue, 24 May 2016 05:06:01 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605240506.u4O5614t035178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 24 May 2016 05:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300565 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 05:06:02 -0000 Author: sephe Date: Tue May 24 05:06:01 2016 New Revision: 300565 URL: https://svnweb.freebsd.org/changeset/base/300565 Log: hyperv/vmbus: Move vmbus interrupt counter into vmbus softc MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6497 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 05:02:24 2016 (r300564) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 05:06:01 2016 (r300565) @@ -186,12 +186,11 @@ hv_vmbus_isr(struct trapframe *frame) return (FILTER_HANDLED); } -u_long *hv_vmbus_intr_cpu[MAXCPU]; - void hv_vector_handler(struct trapframe *trap_frame) { - int cpu; + struct vmbus_softc *sc = vmbus_get_softc(); + int cpu = curcpu; /* * Disable preemption. @@ -201,8 +200,7 @@ hv_vector_handler(struct trapframe *trap /* * Do a little interrupt counting. */ - cpu = PCPU_GET(cpuid); - (*hv_vmbus_intr_cpu[cpu])++; + (*VMBUS_SC_PCPU_GET(sc, intr_cnt, cpu))++; hv_vmbus_isr(trap_frame); @@ -400,7 +398,7 @@ vmbus_bus_init(void) CPU_FOREACH(j) { snprintf(buf, sizeof(buf), "cpu%d:hyperv", j); - intrcnt_add(buf, &hv_vmbus_intr_cpu[j]); + intrcnt_add(buf, VMBUS_SC_PCPU_PTR(sc, intr_cnt, j)); for (i = 0; i < 2; i++) setup_args.page_buffers[2 * j + i] = NULL; Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Tue May 24 05:02:24 2016 (r300564) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Tue May 24 05:06:01 2016 (r300565) @@ -33,6 +33,7 @@ struct vmbus_pcpu_data { int event_flag_cnt; /* # of event flags */ + u_long *intr_cnt; } __aligned(CACHE_LINE_SIZE); struct vmbus_softc { From owner-svn-src-head@freebsd.org Tue May 24 05:18:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AF07B4833B; Tue, 24 May 2016 05:18:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 152A71FF8; Tue, 24 May 2016 05:18:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O5IQWD038481; Tue, 24 May 2016 05:18:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O5IQUT038480; Tue, 24 May 2016 05:18:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605240518.u4O5IQUT038480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 24 May 2016 05:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300567 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 05:18:28 -0000 Author: sephe Date: Tue May 24 05:18:26 2016 New Revision: 300567 URL: https://svnweb.freebsd.org/changeset/base/300567 Log: hyperv/vmbus: Pass vmbus_softc and curcpu to hv_vmbus_isr() MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6498 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 05:11:55 2016 (r300566) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 05:18:26 2016 (r300567) @@ -131,11 +131,9 @@ handled: * message to process - an event or a channel message. */ static inline int -hv_vmbus_isr(struct trapframe *frame) +hv_vmbus_isr(struct vmbus_softc *sc, struct trapframe *frame, int cpu) { - struct vmbus_softc *sc = vmbus_get_softc(); hv_vmbus_message *msg, *msg_base; - int cpu = curcpu; /* * The Windows team has advised that we check for events @@ -202,7 +200,7 @@ hv_vector_handler(struct trapframe *trap */ (*VMBUS_SC_PCPU_GET(sc, intr_cnt, cpu))++; - hv_vmbus_isr(trap_frame); + hv_vmbus_isr(sc, trap_frame, cpu); /* * Enable preemption. From owner-svn-src-head@freebsd.org Tue May 24 05:26:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AED4B4852A; Tue, 24 May 2016 05:26:54 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AA78173E; Tue, 24 May 2016 05:26:54 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O5QrkC041766; Tue, 24 May 2016 05:26:53 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O5Qrnt041765; Tue, 24 May 2016 05:26:53 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605240526.u4O5Qrnt041765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 24 May 2016 05:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300568 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 05:26:54 -0000 Author: sephe Date: Tue May 24 05:26:52 2016 New Revision: 300568 URL: https://svnweb.freebsd.org/changeset/base/300568 Log: hyperv/busdma: Take BUS_DMA_ZERO into account MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6499 Modified: head/sys/dev/hyperv/vmbus/hyperv_busdma.c Modified: head/sys/dev/hyperv/vmbus/hyperv_busdma.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv_busdma.c Tue May 24 05:18:26 2016 (r300567) +++ head/sys/dev/hyperv/vmbus/hyperv_busdma.c Tue May 24 05:26:52 2016 (r300568) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include -#define HYPERV_DMA_WAITMASK (BUS_DMA_WAITOK | BUS_DMA_NOWAIT) +#define HYPERV_DMA_MASK (BUS_DMA_WAITOK | BUS_DMA_NOWAIT | BUS_DMA_ZERO) void hyperv_dma_map_paddr(void *arg, bus_dma_segment_t *segs, int nseg, int error) @@ -73,7 +73,7 @@ hyperv_dmamem_alloc(bus_dma_tag_t parent return NULL; error = bus_dmamem_alloc(dma->hv_dtag, &ret, - (flags & HYPERV_DMA_WAITMASK) | BUS_DMA_COHERENT, &dma->hv_dmap); + (flags & HYPERV_DMA_MASK) | BUS_DMA_COHERENT, &dma->hv_dmap); if (error) { bus_dma_tag_destroy(dma->hv_dtag); return NULL; From owner-svn-src-head@freebsd.org Tue May 24 05:29:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66216B485A7; Tue, 24 May 2016 05:29:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D86818F8; Tue, 24 May 2016 05:29:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O5TgYf041894; Tue, 24 May 2016 05:29:42 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O5Tg2k041893; Tue, 24 May 2016 05:29:42 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605240529.u4O5Tg2k041893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 24 May 2016 05:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300569 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 05:29:43 -0000 Author: dchagin Date: Tue May 24 05:29:41 2016 New Revision: 300569 URL: https://svnweb.freebsd.org/changeset/base/300569 Log: Don't leak fp in case where fo_ioctl() returns an error. Reported by: C Turt MFC after: 1 week Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Tue May 24 05:26:52 2016 (r300568) +++ head/sys/compat/linux/linux_ioctl.c Tue May 24 05:29:41 2016 (r300569) @@ -977,7 +977,7 @@ linux_ioctl_termio(struct thread *td, st error = fo_ioctl(fp, TIOCGETD, (caddr_t)&bsd_line, td->td_ucred, td); if (error) - return (error); + break; switch (bsd_line) { case TTYDISC: linux_line = LINUX_N_TTY; From owner-svn-src-head@freebsd.org Tue May 24 05:43:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67C7FB4896A; Tue, 24 May 2016 05:43:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 143581299; Tue, 24 May 2016 05:43:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O5ht4Q047510; Tue, 24 May 2016 05:43:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O5ht5F047509; Tue, 24 May 2016 05:43:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605240543.u4O5ht5F047509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 24 May 2016 05:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300570 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 05:43:58 -0000 Author: sephe Date: Tue May 24 05:43:55 2016 New Revision: 300570 URL: https://svnweb.freebsd.org/changeset/base/300570 Log: hyperv/vmbus: Rename local variable and break long lines No functional changes. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6500 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 05:29:41 2016 (r300569) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 05:43:55 2016 (r300570) @@ -370,7 +370,7 @@ static int vmbus_bus_init(void) { struct vmbus_softc *sc; - int i, j, n, ret; + int i, n, ret, cpu; char buf[MAXCOMLEN + 1]; cpuset_t cpu_mask; @@ -394,44 +394,49 @@ vmbus_bus_init(void) sc->vmbus_idtvec); } - CPU_FOREACH(j) { - snprintf(buf, sizeof(buf), "cpu%d:hyperv", j); - intrcnt_add(buf, VMBUS_SC_PCPU_PTR(sc, intr_cnt, j)); + CPU_FOREACH(cpu) { + snprintf(buf, sizeof(buf), "cpu%d:hyperv", cpu); + intrcnt_add(buf, VMBUS_SC_PCPU_PTR(sc, intr_cnt, cpu)); for (i = 0; i < 2; i++) - setup_args.page_buffers[2 * j + i] = NULL; + setup_args.page_buffers[2 * cpu + i] = NULL; } /* * Per cpu setup. */ - CPU_FOREACH(j) { + CPU_FOREACH(cpu) { /* * Setup taskqueue to handle events */ - hv_vmbus_g_context.hv_event_queue[j] = taskqueue_create_fast("hyperv event", M_WAITOK, - taskqueue_thread_enqueue, &hv_vmbus_g_context.hv_event_queue[j]); - CPU_SETOF(j, &cpu_mask); - taskqueue_start_threads_cpuset(&hv_vmbus_g_context.hv_event_queue[j], 1, PI_NET, &cpu_mask, - "hvevent%d", j); + hv_vmbus_g_context.hv_event_queue[cpu] = + taskqueue_create_fast("hyperv event", M_WAITOK, + taskqueue_thread_enqueue, + &hv_vmbus_g_context.hv_event_queue[cpu]); + CPU_SETOF(cpu, &cpu_mask); + taskqueue_start_threads_cpuset( + &hv_vmbus_g_context.hv_event_queue[cpu], 1, PI_NET, + &cpu_mask, "hvevent%d", cpu); /* * Setup per-cpu tasks and taskqueues to handle msg. */ - hv_vmbus_g_context.hv_msg_tq[j] = taskqueue_create_fast( + hv_vmbus_g_context.hv_msg_tq[cpu] = taskqueue_create_fast( "hyperv msg", M_WAITOK, taskqueue_thread_enqueue, - &hv_vmbus_g_context.hv_msg_tq[j]); - CPU_SETOF(j, &cpu_mask); - taskqueue_start_threads_cpuset(&hv_vmbus_g_context.hv_msg_tq[j], - 1, PI_NET, &cpu_mask, "hvmsg%d", j); - TASK_INIT(&hv_vmbus_g_context.hv_msg_task[j], 0, + &hv_vmbus_g_context.hv_msg_tq[cpu]); + CPU_SETOF(cpu, &cpu_mask); + taskqueue_start_threads_cpuset( + &hv_vmbus_g_context.hv_msg_tq[cpu], 1, PI_NET, + &cpu_mask, "hvmsg%d", cpu); + TASK_INIT(&hv_vmbus_g_context.hv_msg_task[cpu], 0, vmbus_msg_task, NULL); /* - * Prepare the per cpu msg and event pages to be called on each cpu. + * Prepare the per cpu msg and event pages to be called on + * each cpu. */ for(i = 0; i < 2; i++) { - setup_args.page_buffers[2 * j + i] = + setup_args.page_buffers[2 * cpu + i] = malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK | M_ZERO); } } @@ -475,10 +480,10 @@ vmbus_bus_init(void) /* * remove swi and vmbus callback vector; */ - CPU_FOREACH(j) { - if (hv_vmbus_g_context.hv_event_queue[j] != NULL) { - taskqueue_free(hv_vmbus_g_context.hv_event_queue[j]); - hv_vmbus_g_context.hv_event_queue[j] = NULL; + CPU_FOREACH(cpu) { + if (hv_vmbus_g_context.hv_event_queue[cpu] != NULL) { + taskqueue_free(hv_vmbus_g_context.hv_event_queue[cpu]); + hv_vmbus_g_context.hv_event_queue[cpu] = NULL; } } From owner-svn-src-head@freebsd.org Tue May 24 05:52:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F107B48C33; Tue, 24 May 2016 05:52:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AE781A21; Tue, 24 May 2016 05:52:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O5pqMK049586; Tue, 24 May 2016 05:51:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O5ppPk049558; Tue, 24 May 2016 05:51:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605240551.u4O5ppPk049558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 24 May 2016 05:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300571 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 05:52:01 -0000 Author: sephe Date: Tue May 24 05:51:51 2016 New Revision: 300571 URL: https://svnweb.freebsd.org/changeset/base/300571 Log: hyperv/vmbus: Move SynIC setup/teardown from hyperv file to vmbus file Avoid unnecessary exposure. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6501 Modified: head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Tue May 24 05:43:55 2016 (r300570) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Tue May 24 05:51:51 2016 (r300571) @@ -216,132 +216,6 @@ hv_vmbus_signal_event(void *con_id) return (status); } -/** - * @brief hv_vmbus_synic_init - */ -void -hv_vmbus_synic_init(void *arg) -{ - struct vmbus_softc *sc = vmbus_get_softc(); - int cpu; - uint64_t hv_vcpu_index; - hv_vmbus_synic_simp simp; - hv_vmbus_synic_siefp siefp; - hv_vmbus_synic_scontrol sctrl; - hv_vmbus_synic_sint shared_sint; - uint64_t version; - hv_setup_args* setup_args = (hv_setup_args *)arg; - - cpu = PCPU_GET(cpuid); - - /* - * TODO: Check the version - */ - version = rdmsr(HV_X64_MSR_SVERSION); - - hv_vmbus_g_context.syn_ic_msg_page[cpu] = - setup_args->page_buffers[2 * cpu]; - hv_vmbus_g_context.syn_ic_event_page[cpu] = - setup_args->page_buffers[2 * cpu + 1]; - - /* - * Setup the Synic's message page - */ - - simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); - simp.u.simp_enabled = 1; - simp.u.base_simp_gpa = ((hv_get_phys_addr( - hv_vmbus_g_context.syn_ic_msg_page[cpu])) >> PAGE_SHIFT); - - wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t); - - /* - * Setup the Synic's event page - */ - siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP); - siefp.u.siefp_enabled = 1; - siefp.u.base_siefp_gpa = ((hv_get_phys_addr( - hv_vmbus_g_context.syn_ic_event_page[cpu])) >> PAGE_SHIFT); - - wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); - - /*HV_SHARED_SINT_IDT_VECTOR + 0x20; */ - shared_sint.as_uint64_t = 0; - shared_sint.u.vector = sc->vmbus_idtvec; - shared_sint.u.masked = FALSE; - shared_sint.u.auto_eoi = TRUE; - - wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, - shared_sint.as_uint64_t); - - wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT, - shared_sint.as_uint64_t); - - /* Enable the global synic bit */ - sctrl.as_uint64_t = rdmsr(HV_X64_MSR_SCONTROL); - sctrl.u.enable = 1; - - wrmsr(HV_X64_MSR_SCONTROL, sctrl.as_uint64_t); - - hv_vmbus_g_context.syn_ic_initialized = TRUE; - - /* - * Set up the cpuid mapping from Hyper-V to FreeBSD. - * The array is indexed using FreeBSD cpuid. - */ - hv_vcpu_index = rdmsr(HV_X64_MSR_VP_INDEX); - hv_vmbus_g_context.hv_vcpu_index[cpu] = (uint32_t)hv_vcpu_index; - - return; -} - -/** - * @brief Cleanup routine for hv_vmbus_synic_init() - */ -void hv_vmbus_synic_cleanup(void *arg) -{ - hv_vmbus_synic_sint shared_sint; - hv_vmbus_synic_simp simp; - hv_vmbus_synic_siefp siefp; - - if (!hv_vmbus_g_context.syn_ic_initialized) - return; - - shared_sint.as_uint64_t = rdmsr( - HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT); - - shared_sint.u.masked = 1; - - /* - * Disable the interrupt 0 - */ - wrmsr( - HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, - shared_sint.as_uint64_t); - - shared_sint.as_uint64_t = rdmsr( - HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT); - - shared_sint.u.masked = 1; - - /* - * Disable the interrupt 1 - */ - wrmsr( - HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT, - shared_sint.as_uint64_t); - simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); - simp.u.simp_enabled = 0; - simp.u.base_simp_gpa = 0; - - wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t); - - siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP); - siefp.u.siefp_enabled = 0; - siefp.u.base_siefp_gpa = 0; - - wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); -} static bool hyperv_identify(void) Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 05:43:55 2016 (r300570) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 05:51:51 2016 (r300571) @@ -208,6 +208,126 @@ hv_vector_handler(struct trapframe *trap critical_exit(); } +static void +vmbus_synic_setup(void *arg) +{ + struct vmbus_softc *sc = vmbus_get_softc(); + int cpu; + uint64_t hv_vcpu_index; + hv_vmbus_synic_simp simp; + hv_vmbus_synic_siefp siefp; + hv_vmbus_synic_scontrol sctrl; + hv_vmbus_synic_sint shared_sint; + uint64_t version; + hv_setup_args* setup_args = (hv_setup_args *)arg; + + cpu = PCPU_GET(cpuid); + + /* + * TODO: Check the version + */ + version = rdmsr(HV_X64_MSR_SVERSION); + + hv_vmbus_g_context.syn_ic_msg_page[cpu] = + setup_args->page_buffers[2 * cpu]; + hv_vmbus_g_context.syn_ic_event_page[cpu] = + setup_args->page_buffers[2 * cpu + 1]; + + /* + * Setup the Synic's message page + */ + + simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); + simp.u.simp_enabled = 1; + simp.u.base_simp_gpa = ((hv_get_phys_addr( + hv_vmbus_g_context.syn_ic_msg_page[cpu])) >> PAGE_SHIFT); + + wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t); + + /* + * Setup the Synic's event page + */ + siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP); + siefp.u.siefp_enabled = 1; + siefp.u.base_siefp_gpa = ((hv_get_phys_addr( + hv_vmbus_g_context.syn_ic_event_page[cpu])) >> PAGE_SHIFT); + + wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); + + /*HV_SHARED_SINT_IDT_VECTOR + 0x20; */ + shared_sint.as_uint64_t = 0; + shared_sint.u.vector = sc->vmbus_idtvec; + shared_sint.u.masked = FALSE; + shared_sint.u.auto_eoi = TRUE; + + wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, + shared_sint.as_uint64_t); + + wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT, + shared_sint.as_uint64_t); + + /* Enable the global synic bit */ + sctrl.as_uint64_t = rdmsr(HV_X64_MSR_SCONTROL); + sctrl.u.enable = 1; + + wrmsr(HV_X64_MSR_SCONTROL, sctrl.as_uint64_t); + + hv_vmbus_g_context.syn_ic_initialized = TRUE; + + /* + * Set up the cpuid mapping from Hyper-V to FreeBSD. + * The array is indexed using FreeBSD cpuid. + */ + hv_vcpu_index = rdmsr(HV_X64_MSR_VP_INDEX); + hv_vmbus_g_context.hv_vcpu_index[cpu] = (uint32_t)hv_vcpu_index; +} + +static void +vmbus_synic_teardown(void *arg) +{ + hv_vmbus_synic_sint shared_sint; + hv_vmbus_synic_simp simp; + hv_vmbus_synic_siefp siefp; + + if (!hv_vmbus_g_context.syn_ic_initialized) + return; + + shared_sint.as_uint64_t = rdmsr( + HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT); + + shared_sint.u.masked = 1; + + /* + * Disable the interrupt 0 + */ + wrmsr( + HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, + shared_sint.as_uint64_t); + + shared_sint.as_uint64_t = rdmsr( + HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT); + + shared_sint.u.masked = 1; + + /* + * Disable the interrupt 1 + */ + wrmsr( + HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT, + shared_sint.as_uint64_t); + simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); + simp.u.simp_enabled = 0; + simp.u.base_simp_gpa = 0; + + wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t); + + siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP); + siefp.u.siefp_enabled = 0; + siefp.u.base_siefp_gpa = 0; + + wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); +} + static int vmbus_read_ivar( device_t dev, @@ -445,7 +565,7 @@ vmbus_bus_init(void) printf("VMBUS: Calling smp_rendezvous, smp_started = %d\n", smp_started); - smp_rendezvous(NULL, hv_vmbus_synic_init, NULL, &setup_args); + smp_rendezvous(NULL, vmbus_synic_setup, NULL, &setup_args); /* * Connect to VMBus in the root partition @@ -553,7 +673,7 @@ vmbus_detach(device_t dev) hv_vmbus_release_unattached_channels(); hv_vmbus_disconnect(); - smp_rendezvous(NULL, hv_vmbus_synic_cleanup, NULL, NULL); + smp_rendezvous(NULL, vmbus_synic_teardown, NULL, NULL); for(i = 0; i < 2 * MAXCPU; i++) { if (setup_args.page_buffers[i] != NULL) Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue May 24 05:43:55 2016 (r300570) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue May 24 05:51:51 2016 (r300571) @@ -727,8 +727,6 @@ uint16_t hv_vmbus_post_msg_via_msg_ipc( size_t payload_size); uint16_t hv_vmbus_signal_event(void *con_id); -void hv_vmbus_synic_init(void *irq_arg); -void hv_vmbus_synic_cleanup(void *arg); struct hv_device* hv_vmbus_child_device_create( hv_guid device_type, From owner-svn-src-head@freebsd.org Tue May 24 06:01:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AA23B48F5B; Tue, 24 May 2016 06:01:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E0A81EFA; Tue, 24 May 2016 06:01:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O61eMb054552; Tue, 24 May 2016 06:01:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O61emP054548; Tue, 24 May 2016 06:01:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605240601.u4O61emP054548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 24 May 2016 06:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300572 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 06:01:50 -0000 Author: sephe Date: Tue May 24 06:01:39 2016 New Revision: 300572 URL: https://svnweb.freebsd.org/changeset/base/300572 Log: hyperv/vmbus: Use busdma(9) for messages and event flags And - Move message and event flags to vmbus_softc per-cpu data. - Get rid of hv_setup_arg, which serves no purpose now. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6502 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Tue May 24 05:51:51 2016 (r300571) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Tue May 24 06:01:39 2016 (r300572) @@ -333,13 +333,11 @@ vmbus_event_proc(struct vmbus_softc *sc, { hv_vmbus_synic_event_flags *event; - event = hv_vmbus_g_context.syn_ic_event_page[cpu] + - HV_VMBUS_MESSAGE_SINT; - /* * On Host with Win8 or above, the event page can be checked directly * to get the id of the channel that has the pending interrupt. */ + event = VMBUS_SC_PCPU_GET(sc, event_flag, cpu) + HV_VMBUS_MESSAGE_SINT; vmbus_event_flags_proc(event->flagsul, VMBUS_SC_PCPU_GET(sc, event_flag_cnt, cpu)); } @@ -349,9 +347,7 @@ vmbus_event_proc_compat(struct vmbus_sof { hv_vmbus_synic_event_flags *event; - event = hv_vmbus_g_context.syn_ic_event_page[cpu] + - HV_VMBUS_MESSAGE_SINT; - + event = VMBUS_SC_PCPU_GET(sc, event_flag, cpu) + HV_VMBUS_MESSAGE_SINT; if (atomic_testandclear_int(&event->flags32[0], 0)) { vmbus_event_flags_proc( hv_vmbus_g_connection.recv_interrupt_page, Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 05:51:51 2016 (r300571) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 06:01:39 2016 (r300572) @@ -69,18 +69,16 @@ __FBSDID("$FreeBSD$"); struct vmbus_softc *vmbus_sc; static int vmbus_inited; -static hv_setup_args setup_args; /* only CPU 0 supported at this time */ static char *vmbus_ids[] = { "VMBUS", NULL }; static void -vmbus_msg_task(void *arg __unused, int pending __unused) +vmbus_msg_task(void *xsc, int pending __unused) { + struct vmbus_softc *sc = xsc; hv_vmbus_message *msg; - msg = hv_vmbus_g_context.syn_ic_msg_page[curcpu] + - HV_VMBUS_MESSAGE_SINT; - + msg = VMBUS_SC_PCPU_GET(sc, message, curcpu) + HV_VMBUS_MESSAGE_SINT; for (;;) { const hv_vmbus_channel_msg_table_entry *entry; hv_vmbus_channel_msg_header *hdr; @@ -143,7 +141,7 @@ hv_vmbus_isr(struct vmbus_softc *sc, str sc->vmbus_event_proc(sc, cpu); /* Check if there are actual msgs to be process */ - msg_base = hv_vmbus_g_context.syn_ic_msg_page[cpu]; + msg_base = VMBUS_SC_PCPU_GET(sc, message, cpu); msg = msg_base + HV_VMBUS_TIMER_SINT; /* we call eventtimer process the message */ @@ -209,7 +207,7 @@ hv_vector_handler(struct trapframe *trap } static void -vmbus_synic_setup(void *arg) +vmbus_synic_setup(void *arg __unused) { struct vmbus_softc *sc = vmbus_get_softc(); int cpu; @@ -219,7 +217,6 @@ vmbus_synic_setup(void *arg) hv_vmbus_synic_scontrol sctrl; hv_vmbus_synic_sint shared_sint; uint64_t version; - hv_setup_args* setup_args = (hv_setup_args *)arg; cpu = PCPU_GET(cpuid); @@ -228,19 +225,13 @@ vmbus_synic_setup(void *arg) */ version = rdmsr(HV_X64_MSR_SVERSION); - hv_vmbus_g_context.syn_ic_msg_page[cpu] = - setup_args->page_buffers[2 * cpu]; - hv_vmbus_g_context.syn_ic_event_page[cpu] = - setup_args->page_buffers[2 * cpu + 1]; - /* * Setup the Synic's message page */ - simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); simp.u.simp_enabled = 1; - simp.u.base_simp_gpa = ((hv_get_phys_addr( - hv_vmbus_g_context.syn_ic_msg_page[cpu])) >> PAGE_SHIFT); + simp.u.base_simp_gpa = + VMBUS_SC_PCPU_GET(sc, message_dma.hv_paddr, cpu) >> PAGE_SHIFT; wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t); @@ -249,8 +240,8 @@ vmbus_synic_setup(void *arg) */ siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP); siefp.u.siefp_enabled = 1; - siefp.u.base_siefp_gpa = ((hv_get_phys_addr( - hv_vmbus_g_context.syn_ic_event_page[cpu])) >> PAGE_SHIFT); + siefp.u.base_siefp_gpa = + VMBUS_SC_PCPU_GET(sc, event_flag_dma.hv_paddr, cpu) >> PAGE_SHIFT; wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); @@ -328,6 +319,47 @@ vmbus_synic_teardown(void *arg) wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); } +static void +vmbus_dma_alloc(struct vmbus_softc *sc) +{ + int cpu; + + CPU_FOREACH(cpu) { + /* + * Per-cpu messages and event flags. + */ + VMBUS_SC_PCPU_GET(sc, message, cpu) = hyperv_dmamem_alloc( + bus_get_dma_tag(sc->vmbus_dev), PAGE_SIZE, 0, PAGE_SIZE, + VMBUS_SC_PCPU_PTR(sc, message_dma, cpu), + BUS_DMA_WAITOK | BUS_DMA_ZERO); + VMBUS_SC_PCPU_GET(sc, event_flag, cpu) = hyperv_dmamem_alloc( + bus_get_dma_tag(sc->vmbus_dev), PAGE_SIZE, 0, PAGE_SIZE, + VMBUS_SC_PCPU_PTR(sc, event_flag_dma, cpu), + BUS_DMA_WAITOK | BUS_DMA_ZERO); + } +} + +static void +vmbus_dma_free(struct vmbus_softc *sc) +{ + int cpu; + + CPU_FOREACH(cpu) { + if (VMBUS_SC_PCPU_GET(sc, message, cpu) != NULL) { + hyperv_dmamem_free( + VMBUS_SC_PCPU_PTR(sc, message_dma, cpu), + VMBUS_SC_PCPU_GET(sc, message, cpu)); + VMBUS_SC_PCPU_GET(sc, message, cpu) = NULL; + } + if (VMBUS_SC_PCPU_GET(sc, event_flag, cpu) != NULL) { + hyperv_dmamem_free( + VMBUS_SC_PCPU_PTR(sc, event_flag_dma, cpu), + VMBUS_SC_PCPU_GET(sc, event_flag, cpu)); + VMBUS_SC_PCPU_GET(sc, event_flag, cpu) = NULL; + } + } +} + static int vmbus_read_ivar( device_t dev, @@ -490,7 +522,7 @@ static int vmbus_bus_init(void) { struct vmbus_softc *sc; - int i, n, ret, cpu; + int ret, cpu; char buf[MAXCOMLEN + 1]; cpuset_t cpu_mask; @@ -517,9 +549,6 @@ vmbus_bus_init(void) CPU_FOREACH(cpu) { snprintf(buf, sizeof(buf), "cpu%d:hyperv", cpu); intrcnt_add(buf, VMBUS_SC_PCPU_PTR(sc, intr_cnt, cpu)); - - for (i = 0; i < 2; i++) - setup_args.page_buffers[2 * cpu + i] = NULL; } /* @@ -549,23 +578,18 @@ vmbus_bus_init(void) &hv_vmbus_g_context.hv_msg_tq[cpu], 1, PI_NET, &cpu_mask, "hvmsg%d", cpu); TASK_INIT(&hv_vmbus_g_context.hv_msg_task[cpu], 0, - vmbus_msg_task, NULL); - - /* - * Prepare the per cpu msg and event pages to be called on - * each cpu. - */ - for(i = 0; i < 2; i++) { - setup_args.page_buffers[2 * cpu + i] = - malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK | M_ZERO); - } + vmbus_msg_task, sc); } + /* + * Allocate vmbus DMA stuffs. + */ + vmbus_dma_alloc(sc); + if (bootverbose) printf("VMBUS: Calling smp_rendezvous, smp_started = %d\n", smp_started); - - smp_rendezvous(NULL, vmbus_synic_setup, NULL, &setup_args); + smp_rendezvous(NULL, vmbus_synic_setup, NULL, NULL); /* * Connect to VMBus in the root partition @@ -589,13 +613,8 @@ vmbus_bus_init(void) return (ret); - cleanup1: - /* - * Free pages alloc'ed - */ - for (n = 0; n < 2 * MAXCPU; n++) - if (setup_args.page_buffers[n] != NULL) - free(setup_args.page_buffers[n], M_DEVBUF); +cleanup1: + vmbus_dma_free(sc); /* * remove swi and vmbus callback vector; @@ -675,10 +694,7 @@ vmbus_detach(device_t dev) smp_rendezvous(NULL, vmbus_synic_teardown, NULL, NULL); - for(i = 0; i < 2 * MAXCPU; i++) { - if (setup_args.page_buffers[i] != NULL) - free(setup_args.page_buffers[i], M_DEVBUF); - } + vmbus_dma_free(sc); /* remove swi */ CPU_FOREACH(i) { Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue May 24 05:51:51 2016 (r300571) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue May 24 06:01:39 2016 (r300572) @@ -203,8 +203,6 @@ union vmbus_event_flags; typedef struct { hv_bool_uint8_t syn_ic_initialized; - struct vmbus_message *syn_ic_msg_page[MAXCPU]; - union vmbus_event_flags *syn_ic_event_page[MAXCPU]; /* * For FreeBSD cpuid to Hyper-V vcpuid mapping. */ @@ -755,8 +753,4 @@ void hv_et_intr(struct trapframe*); /* Wait for device creation */ void vmbus_scan(void); -typedef struct { - void *page_buffers[2 * MAXCPU]; -} hv_setup_args; - #endif /* __HYPERV_PRIV_H__ */ Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Tue May 24 05:51:51 2016 (r300571) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Tue May 24 06:01:39 2016 (r300572) @@ -30,10 +30,18 @@ #define _VMBUS_VAR_H_ #include +#include +#include struct vmbus_pcpu_data { - int event_flag_cnt; /* # of event flags */ - u_long *intr_cnt; + u_long *intr_cnt; /* Hyper-V interrupt counter */ + struct vmbus_message *message; /* shared messages */ + int event_flag_cnt; /* # of event flags */ + union vmbus_event_flags *event_flag; /* shared event flags */ + + /* Rarely used fields */ + struct hyperv_dma message_dma; /* busdma glue */ + struct hyperv_dma event_flag_dma; /* busdma glue */ } __aligned(CACHE_LINE_SIZE); struct vmbus_softc { From owner-svn-src-head@freebsd.org Tue May 24 06:10:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC6DCB48093; Tue, 24 May 2016 06:10:22 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF2101320; Tue, 24 May 2016 06:10:22 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O6ALgJ054828; Tue, 24 May 2016 06:10:21 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O6ALXV054825; Tue, 24 May 2016 06:10:21 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605240610.u4O6ALXV054825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 24 May 2016 06:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300573 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 06:10:23 -0000 Author: sephe Date: Tue May 24 06:10:21 2016 New Revision: 300573 URL: https://svnweb.freebsd.org/changeset/base/300573 Log: hyperv/vmbus: Git rid of sc version of pcpu data extraction macro MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6503 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Tue May 24 06:01:39 2016 (r300572) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Tue May 24 06:10:21 2016 (r300573) @@ -337,9 +337,9 @@ vmbus_event_proc(struct vmbus_softc *sc, * On Host with Win8 or above, the event page can be checked directly * to get the id of the channel that has the pending interrupt. */ - event = VMBUS_SC_PCPU_GET(sc, event_flag, cpu) + HV_VMBUS_MESSAGE_SINT; + event = VMBUS_PCPU_GET(sc, event_flag, cpu) + HV_VMBUS_MESSAGE_SINT; vmbus_event_flags_proc(event->flagsul, - VMBUS_SC_PCPU_GET(sc, event_flag_cnt, cpu)); + VMBUS_PCPU_GET(sc, event_flag_cnt, cpu)); } void @@ -347,7 +347,7 @@ vmbus_event_proc_compat(struct vmbus_sof { hv_vmbus_synic_event_flags *event; - event = VMBUS_SC_PCPU_GET(sc, event_flag, cpu) + HV_VMBUS_MESSAGE_SINT; + event = VMBUS_PCPU_GET(sc, event_flag, cpu) + HV_VMBUS_MESSAGE_SINT; if (atomic_testandclear_int(&event->flags32[0], 0)) { vmbus_event_flags_proc( hv_vmbus_g_connection.recv_interrupt_page, @@ -415,7 +415,8 @@ vmbus_on_channel_open(const struct hv_vm int flag_cnt; flag_cnt = (chan->offer_msg.child_rel_id / HV_CHANNEL_ULONG_LEN) + 1; - flag_cnt_ptr = VMBUS_PCPU_PTR(event_flag_cnt, chan->target_cpu); + flag_cnt_ptr = VMBUS_PCPU_PTR(vmbus_get_softc(), event_flag_cnt, + chan->target_cpu); for (;;) { int old_flag_cnt; Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 06:01:39 2016 (r300572) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 06:10:21 2016 (r300573) @@ -78,7 +78,7 @@ vmbus_msg_task(void *xsc, int pending __ struct vmbus_softc *sc = xsc; hv_vmbus_message *msg; - msg = VMBUS_SC_PCPU_GET(sc, message, curcpu) + HV_VMBUS_MESSAGE_SINT; + msg = VMBUS_PCPU_GET(sc, message, curcpu) + HV_VMBUS_MESSAGE_SINT; for (;;) { const hv_vmbus_channel_msg_table_entry *entry; hv_vmbus_channel_msg_header *hdr; @@ -141,7 +141,7 @@ hv_vmbus_isr(struct vmbus_softc *sc, str sc->vmbus_event_proc(sc, cpu); /* Check if there are actual msgs to be process */ - msg_base = VMBUS_SC_PCPU_GET(sc, message, cpu); + msg_base = VMBUS_PCPU_GET(sc, message, cpu); msg = msg_base + HV_VMBUS_TIMER_SINT; /* we call eventtimer process the message */ @@ -196,7 +196,7 @@ hv_vector_handler(struct trapframe *trap /* * Do a little interrupt counting. */ - (*VMBUS_SC_PCPU_GET(sc, intr_cnt, cpu))++; + (*VMBUS_PCPU_GET(sc, intr_cnt, cpu))++; hv_vmbus_isr(sc, trap_frame, cpu); @@ -231,7 +231,7 @@ vmbus_synic_setup(void *arg __unused) simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); simp.u.simp_enabled = 1; simp.u.base_simp_gpa = - VMBUS_SC_PCPU_GET(sc, message_dma.hv_paddr, cpu) >> PAGE_SHIFT; + VMBUS_PCPU_GET(sc, message_dma.hv_paddr, cpu) >> PAGE_SHIFT; wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t); @@ -241,7 +241,7 @@ vmbus_synic_setup(void *arg __unused) siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP); siefp.u.siefp_enabled = 1; siefp.u.base_siefp_gpa = - VMBUS_SC_PCPU_GET(sc, event_flag_dma.hv_paddr, cpu) >> PAGE_SHIFT; + VMBUS_PCPU_GET(sc, event_flag_dma.hv_paddr, cpu) >> PAGE_SHIFT; wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); @@ -328,13 +328,13 @@ vmbus_dma_alloc(struct vmbus_softc *sc) /* * Per-cpu messages and event flags. */ - VMBUS_SC_PCPU_GET(sc, message, cpu) = hyperv_dmamem_alloc( + VMBUS_PCPU_GET(sc, message, cpu) = hyperv_dmamem_alloc( bus_get_dma_tag(sc->vmbus_dev), PAGE_SIZE, 0, PAGE_SIZE, - VMBUS_SC_PCPU_PTR(sc, message_dma, cpu), + VMBUS_PCPU_PTR(sc, message_dma, cpu), BUS_DMA_WAITOK | BUS_DMA_ZERO); - VMBUS_SC_PCPU_GET(sc, event_flag, cpu) = hyperv_dmamem_alloc( + VMBUS_PCPU_GET(sc, event_flag, cpu) = hyperv_dmamem_alloc( bus_get_dma_tag(sc->vmbus_dev), PAGE_SIZE, 0, PAGE_SIZE, - VMBUS_SC_PCPU_PTR(sc, event_flag_dma, cpu), + VMBUS_PCPU_PTR(sc, event_flag_dma, cpu), BUS_DMA_WAITOK | BUS_DMA_ZERO); } } @@ -345,17 +345,17 @@ vmbus_dma_free(struct vmbus_softc *sc) int cpu; CPU_FOREACH(cpu) { - if (VMBUS_SC_PCPU_GET(sc, message, cpu) != NULL) { + if (VMBUS_PCPU_GET(sc, message, cpu) != NULL) { hyperv_dmamem_free( - VMBUS_SC_PCPU_PTR(sc, message_dma, cpu), - VMBUS_SC_PCPU_GET(sc, message, cpu)); - VMBUS_SC_PCPU_GET(sc, message, cpu) = NULL; + VMBUS_PCPU_PTR(sc, message_dma, cpu), + VMBUS_PCPU_GET(sc, message, cpu)); + VMBUS_PCPU_GET(sc, message, cpu) = NULL; } - if (VMBUS_SC_PCPU_GET(sc, event_flag, cpu) != NULL) { + if (VMBUS_PCPU_GET(sc, event_flag, cpu) != NULL) { hyperv_dmamem_free( - VMBUS_SC_PCPU_PTR(sc, event_flag_dma, cpu), - VMBUS_SC_PCPU_GET(sc, event_flag, cpu)); - VMBUS_SC_PCPU_GET(sc, event_flag, cpu) = NULL; + VMBUS_PCPU_PTR(sc, event_flag_dma, cpu), + VMBUS_PCPU_GET(sc, event_flag, cpu)); + VMBUS_PCPU_GET(sc, event_flag, cpu) = NULL; } } } @@ -548,7 +548,7 @@ vmbus_bus_init(void) CPU_FOREACH(cpu) { snprintf(buf, sizeof(buf), "cpu%d:hyperv", cpu); - intrcnt_add(buf, VMBUS_SC_PCPU_PTR(sc, intr_cnt, cpu)); + intrcnt_add(buf, VMBUS_PCPU_PTR(sc, intr_cnt, cpu)); } /* Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Tue May 24 06:01:39 2016 (r300572) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Tue May 24 06:10:21 2016 (r300573) @@ -65,12 +65,8 @@ vmbus_get_device(void) return vmbus_sc->vmbus_dev; } -#define VMBUS_SC_PCPU_GET(sc, field, cpu) (sc)->vmbus_pcpu[(cpu)].field -#define VMBUS_SC_PCPU_PTR(sc, field, cpu) &(sc)->vmbus_pcpu[(cpu)].field -#define VMBUS_PCPU_GET(field, cpu) \ - VMBUS_SC_PCPU_GET(vmbus_get_softc(), field, (cpu)) -#define VMBUS_PCPU_PTR(field, cpu) \ - VMBUS_SC_PCPU_PTR(vmbus_get_softc(), field, (cpu)) +#define VMBUS_PCPU_GET(sc, field, cpu) (sc)->vmbus_pcpu[(cpu)].field +#define VMBUS_PCPU_PTR(sc, field, cpu) &(sc)->vmbus_pcpu[(cpu)].field void vmbus_on_channel_open(const struct hv_vmbus_channel *); void vmbus_event_proc(struct vmbus_softc *, int); From owner-svn-src-head@freebsd.org Tue May 24 06:42:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDA87B488BA; Tue, 24 May 2016 06:42:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B486C1736; Tue, 24 May 2016 06:42:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O6gEC7066580; Tue, 24 May 2016 06:42:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O6gE47066579; Tue, 24 May 2016 06:42:14 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605240642.u4O6gE47066579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 24 May 2016 06:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300574 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 06:42:16 -0000 Author: sephe Date: Tue May 24 06:42:14 2016 New Revision: 300574 URL: https://svnweb.freebsd.org/changeset/base/300574 Log: hyperv/vmbus: Factor out functions for vmbus interrupt set/teardown This paves way for further cleanup and fix. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6505 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 06:10:21 2016 (r300573) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 06:42:14 2016 (r300574) @@ -72,6 +72,8 @@ static int vmbus_inited; static char *vmbus_ids[] = { "VMBUS", NULL }; +extern inthand_t IDTVEC(hv_vmbus_callback); + static void vmbus_msg_task(void *xsc, int pending __unused) { @@ -361,6 +363,82 @@ vmbus_dma_free(struct vmbus_softc *sc) } static int +vmbus_intr_setup(struct vmbus_softc *sc) +{ + int cpu; + + /* + * Find a free IDT vector for vmbus messages/events. + */ + sc->vmbus_idtvec = lapic_ipi_alloc(IDTVEC(hv_vmbus_callback)); + if (sc->vmbus_idtvec < 0) { + device_printf(sc->vmbus_dev, "cannot find free IDT vector\n"); + return ENXIO; + } + if(bootverbose) { + device_printf(sc->vmbus_dev, "vmbus IDT vector %d\n", + sc->vmbus_idtvec); + } + + CPU_FOREACH(cpu) { + char buf[MAXCOMLEN + 1]; + + snprintf(buf, sizeof(buf), "cpu%d:hyperv", cpu); + intrcnt_add(buf, VMBUS_PCPU_PTR(sc, intr_cnt, cpu)); + } + + /* + * Per cpu setup. + */ + CPU_FOREACH(cpu) { + cpuset_t cpu_mask; + + /* + * Setup taskqueue to handle events + */ + hv_vmbus_g_context.hv_event_queue[cpu] = + taskqueue_create_fast("hyperv event", M_WAITOK, + taskqueue_thread_enqueue, + &hv_vmbus_g_context.hv_event_queue[cpu]); + CPU_SETOF(cpu, &cpu_mask); + taskqueue_start_threads_cpuset( + &hv_vmbus_g_context.hv_event_queue[cpu], 1, PI_NET, + &cpu_mask, "hvevent%d", cpu); + + /* + * Setup per-cpu tasks and taskqueues to handle msg. + */ + hv_vmbus_g_context.hv_msg_tq[cpu] = taskqueue_create_fast( + "hyperv msg", M_WAITOK, taskqueue_thread_enqueue, + &hv_vmbus_g_context.hv_msg_tq[cpu]); + CPU_SETOF(cpu, &cpu_mask); + taskqueue_start_threads_cpuset( + &hv_vmbus_g_context.hv_msg_tq[cpu], 1, PI_NET, + &cpu_mask, "hvmsg%d", cpu); + TASK_INIT(&hv_vmbus_g_context.hv_msg_task[cpu], 0, + vmbus_msg_task, sc); + } + return 0; +} + +static void +vmbus_intr_teardown(struct vmbus_softc *sc) +{ + int cpu; + + CPU_FOREACH(cpu) { + if (hv_vmbus_g_context.hv_event_queue[cpu] != NULL) { + taskqueue_free(hv_vmbus_g_context.hv_event_queue[cpu]); + hv_vmbus_g_context.hv_event_queue[cpu] = NULL; + } + } + if (sc->vmbus_idtvec >= 0) { + lapic_ipi_free(sc->vmbus_idtvec); + sc->vmbus_idtvec = -1; + } +} + +static int vmbus_read_ivar( device_t dev, device_t child, @@ -504,8 +582,6 @@ vmbus_probe(device_t dev) return (BUS_PROBE_DEFAULT); } -extern inthand_t IDTVEC(hv_vmbus_callback); - /** * @brief Main vmbus driver initialization routine. * @@ -522,9 +598,7 @@ static int vmbus_bus_init(void) { struct vmbus_softc *sc; - int ret, cpu; - char buf[MAXCOMLEN + 1]; - cpuset_t cpu_mask; + int ret; if (vmbus_inited) return (0); @@ -533,56 +607,14 @@ vmbus_bus_init(void) sc = vmbus_get_softc(); /* - * Find a free IDT vector for vmbus messages/events. + * Setup interrupt. */ - sc->vmbus_idtvec = lapic_ipi_alloc(IDTVEC(hv_vmbus_callback)); - if (sc->vmbus_idtvec < 0) { - device_printf(sc->vmbus_dev, "cannot find free IDT vector\n"); - ret = ENXIO; + ret = vmbus_intr_setup(sc); + if (ret != 0) goto cleanup; - } - if(bootverbose) { - device_printf(sc->vmbus_dev, "vmbus IDT vector %d\n", - sc->vmbus_idtvec); - } - - CPU_FOREACH(cpu) { - snprintf(buf, sizeof(buf), "cpu%d:hyperv", cpu); - intrcnt_add(buf, VMBUS_PCPU_PTR(sc, intr_cnt, cpu)); - } /* - * Per cpu setup. - */ - CPU_FOREACH(cpu) { - /* - * Setup taskqueue to handle events - */ - hv_vmbus_g_context.hv_event_queue[cpu] = - taskqueue_create_fast("hyperv event", M_WAITOK, - taskqueue_thread_enqueue, - &hv_vmbus_g_context.hv_event_queue[cpu]); - CPU_SETOF(cpu, &cpu_mask); - taskqueue_start_threads_cpuset( - &hv_vmbus_g_context.hv_event_queue[cpu], 1, PI_NET, - &cpu_mask, "hvevent%d", cpu); - - /* - * Setup per-cpu tasks and taskqueues to handle msg. - */ - hv_vmbus_g_context.hv_msg_tq[cpu] = taskqueue_create_fast( - "hyperv msg", M_WAITOK, taskqueue_thread_enqueue, - &hv_vmbus_g_context.hv_msg_tq[cpu]); - CPU_SETOF(cpu, &cpu_mask); - taskqueue_start_threads_cpuset( - &hv_vmbus_g_context.hv_msg_tq[cpu], 1, PI_NET, - &cpu_mask, "hvmsg%d", cpu); - TASK_INIT(&hv_vmbus_g_context.hv_msg_task[cpu], 0, - vmbus_msg_task, sc); - } - - /* - * Allocate vmbus DMA stuffs. + * Allocate DMA stuffs. */ vmbus_dma_alloc(sc); @@ -597,7 +629,7 @@ vmbus_bus_init(void) ret = hv_vmbus_connect(); if (ret != 0) - goto cleanup1; + goto cleanup; if (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008 || hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7) @@ -613,22 +645,10 @@ vmbus_bus_init(void) return (ret); -cleanup1: +cleanup: vmbus_dma_free(sc); + vmbus_intr_teardown(sc); - /* - * remove swi and vmbus callback vector; - */ - CPU_FOREACH(cpu) { - if (hv_vmbus_g_context.hv_event_queue[cpu] != NULL) { - taskqueue_free(hv_vmbus_g_context.hv_event_queue[cpu]); - hv_vmbus_g_context.hv_event_queue[cpu] = NULL; - } - } - - lapic_ipi_free(sc->vmbus_idtvec); - - cleanup: return (ret); } @@ -642,6 +662,7 @@ vmbus_attach(device_t dev) { vmbus_sc = device_get_softc(dev); vmbus_sc->vmbus_dev = dev; + vmbus_sc->vmbus_idtvec = -1; /* * Event processing logic will be configured: @@ -687,7 +708,6 @@ static int vmbus_detach(device_t dev) { struct vmbus_softc *sc = device_get_softc(dev); - int i; hv_vmbus_release_unattached_channels(); hv_vmbus_disconnect(); @@ -695,16 +715,7 @@ vmbus_detach(device_t dev) smp_rendezvous(NULL, vmbus_synic_teardown, NULL, NULL); vmbus_dma_free(sc); - - /* remove swi */ - CPU_FOREACH(i) { - if (hv_vmbus_g_context.hv_event_queue[i] != NULL) { - taskqueue_free(hv_vmbus_g_context.hv_event_queue[i]); - hv_vmbus_g_context.hv_event_queue[i] = NULL; - } - } - - lapic_ipi_free(sc->vmbus_idtvec); + vmbus_intr_teardown(sc); return (0); } From owner-svn-src-head@freebsd.org Tue May 24 07:06:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C72DFB48F5B; Tue, 24 May 2016 07:06:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EFBC1391; Tue, 24 May 2016 07:06:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O764h1072999; Tue, 24 May 2016 07:06:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O7644X072998; Tue, 24 May 2016 07:06:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605240706.u4O7644X072998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 24 May 2016 07:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300575 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 07:06:05 -0000 Author: hselasky Date: Tue May 24 07:06:04 2016 New Revision: 300575 URL: https://svnweb.freebsd.org/changeset/base/300575 Log: Use make_dev_s() instead of make_dev() to avoid race setting "si_drv1". Convert panic() into regular error while at it. Suggested by: jhb @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/cdev.h Tue May 24 06:42:14 2016 (r300574) +++ head/sys/compat/linuxkpi/common/include/linux/cdev.h Tue May 24 07:06:04 2016 (r300575) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -80,12 +80,27 @@ cdev_put(struct linux_cdev *p) static inline int cdev_add(struct linux_cdev *cdev, dev_t dev, unsigned count) { + struct make_dev_args args; + int error; + if (count != 1) - panic("cdev_add: Unsupported count: %d", count); - cdev->cdev = make_dev(&linuxcdevsw, MINOR(dev), 0, 0, 0700, - "%s", kobject_name(&cdev->kobj)); + return (-EINVAL); + cdev->dev = dev; - cdev->cdev->si_drv1 = cdev; + + /* Setup arguments for make_dev_s() */ + make_dev_args_init(&args); + args.mda_devsw = &linuxcdevsw; + args.mda_uid = 0; + args.mda_gid = 0; + args.mda_mode = 0700; + args.mda_si_drv1 = cdev; + args.mda_unit = MINOR(dev); + + error = make_dev_s(&args, &cdev->cdev, "%s", + kobject_name(&cdev->kobj)); + if (error) + return (-error); kobject_get(cdev->kobj.parent); return (0); @@ -94,10 +109,24 @@ cdev_add(struct linux_cdev *cdev, dev_t static inline int cdev_add_ext(struct linux_cdev *cdev, dev_t dev, uid_t uid, gid_t gid, int mode) { - cdev->cdev = make_dev(&linuxcdevsw, MINOR(dev), uid, gid, mode, - "%s/%d", kobject_name(&cdev->kobj), MINOR(dev)); + struct make_dev_args args; + int error; + cdev->dev = dev; - cdev->cdev->si_drv1 = cdev; + + /* Setup arguments for make_dev_s() */ + make_dev_args_init(&args); + args.mda_devsw = &linuxcdevsw; + args.mda_uid = uid; + args.mda_gid = gid; + args.mda_mode = mode; + args.mda_si_drv1 = cdev; + args.mda_unit = MINOR(dev); + + error = make_dev_s(&args, &cdev->cdev, "%s/%d", + kobject_name(&cdev->kobj), MINOR(dev)); + if (error) + return (-error); kobject_get(cdev->kobj.parent); return (0); From owner-svn-src-head@freebsd.org Tue May 24 07:07:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E9F8B4702F; Tue, 24 May 2016 07:07:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B6871843; Tue, 24 May 2016 07:07:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O77BeB073232; Tue, 24 May 2016 07:07:11 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O77BFu073231; Tue, 24 May 2016 07:07:11 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605240707.u4O77BFu073231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 24 May 2016 07:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300576 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 07:07:12 -0000 Author: sephe Date: Tue May 24 07:07:11 2016 New Revision: 300576 URL: https://svnweb.freebsd.org/changeset/base/300576 Log: hyperv/vmbus: Free message taskqueue during interrupt teardown MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6506 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 07:06:04 2016 (r300575) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 07:07:11 2016 (r300576) @@ -431,6 +431,12 @@ vmbus_intr_teardown(struct vmbus_softc * taskqueue_free(hv_vmbus_g_context.hv_event_queue[cpu]); hv_vmbus_g_context.hv_event_queue[cpu] = NULL; } + if (hv_vmbus_g_context.hv_msg_tq[cpu] != NULL) { + taskqueue_drain(hv_vmbus_g_context.hv_msg_tq[cpu], + &hv_vmbus_g_context.hv_msg_task[cpu]); + taskqueue_free(hv_vmbus_g_context.hv_msg_tq[cpu]); + hv_vmbus_g_context.hv_msg_tq[cpu] = NULL; + } } if (sc->vmbus_idtvec >= 0) { lapic_ipi_free(sc->vmbus_idtvec); From owner-svn-src-head@freebsd.org Tue May 24 07:46:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C2E0B480B2; Tue, 24 May 2016 07:46:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F319F10EC; Tue, 24 May 2016 07:46:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O7kLG0085995; Tue, 24 May 2016 07:46:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O7kLLi085991; Tue, 24 May 2016 07:46:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605240746.u4O7kLLi085991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 24 May 2016 07:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300590 - in head/sys/compat/linuxkpi/common: include/linux 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 07:46:22 -0000 Author: hselasky Date: Tue May 24 07:46:20 2016 New Revision: 300590 URL: https://svnweb.freebsd.org/changeset/base/300590 Log: Set "current" for all PCI enumeration callbacks. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/compat.h head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/compat.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compat.h Tue May 24 07:21:23 2016 (r300589) +++ head/sys/compat/linuxkpi/common/include/linux/compat.h Tue May 24 07:46:20 2016 (r300590) @@ -31,4 +31,10 @@ #ifndef _LINUX_COMPAT_H_ #define _LINUX_COMPAT_H_ +struct thread; +struct task_struct; + +void linux_set_current(struct thread *td, struct task_struct *t); +void linux_clear_current(struct thread *td); + #endif /* _LINUX_COMPAT_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Tue May 24 07:21:23 2016 (r300589) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Tue May 24 07:46:20 2016 (r300590) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -380,7 +381,7 @@ kobject_init_and_add(struct kobject *kob return kobject_add_complete(kobj, parent); } -static void +void linux_set_current(struct thread *td, struct task_struct *t) { memset(t, 0, sizeof(*t)); @@ -388,7 +389,7 @@ linux_set_current(struct thread *td, str task_struct_set(td, t); } -static void +void linux_clear_current(struct thread *td) { task_struct_set(td, NULL); Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue May 24 07:21:23 2016 (r300589) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue May 24 07:46:20 2016 (r300590) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static device_probe_t linux_pci_probe; static device_attach_t linux_pci_attach; @@ -120,8 +121,12 @@ linux_pci_attach(device_t dev) struct pci_dev *pdev; struct pci_driver *pdrv; const struct pci_device_id *id; + struct task_struct t; + struct thread *td; int error; + td = curthread; + linux_set_current(td, &t); pdrv = linux_pci_find(dev, &id); pdev = device_get_softc(dev); pdev->dev.parent = &linux_root_device; @@ -152,16 +157,21 @@ linux_pci_attach(device_t dev) list_del(&pdev->links); spin_unlock(&pci_lock); put_device(&pdev->dev); - return (-error); + error = -error; } - return (0); + linux_clear_current(td); + return (error); } static int linux_pci_detach(device_t dev) { struct pci_dev *pdev; + struct task_struct t; + struct thread *td; + td = curthread; + linux_set_current(td, &t); pdev = device_get_softc(dev); mtx_unlock(&Giant); pdev->pdrv->remove(pdev); @@ -170,6 +180,7 @@ linux_pci_detach(device_t dev) list_del(&pdev->links); spin_unlock(&pci_lock); put_device(&pdev->dev); + linux_clear_current(td); return (0); } @@ -179,13 +190,18 @@ linux_pci_suspend(device_t dev) { struct pm_message pm = { }; struct pci_dev *pdev; + struct task_struct t; + struct thread *td; int err; + td = curthread; + linux_set_current(td, &t); pdev = device_get_softc(dev); if (pdev->pdrv->suspend != NULL) err = -pdev->pdrv->suspend(pdev, pm); else err = 0; + linux_clear_current(td); return (err); } @@ -193,13 +209,18 @@ static int linux_pci_resume(device_t dev) { struct pci_dev *pdev; + struct task_struct t; + struct thread *td; int err; + td = curthread; + linux_set_current(td, &t); pdev = device_get_softc(dev); if (pdev->pdrv->resume != NULL) err = -pdev->pdrv->resume(pdev); else err = 0; + linux_clear_current(td); return (err); } @@ -207,13 +228,18 @@ static int linux_pci_shutdown(device_t dev) { struct pci_dev *pdev; + struct task_struct t; + struct thread *td; + td = curthread; + linux_set_current(td, &t); pdev = device_get_softc(dev); if (pdev->pdrv->shutdown != NULL) { DROP_GIANT(); pdev->pdrv->shutdown(pdev); PICKUP_GIANT(); } + linux_clear_current(td); return (0); } From owner-svn-src-head@freebsd.org Tue May 24 07:52:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17AE4B48324; Tue, 24 May 2016 07:52:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDEB31979; Tue, 24 May 2016 07:52:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O7qsfx089302; Tue, 24 May 2016 07:52:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O7qs1n089301; Tue, 24 May 2016 07:52:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605240752.u4O7qs1n089301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 24 May 2016 07:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300591 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 07:52:55 -0000 Author: hselasky Date: Tue May 24 07:52:53 2016 New Revision: 300591 URL: https://svnweb.freebsd.org/changeset/base/300591 Log: Use the DROP_GIANT() and PICKUP_GIANT() macros instead of making assumptions about how the Giant mutex is locked. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue May 24 07:46:20 2016 (r300590) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue May 24 07:52:53 2016 (r300591) @@ -146,12 +146,12 @@ linux_pci_attach(device_t dev) else pdev->dev.irq = 255; pdev->irq = pdev->dev.irq; - mtx_unlock(&Giant); + DROP_GIANT(); spin_lock(&pci_lock); list_add(&pdev->links, &pci_devices); spin_unlock(&pci_lock); error = pdrv->probe(pdev, id); - mtx_lock(&Giant); + PICKUP_GIANT(); if (error) { spin_lock(&pci_lock); list_del(&pdev->links); @@ -173,9 +173,9 @@ linux_pci_detach(device_t dev) td = curthread; linux_set_current(td, &t); pdev = device_get_softc(dev); - mtx_unlock(&Giant); + DROP_GIANT(); pdev->pdrv->remove(pdev); - mtx_lock(&Giant); + PICKUP_GIANT(); spin_lock(&pci_lock); list_del(&pdev->links); spin_unlock(&pci_lock); From owner-svn-src-head@freebsd.org Tue May 24 08:44:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6667BB48B78; Tue, 24 May 2016 08:44:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40B1A19B3; Tue, 24 May 2016 08:44:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O8ikb1005089; Tue, 24 May 2016 08:44:46 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O8ijkn005083; Tue, 24 May 2016 08:44:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605240844.u4O8ijkn005083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 24 May 2016 08:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300592 - in head/sys: cam/ctl dev/cxgbe/cxgbei dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 08:44:47 -0000 Author: trasz Date: Tue May 24 08:44:45 2016 New Revision: 300592 URL: https://svnweb.freebsd.org/changeset/base/300592 Log: Add mechanism for choosing iSER-capable ICL modules. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/icl.h head/sys/dev/iscsi/icl_soft.c head/sys/dev/iscsi/iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Tue May 24 07:52:53 2016 (r300591) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Tue May 24 08:44:45 2016 (r300592) @@ -1264,7 +1264,7 @@ cfiscsi_session_new(struct cfiscsi_softc cv_init(&cs->cs_login_cv, "cfiscsi_login"); #endif - cs->cs_conn = icl_new_conn(offload, "cfiscsi", &cs->cs_lock); + cs->cs_conn = icl_new_conn(offload, false, "cfiscsi", &cs->cs_lock); if (cs->cs_conn == NULL) { free(cs, M_CFISCSI); return (NULL); @@ -1793,7 +1793,8 @@ cfiscsi_ioctl_limits(struct ctl_iscsi *c cilp = (struct ctl_iscsi_limits_params *)&(ci->data); - error = icl_limits(cilp->offload, &cilp->data_segment_limit); + error = icl_limits(cilp->offload, false, + &cilp->data_segment_limit); if (error != 0) { ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Tue May 24 07:52:53 2016 (r300591) +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Tue May 24 08:44:45 2016 (r300592) @@ -850,7 +850,7 @@ icl_cxgbei_load(void) refcount_init(&icl_cxgbei_ncons, 0); - error = icl_register("cxgbei", 100, icl_cxgbei_limits, + error = icl_register("cxgbei", false, 100, icl_cxgbei_limits, icl_cxgbei_new_conn); KASSERT(error == 0, ("failed to register")); @@ -864,7 +864,7 @@ icl_cxgbei_unload(void) if (icl_cxgbei_ncons != 0) return (EBUSY); - icl_unregister("cxgbei"); + icl_unregister("cxgbei", false); uma_zdestroy(icl_transfer_zone); Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Tue May 24 07:52:53 2016 (r300591) +++ head/sys/dev/iscsi/icl.c Tue May 24 08:44:45 2016 (r300592) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); struct icl_module { TAILQ_ENTRY(icl_module) im_next; char *im_name; + bool im_iser; int im_priority; int (*im_limits)(size_t *limitp); struct icl_conn *(*im_new_conn)(const char *name, @@ -106,7 +107,7 @@ sysctl_kern_icl_drivers(SYSCTL_HANDLER_A } static struct icl_module * -icl_find(const char *name) +icl_find(const char *name, bool iser, bool quiet) { struct icl_module *im, *im_max; @@ -117,34 +118,52 @@ icl_find(const char *name) * priority. */ if (name == NULL || name[0] == '\0') { - im_max = TAILQ_FIRST(&sc->sc_modules); + im_max = NULL; TAILQ_FOREACH(im, &sc->sc_modules, im_next) { - if (im->im_priority > im_max->im_priority) + if (im->im_iser != iser) + continue; + if (im_max == NULL || + im->im_priority > im_max->im_priority) im_max = im; } + if (iser && im_max == NULL && !quiet) + ICL_WARN("no iSER-capable offload found"); + return (im_max); } TAILQ_FOREACH(im, &sc->sc_modules, im_next) { - if (strcasecmp(im->im_name, name) == 0) - return (im); + if (strcasecmp(im->im_name, name) != 0) + continue; + + if (!im->im_iser && iser && !quiet) { + ICL_WARN("offload \"%s\" is not iSER-capable", name); + return (NULL); + } + if (im->im_iser && !iser && !quiet) { + ICL_WARN("offload \"%s\" is iSER-only", name); + return (NULL); + } + + return (im); } + if (!quiet) + ICL_WARN("offload \"%s\" not found", name); + return (NULL); } struct icl_conn * -icl_new_conn(const char *offload, const char *name, struct mtx *lock) +icl_new_conn(const char *offload, bool iser, const char *name, struct mtx *lock) { struct icl_module *im; struct icl_conn *ic; sx_slock(&sc->sc_lock); - im = icl_find(offload); - + im = icl_find(offload, iser, false); if (im == NULL) { - ICL_WARN("offload \"%s\" not found", offload); sx_sunlock(&sc->sc_lock); return (NULL); } @@ -156,16 +175,14 @@ icl_new_conn(const char *offload, const } int -icl_limits(const char *offload, size_t *limitp) +icl_limits(const char *offload, bool iser, size_t *limitp) { struct icl_module *im; int error; sx_slock(&sc->sc_lock); - im = icl_find(offload); - + im = icl_find(offload, iser, false); if (im == NULL) { - ICL_WARN("offload \"%s\" not found", offload); sx_sunlock(&sc->sc_lock); return (ENXIO); } @@ -176,16 +193,14 @@ icl_limits(const char *offload, size_t * return (error); } - int -icl_register(const char *offload, int priority, int (*limits)(size_t *), +icl_register(const char *offload, bool iser, int priority, int (*limits)(size_t *), struct icl_conn *(*new_conn)(const char *, struct mtx *)) { struct icl_module *im; sx_xlock(&sc->sc_lock); - im = icl_find(offload); - + im = icl_find(offload, iser, true); if (im != NULL) { ICL_WARN("offload \"%s\" already registered", offload); sx_xunlock(&sc->sc_lock); @@ -194,6 +209,7 @@ icl_register(const char *offload, int pr im = malloc(sizeof(*im), M_ICL, M_ZERO | M_WAITOK); im->im_name = strdup(offload, M_ICL); + im->im_iser = iser; im->im_priority = priority; im->im_limits = limits; im->im_new_conn = new_conn; @@ -206,13 +222,12 @@ icl_register(const char *offload, int pr } int -icl_unregister(const char *offload) +icl_unregister(const char *offload, bool rdma) { struct icl_module *im; sx_xlock(&sc->sc_lock); - im = icl_find(offload); - + im = icl_find(offload, rdma, true); if (im == NULL) { ICL_WARN("offload \"%s\" not registered", offload); sx_xunlock(&sc->sc_lock); Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Tue May 24 07:52:53 2016 (r300591) +++ head/sys/dev/iscsi/icl.h Tue May 24 08:44:45 2016 (r300592) @@ -126,14 +126,14 @@ struct icl_conn { void *ic_prv0; }; -struct icl_conn *icl_new_conn(const char *offload, const char *name, +struct icl_conn *icl_new_conn(const char *offload, bool iser, const char *name, struct mtx *lock); -int icl_limits(const char *offload, size_t *limitp); +int icl_limits(const char *offload, bool iser, size_t *limitp); -int icl_register(const char *offload, int priority, +int icl_register(const char *offload, bool iser, int priority, int (*limits)(size_t *), struct icl_conn *(*new_conn)(const char *, struct mtx *)); -int icl_unregister(const char *offload); +int icl_unregister(const char *offload, bool rdma); #ifdef ICL_KERNEL_PROXY Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Tue May 24 07:52:53 2016 (r300591) +++ head/sys/dev/iscsi/icl_soft.c Tue May 24 08:44:45 2016 (r300592) @@ -1531,9 +1531,19 @@ icl_soft_load(void) * it's known as "offload driver"; "offload driver: soft" * doesn't make much sense. */ - error = icl_register("none", 0, icl_soft_limits, icl_soft_new_conn); + error = icl_register("none", false, 0, + icl_soft_limits, icl_soft_new_conn); KASSERT(error == 0, ("failed to register")); +#if defined(ICL_KERNEL_PROXY) && 0 + /* + * Debugging aid for kernel proxy functionality. + */ + error = icl_register("proxytest", true, 0, + icl_soft_limits, icl_soft_new_conn); + KASSERT(error == 0, ("failed to register")); +#endif + return (error); } @@ -1544,7 +1554,10 @@ icl_soft_unload(void) if (icl_ncons != 0) return (EBUSY); - icl_unregister("none"); + icl_unregister("none", false); +#if defined(ICL_KERNEL_PROXY) && 0 + icl_unregister("proxytest", true); +#endif uma_zdestroy(icl_pdu_zone); Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue May 24 07:52:53 2016 (r300591) +++ head/sys/dev/iscsi/iscsi.c Tue May 24 08:44:45 2016 (r300592) @@ -1324,6 +1324,7 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof sizeof(request->idr_conf)); error = icl_limits(is->is_conf.isc_offload, + is->is_conf.isc_iser, &request->idr_limits.isl_max_data_segment_length); if (error != 0) { ISCSI_SESSION_WARN(is, "icl_limits for offload \"%s\" " @@ -1773,7 +1774,7 @@ iscsi_ioctl_session_add(struct iscsi_sof } is->is_conn = icl_new_conn(is->is_conf.isc_offload, - "iscsi", &is->is_lock); + is->is_conf.isc_iser, "iscsi", &is->is_lock); if (is->is_conn == NULL) { sx_xunlock(&sc->sc_lock); free(is, M_ISCSI); From owner-svn-src-head@freebsd.org Tue May 24 08:54:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76353B48D63; Tue, 24 May 2016 08:54:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 471E21E6E; Tue, 24 May 2016 08:54:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O8sfGP008054; Tue, 24 May 2016 08:54:41 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O8sfRp008053; Tue, 24 May 2016 08:54:41 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605240854.u4O8sfRp008053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 24 May 2016 08:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300593 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 08:54:42 -0000 Author: trasz Date: Tue May 24 08:54:41 2016 New Revision: 300593 URL: https://svnweb.freebsd.org/changeset/base/300593 Log: Rename kern.icl.drivers to kern.icl.offloads, for consistency. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Tue May 24 08:44:45 2016 (r300592) +++ head/sys/dev/iscsi/icl.c Tue May 24 08:54:41 2016 (r300593) @@ -69,7 +69,7 @@ struct icl_softc { TAILQ_HEAD(, icl_module) sc_modules; }; -static int sysctl_kern_icl_drivers(SYSCTL_HANDLER_ARGS); +static int sysctl_kern_icl_offloads(SYSCTL_HANDLER_ARGS); static MALLOC_DEFINE(M_ICL, "icl", "iSCSI Common Layer"); static struct icl_softc *sc; @@ -77,13 +77,13 @@ SYSCTL_NODE(_kern, OID_AUTO, icl, CTLFLA int icl_debug = 1; SYSCTL_INT(_kern_icl, OID_AUTO, debug, CTLFLAG_RWTUN, &icl_debug, 0, "Enable debug messages"); -SYSCTL_PROC(_kern_icl, OID_AUTO, drivers, +SYSCTL_PROC(_kern_icl, OID_AUTO, offloads, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - NULL, 0, sysctl_kern_icl_drivers, "A", - "List of ICL drivers"); + NULL, 0, sysctl_kern_icl_offloads, "A", + "List of ICL modules"); static int -sysctl_kern_icl_drivers(SYSCTL_HANDLER_ARGS) +sysctl_kern_icl_offloads(SYSCTL_HANDLER_ARGS) { const struct icl_module *im; struct sbuf sb; From owner-svn-src-head@freebsd.org Tue May 24 09:23:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B329FB485F9; Tue, 24 May 2016 09:23:05 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83E4C1B11; Tue, 24 May 2016 09:23:05 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O9N4mT017098; Tue, 24 May 2016 09:23:04 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O9N4lU017097; Tue, 24 May 2016 09:23:04 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201605240923.u4O9N4lU017097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 24 May 2016 09:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300594 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 09:23:05 -0000 Author: kevlo Date: Tue May 24 09:23:04 2016 New Revision: 300594 URL: https://svnweb.freebsd.org/changeset/base/300594 Log: Add __iowrite32_copy() to the Linux kernel compatibility layer. Reviewed by: hselasky Modified: head/sys/compat/linuxkpi/common/include/linux/io.h Modified: head/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/io.h Tue May 24 08:54:41 2016 (r300593) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Tue May 24 09:23:04 2016 (r300594) @@ -202,6 +202,17 @@ void iounmap(void *addr); #define memcpy_toio(a, b, c) memcpy((a), (b), (c)) static inline void +__iowrite32_copy(void *to, void *from, size_t count) +{ + uint32_t *src; + uint32_t *dst; + int i; + + for (i = 0, src = from, dst = to; i < count; i++, src++, dst++) + __raw_writel(*src, dst); +} + +static inline void __iowrite64_copy(void *to, void *from, size_t count) { #ifdef __LP64__ @@ -212,13 +223,7 @@ __iowrite64_copy(void *to, void *from, s for (i = 0, src = from, dst = to; i < count; i++, src++, dst++) __raw_writeq(*src, dst); #else - uint32_t *src; - uint32_t *dst; - int i; - - count *= 2; - for (i = 0, src = from, dst = to; i < count; i++, src++, dst++) - __raw_writel(*src, dst); + __iowrite32_copy(to, from, count * 2); #endif } From owner-svn-src-head@freebsd.org Tue May 24 10:16:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F1B1B46331; Tue, 24 May 2016 10:16:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31B5E12CC; Tue, 24 May 2016 10:16:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OAG3Bg032330; Tue, 24 May 2016 10:16:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OAG3HR032329; Tue, 24 May 2016 10:16:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605241016.u4OAG3HR032329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 May 2016 10:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300595 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 10:16:04 -0000 Author: kib Date: Tue May 24 10:16:03 2016 New Revision: 300595 URL: https://svnweb.freebsd.org/changeset/base/300595 Log: Remove Giant around allocation of the swap pager with non-NULL handle. Existing issue of not protecting pager_object_list iteration in vm_pager_object_lookup() by sw_alloc_mtx is not affected by Giant removal. Reviewed by: alc Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue May 24 09:23:04 2016 (r300594) +++ head/sys/vm/swap_pager.c Tue May 24 10:16:03 2016 (r300595) @@ -604,7 +604,6 @@ swap_pager_alloc(void *handle, vm_ooffse pindex = OFF_TO_IDX(offset + PAGE_MASK + size); if (handle) { - mtx_lock(&Giant); /* * Reference existing named region or allocate new one. There * should not be a race here against swp_pager_meta_build() @@ -617,7 +616,6 @@ swap_pager_alloc(void *handle, vm_ooffse if (cred != NULL) { if (!swap_reserve_by_cred(size, cred)) { sx_xunlock(&sw_alloc_sx); - mtx_unlock(&Giant); return (NULL); } crhold(cred); @@ -633,7 +631,6 @@ swap_pager_alloc(void *handle, vm_ooffse VM_OBJECT_WUNLOCK(object); } sx_xunlock(&sw_alloc_sx); - mtx_unlock(&Giant); } else { if (cred != NULL) { if (!swap_reserve_by_cred(size, cred)) From owner-svn-src-head@freebsd.org Tue May 24 10:21:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C591B46503; Tue, 24 May 2016 10:21:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 443E716DE; Tue, 24 May 2016 10:21:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OALd4m035136; Tue, 24 May 2016 10:21:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OALd9a035135; Tue, 24 May 2016 10:21:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605241021.u4OALd9a035135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 May 2016 10:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300596 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 10:21:40 -0000 Author: kib Date: Tue May 24 10:21:39 2016 New Revision: 300596 URL: https://svnweb.freebsd.org/changeset/base/300596 Log: In vm_page_alloc_contig(), on vm_page_insert() failure, mark each freed page as VPO_UNMANAGED. Otherwise vm_pge_free_toq() insists on owning the page lock. Previously, VPO_UNMANAGED was only set up to the last processed page. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue May 24 10:16:03 2016 (r300595) +++ head/sys/vm/vm_page.c Tue May 24 10:21:39 2016 (r300596) @@ -1944,8 +1944,10 @@ retry: m < &m_ret[npages]; m++) { if ((req & VM_ALLOC_WIRED) != 0) m->wire_count = 0; - if (m >= m_tmp) + if (m >= m_tmp) { m->object = NULL; + m->oflags |= VPO_UNMANAGED; + } vm_page_free(m); } return (NULL); From owner-svn-src-head@freebsd.org Tue May 24 11:44:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C311B43027; Tue, 24 May 2016 11:44:44 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C7CC1A53; Tue, 24 May 2016 11:44:44 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OBihGu060387; Tue, 24 May 2016 11:44:43 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OBih30060386; Tue, 24 May 2016 11:44:43 GMT (envelope-from des@FreeBSD.org) Message-Id: <201605241144.u4OBih30060386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 24 May 2016 11:44:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300602 - head/lib/libradius X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 11:44:44 -0000 Author: des Date: Tue May 24 11:44:43 2016 New Revision: 300602 URL: https://svnweb.freebsd.org/changeset/base/300602 Log: The NAS-Identifier attribute is a string, not an integer. MFC after: 1 week Modified: head/lib/libradius/radlib.h Modified: head/lib/libradius/radlib.h ============================================================================== --- head/lib/libradius/radlib.h Tue May 24 10:46:23 2016 (r300601) +++ head/lib/libradius/radlib.h Tue May 24 11:44:43 2016 (r300602) @@ -98,7 +98,7 @@ #define RAD_TERMINATION_ACTION 29 /* Integer */ #define RAD_CALLED_STATION_ID 30 /* String */ #define RAD_CALLING_STATION_ID 31 /* String */ -#define RAD_NAS_IDENTIFIER 32 /* Integer */ +#define RAD_NAS_IDENTIFIER 32 /* String */ #define RAD_PROXY_STATE 33 /* Integer */ #define RAD_LOGIN_LAT_SERVICE 34 /* Integer */ #define RAD_LOGIN_LAT_NODE 35 /* Integer */ From owner-svn-src-head@freebsd.org Tue May 24 11:47:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65A6EB431E4; Tue, 24 May 2016 11:47:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35F8C1CC9; Tue, 24 May 2016 11:47:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OBlETB060514; Tue, 24 May 2016 11:47:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OBlEVc060513; Tue, 24 May 2016 11:47:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605241147.u4OBlEVc060513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 24 May 2016 11:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300603 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 11:47:15 -0000 Author: tuexen Date: Tue May 24 11:47:14 2016 New Revision: 300603 URL: https://svnweb.freebsd.org/changeset/base/300603 Log: Allow an MTU of 65535 bytes to be set via TUN[SG]IFINFO. This requires changing the type on the mtu field in struct tuninfo from short to unsigned short. This is used, for example, by packetdrill to test with MTUs up to the maximum value. Differential Revision: 6452 Modified: head/sys/net/if_tun.h Modified: head/sys/net/if_tun.h ============================================================================== --- head/sys/net/if_tun.h Tue May 24 11:44:43 2016 (r300602) +++ head/sys/net/if_tun.h Tue May 24 11:47:14 2016 (r300603) @@ -25,11 +25,11 @@ #define TUNMTU 1500 /* Maximum receive packet size (hard limit) */ -#define TUNMRU 16384 +#define TUNMRU 65535 struct tuninfo { int baudrate; /* linespeed */ - short mtu; /* maximum transmission unit */ + unsigned short mtu; /* maximum transmission unit */ u_char type; /* ethernet, tokenring, etc. */ u_char dummy; /* place holder */ }; From owner-svn-src-head@freebsd.org Tue May 24 12:06:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 208DDB43E05; Tue, 24 May 2016 12:06:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E55991987; Tue, 24 May 2016 12:06:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OC6vQk066393; Tue, 24 May 2016 12:06:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OC6vxt066392; Tue, 24 May 2016 12:06:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605241206.u4OC6vxt066392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 24 May 2016 12:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300604 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 12:06:58 -0000 Author: andrew Date: Tue May 24 12:06:56 2016 New Revision: 300604 URL: https://svnweb.freebsd.org/changeset/base/300604 Log: Limit calling pmc_hook to when the interrupt comes while running userspace. We may enable interrupts from within the callback, e.g. in a data abort during copyin. If we receive an interrupt at that time pmc_hook will be called again and, as it is handling userspace stack tracing, will hit a KASSERT as it checks if the trapframe is from userland. With this I can run hwpmc with intrng on a ThunderX and have it trace all CPUs. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/subr_intr.c Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Tue May 24 11:47:14 2016 (r300603) +++ head/sys/kern/subr_intr.c Tue May 24 12:06:56 2016 (r300604) @@ -317,7 +317,8 @@ intr_irq_handler(struct trapframe *tf) td->td_intr_frame = oldframe; critical_exit(); #ifdef HWPMC_HOOKS - if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) + if (pmc_hook && TRAPF_USERMODE(tf) && + (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, tf); #endif } From owner-svn-src-head@freebsd.org Tue May 24 12:14:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D994EB43F93; Tue, 24 May 2016 12:14:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 828F61D72; Tue, 24 May 2016 12:14:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OCEJhP069473; Tue, 24 May 2016 12:14:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OCEJ9E069471; Tue, 24 May 2016 12:14:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605241214.u4OCEJ9E069471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 24 May 2016 12:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300605 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 12:14:21 -0000 Author: arybchik Date: Tue May 24 12:14:19 2016 New Revision: 300605 URL: https://svnweb.freebsd.org/changeset/base/300605 Log: sfxge(4): be ready to receive events immediately after event queues are created Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6507 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/efx_ev.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Tue May 24 12:06:56 2016 (r300604) +++ head/sys/dev/sfxge/common/ef10_ev.c Tue May 24 12:14:19 2016 (r300605) @@ -275,6 +275,11 @@ ef10_ev_qcreate( /* Set up the event queue */ irq = index; /* INIT_EVQ expects function-relative vector number */ + + /* + * Interrupts may be raised for events immediately after the queue is + * created. See bug58606. + */ if ((rc = efx_mcdi_init_evq(enp, index, esmp, n, irq)) != 0) goto fail3; Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Tue May 24 12:06:56 2016 (r300604) +++ head/sys/dev/sfxge/common/efx_ev.c Tue May 24 12:14:19 2016 (r300605) @@ -251,16 +251,27 @@ efx_ev_qcreate( eep->ee_mask = n - 1; eep->ee_esmp = esmp; - if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, eep)) != 0) - goto fail2; - + /* + * Set outputs before the queue is created because interrupts may be + * raised for events immediately after the queue is created, before the + * function call below returns. See bug58606. + * + * The eepp pointer passed in by the client must therefore point to data + * shared with the client's event processing context. + */ enp->en_ev_qcount++; *eepp = eep; + if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, eep)) != 0) + goto fail2; + return (0); fail2: EFSYS_PROBE(fail2); + + *eepp = NULL; + enp->en_ev_qcount--; EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_evq_t), eep); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-head@freebsd.org Tue May 24 12:15:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F0F7B47012; Tue, 24 May 2016 12:15:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5763A1EFE; Tue, 24 May 2016 12:15:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OCFUcF069558; Tue, 24 May 2016 12:15:30 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OCFUsZ069555; Tue, 24 May 2016 12:15:30 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605241215.u4OCFUsZ069555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 24 May 2016 12:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300606 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 12:15:31 -0000 Author: arybchik Date: Tue May 24 12:15:30 2016 New Revision: 300606 URL: https://svnweb.freebsd.org/changeset/base/300606 Log: sfxge(4): provide option to disable not a local MAC address check Option EFSYS_OPT_ALLOW_UNCONFIGURED_NIC disables check that the adapter MAC address is not a local address (beginning 02). Submitted by: Laurence Evans Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6508 Modified: head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Tue May 24 12:14:19 2016 (r300605) +++ head/sys/dev/sfxge/common/efsys.h Tue May 24 12:15:30 2016 (r300606) @@ -278,6 +278,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_LICENSING 0 +#define EFSYS_OPT_ALLOW_UNCONFIGURED_NIC 0 + /* ID */ typedef struct __efsys_identifier_s efsys_identifier_t; Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 24 12:14:19 2016 (r300605) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 24 12:15:30 2016 (r300606) @@ -334,5 +334,12 @@ # endif #endif /* EFSYS_OPT_LICENSING */ +/* Support adapters with missing static config (for factory use only) */ +#if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC +# if !EFSYS_OPT_MEDFORD +# error "ALLOW_UNCONFIGURED_NIC requires MEDFORD" +# endif +#endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ + #endif /* _SYS_EFX_CHECK_H */ Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Tue May 24 12:14:19 2016 (r300605) +++ head/sys/dev/sfxge/common/medford_nic.c Tue May 24 12:15:30 2016 (r300606) @@ -180,6 +180,12 @@ medford_board_cfg( /* MAC address for this function */ if (EFX_PCI_FUNCTION_IS_PF(encp)) { rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); +#if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC + /* Disable static config checking for Medford NICs, ONLY + * for manufacturing test and setup at the factory, to + * allow the static config to be installed. + */ +#else /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ if ((rc == 0) && (mac_addr[0] & 0x02)) { /* * If the static config does not include a global MAC @@ -189,6 +195,7 @@ medford_board_cfg( */ rc = EINVAL; } +#endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ } else { rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); } From owner-svn-src-head@freebsd.org Tue May 24 12:17:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 657DCB47093; Tue, 24 May 2016 12:17:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 027AB10B0; Tue, 24 May 2016 12:17:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OCH5uf069725; Tue, 24 May 2016 12:17:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OCGwMS069646; Tue, 24 May 2016 12:16:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605241216.u4OCGwMS069646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 24 May 2016 12:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300607 - in head: share/man/man4 sys/dev/sfxge 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 12:17:06 -0000 Author: arybchik Date: Tue May 24 12:16:57 2016 New Revision: 300607 URL: https://svnweb.freebsd.org/changeset/base/300607 Log: sfxge(4): cleanup: update copyright to 2016 Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6509 Modified: head/share/man/man4/sfxge.4 head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_intr.c head/sys/dev/sfxge/common/ef10_mac.c head/sys/dev/sfxge/common/ef10_mcdi.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/ef10_vpd.c head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_bootcfg.c head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_crc32.c head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_hash.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_intr.c head/sys/dev/sfxge/common/efx_lic.c head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/efx_mon.c head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/efx_phy.c head/sys/dev/sfxge/common/efx_phy_ids.h head/sys/dev/sfxge/common/efx_port.c head/sys/dev/sfxge/common/efx_regs.h head/sys/dev/sfxge/common/efx_regs_ef10.h head/sys/dev/sfxge/common/efx_regs_pci.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/efx_sram.c head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/efx_types.h head/sys/dev/sfxge/common/efx_vpd.c head/sys/dev/sfxge/common/efx_wol.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/hunt_phy.c head/sys/dev/sfxge/common/mcdi_mon.c head/sys/dev/sfxge/common/mcdi_mon.h head/sys/dev/sfxge/common/medford_impl.h head/sys/dev/sfxge/common/medford_nic.c head/sys/dev/sfxge/common/siena_flash.h head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_mac.c head/sys/dev/sfxge/common/siena_mcdi.c head/sys/dev/sfxge/common/siena_nic.c head/sys/dev/sfxge/common/siena_nvram.c head/sys/dev/sfxge/common/siena_phy.c head/sys/dev/sfxge/common/siena_sram.c head/sys/dev/sfxge/common/siena_vpd.c 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_ioc.h head/sys/dev/sfxge/sfxge_mcdi.c head/sys/dev/sfxge/sfxge_nvram.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 head/sys/dev/sfxge/sfxge_version.h Modified: head/share/man/man4/sfxge.4 ============================================================================== --- head/share/man/man4/sfxge.4 Tue May 24 12:15:30 2016 (r300606) +++ head/share/man/man4/sfxge.4 Tue May 24 12:16:57 2016 (r300607) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2015 Solarflare Communications Inc. +.\" Copyright (c) 2011-2016 Solarflare Communications Inc. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/ef10_ev.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/ef10_filter.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/ef10_impl.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Solarflare Communications Inc. + * Copyright (c) 2015-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/ef10_intr.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_intr.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/ef10_intr.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/ef10_mac.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/ef10_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mcdi.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/ef10_mcdi.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/ef10_nic.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/ef10_nvram.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/ef10_phy.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/ef10_rx.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/ef10_tx.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/ef10_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_vpd.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/ef10_vpd.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efsys.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications Inc. + * Copyright (c) 2010-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by Philip Paeps under contract for Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006-2015 Solarflare Communications Inc. + * Copyright (c) 2006-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_crc32.c ============================================================================== --- head/sys/dev/sfxge/common/efx_crc32.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_crc32.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015 Solarflare Communications Inc. + * Copyright (c) 2013-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_ev.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_filter.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_hash.c ============================================================================== --- head/sys/dev/sfxge/common/efx_hash.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_hash.c Tue May 24 12:16:57 2016 (r300607) @@ -10,7 +10,7 @@ * ...You can use this free for any purpose. It's in the public domain. * It has no warranty." * - * Copyright (c) 2014-2015 Solarflare Communications Inc. + * Copyright (c) 2014-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_impl.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_intr.c ============================================================================== --- head/sys/dev/sfxge/common/efx_intr.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_intr.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_lic.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_mac.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2008-2015 Solarflare Communications Inc. + * Copyright (c) 2008-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_mcdi.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_mon.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_nic.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_nvram.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_phy.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_phy_ids.h ============================================================================== --- head/sys/dev/sfxge/common/efx_phy_ids.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_phy_ids.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015 Solarflare Communications Inc. + * Copyright (c) 2013-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_port.c ============================================================================== --- head/sys/dev/sfxge/common/efx_port.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_port.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_regs.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_regs.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_regs_ef10.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_ef10.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_regs_ef10.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_regs_pci.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_pci.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_regs_pci.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_rx.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_sram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_sram.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_sram.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_tx.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_types.h ============================================================================== --- head/sys/dev/sfxge/common/efx_types.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_types.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/efx_vpd.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_vpd.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/efx_wol.c ============================================================================== --- head/sys/dev/sfxge/common/efx_wol.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/efx_wol.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/hunt_nic.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/hunt_phy.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_phy.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/hunt_phy.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/mcdi_mon.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/mcdi_mon.h ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/mcdi_mon.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/medford_impl.h ============================================================================== --- head/sys/dev/sfxge/common/medford_impl.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/medford_impl.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Solarflare Communications Inc. + * Copyright (c) 2015-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/medford_nic.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Solarflare Communications Inc. + * Copyright (c) 2015-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/siena_flash.h ============================================================================== --- head/sys/dev/sfxge/common/siena_flash.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/siena_flash.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2015 Solarflare Communications Inc. + * Copyright (c) 2007-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/siena_impl.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/siena_mac.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mac.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/siena_mac.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/siena_mcdi.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/siena_nic.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/siena_nvram.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/siena_phy.c ============================================================================== --- head/sys/dev/sfxge/common/siena_phy.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/siena_phy.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/siena_sram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_sram.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/siena_sram.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/siena_vpd.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/common/siena_vpd.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2015 Solarflare Communications Inc. + * Copyright (c) 2009-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications Inc. + * Copyright (c) 2010-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by Philip Paeps under contract for Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications Inc. + * Copyright (c) 2010-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by Philip Paeps under contract for Modified: head/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- head/sys/dev/sfxge/sfxge_dma.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge_dma.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications Inc. + * Copyright (c) 2010-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by Philip Paeps under contract for Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge_ev.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications Inc. + * Copyright (c) 2010-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by Philip Paeps under contract for Modified: head/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- head/sys/dev/sfxge/sfxge_intr.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge_intr.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications Inc. + * Copyright (c) 2010-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by Philip Paeps under contract for Modified: head/sys/dev/sfxge/sfxge_ioc.h ============================================================================== --- head/sys/dev/sfxge/sfxge_ioc.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge_ioc.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2015 Solarflare Communications Inc. + * Copyright (c) 2014-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/sfxge/sfxge_mcdi.c ============================================================================== --- head/sys/dev/sfxge/sfxge_mcdi.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge_mcdi.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications Inc. + * Copyright (c) 2010-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by Philip Paeps under contract for Modified: head/sys/dev/sfxge/sfxge_nvram.c ============================================================================== --- head/sys/dev/sfxge/sfxge_nvram.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge_nvram.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications, Inc. + * Copyright (c) 2010-2016 Solarflare Communications, Inc. * All rights reserved. * * This software was developed in part by OKTET Labs Ltd. under contract for Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge_port.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications Inc. + * Copyright (c) 2010-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by Philip Paeps under contract for Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge_rx.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications Inc. + * Copyright (c) 2010-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by Philip Paeps under contract for Modified: head/sys/dev/sfxge/sfxge_rx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge_rx.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications Inc. + * Copyright (c) 2010-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by Philip Paeps under contract for Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge_tx.c Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications Inc. + * Copyright (c) 2010-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by Philip Paeps under contract for Modified: head/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge_tx.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2015 Solarflare Communications Inc. + * Copyright (c) 2010-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by Philip Paeps under contract for Modified: head/sys/dev/sfxge/sfxge_version.h ============================================================================== --- head/sys/dev/sfxge/sfxge_version.h Tue May 24 12:15:30 2016 (r300606) +++ head/sys/dev/sfxge/sfxge_version.h Tue May 24 12:16:57 2016 (r300607) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Solarflare Communications Inc. + * Copyright (c) 2015-2016 Solarflare Communications Inc. * All rights reserved. * * This software was developed in part by OKTET Labs under contract for From owner-svn-src-head@freebsd.org Tue May 24 12:19:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45CB8B47173; Tue, 24 May 2016 12:19:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 133981286; Tue, 24 May 2016 12:19:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OCJFW6069842; Tue, 24 May 2016 12:19:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OCJFOZ069841; Tue, 24 May 2016 12:19:15 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605241219.u4OCJFOZ069841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 24 May 2016 12:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300608 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 12:19:16 -0000 Author: arybchik Date: Tue May 24 12:19:14 2016 New Revision: 300608 URL: https://svnweb.freebsd.org/changeset/base/300608 Log: sfxge(4): bump driver version to the closest out-of-tree version Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/sfxge_version.h Modified: head/sys/dev/sfxge/sfxge_version.h ============================================================================== --- head/sys/dev/sfxge/sfxge_version.h Tue May 24 12:16:57 2016 (r300607) +++ head/sys/dev/sfxge/sfxge_version.h Tue May 24 12:19:14 2016 (r300608) @@ -36,6 +36,6 @@ #ifndef _SFXGE_VERSION_H #define _SFXGE_VERSION_H -#define SFXGE_VERSION_STRING "v4.8.0.1019" +#define SFXGE_VERSION_STRING "v4.8.0.1071" #endif /* _SFXGE_DRIVER_VERSION_H */ From owner-svn-src-head@freebsd.org Tue May 24 12:20:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EB1EB471F4; Tue, 24 May 2016 12:20:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BE5F1478; Tue, 24 May 2016 12:20:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OCKOJb069936; Tue, 24 May 2016 12:20:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OCKO1C069934; Tue, 24 May 2016 12:20:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605241220.u4OCKO1C069934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 24 May 2016 12:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300609 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 12:20:25 -0000 Author: arybchik Date: Tue May 24 12:20:23 2016 New Revision: 300609 URL: https://svnweb.freebsd.org/changeset/base/300609 Log: sfxge(4): enable Medford support Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6510 Modified: head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/sfxge.c Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Tue May 24 12:19:14 2016 (r300608) +++ head/sys/dev/sfxge/common/efsys.h Tue May 24 12:20:23 2016 (r300609) @@ -238,7 +238,7 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_SIENA 1 #define EFSYS_OPT_HUNTINGTON 1 -#define EFSYS_OPT_MEDFORD 0 +#define EFSYS_OPT_MEDFORD 1 #ifdef DEBUG #define EFSYS_OPT_CHECK_REG 1 #else Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Tue May 24 12:19:14 2016 (r300608) +++ head/sys/dev/sfxge/sfxge.c Tue May 24 12:20:23 2016 (r300609) @@ -1150,6 +1150,11 @@ sfxge_probe(device_t dev) return (0); } + if (family == EFX_FAMILY_MEDFORD) { + device_set_desc(dev, "Solarflare SFC9200 family"); + return (0); + } + DBGPRINT(dev, "impossible controller family %d", family); return (ENXIO); } From owner-svn-src-head@freebsd.org Tue May 24 12:20:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D717B47326; Tue, 24 May 2016 12:20:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id CB8DB1748; Tue, 24 May 2016 12:20:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id BC6964295DC; Tue, 24 May 2016 22:20:41 +1000 (AEST) Date: Tue, 24 May 2016 22:20:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kevin Lo cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300423 - in head/sys: fs/ext2fs ufs/ffs In-Reply-To: <201605221431.u4MEVKXC007524@repo.freebsd.org> Message-ID: <20160524195127.C931@besplex.bde.org> References: <201605221431.u4MEVKXC007524@repo.freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=QENDHu2xUf8jxPyttf4A:9 a=TjCIVPREPFfoBbfk:21 a=UyK6-i59gRvh9EqX:21 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 12:20:50 -0000 On Sun, 22 May 2016, Kevin Lo wrote: > Log: > arc4random() returns 0 to (2**32)=E2=88=921, use an alternative to initi= alize > i_gen if it's zero rather than a divide by 2. > > With inputs from delphij, mckusick, rmacklem > > Reviewed by:=09mckusick > ... > Modified: head/sys/fs/ext2fs/ext2_alloc.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/fs/ext2fs/ext2_alloc.c=09Sun May 22 14:13:20 2016=09(r300422= ) > +++ head/sys/fs/ext2fs/ext2_alloc.c=09Sun May 22 14:31:20 2016=09(r300423= ) > @@ -408,7 +408,8 @@ ext2_valloc(struct vnode *pvp, int mode, > =09/* > =09 * Set up a new generation number for this inode. > =09 */ > -=09ip->i_gen =3D arc4random(); > +=09while (ip->i_gen =3D=3D 0 || ++ip->i_gen =3D=3D 0) > +=09=09ip->i_gen =3D arc4random(); This is a correct implementation of ffs's intended method, but ffs's intended method is wrong (see below for its wrongness). Correctness depends on i_gen having type uint32_t in ext2fs. This makes the code +ip_i_gen undead, so i_gen is re-randomized occasionally (averaged over all inodes, once for every ~2 billionth reuse of an inode, which is practically never. Bugs in ffs prevent it being done even that often there. So the re-randomization is almost useless. I think it is slighty worse than useless, since it may give the same i_gen immediately, while always incrementing (but skipping 0) always gives a new i_gen. ext2fs might not need this at all. For ffs, then special case of i_gen =3D=3D 0 must be handled because we still pretend to support file systems created by newfs versions almost 25 years old. newfs didn't initialize di_gen back then, so all inodes started with di_gen =3D=3D 0. ext2fs is less that 25 years old, so it has less history to support. > > =09vfs_timestamp(&ts); > =09ip->i_birthtime =3D ts.tv_sec; > > Modified: head/sys/fs/ext2fs/ext2_vfsops.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/fs/ext2fs/ext2_vfsops.c=09Sun May 22 14:13:20 2016=09(r30042= 2) > +++ head/sys/fs/ext2fs/ext2_vfsops.c=09Sun May 22 14:31:20 2016=09(r30042= 3) > @@ -998,7 +998,8 @@ ext2_vget(struct mount *mp, ino_t ino, i > =09 * already have one. This should only happen on old filesystems. > =09 */ > =09if (ip->i_gen =3D=3D 0) { > -=09=09ip->i_gen =3D random() + 1; > +=09=09while (ip->i_gen =3D=3D 0) > +=09=09=09ip->i_gen =3D arc4random(); This is correct, but might be unnecessary (see above). "on old filesystems= " was copied from ffs where it meant "on file systems created by versions of newfs that didn't initialize di_gen". Such file systems are restricted to ffs1. But i_gen stil occurs due to bugs in newfs -- it is missing this loop, so it sometimes sets i_gen to the random value of 1, and we can't/don= 't tell the difference between this and unitialized. I think ext2fs is more like ffs2 in a relevant way here. Both have the feature of speeding up newfs by only writing a few inodes. Thus most inode allocations occur in the kernel, and it hardly matters if newfs initialized i_gen for the few inodes that it initialized. extfs and ext2fs also have an inode non-clearing feature on unlink that might be relevant. I forget if ffs2 has this. So the code should be simplified by never expecting newfs to initialize i_gen to nonzero. It already almost does this, except in the comment. For this, it is necessary to skip i_gen =3D=3D 0 (mod 2**32). > =09=09if ((vp->v_mount->mnt_flag & MNT_RDONLY) =3D=3D 0) > =09=09=09ip->i_flag |=3D IN_MODIFIED; > =09} > > Modified: head/sys/ufs/ffs/ffs_alloc.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/ufs/ffs/ffs_alloc.c=09Sun May 22 14:13:20 2016=09(r300422) > +++ head/sys/ufs/ffs/ffs_alloc.c=09Sun May 22 14:31:20 2016=09(r300423) > @@ -1102,8 +1102,8 @@ dup_alloc: > =09/* > =09 * Set up a new generation number for this inode. > =09 */ > -=09if (ip->i_gen =3D=3D 0 || ++ip->i_gen =3D=3D 0) > -=09=09ip->i_gen =3D arc4random() / 2 + 1; > +=09while (ip->i_gen =3D=3D 0 || ++ip->i_gen =3D=3D 0) > +=09=09ip->i_gen =3D arc4random(); This is broken due to an old type error. In ffs, i_gen has type uint64_t, so it is physically impossible for ++ip->i_gen to wrap to 0. (i_gen is initialized from di_gen, and that has type uint32_t, so i_gen is initially <=3D UINT32_MAX and it would take 584 years to wrap with the modest inode recycling period of 1 nanosecond.) So the above is an obfuscated way of writing: =09if (ip->i_gen =3D=3D 0) { =09=09/* =09=09 * This value means uninitialized (or a bug). Init now. =09=09 * The loop is to not have the usual bug here. =09=09 */ =09=09do =09=09=09ip->i_gen =3D arc4random(); =09=09while (ip->i_gen =3D=3D 0); =09} else =09=09ip->i_gen++; Now it is clear that i_gen can grow far above UINT32_MAX. But usually it doesn't. Growth above UINT32_MAX gets truncated when the vnode is recycled. Overflow occurs with i_gen is stored to di_gen, and growth resumes at a small truncated value. The type error gives truncation on most uses of i_gen: di_gen, ufid_gen and ueh_i_gen are all 32 bits. va_gen is 32-bits on 32-bit arches but is 64 bits on 64-bit arches. Various bugs result. The bugs are mostly features. It is not very useful to re-randomize on reaching the 32-bit boundary. The bugfeature normally avoids this. If i_gen were not truncated to 32 bits when the vnode is recycled (or on unmount), and if it were consistently truncated (that means, truncate it to 32 bits in va_gen on 64-bit arches), then the bugfeature would work perfectly. The top 32 bits in i_gen would then be unused except to record history for a few trillion years for most inodes. > =09DIP_SET(ip, i_gen, ip->i_gen); > =09if (fs->fs_magic =3D=3D FS_UFS2_MAGIC) { > =09=09vfs_timestamp(&ts); > @@ -2080,7 +2080,8 @@ gotit: > =09=09bzero(ibp->b_data, (int)fs->fs_bsize); > =09=09dp2 =3D (struct ufs2_dinode *)(ibp->b_data); > =09=09for (i =3D 0; i < INOPB(fs); i++) { > -=09=09=09dp2->di_gen =3D arc4random() / 2 + 1; > +=09=09=09while (dp2->di_gen =3D=3D 0) > +=09=09=09=09dp2->di_gen =3D arc4random(); This seems to be correct. It is only for the ffs2 case, and di_gen was initialized to 0 by the bzero(), but the while loop is easier to read that the more optimal do-while loop that I wrote above. > =09=09=09dp2++; > =09=09} > =09=09/* > > Modified: head/sys/ufs/ffs/ffs_vfsops.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/ufs/ffs/ffs_vfsops.c=09Sun May 22 14:13:20 2016=09(r300422) > +++ head/sys/ufs/ffs/ffs_vfsops.c=09Sun May 22 14:31:20 2016=09(r300423) > @@ -1768,7 +1768,8 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags > =09 * already have one. This should only happen on old filesystems. > =09 */ > =09if (ip->i_gen =3D=3D 0) { > -=09=09ip->i_gen =3D arc4random() / 2 + 1; > +=09=09while (ip->i_gen =3D=3D 0) > +=09=09=09ip->i_gen =3D arc4random(); This also seems to be correct. Now the compiler can easily optimize the while loop to a do-while loop, since a previous check for i_gen =3D=3D 0 is visible. "should" in the comment is correct, except this should never happen now since file systems that were old when it was written now shouldn't exist. However, this does happen now, mostly for new file systems, due to a bug in newfs: newfs is missing this while loop, so it sometimes initializes di_gen to 0. Then we can't/don't tell if di_gen was initialized to a random value, so we-re-randomize it. > =09=09if ((vp->v_mount->mnt_flag & MNT_RDONLY) =3D=3D 0) { > =09=09=09ip->i_flag |=3D IN_MODIFIED; > =09=09=09DIP_SET(ip, i_gen, ip->i_gen); All versions of newfs seem to have had buggy initialization: - they didn't initialize di_gen (except to 0) until 1997 - the first 1997 version used /dev/urandom to initialize "long ret;". Assignment of this to "int32_t di_gen;" overflowed on 64-bit arches (alpha?). This gave a negative value which gave further overflows or suprising sign extensions mainly when assigned to "u_long va_gen'"; most other types were consistently signed. - the next 1997 version used random(). This fixed the generation of negative values. 0 was still generated - the 2003 version used arc4random(). This gave negative values again. 0 was still generated. This is essentially the current version. The current version uses a wrapper function like the first 1997 version. - newfs doesn't seem to have ever had the version that did *random() / 2 + = 1 like the kernel did. It thus escaped having the overflow/sign extension bugs that the kernel had. Dividing by 2 was apparently supposed to avoi= d these bugs. It worked with random() since random() returns at most INT32_MAX. But arc4random() returns at mist UINT32_MAX. Dividing this by 2 gives (u_int)INT32_MAX and adding 1 gives a value that overflows when assigned to int32_t. This was later fixed by changing lots of int32_t to uint32_t. I'm not sure about the security aspects of randomizing i_gen. The re- randomization is so accidental and infrequent that security must be unimportant. But I think a unique generation (over all inodes on all file systems) would be better than any randomness. FreeBSD-1 was closer to having that -- i_gen was initialized to the global nextgennumber++ if it was zero; it was not incremented for inode use. The globabl would have to be 64 bits now. Ensuring uniqueness is not easy since it means that you have to check inode numbers on not-very-trusted newly mounted file systems against all inode numbers already in use. Perhaps it works to always use a new set for every new mount (ignore the ones on disk). Bruce From owner-svn-src-head@freebsd.org Tue May 24 12:40:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D694DB47672; Tue, 24 May 2016 12:40:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B15810F9; Tue, 24 May 2016 12:40:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OCe3Bc076066; Tue, 24 May 2016 12:40:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OCe3Gc076065; Tue, 24 May 2016 12:40:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605241240.u4OCe3Gc076065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 24 May 2016 12:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300610 - head/sys/dev/ntb/if_ntb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 12:40:05 -0000 Author: mav Date: Tue May 24 12:40:03 2016 New Revision: 300610 URL: https://svnweb.freebsd.org/changeset/base/300610 Log: Re-enable write combining, disabled by default at r295486. if_ntb(4) strongly benefits from WC, improving throughput from 350Mbit/s to 8-10Gbit/s on my tests. MFC after: 1 week Modified: head/sys/dev/ntb/if_ntb/if_ntb.c Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Tue May 24 12:20:23 2016 (r300609) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Tue May 24 12:40:03 2016 (r300610) @@ -616,6 +616,10 @@ ntb_transport_probe(struct ntb_softc *nt mw->xlat_size = 0; mw->virt_addr = NULL; mw->dma_addr = 0; + + rc = ntb_mw_set_wc(nt->ntb, i, VM_MEMATTR_WRITE_COMBINING); + if (rc) + ntb_printf(0, "Unable to set mw%d caching\n", i); } qp_bitmap = ntb_db_valid_mask(ntb); From owner-svn-src-head@freebsd.org Tue May 24 13:57:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38F9DB4718C; Tue, 24 May 2016 13:57:25 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06562129B; Tue, 24 May 2016 13:57:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ODvOlp000802; Tue, 24 May 2016 13:57:24 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ODvOhp000801; Tue, 24 May 2016 13:57:24 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201605241357.u4ODvOhp000801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 24 May 2016 13:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300612 - head/sys/dev/an X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 13:57:25 -0000 Author: sbruno Date: Tue May 24 13:57:23 2016 New Revision: 300612 URL: https://svnweb.freebsd.org/changeset/base/300612 Log: Reject ioctl commands for FLSHGCHR and FLSHPCHR if the size is greater than sc->areq. This is a bounds check to ensure we're not just cramming arbitrarily sized nonsense into the driver and overflowing the heap. PR: 209545 Submitted by: cturt@hardenedbsd.org MFC after: 2 weeks Modified: head/sys/dev/an/if_an.c Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Tue May 24 13:57:23 2016 (r300611) +++ head/sys/dev/an/if_an.c Tue May 24 13:57:23 2016 (r300612) @@ -3749,6 +3749,9 @@ flashcard(struct ifnet *ifp, struct airo return ENOBUFS; break; case AIROFLSHGCHR: /* Get char from aux */ + if (l_ioctl->len > sizeof(sc->areq)) { + return -EINVAL; + } AN_UNLOCK(sc); status = copyin(l_ioctl->data, &sc->areq, l_ioctl->len); AN_LOCK(sc); @@ -3760,6 +3763,9 @@ flashcard(struct ifnet *ifp, struct airo else return -1; case AIROFLSHPCHR: /* Send char to card. */ + if (l_ioctl->len > sizeof(sc->areq)) { + return -EINVAL; + } AN_UNLOCK(sc); status = copyin(l_ioctl->data, &sc->areq, l_ioctl->len); AN_LOCK(sc); From owner-svn-src-head@freebsd.org Tue May 24 13:57:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A9F8B47189; Tue, 24 May 2016 13:57:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C841129A; Tue, 24 May 2016 13:57:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ODvNbZ000758; Tue, 24 May 2016 13:57:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ODvN7Q000757; Tue, 24 May 2016 13:57:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605241357.u4ODvN7Q000757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 24 May 2016 13:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300611 - head/sys/cddl/dev/dtrace/aarch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 13:57:24 -0000 Author: andrew Date: Tue May 24 13:57:23 2016 New Revision: 300611 URL: https://svnweb.freebsd.org/changeset/base/300611 Log: Mark all memory before the kernel as toxic to DTrace. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Tue May 24 12:40:03 2016 (r300610) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Tue May 24 13:57:23 2016 (r300611) @@ -120,7 +120,7 @@ void dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) { - printf("IMPLEMENT ME: dtrace_toxic_ranges\n"); + (*func)(0, (uintptr_t)VM_MIN_KERNEL_ADDRESS); } void From owner-svn-src-head@freebsd.org Tue May 24 13:58:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBC17B47253; Tue, 24 May 2016 13:58:08 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88E041746; Tue, 24 May 2016 13:58:08 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ODw7GC000887; Tue, 24 May 2016 13:58:07 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ODw7HL000886; Tue, 24 May 2016 13:58:07 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201605241358.u4ODw7HL000886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Tue, 24 May 2016 13:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300613 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 13:58:08 -0000 Author: skreuzer (doc,ports committer) Date: Tue May 24 13:58:07 2016 New Revision: 300613 URL: https://svnweb.freebsd.org/changeset/base/300613 Log: Bump copyright year Approved by: gjb@ (implicit) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 24 13:57:23 2016 (r300612) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 24 13:58:07 2016 (r300613) @@ -26,6 +26,7 @@ 2015 + 2016 The &os; Documentation Project From owner-svn-src-head@freebsd.org Tue May 24 13:59:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B466B4737A; Tue, 24 May 2016 13:59:15 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E15361A6D; Tue, 24 May 2016 13:59:14 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ODxEEb000968; Tue, 24 May 2016 13:59:14 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ODxE5a000967; Tue, 24 May 2016 13:59:14 GMT (envelope-from br@FreeBSD.org) Message-Id: <201605241359.u4ODxE5a000967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 24 May 2016 13:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300614 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 13:59:15 -0000 Author: br Date: Tue May 24 13:59:13 2016 New Revision: 300614 URL: https://svnweb.freebsd.org/changeset/base/300614 Log: Store the original value of stack pointer to the exception frame (the value we had before supervisor exception occurred). This helps consumers (e.g. DTrace) to not proceed additional calculations. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/riscv/riscv/exception.S Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Tue May 24 13:58:07 2016 (r300613) +++ head/sys/riscv/riscv/exception.S Tue May 24 13:59:13 2016 (r300614) @@ -93,7 +93,9 @@ __FBSDID("$FreeBSD$"); .if \el == 1 /* Store kernel sp */ - sd sp, (TF_SP)(sp) + li t1, TF_SIZE + add t0, sp, t1 + sd t0, (TF_SP)(sp) .else /* Store user sp */ csrr t0, sscratch From owner-svn-src-head@freebsd.org Tue May 24 14:34:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5B8BB47DD1; Tue, 24 May 2016 14:34:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2973104E; Tue, 24 May 2016 14:34:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OEYaUD013699; Tue, 24 May 2016 14:34:36 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OEYaZv013698; Tue, 24 May 2016 14:34:36 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605241434.u4OEYaZv013698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 24 May 2016 14:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300615 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 14:34:38 -0000 Author: trasz Date: Tue May 24 14:34:36 2016 New Revision: 300615 URL: https://svnweb.freebsd.org/changeset/base/300615 Log: Add kern.icl.iser_offloads sysctl. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Tue May 24 13:59:13 2016 (r300614) +++ head/sys/dev/iscsi/icl.c Tue May 24 14:34:36 2016 (r300615) @@ -79,20 +79,27 @@ SYSCTL_INT(_kern_icl, OID_AUTO, debug, C &icl_debug, 0, "Enable debug messages"); SYSCTL_PROC(_kern_icl, OID_AUTO, offloads, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - NULL, 0, sysctl_kern_icl_offloads, "A", + NULL, false, sysctl_kern_icl_offloads, "A", "List of ICL modules"); +SYSCTL_PROC(_kern_icl, OID_AUTO, iser_offloads, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, true, sysctl_kern_icl_offloads, "A", + "List of iSER ICL modules"); static int sysctl_kern_icl_offloads(SYSCTL_HANDLER_ARGS) { const struct icl_module *im; struct sbuf sb; + bool iser = arg2; int error; sbuf_new(&sb, NULL, 256, SBUF_AUTOEXTEND | SBUF_INCLUDENUL); sx_slock(&sc->sc_lock); TAILQ_FOREACH(im, &sc->sc_modules, im_next) { + if (im->im_iser != iser) + continue; if (im != TAILQ_FIRST(&sc->sc_modules)) sbuf_putc(&sb, ' '); sbuf_printf(&sb, "%s", im->im_name); From owner-svn-src-head@freebsd.org Tue May 24 14:47:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49739B481E0 for ; Tue, 24 May 2016 14:47:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm48-vm7.bullet.mail.bf1.yahoo.com (nm48-vm7.bullet.mail.bf1.yahoo.com [216.109.115.174]) (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 11A871A57 for ; Tue, 24 May 2016 14:47:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1464101240; bh=VySKh377OV8Nj1W8csiYM3fQNmLLxHpN9apdvgJmTk8=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=XOOf9wdM6qpQYAAQ35cnOPbPYEL3T1LFAL4FV7VP1GvG07XERekzm0fIgiPa1P7pG2PdLO41pVnMR+dbpka5kkBDLETmfC80uuoFzDbfdu47GzYu0aybimc0t5G7uFQMcfAmt5FBQG7rolJhtOvWnXvlCQilHRquOcLWZE0Mac7GXxkcii/TdtinY5uNhDBgZUlNOCTggQmOd0FcVmcCdtapxLdnu3LLgnOArI80itTo63p0vSQ+pMRRTwRF2iZt9MDPVFOsEwPvDGyYefTPrN0IBu3JW/Mg+eYoOeAhIZbyUK+KSLbvonHuAf9bxlGHpwyzYVnz3cv4FEAvuyzHKg== Received: from [66.196.81.171] by nm48.bullet.mail.bf1.yahoo.com with NNFMP; 24 May 2016 14:47:20 -0000 Received: from [68.142.230.72] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 24 May 2016 14:47:20 -0000 Received: from [127.0.0.1] by smtp229.mail.bf1.yahoo.com with NNFMP; 24 May 2016 14:47:20 -0000 X-Yahoo-Newman-Id: 543301.25536.bm@smtp229.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: FEjh0UQVM1kt_5UIkCeZS8ri1MvAaGtvhjCIhypCGqU6FV3 MGmDKiHm9qwYaw3zpNzOe654P7JQJKVU4_Dwxxt0_ny00MroEhFP7v8ssiYH QHtlZtYlhQ3T5OGyy9byPQoayvsELuLccbbrRKZ4_LAgr.znXOq9jdfen.Pt 01i5MlxjDUMsG1.OdpC50KLk890HKjwu8zQznwWSZyo3gCvaxSBRcHl0xMQv 2GGqvZl3QPbcyVeqJVoCWLh89moT1CYgF7H9L4ICXBM0XACUUR24Dnm8DA3r xv418uLhmFIv4eqLhV7DcGAkIHFuerFTR6oLvV4p4zaxIaQQLlDkeCtojymG _WxtqrVAWRXGJhpfeXV4LEmCY4gazUGGJTWovSmZvOEzp5z4ncuuat9EK3H4 u2IPOorq85N5HMN06KBdCGVXEqDBNKznDf827MgDhncjstZksKT6a1TnGGXm 25r5Y2mEVr1gjdW1IQDDbSh11w3Y_JkkTiojKhEnvjn_uGU06qjiF8zrgBx1 cREJZac8YOPMt5wL4iGXnQBpLRS5REOb1 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r300423 - in head/sys: fs/ext2fs ufs/ffs To: Bruce Evans , Kevin Lo References: <201605221431.u4MEVKXC007524@repo.freebsd.org> <20160524195127.C931@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: Date: Tue, 24 May 2016 09:47:38 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160524195127.C931@besplex.bde.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 14:47:28 -0000 On 05/24/16 07:20, Bruce Evans wrote: > On Sun, 22 May 2016, Kevin Lo wrote: > >> Log: >> arc4random() returns 0 to (2**32)−1, use an alternative to initialize >> i_gen if it's zero rather than a divide by 2. >> >> With inputs from delphij, mckusick, rmacklem >> >> Reviewed by: mckusick >> ... >> Modified: head/sys/fs/ext2fs/ext2_alloc.c >> ============================================================================== >> >> --- head/sys/fs/ext2fs/ext2_alloc.c Sun May 22 14:13:20 2016 >> (r300422) >> +++ head/sys/fs/ext2fs/ext2_alloc.c Sun May 22 14:31:20 2016 >> (r300423) >> @@ -408,7 +408,8 @@ ext2_valloc(struct vnode *pvp, int mode, >> /* >> * Set up a new generation number for this inode. >> */ >> - ip->i_gen = arc4random(); >> + while (ip->i_gen == 0 || ++ip->i_gen == 0) >> + ip->i_gen = arc4random(); > > This is a correct implementation of ffs's intended method, but ffs's > intended method is wrong (see below for its wrongness). > > Correctness depends on i_gen having type uint32_t in ext2fs. This > makes the code +ip_i_gen undead, so i_gen is re-randomized occasionally > (averaged over all inodes, once for every ~2 billionth reuse of an > inode, which is practically never. Bugs in ffs prevent it being done > even that often there. So the re-randomization is almost useless. I > think it is slighty worse than useless, since it may give the same > i_gen immediately, while always incrementing (but skipping 0) always > gives a new i_gen. > > ext2fs might not need this at all. For ffs, then special case of > i_gen == 0 must be handled because we still pretend to support file > systems created by newfs versions almost 25 years old. newfs didn't > initialize di_gen back then, so all inodes started with di_gen == 0. > ext2fs is less that 25 years old, so it has less history to support. > I agree ext2fs, and likely UFS2, can handle the case of di_gen == 0. The additional question is where do we actually need to do randomization in ext2fs? UFS does the randomization when formatting so ffs_vget doesn't do randomization at all. arc4random is AFAICT, only required for very old UFS1. I lost interest in ext2fs and can't be bothered to look in linux ;). >> >> vfs_timestamp(&ts); >> ip->i_birthtime = ts.tv_sec; >> >> Modified: head/sys/fs/ext2fs/ext2_vfsops.c >> ============================================================================== >> >> --- head/sys/fs/ext2fs/ext2_vfsops.c Sun May 22 14:13:20 2016 >> (r300422) >> +++ head/sys/fs/ext2fs/ext2_vfsops.c Sun May 22 14:31:20 2016 >> (r300423) >> @@ -998,7 +998,8 @@ ext2_vget(struct mount *mp, ino_t ino, i >> * already have one. This should only happen on old filesystems. >> */ >> if (ip->i_gen == 0) { >> - ip->i_gen = random() + 1; >> + while (ip->i_gen == 0) >> + ip->i_gen = arc4random(); > > This is correct, but might be unnecessary (see above). "on old > filesystems" > was copied from ffs where it meant "on file systems created by versions > of newfs that didn't initialize di_gen". Such file systems are restricted > to ffs1. But i_gen stil occurs due to bugs in newfs -- it is missing this > loop, so it sometimes sets i_gen to the random value of 1, and we > can't/don't > tell the difference between this and unitialized. > > I think ext2fs is more like ffs2 in a relevant way here. Both have the > feature of speeding up newfs by only writing a few inodes. Thus most > inode allocations occur in the kernel, and it hardly matters if newfs > initialized i_gen for the few inodes that it initialized. extfs and > ext2fs also have an inode non-clearing feature on unlink that might > be relevant. I forget if ffs2 has this. So the code should be simplified > by never expecting newfs to initialize i_gen to nonzero. It already > almost does this, except in the comment. For this, it is necessary to > skip i_gen == 0 (mod 2**32). > >> if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) >> ip->i_flag |= IN_MODIFIED; >> } >> >> Modified: head/sys/ufs/ffs/ffs_alloc.c >> ============================================================================== >> >> --- head/sys/ufs/ffs/ffs_alloc.c Sun May 22 14:13:20 2016 (r300422) >> +++ head/sys/ufs/ffs/ffs_alloc.c Sun May 22 14:31:20 2016 (r300423) >> @@ -1102,8 +1102,8 @@ dup_alloc: >> /* >> * Set up a new generation number for this inode. >> */ >> - if (ip->i_gen == 0 || ++ip->i_gen == 0) >> - ip->i_gen = arc4random() / 2 + 1; >> + while (ip->i_gen == 0 || ++ip->i_gen == 0) >> + ip->i_gen = arc4random(); > > This is broken due to an old type error. In ffs, i_gen has type uint64_t, > so it is physically impossible for ++ip->i_gen to wrap to 0. > (i_gen is initialized from di_gen, and that has type uint32_t, so > i_gen is initially <= UINT32_MAX and it would take 584 years to wrap > with the modest inode recycling period of 1 nanosecond.) > So the above is an obfuscated way of writing: > > if (ip->i_gen == 0) { > /* > * This value means uninitialized (or a bug). Init now. > * The loop is to not have the usual bug here. > */ > do > ip->i_gen = arc4random(); > while (ip->i_gen == 0); > } else > ip->i_gen++; > > Now it is clear that i_gen can grow far above UINT32_MAX. But usually > it doesn't. Growth above UINT32_MAX gets truncated when the vnode is > recycled. Overflow occurs with i_gen is stored to di_gen, and growth > resumes at a small truncated value. > > The type error gives truncation on most uses of i_gen: di_gen, ufid_gen > and ueh_i_gen are all 32 bits. va_gen is 32-bits on 32-bit arches but > is 64 bits on 64-bit arches. Various bugs result. The bugs are mostly > features. It is not very useful to re-randomize on reaching the 32-bit > boundary. The bugfeature normally avoids this. If i_gen were not > truncated to 32 bits when the vnode is recycled (or on unmount), and > if it were consistently truncated (that means, truncate it to 32 bits > in va_gen on 64-bit arches), then the bugfeature would work perfectly. > The top 32 bits in i_gen would then be unused except to record history > for a few trillion years for most inodes. > >> DIP_SET(ip, i_gen, ip->i_gen); >> if (fs->fs_magic == FS_UFS2_MAGIC) { >> vfs_timestamp(&ts); >> @@ -2080,7 +2080,8 @@ gotit: >> bzero(ibp->b_data, (int)fs->fs_bsize); >> dp2 = (struct ufs2_dinode *)(ibp->b_data); >> for (i = 0; i < INOPB(fs); i++) { >> - dp2->di_gen = arc4random() / 2 + 1; >> + while (dp2->di_gen == 0) >> + dp2->di_gen = arc4random(); > > This seems to be correct. It is only for the ffs2 case, and di_gen was > initialized to 0 by the bzero(), but the while loop is easier to read > that the more optimal do-while loop that I wrote above. > >> dp2++; >> } >> /* >> >> Modified: head/sys/ufs/ffs/ffs_vfsops.c >> ============================================================================== >> >> --- head/sys/ufs/ffs/ffs_vfsops.c Sun May 22 14:13:20 2016 >> (r300422) >> +++ head/sys/ufs/ffs/ffs_vfsops.c Sun May 22 14:31:20 2016 >> (r300423) >> @@ -1768,7 +1768,8 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags >> * already have one. This should only happen on old filesystems. >> */ >> if (ip->i_gen == 0) { >> - ip->i_gen = arc4random() / 2 + 1; >> + while (ip->i_gen == 0) >> + ip->i_gen = arc4random(); > > This also seems to be correct. Now the compiler can easily optimize the > while loop to a do-while loop, since a previous check for i_gen == 0 is > visible. > > "should" in the comment is correct, except this should never happen > now since file systems that were old when it was written now shouldn't > exist. However, this does happen now, mostly for new file systems, > due to a bug in newfs: newfs is missing this while loop, so it sometimes > initializes di_gen to 0. Then we can't/don't tell if di_gen was > initialized to a random value, so we-re-randomize it. > >> if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { >> ip->i_flag |= IN_MODIFIED; >> DIP_SET(ip, i_gen, ip->i_gen); > > All versions of newfs seem to have had buggy initialization: > - they didn't initialize di_gen (except to 0) until 1997 > - the first 1997 version used /dev/urandom to initialize "long ret;". > Assignment of this to "int32_t di_gen;" overflowed on 64-bit arches > (alpha?). This gave a negative value which gave further overflows > or suprising sign extensions mainly when assigned to "u_long va_gen'"; > most other types were consistently signed. > - the next 1997 version used random(). This fixed the generation of > negative values. 0 was still generated > - the 2003 version used arc4random(). This gave negative values again. > 0 was still generated. This is essentially the current version. The > current version uses a wrapper function like the first 1997 version. > - newfs doesn't seem to have ever had the version that did *random() / 2 > + 1 > like the kernel did. It thus escaped having the overflow/sign extension > bugs that the kernel had. Dividing by 2 was apparently supposed to avoid > these bugs. It worked with random() since random() returns at most > INT32_MAX. But arc4random() returns at mist UINT32_MAX. Dividing this > by 2 gives (u_int)INT32_MAX and adding 1 gives a value that overflows > when assigned to int32_t. This was later fixed by changing lots of > int32_t to uint32_t. > > I'm not sure about the security aspects of randomizing i_gen. The re- > randomization is so accidental and infrequent that security must be > unimportant. But I think a unique generation (over all inodes on all > file systems) would be better than any randomness. FreeBSD-1 was closer > to having that -- i_gen was initialized to the global nextgennumber++ if > it was zero; it was not incremented for inode use. The globabl would > have to be 64 bits now. Ensuring uniqueness is not easy since it means > that you have to check inode numbers on not-very-trusted newly mounted > file systems against all inode numbers already in use. Perhaps it works > to always use a new set for every new mount (ignore the ones on disk). > > Bruce Yes, I have always wondered: who is detecting if we have a repeated generation number, the end user? And then if we get a repeated generation number and try to fix it, how do we know that a new random value we generate to replace the duplicate is unused? I am rather afraid to hear the answers :-/. Pedro. From owner-svn-src-head@freebsd.org Tue May 24 15:39:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4784B48EA4; Tue, 24 May 2016 15:39:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD746147B; Tue, 24 May 2016 15:39:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OFdvI2032258; Tue, 24 May 2016 15:39:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OFdvFd032257; Tue, 24 May 2016 15:39:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605241539.u4OFdvFd032257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 24 May 2016 15:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300616 - head/sys/dev/bhnd/soc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 15:39:59 -0000 Author: adrian Date: Tue May 24 15:39:57 2016 New Revision: 300616 URL: https://svnweb.freebsd.org/changeset/base/300616 Log: [bhnd] fix compilation due to incompatible types Submitted by: Michael Zhilin Differential Revision: https://reviews.freebsd.org/D6532 Modified: head/sys/dev/bhnd/soc/bhnd_soc.c Modified: head/sys/dev/bhnd/soc/bhnd_soc.c ============================================================================== --- head/sys/dev/bhnd/soc/bhnd_soc.c Tue May 24 14:34:36 2016 (r300615) +++ head/sys/dev/bhnd/soc/bhnd_soc.c Tue May 24 15:39:57 2016 (r300616) @@ -216,7 +216,7 @@ bhnd_soc_is_hw_disabled(device_t dev, de return false; } -static int +static bhnd_attach_type bhnd_soc_get_attach_type(device_t dev, device_t child) { return (BHND_ATTACH_NATIVE); From owner-svn-src-head@freebsd.org Tue May 24 15:53:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDCF2B482AF; Tue, 24 May 2016 15:53:28 +0000 (UTC) (envelope-from jhb@freebsd.org) 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 CD8C31D6E; Tue, 24 May 2016 15:53:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DDCE0B978; Tue, 24 May 2016 11:53:26 -0400 (EDT) From: John Baldwin To: Alan Somers Cc: Peter Wemm , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r300557 - head/usr.sbin/apmd Date: Tue, 24 May 2016 08:52:32 -0700 Message-ID: <2084098.Ir36lcS1Gf@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201605240315.u4O3FkMt001717@repo.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); Tue, 24 May 2016 11:53:27 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 15:53:29 -0000 On Monday, May 23, 2016 09:24:41 PM Alan Somers wrote: > On Mon, May 23, 2016 at 9:15 PM, Peter Wemm wrote: > > > Author: peter > > Date: Tue May 24 03:15:46 2016 > > New Revision: 300557 > > URL: https://svnweb.freebsd.org/changeset/base/300557 > > > > Log: > > It seems is a new prerequisite for after > > r300539. Attempt to fix the build for i386. > > > > Modified: > > head/usr.sbin/apmd/apmd.c > > head/usr.sbin/apmd/apmdlex.l > > head/usr.sbin/apmd/apmdparse.y > > > > > Are you sure this is necessary, even after 300544? Actually, we try to avoid nested includes when possible for userland, so I'd be inclined to drop the nested include and just add to the places that need it. Userland code in the base system is supposed to have or as the first #include anyway (which apmd was not following), so any fixes to userland are probably style fixes anyway. -- John Baldwin From owner-svn-src-head@freebsd.org Tue May 24 16:30:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93E41B48ED8; Tue, 24 May 2016 16:30:06 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FF8B13A1; Tue, 24 May 2016 16:30:06 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OGU5TW047840; Tue, 24 May 2016 16:30:05 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OGU53d047839; Tue, 24 May 2016 16:30:05 GMT (envelope-from br@FreeBSD.org) Message-Id: <201605241630.u4OGU53d047839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 24 May 2016 16:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300617 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 16:30:06 -0000 Author: br Date: Tue May 24 16:30:05 2016 New Revision: 300617 URL: https://svnweb.freebsd.org/changeset/base/300617 Log: Set dependencies for genassym.c. This fixes non-parallel build. Modified: head/sys/conf/Makefile.riscv Modified: head/sys/conf/Makefile.riscv ============================================================================== --- head/sys/conf/Makefile.riscv Tue May 24 15:39:57 2016 (r300616) +++ head/sys/conf/Makefile.riscv Tue May 24 16:30:05 2016 (r300617) @@ -32,6 +32,9 @@ INCLUDES+= -I$S/contrib/libfdt CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls .endif +# hack because genassym.c includes sys/bus.h which includes these. +genassym.o: bus_if.h device_if.h + %BEFORE_DEPEND %OBJS From owner-svn-src-head@freebsd.org Tue May 24 16:41:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABAD2B480F8; Tue, 24 May 2016 16:41:39 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67E091B7E; Tue, 24 May 2016 16:41:39 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OGfcCj053473; Tue, 24 May 2016 16:41:38 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OGfbRq051549; Tue, 24 May 2016 16:41:37 GMT (envelope-from br@FreeBSD.org) Message-Id: <201605241641.u4OGfbRq051549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 24 May 2016 16:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300618 - in head: cddl/contrib/opensolaris/lib/libdtrace/common cddl/contrib/opensolaris/lib/libdtrace/riscv cddl/lib cddl/lib/libdtrace cddl/usr.sbin sys/cddl/contrib/opensolaris/uts/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 16:41:39 -0000 Author: br Date: Tue May 24 16:41:37 2016 New Revision: 300618 URL: https://svnweb.freebsd.org/changeset/base/300618 Log: Add initial DTrace support for RISC-V. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Added: head/cddl/contrib/opensolaris/lib/libdtrace/riscv/ head/cddl/contrib/opensolaris/lib/libdtrace/riscv/dt_isadep.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/riscv/ head/sys/cddl/contrib/opensolaris/uts/riscv/dtrace/ head/sys/cddl/contrib/opensolaris/uts/riscv/dtrace/fasttrap_isa.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/riscv/sys/ head/sys/cddl/contrib/opensolaris/uts/riscv/sys/fasttrap_isa.h (contents, props changed) head/sys/cddl/dev/dtrace/riscv/ head/sys/cddl/dev/dtrace/riscv/dtrace_asm.S (contents, props changed) head/sys/cddl/dev/dtrace/riscv/dtrace_isa.c (contents, props changed) head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c (contents, props changed) head/sys/cddl/dev/dtrace/riscv/regset.h (contents, props changed) head/sys/cddl/dev/fbt/riscv/ head/sys/cddl/dev/fbt/riscv/fbt_isa.c (contents, props changed) head/sys/cddl/dev/fbt/riscv/fbt_isa.h (contents, props changed) Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c head/cddl/lib/Makefile head/cddl/lib/libdtrace/Makefile head/cddl/usr.sbin/Makefile head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/dev/profile/profile.c head/sys/conf/files.riscv head/sys/riscv/include/frame.h head/sys/riscv/include/riscvreg.h head/sys/riscv/riscv/trap.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Tue May 24 16:30:05 2016 (r300617) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Tue May 24 16:41:37 2016 (r300618) @@ -250,6 +250,9 @@ printf("%s:%s(%d): DOODAD\n",__FUNCTION_ dofr[j].dofr_offset + 4; rel->r_info = ELF32_R_INFO(count + dep->de_global, R_PPC_REL32); +#elif defined(__riscv__) +/* XXX */ +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); #elif defined(__sparc) /* * Add 4 bytes to hit the low half of this 64-bit @@ -440,6 +443,8 @@ prepare_elf64(dtrace_hdl_t *dtp, const d dofr[j].dofr_offset; rel->r_info = ELF64_R_INFO(count + dep->de_global, R_PPC64_REL64); +#elif defined(__riscv__) +/* XXX */ #elif defined(__i386) || defined(__amd64) rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; @@ -935,7 +940,15 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, i return (0); } - +#elif defined(__riscv__) +/* XXX */ +static int +dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, + uint32_t *off) +{ +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); + return (0); +} #elif defined(__sparc) #define DT_OP_RET 0x81c7e008 Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Tue May 24 16:30:05 2016 (r300617) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Tue May 24 16:41:37 2016 (r300618) @@ -310,7 +310,8 @@ pfprint_fp(dtrace_hdl_t *dtp, FILE *fp, case sizeof (double): return (dt_printf(dtp, fp, format, *((double *)addr) / n)); -#if !defined(__arm__) && !defined(__powerpc__) && !defined(__mips__) +#if !defined(__arm__) && !defined(__powerpc__) && \ + !defined(__mips__) && !defined(__riscv__) case sizeof (long double): return (dt_printf(dtp, fp, format, *((long double *)addr) / ldn)); Added: head/cddl/contrib/opensolaris/lib/libdtrace/riscv/dt_isadep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/lib/libdtrace/riscv/dt_isadep.c Tue May 24 16:41:37 2016 (r300618) @@ -0,0 +1,139 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + * Copyright 2014 Howard Su + * Copyright 2015 George V. Neville-Neil + * Copyright 2015 Ruslan Bukin + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include +#include +#include + +#include +#include + +#if !defined(sun) +#include +#endif + +/*ARGSUSED*/ +int +dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp) +{ + + ftp->ftps_type = DTFTP_ENTRY; + ftp->ftps_pc = (uintptr_t)symp->st_value; + ftp->ftps_size = (size_t)symp->st_size; + ftp->ftps_noffs = 1; + ftp->ftps_offs[0] = 0; + + if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) { + dt_dprintf("fasttrap probe creation ioctl failed: %s\n", + strerror(errno)); + return (dt_set_errno(dtp, errno)); + } + + return (1); +} + +int +dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, uint64_t *stret) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + + return (DT_PROC_ERR); +} + +/*ARGSUSED*/ +int +dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, ulong_t off) +{ + + if (!ALIGNED_POINTER(off, 4)) + return (DT_PROC_ALIGN); + + ftp->ftps_type = DTFTP_OFFSETS; + ftp->ftps_pc = (uintptr_t)symp->st_value; + ftp->ftps_size = (size_t)symp->st_size; + ftp->ftps_noffs = 1; + ftp->ftps_offs[0] = off; + + if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) { + dt_dprintf("fasttrap probe creation ioctl failed: %s\n", + strerror(errno)); + return (dt_set_errno(dtp, errno)); + } + + return (1); +} + +/*ARGSUSED*/ +int +dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, const char *pattern) +{ + ulong_t i; + + ftp->ftps_type = DTFTP_OFFSETS; + ftp->ftps_pc = (uintptr_t)symp->st_value; + ftp->ftps_size = (size_t)symp->st_size; + ftp->ftps_noffs = 0; + + /* + * If we're matching against everything, just iterate through each + * instruction in the function, otherwise look for matching offset + * names by constructing the string and comparing it against the + * pattern. + */ + if (strcmp("*", pattern) == 0) { + for (i = 0; i < symp->st_size; i += 4) { + ftp->ftps_offs[ftp->ftps_noffs++] = i; + } + } else { + char name[sizeof (i) * 2 + 1]; + + for (i = 0; i < symp->st_size; i += 4) { + (void) sprintf(name, "%lx", i); + if (gmatch(name, pattern)) + ftp->ftps_offs[ftp->ftps_noffs++] = i; + } + } + + if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) { + dt_dprintf("fasttrap probe creation ioctl failed: %s\n", + strerror(errno)); + return (dt_set_errno(dtp, errno)); + } + + return (ftp->ftps_noffs); +} Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Tue May 24 16:30:05 2016 (r300617) +++ head/cddl/lib/Makefile Tue May 24 16:41:37 2016 (r300618) @@ -26,7 +26,7 @@ _libzpool= libzpool .endif .endif -.if ${MACHINE_CPUARCH} != "sparc64" && ${MACHINE_CPUARCH} != "riscv" +.if ${MACHINE_CPUARCH} != "sparc64" _drti= drti _libdtrace= libdtrace .endif Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Tue May 24 16:30:05 2016 (r300617) +++ head/cddl/lib/libdtrace/Makefile Tue May 24 16:41:37 2016 (r300618) @@ -95,6 +95,10 @@ CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/ut CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/powerpc +.elif ${MACHINE_CPUARCH} == "riscv" +CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/riscv +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/riscv +.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/riscv .elif ${MACHINE_CPUARCH} == "sparc64" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Tue May 24 16:30:05 2016 (r300617) +++ head/cddl/usr.sbin/Makefile Tue May 24 16:41:37 2016 (r300618) @@ -26,7 +26,8 @@ _lockstat= lockstat _plockstat= plockstat .endif -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ + ${MACHINE_CPUARCH} == "riscv" _dtrace= dtrace _lockstat= lockstat .endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue May 24 16:30:05 2016 (r300617) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue May 24 16:41:37 2016 (r300618) @@ -12026,7 +12026,7 @@ err: *factor = 1; #if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \ - defined(__mips__) || defined(__powerpc__) + defined(__mips__) || defined(__powerpc__) || defined(__riscv__) /* * FreeBSD isn't good at limiting the amount of memory we * ask to malloc, so let's place a limit here before trying Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Tue May 24 16:30:05 2016 (r300617) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Tue May 24 16:41:37 2016 (r300618) @@ -2495,6 +2495,16 @@ extern void dtrace_helpers_destroy(proc_ #define DTRACE_INVOP_SD 1 #define DTRACE_INVOP_LD 2 + +#elif defined(__riscv__) + +#define SD_RA_SP_MASK 0x1fff07f +#define SD_RA_SP 0x0113023 + +#define DTRACE_INVOP_SD 1 +#define DTRACE_INVOP_RET 2 +#define DTRACE_INVOP_NOP 3 + #endif #ifdef __cplusplus Added: head/sys/cddl/contrib/opensolaris/uts/riscv/dtrace/fasttrap_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/riscv/dtrace/fasttrap_isa.c Tue May 24 16:41:37 2016 (r300618) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * XXX: Placeholder for RISC-V fasttrap code + */ Added: head/sys/cddl/contrib/opensolaris/uts/riscv/sys/fasttrap_isa.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/riscv/sys/fasttrap_isa.h Tue May 24 16:41:37 2016 (r300618) @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _FASTTRAP_ISA_H +#define _FASTTRAP_ISA_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef uint32_t fasttrap_instr_t; + +/* XXX: Place for RISC-V fasttrap headers */ + +#ifdef __cplusplus +} +#endif + +#endif /* _FASTTRAP_ISA_H */ Added: head/sys/cddl/dev/dtrace/riscv/dtrace_asm.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/riscv/dtrace_asm.S Tue May 24 16:41:37 2016 (r300618) @@ -0,0 +1,176 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * Portions Copyright 2016 Ruslan Bukin + * + * $FreeBSD$ + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#define _ASM +#define _LOCORE + +#include +#include + +#include +#include + +#include "assym.s" + +/* +void dtrace_membar_producer(void) +*/ +ENTRY(dtrace_membar_producer) + RET +END(dtrace_membar_producer) + +/* +void dtrace_membar_consumer(void) +*/ +ENTRY(dtrace_membar_consumer) + RET +END(dtrace_membar_consumer) + +/* +dtrace_icookie_t dtrace_interrupt_disable(void) +*/ +ENTRY(dtrace_interrupt_disable) + csrci sstatus, 1 + RET +END(dtrace_interrupt_disable) + +/* +void dtrace_interrupt_enable(dtrace_icookie_t cookie) +*/ +ENTRY(dtrace_interrupt_enable) + csrsi sstatus, 1 + RET +END(dtrace_interrupt_enable) +/* +uint8_t +dtrace_fuword8_nocheck(void *addr) +*/ +ENTRY(dtrace_fuword8_nocheck) + lb a0, 0(a0) + RET +END(dtrace_fuword8_nocheck) + +/* +uint16_t +dtrace_fuword16_nocheck(void *addr) +*/ +ENTRY(dtrace_fuword16_nocheck) + lh a0, 0(a0) + RET +END(dtrace_fuword16_nocheck) + +/* +uint32_t +dtrace_fuword32_nocheck(void *addr) +*/ +ENTRY(dtrace_fuword32_nocheck) + lw a0, 0(a0) + RET +END(dtrace_fuword32_nocheck) + +/* +uint64_t +dtrace_fuword64_nocheck(void *addr) +*/ +ENTRY(dtrace_fuword64_nocheck) + ld a0, 0(a0) + RET +END(dtrace_fuword64_nocheck) + +/* +void +dtrace_copy(uintptr_t uaddr, uintptr_t kaddr, size_t size) +*/ +ENTRY(dtrace_copy) + beqz a2, 2f /* If len == 0 then skip loop */ +1: + lb a4, 0(a0) /* Load from uaddr */ + addi a0, a0, 1 + sb a4, 0(a1) /* Store in kaddr */ + addi a1, a1, 1 + addi a2, a2, -1 /* len-- */ + bnez a2, 1b +2: + RET +END(dtrace_copy) + +/* +void +dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +XXX: Check for flags? +*/ +ENTRY(dtrace_copystr) + beqz a2, 2f /* If len == 0 then skip loop */ + lb a4, 0(a0) /* Load from uaddr */ + addi a0, a0, 1 + sb a4, 0(a1) /* Store in kaddr */ + addi a1, a1, 1 + beqz a4, 2f /* If == 0 then break */ + addi a2, a2, -1 /* len-- */ + bnez a2, 1b +2: + RET +END(dtrace_copystr) + +/* +uintptr_t +dtrace_caller(int aframes) +*/ +ENTRY(dtrace_caller) + li a0, -1 + RET +END(dtrace_caller) + +/* +uint32_t +dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) +*/ +ENTRY(dtrace_cas32) +1: lr.w a3, 0(a0) /* Load target */ + bne a3, a1, 2f /* *target != cmp ? return */ + sc.w a4, a2, 0(a0) /* Store new to target */ + bnez a4, 1b /* Try again if store not succeed */ +2: mv a0, a3 /* Return the value loaded from target */ + RET +END(dtrace_cas32) + +/* +void * +dtrace_casptr(volatile void *target, volatile void *cmp, volatile void *new) +*/ +ENTRY(dtrace_casptr) +1: lr.d a3, 0(a0) /* Load target */ + bne a3, a1, 2f /* *target != cmp ? return */ + sc.d a4, a2, 0(a0) /* Store new to target */ + bnez a4, 1b /* Try again if store not succeed */ +2: mv a0, a3 /* Return the value loaded from target */ + RET +END(dtrace_casptr) Added: head/sys/cddl/dev/dtrace/riscv/dtrace_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/riscv/dtrace_isa.c Tue May 24 16:41:37 2016 (r300618) @@ -0,0 +1,394 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * Portions Copyright 2016 Ruslan Bukin + * + * $FreeBSD$ + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "regset.h" + +/* + * Wee need some reasonable default to prevent backtrace code + * from wandering too far + */ +#define MAX_FUNCTION_SIZE 0x10000 +#define MAX_PROLOGUE_SIZE 0x100 +#define MAX_USTACK_DEPTH 2048 + +uint8_t dtrace_fuword8_nocheck(void *); +uint16_t dtrace_fuword16_nocheck(void *); +uint32_t dtrace_fuword32_nocheck(void *); +uint64_t dtrace_fuword64_nocheck(void *); + +void +dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, + uint32_t *intrpc) +{ + struct unwind_state state; + int scp_offset; + register_t sp; + int depth; + + depth = 0; + + if (intrpc != 0) { + pcstack[depth++] = (pc_t) intrpc; + } + + aframes++; + + __asm __volatile("mv %0, sp" : "=&r" (sp)); + + state.fp = (uint64_t)__builtin_frame_address(0); + state.sp = sp; + state.pc = (uint64_t)dtrace_getpcstack; + + while (depth < pcstack_limit) { + if (unwind_frame(&state)) + break; + + if (!INKERNEL(state.pc) || !INKERNEL(state.fp)) + break; + + /* + * NB: Unlike some other architectures, we don't need to + * explicitly insert cpu_dtrace_caller as it appears in the + * normal kernel stack trace rather than a special trap frame. + */ + if (aframes > 0) { + aframes--; + } else { + pcstack[depth++] = state.pc; + } + + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} + +static int +dtrace_getustack_common(uint64_t *pcstack, int pcstack_limit, uintptr_t pc, + uintptr_t fp) +{ + volatile uint16_t *flags; + uintptr_t oldfp; + int ret; + + ret = 0; + flags = (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; + + ASSERT(pcstack == NULL || pcstack_limit > 0); + + while (pc != 0) { + /* + * We limit the number of times we can go around this + * loop to account for a circular stack. + */ + if (ret++ >= MAX_USTACK_DEPTH) { + *flags |= CPU_DTRACE_BADSTACK; + cpu_core[curcpu].cpuc_dtrace_illval = fp; + break; + } + + if (pcstack != NULL) { + *pcstack++ = (uint64_t)pc; + pcstack_limit--; + if (pcstack_limit <= 0) + break; + } + + if (fp == 0) + break; + + pc = dtrace_fuword64((void *)(fp + + offsetof(struct riscv_frame, f_retaddr))); + fp = dtrace_fuword64((void *)fp); + + if (fp == oldfp) { + *flags |= CPU_DTRACE_BADSTACK; + cpu_core[curcpu].cpuc_dtrace_illval = fp; + break; + } + } + + return (ret); +} + +void +dtrace_getupcstack(uint64_t *pcstack, int pcstack_limit) +{ + volatile uint16_t *flags; + struct trapframe *tf; + uintptr_t pc, sp, fp; + proc_t *p; + int n; + + p = curproc; + flags = (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; + + if (*flags & CPU_DTRACE_FAULT) + return; + + if (pcstack_limit <= 0) + return; + + /* + * If there's no user context we still need to zero the stack. + */ + if (p == NULL || (tf = curthread->td_frame) == NULL) + goto zero; + + *pcstack++ = (uint64_t)p->p_pid; + pcstack_limit--; + + if (pcstack_limit <= 0) + return; + + pc = tf->tf_sepc; + sp = tf->tf_sp; + fp = tf->tf_s[0]; + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + + *pcstack++ = (uint64_t)pc; + pcstack_limit--; + if (pcstack_limit <= 0) + return; + + pc = tf->tf_ra; + } + + n = dtrace_getustack_common(pcstack, pcstack_limit, pc, fp); + ASSERT(n >= 0); + ASSERT(n <= pcstack_limit); + + pcstack += n; + pcstack_limit -= n; + +zero: + while (pcstack_limit-- > 0) + *pcstack++ = 0; +} + +int +dtrace_getustackdepth(void) +{ + + printf("IMPLEMENT ME: %s\n", __func__); + + return (0); +} + +void +dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack, int pcstack_limit) +{ + + printf("IMPLEMENT ME: %s\n", __func__); +} + +/*ARGSUSED*/ +uint64_t +dtrace_getarg(int arg, int aframes) +{ + + printf("IMPLEMENT ME: %s\n", __func__); + + return (0); +} + +int +dtrace_getstackdepth(int aframes) +{ + struct unwind_state state; + int scp_offset; + register_t sp; + int depth; + int done; + + depth = 1; + done = 0; + + __asm __volatile("mv %0, sp" : "=&r" (sp)); + + state.fp = (uint64_t)__builtin_frame_address(0); + state.sp = sp; + state.pc = (uint64_t)dtrace_getstackdepth; + + do { + done = unwind_frame(&state); + if (!INKERNEL(state.pc) || !INKERNEL(state.fp)) + break; + depth++; + } while (!done); + + if (depth < aframes) + return (0); + else + return (depth - aframes); +} + +ulong_t +dtrace_getreg(struct trapframe *rp, uint_t reg) +{ + + printf("IMPLEMENT ME: %s\n", __func__); + + return (0); +} + +static int +dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) +{ + + if (uaddr + size > VM_MAXUSER_ADDRESS || uaddr + size < uaddr) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = uaddr; + return (0); + } + + return (1); +} + +void +dtrace_copyin(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +{ + + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copy(uaddr, kaddr, size); +} + +void +dtrace_copyout(uintptr_t kaddr, uintptr_t uaddr, size_t size, + volatile uint16_t *flags) +{ + + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copy(kaddr, uaddr, size); +} + +void +dtrace_copyinstr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +{ + + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copystr(uaddr, kaddr, size, flags); +} + +void +dtrace_copyoutstr(uintptr_t kaddr, uintptr_t uaddr, size_t size, + volatile uint16_t *flags) +{ + + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copystr(kaddr, uaddr, size, flags); +} + +uint8_t +dtrace_fuword8(void *uaddr) +{ + + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + + return (dtrace_fuword8_nocheck(uaddr)); +} + +uint16_t +dtrace_fuword16(void *uaddr) +{ + + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + + return (dtrace_fuword16_nocheck(uaddr)); +} + +uint32_t +dtrace_fuword32(void *uaddr) +{ + + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + + return (dtrace_fuword32_nocheck(uaddr)); +} + +uint64_t +dtrace_fuword64(void *uaddr) +{ + + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + + return (dtrace_fuword64_nocheck(uaddr)); +} Added: head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Tue May 24 16:41:37 2016 (r300618) @@ -0,0 +1,282 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * Portions Copyright 2016 Ruslan Bukin + * + * $FreeBSD$ + * + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern dtrace_id_t dtrace_probeid_error; +extern int (*dtrace_invop_jump_addr)(struct trapframe *); +extern void dtrace_getnanotime(struct timespec *tsp); + +int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); +void dtrace_invop_init(void); +void dtrace_invop_uninit(void); + +typedef struct dtrace_invop_hdlr { + int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); + struct dtrace_invop_hdlr *dtih_next; +} dtrace_invop_hdlr_t; + +dtrace_invop_hdlr_t *dtrace_invop_hdlr; + +int +dtrace_invop(uintptr_t addr, struct trapframe *frame, uintptr_t eax) +{ + dtrace_invop_hdlr_t *hdlr; + int rval; + + for (hdlr = dtrace_invop_hdlr; hdlr != NULL; hdlr = hdlr->dtih_next) + if ((rval = hdlr->dtih_func(addr, frame, eax)) != 0) + return (rval); + + return (0); +} + + +void +dtrace_invop_add(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue May 24 17:22:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0DD5B47147; Tue, 24 May 2016 17:22:14 +0000 (UTC) (envelope-from cschuber@gmail.com) Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com [IPv6:2607:f8b0:400e:c00::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82EC317ED; Tue, 24 May 2016 17:22:14 +0000 (UTC) (envelope-from cschuber@gmail.com) Received: by mail-pf0-x22e.google.com with SMTP id y69so8908647pfb.1; Tue, 24 May 2016 10:22:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:mime-version:from:subject:date:to:cc; bh=9t9JVIb3H92KtZbvTA4vMIMgAVMNd61J7TBpwahKkBg=; b=bN0d6bwyaK7YgdMT5yShoCJoReQWaeKx62airT+fSBzFEKe7xo6JQbDQCnTstk/T36 zsLmuuZiEfnCbBFdoPjcD8AMlFA1VTuIPiR1/oDLNptRi+LvAzNmy0Q4RoSaDAwvxAyd uss3g1d9SUKa89hjIK5ZPB77UaaO1dJmO1nR8tPazgHK9QAQEf99vB7mR2vpRzX1If/f WXKGqCzIGzHfXR13pd+LWM/D09OgBYWMACfFJ4+yKNETvNlHv6oHMB6kEEG0L9yMWOU/ Bq1XN/yQx6UNXIrYICYHgXYngcFRkMb3lBiw+wggWWcN7n2mToT7DJb/A5dyaPiZk+Gj y/eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:mime-version:from:subject:date:to:cc; bh=9t9JVIb3H92KtZbvTA4vMIMgAVMNd61J7TBpwahKkBg=; b=S4Aqi8FI0FDm3u1CsVtwt6qchdJOnT2b38D4v9p73/2f0Z7JjHg3AJlF/UUDAN60Yj wi3cQn/bS+LK/47sjxnRoBCYVTUddr/tb9qp8BylcnGhcg0ELDB2kGfxQxAPyDeF6EDR b7XVgw/hZqS7cAh+xPyu2x0ztZD6HK+O4vjPo1JejZGfBQLrD1W6nPJHMPChdDgjrUbw J328LAN1UueplGh5d4K8Rwi+rHWaFRrp837hXXjt3wEbHgsQ+l7tfFVz1n7wjn8iEx0R GUH2vuRBZapH141V9HxfSNP0UvLS4M5u4vwDkrg+3uX+GGLpEL8vtI8JcaTs3qhx9qUy aKAQ== X-Gm-Message-State: ALyK8tJ7ljK7Hf7PRhFoWBFegxEZa7T8odbX6/sVdoGiffQPqJQwzFTLgqScGnICTNTj2Q== X-Received: by 10.98.69.202 with SMTP id n71mr2775649pfi.82.1464110534004; Tue, 24 May 2016 10:22:14 -0700 (PDT) Received: from [25.88.35.112] (S0106d4ca6d8943b0.gv.shawcable.net. [24.68.134.59]) by smtp.gmail.com with ESMTPSA id w27sm55749017pfi.24.2016.05.24.10.22.12 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2016 10:22:12 -0700 (PDT) Message-ID: <57448dc4.1b0e620a.71bca.fffff8e1@mx.google.com> MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn commit: r300617 - head/sys/conf Date: Tue, 24 May 2016 10:22:16 -0700 To: Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" CC: Cy Schubert Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 17:22:14 -0000 >From the commit log it would appear that parallel builds worked whereas seq= uential (non-parallel) builds did not. That's kind of strange. Sent from my cellphone, ~Cy -----Original Message----- From: Ruslan Bukin Sent: 24/05/2016 09:30 To: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: svn commit: r300617 - head/sys/conf Author: br Date: Tue May 24 16:30:05 2016 New Revision: 300617 URL: https://svnweb.freebsd.org/changeset/base/300617 Log: Set dependencies for genassym.c. This fixes non-parallel build. Modified: head/sys/conf/Makefile.riscv Modified: head/sys/conf/Makefile.riscv =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- head/sys/conf/Makefile.riscv Tue May 24 15:39:57 2016 (r300616) +++ head/sys/conf/Makefile.riscv Tue May 24 16:30:05 2016 (r300617) @@ -32,6 +32,9 @@ INCLUDES+=3D -I$S/contrib/libfdt CFLAGS +=3D -fno-omit-frame-pointer -fno-optimize-sibling-calls .endif =20 +# hack because genassym.c includes sys/bus.h which includes these. +genassym.o: bus_if.h device_if.h + %BEFORE_DEPEND =20 %OBJS From owner-svn-src-head@freebsd.org Tue May 24 17:38:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17287B476B1; Tue, 24 May 2016 17:38:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC9BA10C6; Tue, 24 May 2016 17:38:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OHcSr8069441; Tue, 24 May 2016 17:38:28 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OHcScx069440; Tue, 24 May 2016 17:38:28 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605241738.u4OHcScx069440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 24 May 2016 17:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300619 - head/sys/cddl/dev/dtrace/aarch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 17:38:29 -0000 Author: bz Date: Tue May 24 17:38:27 2016 New Revision: 300619 URL: https://svnweb.freebsd.org/changeset/base/300619 Log: Try to unbreak the build after r300611 by including the header defining VM_MIN_KERNEL_ADDRESS. Sponsored by: DARPA/AFRL Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Tue May 24 16:41:37 2016 (r300618) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Tue May 24 17:38:27 2016 (r300619) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include extern dtrace_id_t dtrace_probeid_error; From owner-svn-src-head@freebsd.org Tue May 24 18:44:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73A45B4969D; Tue, 24 May 2016 18:44:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44FC513C4; Tue, 24 May 2016 18:44:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OIio8d090458; Tue, 24 May 2016 18:44:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OIioBp090457; Tue, 24 May 2016 18:44:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605241844.u4OIioBp090457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 24 May 2016 18:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300620 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 18:44:51 -0000 Author: ngie Date: Tue May 24 18:44:50 2016 New Revision: 300620 URL: https://svnweb.freebsd.org/changeset/base/300620 Log: Use reallocf instead of malloc to fix leak with outbuf_pmap The previous code overwrote outbuf_pmap's memory with malloc once per loop iteration, which leaked its memory; use reallocf instead to ensure that memory is properly free'd each loop iteration. Add a outbuf_pmap = NULL in the failure case to avoid a double-free at the bottom of the function. Differential Revision: https://reviews.freebsd.org/D6495 MFC after: 1 week Reported by: Coverity CID: 1038776 Reviewed by: markj, pfgj Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/clnt_bcast.c Modified: head/lib/libc/rpc/clnt_bcast.c ============================================================================== --- head/lib/libc/rpc/clnt_bcast.c Tue May 24 17:38:27 2016 (r300619) +++ head/lib/libc/rpc/clnt_bcast.c Tue May 24 18:44:50 2016 (r300620) @@ -346,7 +346,9 @@ rpc_broadcast_exp(rpcprog_t prog, rpcver #ifdef PORTMAP if (si.si_af == AF_INET && si.si_proto == IPPROTO_UDP) { udpbufsz = fdlist[fdlistno].dsize; - if ((outbuf_pmap = malloc(udpbufsz)) == NULL) { + outbuf_pmap = reallocf(outbuf_pmap, udpbufsz); + if (outbuf_pmap == NULL) { + outbuf_pmap = NULL; _close(fd); stat = RPC_SYSTEMERROR; goto done_broad; From owner-svn-src-head@freebsd.org Tue May 24 18:49:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E3ADB497AD; Tue, 24 May 2016 18:49:45 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com [209.85.213.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3436717CE; Tue, 24 May 2016 18:49:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ig0-f179.google.com with SMTP id bi2so57965970igb.0; Tue, 24 May 2016 11:49:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=XyybUbjp4dexNyh6is6Ftv5tPWL03EjGdDel4+jumV0=; b=fsfqYL0IYycHxV/iA8BYhy3ZwkeR1Iy4nHmkGAo0R++AhALMlXeKzC5FpRC5F1HhV4 WETOA7+PduIidFvElbzOZHC/H+u6f+OEws3TPX2lcRm4UMe/3l+Rdbm8ZI98Ubt47Rvb /wT02AAmQAlwKwHx/o3vy65N6vIT3GV1sNPDUOWERUc4zSSRoNlGbvSTXR54VBJPoWfL 1AnXRBHML552h/5OripwhdJt3EvQ6ye1ELPHNNXdXNOp5IddUeXRjdBCE5sdnEeQVgp4 gI5vUMkxjCBt71kd/AgymauzafzjZp60SU2aO3nYeGnghjgAv62yrRI+unaE+S5ISxTD 2ejA== X-Gm-Message-State: ALyK8tLemVHCPBAUAMpdv6hoEJE+NgQPJ04eoarSEBWpbNP53PybRoN2hU5D2+vp0Cr6mA== X-Received: by 10.50.108.109 with SMTP id hj13mr270106igb.96.1464115778627; Tue, 24 May 2016 11:49:38 -0700 (PDT) Received: from mail-ig0-f178.google.com (mail-ig0-f178.google.com. [209.85.213.178]) by smtp.gmail.com with ESMTPSA id u67sm1538142itd.1.2016.05.24.11.49.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 May 2016 11:49:38 -0700 (PDT) Received: by mail-ig0-f178.google.com with SMTP id l10so16056764igk.0; Tue, 24 May 2016 11:49:37 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.50.29.72 with SMTP id i8mr3489704igh.48.1464115777783; Tue, 24 May 2016 11:49:37 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Tue, 24 May 2016 11:49:37 -0700 (PDT) In-Reply-To: <201605241844.u4OIioBp090457@repo.freebsd.org> References: <201605241844.u4OIioBp090457@repo.freebsd.org> Date: Tue, 24 May 2016 11:49:37 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300620 - head/lib/libc/rpc From: Conrad Meyer To: Garrett Cooper Cc: 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 18:49:45 -0000 On Tue, May 24, 2016 at 11:44 AM, Garrett Cooper wrote: > Author: ngie > Date: Tue May 24 18:44:50 2016 > New Revision: 300620 > URL: https://svnweb.freebsd.org/changeset/base/300620 > > Log: > Use reallocf instead of malloc to fix leak with outbuf_pmap > > ... > > Add a outbuf_pmap = NULL in the failure case to avoid a double-free > at the bottom of the function. > > ... > Modified: head/lib/libc/rpc/clnt_bcast.c > ============================================================================== > --- head/lib/libc/rpc/clnt_bcast.c Tue May 24 17:38:27 2016 (r300619) > +++ head/lib/libc/rpc/clnt_bcast.c Tue May 24 18:44:50 2016 (r300620) > @@ -346,7 +346,9 @@ rpc_broadcast_exp(rpcprog_t prog, rpcver > #ifdef PORTMAP > if (si.si_af == AF_INET && si.si_proto == IPPROTO_UDP) { > udpbufsz = fdlist[fdlistno].dsize; > - if ((outbuf_pmap = malloc(udpbufsz)) == NULL) { > + outbuf_pmap = reallocf(outbuf_pmap, udpbufsz); > + if (outbuf_pmap == NULL) { > + outbuf_pmap = NULL; Huh? This seems a little redundant. > _close(fd); > stat = RPC_SYSTEMERROR; > goto done_broad; > Best, Conrad From owner-svn-src-head@freebsd.org Tue May 24 18:53:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2F61B49909; Tue, 24 May 2016 18:53:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8550A1C10; Tue, 24 May 2016 18:53:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OIr67G093393; Tue, 24 May 2016 18:53:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OIr6B0093392; Tue, 24 May 2016 18:53:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605241853.u4OIr6B0093392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 24 May 2016 18:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300621 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 18:53:07 -0000 Author: ngie Date: Tue May 24 18:53:06 2016 New Revision: 300621 URL: https://svnweb.freebsd.org/changeset/base/300621 Log: Remove redundant NULLing of outbuf_pmap If reallocf ever failed, outbuf_pmap would already be NULL MFC after: 1 week X-MFC with: r300620 Reported by: cem Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/clnt_bcast.c Modified: head/lib/libc/rpc/clnt_bcast.c ============================================================================== --- head/lib/libc/rpc/clnt_bcast.c Tue May 24 18:44:50 2016 (r300620) +++ head/lib/libc/rpc/clnt_bcast.c Tue May 24 18:53:06 2016 (r300621) @@ -348,7 +348,6 @@ rpc_broadcast_exp(rpcprog_t prog, rpcver udpbufsz = fdlist[fdlistno].dsize; outbuf_pmap = reallocf(outbuf_pmap, udpbufsz); if (outbuf_pmap == NULL) { - outbuf_pmap = NULL; _close(fd); stat = RPC_SYSTEMERROR; goto done_broad; From owner-svn-src-head@freebsd.org Tue May 24 18:54:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66FA7B4995F; Tue, 24 May 2016 18:54:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D4371D81; Tue, 24 May 2016 18:54:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x229.google.com with SMTP id 190so18075735iow.1; Tue, 24 May 2016 11:54:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=wFAVoJvEhBvLDk2m+SJaijq+0g06pBwDw1Czq9NzaiY=; b=OnkNcPa37vJeeQj7ScrffH0GysUmFxk9FJv9IWno3a9vqfWDhqMgSpwuds0siL3Xe7 vE5YA9tVwT1kt/YslbzRxCVJ1viSI6qKQNM0tpUWdmXef84Gr1xYFhhLn7ZMXDzFPMh3 gSoD7Wn3h0sWLN6cOcCYQMdV2FPlwZKwqA0uwajYNKH+SMmqlDRxf619hw3QLcAP5D0t k9KrAHejDXDCQx44eM8Tac8+1juUx4B7cC/BBbDMCnQBpQ/K/MEGOkrlZxUgHeff71Wh VfskYl4iSFYD8V9ctSwW0HQntxNY+X5qpL37Gvw2/yZ8zQx5KgOQmhGvBQDpxC8dubWj NBIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=wFAVoJvEhBvLDk2m+SJaijq+0g06pBwDw1Czq9NzaiY=; b=BfdBB2ttE5tFgDL9PdxwzqNAeJV2aesqEYIDPyqe16VsyTUze0mo1v26xn93/Kd43w lOcL5i3l/xn+9in+GRbbo4235BSJBxBEqkdeR0y5pcz1r/IMfgkdAqRvJ0eIhSAchobi PCqz+EBuuykuCRFNR5Rf+dIjR1I6W5kZbnNKYAZQu8gweR0W4IESVHuTCVTajwCNRpCJ 8QAcmCpQQxNx+0KF6zICYZmytK/X2moBEKVIfgVudBDFcJG/BHXR3kSQc+pbRBOJJJOv s1jd8mVm1uwr+vKvhnyATzclLT8hMpI/4jDDiIVqEqNfloIbdLylTGul6sw/745kQBun QSjg== X-Gm-Message-State: ALyK8tIpEg6So4iP3VCzwWgHFJVlgiQnkosx9bTDlohtM8OWj4MYJVx2psvYo2hJ4nTobA== X-Received: by 10.107.9.86 with SMTP id j83mr338775ioi.50.1464116041564; Tue, 24 May 2016 11:54:01 -0700 (PDT) Received: from [192.168.20.7] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id 65sm1503440iog.42.2016.05.24.11.54.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2016 11:54:00 -0700 (PDT) Subject: Re: svn commit: r300620 - head/lib/libc/rpc Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2747BE4B-C121-4E2A-99F6-5B45FA9A28DA"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Tue, 24 May 2016 11:53:58 -0700 Cc: Garrett Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <04B24CA6-4C03-4DA9-A18F-8E82BADD0BB3@gmail.com> References: <201605241844.u4OIioBp090457@repo.freebsd.org> To: "Conrad E. Meyer" X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 18:54:02 -0000 --Apple-Mail=_2747BE4B-C121-4E2A-99F6-5B45FA9A28DA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On May 24, 2016, at 11:49, Conrad Meyer wrote: >=20 > On Tue, May 24, 2016 at 11:44 AM, Garrett Cooper = wrote: >> Author: ngie >> Date: Tue May 24 18:44:50 2016 >> New Revision: 300620 >> URL: https://svnweb.freebsd.org/changeset/base/300620 >>=20 >> Log: >> Use reallocf instead of malloc to fix leak with outbuf_pmap >>=20 >> ... >>=20 >> Add a outbuf_pmap =3D NULL in the failure case to avoid a = double-free >> at the bottom of the function. >>=20 >> ... >> Modified: head/lib/libc/rpc/clnt_bcast.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/lib/libc/rpc/clnt_bcast.c Tue May 24 17:38:27 2016 = (r300619) >> +++ head/lib/libc/rpc/clnt_bcast.c Tue May 24 18:44:50 2016 = (r300620) >> @@ -346,7 +346,9 @@ rpc_broadcast_exp(rpcprog_t prog, rpcver >> #ifdef PORTMAP >> if (si.si_af =3D=3D AF_INET && si.si_proto =3D=3D = IPPROTO_UDP) { >> udpbufsz =3D fdlist[fdlistno].dsize; >> - if ((outbuf_pmap =3D malloc(udpbufsz)) =3D=3D = NULL) { >> + outbuf_pmap =3D reallocf(outbuf_pmap, = udpbufsz); >> + if (outbuf_pmap =3D=3D NULL) { >> + outbuf_pmap =3D NULL; >=20 > Huh? This seems a little redundant. Yes, it was *sigh* (r300621).. --Apple-Mail=_2747BE4B-C121-4E2A-99F6-5B45FA9A28DA 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 iQIcBAEBCgAGBQJXRKNGAAoJEPWDqSZpMIYVYvsP/1jQcrWAkjCIYrh89WwlYTAf 2Ag5Gmj2qAzZFtJ4wwxqBSXA9VgcPgjECZ//lK/LVzIpRU+euwaHwhlNWaf0B8IF GF7+dhobXoiIejx5MXvs2/ogVRa4Tauiz+DF4ISiT141kR7Fkm+AxPogpTQta4Lu BIOAYpM0/Rh9asyayL2EVX/Y5x+8M1TMjMS6/yawCBDKRXWm6QqjD1bGGw3ePFgd r7syi3o2Z6pmIZNxtVHz6hqi13x0NJG/u2JwFbmrWn/qmJpuwe6Uqsa1GuZvtU7e wKUO5kJLdIBVnVJv3A4y0LzQBoCGKoMc4b/vjcR8ALi2u1u7kWcpKbYU9H30FpDN McavFeTYtAP1WLseGvA3NzLpqbKq2H8gYC2hEdcWZlovKNt5eTNYfyUOYivqssYU hGL7dveG+Xh6Fhc9V2vrE9h4DaDtcIeplXNDoPb8/ybsH03M70GcDbXOCwb8t8bn zCokitju9VwfoH2dbu1IqtBeJuh2ZuRopSF4wS6LHTFXqsYYcfYhg5x/xCIjM9Vm oVubxazu9m1noDdBNOmrvNS731lS8izt9SY/Q2k2mWWVlZGS6IO9mCGv0aNXOlPL sSpLI00Gn+REgDVIjzoIROmc7QfAu/Zy8Eao0+F1c1YU2fScv7YqfQVXjhnl3oua 28oQklJ1s0uSLqIj5SqS =GwEY -----END PGP SIGNATURE----- --Apple-Mail=_2747BE4B-C121-4E2A-99F6-5B45FA9A28DA-- From owner-svn-src-head@freebsd.org Tue May 24 19:20:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 860E1B49EF2; Tue, 24 May 2016 19:20:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57C7F1A38; Tue, 24 May 2016 19:20:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OJKUsi099673; Tue, 24 May 2016 19:20:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OJKUfV099672; Tue, 24 May 2016 19:20:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605241920.u4OJKUfV099672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 May 2016 19:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300622 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 19:20:31 -0000 Author: kib Date: Tue May 24 19:20:30 2016 New Revision: 300622 URL: https://svnweb.freebsd.org/changeset/base/300622 Log: In vm_page_cache(), only drop the vnode after radix insert failure for empty page cache when the object type if OBJT_VNODE. Reported and tested by: pho Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue May 24 18:53:06 2016 (r300621) +++ head/sys/vm/vm_page.c Tue May 24 19:20:30 2016 (r300622) @@ -3290,7 +3290,8 @@ vm_page_cache(vm_page_t m) cache_was_empty = vm_radix_is_empty(&object->cache); if (vm_radix_insert(&object->cache, m)) { mtx_unlock(&vm_page_queue_free_mtx); - if (object->resident_page_count == 0) + if (object->type == OBJT_VNODE && + object->resident_page_count == 0) vdrop(object->handle); m->object = NULL; vm_page_free(m); From owner-svn-src-head@freebsd.org Tue May 24 19:52:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56E73B48A7D; Tue, 24 May 2016 19:52:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2481A10A2; Tue, 24 May 2016 19:52:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OJq5Tl012005; Tue, 24 May 2016 19:52:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OJq5Us012004; Tue, 24 May 2016 19:52:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605241952.u4OJq5Us012004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 24 May 2016 19:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300624 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 19:52:06 -0000 Author: ngie Date: Tue May 24 19:52:05 2016 New Revision: 300624 URL: https://svnweb.freebsd.org/changeset/base/300624 Log: Fix up r300385 I accidentally glossed over the fact that tmp is manipulated via strchr, so if we tried to free `tmp` after r300385, it would have crashed. Create a separate pointer (tmp2) to track the original allocation of `tmp`, and free `tmp2` if `p->nc_lookups` can't be malloced MFC after: 4 days X-MFC with: r300385 Reported by: Coverity CID: 1356026 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/getnetconfig.c Modified: head/lib/libc/rpc/getnetconfig.c ============================================================================== --- head/lib/libc/rpc/getnetconfig.c Tue May 24 19:26:58 2016 (r300623) +++ head/lib/libc/rpc/getnetconfig.c Tue May 24 19:52:05 2016 (r300624) @@ -692,7 +692,7 @@ static struct netconfig * dup_ncp(struct netconfig *ncp) { struct netconfig *p; - char *tmp; + char *tmp, *tmp2; u_int i; if ((tmp=malloc(MAXNETCONFIGLINE)) == NULL) @@ -701,6 +701,7 @@ dup_ncp(struct netconfig *ncp) free(tmp); return(NULL); } + tmp2 = tmp; /* * First we dup all the data from matched netconfig buffer. Then we * adjust some of the member pointer to a pre-allocated buffer where @@ -722,7 +723,7 @@ dup_ncp(struct netconfig *ncp) if (p->nc_lookups == NULL) { free(p->nc_netid); free(p); - free(tmp); + free(tmp2); return(NULL); } for (i=0; i < p->nc_nlookups; i++) { From owner-svn-src-head@freebsd.org Tue May 24 20:06:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C18D6B49018; Tue, 24 May 2016 20:06:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92FF91AD8; Tue, 24 May 2016 20:06:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OK6fjm015140; Tue, 24 May 2016 20:06:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OK6fjl015139; Tue, 24 May 2016 20:06:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605242006.u4OK6fjl015139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 24 May 2016 20:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300625 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 20:06:42 -0000 Author: ngie Date: Tue May 24 20:06:41 2016 New Revision: 300625 URL: https://svnweb.freebsd.org/changeset/base/300625 Log: Remove unnecessary memset(.., 0, ..)'s The mem_alloc macro calls calloc (userspace) / malloc(.., M_WAITOK|M_ZERO) under the covers, so zeroing out memory is already handled by the underlying calls MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/rpc/svc.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Tue May 24 19:52:05 2016 (r300624) +++ head/sys/rpc/svc.c Tue May 24 20:06:41 2016 (r300625) @@ -847,9 +847,7 @@ svc_xprt_alloc() SVCXPRT_EXT *ext; xprt = mem_alloc(sizeof(SVCXPRT)); - memset(xprt, 0, sizeof(SVCXPRT)); ext = mem_alloc(sizeof(SVCXPRT_EXT)); - memset(ext, 0, sizeof(SVCXPRT_EXT)); xprt->xp_p3 = ext; refcount_init(&xprt->xp_refs, 1); From owner-svn-src-head@freebsd.org Tue May 24 21:09:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 863EEB49E99; Tue, 24 May 2016 21:09:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6192710A8; Tue, 24 May 2016 21:09:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OL95T6033353; Tue, 24 May 2016 21:09:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OL95Fr033351; Tue, 24 May 2016 21:09:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605242109.u4OL95Fr033351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 May 2016 21:09:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300626 - in head: sys/kern tests/sys/aio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 21:09:06 -0000 Author: jhb Date: Tue May 24 21:09:05 2016 New Revision: 300626 URL: https://svnweb.freebsd.org/changeset/base/300626 Log: Return the correct status when a partially completed request is cancelled. After the previous changes to fix requests on blocking sockets to complete across multiple operations, an edge case exists where a request can be cancelled after it has partially completed. POSIX doesn't appear to dictate exactly how to handle this case, but in general I feel that aio_cancel() should arrange to cancel any request it can, but that any partially completed requests should return a partial completion rather than ECANCELED. To that end, fix the socket AIO cancellation routine to return a short read/write if a partially completed request is cancelled rather than ECANCELED. Sponsored by: Chelsio Communications Modified: head/sys/kern/sys_socket.c head/tests/sys/aio/aio_test.c Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Tue May 24 20:06:41 2016 (r300625) +++ head/sys/kern/sys_socket.c Tue May 24 21:09:05 2016 (r300626) @@ -721,6 +721,7 @@ soo_aio_cancel(struct kaiocb *job) { struct socket *so; struct sockbuf *sb; + long done; int opcode; so = job->fd_file->f_data; @@ -739,7 +740,11 @@ soo_aio_cancel(struct kaiocb *job) sb->sb_flags &= ~SB_AIO; SOCKBUF_UNLOCK(sb); - aio_cancel(job); + done = job->uaiocb._aiocb_private.status; + if (done != 0) + aio_complete(job, done, 0); + else + aio_cancel(job); } static int Modified: head/tests/sys/aio/aio_test.c ============================================================================== --- head/tests/sys/aio/aio_test.c Tue May 24 20:06:41 2016 (r300625) +++ head/tests/sys/aio/aio_test.c Tue May 24 21:09:05 2016 (r300626) @@ -845,6 +845,74 @@ ATF_TC_BODY(aio_socket_blocking_short_wr close(s[0]); } +/* + * This test verifies that cancelling a partially completed socket write + * returns a short write rather than ECANCELED. + */ +ATF_TC_WITHOUT_HEAD(aio_socket_short_write_cancel); +ATF_TC_BODY(aio_socket_short_write_cancel, tc) +{ + struct aiocb iocb, *iocbp; + char *buffer[2]; + ssize_t done; + int buffer_size, sb_size; + socklen_t len; + int s[2]; + + ATF_REQUIRE_KERNEL_MODULE("aio"); + + ATF_REQUIRE(socketpair(PF_UNIX, SOCK_STREAM, 0, s) != -1); + + len = sizeof(sb_size); + ATF_REQUIRE(getsockopt(s[0], SOL_SOCKET, SO_RCVBUF, &sb_size, &len) != + -1); + ATF_REQUIRE(len == sizeof(sb_size)); + buffer_size = sb_size; + + ATF_REQUIRE(getsockopt(s[1], SOL_SOCKET, SO_SNDBUF, &sb_size, &len) != + -1); + ATF_REQUIRE(len == sizeof(sb_size)); + if (sb_size > buffer_size) + buffer_size = sb_size; + + /* + * Use three times the size of the MAX(receive buffer, send + * buffer) for the write to ensure that the write is split up + * into multiple writes internally. The recv() ensures that + * the write has partially completed, but a remaining size of + * two buffers should ensure that the write has not completed + * fully when it is cancelled. + */ + buffer[0] = malloc(buffer_size); + ATF_REQUIRE(buffer[0] != NULL); + buffer[1] = malloc(buffer_size * 3); + ATF_REQUIRE(buffer[1] != NULL); + + srandomdev(); + aio_fill_buffer(buffer[1], buffer_size * 3, random()); + + memset(&iocb, 0, sizeof(iocb)); + iocb.aio_fildes = s[1]; + iocb.aio_buf = buffer[1]; + iocb.aio_nbytes = buffer_size * 3; + ATF_REQUIRE(aio_write(&iocb) == 0); + + done = recv(s[0], buffer[0], buffer_size, MSG_WAITALL); + ATF_REQUIRE(done == buffer_size); + + ATF_REQUIRE(aio_error(&iocb) == EINPROGRESS); + ATF_REQUIRE(aio_cancel(s[1], &iocb) == AIO_NOTCANCELED); + + done = aio_waitcomplete(&iocbp, NULL); + ATF_REQUIRE(iocbp == &iocb); + ATF_REQUIRE(done >= buffer_size && done <= buffer_size * 2); + + ATF_REQUIRE(memcmp(buffer[0], buffer[1], buffer_size) == 0); + + close(s[1]); + close(s[0]); +} + ATF_TP_ADD_TCS(tp) { @@ -857,6 +925,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, aio_large_read_test); ATF_TP_ADD_TC(tp, aio_socket_two_reads); ATF_TP_ADD_TC(tp, aio_socket_blocking_short_write); + ATF_TP_ADD_TC(tp, aio_socket_short_write_cancel); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Tue May 24 21:13:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB745B49FFD; Tue, 24 May 2016 21:13:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C065164C; Tue, 24 May 2016 21:13:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OLDX3S036156; Tue, 24 May 2016 21:13:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OLDXao036155; Tue, 24 May 2016 21:13:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605242113.u4OLDXao036155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 May 2016 21:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300627 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 21:13:34 -0000 Author: kib Date: Tue May 24 21:13:33 2016 New Revision: 300627 URL: https://svnweb.freebsd.org/changeset/base/300627 Log: Silence false LOR report due to the taskqueue mutex and kqueue lock named the same. Reported by: Doug Luce Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Tue May 24 21:09:05 2016 (r300626) +++ head/sys/kern/kern_event.c Tue May 24 21:13:33 2016 (r300627) @@ -91,7 +91,7 @@ MTX_SYSINIT(kq_global, &kq_global, "kque haslck = 0; \ } while (0) -TASKQUEUE_DEFINE_THREAD(kqueue); +TASKQUEUE_DEFINE_THREAD(kqueue_ctx); static int kevent_copyout(void *arg, struct kevent *kevp, int count); static int kevent_copyin(void *arg, struct kevent *kevp, int count); @@ -1426,7 +1426,7 @@ kqueue_schedtask(struct kqueue *kq) ("scheduling kqueue task while draining")); if ((kq->kq_state & KQ_TASKSCHED) != KQ_TASKSCHED) { - taskqueue_enqueue(taskqueue_kqueue, &kq->kq_task); + taskqueue_enqueue(taskqueue_kqueue_ctx, &kq->kq_task); kq->kq_state |= KQ_TASKSCHED; } } From owner-svn-src-head@freebsd.org Tue May 24 21:20:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04C8EB490A9; Tue, 24 May 2016 21:20:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89E3F18A9; Tue, 24 May 2016 21:20:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OLKHu0036441; Tue, 24 May 2016 21:20:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OLKHuL036436; Tue, 24 May 2016 21:20:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605242120.u4OLKHuL036436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 24 May 2016 21:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300628 - in head/sys/dev/bhnd: . bhndb cores/chipc cores/pci cores/pcie2 siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 21:20:19 -0000 Author: adrian Date: Tue May 24 21:20:17 2016 New Revision: 300628 URL: https://svnweb.freebsd.org/changeset/base/300628 Log: [bhnd] Normalize bhnd(4) device matching API This unifies handling of core, chip, and board-level device matching, and adds support for matching device drivers against the bus attach type (e.g. SoC vs WiFi adapter). Core-level quirks on Broadcom's chipsets generally are specific to some combination of chip model, core revision, chip package (e.g. 12x9 SMT package), SROM revision, etc. Unifying the match APIs for all three attribute types (core, chip, board/srom) allows defining a single device quirk table that matches across all of those attributes. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6515 Added: head/sys/dev/bhnd/bhnd_match.h (contents, props changed) Modified: head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/bhndb/bhndb_hwdata.c head/sys/dev/bhnd/bhndb/bhndb_pci_hwdata.c head/sys/dev/bhnd/bhndb/bhndb_subr.c head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/pci/bhnd_pci.c head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c head/sys/dev/bhnd/siba/siba_bhndb.c Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Tue May 24 21:13:33 2016 (r300627) +++ head/sys/dev/bhnd/bhnd.h Tue May 24 21:20:17 2016 (r300628) @@ -41,6 +41,7 @@ #include "bhnd_types.h" #include "bhnd_debug.h" #include "bhnd_bus_if.h" +#include "bhnd_match.h" extern devclass_t bhnd_devclass; extern devclass_t bhnd_hostb_devclass; @@ -169,17 +170,6 @@ struct bhnd_core_info { int unit; /**< bus-assigned core unit */ }; - -/** - * A hardware revision match descriptor. - */ -struct bhnd_hwrev_match { - uint16_t start; /**< first revision, or BHND_HWREV_INVALID - to match on any revision. */ - uint16_t end; /**< last revision, or BHND_HWREV_INVALID - to match on any revision. */ -}; - /** * A bhnd(4) bus resource. * @@ -193,223 +183,70 @@ struct bhnd_resource { * is MMIO accessible. */ }; -/** - * Wildcard hardware revision match descriptor. - */ -#define BHND_HWREV_ANY { BHND_HWREV_INVALID, BHND_HWREV_INVALID } -#define BHND_HWREV_IS_ANY(_m) \ - ((_m)->start == BHND_HWREV_INVALID && (_m)->end == BHND_HWREV_INVALID) - -/** - * Hardware revision match descriptor for an inclusive range. - * - * @param _start The first applicable hardware revision. - * @param _end The last applicable hardware revision, or BHND_HWREV_INVALID - * to match on any revision. - */ -#define BHND_HWREV_RANGE(_start, _end) { _start, _end } - -/** - * Hardware revision match descriptor for a single revision. - * - * @param _hwrev The hardware revision to match on. - */ -#define BHND_HWREV_EQ(_hwrev) BHND_HWREV_RANGE(_hwrev, _hwrev) - -/** - * Hardware revision match descriptor for any revision equal to or greater - * than @p _start. - * - * @param _start The first hardware revision to match on. - */ -#define BHND_HWREV_GTE(_start) BHND_HWREV_RANGE(_start, BHND_HWREV_INVALID) - -/** - * Hardware revision match descriptor for any revision equal to or less - * than @p _end. - * - * @param _end The last hardware revision to match on. - */ -#define BHND_HWREV_LTE(_end) BHND_HWREV_RANGE(0, _end) - - -/** A core match descriptor. */ -struct bhnd_core_match { - uint16_t vendor; /**< required JEP106 device vendor or BHND_MFGID_INVALID. */ - uint16_t device; /**< required core ID or BHND_COREID_INVALID */ - struct bhnd_hwrev_match hwrev; /**< matching revisions. */ - bhnd_devclass_t class; /**< required class or BHND_DEVCLASS_INVALID */ - int unit; /**< required core unit, or -1 */ -}; - -/** - * Core match descriptor matching against the given @p _vendor, @p _device, - * and @p _hwrev match descriptors. - */ -#define BHND_CORE_MATCH(_vendor, _device, _hwrev) \ - { _vendor, _device, _hwrev, BHND_DEVCLASS_INVALID, -1 } - -/** - * Wildcard core match descriptor. - */ -#define BHND_CORE_MATCH_ANY \ - { \ - .vendor = BHND_MFGID_INVALID, \ - .device = BHND_COREID_INVALID, \ - .hwrev = BHND_HWREV_ANY, \ - .class = BHND_DEVCLASS_INVALID, \ - .unit = -1 \ - } - /** - * A chipset match descriptor. - * - * @warning Matching on board/nvram attributes relies on NVRAM access, and will - * fail if a valid NVRAM device cannot be found, or is not yet attached. + * Device quirk table descriptor. */ -struct bhnd_chip_match { - /** Select fields to be matched */ - uint16_t - match_id:1, - match_rev:1, - match_pkg:1, - match_bvendor:1, - match_btype:1, - match_brev:1, - match_srom_rev:1, - match_any:1, - match_flags_unused:8; - - uint16_t chip_id; /**< required chip id */ - struct bhnd_hwrev_match chip_rev; /**< matching chip revisions */ - uint8_t chip_pkg; /**< required package */ - - uint16_t board_vendor; /**< required board vendor */ - uint16_t board_type; /**< required board type */ - struct bhnd_hwrev_match board_rev; /**< matching board revisions */ - - struct bhnd_hwrev_match board_srom_rev; /**< matching board srom revisions */ +struct bhnd_device_quirk { + struct bhnd_device_match desc; /**< device match descriptor */ + uint32_t quirks; /**< quirk flags */ }; -#define BHND_CHIP_MATCH_ANY \ - { .match_any = 1 } - -#define BHND_CHIP_MATCH_IS_ANY(_m) \ - ((_m)->match_any == 1) - -#define BHND_CHIP_MATCH_REQ_BOARD_INFO(_m) \ - ((_m)->match_srom_rev || (_m)->match_bvendor || \ - (_m)->match_btype || (_m)->match_brev) - -/** Set the required chip ID within a bhnd_chip_match instance */ -#define BHND_CHIP_ID(_cid) \ - .match_id = 1, .chip_id = BHND_CHIPID_BCM ## _cid - -/** Set the required chip revision range within a bhnd_chip_match instance */ -#define BHND_CHIP_REV(_rev) \ - .match_rev = 1, .chip_rev = BHND_ ## _rev +#define BHND_CORE_QUIRK(_rev, _flags) \ + {{ BHND_MATCH_CORE_REV(_rev) }, (_flags) } -/** Set the required package ID within a bhnd_chip_match instance */ -#define BHND_CHIP_PKG(_pkg) \ - .match_pkg = 1, .chip_pkg = BHND_PKGID_BCM ## _pkg +#define BHND_CHIP_QUIRK(_chip, _rev, _flags) \ + {{ BHND_CHIP_IR(BCM ## _chip, _rev) }, (_flags) } -/** Set the required board vendor within a bhnd_chip_match instance */ -#define BHND_CHIP_BVENDOR(_vend) \ - .match_bvendor = 1, .board_vendor = _vend +#define BHND_PKG_QUIRK(_chip, _pkg, _flags) \ + {{ BHND_CHIP_IP(BCM ## _chip, BCM ## _chip ## _pkg) }, (_flags) } -/** Set the required board type within a bhnd_chip_match instance */ -#define BHND_CHIP_BTYPE(_btype) \ - .match_btype = 1, .board_type = BHND_BOARD_ ## _btype +#define BHND_BOARD_QUIRK(_board, _flags) \ + {{ BHND_MATCH_BOARD_TYPE(_board) }, \ + (_flags) } -/** Set the required SROM revision range within a bhnd_chip_match instance */ -#define BHND_CHIP_SROMREV(_rev) \ - .match_srom_rev = 1, .board_srom_rev = BHND_ ## _rev - -/** Set the required board revision range within a bhnd_chip_match instance */ -#define BHND_CHIP_BREV(_rev) \ - .match_brev = 1, .board_rev = BHND_ ## _rev - -/** Set the required board vendor and type within a bhnd_chip_match instance */ -#define BHND_CHIP_BVT(_vend, _type) \ - BHND_CHIP_BVENDOR(_vend), BHND_CHIP_BTYPE(_type) - -/** Set the required board vendor, type, and revision within a bhnd_chip_match - * instance */ -#define BHND_CHIP_BVTR(_vend, _type, _rev) \ - BHND_CHIP_BVT(_vend, _type), BHND_CHIP_BREV(_rev) - -/** Set the required chip and package ID within a bhnd_chip_match instance */ -#define BHND_CHIP_IP(_cid, _pkg) \ - BHND_CHIP_ID(_cid), BHND_CHIP_PKG(_pkg) - -/** Set the required chip ID, package ID, and revision within a bhnd_chip_match - * instance */ -#define BHND_CHIP_IPR(_cid, _pkg, _rev) \ - BHND_CHIP_ID(_cid), BHND_CHIP_PKG(_pkg), BHND_CHIP_REV(_rev) - -/** Set the required chip ID and revision within a bhnd_chip_match - * instance */ -#define BHND_CHIP_IR(_cid, _rev) \ - BHND_CHIP_ID(_cid), BHND_CHIP_REV(_rev) - -/** - * Chipset quirk table descriptor. - */ -struct bhnd_chip_quirk { - const struct bhnd_chip_match chip; /**< chip match descriptor */ - uint32_t quirks; /**< quirk flags */ -}; - -#define BHND_CHIP_QUIRK_END { BHND_CHIP_MATCH_ANY, 0 } - -#define BHND_CHIP_QUIRK_IS_END(_q) \ - (BHND_CHIP_MATCH_IS_ANY(&(_q)->chip) && (_q)->quirks == 0) - -/** - * Device quirk table descriptor. - */ -struct bhnd_device_quirk { - struct bhnd_hwrev_match hwrev; /**< applicable hardware revisions */ - uint32_t quirks; /**< quirk flags */ -}; -#define BHND_DEVICE_QUIRK_END { BHND_HWREV_ANY, 0 } +#define BHND_DEVICE_QUIRK_END { { BHND_MATCH_ANY }, 0 } #define BHND_DEVICE_QUIRK_IS_END(_q) \ - (BHND_HWREV_IS_ANY(&(_q)->hwrev) && (_q)->quirks == 0) + (((_q)->desc.m.match_flags == 0) && (_q)->quirks == 0) enum { BHND_DF_ANY = 0, - BHND_DF_HOSTB = (1<<0) /**< core is serving as the bus' - * host bridge */ + BHND_DF_HOSTB = (1<<0), /**< core is serving as the bus' host + * bridge. implies BHND_DF_ADAPTER */ + BHND_DF_SOC = (1<<1), /**< core is attached to a native + bus (BHND_ATTACH_NATIVE) */ + BHND_DF_ADAPTER = (1<<2), /**< core is attached to a bridged + * adapter (BHND_ATTACH_ADAPTER) */ }; /** Device probe table descriptor */ struct bhnd_device { - const struct bhnd_core_match core; /**< core match descriptor */ - const char *desc; /**< device description, or NULL. */ - const struct bhnd_device_quirk *quirks_table; /**< quirks table for this device, or NULL */ - const struct bhnd_chip_quirk *chip_quirks_table; /**< chipset-specific quirks for this device, or NULL */ - uint32_t device_flags; /**< required BHND_DF_* flags */ + const struct bhnd_device_match core; /**< core match descriptor */ + const char *desc; /**< device description, or NULL. */ + const struct bhnd_device_quirk *quirks_table; /**< quirks table for this device, or NULL */ + uint32_t device_flags; /**< required BHND_DF_* flags */ }; -#define _BHND_DEVICE(_vendor, _device, _desc, _quirks, _chip_quirks, \ - _flags, ...) \ - { BHND_CORE_MATCH(BHND_MFGID_ ## _vendor, \ - BHND_COREID_ ## _device, BHND_HWREV_ANY), _desc, _quirks, \ - _chip_quirks, _flags } +#define _BHND_DEVICE(_vendor, _device, _desc, _quirks, \ + _flags, ...) \ + { { BHND_MATCH_CORE(BHND_MFGID_ ## _vendor, \ + BHND_COREID_ ## _device) }, _desc, _quirks, \ + _flags } -#define BHND_MIPS_DEVICE(_device, _desc, _quirks, _chip_quirks, ...) \ - _BHND_DEVICE(MIPS, _device, _desc, _quirks, _chip_quirks, \ +#define BHND_MIPS_DEVICE(_device, _desc, _quirks, ...) \ + _BHND_DEVICE(MIPS, _device, _desc, _quirks, \ ## __VA_ARGS__, 0) -#define BHND_ARM_DEVICE(_device, _desc, _quirks, _chip_quirks, ...) \ - _BHND_DEVICE(ARM, _device, _desc, _quirks, _chip_quirks, \ +#define BHND_ARM_DEVICE(_device, _desc, _quirks, ...) \ + _BHND_DEVICE(ARM, _device, _desc, _quirks, \ ## __VA_ARGS__, 0) -#define BHND_DEVICE(_device, _desc, _quirks, _chip_quirks, ...) \ - _BHND_DEVICE(BCM, _device, _desc, _quirks, _chip_quirks, \ +#define BHND_DEVICE(_device, _desc, _quirks, ...) \ + _BHND_DEVICE(BCM, _device, _desc, _quirks, \ ## __VA_ARGS__, 0) -#define BHND_DEVICE_END { BHND_CORE_MATCH_ANY, NULL, NULL, NULL, 0 } +#define BHND_DEVICE_END { { BHND_MATCH_ANY }, NULL, NULL, 0 } +#define BHND_DEVICE_IS_END(_d) \ + (BHND_MATCH_IS_ANY(&(_d)->core) && (_d)->desc == NULL) const char *bhnd_vendor_name(uint16_t vendor); const char *bhnd_port_type_name(bhnd_port_type port_type); @@ -447,17 +284,17 @@ bool bhnd_core_matches( bool bhnd_chip_matches( const struct bhnd_chipid *chipid, - const struct bhnd_board_info *binfo, const struct bhnd_chip_match *desc); +bool bhnd_board_matches( + const struct bhnd_board_info *info, + const struct bhnd_board_match *desc); + bool bhnd_hwrev_matches(uint16_t hwrev, const struct bhnd_hwrev_match *desc); -uint32_t bhnd_chip_quirks(device_t dev, - const struct bhnd_chip_quirk *table); - bool bhnd_device_matches(device_t dev, - const struct bhnd_core_match *desc); + const struct bhnd_device_match *desc); const struct bhnd_device *bhnd_device_lookup(device_t dev, const struct bhnd_device *table, @@ -469,7 +306,6 @@ uint32_t bhnd_device_quirks(device_t struct bhnd_core_info bhnd_get_core_info(device_t dev); - int bhnd_alloc_resources(device_t dev, struct resource_spec *rs, struct bhnd_resource **res); Added: head/sys/dev/bhnd/bhnd_match.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/bhnd_match.h Tue May 24 21:20:17 2016 (r300628) @@ -0,0 +1,291 @@ +/*- + * Copyright (c) 2015-2016 Landon Fuller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#ifndef _BHND_BHND_MATCH_H_ +#define _BHND_BHND_MATCH_H_ + +#include "bhnd_types.h" + +/** + * A hardware revision match descriptor. + */ +struct bhnd_hwrev_match { + uint16_t start; /**< first revision, or BHND_HWREV_INVALID + to match on any revision. */ + uint16_t end; /**< last revision, or BHND_HWREV_INVALID + to match on any revision. */ +}; + +/* Copy match field @p _name from @p _src */ +#define _BHND_COPY_MATCH_FIELD(_src, _name) \ + .m.match._name = (_src)->m.match._name, \ + ._name = (_src)->_name + +/* Set match field @p _name with @p _value */ +#define _BHND_SET_MATCH_FIELD(_name, _value) \ + .m.match._name = 1, ._name = _value + +/** + * Wildcard hardware revision match descriptor. + */ +#define BHND_HWREV_ANY { BHND_HWREV_INVALID, BHND_HWREV_INVALID } +#define BHND_HWREV_IS_ANY(_m) \ + ((_m)->start == BHND_HWREV_INVALID && (_m)->end == BHND_HWREV_INVALID) + +/** + * Hardware revision match descriptor for an inclusive range. + * + * @param _start The first applicable hardware revision. + * @param _end The last applicable hardware revision, or BHND_HWREV_INVALID + * to match on any revision. + */ +#define BHND_HWREV_RANGE(_start, _end) { _start, _end } + +/** + * Hardware revision match descriptor for a single revision. + * + * @param _hwrev The hardware revision to match on. + */ +#define BHND_HWREV_EQ(_hwrev) BHND_HWREV_RANGE(_hwrev, _hwrev) + +/** + * Hardware revision match descriptor for any revision equal to or greater + * than @p _start. + * + * @param _start The first hardware revision to match on. + */ +#define BHND_HWREV_GTE(_start) BHND_HWREV_RANGE(_start, BHND_HWREV_INVALID) + +/** + * Hardware revision match descriptor for any revision equal to or less + * than @p _end. + * + * @param _end The last hardware revision to match on. + */ +#define BHND_HWREV_LTE(_end) BHND_HWREV_RANGE(0, _end) + +/** + * A bhnd(4) core match descriptor. + */ +struct bhnd_core_match { + /** Select fields to be matched */ + union { + uint8_t match_flags; + struct { + uint8_t + core_vendor:1, + core_id:1, + core_rev:1, + core_class:1, + core_unit:1, + flags_unused:3; + } match; + } m; + + uint16_t core_vendor; /**< required JEP106 device vendor */ + uint16_t core_id; /**< required core ID */ + struct bhnd_hwrev_match core_rev; /**< matching core revisions. */ + bhnd_devclass_t core_class; /**< required bhnd class */ + int core_unit; /**< required core unit */ +}; + +#define _BHND_CORE_MATCH_COPY(_src) \ + _BHND_COPY_MATCH_FIELD(_src, core_vendor), \ + _BHND_COPY_MATCH_FIELD(_src, core_id), \ + _BHND_COPY_MATCH_FIELD(_src, core_rev), \ + _BHND_COPY_MATCH_FIELD(_src, core_class), \ + _BHND_COPY_MATCH_FIELD(_src, core_unit) \ + +#define BHND_MATCH_CORE_VENDOR(_v) _BHND_SET_MATCH_FIELD(core_vendor, _v) +#define BHND_MATCH_CORE_ID(_id) _BHND_SET_MATCH_FIELD(core_id, _id) +#define BHND_MATCH_CORE_REV(_rev) _BHND_SET_MATCH_FIELD(core_rev, \ + BHND_ ## _rev) +#define BHND_MATCH_CORE_CLASS(_cls) _BHND_SET_MATCH_FIELD(core_class, _cls) +#define BHND_MATCH_CORE_UNIT(_unit) _BHND_SET_MATCH_FIELD(core_unit, _unit) + +/** + * Match against the given @p _vendor and @p _id, + */ +#define BHND_MATCH_CORE(_vendor, _id) \ + BHND_MATCH_CORE_VENDOR(_vendor), \ + BHND_MATCH_CORE_ID(_id) + +/** + * A bhnd(4) chip match descriptor. + */ +struct bhnd_chip_match { + /** Select fields to be matched */ + union { + uint8_t match_flags; + struct { + uint8_t + chip_id:1, + chip_rev:1, + chip_pkg:1, + flags_unused:5; + } match; + + } m; + + uint16_t chip_id; /**< required chip id */ + struct bhnd_hwrev_match chip_rev; /**< matching chip revisions */ + uint8_t chip_pkg; /**< required package */ +}; + +#define _BHND_CHIP_MATCH_COPY(_src) \ + _BHND_COPY_MATCH_FIELD(_src, chip_id), \ + _BHND_COPY_MATCH_FIELD(_src, chip_rev), \ + _BHND_COPY_MATCH_FIELD(_src, chip_pkg) \ + +/** Set the required chip ID within a bhnd match descriptor */ +#define BHND_CHIP_ID(_cid) _BHND_SET_MATCH_FIELD(chip_id, \ + BHND_CHIPID_ ## _cid) + +/** Set the required chip revision range within a bhnd match descriptor */ +#define BHND_CHIP_REV(_rev) _BHND_SET_MATCH_FIELD(chip_rev, \ + BHND_ ## _rev) + +/** Set the required package ID within a bhnd match descriptor */ +#define BHND_CHIP_PKG(_pkg) _BHND_SET_MATCH_FIELD(chip_pkg, \ + BHND_PKGID_ ## _pkg) + +/** Set the required chip and package ID within a bhnd match descriptor */ +#define BHND_CHIP_IP(_cid, _pkg) \ + BHND_CHIP_ID(_cid), BHND_CHIP_PKG(_pkg) + +/** Set the required chip ID, package ID, and revision within a bhnd_device_match + * instance */ +#define BHND_CHIP_IPR(_cid, _pkg, _rev) \ + BHND_CHIP_ID(_cid), BHND_CHIP_PKG(_pkg), BHND_CHIP_REV(_rev) + +/** Set the required chip ID and revision within a bhnd_device_match + * instance */ +#define BHND_CHIP_IR(_cid, _rev) \ + BHND_CHIP_ID(_cid), BHND_CHIP_REV(_rev) + +/** + * A bhnd(4) board match descriptor. + */ +struct bhnd_board_match { + /** Select fields to be matched */ + union { + uint8_t match_flags; + struct { + uint8_t + board_vendor:1, + board_type:1, + board_rev:1, + board_srom_rev:1, + flags_unused:4; + } match; + } m; + + uint16_t board_vendor; /**< required board vendor */ + uint16_t board_type; /**< required board type */ + struct bhnd_hwrev_match board_rev; /**< matching board revisions */ + struct bhnd_hwrev_match board_srom_rev; /**< matching board srom revisions */ +}; + +#define _BHND_BOARD_MATCH_COPY(_src) \ + _BHND_COPY_MATCH_FIELD(_src, board_vendor), \ + _BHND_COPY_MATCH_FIELD(_src, board_type), \ + _BHND_COPY_MATCH_FIELD(_src, board_rev), \ + _BHND_COPY_MATCH_FIELD(_src, board_srom_rev) + +/** Set the required board vendor within a bhnd match descriptor */ +#define BHND_MATCH_BOARD_VENDOR(_v) _BHND_SET_MATCH_FIELD(board_vendor, _v) + +/** Set the required board type within a bhnd match descriptor */ +#define BHND_MATCH_BOARD_TYPE(_type) _BHND_SET_MATCH_FIELD(board_type, \ + BHND_BOARD_ ## _type) +/** Set the required SROM revision range within a bhnd match descriptor */ +#define BHND_MATCH_SROMREV(_rev) _BHND_SET_MATCH_FIELD(board_srom_rev, \ + BHND_HWREV_ ## _rev) + +/** Set the required board revision range within a bhnd match descriptor */ +#define BHND_MATCH_BOARD_REV(_rev) _BHND_SET_MATCH_FIELD(board_rev, \ + BHND_ ## _rev) + +/** Set the required board vendor and type within a bhnd match descriptor */ +#define BHND_MATCH_BOARD(_vend, _type) \ + BHND_MATCH_BOARD_VENDOR(_vend), BHND_MATCH_BOARD_TYPE(_type) + + +/** + * A bhnd(4) device match descriptor. + * + * @warning Matching on board attributes relies on NVRAM access, and will + * fail if a valid NVRAM device cannot be found, or is not yet attached. + */ +struct bhnd_device_match { + /** Select fields to be matched */ + union { + uint16_t match_flags; + struct { + uint16_t + core_vendor:1, + core_id:1, + core_rev:1, + core_class:1, + core_unit:1, + chip_id:1, + chip_rev:1, + chip_pkg:1, + board_vendor:1, + board_type:1, + board_rev:1, + board_srom_rev:1, + flags_unused:2; + } match; + } m; + + uint16_t core_vendor; /**< required JEP106 device vendor */ + uint16_t core_id; /**< required core ID */ + struct bhnd_hwrev_match core_rev; /**< matching core revisions. */ + bhnd_devclass_t core_class; /**< required bhnd class */ + int core_unit; /**< required core unit */ + + uint16_t chip_id; /**< required chip id */ + struct bhnd_hwrev_match chip_rev; /**< matching chip revisions */ + uint8_t chip_pkg; /**< required package */ + + uint16_t board_vendor; /**< required board vendor */ + uint16_t board_type; /**< required board type */ + struct bhnd_hwrev_match board_rev; /**< matching board revisions */ + struct bhnd_hwrev_match board_srom_rev; /**< matching board srom revisions */ +}; + +/** Define a wildcard match requirement (matches on any device). */ +#define BHND_MATCH_ANY .m.match_flags = 0 +#define BHND_MATCH_IS_ANY(_m) \ + ((_m)->m.match_flags == 0) + +#endif /* _BHND_BHND_MATCH_H_ */ Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Tue May 24 21:13:33 2016 (r300627) +++ head/sys/dev/bhnd/bhnd_subr.c Tue May 24 21:20:17 2016 (r300628) @@ -303,14 +303,13 @@ device_t bhnd_find_child(device_t dev, bhnd_devclass_t class, int unit) { struct bhnd_core_match md = { - .vendor = BHND_MFGID_INVALID, - .device = BHND_COREID_INVALID, - .hwrev.start = BHND_HWREV_INVALID, - .hwrev.end = BHND_HWREV_INVALID, - .class = class, - .unit = unit + BHND_MATCH_CORE_CLASS(class), + BHND_MATCH_CORE_UNIT(unit) }; + if (unit == -1) + md.m.match.core_unit = 0; + return bhnd_match_child(dev, &md); } @@ -337,9 +336,10 @@ bhnd_match_child(device_t dev, const str match = NULL; for (int i = 0; i < devcnt; i++) { - device_t dev = devlistp[i]; - if (bhnd_device_matches(dev, desc)) { - match = dev; + struct bhnd_core_info ci = bhnd_get_core_info(devlistp[i]); + + if (bhnd_core_matches(&ci, desc)) { + match = devlistp[i]; goto done; } } @@ -437,12 +437,7 @@ bhnd_find_core(const struct bhnd_core_in bhnd_devclass_t class) { struct bhnd_core_match md = { - .vendor = BHND_MFGID_INVALID, - .device = BHND_COREID_INVALID, - .hwrev.start = BHND_HWREV_INVALID, - .hwrev.end = BHND_HWREV_INVALID, - .class = class, - .unit = -1 + BHND_MATCH_CORE_CLASS(class) }; return bhnd_match_core(cores, num_cores, &md); @@ -461,22 +456,21 @@ bool bhnd_core_matches(const struct bhnd_core_info *core, const struct bhnd_core_match *desc) { - if (desc->vendor != BHND_MFGID_INVALID && - desc->vendor != core->vendor) + if (desc->m.match.core_vendor && desc->core_vendor != core->vendor) return (false); - if (desc->device != BHND_COREID_INVALID && - desc->device != core->device) + if (desc->m.match.core_id && desc->core_id != core->device) return (false); - if (desc->unit != -1 && desc->unit != core->unit) + if (desc->m.match.core_unit && desc->core_unit != core->unit) return (false); - if (!bhnd_hwrev_matches(core->hwrev, &desc->hwrev)) + if (desc->m.match.core_rev && + !bhnd_hwrev_matches(core->hwrev, &desc->core_rev)) return (false); - if (desc->class != BHND_DEVCLASS_INVALID && - desc->class != bhnd_core_class(core)) + if (desc->m.match.core_class && + desc->core_class != bhnd_core_class(core)) return (false); return true; @@ -486,7 +480,6 @@ bhnd_core_matches(const struct bhnd_core * Return true if the @p chip matches @p desc. * * @param chip A bhnd chip identifier. - * @param board The bhnd board info, or NULL if unavailable. * @param desc A match descriptor to compare against @p chip. * * @retval true if @p chip matches @p match @@ -494,46 +487,49 @@ bhnd_core_matches(const struct bhnd_core */ bool bhnd_chip_matches(const struct bhnd_chipid *chip, - const struct bhnd_board_info *board, const struct bhnd_chip_match *desc) { - /* Explicit wildcard match */ - if (desc->match_any) - return (true); - - /* If board_info is missing, but required, we cannot match. */ - if (BHND_CHIP_MATCH_REQ_BOARD_INFO(desc) && board == NULL) - return (false); - - - /* Chip matching */ - if (desc->match_id && chip->chip_id != desc->chip_id) + if (desc->m.match.chip_id && chip->chip_id != desc->chip_id) return (false); - if (desc->match_pkg && chip->chip_pkg != desc->chip_pkg) + if (desc->m.match.chip_pkg && chip->chip_pkg != desc->chip_pkg) return (false); - if (desc->match_rev && + if (desc->m.match.chip_rev && !bhnd_hwrev_matches(chip->chip_rev, &desc->chip_rev)) return (false); + return (true); +} - /* Board info matching */ - if (desc->match_srom_rev && +/** + * Return true if the @p board matches @p desc. + * + * @param board The bhnd board info. + * @param desc A match descriptor to compare against @p board. + * + * @retval true if @p chip matches @p match + * @retval false if @p chip does not match @p match. + */ +bool +bhnd_board_matches(const struct bhnd_board_info *board, + const struct bhnd_board_match *desc) +{ + if (desc->m.match.board_srom_rev && !bhnd_hwrev_matches(board->board_srom_rev, &desc->board_srom_rev)) return (false); - if (desc->match_bvendor && board->board_vendor != desc->board_vendor) + if (desc->m.match.board_vendor && + board->board_vendor != desc->board_vendor) return (false); - if (desc->match_btype && board->board_type != desc->board_type) + if (desc->m.match.board_type && board->board_type != desc->board_type) return (false); - if (desc->match_brev && + if (desc->m.match.board_rev && !bhnd_hwrev_matches(board->board_rev, &desc->board_rev)) return (false); - return (true); } @@ -570,16 +566,59 @@ bhnd_hwrev_matches(uint16_t hwrev, const * @retval false if @p dev does not match @p match. */ bool -bhnd_device_matches(device_t dev, const struct bhnd_core_match *desc) +bhnd_device_matches(device_t dev, const struct bhnd_device_match *desc) { - struct bhnd_core_info ci = { - .vendor = bhnd_get_vendor(dev), - .device = bhnd_get_device(dev), - .unit = bhnd_get_core_unit(dev), - .hwrev = bhnd_get_hwrev(dev) - }; + struct bhnd_core_info core; + const struct bhnd_chipid *chip; + struct bhnd_board_info board; + device_t parent; + int error; - return bhnd_core_matches(&ci, desc); + /* Construct individual match descriptors */ + struct bhnd_core_match m_core = { _BHND_CORE_MATCH_COPY(desc) }; + struct bhnd_chip_match m_chip = { _BHND_CHIP_MATCH_COPY(desc) }; + struct bhnd_board_match m_board = { _BHND_BOARD_MATCH_COPY(desc) }; + + /* Fetch and match core info */ + if (m_core.m.match_flags) { + /* Only applicable to bhnd-attached cores */ + parent = device_get_parent(dev); + if (device_get_devclass(parent) != bhnd_devclass) { + device_printf(dev, "attempting to match core " + "attributes against non-core device\n"); + return (false); + } + + core = bhnd_get_core_info(dev); + if (!bhnd_core_matches(&core, &m_core)) + return (false); + } + + /* Fetch and match chip info */ + if (m_chip.m.match_flags) { + chip = bhnd_get_chipid(dev); + + if (!bhnd_chip_matches(chip, &m_chip)) + return (false); + } + + /* Fetch and match board info. + * + * This is not available until after NVRAM is up; earlier device + * matches should not include board requirements */ + if (m_board.m.match_flags) { + if ((error = bhnd_read_board_info(dev, &board))) { + device_printf(dev, "failed to read required board info " + "during device matching: %d\n", error); + return (false); + } + + if (!bhnd_board_matches(&board, &m_board)) + return (false); + } + + /* All matched */ + return (true); } /** @@ -598,11 +637,14 @@ bhnd_device_lookup(device_t dev, const s { const struct bhnd_device *entry; device_t hostb, parent; + bhnd_attach_type attach_type; + uint32_t dflags; parent = device_get_parent(dev); hostb = bhnd_find_hostb_device(parent); + attach_type = bhnd_get_attach_type(dev); - for (entry = table; entry->desc != NULL; entry = + for (entry = table; !BHND_DEVICE_IS_END(entry); entry = (const struct bhnd_device *) ((const char *) entry + entry_size)) { /* match core info */ @@ -610,10 +652,23 @@ bhnd_device_lookup(device_t dev, const s continue; /* match device flags */ - if (entry->device_flags & BHND_DF_HOSTB) { + dflags = entry->device_flags; + + /* hostb implies BHND_ATTACH_ADAPTER requirement */ + if (dflags & BHND_DF_HOSTB) + dflags |= BHND_DF_ADAPTER; + + if (dflags & BHND_DF_ADAPTER) + if (attach_type != BHND_ATTACH_ADAPTER) + continue; + + if (dflags & BHND_DF_HOSTB) if (dev != hostb) continue; - } + + if (dflags & BHND_DF_SOC) + if (attach_type != BHND_ATTACH_NATIVE) + continue; /* device found */ return (entry); @@ -624,66 +679,10 @@ bhnd_device_lookup(device_t dev, const s } /** - * Scan @p table for all quirk flags applicable to @p dev's chip identifier - * (as returned by bhnd_get_chipid). - * - * @param dev A bhnd device. - * @param table The chip quirk table to search. - * - * @return returns all matching quirk flags. - */ -uint32_t -bhnd_chip_quirks(device_t dev, const struct bhnd_chip_quirk *table) -{ - struct bhnd_board_info bi, *board; - const struct bhnd_chipid *cid; - const struct bhnd_chip_quirk *qent; - uint32_t quirks; - int error; - bool need_boardinfo; - - cid = bhnd_get_chipid(dev); - quirks = 0; - need_boardinfo = 0; - board = NULL; - - /* Determine whether quirk matching requires board_info; we want to - * avoid fetching board_info for early devices (e.g. ChipCommon) - * that are brought up prior to NVRAM being readable. */ - for (qent = table; !BHND_CHIP_QUIRK_IS_END(qent); qent++) { - if (!BHND_CHIP_MATCH_REQ_BOARD_INFO(&qent->chip)) - continue; - - need_boardinfo = true; - break; - } - - /* If required, fetch board info */ - if (need_boardinfo) { - error = bhnd_read_board_info(dev, &bi); - if (!error) { - board = &bi; - } else { - device_printf(dev, "failed to read required board info " - "during quirk matching: %d\n", error); - } - } - - /* Apply all matching quirk flags */ - for (qent = table; !BHND_CHIP_QUIRK_IS_END(qent); qent++) { - if (bhnd_chip_matches(cid, board, &qent->chip)) - quirks |= qent->quirks; - } - - return (quirks); -} - -/** - * Scan @p table for all quirk flags applicable to @p dev. + * Scan the device @p table for all quirk flags applicable to @p dev. * * @param dev A bhnd device to match against @p table. * @param table The device table to search. - * @param entry_size The @p table entry size, in bytes. * * @return returns all matching quirk flags. */ @@ -692,32 +691,25 @@ bhnd_device_quirks(device_t dev, const s size_t entry_size) { const struct bhnd_device *dent; - const struct bhnd_device_quirk *qtable, *qent; + const struct bhnd_device_quirk *qent, *qtable; uint32_t quirks; - uint16_t hwrev; - hwrev = bhnd_get_hwrev(dev); - quirks = 0; + /* Locate the device entry */ + if ((dent = bhnd_device_lookup(dev, table, entry_size)) == NULL) + return (0); - /* Find the quirk table */ - if ((dent = bhnd_device_lookup(dev, table, entry_size)) == NULL) { - /* This is almost certainly a (caller) implementation bug */ - device_printf(dev, "quirk lookup did not match any device\n"); + /* Quirks table is optional */ + qtable = dent->quirks_table; + if (qtable == NULL) return (0); - } /* Collect matching device quirk entries */ - if ((qtable = dent->quirks_table) != NULL) { - for (qent = qtable; !BHND_DEVICE_QUIRK_IS_END(qent); qent++) { - if (bhnd_hwrev_matches(hwrev, &qent->hwrev)) - quirks |= qent->quirks; - } + quirks = 0; + for (qent = qtable; !BHND_DEVICE_QUIRK_IS_END(qent); qent++) { + if (bhnd_device_matches(dev, &qent->desc)) + quirks |= qent->quirks; } - /* Collect matching chip quirk entries */ - if (dent->chip_quirks_table != NULL) - quirks |= bhnd_chip_quirks(dev, dent->chip_quirks_table); - return (quirks); } Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Tue May 24 21:13:33 2016 (r300627) +++ head/sys/dev/bhnd/bhndb/bhndb.c Tue May 24 21:20:17 2016 (r300628) @@ -194,13 +194,15 @@ bhndb_hw_matches(device_t *devlist, int { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue May 24 23:15:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 728F5B493E7; Tue, 24 May 2016 23:15:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43B581327; Tue, 24 May 2016 23:15:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ONFqJr075209; Tue, 24 May 2016 23:15:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ONFqNK075208; Tue, 24 May 2016 23:15:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605242315.u4ONFqNK075208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 24 May 2016 23:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300630 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 23:15:53 -0000 Author: bdrewery Date: Tue May 24 23:15:52 2016 New Revision: 300630 URL: https://svnweb.freebsd.org/changeset/base/300630 Log: WITH_META_MODE: Correct description of missing .meta file. Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/options/WITH_META_MODE Modified: head/tools/build/options/WITH_META_MODE ============================================================================== --- head/tools/build/options/WITH_META_MODE Tue May 24 23:04:16 2016 (r300629) +++ head/tools/build/options/WITH_META_MODE Tue May 24 23:15:52 2016 (r300630) @@ -19,7 +19,9 @@ The command to execute changes. .It The current working directory changes. .It -The target's meta file is missing. +The target's meta file is missing, if it had +.Sy .META +as a dependency. .It [requires .Xr filemon 4 ] From owner-svn-src-head@freebsd.org Tue May 24 23:19:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D1DB49643; Tue, 24 May 2016 23:19:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE3D61793; Tue, 24 May 2016 23:19:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ONJ469075359; Tue, 24 May 2016 23:19:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ONJ4eG075358; Tue, 24 May 2016 23:19:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605242319.u4ONJ4eG075358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 24 May 2016 23:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300631 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 23:19:05 -0000 Author: bdrewery Date: Tue May 24 23:19:03 2016 New Revision: 300631 URL: https://svnweb.freebsd.org/changeset/base/300631 Log: Regenerate Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue May 24 23:15:52 2016 (r300630) +++ head/share/man/man5/src.conf.5 Tue May 24 23:19:03 2016 (r300631) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd May 20, 2016 +.Dd May 24, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1062,7 +1062,7 @@ Set to not build utilities for manual pa .Xr manctl 8 , and related support files. .It Va WITH_META_MODE -.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 298007 2016-04-14 22:00:49Z bdrewery +.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 300630 2016-05-24 23:15:52Z bdrewery Creates .Xr make 1 meta files when building, which can provide a reliable incremental build when @@ -1083,7 +1083,9 @@ The command to execute changes. .It The current working directory changes. .It -The target's meta file is missing. +The target's meta file is missing, if it had +.Sy .META +as a dependency. .It [requires .Xr filemon 4 ] From owner-svn-src-head@freebsd.org Tue May 24 23:36:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25E76B49990; Tue, 24 May 2016 23:36:45 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E781D1EA7; Tue, 24 May 2016 23:36:44 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ONaijP081179; Tue, 24 May 2016 23:36:44 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ONait8081178; Tue, 24 May 2016 23:36:44 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605242336.u4ONait8081178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Tue, 24 May 2016 23:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300632 - head/usr.sbin/acpi/acpidump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 23:36:45 -0000 Author: truckman Date: Tue May 24 23:36:43 2016 New Revision: 300632 URL: https://svnweb.freebsd.org/changeset/base/300632 Log: Fix acpidump CID 1011278 (Buffer not null terminated) and other issues Coverity reports that a buffer used for temporary file generation might not be NUL terminated by strncpy(). This is probably not true because the input gets passed through realpath(), but if the path name is sufficiently long the name could be truncated and cause other problems. The code for generating the temp file names is also overly complex. Instead of a bunch of calls to strncpy() and and strncat(), simplify the code by using snprintf() and add checks for unexpected truncation. The output file created by iasl -d is predictable. Fix this by using mkdtemp() to create a directory to hold the iasl input and output files. Check the return values of more syscalls. Reported by: Coverity CID: 1011278 Reviewed by: jkim MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6360 Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Tue May 24 23:19:03 2016 (r300631) +++ head/usr.sbin/acpi/acpidump/acpi.c Tue May 24 23:36:43 2016 (r300632) @@ -1466,27 +1466,34 @@ dsdt_save_file(char *outfile, ACPI_TABLE void aml_disassemble(ACPI_TABLE_HEADER *rsdt, ACPI_TABLE_HEADER *dsdp) { - char buf[PATH_MAX], tmpstr[PATH_MAX]; + char buf[PATH_MAX], tmpstr[PATH_MAX], wrkdir[PATH_MAX]; + const char *iname = "/acpdump.din"; + const char *oname = "/acpdump.dsl"; const char *tmpdir; - char *tmpext; FILE *fp; size_t len; - int fd; + int fd, status; + pid_t pid; tmpdir = getenv("TMPDIR"); if (tmpdir == NULL) tmpdir = _PATH_TMP; - strncpy(tmpstr, tmpdir, sizeof(tmpstr)); - if (realpath(tmpstr, buf) == NULL) { + if (realpath(tmpdir, buf) == NULL) { perror("realpath tmp dir"); return; } - strncpy(tmpstr, buf, sizeof(tmpstr)); - strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(buf)); - len = strlen(tmpstr); - tmpext = tmpstr + len; - strncpy(tmpext, "XXXXXX", sizeof(tmpstr) - len); - fd = mkstemp(tmpstr); + len = sizeof(wrkdir) - strlen(iname); + if ((size_t)snprintf(wrkdir, len, "%s/acpidump.XXXXXX", buf) > len-1 ) { + fprintf(stderr, "$TMPDIR too long\n"); + return; + } + if (mkdtemp(wrkdir) == NULL) { + perror("mkdtemp tmp working dir"); + return; + } + assert((size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, iname) + <= sizeof(tmpstr) - 1); + fd = open(tmpstr, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); if (fd < 0) { perror("iasl tmp file"); return; @@ -1495,28 +1502,46 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt, close(fd); /* Run iasl -d on the temp file */ - if (fork() == 0) { + if ((pid = fork()) == 0) { close(STDOUT_FILENO); if (vflag == 0) close(STDERR_FILENO); execl("/usr/sbin/iasl", "iasl", "-d", tmpstr, NULL); err(1, "exec"); } - - wait(NULL); - unlink(tmpstr); + if (pid > 0) + wait(&status); + if (unlink(tmpstr) < 0) { + perror("unlink"); + goto out; + } + if (pid < 0) { + perror("fork"); + goto out; + } + if (status != 0) { + fprintf(stderr, "iast exit status = %d\n", status); + } /* Dump iasl's output to stdout */ - strncpy(tmpext, "dsl", sizeof(tmpstr) - len); + assert((size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, oname) + <= sizeof(tmpstr) -1); fp = fopen(tmpstr, "r"); - unlink(tmpstr); + if (unlink(tmpstr) < 0) { + perror("unlink"); + goto out; + } if (fp == NULL) { perror("iasl tmp file (read)"); - return; + goto out; } while ((len = fread(buf, 1, sizeof(buf), fp)) > 0) fwrite(buf, 1, len, stdout); fclose(fp); + + out: + if (rmdir(wrkdir) < 0) + perror("rmdir"); } void From owner-svn-src-head@freebsd.org Tue May 24 23:41:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02278B49B1E; Tue, 24 May 2016 23:41:38 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C937D117B; Tue, 24 May 2016 23:41:37 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ONfaUp083998; Tue, 24 May 2016 23:41:36 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ONfabj083997; Tue, 24 May 2016 23:41:36 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605242341.u4ONfabj083997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Tue, 24 May 2016 23:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300633 - head/usr.sbin/acpi/acpidb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 23:41:38 -0000 Author: truckman Date: Tue May 24 23:41:36 2016 New Revision: 300633 URL: https://svnweb.freebsd.org/changeset/base/300633 Log: Fix acpidb CIDs 1011279 (Buffer not null terminated) and 978405 and 1199380 (Resource leak). load_dsdt() calls strncpy() to copy a filename and Coverity warns that the destination buffer may not be NUL terminated. Fix this by using strlcpy() instead. If silent truncation occurs, then the filename was not valid anyway. load_dsdt() leaks an fd (CID 978405) and a memory region allocated using mmap() (CID 1199380) when it returns. Fix these by calling close() and munmap() as appropriate. Don't bother fixing the minor memory leak "list", allocated by AcGetAllTablesFromFile() (CID 1355191). Check for truncation when creating the temp file name. Set a flag to indicate that the temp file should be unlinked. Relying on a strcmp() test could delete the input file in contrived cases. Reported by: Coverity CID: 1011279, 978405, 1199380 Reviewed by: jkim MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6368 Modified: head/usr.sbin/acpi/acpidb/acpidb.c Modified: head/usr.sbin/acpi/acpidb/acpidb.c ============================================================================== --- head/usr.sbin/acpi/acpidb/acpidb.c Tue May 24 23:36:43 2016 (r300632) +++ head/usr.sbin/acpi/acpidb/acpidb.c Tue May 24 23:41:36 2016 (r300633) @@ -385,8 +385,7 @@ load_dsdt(const char *dsdtfile) ACPI_NEW_TABLE_DESC *list; u_int8_t *code; struct stat sb; - int fd, fd2; - int error; + int dounlink, error, fd; fd = open(dsdtfile, O_RDONLY, 0); if (fd == -1) { @@ -399,11 +398,13 @@ load_dsdt(const char *dsdtfile) return (-1); } code = mmap(NULL, (size_t)sb.st_size, PROT_READ, MAP_PRIVATE, fd, (off_t)0); + close(fd); if (code == NULL) { perror("mmap"); return (-1); } if ((error = AcpiInitializeSubsystem()) != AE_OK) { + munmap(code, (size_t)sb.st_size); return (-1); } @@ -411,21 +412,30 @@ load_dsdt(const char *dsdtfile) * make sure DSDT data contains table header or not. */ if (strncmp((char *)code, "DSDT", 4) == 0) { - strncpy(filetmp, dsdtfile, sizeof(filetmp)); + dounlink = 0; + strlcpy(filetmp, dsdtfile, sizeof(filetmp)); } else { + dounlink = 1; mode_t mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); dummy_dsdt_table.Length = sizeof(ACPI_TABLE_HEADER) + sb.st_size; - snprintf(filetmp, sizeof(filetmp), "%s.tmp", dsdtfile); - fd2 = open(filetmp, O_WRONLY | O_CREAT | O_TRUNC, mode); - if (fd2 == -1) { + if ((size_t)snprintf(filetmp, sizeof(filetmp), "%s.tmp", + dsdtfile) > sizeof(filetmp) - 1) { + fprintf(stderr, "file name too long\n"); + munmap(code, (size_t)sb.st_size); + return (-1); + } + fd = open(filetmp, O_WRONLY | O_CREAT | O_TRUNC, mode); + if (fd == -1) { perror("open"); + munmap(code, (size_t)sb.st_size); return (-1); } - write(fd2, &dummy_dsdt_table, sizeof(ACPI_TABLE_HEADER)); + write(fd, &dummy_dsdt_table, sizeof(ACPI_TABLE_HEADER)); - write(fd2, code, sb.st_size); - close(fd2); + write(fd, code, sb.st_size); + close(fd); } + munmap(code, (size_t)sb.st_size); /* * Install the virtual machine version of address space handlers. @@ -487,7 +497,7 @@ load_dsdt(const char *dsdtfile) AcpiGbl_DebuggerConfiguration = 0; AcpiDbUserCommands(':', NULL); - if (strcmp(dsdtfile, filetmp) != 0) { + if (dounlink) { unlink(filetmp); } From owner-svn-src-head@freebsd.org Wed May 25 00:13:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DF4AB48142; Wed, 25 May 2016 00:13:02 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 656C21FBD; Wed, 25 May 2016 00:13:02 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P0D1x8093062; Wed, 25 May 2016 00:13:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P0D1rj093061; Wed, 25 May 2016 00:13:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605250013.u4P0D1rj093061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 25 May 2016 00:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300634 - head/sys/boot/efi/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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 00:13:02 -0000 Author: cem Date: Wed May 25 00:13:01 2016 New Revision: 300634 URL: https://svnweb.freebsd.org/changeset/base/300634 Log: efi loader: Match format string to EFI_ERROR_CODE() Silence a format specifier warning. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Tue May 24 23:41:36 2016 (r300633) +++ head/sys/boot/efi/loader/main.c Wed May 25 00:13:01 2016 (r300634) @@ -923,7 +923,7 @@ command_efi_set(int argc, char *argv[]) EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS, strlen(val) + 1, val); if (EFI_ERROR(err)) { - printf("Failed to set variable: error %d\n", EFI_ERROR_CODE(err)); + printf("Failed to set variable: error %lu\n", EFI_ERROR_CODE(err)); return (CMD_ERROR); } return (CMD_OK); @@ -954,7 +954,7 @@ command_efi_unset(int argc, char *argv[] cpy8to16(var, wvar, sizeof(wvar)); err = RS->SetVariable(wvar, &guid, 0, 0, NULL); if (EFI_ERROR(err)) { - printf("Failed to unset variable: error %d\n", EFI_ERROR_CODE(err)); + printf("Failed to unset variable: error %lu\n", EFI_ERROR_CODE(err)); return (CMD_ERROR); } return (CMD_OK); From owner-svn-src-head@freebsd.org Wed May 25 00:16:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F091B48329; Wed, 25 May 2016 00:16:53 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C38F1288; Wed, 25 May 2016 00:16:53 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P0GqX7093250; Wed, 25 May 2016 00:16:52 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P0GqnV093249; Wed, 25 May 2016 00:16:52 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605250016.u4P0GqnV093249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 00:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300635 - head/usr.sbin/ypserv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 00:16:53 -0000 Author: truckman Date: Wed May 25 00:16:52 2016 New Revision: 300635 URL: https://svnweb.freebsd.org/changeset/base/300635 Log: Call free(cur) if strdup(dirp->d_name) fails to avoid a memory leak. Reported by: Coverity CID: 1007414 MFC after: 1 week Modified: head/usr.sbin/ypserv/yp_server.c Modified: head/usr.sbin/ypserv/yp_server.c ============================================================================== --- head/usr.sbin/ypserv/yp_server.c Wed May 25 00:13:01 2016 (r300634) +++ head/usr.sbin/ypserv/yp_server.c Wed May 25 00:16:52 2016 (r300635) @@ -711,6 +711,7 @@ yp_maplist_create(const char *domain) yp_error("strdup() failed: %s",strerror(errno)); closedir(dird); yp_maplist_free(yp_maplist); + free(cur); return(NULL); } cur->next = yp_maplist; From owner-svn-src-head@freebsd.org Wed May 25 00:25:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E3BAB48649; Wed, 25 May 2016 00:25:40 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D39431A4A; Wed, 25 May 2016 00:25:39 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P0Pdf3096238; Wed, 25 May 2016 00:25:39 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P0PdXH096237; Wed, 25 May 2016 00:25:39 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605250025.u4P0PdXH096237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 00:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300636 - head/usr.sbin/ypserv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 00:25:40 -0000 Author: truckman Date: Wed May 25 00:25:38 2016 New Revision: 300636 URL: https://svnweb.freebsd.org/changeset/base/300636 Log: Delay calling yp_malloc_dnsent() until after some additional sanity checks to avoid leaking memory on error returns. Reported by: Coverity CID: 1007416 MFC after: 1 week Modified: head/usr.sbin/ypserv/yp_dnslookup.c Modified: head/usr.sbin/ypserv/yp_dnslookup.c ============================================================================== --- head/usr.sbin/ypserv/yp_dnslookup.c Wed May 25 00:16:52 2016 (r300635) +++ head/usr.sbin/ypserv/yp_dnslookup.c Wed May 25 00:25:38 2016 (r300636) @@ -489,9 +489,6 @@ yp_async_lookup_addr(struct svc_req *rqs yp_find_dnsqent(svcudp_get_xid(rqstp->rq_xprt),BY_RPC_XID) != NULL) return(YP_TRUE); - if ((q = yp_malloc_dnsent()) == NULL) - return(YP_YPERR); - switch (af) { case AF_INET: if (inet_aton(addr, (struct in_addr *)uaddr) != 1) @@ -516,6 +513,9 @@ yp_async_lookup_addr(struct svc_req *rqs return(YP_YPERR); } + if ((q = yp_malloc_dnsent()) == NULL) + return(YP_YPERR); + if (debug) yp_error("DNS address is: %s", buf); From owner-svn-src-head@freebsd.org Wed May 25 01:23:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D01BFB49234; Wed, 25 May 2016 01:23:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88BD912B7; Wed, 25 May 2016 01:23:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P1NJk1014264; Wed, 25 May 2016 01:23:19 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P1NJlY014263; Wed, 25 May 2016 01:23:19 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201605250123.u4P1NJlY014263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 25 May 2016 01:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300637 - head/sys/dev/dpaa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 01:23:20 -0000 Author: jhibbits Date: Wed May 25 01:23:19 2016 New Revision: 300637 URL: https://svnweb.freebsd.org/changeset/base/300637 Log: Set the TLB caching properties for portals at attach time. This was found while reworking the device tree nodes for dtsec to match the Linux device tree. Instead of waiting and expecting later code to call dpaa_portal_map_registers(), do the equivalent immediately upon mapping. Otherwise, it's possible to access the pages before that function is called, and hang the CPU. Modified: head/sys/dev/dpaa/portals_common.c Modified: head/sys/dev/dpaa/portals_common.c ============================================================================== --- head/sys/dev/dpaa/portals_common.c Wed May 25 00:25:38 2016 (r300636) +++ head/sys/dev/dpaa/portals_common.c Wed May 25 01:23:19 2016 (r300637) @@ -76,9 +76,12 @@ dpaa_portal_alloc_res(device_t dev, stru SYS_RES_MEMORY, &sc->sc_rrid[0], rle->start + sc->sc_dp_pa, rle->end + sc->sc_dp_pa, rle->count, RF_ACTIVE); if (sc->sc_rres[0] == NULL) { - device_printf(dev, "Could not allocate memory.\n"); + device_printf(dev, + "Could not allocate cache enabled memory.\n"); return (ENXIO); } + tlb1_set_entry(rman_get_bushandle(sc->sc_rres[0]), + rle->start + sc->sc_dp_pa, rle->count, _TLB_ENTRY_MEM); /* Cache inhibited area */ rle = resource_list_find(res, SYS_RES_MEMORY, 1); sc->sc_rrid[1] = 1; @@ -86,11 +89,15 @@ dpaa_portal_alloc_res(device_t dev, stru SYS_RES_MEMORY, &sc->sc_rrid[1], rle->start + sc->sc_dp_pa, rle->end + sc->sc_dp_pa, rle->count, RF_ACTIVE); if (sc->sc_rres[1] == NULL) { - device_printf(dev, "Could not allocate memory.\n"); + device_printf(dev, + "Could not allocate cache inhibited memory.\n"); bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rrid[0], sc->sc_rres[0]); return (ENXIO); } + tlb1_set_entry(rman_get_bushandle(sc->sc_rres[1]), + rle->start + sc->sc_dp_pa, rle->count, _TLB_ENTRY_IO); + sc->sc_dp[cpu].dp_regs_mapped = 1; } /* Acquire portal's CE_PA and CI_PA */ rle = resource_list_find(res, SYS_RES_MEMORY, 0); From owner-svn-src-head@freebsd.org Wed May 25 01:35:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C59DEB4949E; Wed, 25 May 2016 01:35:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85F911A3A; Wed, 25 May 2016 01:35:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P1Z2wS017293; Wed, 25 May 2016 01:35:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P1Z2eE017292; Wed, 25 May 2016 01:35:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201605250135.u4P1Z2eE017292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 25 May 2016 01:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300638 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 01:35:03 -0000 Author: cy Date: Wed May 25 01:35:02 2016 New Revision: 300638 URL: https://svnweb.freebsd.org/changeset/base/300638 Log: Use the expiry date to determine whether to replace the DB copy of leapfile instead of using the leapfile serial number (create timestamp). PR: 209577 MFC after: 3 days Modified: head/etc/rc.d/ntpd Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Wed May 25 01:23:19 2016 (r300637) +++ head/etc/rc.d/ntpd Wed May 25 01:35:02 2016 (r300638) @@ -108,8 +108,8 @@ ntpd_fetch_leapfile() { $verbose fetching $url fetch $ntp_leapfile_fetch_opts -o $ntp_tmp_leapfile $url && break done - ntp_ver_no_tmp=$(get_ntp_leapfile_ver $ntp_tmp_leapfile) - if [ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then + ntp_expiry_tmp=$(get_ntp_leapfile_expiry $ntp_tmp_leapfile) + if [ "$ntp_expiry_tmp" -gt "$ntp_leap_expiry" ]; then $verbose using $url as $ntp_db_leapfile mv $ntp_tmp_leapfile $ntp_db_leapfile else From owner-svn-src-head@freebsd.org Wed May 25 01:37:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C0D9B49586; Wed, 25 May 2016 01:37:27 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F33F11C34; Wed, 25 May 2016 01:37:26 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P1bQ5I017459; Wed, 25 May 2016 01:37:26 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P1bQ86017456; Wed, 25 May 2016 01:37:26 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605250137.u4P1bQ86017456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 01:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300639 - head/usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 01:37:27 -0000 Author: truckman Date: Wed May 25 01:37:25 2016 New Revision: 300639 URL: https://svnweb.freebsd.org/changeset/base/300639 Log: Fix Coverity CIDs 1340544 Resource leak and 1340543 Use after free At line 479 of ldapclient.c in client_build_req(), the error return leaks ldap_attrs (CID 1340544). It looks like this can happen if the first utoa() call in aldap_get_stringset() fails. It looks like other leaks can happen if other utoa() calls fail since scanning this array when it is freed stops when the first NULL is encountered. Fix these problems by not storing NULL in the array when utoa() fails, and by freeing ret and returning NULL if nothing is stored in the array. That way the caller will never see the ldap_attrs[0] == NULL case, so delete that check. The ber_printf_element() calls ber_free_elements() on its ber argument and returns NULL on failure. When each of its callers detects failure, they do a goto fail, which then calls ber_free_elements() with the same pointer (CID 1340543). Fix is to delete the ber_free_elements() from ber_printf_element() Reported by: Coverity CID: 1340543, 1340544 Reviewed by: araujo Differential Revision: https://reviews.freebsd.org/D6550 Modified: head/usr.sbin/ypldap/aldap.c head/usr.sbin/ypldap/ber.c head/usr.sbin/ypldap/ldapclient.c Modified: head/usr.sbin/ypldap/aldap.c ============================================================================== --- head/usr.sbin/ypldap/aldap.c Wed May 25 01:35:02 2016 (r300638) +++ head/usr.sbin/ypldap/aldap.c Wed May 25 01:37:25 2016 (r300639) @@ -716,12 +716,19 @@ aldap_get_stringset(struct ber_element * return NULL; for (a = elm, i = 0; a != NULL && a->be_type == BER_TYPE_OCTETSTRING; - a = a->be_next, i++) { + a = a->be_next) { ber_get_string(a, &s); ret[i] = utoa(s); + if (ret[i] != NULL) + i++; + } - ret[i + 1] = NULL; + if (i == 0) { + free(ret); + return NULL; + } + ret[i] = NULL; return ret; } Modified: head/usr.sbin/ypldap/ber.c ============================================================================== --- head/usr.sbin/ypldap/ber.c Wed May 25 01:35:02 2016 (r300638) +++ head/usr.sbin/ypldap/ber.c Wed May 25 01:37:25 2016 (r300639) @@ -621,7 +621,6 @@ ber_printf_elements(struct ber_element * return (ber); fail: - ber_free_elements(ber); return (NULL); } Modified: head/usr.sbin/ypldap/ldapclient.c ============================================================================== --- head/usr.sbin/ypldap/ldapclient.c Wed May 25 01:35:02 2016 (r300638) +++ head/usr.sbin/ypldap/ldapclient.c Wed May 25 01:37:25 2016 (r300639) @@ -475,8 +475,6 @@ client_build_req(struct idm *idm, struct } else { if (aldap_match_attr(m, idm->idm_attrs[i], &ldap_attrs) == -1) return (-1); - if (ldap_attrs[0] == NULL) - return (-1); if (strlcat(ir->ir_line, ldap_attrs[0], sizeof(ir->ir_line)) >= sizeof(ir->ir_line)) { aldap_free_attr(ldap_attrs); From owner-svn-src-head@freebsd.org Wed May 25 01:37:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73DD2B495B8; Wed, 25 May 2016 01:37:40 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 383241D83; Wed, 25 May 2016 01:37:40 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P1bd4t017509; Wed, 25 May 2016 01:37:39 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P1bd0D017508; Wed, 25 May 2016 01:37:39 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201605250137.u4P1bd0D017508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Wed, 25 May 2016 01:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300640 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 01:37:40 -0000 Author: ken Date: Wed May 25 01:37:39 2016 New Revision: 300640 URL: https://svnweb.freebsd.org/changeset/base/300640 Log: Fix a few ada(4) driver issues: o Some Samsung drives do not support the ATA READ LOG EXT or READ LOG DMA EXT commands, despite indicating that they do in their IDENTIFY data. So, fix this in two ways: 1. Only start the log directory probe (ADA_STATE_LOGDIR) if the drive claims to be an SMR drive in the first place. We don't need to do the extra probing for other devices. This will also serve to prevent problems with other drives that have the same issue. 2. Add quirks for the two Samsung drives that have been reported so far (thanks to Oleg Nauman and Alex Petrov). If there is a reason to do a Read Log later on, we will know that it doesn't work on these drives. o Add a quirk entry to mark Seagate Lamarr Drive Managed drives as drive managed. They don't report this in their Identify data. sys/cam/ata/ata_da.c: Add two new quirks: 1. ADA_Q_LOG_BROKEN, for drives that claim to support Read Log but don't really. 2. ADA_Q_SMR_DM, for drives that are Drive Managed SMR, but don't report it. This can matter for software that wants to know when it should make an extra effort to write sequentially. Record two Samsung drives that don't support Read Log, and one Seagate drive that doesn't report that it is a SMR drive. The Seagate drive is already recorded in the da(4) driver. We may have to come up with a similar solution in the da(4) driver for SATA drives that don't properly support Read Log. In adasetflags(), Dont' set the ADA_FLAG_CAN_LOG bit if the device has the LOG_BROKEN quirk set. Also, look at the SMR_DM quirk and set the device type accordingly if it is actually a drive managed drive. When deciding whether to go into the LOGDIR probe state, look to see whether the device claims to be an SMR device. If not, don't bother with the LOGDIR probe state. Sponsored by: Spectra Logic Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Wed May 25 01:37:25 2016 (r300639) +++ head/sys/cam/ata/ata_da.c Wed May 25 01:37:39 2016 (r300640) @@ -115,12 +115,16 @@ typedef enum { ADA_Q_NONE = 0x00, ADA_Q_4K = 0x01, ADA_Q_NCQ_TRIM_BROKEN = 0x02, + ADA_Q_LOG_BROKEN = 0x04, + ADA_Q_SMR_DM = 0x08 } ada_quirks; #define ADA_Q_BIT_STRING \ "\020" \ "\0014K" \ - "\002NCQ_TRIM_BROKEN" + "\002NCQ_TRIM_BROKEN" \ + "\003LOG_BROKEN" \ + "\004SMR_DM" typedef enum { ADA_CCB_RAHEAD = 0x01, @@ -680,6 +684,35 @@ static struct ada_quirk_entry ada_quirk_ /*quirks*/ADA_Q_4K }, { + /* + * Samsung drive that doesn't support READ LOG EXT or + * READ LOG DMA EXT, despite reporting that it does in + * ATA identify data: + * SAMSUNG HD200HJ KF100-06 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG HD200*", "*" }, + /*quirks*/ADA_Q_LOG_BROKEN + }, + { + /* + * Samsung drive that doesn't support READ LOG EXT or + * READ LOG DMA EXT, despite reporting that it does in + * ATA identify data: + * SAMSUNG HD501LJ CR100-10 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG HD501*", "*" }, + /*quirks*/ADA_Q_LOG_BROKEN + }, + { + /* + * Seagate Lamarr 8TB Shingled Magnetic Recording (SMR) + * Drive Managed SATA hard drive. This drive doesn't report + * in firmware that it is a drive managed SMR drive. + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "ST8000AS0002*", "*" }, + /*quirks*/ADA_Q_SMR_DM + }, + { /* Default */ { T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED, @@ -1258,7 +1291,8 @@ adaasync(void *callback_arg, u_int32_t c softc->state = ADA_STATE_RAHEAD; else if (ADA_WC >= 0 && softc->flags & ADA_FLAG_CAN_RAHEAD) softc->state = ADA_STATE_WCACHE; - else if (softc->flags & ADA_FLAG_CAN_LOG) + else if ((softc->flags & ADA_FLAG_CAN_LOG) + && (softc->zone_mode != ADA_ZONE_NONE)) softc->state = ADA_STATE_LOGDIR; else break; @@ -1581,7 +1615,8 @@ adasetflags(struct ada_softc *softc, str */ adasetdeletemethod(softc); - if (cgd->ident_data.support.extension & ATA_SUPPORT_GENLOG) + if ((cgd->ident_data.support.extension & ATA_SUPPORT_GENLOG) + && ((softc->quirks & ADA_Q_LOG_BROKEN) == 0)) softc->flags |= ADA_FLAG_CAN_LOG; else softc->flags &= ~ADA_FLAG_CAN_LOG; @@ -1589,8 +1624,9 @@ adasetflags(struct ada_softc *softc, str if ((cgd->ident_data.support3 & ATA_SUPPORT_ZONE_MASK) == ATA_SUPPORT_ZONE_HOST_AWARE) softc->zone_mode = ADA_ZONE_HOST_AWARE; - else if ((cgd->ident_data.support3 & ATA_SUPPORT_ZONE_MASK) == - ATA_SUPPORT_ZONE_DEV_MANAGED) + else if (((cgd->ident_data.support3 & ATA_SUPPORT_ZONE_MASK) == + ATA_SUPPORT_ZONE_DEV_MANAGED) + || (softc->quirks & ADA_Q_SMR_DM)) softc->zone_mode = ADA_ZONE_DRIVE_MANAGED; else softc->zone_mode = ADA_ZONE_NONE; @@ -1818,7 +1854,8 @@ adaregister(struct cam_periph *periph, v softc->state = ADA_STATE_RAHEAD; } else if (ADA_WC >= 0 && softc->flags & ADA_FLAG_CAN_WCACHE) { softc->state = ADA_STATE_WCACHE; - } else if (softc->flags & ADA_FLAG_CAN_LOG) { + } else if ((softc->flags & ADA_FLAG_CAN_LOG) + && (softc->zone_mode != ADA_ZONE_NONE)) { softc->state = ADA_STATE_LOGDIR; } else { /* @@ -2863,7 +2900,8 @@ adadone(struct cam_periph *periph, union /* Drop freeze taken due to CAM_DEV_QFREEZE */ cam_release_devq(path, 0, 0, 0, FALSE); - if (softc->flags & ADA_FLAG_CAN_LOG) { + if ((softc->flags & ADA_FLAG_CAN_LOG) + && (softc->zone_mode != ADA_ZONE_NONE)) { xpt_release_ccb(done_ccb); softc->state = ADA_STATE_LOGDIR; xpt_schedule(periph, priority); From owner-svn-src-head@freebsd.org Wed May 25 02:10:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06267B49B1A; Wed, 25 May 2016 02:10:32 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A71081D45; Wed, 25 May 2016 02:10:31 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P2AUa2026888; Wed, 25 May 2016 02:10:30 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P2AUh1026887; Wed, 25 May 2016 02:10:30 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605250210.u4P2AUh1026887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 02:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300642 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 02:10:32 -0000 Author: truckman Date: Wed May 25 02:10:30 2016 New Revision: 300642 URL: https://svnweb.freebsd.org/changeset/base/300642 Log: Match the descriptions of the \H and \h prompt string sequences to reality. They were swapped. X-Confirmed by: jilles MFC after: 1 week Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Wed May 25 01:48:44 2016 (r300641) +++ head/bin/sh/sh.1 Wed May 25 02:10:30 2016 (r300642) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd January 30, 2016 +.Dd May 24, 2016 .Dt SH 1 .Os .Sh NAME @@ -1403,9 +1403,9 @@ may include any of the following formatt which are replaced by the given information: .Bl -tag -width indent .It Li \eH -The local hostname. -.It Li \eh The fully-qualified hostname. +.It Li \eh +The local hostname. .It Li \eW The final component of the current working directory. .It Li \ew From owner-svn-src-head@freebsd.org Wed May 25 02:51:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 608C2B47250; Wed, 25 May 2016 02:51:16 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E48010FE; Wed, 25 May 2016 02:51:16 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P2pFGa039029; Wed, 25 May 2016 02:51:15 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P2pFFM039028; Wed, 25 May 2016 02:51:15 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605250251.u4P2pFFM039028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 02:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300643 - head/bin/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 02:51:16 -0000 Author: truckman Date: Wed May 25 02:51:15 2016 New Revision: 300643 URL: https://svnweb.freebsd.org/changeset/base/300643 Log: Close from_fd if malloc() fails to avoid a file descriptor leak. Reported by: Coverity CID: 1007203 MFC after: 1 week Modified: head/bin/mv/mv.c Modified: head/bin/mv/mv.c ============================================================================== --- head/bin/mv/mv.c Wed May 25 02:10:30 2016 (r300642) +++ head/bin/mv/mv.c Wed May 25 02:51:15 2016 (r300643) @@ -286,6 +286,7 @@ fastcopy(const char *from, const char *t } if (bp == NULL && (bp = malloc((size_t)blen)) == NULL) { warnx("malloc(%u) failed", blen); + (void)close(from_fd); return (1); } while ((to_fd = From owner-svn-src-head@freebsd.org Wed May 25 03:30:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D9DDB478DE; Wed, 25 May 2016 03:30:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04BA91EDB; Wed, 25 May 2016 03:30:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P3UuJO052570; Wed, 25 May 2016 03:30:56 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P3Uuw0052569; Wed, 25 May 2016 03:30:56 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605250330.u4P3Uuw0052569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 25 May 2016 03:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300644 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 03:30:57 -0000 Author: sephe Date: Wed May 25 03:30:56 2016 New Revision: 300644 URL: https://svnweb.freebsd.org/changeset/base/300644 Log: hyperv/vmbus: Check hyperv_dmamem_alloc return value Though it is highly unlikely this function would fail w/ BUS_DMA_WAITOK, we had better to check its return value; better safe then sorry here. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6518 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 02:51:15 2016 (r300643) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 03:30:56 2016 (r300644) @@ -321,24 +321,34 @@ vmbus_synic_teardown(void *arg) wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); } -static void +static int vmbus_dma_alloc(struct vmbus_softc *sc) { int cpu; CPU_FOREACH(cpu) { + void *ptr; + /* * Per-cpu messages and event flags. */ - VMBUS_PCPU_GET(sc, message, cpu) = hyperv_dmamem_alloc( - bus_get_dma_tag(sc->vmbus_dev), PAGE_SIZE, 0, PAGE_SIZE, + ptr = hyperv_dmamem_alloc(bus_get_dma_tag(sc->vmbus_dev), + PAGE_SIZE, 0, PAGE_SIZE, VMBUS_PCPU_PTR(sc, message_dma, cpu), BUS_DMA_WAITOK | BUS_DMA_ZERO); - VMBUS_PCPU_GET(sc, event_flag, cpu) = hyperv_dmamem_alloc( - bus_get_dma_tag(sc->vmbus_dev), PAGE_SIZE, 0, PAGE_SIZE, + if (ptr == NULL) + return ENOMEM; + VMBUS_PCPU_GET(sc, message, cpu) = ptr; + + ptr = hyperv_dmamem_alloc(bus_get_dma_tag(sc->vmbus_dev), + PAGE_SIZE, 0, PAGE_SIZE, VMBUS_PCPU_PTR(sc, event_flag_dma, cpu), BUS_DMA_WAITOK | BUS_DMA_ZERO); + if (ptr == NULL) + return ENOMEM; + VMBUS_PCPU_GET(sc, event_flag, cpu) = ptr; } + return 0; } static void @@ -622,7 +632,9 @@ vmbus_bus_init(void) /* * Allocate DMA stuffs. */ - vmbus_dma_alloc(sc); + ret = vmbus_dma_alloc(sc); + if (ret != 0) + goto cleanup; if (bootverbose) printf("VMBUS: Calling smp_rendezvous, smp_started = %d\n", From owner-svn-src-head@freebsd.org Wed May 25 03:39:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9E04B47B8B; Wed, 25 May 2016 03:39:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FB4613A1; Wed, 25 May 2016 03:39:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P3dgaX054879; Wed, 25 May 2016 03:39:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P3dgKv054878; Wed, 25 May 2016 03:39:42 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605250339.u4P3dgKv054878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 25 May 2016 03:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300645 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 03:39:43 -0000 Author: sephe Date: Wed May 25 03:39:42 2016 New Revision: 300645 URL: https://svnweb.freebsd.org/changeset/base/300645 Log: hyperv/vmbus: Allocate/setup IDT vector after all ISR resources are ready And release IDT vector before releasing ISR resources on interrupt teardown path. We still have some work to do on the interrupt tearing down path. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6519 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 03:30:56 2016 (r300644) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 03:39:42 2016 (r300645) @@ -377,34 +377,17 @@ vmbus_intr_setup(struct vmbus_softc *sc) { int cpu; - /* - * Find a free IDT vector for vmbus messages/events. - */ - sc->vmbus_idtvec = lapic_ipi_alloc(IDTVEC(hv_vmbus_callback)); - if (sc->vmbus_idtvec < 0) { - device_printf(sc->vmbus_dev, "cannot find free IDT vector\n"); - return ENXIO; - } - if(bootverbose) { - device_printf(sc->vmbus_dev, "vmbus IDT vector %d\n", - sc->vmbus_idtvec); - } - CPU_FOREACH(cpu) { char buf[MAXCOMLEN + 1]; + cpuset_t cpu_mask; + /* Allocate an interrupt counter for Hyper-V interrupt */ snprintf(buf, sizeof(buf), "cpu%d:hyperv", cpu); intrcnt_add(buf, VMBUS_PCPU_PTR(sc, intr_cnt, cpu)); - } - - /* - * Per cpu setup. - */ - CPU_FOREACH(cpu) { - cpuset_t cpu_mask; /* - * Setup taskqueue to handle events + * Setup taskqueue to handle events. Task will be per- + * channel. */ hv_vmbus_g_context.hv_event_queue[cpu] = taskqueue_create_fast("hyperv event", M_WAITOK, @@ -416,7 +399,7 @@ vmbus_intr_setup(struct vmbus_softc *sc) &cpu_mask, "hvevent%d", cpu); /* - * Setup per-cpu tasks and taskqueues to handle msg. + * Setup tasks and taskqueues to handle messages. */ hv_vmbus_g_context.hv_msg_tq[cpu] = taskqueue_create_fast( "hyperv msg", M_WAITOK, taskqueue_thread_enqueue, @@ -428,6 +411,20 @@ vmbus_intr_setup(struct vmbus_softc *sc) TASK_INIT(&hv_vmbus_g_context.hv_msg_task[cpu], 0, vmbus_msg_task, sc); } + + /* + * All Hyper-V ISR required resources are setup, now let's find a + * free IDT vector for Hyper-V ISR and set it up. + */ + sc->vmbus_idtvec = lapic_ipi_alloc(IDTVEC(hv_vmbus_callback)); + if (sc->vmbus_idtvec < 0) { + device_printf(sc->vmbus_dev, "cannot find free IDT vector\n"); + return ENXIO; + } + if(bootverbose) { + device_printf(sc->vmbus_dev, "vmbus IDT vector %d\n", + sc->vmbus_idtvec); + } return 0; } @@ -436,6 +433,11 @@ vmbus_intr_teardown(struct vmbus_softc * { int cpu; + if (sc->vmbus_idtvec >= 0) { + lapic_ipi_free(sc->vmbus_idtvec); + sc->vmbus_idtvec = -1; + } + CPU_FOREACH(cpu) { if (hv_vmbus_g_context.hv_event_queue[cpu] != NULL) { taskqueue_free(hv_vmbus_g_context.hv_event_queue[cpu]); @@ -448,10 +450,6 @@ vmbus_intr_teardown(struct vmbus_softc * hv_vmbus_g_context.hv_msg_tq[cpu] = NULL; } } - if (sc->vmbus_idtvec >= 0) { - lapic_ipi_free(sc->vmbus_idtvec); - sc->vmbus_idtvec = -1; - } } static int @@ -623,16 +621,16 @@ vmbus_bus_init(void) sc = vmbus_get_softc(); /* - * Setup interrupt. + * Allocate DMA stuffs. */ - ret = vmbus_intr_setup(sc); + ret = vmbus_dma_alloc(sc); if (ret != 0) goto cleanup; /* - * Allocate DMA stuffs. + * Setup interrupt. */ - ret = vmbus_dma_alloc(sc); + ret = vmbus_intr_setup(sc); if (ret != 0) goto cleanup; @@ -664,8 +662,8 @@ vmbus_bus_init(void) return (ret); cleanup: - vmbus_dma_free(sc); vmbus_intr_teardown(sc); + vmbus_dma_free(sc); return (ret); } @@ -732,8 +730,8 @@ vmbus_detach(device_t dev) smp_rendezvous(NULL, vmbus_synic_teardown, NULL, NULL); - vmbus_dma_free(sc); vmbus_intr_teardown(sc); + vmbus_dma_free(sc); return (0); } From owner-svn-src-head@freebsd.org Wed May 25 04:59:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E5B0B48958; Wed, 25 May 2016 04:59:21 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E7031FCD; Wed, 25 May 2016 04:59:21 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P4xKsI078861; Wed, 25 May 2016 04:59:20 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P4xK1L078857; Wed, 25 May 2016 04:59:20 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605250459.u4P4xK1L078857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 25 May 2016 04:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300646 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 04:59:21 -0000 Author: sephe Date: Wed May 25 04:59:20 2016 New Revision: 300646 URL: https://svnweb.freebsd.org/changeset/base/300646 Log: hyperv/vmbus: Move event/message taskqueue/task to vmbus softc MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6520 Modified: head/sys/dev/hyperv/vmbus/hv_channel.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Wed May 25 03:39:42 2016 (r300645) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Wed May 25 04:59:20 2016 (r300646) @@ -202,7 +202,8 @@ hv_vmbus_channel_open( vmbus_on_channel_open(new_channel); - new_channel->rxq = hv_vmbus_g_context.hv_event_queue[new_channel->target_cpu]; + new_channel->rxq = VMBUS_PCPU_GET(vmbus_get_softc(), event_tq, + new_channel->target_cpu); TASK_INIT(&new_channel->channel_task, 0, VmbusProcessChannelEvent, new_channel); /* Allocate the ring buffer */ Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 03:39:42 2016 (r300645) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 04:59:20 2016 (r300646) @@ -177,8 +177,8 @@ hv_vmbus_isr(struct vmbus_softc *sc, str msg = msg_base + HV_VMBUS_MESSAGE_SINT; if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { - taskqueue_enqueue(hv_vmbus_g_context.hv_msg_tq[cpu], - &hv_vmbus_g_context.hv_msg_task[cpu]); + taskqueue_enqueue(VMBUS_PCPU_GET(sc, message_tq, cpu), + VMBUS_PCPU_PTR(sc, message_task, cpu)); } return (FILTER_HANDLED); @@ -389,26 +389,25 @@ vmbus_intr_setup(struct vmbus_softc *sc) * Setup taskqueue to handle events. Task will be per- * channel. */ - hv_vmbus_g_context.hv_event_queue[cpu] = - taskqueue_create_fast("hyperv event", M_WAITOK, - taskqueue_thread_enqueue, - &hv_vmbus_g_context.hv_event_queue[cpu]); + VMBUS_PCPU_GET(sc, event_tq, cpu) = taskqueue_create_fast( + "hyperv event", M_WAITOK, taskqueue_thread_enqueue, + VMBUS_PCPU_PTR(sc, event_tq, cpu)); CPU_SETOF(cpu, &cpu_mask); taskqueue_start_threads_cpuset( - &hv_vmbus_g_context.hv_event_queue[cpu], 1, PI_NET, - &cpu_mask, "hvevent%d", cpu); + VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, &cpu_mask, + "hvevent%d", cpu); /* * Setup tasks and taskqueues to handle messages. */ - hv_vmbus_g_context.hv_msg_tq[cpu] = taskqueue_create_fast( + VMBUS_PCPU_GET(sc, message_tq, cpu) = taskqueue_create_fast( "hyperv msg", M_WAITOK, taskqueue_thread_enqueue, - &hv_vmbus_g_context.hv_msg_tq[cpu]); + VMBUS_PCPU_PTR(sc, message_tq, cpu)); CPU_SETOF(cpu, &cpu_mask); taskqueue_start_threads_cpuset( - &hv_vmbus_g_context.hv_msg_tq[cpu], 1, PI_NET, - &cpu_mask, "hvmsg%d", cpu); - TASK_INIT(&hv_vmbus_g_context.hv_msg_task[cpu], 0, + VMBUS_PCPU_PTR(sc, message_tq, cpu), 1, PI_NET, &cpu_mask, + "hvmsg%d", cpu); + TASK_INIT(VMBUS_PCPU_PTR(sc, message_task, cpu), 0, vmbus_msg_task, sc); } @@ -439,15 +438,15 @@ vmbus_intr_teardown(struct vmbus_softc * } CPU_FOREACH(cpu) { - if (hv_vmbus_g_context.hv_event_queue[cpu] != NULL) { - taskqueue_free(hv_vmbus_g_context.hv_event_queue[cpu]); - hv_vmbus_g_context.hv_event_queue[cpu] = NULL; + if (VMBUS_PCPU_GET(sc, event_tq, cpu) != NULL) { + taskqueue_free(VMBUS_PCPU_GET(sc, event_tq, cpu)); + VMBUS_PCPU_GET(sc, event_tq, cpu) = NULL; } - if (hv_vmbus_g_context.hv_msg_tq[cpu] != NULL) { - taskqueue_drain(hv_vmbus_g_context.hv_msg_tq[cpu], - &hv_vmbus_g_context.hv_msg_task[cpu]); - taskqueue_free(hv_vmbus_g_context.hv_msg_tq[cpu]); - hv_vmbus_g_context.hv_msg_tq[cpu] = NULL; + if (VMBUS_PCPU_GET(sc, message_tq, cpu) != NULL) { + taskqueue_drain(VMBUS_PCPU_GET(sc, message_tq, cpu), + VMBUS_PCPU_PTR(sc, message_task, cpu)); + taskqueue_free(VMBUS_PCPU_GET(sc, message_tq, cpu)); + VMBUS_PCPU_GET(sc, message_tq, cpu) = NULL; } } } Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed May 25 03:39:42 2016 (r300645) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed May 25 04:59:20 2016 (r300646) @@ -207,13 +207,6 @@ typedef struct { * For FreeBSD cpuid to Hyper-V vcpuid mapping. */ uint32_t hv_vcpu_index[MAXCPU]; - /* - * Each cpu has its own software interrupt handler for channel - * event and msg handling. - */ - struct taskqueue *hv_event_queue[MAXCPU]; - struct taskqueue *hv_msg_tq[MAXCPU]; - struct task hv_msg_task[MAXCPU]; } hv_vmbus_context; /* Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Wed May 25 03:39:42 2016 (r300645) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Wed May 25 04:59:20 2016 (r300646) @@ -42,11 +42,16 @@ struct vmbus_pcpu_data { /* Rarely used fields */ struct hyperv_dma message_dma; /* busdma glue */ struct hyperv_dma event_flag_dma; /* busdma glue */ + struct taskqueue *event_tq; /* event taskq */ + struct taskqueue *message_tq; /* message taskq */ + struct task message_task; /* message task */ } __aligned(CACHE_LINE_SIZE); struct vmbus_softc { void (*vmbus_event_proc)(struct vmbus_softc *, int); struct vmbus_pcpu_data vmbus_pcpu[MAXCPU]; + + /* Rarely used fields */ device_t vmbus_dev; int vmbus_idtvec; }; From owner-svn-src-head@freebsd.org Wed May 25 05:06:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2987BB48B12; Wed, 25 May 2016 05:06:17 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E691213E6; Wed, 25 May 2016 05:06:16 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P56GVK081739; Wed, 25 May 2016 05:06:16 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P56FNL081735; Wed, 25 May 2016 05:06:15 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605250506.u4P56FNL081735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 25 May 2016 05:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300647 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 05:06:17 -0000 Author: sephe Date: Wed May 25 05:06:15 2016 New Revision: 300647 URL: https://svnweb.freebsd.org/changeset/base/300647 Log: hyperv/vmbus: Move vcpuid into vmbus softc per-cpu data MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6521 Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed May 25 04:59:20 2016 (r300646) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed May 25 05:06:15 2016 (r300647) @@ -32,7 +32,8 @@ #include #include -#include "hv_vmbus_priv.h" +#include +#include /* * Internal functions @@ -301,7 +302,7 @@ vmbus_channel_cpu_set(struct hv_vmbus_ch KASSERT(cpu >= 0 && cpu < mp_ncpus, ("invalid cpu %d", cpu)); chan->target_cpu = cpu; - chan->target_vcpu = hv_vmbus_g_context.hv_vcpu_index[cpu]; + chan->target_vcpu = VMBUS_PCPU_GET(vmbus_get_softc(), vcpuid, cpu); if (bootverbose) { printf("vmbus_chan%u: assigned to cpu%u [vcpu%u]\n", @@ -744,7 +745,7 @@ vmbus_select_outgoing_channel(struct hv_ return outgoing_channel; } - cur_vcpu = hv_vmbus_g_context.hv_vcpu_index[smp_pro_id]; + cur_vcpu = VMBUS_PCPU_GET(vmbus_get_softc(), vcpuid, smp_pro_id); TAILQ_FOREACH(new_channel, &primary->sc_list_anchor, sc_list_entry) { if (new_channel->state != HV_CHANNEL_OPENED_STATE){ Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 04:59:20 2016 (r300646) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 05:06:15 2016 (r300647) @@ -213,7 +213,6 @@ vmbus_synic_setup(void *arg __unused) { struct vmbus_softc *sc = vmbus_get_softc(); int cpu; - uint64_t hv_vcpu_index; hv_vmbus_synic_simp simp; hv_vmbus_synic_siefp siefp; hv_vmbus_synic_scontrol sctrl; @@ -271,8 +270,7 @@ vmbus_synic_setup(void *arg __unused) * Set up the cpuid mapping from Hyper-V to FreeBSD. * The array is indexed using FreeBSD cpuid. */ - hv_vcpu_index = rdmsr(HV_X64_MSR_VP_INDEX); - hv_vmbus_g_context.hv_vcpu_index[cpu] = (uint32_t)hv_vcpu_index; + VMBUS_PCPU_GET(sc, vcpuid, cpu) = rdmsr(HV_X64_MSR_VP_INDEX); } static void Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed May 25 04:59:20 2016 (r300646) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed May 25 05:06:15 2016 (r300647) @@ -202,11 +202,6 @@ union vmbus_event_flags; typedef struct { hv_bool_uint8_t syn_ic_initialized; - - /* - * For FreeBSD cpuid to Hyper-V vcpuid mapping. - */ - uint32_t hv_vcpu_index[MAXCPU]; } hv_vmbus_context; /* Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Wed May 25 04:59:20 2016 (r300646) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Wed May 25 05:06:15 2016 (r300647) @@ -36,6 +36,7 @@ struct vmbus_pcpu_data { u_long *intr_cnt; /* Hyper-V interrupt counter */ struct vmbus_message *message; /* shared messages */ + uint32_t vcpuid; /* virtual cpuid */ int event_flag_cnt; /* # of event flags */ union vmbus_event_flags *event_flag; /* shared event flags */ From owner-svn-src-head@freebsd.org Wed May 25 05:12:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C6FFB48C99; Wed, 25 May 2016 05:12:58 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0AFD1977; Wed, 25 May 2016 05:12:57 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P5CubY084604; Wed, 25 May 2016 05:12:56 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P5CuvH084602; Wed, 25 May 2016 05:12:56 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605250512.u4P5CuvH084602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 05:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300648 - head/bin/ps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 05:12:58 -0000 Author: truckman Date: Wed May 25 05:12:56 2016 New Revision: 300648 URL: https://svnweb.freebsd.org/changeset/base/300648 Log: Fix CID 1011370 (Resource leak) in ps. There is no need to to call strdup() on the value returned by fmt(). The latter calls fmt_argv() which always returns a dynamically allocated string, and calling strdup() on that leaks the memory allocated by fmt_argv(). Wave some const magic on ki_args and ki_env to make the direct assignment happy. This requires a tweak to the asprintf() case to avoid a const vs. non-const mismatch. Reported by: Coverity CID: 1011370 MFC after: 1 week Modified: head/bin/ps/ps.c head/bin/ps/ps.h Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Wed May 25 05:06:15 2016 (r300647) +++ head/bin/ps/ps.c Wed May 25 05:12:56 2016 (r300648) @@ -1235,6 +1235,7 @@ fmt(char **(*fn)(kvm_t *, const struct k static void saveuser(KINFO *ki) { + char *argsp; if (ki->ki_p->ki_flag & P_INMEM) { /* @@ -1253,10 +1254,12 @@ saveuser(KINFO *ki) if (ki->ki_p->ki_stat == SZOMB) ki->ki_args = strdup(""); else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) - ki->ki_args = strdup(fmt(kvm_getargv, ki, - ki->ki_p->ki_comm, ki->ki_p->ki_tdname, MAXCOMLEN)); - else - asprintf(&ki->ki_args, "(%s)", ki->ki_p->ki_comm); + ki->ki_args = fmt(kvm_getargv, ki, + ki->ki_p->ki_comm, ki->ki_p->ki_tdname, MAXCOMLEN); + else { + asprintf(&argsp, "(%s)", ki->ki_p->ki_comm); + ki->ki_args = argsp; + } if (ki->ki_args == NULL) xo_errx(1, "malloc failed"); } else { @@ -1264,8 +1267,8 @@ saveuser(KINFO *ki) } if (needenv) { if (UREADOK(ki)) - ki->ki_env = strdup(fmt(kvm_getenvv, ki, - (char *)NULL, (char *)NULL, 0)); + ki->ki_env = fmt(kvm_getenvv, ki, + (char *)NULL, (char *)NULL, 0); else ki->ki_env = strdup("()"); if (ki->ki_env == NULL) Modified: head/bin/ps/ps.h ============================================================================== --- head/bin/ps/ps.h Wed May 25 05:06:15 2016 (r300647) +++ head/bin/ps/ps.h Wed May 25 05:12:56 2016 (r300648) @@ -42,8 +42,8 @@ typedef struct kinfo_str { typedef struct kinfo { struct kinfo_proc *ki_p; /* kinfo_proc structure */ - char *ki_args; /* exec args */ - char *ki_env; /* environment */ + const char *ki_args; /* exec args */ + const char *ki_env; /* environment */ int ki_valid; /* 1 => uarea stuff valid */ double ki_pcpu; /* calculated in main() */ segsz_t ki_memsize; /* calculated in main() */ From owner-svn-src-head@freebsd.org Wed May 25 05:20:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1357B48D38; Wed, 25 May 2016 05:20:35 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BAE21C82; Wed, 25 May 2016 05:20:35 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P5KYi4087036; Wed, 25 May 2016 05:20:34 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P5KY9e087035; Wed, 25 May 2016 05:20:34 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605250520.u4P5KY9e087035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 05:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300649 - head/bin/setfacl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 05:20:35 -0000 Author: truckman Date: Wed May 25 05:20:34 2016 New Revision: 300649 URL: https://svnweb.freebsd.org/changeset/base/300649 Log: Fix Coverity CID 1019054 (String not null terminated) in setfacl. Increase the size of buf[] by one to allow room for a NUL character at the end. Reported by: Coverity CID: 1019054 MFC after: 1 week Modified: head/bin/setfacl/file.c Modified: head/bin/setfacl/file.c ============================================================================== --- head/bin/setfacl/file.c Wed May 25 05:12:56 2016 (r300648) +++ head/bin/setfacl/file.c Wed May 25 05:20:34 2016 (r300649) @@ -43,7 +43,7 @@ acl_t get_acl_from_file(const char *filename) { FILE *file; - char buf[BUFSIZ]; + char buf[BUFSIZ+1]; if (filename == NULL) err(1, "(null) filename in get_acl_from_file()"); @@ -61,7 +61,7 @@ get_acl_from_file(const char *filename) err(1, "fopen() %s failed", filename); } - fread(buf, sizeof(buf), (size_t)1, file); + fread(buf, sizeof(buf) - 1, (size_t)1, file); if (ferror(file) != 0) { fclose(file); err(1, "error reading from %s", filename); From owner-svn-src-head@freebsd.org Wed May 25 05:22:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BF1CB48F45; Wed, 25 May 2016 05:22:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AF951045; Wed, 25 May 2016 05:22:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P5MaH2087789; Wed, 25 May 2016 05:22:36 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P5Maiw087785; Wed, 25 May 2016 05:22:36 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605250522.u4P5Maiw087785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 25 May 2016 05:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300650 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 05:22:37 -0000 Author: sephe Date: Wed May 25 05:22:35 2016 New Revision: 300650 URL: https://svnweb.freebsd.org/changeset/base/300650 Log: hyperv/vmbus: Move two global flags into vmbus softc And pack them into one flag field. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6522 Modified: head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Wed May 25 05:20:34 2016 (r300649) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Wed May 25 05:22:35 2016 (r300650) @@ -96,13 +96,6 @@ u_int hyperv_recommends; static u_int hyperv_pm_features; static u_int hyperv_features3; -/** - * Globals - */ -hv_vmbus_context hv_vmbus_g_context = { - .syn_ic_initialized = FALSE, -}; - static struct timecounter hv_timecounter = { hv_get_timecount, 0, ~0u, HV_NANOSECONDS_PER_SEC/100, "Hyper-V", HV_NANOSECONDS_PER_SEC/100 }; Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 05:20:34 2016 (r300649) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 05:22:35 2016 (r300650) @@ -68,8 +68,6 @@ __FBSDID("$FreeBSD$"); struct vmbus_softc *vmbus_sc; -static int vmbus_inited; - static char *vmbus_ids[] = { "VMBUS", NULL }; extern inthand_t IDTVEC(hv_vmbus_callback); @@ -264,8 +262,6 @@ vmbus_synic_setup(void *arg __unused) wrmsr(HV_X64_MSR_SCONTROL, sctrl.as_uint64_t); - hv_vmbus_g_context.syn_ic_initialized = TRUE; - /* * Set up the cpuid mapping from Hyper-V to FreeBSD. * The array is indexed using FreeBSD cpuid. @@ -280,9 +276,6 @@ vmbus_synic_teardown(void *arg) hv_vmbus_synic_simp simp; hv_vmbus_synic_siefp siefp; - if (!hv_vmbus_g_context.syn_ic_initialized) - return; - shared_sint.as_uint64_t = rdmsr( HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT); @@ -608,14 +601,12 @@ vmbus_probe(device_t dev) static int vmbus_bus_init(void) { - struct vmbus_softc *sc; + struct vmbus_softc *sc = vmbus_get_softc(); int ret; - if (vmbus_inited) + if (sc->vmbus_flags & VMBUS_FLAG_ATTACHED) return (0); - - vmbus_inited = 1; - sc = vmbus_get_softc(); + sc->vmbus_flags |= VMBUS_FLAG_ATTACHED; /* * Allocate DMA stuffs. @@ -631,10 +622,13 @@ vmbus_bus_init(void) if (ret != 0) goto cleanup; + /* + * Setup SynIC. + */ if (bootverbose) - printf("VMBUS: Calling smp_rendezvous, smp_started = %d\n", - smp_started); + device_printf(sc->vmbus_dev, "smp_started = %d\n", smp_started); smp_rendezvous(NULL, vmbus_synic_setup, NULL, NULL); + sc->vmbus_flags |= VMBUS_FLAG_SYNIC; /* * Connect to VMBus in the root partition @@ -725,7 +719,10 @@ vmbus_detach(device_t dev) hv_vmbus_release_unattached_channels(); hv_vmbus_disconnect(); - smp_rendezvous(NULL, vmbus_synic_teardown, NULL, NULL); + if (sc->vmbus_flags & VMBUS_FLAG_SYNIC) { + sc->vmbus_flags &= ~VMBUS_FLAG_SYNIC; + smp_rendezvous(NULL, vmbus_synic_teardown, NULL, NULL); + } vmbus_intr_teardown(sc); vmbus_dma_free(sc); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed May 25 05:20:34 2016 (r300649) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed May 25 05:22:35 2016 (r300650) @@ -200,10 +200,6 @@ enum { struct vmbus_message; union vmbus_event_flags; -typedef struct { - hv_bool_uint8_t syn_ic_initialized; -} hv_vmbus_context; - /* * Define hypervisor message types */ @@ -635,7 +631,6 @@ typedef enum { * Global variables */ -extern hv_vmbus_context hv_vmbus_g_context; extern hv_vmbus_connection hv_vmbus_g_connection; extern u_int hyperv_features; Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Wed May 25 05:20:34 2016 (r300649) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Wed May 25 05:22:35 2016 (r300650) @@ -55,8 +55,12 @@ struct vmbus_softc { /* Rarely used fields */ device_t vmbus_dev; int vmbus_idtvec; + uint32_t vmbus_flags; /* see VMBUS_FLAG_ */ }; +#define VMBUS_FLAG_ATTACHED 0x0001 /* vmbus was attached */ +#define VMBUS_FLAG_SYNIC 0x0002 /* SynIC was setup */ + extern struct vmbus_softc *vmbus_sc; static __inline struct vmbus_softc * From owner-svn-src-head@freebsd.org Wed May 25 05:30:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17B3BB490E4; Wed, 25 May 2016 05:30:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3762127E; Wed, 25 May 2016 05:30:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P5UmNV088085; Wed, 25 May 2016 05:30:48 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P5UmUZ088084; Wed, 25 May 2016 05:30:48 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605250530.u4P5UmUZ088084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 25 May 2016 05:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300651 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 05:30:50 -0000 Author: sephe Date: Wed May 25 05:30:48 2016 New Revision: 300651 URL: https://svnweb.freebsd.org/changeset/base/300651 Log: hyperv/vmbus: Minor style and white space cleanup MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6523 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 05:22:35 2016 (r300650) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 05:30:48 2016 (r300651) @@ -443,16 +443,11 @@ vmbus_intr_teardown(struct vmbus_softc * } static int -vmbus_read_ivar( - device_t dev, - device_t child, - int index, - uintptr_t* result) +vmbus_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) { struct hv_device *child_dev_ctx = device_get_ivars(child); switch (index) { - case HV_VMBUS_IVAR_TYPE: *result = (uintptr_t) &child_dev_ctx->class_id; return (0); @@ -470,14 +465,9 @@ vmbus_read_ivar( } static int -vmbus_write_ivar( - device_t dev, - device_t child, - int index, - uintptr_t value) +vmbus_write_ivar(device_t dev, device_t child, int index, uintptr_t value) { switch (index) { - case HV_VMBUS_IVAR_TYPE: case HV_VMBUS_IVAR_INSTANCE: case HV_VMBUS_IVAR_DEVCTX: @@ -508,19 +498,16 @@ vmbus_child_pnpinfo_str(device_t dev, de return (0); } -struct hv_device* -hv_vmbus_child_device_create( - hv_guid type, - hv_guid instance, - hv_vmbus_channel* channel) +struct hv_device * +hv_vmbus_child_device_create(hv_guid type, hv_guid instance, + hv_vmbus_channel *channel) { - hv_device* child_dev; + hv_device *child_dev; /* * Allocate the new child device */ - child_dev = malloc(sizeof(hv_device), M_DEVBUF, - M_WAITOK | M_ZERO); + child_dev = malloc(sizeof(hv_device), M_DEVBUF, M_WAITOK | M_ZERO); child_dev->channel = channel; memcpy(&child_dev->class_id, &type, sizeof(hv_guid)); From owner-svn-src-head@freebsd.org Wed May 25 05:37:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DFC8B491E0; Wed, 25 May 2016 05:37:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 512881883; Wed, 25 May 2016 05:37:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P5bgDK090946; Wed, 25 May 2016 05:37:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P5bgEK090945; Wed, 25 May 2016 05:37:42 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605250537.u4P5bgEK090945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 25 May 2016 05:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300652 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 05:37:43 -0000 Author: sephe Date: Wed May 25 05:37:42 2016 New Revision: 300652 URL: https://svnweb.freebsd.org/changeset/base/300652 Log: hyperv/vmbus: Pass vmbus softc to vmbus_synic_setup MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6527 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 05:30:48 2016 (r300651) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 05:37:42 2016 (r300652) @@ -207,9 +207,9 @@ hv_vector_handler(struct trapframe *trap } static void -vmbus_synic_setup(void *arg __unused) +vmbus_synic_setup(void *xsc) { - struct vmbus_softc *sc = vmbus_get_softc(); + struct vmbus_softc *sc = xsc; int cpu; hv_vmbus_synic_simp simp; hv_vmbus_synic_siefp siefp; @@ -614,7 +614,7 @@ vmbus_bus_init(void) */ if (bootverbose) device_printf(sc->vmbus_dev, "smp_started = %d\n", smp_started); - smp_rendezvous(NULL, vmbus_synic_setup, NULL, NULL); + smp_rendezvous(NULL, vmbus_synic_setup, NULL, sc); sc->vmbus_flags |= VMBUS_FLAG_SYNIC; /* From owner-svn-src-head@freebsd.org Wed May 25 05:45:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 698B3B4932D; Wed, 25 May 2016 05:45:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25F651D21; Wed, 25 May 2016 05:45:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P5jhAW093851; Wed, 25 May 2016 05:45:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P5jhHX093850; Wed, 25 May 2016 05:45:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605250545.u4P5jhHX093850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 25 May 2016 05:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300653 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 05:45:44 -0000 Author: sephe Date: Wed May 25 05:45:43 2016 New Revision: 300653 URL: https://svnweb.freebsd.org/changeset/base/300653 Log: hyperv/vmbus: Nuke unnecessary MSR read MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6528 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 05:37:42 2016 (r300652) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 05:45:43 2016 (r300653) @@ -215,16 +215,10 @@ vmbus_synic_setup(void *xsc) hv_vmbus_synic_siefp siefp; hv_vmbus_synic_scontrol sctrl; hv_vmbus_synic_sint shared_sint; - uint64_t version; cpu = PCPU_GET(cpuid); /* - * TODO: Check the version - */ - version = rdmsr(HV_X64_MSR_SVERSION); - - /* * Setup the Synic's message page */ simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); From owner-svn-src-head@freebsd.org Wed May 25 05:53:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C3B4B494A0; Wed, 25 May 2016 05:53:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13AC911A9; Wed, 25 May 2016 05:53:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P5rD20096903; Wed, 25 May 2016 05:53:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P5rDo1096901; Wed, 25 May 2016 05:53:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605250553.u4P5rDo1096901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 25 May 2016 05:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300654 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 05:53:14 -0000 Author: sephe Date: Wed May 25 05:53:12 2016 New Revision: 300654 URL: https://svnweb.freebsd.org/changeset/base/300654 Log: hyperv/vmbus: Rework SynIC setup and teardown - Avoid bit fields. - Fix SINT setup (preserve required bits). MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6529 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hyperv_reg.h Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 05:45:43 2016 (r300653) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 25 05:53:12 2016 (r300654) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -210,100 +211,97 @@ static void vmbus_synic_setup(void *xsc) { struct vmbus_softc *sc = xsc; - int cpu; - hv_vmbus_synic_simp simp; - hv_vmbus_synic_siefp siefp; - hv_vmbus_synic_scontrol sctrl; - hv_vmbus_synic_sint shared_sint; - - cpu = PCPU_GET(cpuid); + int cpu = curcpu; + uint64_t val, orig; + uint32_t sint; /* - * Setup the Synic's message page + * Save virtual processor id. */ - simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); - simp.u.simp_enabled = 1; - simp.u.base_simp_gpa = - VMBUS_PCPU_GET(sc, message_dma.hv_paddr, cpu) >> PAGE_SHIFT; - - wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t); + VMBUS_PCPU_GET(sc, vcpuid, cpu) = rdmsr(MSR_HV_VP_INDEX); /* - * Setup the Synic's event page + * Setup the SynIC message. */ - siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP); - siefp.u.siefp_enabled = 1; - siefp.u.base_siefp_gpa = - VMBUS_PCPU_GET(sc, event_flag_dma.hv_paddr, cpu) >> PAGE_SHIFT; + orig = rdmsr(MSR_HV_SIMP); + val = MSR_HV_SIMP_ENABLE | (orig & MSR_HV_SIMP_RSVD_MASK) | + ((VMBUS_PCPU_GET(sc, message_dma.hv_paddr, cpu) >> PAGE_SHIFT) << + MSR_HV_SIMP_PGSHIFT); + wrmsr(MSR_HV_SIMP, val); - wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); - - /*HV_SHARED_SINT_IDT_VECTOR + 0x20; */ - shared_sint.as_uint64_t = 0; - shared_sint.u.vector = sc->vmbus_idtvec; - shared_sint.u.masked = FALSE; - shared_sint.u.auto_eoi = TRUE; - - wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, - shared_sint.as_uint64_t); + /* + * Setup the SynIC event flags. + */ + orig = rdmsr(MSR_HV_SIEFP); + val = MSR_HV_SIEFP_ENABLE | (orig & MSR_HV_SIEFP_RSVD_MASK) | + ((VMBUS_PCPU_GET(sc, event_flag_dma.hv_paddr, cpu) >> PAGE_SHIFT) << + MSR_HV_SIEFP_PGSHIFT); + wrmsr(MSR_HV_SIEFP, val); - wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT, - shared_sint.as_uint64_t); - /* Enable the global synic bit */ - sctrl.as_uint64_t = rdmsr(HV_X64_MSR_SCONTROL); - sctrl.u.enable = 1; + /* + * Configure and unmask SINT for message and event flags. + */ + sint = MSR_HV_SINT0 + HV_VMBUS_MESSAGE_SINT; + orig = rdmsr(sint); + val = sc->vmbus_idtvec | MSR_HV_SINT_AUTOEOI | + (orig & MSR_HV_SINT_RSVD_MASK); + wrmsr(sint, val); - wrmsr(HV_X64_MSR_SCONTROL, sctrl.as_uint64_t); + /* + * Configure and unmask SINT for timer. + */ + sint = MSR_HV_SINT0 + HV_VMBUS_TIMER_SINT; + orig = rdmsr(sint); + val = sc->vmbus_idtvec | MSR_HV_SINT_AUTOEOI | + (orig & MSR_HV_SINT_RSVD_MASK); + wrmsr(sint, val); /* - * Set up the cpuid mapping from Hyper-V to FreeBSD. - * The array is indexed using FreeBSD cpuid. + * All done; enable SynIC. */ - VMBUS_PCPU_GET(sc, vcpuid, cpu) = rdmsr(HV_X64_MSR_VP_INDEX); + orig = rdmsr(MSR_HV_SCONTROL); + val = MSR_HV_SCTRL_ENABLE | (orig & MSR_HV_SCTRL_RSVD_MASK); + wrmsr(MSR_HV_SCONTROL, val); } static void vmbus_synic_teardown(void *arg) { - hv_vmbus_synic_sint shared_sint; - hv_vmbus_synic_simp simp; - hv_vmbus_synic_siefp siefp; - - shared_sint.as_uint64_t = rdmsr( - HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT); - - shared_sint.u.masked = 1; + uint64_t orig; + uint32_t sint; /* - * Disable the interrupt 0 + * Disable SynIC. */ - wrmsr( - HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, - shared_sint.as_uint64_t); - - shared_sint.as_uint64_t = rdmsr( - HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT); - - shared_sint.u.masked = 1; + orig = rdmsr(MSR_HV_SCONTROL); + wrmsr(MSR_HV_SCONTROL, (orig & MSR_HV_SCTRL_RSVD_MASK)); /* - * Disable the interrupt 1 + * Mask message and event flags SINT. */ - wrmsr( - HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT, - shared_sint.as_uint64_t); - simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); - simp.u.simp_enabled = 0; - simp.u.base_simp_gpa = 0; + sint = MSR_HV_SINT0 + HV_VMBUS_MESSAGE_SINT; + orig = rdmsr(sint); + wrmsr(sint, orig | MSR_HV_SINT_MASKED); - wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t); + /* + * Mask timer SINT. + */ + sint = MSR_HV_SINT0 + HV_VMBUS_TIMER_SINT; + orig = rdmsr(sint); + wrmsr(sint, orig | MSR_HV_SINT_MASKED); - siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP); - siefp.u.siefp_enabled = 0; - siefp.u.base_siefp_gpa = 0; + /* + * Teardown SynIC message. + */ + orig = rdmsr(MSR_HV_SIMP); + wrmsr(MSR_HV_SIMP, (orig & MSR_HV_SIMP_RSVD_MASK)); - wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); + /* + * Teardown SynIC event flags. + */ + orig = rdmsr(MSR_HV_SIEFP); + wrmsr(MSR_HV_SIEFP, (orig & MSR_HV_SIEFP_RSVD_MASK)); } static int Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv_reg.h Wed May 25 05:45:43 2016 (r300653) +++ head/sys/dev/hyperv/vmbus/hyperv_reg.h Wed May 25 05:53:12 2016 (r300654) @@ -34,4 +34,29 @@ #define MSR_HV_HYPERCALL_RSVD_MASK 0x0ffeULL #define MSR_HV_HYPERCALL_PGSHIFT 12 +#define MSR_HV_VP_INDEX 0x40000002 + +#define MSR_HV_SCONTROL 0x40000080 +#define MSR_HV_SCTRL_ENABLE 0x0001ULL +#define MSR_HV_SCTRL_RSVD_MASK 0xfffffffffffffffeULL + +#define MSR_HV_SIEFP 0x40000082 +#define MSR_HV_SIEFP_ENABLE 0x0001ULL +#define MSR_HV_SIEFP_RSVD_MASK 0x0ffeULL +#define MSR_HV_SIEFP_PGSHIFT 12 + +#define MSR_HV_SIMP 0x40000083 +#define MSR_HV_SIMP_ENABLE 0x0001ULL +#define MSR_HV_SIMP_RSVD_MASK 0x0ffeULL +#define MSR_HV_SIMP_PGSHIFT 12 + +#define MSR_HV_SINT0 0x40000090 +#define MSR_HV_SINT_VECTOR_MASK 0x00ffULL +#define MSR_HV_SINT_RSVD1_MASK 0xff00ULL +#define MSR_HV_SINT_MASKED 0x00010000ULL +#define MSR_HV_SINT_AUTOEOI 0x00020000ULL +#define MSR_HV_SINT_RSVD2_MASK 0xfffffffffffc0000ULL +#define MSR_HV_SINT_RSVD_MASK (MSR_HV_SINT_RSVD1_MASK | \ + MSR_HV_SINT_RSVD2_MASK) + #endif /* !_HYPERV_REG_H_ */ From owner-svn-src-head@freebsd.org Wed May 25 06:01:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 075A2B495DA; Wed, 25 May 2016 06:01:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1C3E14C7; Wed, 25 May 2016 06:01:48 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P61lvG097996; Wed, 25 May 2016 06:01:47 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P61lkI097995; Wed, 25 May 2016 06:01:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605250601.u4P61lkI097995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 25 May 2016 06:01:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300655 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 06:01:49 -0000 Author: sephe Date: Wed May 25 06:01:47 2016 New Revision: 300655 URL: https://svnweb.freebsd.org/changeset/base/300655 Log: hyperv: Preserve required bits when disable Hypercall MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6530 Modified: head/sys/dev/hyperv/vmbus/hv_hv.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Wed May 25 05:53:12 2016 (r300654) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Wed May 25 06:01:47 2016 (r300655) @@ -390,11 +390,14 @@ SYSINIT(hypercall_ctor, SI_SUB_DRIVERS, static void hypercall_destroy(void *arg __unused) { + uint64_t hc; + if (hypercall_context.hc_addr == NULL) return; /* Disable Hypercall */ - wrmsr(MSR_HV_HYPERCALL, 0); + hc = rdmsr(MSR_HV_HYPERCALL); + wrmsr(MSR_HV_HYPERCALL, (hc & MSR_HV_HYPERCALL_RSVD_MASK)); hypercall_memfree(); if (bootverbose) From owner-svn-src-head@freebsd.org Wed May 25 06:29:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38091B4997C; Wed, 25 May 2016 06:29:25 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E45F41246; Wed, 25 May 2016 06:29:24 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P6TOCK006436; Wed, 25 May 2016 06:29:24 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P6TOQ6006434; Wed, 25 May 2016 06:29:24 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201605250629.u4P6TOQ6006434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Wed, 25 May 2016 06:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300657 - head/sys/dev/ral X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 06:29:25 -0000 Author: sgalabov Date: Wed May 25 06:29:23 2016 New Revision: 300657 URL: https://svnweb.freebsd.org/changeset/base/300657 Log: Align radiotap structures in ral(4) Currently all radiotap structures in ral(4) are packed, but are not aligned, which causes ral based devices to crash when one does 'ifconfig wlan0 up' for a wlan interface with a ral wlandev on arches that care about structure alignment (e.g., MIPS). Adding an aligned attribute helps fix this problem and ral devices can be properly brought up. Reviewed by: adrian Sponsored by: Smartcom - Bulgaria AD Modified: head/sys/dev/ral/rt2661var.h head/sys/dev/ral/rt2860var.h Modified: head/sys/dev/ral/rt2661var.h ============================================================================== --- head/sys/dev/ral/rt2661var.h Wed May 25 06:15:26 2016 (r300656) +++ head/sys/dev/ral/rt2661var.h Wed May 25 06:29:23 2016 (r300657) @@ -26,7 +26,7 @@ struct rt2661_rx_radiotap_header { uint16_t wr_chan_flags; int8_t wr_antsignal; int8_t wr_antnoise; -} __packed; +} __packed __aligned(8); #define RT2661_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_TSFT) | \ @@ -42,7 +42,7 @@ struct rt2661_tx_radiotap_header { uint8_t wt_rate; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define RT2661_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ Modified: head/sys/dev/ral/rt2860var.h ============================================================================== --- head/sys/dev/ral/rt2860var.h Wed May 25 06:15:26 2016 (r300656) +++ head/sys/dev/ral/rt2860var.h Wed May 25 06:29:23 2016 (r300657) @@ -38,7 +38,7 @@ struct rt2860_rx_radiotap_header { uint8_t wr_antenna; int8_t wr_antsignal; int8_t wr_antnoise; -} __packed; +} __packed __aligned(8); #define RT2860_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_TSFT) | \ @@ -55,7 +55,7 @@ struct rt2860_tx_radiotap_header { uint8_t wt_rate; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define RT2860_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ From owner-svn-src-head@freebsd.org Wed May 25 06:39:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FEEAB49C0C; Wed, 25 May 2016 06:39:58 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F18EF185B; Wed, 25 May 2016 06:39:57 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P6dvw5009606; Wed, 25 May 2016 06:39:57 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P6dmBB009514; Wed, 25 May 2016 06:39:48 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201605250639.u4P6dmBB009514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Wed, 25 May 2016 06:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300658 - head/sys/gnu/dts/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 06:39:58 -0000 Author: sgalabov Date: Wed May 25 06:39:48 2016 New Revision: 300658 URL: https://svnweb.freebsd.org/changeset/base/300658 Log: Bring ralink/mediatek DTS files in sync with LEDE This is the last sync with LEDE Project dts files before 11.0. Obtained from: LEDE Project Sponsored by: Smartcom - Bulgaria AD Modified: head/sys/gnu/dts/mips/3G150B.dts head/sys/gnu/dts/mips/3G300M.dts head/sys/gnu/dts/mips/A5-V11.dts head/sys/gnu/dts/mips/AIR3GII.dts head/sys/gnu/dts/mips/ALL0256N-4M.dts head/sys/gnu/dts/mips/ALL0256N-8M.dts head/sys/gnu/dts/mips/ALL5002.dts head/sys/gnu/dts/mips/ALL5003.dts head/sys/gnu/dts/mips/ASL26555-16M.dts head/sys/gnu/dts/mips/ASL26555-8M.dts head/sys/gnu/dts/mips/AWAPN2403.dts head/sys/gnu/dts/mips/AWM002.dtsi head/sys/gnu/dts/mips/ArcherC20i.dts head/sys/gnu/dts/mips/CF-WR800N.dts head/sys/gnu/dts/mips/CS-QR10.dts head/sys/gnu/dts/mips/DB-WRT01.dts head/sys/gnu/dts/mips/DCS-930L-B1.dts head/sys/gnu/dts/mips/DIR-300-B7.dts head/sys/gnu/dts/mips/DIR-320-B1.dts head/sys/gnu/dts/mips/DIR-610-A1.dts head/sys/gnu/dts/mips/DIR-615-H1.dts head/sys/gnu/dts/mips/DIR-620-D1.dts head/sys/gnu/dts/mips/DIR-645.dts head/sys/gnu/dts/mips/DIR-810L.dts head/sys/gnu/dts/mips/DIR-860L-B1.dts head/sys/gnu/dts/mips/E1700.dts head/sys/gnu/dts/mips/EX2700.dts head/sys/gnu/dts/mips/F7C027.dts head/sys/gnu/dts/mips/FIREWRT.dts head/sys/gnu/dts/mips/GL-MT300A.dts head/sys/gnu/dts/mips/GL-MT300N.dts head/sys/gnu/dts/mips/GL-MT750.dts head/sys/gnu/dts/mips/HC5XXX.dtsi head/sys/gnu/dts/mips/HLKRM04.dts head/sys/gnu/dts/mips/HT-TM02.dts head/sys/gnu/dts/mips/JHR-N805R.dts head/sys/gnu/dts/mips/LINKIT7688.dts head/sys/gnu/dts/mips/M2M.dts head/sys/gnu/dts/mips/M3.dts head/sys/gnu/dts/mips/M4-4M.dts head/sys/gnu/dts/mips/M4-8M.dts head/sys/gnu/dts/mips/MINIEMBPLUG.dts head/sys/gnu/dts/mips/MIWIFI-MINI.dts head/sys/gnu/dts/mips/MIWIFI-NANO.dts head/sys/gnu/dts/mips/MLW221.dts head/sys/gnu/dts/mips/MLWG2.dts head/sys/gnu/dts/mips/MPRA1.dts head/sys/gnu/dts/mips/MPRA2.dts head/sys/gnu/dts/mips/MT7620a.dts head/sys/gnu/dts/mips/MT7620a_MT7530.dts head/sys/gnu/dts/mips/MT7620a_MT7610e.dts head/sys/gnu/dts/mips/MT7628.dts head/sys/gnu/dts/mips/MZK-750DHP.dts head/sys/gnu/dts/mips/MZK-DP150N.dts head/sys/gnu/dts/mips/MZK-EX300NP.dts head/sys/gnu/dts/mips/MZK-EX750NP.dts head/sys/gnu/dts/mips/MicroWRT.dts head/sys/gnu/dts/mips/NCS601W.dts head/sys/gnu/dts/mips/NW718.dts head/sys/gnu/dts/mips/OY-0001.dts head/sys/gnu/dts/mips/PBR-M1.dts head/sys/gnu/dts/mips/PSG1208.dts head/sys/gnu/dts/mips/PX-4885-4M.dts head/sys/gnu/dts/mips/PX-4885-8M.dts head/sys/gnu/dts/mips/PX-4885.dtsi head/sys/gnu/dts/mips/RE6500.dts head/sys/gnu/dts/mips/RP-N53.dts head/sys/gnu/dts/mips/RT-G32-B1.dts head/sys/gnu/dts/mips/RT-N14U.dts head/sys/gnu/dts/mips/RT5350F-OLINUXINO-EVB.dts head/sys/gnu/dts/mips/RT5350F-OLINUXINO.dts head/sys/gnu/dts/mips/RUT5XX.dts head/sys/gnu/dts/mips/SAP-G3200U3.dts head/sys/gnu/dts/mips/SK-WB8.dts head/sys/gnu/dts/mips/TINY-AC.dts head/sys/gnu/dts/mips/VOCORE-16M.dts head/sys/gnu/dts/mips/VOCORE-8M.dts head/sys/gnu/dts/mips/VOCORE.dtsi head/sys/gnu/dts/mips/WHR-1166D.dts head/sys/gnu/dts/mips/WHR-300HP2.dts head/sys/gnu/dts/mips/WHR-600D.dts head/sys/gnu/dts/mips/WITI.dts head/sys/gnu/dts/mips/WIZARD8800.dts head/sys/gnu/dts/mips/WIZFI630A.dts head/sys/gnu/dts/mips/WL-330N.dts head/sys/gnu/dts/mips/WL-330N3G.dts head/sys/gnu/dts/mips/WMR-300.dts head/sys/gnu/dts/mips/WNCE2001.dts head/sys/gnu/dts/mips/WNDR3700V5.dts head/sys/gnu/dts/mips/WRH-300CR.dts head/sys/gnu/dts/mips/WRTNODE.dts head/sys/gnu/dts/mips/WRTNODE2.dtsi head/sys/gnu/dts/mips/WSR-1166.dts head/sys/gnu/dts/mips/WSR-600.dts head/sys/gnu/dts/mips/WT1520-4M.dts head/sys/gnu/dts/mips/WT1520-8M.dts head/sys/gnu/dts/mips/WT1520.dtsi head/sys/gnu/dts/mips/WT3020-4M.dts head/sys/gnu/dts/mips/WT3020-8M.dts head/sys/gnu/dts/mips/X5.dts head/sys/gnu/dts/mips/X8.dts head/sys/gnu/dts/mips/Y1.dtsi head/sys/gnu/dts/mips/YOUKU-YK1.dts head/sys/gnu/dts/mips/ZBT-WA05.dts head/sys/gnu/dts/mips/ZBT-WE826.dts head/sys/gnu/dts/mips/ZBT-WG2626.dts head/sys/gnu/dts/mips/ZBT-WG3526.dts head/sys/gnu/dts/mips/ZBT-WR8305RT.dts head/sys/gnu/dts/mips/ZTE-Q7.dts head/sys/gnu/dts/mips/mt7620a.dtsi head/sys/gnu/dts/mips/mt7620n.dtsi head/sys/gnu/dts/mips/mt7621.dtsi head/sys/gnu/dts/mips/rt3352.dtsi head/sys/gnu/dts/mips/rt5350.dtsi Modified: head/sys/gnu/dts/mips/3G150B.dts ============================================================================== --- head/sys/gnu/dts/mips/3G150B.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/3G150B.dts Wed May 25 06:39:48 2016 (r300658) @@ -52,7 +52,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/3G300M.dts ============================================================================== --- head/sys/gnu/dts/mips/3G300M.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/3G300M.dts Wed May 25 06:39:48 2016 (r300658) @@ -67,7 +67,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/A5-V11.dts ============================================================================== --- head/sys/gnu/dts/mips/A5-V11.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/A5-V11.dts Wed May 25 06:39:48 2016 (r300658) @@ -58,7 +58,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "pm25lq032"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/AIR3GII.dts ============================================================================== --- head/sys/gnu/dts/mips/AIR3GII.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/AIR3GII.dts Wed May 25 06:39:48 2016 (r300658) @@ -45,7 +45,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "en25q32b"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/ALL0256N-4M.dts ============================================================================== --- head/sys/gnu/dts/mips/ALL0256N-4M.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/ALL0256N-4M.dts Wed May 25 06:39:48 2016 (r300658) @@ -50,7 +50,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/ALL0256N-8M.dts ============================================================================== --- head/sys/gnu/dts/mips/ALL0256N-8M.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/ALL0256N-8M.dts Wed May 25 06:39:48 2016 (r300658) @@ -50,7 +50,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/ALL5002.dts ============================================================================== --- head/sys/gnu/dts/mips/ALL5002.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/ALL5002.dts Wed May 25 06:39:48 2016 (r300658) @@ -50,7 +50,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l25635e"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/ALL5003.dts ============================================================================== --- head/sys/gnu/dts/mips/ALL5003.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/ALL5003.dts Wed May 25 06:39:48 2016 (r300658) @@ -50,7 +50,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l25635e"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/ASL26555-16M.dts ============================================================================== --- head/sys/gnu/dts/mips/ASL26555-16M.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/ASL26555-16M.dts Wed May 25 06:39:48 2016 (r300658) @@ -81,7 +81,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25sl12801"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/ASL26555-8M.dts ============================================================================== --- head/sys/gnu/dts/mips/ASL26555-8M.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/ASL26555-8M.dts Wed May 25 06:39:48 2016 (r300658) @@ -81,7 +81,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25sl064p"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/AWAPN2403.dts ============================================================================== --- head/sys/gnu/dts/mips/AWAPN2403.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/AWAPN2403.dts Wed May 25 06:39:48 2016 (r300658) @@ -36,7 +36,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/AWM002.dtsi ============================================================================== --- head/sys/gnu/dts/mips/AWM002.dtsi Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/AWM002.dtsi Wed May 25 06:39:48 2016 (r300658) @@ -25,7 +25,7 @@ m25p80: m25p80@0 { #address-cells = <1>; #size-cells = <1>; - reg = <0 0>; + reg = <0>; compatible = "jedec,spi-nor"; spi-max-frequency = <10000000>; @@ -55,7 +55,7 @@ }; &pinctrl { - state_default { + state_default: pinctrl0 { gpio { ralink,group = "i2c", "jtag"; ralink,function = "gpio"; Modified: head/sys/gnu/dts/mips/ArcherC20i.dts ============================================================================== --- head/sys/gnu/dts/mips/ArcherC20i.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/ArcherC20i.dts Wed May 25 06:39:48 2016 (r300658) @@ -33,7 +33,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l6405d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/CF-WR800N.dts ============================================================================== --- head/sys/gnu/dts/mips/CF-WR800N.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/CF-WR800N.dts Wed May 25 06:39:48 2016 (r300658) @@ -66,7 +66,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q64"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/CS-QR10.dts ============================================================================== --- head/sys/gnu/dts/mips/CS-QR10.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/CS-QR10.dts Wed May 25 06:39:48 2016 (r300658) @@ -79,7 +79,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l6405d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/DB-WRT01.dts ============================================================================== --- head/sys/gnu/dts/mips/DB-WRT01.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/DB-WRT01.dts Wed May 25 06:39:48 2016 (r300658) @@ -40,7 +40,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l6405d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/DCS-930L-B1.dts ============================================================================== --- head/sys/gnu/dts/mips/DCS-930L-B1.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/DCS-930L-B1.dts Wed May 25 06:39:48 2016 (r300658) @@ -47,7 +47,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/DIR-300-B7.dts ============================================================================== --- head/sys/gnu/dts/mips/DIR-300-B7.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/DIR-300-B7.dts Wed May 25 06:39:48 2016 (r300658) @@ -47,7 +47,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/DIR-320-B1.dts ============================================================================== --- head/sys/gnu/dts/mips/DIR-320-B1.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/DIR-320-B1.dts Wed May 25 06:39:48 2016 (r300658) @@ -69,7 +69,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/DIR-610-A1.dts ============================================================================== --- head/sys/gnu/dts/mips/DIR-610-A1.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/DIR-610-A1.dts Wed May 25 06:39:48 2016 (r300658) @@ -47,7 +47,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/DIR-615-H1.dts ============================================================================== --- head/sys/gnu/dts/mips/DIR-615-H1.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/DIR-615-H1.dts Wed May 25 06:39:48 2016 (r300658) @@ -62,7 +62,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/DIR-620-D1.dts ============================================================================== --- head/sys/gnu/dts/mips/DIR-620-D1.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/DIR-620-D1.dts Wed May 25 06:39:48 2016 (r300658) @@ -41,7 +41,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l6405d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/DIR-645.dts ============================================================================== --- head/sys/gnu/dts/mips/DIR-645.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/DIR-645.dts Wed May 25 06:39:48 2016 (r300658) @@ -69,7 +69,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80"; spi-max-frequency = <25000000>; Modified: head/sys/gnu/dts/mips/DIR-810L.dts ============================================================================== --- head/sys/gnu/dts/mips/DIR-810L.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/DIR-810L.dts Wed May 25 06:39:48 2016 (r300658) @@ -52,7 +52,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/DIR-860L-B1.dts ============================================================================== --- head/sys/gnu/dts/mips/DIR-860L-B1.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/DIR-860L-B1.dts Wed May 25 06:39:48 2016 (r300658) @@ -54,7 +54,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/E1700.dts ============================================================================== --- head/sys/gnu/dts/mips/E1700.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/E1700.dts Wed May 25 06:39:48 2016 (r300658) @@ -57,7 +57,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l6405d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/EX2700.dts ============================================================================== --- head/sys/gnu/dts/mips/EX2700.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/EX2700.dts Wed May 25 06:39:48 2016 (r300658) @@ -95,7 +95,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/F7C027.dts ============================================================================== --- head/sys/gnu/dts/mips/F7C027.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/F7C027.dts Wed May 25 06:39:48 2016 (r300658) @@ -63,7 +63,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l12805d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/FIREWRT.dts ============================================================================== --- head/sys/gnu/dts/mips/FIREWRT.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/FIREWRT.dts Wed May 25 06:39:48 2016 (r300658) @@ -55,7 +55,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/GL-MT300A.dts ============================================================================== --- head/sys/gnu/dts/mips/GL-MT300A.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/GL-MT300A.dts Wed May 25 06:39:48 2016 (r300658) @@ -83,7 +83,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "w25q128"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q128"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/GL-MT300N.dts ============================================================================== --- head/sys/gnu/dts/mips/GL-MT300N.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/GL-MT300N.dts Wed May 25 06:39:48 2016 (r300658) @@ -78,7 +78,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "w25q128"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q128"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/GL-MT750.dts ============================================================================== --- head/sys/gnu/dts/mips/GL-MT750.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/GL-MT750.dts Wed May 25 06:39:48 2016 (r300658) @@ -78,7 +78,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "w25q128"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q128"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/HC5XXX.dtsi ============================================================================== --- head/sys/gnu/dts/mips/HC5XXX.dtsi Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/HC5XXX.dtsi Wed May 25 06:39:48 2016 (r300658) @@ -55,7 +55,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q128"; spi-max-frequency = <10000000>; @@ -125,7 +125,7 @@ }; &pinctrl { - state_default { + state_default: pinctrl0 { gpio { ralink,group = "uartf", "wled", "nd_sd"; ralink,function = "gpio"; Modified: head/sys/gnu/dts/mips/HLKRM04.dts ============================================================================== --- head/sys/gnu/dts/mips/HLKRM04.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/HLKRM04.dts Wed May 25 06:39:48 2016 (r300658) @@ -63,7 +63,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/HT-TM02.dts ============================================================================== --- head/sys/gnu/dts/mips/HT-TM02.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/HT-TM02.dts Wed May 25 06:39:48 2016 (r300658) @@ -52,7 +52,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l6405d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/JHR-N805R.dts ============================================================================== --- head/sys/gnu/dts/mips/JHR-N805R.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/JHR-N805R.dts Wed May 25 06:39:48 2016 (r300658) @@ -45,7 +45,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/LINKIT7688.dts ============================================================================== --- head/sys/gnu/dts/mips/LINKIT7688.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/LINKIT7688.dts Wed May 25 06:39:48 2016 (r300658) @@ -115,7 +115,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l25635e"; spi-max-frequency = <40000000>; m25p,chunked-io = <31>; @@ -146,8 +146,8 @@ spidev@1 { #address-cells = <1>; #size-cells = <1>; - compatible = "spidev"; - reg = <1 0>; + compatible = "linux,spidev"; + reg = <1>; spi-max-frequency = <40000000>; }; }; Modified: head/sys/gnu/dts/mips/M2M.dts ============================================================================== --- head/sys/gnu/dts/mips/M2M.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/M2M.dts Wed May 25 06:39:48 2016 (r300658) @@ -51,7 +51,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l6405d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/M3.dts ============================================================================== --- head/sys/gnu/dts/mips/M3.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/M3.dts Wed May 25 06:39:48 2016 (r300658) @@ -43,7 +43,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q32"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/M4-4M.dts ============================================================================== --- head/sys/gnu/dts/mips/M4-4M.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/M4-4M.dts Wed May 25 06:39:48 2016 (r300658) @@ -36,7 +36,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "pm25lq032"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/M4-8M.dts ============================================================================== --- head/sys/gnu/dts/mips/M4-8M.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/M4-8M.dts Wed May 25 06:39:48 2016 (r300658) @@ -36,7 +36,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "gd25q64"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/MINIEMBPLUG.dts ============================================================================== --- head/sys/gnu/dts/mips/MINIEMBPLUG.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MINIEMBPLUG.dts Wed May 25 06:39:48 2016 (r300658) @@ -72,7 +72,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l6405d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/MIWIFI-MINI.dts ============================================================================== --- head/sys/gnu/dts/mips/MIWIFI-MINI.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MIWIFI-MINI.dts Wed May 25 06:39:48 2016 (r300658) @@ -62,7 +62,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q128"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/MIWIFI-NANO.dts ============================================================================== --- head/sys/gnu/dts/mips/MIWIFI-NANO.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MIWIFI-NANO.dts Wed May 25 06:39:48 2016 (r300658) @@ -57,7 +57,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80"; spi-max-frequency = <10000000>; m25p,chunked-io = <32>; Modified: head/sys/gnu/dts/mips/MLW221.dts ============================================================================== --- head/sys/gnu/dts/mips/MLW221.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MLW221.dts Wed May 25 06:39:48 2016 (r300658) @@ -59,7 +59,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl129p1"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/MLWG2.dts ============================================================================== --- head/sys/gnu/dts/mips/MLWG2.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MLWG2.dts Wed May 25 06:39:48 2016 (r300658) @@ -59,7 +59,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/MPRA1.dts ============================================================================== --- head/sys/gnu/dts/mips/MPRA1.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MPRA1.dts Wed May 25 06:39:48 2016 (r300658) @@ -58,7 +58,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/MPRA2.dts ============================================================================== --- head/sys/gnu/dts/mips/MPRA2.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MPRA2.dts Wed May 25 06:39:48 2016 (r300658) @@ -58,7 +58,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; @@ -101,7 +101,8 @@ }; &esw { - mediatek,portmap = <0x2f>; + mediatek,portmap = <0x1>; + mediatek,portdisable = <0x3e>; }; &wmac { Modified: head/sys/gnu/dts/mips/MT7620a.dts ============================================================================== --- head/sys/gnu/dts/mips/MT7620a.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MT7620a.dts Wed May 25 06:39:48 2016 (r300658) @@ -33,7 +33,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "en25q64"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/MT7620a_MT7530.dts ============================================================================== --- head/sys/gnu/dts/mips/MT7620a_MT7530.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MT7620a_MT7530.dts Wed May 25 06:39:48 2016 (r300658) @@ -14,7 +14,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/MT7620a_MT7610e.dts ============================================================================== --- head/sys/gnu/dts/mips/MT7620a_MT7610e.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MT7620a_MT7610e.dts Wed May 25 06:39:48 2016 (r300658) @@ -37,7 +37,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "en25q64"; spi-max-frequency = <1000000>; Modified: head/sys/gnu/dts/mips/MT7628.dts ============================================================================== --- head/sys/gnu/dts/mips/MT7628.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MT7628.dts Wed May 25 06:39:48 2016 (r300658) @@ -32,7 +32,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "en25q64"; spi-max-frequency = <10000000>; m25p,chunked-io = <32>; Modified: head/sys/gnu/dts/mips/MZK-750DHP.dts ============================================================================== --- head/sys/gnu/dts/mips/MZK-750DHP.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MZK-750DHP.dts Wed May 25 06:39:48 2016 (r300658) @@ -60,7 +60,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l6405d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/MZK-DP150N.dts ============================================================================== --- head/sys/gnu/dts/mips/MZK-DP150N.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MZK-DP150N.dts Wed May 25 06:39:48 2016 (r300658) @@ -40,7 +40,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; @@ -67,11 +67,13 @@ reg = <0x50000 0x3b0000>; }; }; +}; - spidev@1 { +&spi1 { + spidev@0 { compatible = "linux,spidev"; spi-max-frequency = <10000000>; - reg = <1 0>; + reg = <0>; }; }; Modified: head/sys/gnu/dts/mips/MZK-EX300NP.dts ============================================================================== --- head/sys/gnu/dts/mips/MZK-EX300NP.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MZK-EX300NP.dts Wed May 25 06:39:48 2016 (r300658) @@ -75,7 +75,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q64"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/MZK-EX750NP.dts ============================================================================== --- head/sys/gnu/dts/mips/MZK-EX750NP.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MZK-EX750NP.dts Wed May 25 06:39:48 2016 (r300658) @@ -80,7 +80,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q64"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/MicroWRT.dts ============================================================================== --- head/sys/gnu/dts/mips/MicroWRT.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/MicroWRT.dts Wed May 25 06:39:48 2016 (r300658) @@ -45,7 +45,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q128"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/NCS601W.dts ============================================================================== --- head/sys/gnu/dts/mips/NCS601W.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/NCS601W.dts Wed May 25 06:39:48 2016 (r300658) @@ -14,7 +14,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/NW718.dts ============================================================================== --- head/sys/gnu/dts/mips/NW718.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/NW718.dts Wed May 25 06:39:48 2016 (r300658) @@ -52,7 +52,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <25000000>; Modified: head/sys/gnu/dts/mips/OY-0001.dts ============================================================================== --- head/sys/gnu/dts/mips/OY-0001.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/OY-0001.dts Wed May 25 06:39:48 2016 (r300658) @@ -53,7 +53,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q128"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/PBR-M1.dts ============================================================================== --- head/sys/gnu/dts/mips/PBR-M1.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/PBR-M1.dts Wed May 25 06:39:48 2016 (r300658) @@ -121,7 +121,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/PSG1208.dts ============================================================================== --- head/sys/gnu/dts/mips/PSG1208.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/PSG1208.dts Wed May 25 06:39:48 2016 (r300658) @@ -49,7 +49,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "en25q64"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/PX-4885-4M.dts ============================================================================== --- head/sys/gnu/dts/mips/PX-4885-4M.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/PX-4885-4M.dts Wed May 25 06:39:48 2016 (r300658) @@ -9,7 +9,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/PX-4885-8M.dts ============================================================================== --- head/sys/gnu/dts/mips/PX-4885-8M.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/PX-4885-8M.dts Wed May 25 06:39:48 2016 (r300658) @@ -9,7 +9,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/PX-4885.dtsi ============================================================================== --- head/sys/gnu/dts/mips/PX-4885.dtsi Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/PX-4885.dtsi Wed May 25 06:39:48 2016 (r300658) @@ -33,7 +33,7 @@ }; &pinctrl { - state_default { + state_default: pinctrl0 { gpio { ralink,group = "i2c", "jtag", "uartf"; ralink,function = "gpio"; Modified: head/sys/gnu/dts/mips/RE6500.dts ============================================================================== --- head/sys/gnu/dts/mips/RE6500.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/RE6500.dts Wed May 25 06:39:48 2016 (r300658) @@ -56,7 +56,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "en25q64"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/RP-N53.dts ============================================================================== --- head/sys/gnu/dts/mips/RP-N53.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/RP-N53.dts Wed May 25 06:39:48 2016 (r300658) @@ -103,7 +103,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/RT-G32-B1.dts ============================================================================== --- head/sys/gnu/dts/mips/RT-G32-B1.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/RT-G32-B1.dts Wed May 25 06:39:48 2016 (r300658) @@ -33,7 +33,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/RT-N14U.dts ============================================================================== --- head/sys/gnu/dts/mips/RT-N14U.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/RT-N14U.dts Wed May 25 06:39:48 2016 (r300658) @@ -70,7 +70,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q128"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/RT5350F-OLINUXINO-EVB.dts ============================================================================== --- head/sys/gnu/dts/mips/RT5350F-OLINUXINO-EVB.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/RT5350F-OLINUXINO-EVB.dts Wed May 25 06:39:48 2016 (r300658) @@ -36,7 +36,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/RT5350F-OLINUXINO.dts ============================================================================== --- head/sys/gnu/dts/mips/RT5350F-OLINUXINO.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/RT5350F-OLINUXINO.dts Wed May 25 06:39:48 2016 (r300658) @@ -14,7 +14,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/RUT5XX.dts ============================================================================== --- head/sys/gnu/dts/mips/RUT5XX.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/RUT5XX.dts Wed May 25 06:39:48 2016 (r300658) @@ -36,7 +36,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "n25q128a13"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/SAP-G3200U3.dts ============================================================================== --- head/sys/gnu/dts/mips/SAP-G3200U3.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/SAP-G3200U3.dts Wed May 25 06:39:48 2016 (r300658) @@ -51,7 +51,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "en25q64"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/SK-WB8.dts ============================================================================== --- head/sys/gnu/dts/mips/SK-WB8.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/SK-WB8.dts Wed May 25 06:39:48 2016 (r300658) @@ -54,7 +54,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/TINY-AC.dts ============================================================================== --- head/sys/gnu/dts/mips/TINY-AC.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/TINY-AC.dts Wed May 25 06:39:48 2016 (r300658) @@ -70,7 +70,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l6405d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/VOCORE-16M.dts ============================================================================== --- head/sys/gnu/dts/mips/VOCORE-16M.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/VOCORE-16M.dts Wed May 25 06:39:48 2016 (r300658) @@ -9,7 +9,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q128"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/VOCORE-8M.dts ============================================================================== --- head/sys/gnu/dts/mips/VOCORE-8M.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/VOCORE-8M.dts Wed May 25 06:39:48 2016 (r300658) @@ -9,7 +9,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/VOCORE.dtsi ============================================================================== --- head/sys/gnu/dts/mips/VOCORE.dtsi Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/VOCORE.dtsi Wed May 25 06:39:48 2016 (r300658) @@ -156,7 +156,7 @@ }; &pinctrl { - state_default { + state_default: pinctrl0 { gpio { ralink,group = "jtag", "uartf", "led"; ralink,function = "gpio"; Modified: head/sys/gnu/dts/mips/WHR-1166D.dts ============================================================================== --- head/sys/gnu/dts/mips/WHR-1166D.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/WHR-1166D.dts Wed May 25 06:39:48 2016 (r300658) @@ -90,7 +90,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l6405d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/WHR-300HP2.dts ============================================================================== --- head/sys/gnu/dts/mips/WHR-300HP2.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/WHR-300HP2.dts Wed May 25 06:39:48 2016 (r300658) @@ -90,7 +90,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "s25fl064k"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/WHR-600D.dts ============================================================================== --- head/sys/gnu/dts/mips/WHR-600D.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/WHR-600D.dts Wed May 25 06:39:48 2016 (r300658) @@ -90,7 +90,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l6405d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/WITI.dts ============================================================================== --- head/sys/gnu/dts/mips/WITI.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/WITI.dts Wed May 25 06:39:48 2016 (r300658) @@ -63,7 +63,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/WIZARD8800.dts ============================================================================== --- head/sys/gnu/dts/mips/WIZARD8800.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/WIZARD8800.dts Wed May 25 06:39:48 2016 (r300658) @@ -22,7 +22,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q32"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/WIZFI630A.dts ============================================================================== --- head/sys/gnu/dts/mips/WIZFI630A.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/WIZFI630A.dts Wed May 25 06:39:48 2016 (r300658) @@ -82,7 +82,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "w25q128"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/WL-330N.dts ============================================================================== --- head/sys/gnu/dts/mips/WL-330N.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/WL-330N.dts Wed May 25 06:39:48 2016 (r300658) @@ -47,7 +47,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <10000000>; Modified: head/sys/gnu/dts/mips/WL-330N3G.dts ============================================================================== --- head/sys/gnu/dts/mips/WL-330N3G.dts Wed May 25 06:29:23 2016 (r300657) +++ head/sys/gnu/dts/mips/WL-330N3G.dts Wed May 25 06:39:48 2016 (r300658) @@ -52,7 +52,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; - reg = <0 0>; + reg = <0>; linux,modalias = "m25p80", "mx25l3205d"; spi-max-frequency = <10000000>; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed May 25 06:47:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 645BEB49D83; Wed, 25 May 2016 06:47:30 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BCE51CCC; Wed, 25 May 2016 06:47:30 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P6lT3x012499; Wed, 25 May 2016 06:47:29 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P6lTQD012496; Wed, 25 May 2016 06:47:29 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201605250647.u4P6lTQD012496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Wed, 25 May 2016 06:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300659 - in head/sys/mips: conf mediatek X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 06:47:30 -0000 Author: sgalabov Date: Wed May 25 06:47:28 2016 New Revision: 300659 URL: https://svnweb.freebsd.org/changeset/base/300659 Log: Build etherswitch support for appropriate Ralink/Mediatek SoCs Etherswitch support is built by default on all SoCs except RT3662/RT3883 as they have no built-in switch and their configurations with external switches are not yet supported. Sponsored by: Smartcom - Bulgaria AD Modified: head/sys/mips/conf/RT3883_FDT head/sys/mips/mediatek/files.mediatek head/sys/mips/mediatek/std.mediatek Modified: head/sys/mips/conf/RT3883_FDT ============================================================================== --- head/sys/mips/conf/RT3883_FDT Wed May 25 06:39:48 2016 (r300658) +++ head/sys/mips/conf/RT3883_FDT Wed May 25 06:47:28 2016 (r300659) @@ -76,3 +76,7 @@ device if_bridge # Extres device ext_resources device clk + +# For now there's no etherswitch support for RT3662/RT3883 +nodevice etherswitch +nodevice mtkswitch Modified: head/sys/mips/mediatek/files.mediatek ============================================================================== --- head/sys/mips/mediatek/files.mediatek Wed May 25 06:39:48 2016 (r300658) +++ head/sys/mips/mediatek/files.mediatek Wed May 25 06:47:28 2016 (r300659) @@ -40,3 +40,8 @@ mips/mips/tick.c standard # Temporary Reset if mips/mediatek/fdt_reset.c standard mips/mediatek/fdt_reset_if.m standard + +# Switch +dev/etherswitch/mtkswitch/mtkswitch.c optional mtkswitch +dev/etherswitch/mtkswitch/mtkswitch_rt3050.c optional mtkswitch +dev/etherswitch/mtkswitch/mtkswitch_mt7620.c optional mtkswitch Modified: head/sys/mips/mediatek/std.mediatek ============================================================================== --- head/sys/mips/mediatek/std.mediatek Wed May 25 06:39:48 2016 (r300658) +++ head/sys/mips/mediatek/std.mediatek Wed May 25 06:47:28 2016 (r300659) @@ -82,3 +82,9 @@ device loop # ether device support device ether + +# ether switch support +device etherswitch +device miibus +device mtkswitch +device mdio From owner-svn-src-head@freebsd.org Wed May 25 06:55:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BACEBB49FD3; Wed, 25 May 2016 06:55:54 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BF4410F3; Wed, 25 May 2016 06:55:54 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P6trfr015447; Wed, 25 May 2016 06:55:53 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P6trZO015446; Wed, 25 May 2016 06:55:53 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605250655.u4P6trZO015446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 06:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300660 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 06:55:54 -0000 Author: truckman Date: Wed May 25 06:55:53 2016 New Revision: 300660 URL: https://svnweb.freebsd.org/changeset/base/300660 Log: Fix 1016718 Resource leak. Don't leak a file descriptor if fchdir() fails. Reported by: Coverity CID: 1016718 MFC after: 1 week Modified: head/lib/libc/gen/fts-compat.c Modified: head/lib/libc/gen/fts-compat.c ============================================================================== --- head/lib/libc/gen/fts-compat.c Wed May 25 06:47:28 2016 (r300659) +++ head/lib/libc/gen/fts-compat.c Wed May 25 06:55:53 2016 (r300660) @@ -573,8 +573,10 @@ __fts_children_44bsd(FTS *sp, int instr) if ((fd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) return (NULL); sp->fts_child = fts_build(sp, instr); - if (fchdir(fd)) + if (fchdir(fd)) { + (void)_close(fd); return (NULL); + } (void)_close(fd); return (sp->fts_child); } From owner-svn-src-head@freebsd.org Wed May 25 07:13:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EB95B492D1; Wed, 25 May 2016 07:13:54 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0761AC9; Wed, 25 May 2016 07:13:54 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P7DrwM021629; Wed, 25 May 2016 07:13:53 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P7Dr08021628; Wed, 25 May 2016 07:13:53 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605250713.u4P7Dr08021628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 07:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300662 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 07:13:54 -0000 Author: truckman Date: Wed May 25 07:13:53 2016 New Revision: 300662 URL: https://svnweb.freebsd.org/changeset/base/300662 Log: Fix Coverity CID 1016714 Resource leak in process_file_actions_entry() Don't leak a file descriptor of _dup2() fails (shouldn't happen). Reported by: Coverity CID: 1016714 MFC after: 1 week Modified: head/lib/libc/gen/posix_spawn.c Modified: head/lib/libc/gen/posix_spawn.c ============================================================================== --- head/lib/libc/gen/posix_spawn.c Wed May 25 07:09:54 2016 (r300661) +++ head/lib/libc/gen/posix_spawn.c Wed May 25 07:13:53 2016 (r300662) @@ -140,7 +140,7 @@ process_spawnattr(const posix_spawnattr_ static int process_file_actions_entry(posix_spawn_file_actions_entry_t *fae) { - int fd; + int fd, saved_errno; switch (fae->fae_action) { case FAE_OPEN: @@ -149,8 +149,11 @@ process_file_actions_entry(posix_spawn_f if (fd < 0) return (errno); if (fd != fae->fae_fildes) { - if (_dup2(fd, fae->fae_fildes) == -1) - return (errno); + if (_dup2(fd, fae->fae_fildes) == -1) { + saved_errno = errno; + (void)_close(fd); + return (saved_errno); + } if (_close(fd) != 0) { if (errno == EBADF) return (EBADF); From owner-svn-src-head@freebsd.org Wed May 25 07:26:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B2F9B49586; Wed, 25 May 2016 07:26:23 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C191131B; Wed, 25 May 2016 07:26:23 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P7QMTg024713; Wed, 25 May 2016 07:26:22 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P7QM5C024712; Wed, 25 May 2016 07:26:22 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605250726.u4P7QM5C024712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 07:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300664 - head/lib/libcompat/4.3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 07:26:23 -0000 Author: truckman Date: Wed May 25 07:26:22 2016 New Revision: 300664 URL: https://svnweb.freebsd.org/changeset/base/300664 Log: Fix Coverity CID 978183 Resource leak in rexec(). Close the socket if connect() fails to avoid leaking it. Reported by: Coverity CID: 978183 MFC after: 1 week Modified: head/lib/libcompat/4.3/rexec.c Modified: head/lib/libcompat/4.3/rexec.c ============================================================================== --- head/lib/libcompat/4.3/rexec.c Wed May 25 07:14:52 2016 (r300663) +++ head/lib/libcompat/4.3/rexec.c Wed May 25 07:26:22 2016 (r300664) @@ -330,6 +330,7 @@ retry: goto retry; } perror(hp->h_name); + (void) close(s); return (-1); } port = 0; From owner-svn-src-head@freebsd.org Wed May 25 07:39:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12E9AB498F5; Wed, 25 May 2016 07:39:50 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D85431B78; Wed, 25 May 2016 07:39:49 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P7dn68027773; Wed, 25 May 2016 07:39:49 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P7dngg027772; Wed, 25 May 2016 07:39:49 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605250739.u4P7dngg027772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 07:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300665 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 07:39:50 -0000 Author: truckman Date: Wed May 25 07:39:48 2016 New Revision: 300665 URL: https://svnweb.freebsd.org/changeset/base/300665 Log: Don't leak addrinfo in fetch_bind() Reported by: Coverity CID: 1225038 MFC after: 1 week Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Wed May 25 07:26:22 2016 (r300664) +++ head/lib/libfetch/common.c Wed May 25 07:39:48 2016 (r300665) @@ -256,8 +256,11 @@ fetch_bind(int sd, int af, const char *a if ((err = getaddrinfo(addr, NULL, &hints, &res0)) != 0) return (-1); for (res = res0; res; res = res->ai_next) - if (bind(sd, res->ai_addr, res->ai_addrlen) == 0) + if (bind(sd, res->ai_addr, res->ai_addrlen) == 0) { + freeaddrinfo(res0); return (0); + } + freeaddrinfo(res0); return (-1); } From owner-svn-src-head@freebsd.org Wed May 25 07:43:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91F68B49D4E; Wed, 25 May 2016 07:43:33 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6248A10CE; Wed, 25 May 2016 07:43:33 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P7hWTh030711; Wed, 25 May 2016 07:43:32 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P7hWTP030710; Wed, 25 May 2016 07:43:32 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605250743.u4P7hWTP030710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 07:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300666 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 07:43:33 -0000 Author: truckman Date: Wed May 25 07:43:32 2016 New Revision: 300666 URL: https://svnweb.freebsd.org/changeset/base/300666 Log: Call closedir() before returning from fetchListFile() to avoid a leak. Reported by: Coverity CID: 1016697 MFC after: 1 week Modified: head/lib/libfetch/file.c Modified: head/lib/libfetch/file.c ============================================================================== --- head/lib/libfetch/file.c Wed May 25 07:39:48 2016 (r300665) +++ head/lib/libfetch/file.c Wed May 25 07:43:32 2016 (r300666) @@ -149,5 +149,6 @@ fetchListFile(struct url *u, const char fetch_add_entry(&ue, &size, &len, de->d_name, &us); } + closedir(dir); return (ue); } From owner-svn-src-head@freebsd.org Wed May 25 07:48:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36A27B49F63; Wed, 25 May 2016 07:48:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA20E13E0; Wed, 25 May 2016 07:48:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P7mb92030928; Wed, 25 May 2016 07:48:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P7ma5F030925; Wed, 25 May 2016 07:48:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605250748.u4P7ma5F030925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 May 2016 07:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300667 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 07:48:38 -0000 Author: hselasky Date: Wed May 25 07:48:36 2016 New Revision: 300667 URL: https://svnweb.freebsd.org/changeset/base/300667 Log: Check for signals when locking the USB enumeration thread from userspace, so that USB applications can be killed if an enumeration thread should be stuck for various reasons. MFC after: 1 week Modified: head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Wed May 25 07:43:32 2016 (r300666) +++ head/sys/dev/usb/usb_dev.c Wed May 25 07:48:36 2016 (r300667) @@ -228,7 +228,7 @@ usb_ref_device(struct usb_cdev_privdata * We need to grab the enumeration SX-lock before * grabbing the FIFO refs to avoid deadlock at detach! */ - crd->do_unlock = usbd_enum_lock(cpd->udev); + crd->do_unlock = usbd_enum_lock_sig(cpd->udev); mtx_lock(&usb_ref_lock); @@ -236,6 +236,12 @@ usb_ref_device(struct usb_cdev_privdata * Set "is_uref" after grabbing the default SX lock */ crd->is_uref = 1; + + /* check for signal */ + if (crd->do_unlock > 1) { + crd->do_unlock = 0; + goto error; + } } /* check if we are doing an open */ Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Wed May 25 07:43:32 2016 (r300666) +++ head/sys/dev/usb/usb_device.c Wed May 25 07:48:36 2016 (r300667) @@ -2740,7 +2740,7 @@ usbd_device_attached(struct usb_device * /* * The following function locks enumerating the given USB device. If * the lock is already grabbed this function returns zero. Else a - * non-zero value is returned. + * a value of one is returned. */ uint8_t usbd_enum_lock(struct usb_device *udev) @@ -2759,6 +2759,27 @@ usbd_enum_lock(struct usb_device *udev) return (1); } +#if USB_HAVE_UGEN +/* + * This function is the same like usbd_enum_lock() except a value of + * 255 is returned when a signal is pending: + */ +uint8_t +usbd_enum_lock_sig(struct usb_device *udev) +{ + if (sx_xlocked(&udev->enum_sx)) + return (0); + if (sx_xlock_sig(&udev->enum_sx)) + return (255); + if (sx_xlock_sig(&udev->sr_sx)) { + sx_xunlock(&udev->enum_sx); + return (255); + } + mtx_lock(&Giant); + return (1); +} +#endif + /* The following function unlocks enumerating the given USB device. */ void Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Wed May 25 07:43:32 2016 (r300666) +++ head/sys/dev/usb/usb_device.h Wed May 25 07:48:36 2016 (r300667) @@ -314,6 +314,9 @@ void usb_set_device_state(struct usb_dev enum usb_dev_state usb_get_device_state(struct usb_device *); uint8_t usbd_enum_lock(struct usb_device *); +#if USB_HAVE_UGEN +uint8_t usbd_enum_lock_sig(struct usb_device *); +#endif void usbd_enum_unlock(struct usb_device *); void usbd_sr_lock(struct usb_device *); void usbd_sr_unlock(struct usb_device *); From owner-svn-src-head@freebsd.org Wed May 25 08:45:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4009B49BA0; Wed, 25 May 2016 08:45:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81AB211FE; Wed, 25 May 2016 08:45:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P8j38G049161; Wed, 25 May 2016 08:45:03 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P8j3Xg049160; Wed, 25 May 2016 08:45:03 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605250845.u4P8j3Xg049160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 25 May 2016 08:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300669 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 08:45:04 -0000 Author: ed Date: Wed May 25 08:45:03 2016 New Revision: 300669 URL: https://svnweb.freebsd.org/changeset/base/300669 Log: Make code compile when basename() is POSIX compliant. The POSIX basename() function is allowed to modify its input buffer, which means its argument is "char *". Pull a copy of the input string before computing the base. Reviewed by: jtl Differential Revision: https://reviews.freebsd.org/D6465 Modified: head/usr.sbin/pmcstat/pmcpl_gprof.c Modified: head/usr.sbin/pmcstat/pmcpl_gprof.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_gprof.c Wed May 25 08:09:14 2016 (r300668) +++ head/usr.sbin/pmcstat/pmcpl_gprof.c Wed May 25 08:45:03 2016 (r300669) @@ -310,8 +310,9 @@ pmcstat_callgraph_do_gmon_arcs(void) void pmcpl_gmon_initimage(struct pmcstat_image *pi) { + const char *execpath; int count, nlen; - char *sn; + char *sn, *snbuf; char name[NAME_MAX]; /* @@ -321,9 +322,11 @@ pmcpl_gmon_initimage(struct pmcstat_imag * `basename(path)`+ "~" + NNN + ".gmon" till we get a free * entry. */ - if ((sn = basename(pmcstat_string_unintern(pi->pi_execpath))) == NULL) - err(EX_OSERR, "ERROR: Cannot process \"%s\"", - pmcstat_string_unintern(pi->pi_execpath)); + execpath = pmcstat_string_unintern(pi->pi_execpath); + if ((snbuf = strdup(execpath)) == NULL) + err(EX_OSERR, "ERROR: Cannot copy \"%s\"", execpath); + if ((sn = basename(snbuf)) == NULL) + err(EX_OSERR, "ERROR: Cannot process \"%s\"", execpath); nlen = strlen(sn); nlen = min(nlen, (int) (sizeof(name) - sizeof(".gmon"))); @@ -355,6 +358,7 @@ pmcpl_gmon_initimage(struct pmcstat_imag } } while (count > 0); } + free(snbuf); LIST_INIT(&pi->pi_gmlist); } From owner-svn-src-head@freebsd.org Wed May 25 09:00:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0B63B4896D; Wed, 25 May 2016 09:00:06 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE8691AB6; Wed, 25 May 2016 09:00:06 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P905qr052334; Wed, 25 May 2016 09:00:05 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P9057F052333; Wed, 25 May 2016 09:00:05 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201605250900.u4P9057F052333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Wed, 25 May 2016 09:00:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300670 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 09:00:07 -0000 Author: n_hibma Date: Wed May 25 09:00:05 2016 New Revision: 300670 URL: https://svnweb.freebsd.org/changeset/base/300670 Log: Change net.link.log_promisc_mode_change to a read-only tunable PR: 166255 Submitted by: eugen.grosbein.net Obtained from: hselasky MFC after: 3 days Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed May 25 08:45:03 2016 (r300669) +++ head/sys/net/if.c Wed May 25 09:00:05 2016 (r300670) @@ -115,7 +115,7 @@ SYSCTL_INT(_net_link, OID_AUTO, log_link /* Log promiscuous mode change events */ static int log_promisc_mode_change = 1; -SYSCTL_INT(_net_link, OID_AUTO, log_promisc_mode_change, CTLFLAG_RW, +SYSCTL_INT(_net_link, OID_AUTO, log_promisc_mode_change, CTLFLAG_RDTUN, &log_promisc_mode_change, 1, "log promiscuous mode change events"); From owner-svn-src-head@freebsd.org Wed May 25 09:04:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30F7DB48C72; Wed, 25 May 2016 09:04:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7D1F102E; Wed, 25 May 2016 09:04:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4P947gO055115; Wed, 25 May 2016 09:04:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4P946CY055112; Wed, 25 May 2016 09:04:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605250904.u4P946CY055112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 May 2016 09:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300671 - in head/sys/compat/linuxkpi/common: include/linux 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 09:04:08 -0000 Author: hselasky Date: Wed May 25 09:04:06 2016 New Revision: 300671 URL: https://svnweb.freebsd.org/changeset/base/300671 Log: Add checks for SCHEDULER_STOPPED() so that code using the LinuxKPI can run after a panic(). This for example allows a LinuxKPI based graphics stack to receive prints during a panic. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h head/sys/compat/linuxkpi/common/include/linux/wait.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sched.h Wed May 25 09:00:05 2016 (r300670) +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Wed May 25 09:04:06 2016 (r300671) @@ -91,7 +91,7 @@ CTASSERT(sizeof(((struct thread *)0)->td do { \ void *c; \ \ - if (cold) \ + if (cold || SCHEDULER_STOPPED()) \ break; \ c = curthread; \ sleepq_lock(c); \ Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/wait.h Wed May 25 09:00:05 2016 (r300670) +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Wed May 25 09:04:06 2016 (r300671) @@ -31,6 +31,7 @@ #ifndef _LINUX_WAIT_H_ #define _LINUX_WAIT_H_ +#include #include #include #include @@ -81,6 +82,8 @@ do { \ void *c = &(q).wchan; \ if (!(cond)) { \ for (;;) { \ + if (unlikely(SCHEDULER_STOPPED())) \ + break; \ sleepq_lock(c); \ if (cond) { \ sleepq_release(c); \ @@ -100,6 +103,8 @@ do { \ _error = 0; \ if (!(cond)) { \ for (; _error == 0;) { \ + if (unlikely(SCHEDULER_STOPPED())) \ + break; \ sleepq_lock(c); \ if (cond) { \ sleepq_release(c); \ @@ -123,6 +128,8 @@ do { \ \ if (!(cond)) { \ for (; __rc == 0;) { \ + if (unlikely(SCHEDULER_STOPPED())) \ + break; \ sleepq_lock(c); \ if (cond) { \ sleepq_release(c); \ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 25 09:00:05 2016 (r300670) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 25 09:04:06 2016 (r300671) @@ -1093,6 +1093,8 @@ linux_complete_common(struct completion long linux_wait_for_common(struct completion *c, int flags) { + if (unlikely(SCHEDULER_STOPPED())) + return (0); if (flags != 0) flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; @@ -1123,6 +1125,9 @@ linux_wait_for_timeout_common(struct com { long end = jiffies + timeout; + if (unlikely(SCHEDULER_STOPPED())) + return (0); + if (flags != 0) flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; else From owner-svn-src-head@freebsd.org Wed May 25 10:09:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C48EBB49D66; Wed, 25 May 2016 10:09:24 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 879341004; Wed, 25 May 2016 10:09:24 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PA9Nik073321; Wed, 25 May 2016 10:09:23 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PA9NAP073320; Wed, 25 May 2016 10:09:23 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201605251009.u4PA9NAP073320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Wed, 25 May 2016 10:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300674 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 10:09:24 -0000 Author: skra Date: Wed May 25 10:09:23 2016 New Revision: 300674 URL: https://svnweb.freebsd.org/changeset/base/300674 Log: Add more info about the issue fixed in r298460. Rephrase some sentences and fix grammar. No functional change. Suggested by: alc Reviewed by: alc Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Wed May 25 10:04:53 2016 (r300673) +++ head/sys/arm/arm/pmap-v6.c Wed May 25 10:09:23 2016 (r300674) @@ -3302,10 +3302,16 @@ pmap_update_pte1_action(void *arg) * Change pte1 on current pmap. * Note that kernel pte1 must be changed on all pmaps. * - * By ARM ARM manual, the behaviour is UNPREDICABLE when two or more TLB - * entries map same VA. It's a problem when either promotion or demotion - * is being done. The pte1 update and appropriate TLB flush must be done - * atomically in general. + * According to the architecture reference manual published by ARM, + * the behaviour is UNPREDICTABLE when two or more TLB entries map the same VA. + * According to this manual, UNPREDICTABLE behaviours must never happen in + * a viable system. In contrast, on x86 processors, it is not specified which + * TLB entry mapping the virtual address will be used, but the MMU doesn't + * generate a bogus translation the way it does on Cortex-A8 rev 2 (Beaglebone + * Black). + * + * It's a problem when either promotion or demotion is being done. The pte1 + * update and appropriate TLB flush must be done atomically in general. */ static void pmap_change_pte1(pmap_t pmap, pt1_entry_t *pte1p, vm_offset_t va, @@ -3329,8 +3335,9 @@ pmap_change_pte1(pmap_t pmap, pt1_entry_ * Use break-before-make approach for changing userland * mappings. It can cause L1 translation aborts on other * cores in SMP case. So, special treatment is implemented - * in pmap_fault(). Interrups are disabled here to make it - * without any interruption as quick as possible. + * in pmap_fault(). To reduce the likelihood that another core + * will be affected by the broken mapping, disable interrupts + * until the mapping change is completed. */ cspr = disable_interrupts(PSR_I | PSR_F); pte1_clear(pte1p); @@ -6355,9 +6362,9 @@ pmap_fault(pmap_t pmap, vm_offset_t far, PMAP_LOCK(pmap); #ifdef SMP /* - * Special treatment due to break-before-make approach done when + * Special treatment is due to break-before-make approach done when * pte1 is updated for userland mapping during section promotion or - * demotion. If not catched here, pmap_enter() can find a section + * demotion. If not caught here, pmap_enter() can find a section * mapping on faulting address. That is not allowed. */ if (idx == FAULT_TRAN_L1 && usermode && cp15_ats1cur_check(far) == 0) { From owner-svn-src-head@freebsd.org Wed May 25 11:58:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 624B5B49A32; Wed, 25 May 2016 11:58:56 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33B451230; Wed, 25 May 2016 11:58:56 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PBwtcj006571; Wed, 25 May 2016 11:58:55 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PBwtpC006569; Wed, 25 May 2016 11:58:55 GMT (envelope-from br@FreeBSD.org) Message-Id: <201605251158.u4PBwtpC006569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 25 May 2016 11:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300675 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 11:58:56 -0000 Author: br Date: Wed May 25 11:58:55 2016 New Revision: 300675 URL: https://svnweb.freebsd.org/changeset/base/300675 Log: Add relocation support for RISC-V. Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D6559 Modified: head/contrib/elftoolchain/libdwarf/libdwarf.h head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Modified: head/contrib/elftoolchain/libdwarf/libdwarf.h ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf.h Wed May 25 10:09:23 2016 (r300674) +++ head/contrib/elftoolchain/libdwarf/libdwarf.h Wed May 25 11:58:55 2016 (r300675) @@ -440,6 +440,7 @@ enum Dwarf_ISA { DW_ISA_X86, DW_ISA_X86_64, DW_ISA_AARCH64, + DW_ISA_RISCV, DW_ISA_MAX }; Modified: head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Wed May 25 10:09:23 2016 (r300674) +++ head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Wed May 25 11:58:55 2016 (r300675) @@ -54,6 +54,8 @@ _dwarf_get_reloc_type(Dwarf_P_Debug dbg, return (R_ARM_ABS32); case DW_ISA_MIPS: return (is64 ? R_MIPS_64 : R_MIPS_32); + case DW_ISA_RISCV: + return (is64 ? R_RISCV_64 : R_RISCV_32); case DW_ISA_IA64: return (is64 ? R_IA_64_DIR64LSB : R_IA_64_DIR32LSB); default: @@ -106,6 +108,12 @@ _dwarf_get_reloc_size(Dwarf_Debug dbg, D else if (rel_type == R_MIPS_64) return (8); break; + case EM_RISCV: + if (rel_type == R_RISCV_32) + return (4); + else if (rel_type == R_RISCV_64) + return (8); + break; case EM_IA_64: if (rel_type == R_IA_64_SECREL32LSB) return (4); From owner-svn-src-head@freebsd.org Wed May 25 12:03:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE8BCB492EC; Wed, 25 May 2016 12:03:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3ED1BA2; Wed, 25 May 2016 12:03:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PC3NLA009530; Wed, 25 May 2016 12:03:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PC3LC2009507; Wed, 25 May 2016 12:03:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605251203.u4PC3LC2009507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 May 2016 12:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300676 - in head/sys: dev/cxgbe/iw_cxgbe dev/mlx5/mlx5_core ofed/drivers/infiniband/core ofed/drivers/infiniband/debug ofed/drivers/infiniband/hw/mlx4 ofed/drivers/infiniband/hw/mthca ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 12:03:24 -0000 Author: hselasky Date: Wed May 25 12:03:21 2016 New Revision: 300676 URL: https://svnweb.freebsd.org/changeset/base/300676 Log: Prepare for activation of LinuxKPI module parameters as read-only tunable SYSCTL's. Linux module parameters are associated with the module they belong to. FreeBSD does not share this concept of a parent module. Instead add macros which define the prefix to use for the module parameters in the LinuxKPI consumers. While at it convert all "bool" LinuxKPI module parameters to "byte" type, because we don't have a "bool" type of SYSCTL in FreeBSD. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/cxgbe/iw_cxgbe/provider.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/ofed/drivers/infiniband/core/cma.c head/sys/ofed/drivers/infiniband/core/mad.c head/sys/ofed/drivers/infiniband/core/multicast.c head/sys/ofed/drivers/infiniband/core/umem.c head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c head/sys/ofed/drivers/infiniband/debug/memtrack.c head/sys/ofed/drivers/infiniband/hw/mlx4/main.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_catas.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h head/sys/ofed/drivers/infiniband/util/madeye.c head/sys/ofed/drivers/net/mlx4/catas.c head/sys/ofed/drivers/net/mlx4/en_main.c head/sys/ofed/drivers/net/mlx4/en_tx.c head/sys/ofed/drivers/net/mlx4/fw.c head/sys/ofed/drivers/net/mlx4/main.c head/sys/ofed/drivers/net/mlx4/port.c Modified: head/sys/dev/cxgbe/iw_cxgbe/provider.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/provider.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/dev/cxgbe/iw_cxgbe/provider.c Wed May 25 12:03:21 2016 (r300676) @@ -32,6 +32,8 @@ #include __FBSDID("$FreeBSD$"); +#define LINUXKPI_PARAM_PREFIX iw_cxgbe_ + #include "opt_inet.h" #ifdef TCP_OFFLOAD Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 25 12:03:21 2016 (r300676) @@ -25,6 +25,8 @@ * $FreeBSD$ */ +#define LINUXKPI_PARAM_PREFIX mlx5_ + #include #include #include Modified: head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cma.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/core/cma.c Wed May 25 12:03:21 2016 (r300676) @@ -34,6 +34,8 @@ * SOFTWARE. */ +#define LINUXKPI_PARAM_PREFIX ibcore_ + #include #include #include Modified: head/sys/ofed/drivers/infiniband/core/mad.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/mad.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/core/mad.c Wed May 25 12:03:21 2016 (r300676) @@ -33,6 +33,9 @@ * SOFTWARE. * */ + +#define LINUXKPI_PARAM_PREFIX ibcore_ + #include #include #include Modified: head/sys/ofed/drivers/infiniband/core/multicast.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/multicast.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/core/multicast.c Wed May 25 12:03:21 2016 (r300676) @@ -30,6 +30,8 @@ * SOFTWARE. */ +#define LINUXKPI_PARAM_PREFIX ibcore_ + #include #include #include Modified: head/sys/ofed/drivers/infiniband/core/umem.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/umem.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/core/umem.c Wed May 25 12:03:21 2016 (r300676) @@ -32,6 +32,8 @@ * SOFTWARE. */ +#define LINUXKPI_PARAM_PREFIX ibcore_ + #include #include #include Modified: head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Wed May 25 12:03:21 2016 (r300676) @@ -33,6 +33,8 @@ * SOFTWARE. */ +#define LINUXKPI_PARAM_PREFIX ibcore_ + #include #include #include Modified: head/sys/ofed/drivers/infiniband/debug/memtrack.c ============================================================================== --- head/sys/ofed/drivers/infiniband/debug/memtrack.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/debug/memtrack.c Wed May 25 12:03:21 2016 (r300676) @@ -19,6 +19,8 @@ Copyright (c) 2004 Mellanox Technologies Ltd. All rights reserved. */ +#define LINUXKPI_PARAM_PREFIX memtrack_ + #define C_MEMTRACK_C #ifdef kmalloc Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Wed May 25 12:03:21 2016 (r300676) @@ -31,6 +31,8 @@ * SOFTWARE. */ +#define LINUXKPI_PARAM_PREFIX mlx4_ + #include #include #include Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_catas.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mthca/mthca_catas.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/hw/mthca/mthca_catas.c Wed May 25 12:03:21 2016 (r300676) @@ -30,6 +30,8 @@ * SOFTWARE. */ +#define LINUXKPI_PARAM_PREFIX mthca_ + #include #include #include Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c Wed May 25 12:03:21 2016 (r300676) @@ -32,6 +32,8 @@ * SOFTWARE. */ +#define LINUXKPI_PARAM_PREFIX mthca_ + #include #include #include Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c Wed May 25 12:03:21 2016 (r300676) @@ -32,6 +32,8 @@ * SOFTWARE. */ +#define LINUXKPI_PARAM_PREFIX mthca_ + #include #include #include Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Wed May 25 12:03:21 2016 (r300676) @@ -35,6 +35,8 @@ #ifndef _IPOIB_H #define _IPOIB_H +#define LINUXKPI_PARAM_PREFIX ipoib_ + #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ofed.h" Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h Wed May 25 12:03:21 2016 (r300676) @@ -1,6 +1,8 @@ #ifndef _SDP_H_ #define _SDP_H_ +#define LINUXKPI_PARAM_PREFIX ib_sdp_ + #include "opt_ddb.h" #include "opt_inet.h" #include "opt_ofed.h" Modified: head/sys/ofed/drivers/infiniband/util/madeye.c ============================================================================== --- head/sys/ofed/drivers/infiniband/util/madeye.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/infiniband/util/madeye.c Wed May 25 12:03:21 2016 (r300676) @@ -32,6 +32,9 @@ * * $Id$ */ + +#define LINUXKPI_PARAM_PREFIX ib_madeye_ + #include #include #include Modified: head/sys/ofed/drivers/net/mlx4/catas.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/catas.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/net/mlx4/catas.c Wed May 25 12:03:21 2016 (r300676) @@ -31,6 +31,8 @@ * SOFTWARE. */ +#define LINUXKPI_PARAM_PREFIX mlx4_ + #include #include Modified: head/sys/ofed/drivers/net/mlx4/en_main.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_main.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/net/mlx4/en_main.c Wed May 25 12:03:21 2016 (r300676) @@ -31,6 +31,8 @@ * */ +#define LINUXKPI_PARAM_PREFIX mlx4_ + #include #include #include Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_tx.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/net/mlx4/en_tx.c Wed May 25 12:03:21 2016 (r300676) @@ -31,6 +31,8 @@ * */ +#define LINUXKPI_PARAM_PREFIX mlx4_ + #include #include #include Modified: head/sys/ofed/drivers/net/mlx4/fw.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/fw.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/net/mlx4/fw.c Wed May 25 12:03:21 2016 (r300676) @@ -32,6 +32,8 @@ * SOFTWARE. */ +#define LINUXKPI_PARAM_PREFIX mlx4_ + #include #include #include @@ -49,8 +51,8 @@ enum { extern void __buggy_use_of_MLX4_GET(void); extern void __buggy_use_of_MLX4_PUT(void); -static bool enable_qos; -module_param(enable_qos, bool, 0444); +static u8 enable_qos; +module_param(enable_qos, byte, 0444); MODULE_PARM_DESC(enable_qos, "Enable Quality of Service support in the HCA (default: off)"); #define MLX4_GET(dest, source, offset) \ Modified: head/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/main.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/net/mlx4/main.c Wed May 25 12:03:21 2016 (r300676) @@ -33,6 +33,8 @@ * SOFTWARE. */ +#define LINUXKPI_PARAM_PREFIX mlx4_ + #include #include #include Modified: head/sys/ofed/drivers/net/mlx4/port.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/port.c Wed May 25 11:58:55 2016 (r300675) +++ head/sys/ofed/drivers/net/mlx4/port.c Wed May 25 12:03:21 2016 (r300676) @@ -30,6 +30,8 @@ * SOFTWARE. */ +#define LINUXKPI_PARAM_PREFIX mlx4_ + #include #include #include From owner-svn-src-head@freebsd.org Wed May 25 12:12:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05A71B495A0; Wed, 25 May 2016 12:12:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2D0D1143; Wed, 25 May 2016 12:12:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PCCFQo012594; Wed, 25 May 2016 12:12:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PCCEfJ012592; Wed, 25 May 2016 12:12:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605251212.u4PCCEfJ012592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 May 2016 12:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300677 - in head/sys/compat/linuxkpi/common: include/linux 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 12:12:16 -0000 Author: hselasky Date: Wed May 25 12:12:14 2016 New Revision: 300677 URL: https://svnweb.freebsd.org/changeset/base/300677 Log: Implement Linux module parameters as read-only tunable SYSCTLs. Bool module parameters are no longer supported, because there is no equivalent in FreeBSD. There are two macros available which control the behaviour of the LinuxKPI module parameters: - LINUXKPI_PARAM_PARENT allows the consumer to set the SYSCTL parent where the modules parameters will be created. - LINUXKPI_PARAM_PREFIX defines a parameter name prefix, which is added to all created module parameters. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/moduleparam.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/moduleparam.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Wed May 25 12:03:21 2016 (r300676) +++ head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Wed May 25 12:12:14 2016 (r300677) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,204 +31,84 @@ #ifndef _LINUX_MODULEPARAM_H_ #define _LINUX_MODULEPARAM_H_ -#include - -/* - * These are presently not hooked up to anything. In linux the parameters - * can be set when modules are loaded. On FreeBSD these could be mapped - * to kenv in the future. - */ -struct kernel_param; - -typedef int (*param_set_fn)(const char *val, struct kernel_param *kp); -typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp); - -struct kernel_param { - const char *name; - u16 perm; - u16 flags; - param_set_fn set; - param_get_fn get; - union { - void *arg; - struct kparam_string *str; - struct kparam_array *arr; - } un; -}; - -#define KPARAM_ISBOOL 2 - -struct kparam_string { - unsigned int maxlen; - char *string; -}; - -struct kparam_array -{ - unsigned int max; - unsigned int *num; - param_set_fn set; - param_get_fn get; - unsigned int elemsize; - void *elem; -}; - -static inline void -param_sysinit(struct kernel_param *param) -{ -} - -#define module_param_call(name, set, get, arg, perm) \ - static struct kernel_param __param_##name = \ - { #name, perm, 0, set, get, { arg } }; \ - SYSINIT(name##_param_sysinit, SI_SUB_DRIVERS, SI_ORDER_FIRST, \ - param_sysinit, &__param_##name); - -#define module_param_string(name, string, len, perm) - -#define module_param_named(name, var, type, mode) \ - module_param_call(name, param_set_##type, param_get_##type, &var, mode) - -#define module_param(var, type, mode) \ - module_param_named(var, var, type, mode) - -#define module_param_array(var, type, addr_argc, mode) \ - module_param_named(var, var, type, mode) - -#define MODULE_PARM_DESC(name, desc) - -static inline int -param_set_byte(const char *val, struct kernel_param *kp) -{ - - return 0; -} - -static inline int -param_get_byte(char *buffer, struct kernel_param *kp) -{ - - return 0; -} - - -static inline int -param_set_short(const char *val, struct kernel_param *kp) -{ - - return 0; -} - -static inline int -param_get_short(char *buffer, struct kernel_param *kp) -{ - - return 0; -} - - -static inline int -param_set_ushort(const char *val, struct kernel_param *kp) -{ - - return 0; -} - -static inline int -param_get_ushort(char *buffer, struct kernel_param *kp) -{ - - return 0; -} - - -static inline int -param_set_int(const char *val, struct kernel_param *kp) -{ - - return 0; -} - -static inline int -param_get_int(char *buffer, struct kernel_param *kp) -{ - - return 0; -} - - -static inline int -param_set_uint(const char *val, struct kernel_param *kp) -{ - - return 0; -} - -static inline int -param_get_uint(char *buffer, struct kernel_param *kp) -{ - - return 0; -} - - -static inline int -param_set_long(const char *val, struct kernel_param *kp) -{ - - return 0; -} - -static inline int -param_get_long(char *buffer, struct kernel_param *kp) -{ - - return 0; -} - - -static inline int -param_set_ulong(const char *val, struct kernel_param *kp) -{ - - return 0; -} - -static inline int -param_get_ulong(char *buffer, struct kernel_param *kp) -{ - - return 0; -} - - -static inline int -param_set_charp(const char *val, struct kernel_param *kp) -{ - - return 0; -} - -static inline int -param_get_charp(char *buffer, struct kernel_param *kp) -{ - - return 0; -} +#include +#include +#include -static inline int -param_set_bool(const char *val, struct kernel_param *kp) -{ +#ifndef LINUXKPI_PARAM_PARENT +#define LINUXKPI_PARAM_PARENT _compat_linuxkpi +#endif + +#ifndef LINUXKPI_PARAM_PREFIX +#define LINUXKPI_PARAM_PREFIX /* empty prefix is the default */ +#endif + +#define LINUXKPI_PARAM_CONCAT_SUB(a,b,c,d) a##b##c##d +#define LINUXKPI_PARAM_CONCAT(...) LINUXKPI_PARAM_CONCAT_SUB(__VA_ARGS__) +#define LINUXKPI_PARAM_PASS(...) __VA_ARGS__ +#define LINUXKPI_PARAM_DESC(name) LINUXKPI_PARAM_CONCAT(linuxkpi_,LINUXKPI_PARAM_PREFIX,name,_desc) +#define LINUXKPI_PARAM_NAME(name) LINUXKPI_PARAM_CONCAT(LINUXKPI_PARAM_PREFIX,name,,) + +#define LINUXKPI_PARAM_byte(name, var) \ + extern const char LINUXKPI_PARAM_DESC(name)[]; \ + LINUXKPI_PARAM_PASS(SYSCTL_U8(LINUXKPI_PARAM_PARENT, OID_AUTO, \ + LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_DESC(name))) + +#define LINUXKPI_PARAM_short(name, var) \ + extern const char LINUXKPI_PARAM_DESC(name)[]; \ + LINUXKPI_PARAM_PASS(SYSCTL_S16(LINUXKPI_PARAM_PARENT, OID_AUTO, \ + LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_DESC(name))) + +#define LINUXKPI_PARAM_ushort(name, var) \ + extern const char LINUXKPI_PARAM_DESC(name)[]; \ + LINUXKPI_PARAM_PASS(SYSCTL_U16(LINUXKPI_PARAM_PARENT, OID_AUTO, \ + LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_DESC(name))) + +#define LINUXKPI_PARAM_int(name, var) \ + extern const char LINUXKPI_PARAM_DESC(name)[]; \ + LINUXKPI_PARAM_PASS(SYSCTL_INT(LINUXKPI_PARAM_PARENT, OID_AUTO, \ + LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_DESC(name))) + +#define LINUXKPI_PARAM_uint(name, var) \ + extern const char LINUXKPI_PARAM_DESC(name)[]; \ + LINUXKPI_PARAM_PASS(SYSCTL_UINT(LINUXKPI_PARAM_PARENT, OID_AUTO, \ + LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_DESC(name))) + +#define LINUXKPI_PARAM_long(name, var) \ + extern const char LINUXKPI_PARAM_DESC(name)[]; \ + LINUXKPI_PARAM_PASS(SYSCTL_LONG(LINUXKPI_PARAM_PARENT, OID_AUTO, \ + LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_DESC(name))) + +#define LINUXKPI_PARAM_ulong(name, var) \ + extern const char LINUXKPI_PARAM_DESC(name)[]; \ + LINUXKPI_PARAM_PASS(SYSCTL_ULONG(LINUXKPI_PARAM_PARENT, OID_AUTO, \ + LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_DESC(name))) + +#define module_param_string(name, str, len, perm) \ + extern const char LINUXKPI_PARAM_DESC(name)[]; \ + LINUXKPI_PARAM_PASS(SYSCTL_STRING(LINUXKPI_PARAM_PARENT, OID_AUTO, \ + LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, (str), (len), \ + LINUXKPI_PARAM_DESC(name))) + +#define module_param_named(name, var, type, mode) \ + LINUXKPI_PARAM_##type(name, var) + +#define module_param(var, type, mode) \ + LINUXKPI_PARAM_##type(var, var) - return 0; -} +#define module_param_array(var, type, addr_argc, mode) -static inline int -param_get_bool(char *buffer, struct kernel_param *kp) -{ +#define MODULE_PARM_DESC(name, desc) \ + const char LINUXKPI_PARAM_DESC(name)[] = { desc } - return 0; -} +SYSCTL_DECL(_compat_linuxkpi); -#endif /* _LINUX_MODULEPARAM_H_ */ +#endif /* _LINUX_MODULEPARAM_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 25 12:03:21 2016 (r300676) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 25 12:12:14 2016 (r300677) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -77,6 +78,8 @@ __FBSDID("$FreeBSD$"); #include +SYSCTL_NODE(_compat, OID_AUTO, linuxkpi, CTLFLAG_RW, 0, "LinuxKPI parameters"); + MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compat"); #include From owner-svn-src-head@freebsd.org Wed May 25 13:09:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BF7AB49482; Wed, 25 May 2016 13:09:08 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDC761E5D; Wed, 25 May 2016 13:09:07 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PD975M027955; Wed, 25 May 2016 13:09:07 GMT (envelope-from fanf@FreeBSD.org) Received: (from fanf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PD976L027954; Wed, 25 May 2016 13:09:07 GMT (envelope-from fanf@FreeBSD.org) Message-Id: <201605251309.u4PD976L027954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fanf set sender to fanf@FreeBSD.org using -f From: Tony Finch Date: Wed, 25 May 2016 13:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300678 - head/usr.bin/whois X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 13:09:08 -0000 Author: fanf Date: Wed May 25 13:09:06 2016 New Revision: 300678 URL: https://svnweb.freebsd.org/changeset/base/300678 Log: Send whois queries for gov.uk names to JANET. Modified: head/usr.bin/whois/whois.c Modified: head/usr.bin/whois/whois.c ============================================================================== --- head/usr.bin/whois/whois.c Wed May 25 12:12:14 2016 (r300677) +++ head/usr.bin/whois/whois.c Wed May 25 13:09:06 2016 (r300678) @@ -101,6 +101,7 @@ static struct { { "-RIPE", RNICHOST }, /* Nominet's whois server doesn't return referrals to JANET */ { ".ac.uk", "ac.uk" QNICHOST_TAIL }, + { ".gov.uk", "ac.uk" QNICHOST_TAIL }, { "", IANAHOST }, /* default */ { NULL, NULL } /* safety belt */ }; From owner-svn-src-head@freebsd.org Wed May 25 13:23:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB67DB498B9; Wed, 25 May 2016 13:23:50 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84AB318FC; Wed, 25 May 2016 13:23:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2CEDE1FE024; Wed, 25 May 2016 15:23:47 +0200 (CEST) Subject: Re: svn commit: r299393 - in head: . share/mk To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605102232.u4AMWNvp000287@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <08cfa0ac-ad92-c8f9-2141-e72088b17d41@selasky.org> Date: Wed, 25 May 2016 15:27:07 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201605102232.u4AMWNvp000287@repo.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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 13:23:50 -0000 On 05/11/16 00:32, John Baldwin wrote: > Author: jhb > Date: Tue May 10 22:32:23 2016 > New Revision: 299393 > URL: https://svnweb.freebsd.org/changeset/base/299393 > > Log: > Change the default installation directory for modules to /boot/modules. > > Kernel installs always override KMODDIR when installing modules, so > this default setting is only used for standalone module builds. Many > out-of-tree modules manually override KMODDIR already to avoid placing > modules in /boot/kernel. This now makes that behavior the default. > > Discussed on: arch@ > Reviewed by: imp > Relnotes: yes > > Modified: > head/UPDATING > head/share/mk/bsd.own.mk > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Tue May 10 22:28:06 2016 (r299392) > +++ head/UPDATING Tue May 10 22:32:23 2016 (r299393) > @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > +20160510: > + Kernel modules compiled outside of a kernel build now default to > + installing to /boot/modules instead of /boot/kernel. Many kernel > + modules built this way (such as those in ports) already overrode > + KMODDIR explicitly to install into /boot/modules. However, > + manually building and installing a module from /sys/modules will > + now install to /boot/modules instead of /boot/kernel. > + > 20160414: > The CAM I/O scheduler has been committed to the kernel. There should be > no user visible impact. This does enable NCQ Trim on ada SSDs. While the > > Modified: head/share/mk/bsd.own.mk > ============================================================================== > --- head/share/mk/bsd.own.mk Tue May 10 22:28:06 2016 (r299392) > +++ head/share/mk/bsd.own.mk Tue May 10 22:32:23 2016 (r299393) > @@ -165,11 +165,7 @@ BINGRP?= wheel > BINMODE?= 555 > NOBINMODE?= 444 > > -.if defined(MODULES_WITH_WORLD) > KMODDIR?= /boot/modules > -.else > -KMODDIR?= /boot/kernel > -.endif > KMODOWN?= ${BINOWN} > KMODGRP?= ${BINGRP} > KMODMODE?= ${BINMODE} > Just a small nit: There is a comment in bsd.own.mk which needs updating too: > # > # KMODDIR Base path for loadable kernel modules > # (see kld(4)). [/boot/kernel] --HPS From owner-svn-src-head@freebsd.org Wed May 25 13:48:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A896AB4903F; Wed, 25 May 2016 13:48:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A1E81750; Wed, 25 May 2016 13:48:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PDmQTm040105; Wed, 25 May 2016 13:48:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PDmQdA040104; Wed, 25 May 2016 13:48:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605251348.u4PDmQdA040104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 25 May 2016 13:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300679 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 13:48:27 -0000 Author: tuexen Date: Wed May 25 13:48:26 2016 New Revision: 300679 URL: https://svnweb.freebsd.org/changeset/base/300679 Log: Count packets as not being delivered only if they are neither processed by a kernel handler nor by a raw socket. MFC after: 1 week Modified: head/sys/netinet/raw_ip.c Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Wed May 25 13:09:06 2016 (r300678) +++ head/sys/netinet/raw_ip.c Wed May 25 13:48:26 2016 (r300679) @@ -132,6 +132,8 @@ int (*ip_rsvp_vif)(struct socket *, stru void (*ip_rsvp_force_done)(struct socket *); #endif /* INET */ +extern struct protosw inetsw[]; + u_long rip_sendspace = 9216; SYSCTL_ULONG(_net_inet_raw, OID_AUTO, maxdgram, CTLFLAG_RW, &rip_sendspace, 0, "Maximum outgoing raw IP datagram size"); @@ -411,9 +413,11 @@ rip_input(struct mbuf **mp, int *offp, i IPSTAT_INC(ips_delivered); INP_RUNLOCK(last); } else { + if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) { + IPSTAT_INC(ips_noproto); + IPSTAT_DEC(ips_delivered); + } m_freem(m); - IPSTAT_INC(ips_noproto); - IPSTAT_DEC(ips_delivered); } return (IPPROTO_DONE); } From owner-svn-src-head@freebsd.org Wed May 25 14:08:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48399B495B8; Wed, 25 May 2016 14:08:23 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A3B81239; Wed, 25 May 2016 14:08:22 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PE8Muf046174; Wed, 25 May 2016 14:08:22 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PE8LXq046170; Wed, 25 May 2016 14:08:21 GMT (envelope-from br@FreeBSD.org) Message-Id: <201605251408.u4PE8LXq046170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 25 May 2016 14:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300680 - in head: contrib/netbsd-tests/lib/libc/gen contrib/netbsd-tests/lib/libc/sys lib/libc/riscv lib/libc/riscv/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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 14:08:23 -0000 Author: br Date: Wed May 25 14:08:21 2016 New Revision: 300680 URL: https://svnweb.freebsd.org/changeset/base/300680 Log: Remove legacy brk and sbrk from RISC-V. Discussed with: andrew Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Deleted: head/lib/libc/riscv/sys/brk.S head/lib/libc/riscv/sys/sbrk.S Modified: head/contrib/netbsd-tests/lib/libc/gen/t_dir.c head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c head/lib/libc/riscv/Symbol.map head/lib/libc/riscv/sys/Makefile.inc Modified: head/contrib/netbsd-tests/lib/libc/gen/t_dir.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_dir.c Wed May 25 13:48:26 2016 (r300679) +++ head/contrib/netbsd-tests/lib/libc/gen/t_dir.c Wed May 25 14:08:21 2016 (r300680) @@ -111,7 +111,8 @@ ATF_TC_BODY(seekdir_basic, tc) closedir(dp); } -#ifndef __aarch64__ /* There is no sbrk on AArch64 */ +/* There is no sbrk on AArch64 and RISC-V */ +#if !defined(__aarch64__) && !defined(__riscv__) ATF_TC(telldir_leak); ATF_TC_HEAD(telldir_leak, tc) { @@ -161,7 +162,7 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, seekdir_basic); -#ifndef __aarch64__ +#if !defined(__aarch64__) && !defined(__riscv__) ATF_TP_ADD_TC(tp, telldir_leak); #endif Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Wed May 25 13:48:26 2016 (r300679) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Wed May 25 14:08:21 2016 (r300680) @@ -176,7 +176,7 @@ ATF_TC_BODY(mlock_err, tc) unsigned long vmin = 0; size_t len = sizeof(vmin); #endif -#ifndef __aarch64__ +#if !defined(__aarch64__) && !defined(__riscv__) void *invalid_ptr; #endif int null_errno = ENOMEM; /* error expected for NULL */ @@ -214,7 +214,8 @@ ATF_TC_BODY(mlock_err, tc) errno = 0; ATF_REQUIRE_ERRNO(EINVAL, munlock((char *)-1, page) == -1); -#ifndef __aarch64__ /* There is no sbrk on AArch64 */ +/* There is no sbrk on AArch64 and RISC-V */ +#if !defined(__aarch64__) && !defined(__riscv__) /* * Try to create a pointer to an unmapped page - first after current * brk will likely do. Modified: head/lib/libc/riscv/Symbol.map ============================================================================== --- head/lib/libc/riscv/Symbol.map Wed May 25 13:48:26 2016 (r300679) +++ head/lib/libc/riscv/Symbol.map Wed May 25 14:08:21 2016 (r300680) @@ -28,8 +28,6 @@ FBSD_1.0 { ntohl; ntohs; vfork; - brk; - sbrk; makecontext; }; Modified: head/lib/libc/riscv/sys/Makefile.inc ============================================================================== --- head/lib/libc/riscv/sys/Makefile.inc Wed May 25 13:48:26 2016 (r300679) +++ head/lib/libc/riscv/sys/Makefile.inc Wed May 25 14:08:21 2016 (r300680) @@ -3,10 +3,8 @@ SRCS+= trivial-vdso_tc.c #MDASM= ptrace.S -MDASM= brk.S \ - cerror.S \ +MDASM= cerror.S \ pipe.S \ - sbrk.S \ shmat.S \ sigreturn.S \ syscall.S \ From owner-svn-src-head@freebsd.org Wed May 25 15:35:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7796CB4AAD9; Wed, 25 May 2016 15:35:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F87E12F5; Wed, 25 May 2016 15:35:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PFZNxI073948; Wed, 25 May 2016 15:35:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PFZNMv073946; Wed, 25 May 2016 15:35:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605251535.u4PFZNMv073946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 25 May 2016 15:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300683 - head/lib/libc/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 15:35:24 -0000 Author: pfg Date: Wed May 25 15:35:23 2016 New Revision: 300683 URL: https://svnweb.freebsd.org/changeset/base/300683 Log: libc: regexec(3) adjustment. Change the behavior of when REG_STARTEND is combined with REG_NOTBOL. From the original posting[1]: "Enable the assumption that pmatch[0].rm_so is a continuation offset to a string and allows us to do a proper assessment of the character in regards to it's word position ('^' or '\<'), without risking going into unallocated memory." This change makes us similar to how glibc handles REG_STARTEND | REG_NOTBOL, and is closely related to a soon-to-land fix to sed. Special thanks to Martijn van Duren and Ingo Schwarze for working out some consistent behaviour. Differential Revision: https://reviews.freebsd.org/D6257 Taken from: openbsd-tech 2016-05-24 [1] (Martijn van Duren) Relnotes: yes MFC after: 1 month Modified: head/lib/libc/regex/engine.c head/lib/libc/regex/regex.3 Modified: head/lib/libc/regex/engine.c ============================================================================== --- head/lib/libc/regex/engine.c Wed May 25 15:10:07 2016 (r300682) +++ head/lib/libc/regex/engine.c Wed May 25 15:35:23 2016 (r300683) @@ -786,7 +786,7 @@ fast( struct match *m, ASSIGN(fresh, st); SP("start", st, *p); coldp = NULL; - if (start == m->beginp) + if (start == m->offp || (start == m->beginp && !(m->eflags®_NOTBOL))) c = OUT; else { /* @@ -891,7 +891,7 @@ slow( struct match *m, SP("sstart", st, *p); st = step(m->g, startst, stopst, st, NOTHING, st); matchp = NULL; - if (start == m->beginp) + if (start == m->offp || (start == m->beginp && !(m->eflags®_NOTBOL))) c = OUT; else { /* Modified: head/lib/libc/regex/regex.3 ============================================================================== --- head/lib/libc/regex/regex.3 Wed May 25 15:10:07 2016 (r300682) +++ head/lib/libc/regex/regex.3 Wed May 25 15:35:23 2016 (r300683) @@ -32,7 +32,7 @@ .\" @(#)regex.3 8.4 (Berkeley) 3/20/94 .\" $FreeBSD$ .\" -.Dd August 17, 2005 +.Dd May 25, 2016 .Dt REGEX 3 .Os .Sh NAME @@ -235,11 +235,16 @@ The argument is the bitwise OR of zero or more of the following flags: .Bl -tag -width REG_STARTEND .It Dv REG_NOTBOL -The first character of -the string -is not the beginning of a line, so the -.Ql ^\& -anchor should not match before it. +The first character of the string is treated as the continuation +of a line. +This means that the anchors +.Ql ^\& , +.Ql [[:<:]] , +and +.Ql \e< +do not match before it; but see +.Dv REG_STARTEND +below. This does not affect the behavior of newlines under .Dv REG_NEWLINE . .It Dv REG_NOTEOL @@ -247,19 +252,16 @@ The NUL terminating the string does not end a line, so the .Ql $\& -anchor should not match before it. +anchor does not match before it. This does not affect the behavior of newlines under .Dv REG_NEWLINE . .It Dv REG_STARTEND The string is considered to start at -.Fa string -+ -.Fa pmatch Ns [0]. Ns Va rm_so -and to have a terminating NUL located at -.Fa string -+ -.Fa pmatch Ns [0]. Ns Va rm_eo -(there need not actually be a NUL at that location), +.Fa string No + +.Fa pmatch Ns [0]. Ns Fa rm_so +and to end before the byte located at +.Fa string No + +.Fa pmatch Ns [0]. Ns Fa rm_eo , regardless of the value of .Fa nmatch . See below for the definition of @@ -271,13 +273,37 @@ compatible with but not specified by .St -p1003.2 , and should be used with caution in software intended to be portable to other systems. -Note that a non-zero -.Va rm_so -does not imply -.Dv REG_NOTBOL ; -.Dv REG_STARTEND -affects only the location of the string, -not how it is matched. +.Pp +Without +.Dv REG_NOTBOL , +the position +.Fa rm_so +is considered the beginning of a line, such that +.Ql ^ +matches before it, and the beginning of a word if there is a word +character at this position, such that +.Ql [[:<:]] +and +.Ql \e< +match before it. +.Pp +With +.Dv REG_NOTBOL , +the character at position +.Fa rm_so +is treated as the continuation of a line, and if +.Fa rm_so +is greater than 0, the preceding character is taken into consideration. +If the preceding character is a newline and the regular expression was compiled +with +.Dv REG_NEWLINE , +.Ql ^ +matches before the string; if the preceding character is not a word character +but the string starts with a word character, +.Ql [[:<:]] +and +.Ql \e< +match before the string. .El .Pp See From owner-svn-src-head@freebsd.org Wed May 25 15:42:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C239CB4AE81; Wed, 25 May 2016 15:42:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94E8E1C02; Wed, 25 May 2016 15:42:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PFgdME076997; Wed, 25 May 2016 15:42:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PFgdRG076996; Wed, 25 May 2016 15:42:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605251542.u4PFgdRG076996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 25 May 2016 15:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300684 - head/usr.bin/sed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 15:42:40 -0000 Author: pfg Date: Wed May 25 15:42:39 2016 New Revision: 300684 URL: https://svnweb.freebsd.org/changeset/base/300684 Log: sed: convert sed to use REG_STARTEND more explicitly. Summarizing the findings in the OpenBSD list: This solves a reproduceable issue with very recent Mesa where REG_NOTBOL combined with a match at the begin of the string causes our regex library to treat the word as not begin of word. Thanks to Martijn van Duren and Ingo Schwarze for taking the time to solve this in the least invasive way. PR: 209352, 209387 Taken from: openbsd-tech (Martijn van Duren) MFC after: 1 month Modified: head/usr.bin/sed/process.c Modified: head/usr.bin/sed/process.c ============================================================================== --- head/usr.bin/sed/process.c Wed May 25 15:35:23 2016 (r300683) +++ head/usr.bin/sed/process.c Wed May 25 15:42:39 2016 (r300684) @@ -71,7 +71,8 @@ static inline int applies(struct s_comm static void do_tr(struct s_tr *); static void flush_appends(void); static void lputs(char *, size_t); -static int regexec_e(regex_t *, const char *, int, int, size_t); +static int regexec_e(regex_t *, const char *, int, int, size_t, + size_t); static void regsub(SPACE *, char *, char *); static int substitute(struct s_command *); @@ -281,7 +282,7 @@ new: if (!nflag && !pd) * (lastline, linenumber, ps). */ #define MATCH(a) \ - ((a)->type == AT_RE ? regexec_e((a)->u.r, ps, 0, 1, psl) : \ + ((a)->type == AT_RE ? regexec_e((a)->u.r, ps, 0, 1, 0, psl) : \ (a)->type == AT_LINE ? linenum == (a)->u.l : lastline()) /* @@ -381,6 +382,7 @@ substitute(struct s_command *cp) regex_t *re; regoff_t slen; int lastempty, n; + size_t le = 0; char *s; s = ps; @@ -392,7 +394,7 @@ substitute(struct s_command *cp) linenum, fname, cp->u.s->maxbref); } } - if (!regexec_e(re, s, 0, 0, psl)) + if (!regexec_e(re, s, 0, 0, 0, psl)) return (0); SS.len = 0; /* Clean substitute space. */ @@ -402,28 +404,30 @@ substitute(struct s_command *cp) do { /* Copy the leading retained string. */ - if (n <= 1 && match[0].rm_so) - cspace(&SS, s, match[0].rm_so, APPEND); + if (n <= 1 && match[0].rm_so - le) + cspace(&SS, s, match[0].rm_so - le, APPEND); /* Skip zero-length matches right after other matches. */ - if (lastempty || match[0].rm_so || + if (lastempty || (match[0].rm_so - le) || match[0].rm_so != match[0].rm_eo) { if (n <= 1) { /* Want this match: append replacement. */ - regsub(&SS, s, cp->u.s->new); + regsub(&SS, ps, cp->u.s->new); if (n == 1) n = -1; } else { /* Want a later match: append original. */ - if (match[0].rm_eo) - cspace(&SS, s, match[0].rm_eo, APPEND); + if (match[0].rm_eo - le) + cspace(&SS, s, match[0].rm_eo - le, + APPEND); n--; } } /* Move past this match. */ - s += match[0].rm_eo; - slen -= match[0].rm_eo; + s += (match[0].rm_eo - le); + slen -= (match[0].rm_eo - le); + le = match[0].rm_eo; /* * After a zero-length match, advance one byte, @@ -434,13 +438,15 @@ substitute(struct s_command *cp) slen = -1; else slen--; - if (*s != '\0') + if (*s != '\0') { cspace(&SS, s++, 1, APPEND); + le++; + } lastempty = 1; } else lastempty = 0; - } while (n >= 0 && slen >= 0 && regexec_e(re, s, REG_NOTBOL, 0, slen)); + } while (n >= 0 && slen >= 0 && regexec_e(re, ps, 0, 0, le, psl)); /* Did not find the requested number of matches. */ if (n > 1) @@ -652,7 +658,7 @@ lputs(char *s, size_t len) static int regexec_e(regex_t *preg, const char *string, int eflags, int nomatch, - size_t slen) + size_t start, size_t stop) { int eval; @@ -663,8 +669,8 @@ regexec_e(regex_t *preg, const char *str defpreg = preg; /* Set anchors */ - match[0].rm_so = 0; - match[0].rm_eo = slen; + match[0].rm_so = start; + match[0].rm_eo = stop; eval = regexec(defpreg, string, nomatch ? 0 : maxnsub + 1, match, eflags | REG_STARTEND); From owner-svn-src-head@freebsd.org Wed May 25 15:43:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80A73B4AECA; Wed, 25 May 2016 15:43:02 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34DB81D68; Wed, 25 May 2016 15:43:02 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PFh1q3077087; Wed, 25 May 2016 15:43:01 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PFh146077085; Wed, 25 May 2016 15:43:01 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605251543.u4PFh146077085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 15:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300685 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 15:43:02 -0000 Author: truckman Date: Wed May 25 15:43:01 2016 New Revision: 300685 URL: https://svnweb.freebsd.org/changeset/base/300685 Log: Fix a couple of new instances of a false positive Coverity buffer overflow defect. Use the new CCB_CLEAR_ALL_EXCEPT_HDR() macro instead of the calling bzero() on the pointer to the header used as an array and indexed by 1. Don't leak a buffer after executing "goto restart_report" by overwriting its pointer with the results of another calloc(). Be sure to clear the buffer before reusing it. (CID 1356042) Reported by: Coverity CID: 1356022, 1356034, 1356023, 1356035, 1356042 Reviewed by: ken Modified: head/sbin/camcontrol/epc.c head/sbin/camcontrol/zone.c Modified: head/sbin/camcontrol/epc.c ============================================================================== --- head/sbin/camcontrol/epc.c Wed May 25 15:42:39 2016 (r300684) +++ head/sbin/camcontrol/epc.c Wed May 25 15:43:01 2016 (r300685) @@ -633,8 +633,7 @@ epc(struct cam_device *device, int argc, goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(ccb); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { Modified: head/sbin/camcontrol/zone.c ============================================================================== --- head/sbin/camcontrol/zone.c Wed May 25 15:42:39 2016 (r300684) +++ head/sbin/camcontrol/zone.c Wed May 25 15:43:01 2016 (r300685) @@ -347,8 +347,7 @@ zone(struct cam_device *device, int argc goto bailout; } - bzero(&(&ccb->ccb_h)[1], - sizeof(union ccb) - sizeof(struct ccb_hdr)); + CCB_CLEAR_ALL_EXCEPT_HDR(ccb); while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { @@ -484,7 +483,8 @@ restart_report: sector_count = ZAC_ATA_SECTOR_COUNT(alloc_len); protocol = AP_PROTO_DMA; } else { - cdb_storage = calloc(cdb_storage_len, 1); + if (cdb_storage == NULL) + cdb_storage = calloc(cdb_storage_len, 1); if (cdb_storage == NULL) err(1, "couldn't allocate memory"); @@ -662,6 +662,8 @@ restart_report: if (zp_status == ZONE_PRINT_MORE_DATA) { bzero(ccb, sizeof(*ccb)); first_pass = 0; + if (cdb_storage != NULL) + bzero(cdb_storage, cdb_storage_len); goto restart_report; } else if (zp_status == ZONE_PRINT_ERROR) error = 1; From owner-svn-src-head@freebsd.org Wed May 25 15:49:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1FA5B49065; Wed, 25 May 2016 15:49:30 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F5261205; Wed, 25 May 2016 15:49:30 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PFnTNt079366; Wed, 25 May 2016 15:49:29 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PFnTkp079365; Wed, 25 May 2016 15:49:29 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605251549.u4PFnTkp079365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 15:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300686 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 15:49:30 -0000 Author: truckman Date: Wed May 25 15:49:29 2016 New Revision: 300686 URL: https://svnweb.freebsd.org/changeset/base/300686 Log: Fix a couple of Coverity Unintended sign extension sign extension defects. When shifting an unsigned byte into the upper 8 bits of an int and the resulting value is greater than 0x7FFFFFF, the result will be sign extended when converting to a 64 bit unsigned long. Fix by casting to (uint64_t) before the shift. Reported by: Coverity CID: 1356044, 1356045 Reviewed by: ken Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Wed May 25 15:43:01 2016 (r300685) +++ head/sbin/camcontrol/camcontrol.c Wed May 25 15:49:29 2016 (r300686) @@ -5188,7 +5188,7 @@ get_ata_status(struct cam_device *dev, u desc->count_7_0; *lba = ((uint64_t)desc->lba_47_40 << 40) | ((uint64_t)desc->lba_39_32 << 32) | - (desc->lba_31_24 << 24) | + ((uint64_t)desc->lba_31_24 << 24) | (desc->lba_23_16 << 16) | (desc->lba_15_8 << 8) | desc->lba_7_0; @@ -5249,7 +5249,7 @@ get_ata_status(struct cam_device *dev, u (res->lba_low); if (res->flags & CAM_ATAIO_48BIT) { *count |= (res->sector_count_exp << 8); - *lba |= (res->lba_low_exp << 24) | + *lba |= ((uint64_t)res->lba_low_exp << 24) | ((uint64_t)res->lba_mid_exp << 32) | ((uint64_t)res->lba_high_exp << 40); } else { From owner-svn-src-head@freebsd.org Wed May 25 15:51:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F35CB49365; Wed, 25 May 2016 15:51:49 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3206A17DC; Wed, 25 May 2016 15:51:49 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4PFpewg006305; Wed, 25 May 2016 08:51:44 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605251551.u4PFpewg006305@gw.catspoiler.org> Date: Wed, 25 May 2016 08:51:40 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r300685 - head/sbin/camcontrol To: src-committers@freebsd.org cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605251543.u4PFh146077085@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 15:51:49 -0000 On 25 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Wed May 25 15:43:01 2016 > New Revision: 300685 > URL: https://svnweb.freebsd.org/changeset/base/300685 > > Log: > Fix a couple of new instances of a false positive Coverity buffer > overflow defect. Use the new CCB_CLEAR_ALL_EXCEPT_HDR() macro > instead of the calling bzero() on the pointer to the header used > as an array and indexed by 1. > > Don't leak a buffer after executing "goto restart_report" by > overwriting its pointer with the results of another calloc(). > Be sure to clear the buffer before reusing it. (CID 1356042) > > Reported by: Coverity > CID: 1356022, 1356034, 1356023, 1356035, 1356042 > Reviewed by: ken Differential Revision: https://reviews.freebsd.org/D6558 From owner-svn-src-head@freebsd.org Wed May 25 15:52:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDDA4B4943A; Wed, 25 May 2016 15:52:39 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B793C1A2B; Wed, 25 May 2016 15:52:39 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4PFqV5X006311; Wed, 25 May 2016 08:52:35 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605251552.u4PFqV5X006311@gw.catspoiler.org> Date: Wed, 25 May 2016 08:52:31 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r300686 - head/sbin/camcontrol To: src-committers@freebsd.org cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605251549.u4PFnTkp079365@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 15:52:40 -0000 On 25 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Wed May 25 15:49:29 2016 > New Revision: 300686 > URL: https://svnweb.freebsd.org/changeset/base/300686 > > Log: > Fix a couple of Coverity Unintended sign extension sign extension > defects. When shifting an unsigned byte into the upper 8 bits of > an int and the resulting value is greater than 0x7FFFFFF, the result > will be sign extended when converting to a 64 bit unsigned long. > Fix by casting to (uint64_t) before the shift. > > Reported by: Coverity > CID: 1356044, 1356045 > Reviewed by: ken Differential Revision: https://reviews.freebsd.org/D6557 From owner-svn-src-head@freebsd.org Wed May 25 15:54:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D5DDB494C3; Wed, 25 May 2016 15:54:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FFD71BD9; Wed, 25 May 2016 15:54:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PFsLhQ082157; Wed, 25 May 2016 15:54:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PFsL4t082156; Wed, 25 May 2016 15:54:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605251554.u4PFsL4t082156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 25 May 2016 15:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300687 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 15:54:22 -0000 Author: tuexen Date: Wed May 25 15:54:21 2016 New Revision: 300687 URL: https://svnweb.freebsd.org/changeset/base/300687 Log: Send an ICMP packet indicating destination unreachable/protocol unreachable if we don't handle the packet in the kernel and not in userspace. MFC after: 1 week Modified: head/sys/netinet/raw_ip.c Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Wed May 25 15:49:29 2016 (r300686) +++ head/sys/netinet/raw_ip.c Wed May 25 15:54:21 2016 (r300687) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef IPSEC #include @@ -416,8 +417,10 @@ rip_input(struct mbuf **mp, int *offp, i if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) { IPSTAT_INC(ips_noproto); IPSTAT_DEC(ips_delivered); + icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PROTOCOL, 0, 0); + } else { + m_freem(m); } - m_freem(m); } return (IPPROTO_DONE); } From owner-svn-src-head@freebsd.org Wed May 25 16:38:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4817CB4A2D9; Wed, 25 May 2016 16:38:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18A311DF5; Wed, 25 May 2016 16:38:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PGcAwR095483; Wed, 25 May 2016 16:38:10 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PGcAgw095482; Wed, 25 May 2016 16:38:10 GMT (envelope-from br@FreeBSD.org) Message-Id: <201605251638.u4PGcAgw095482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 25 May 2016 16:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300689 - head/lib/libc/riscv/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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 16:38:11 -0000 Author: br Date: Wed May 25 16:38:10 2016 New Revision: 300689 URL: https://svnweb.freebsd.org/changeset/base/300689 Log: Do not generate code for sbrk syscall -- sbrk support was removed. Pointed out by: andrew Modified: head/lib/libc/riscv/sys/Makefile.inc Modified: head/lib/libc/riscv/sys/Makefile.inc ============================================================================== --- head/lib/libc/riscv/sys/Makefile.inc Wed May 25 16:04:50 2016 (r300688) +++ head/lib/libc/riscv/sys/Makefile.inc Wed May 25 16:38:10 2016 (r300689) @@ -15,6 +15,7 @@ NOASM= break.o \ exit.o \ getlogin.o \ openbsd_poll.o \ + sbrk.o \ sstk.o \ vfork.o \ yield.o From owner-svn-src-head@freebsd.org Wed May 25 18:10:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A38FB495B3; Wed, 25 May 2016 18:10:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 477501F97; Wed, 25 May 2016 18:10:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PIAibn023681; Wed, 25 May 2016 18:10:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PIAiFp023680; Wed, 25 May 2016 18:10:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605251810.u4PIAiFp023680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 25 May 2016 18:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300691 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 18:10:45 -0000 Author: kib Date: Wed May 25 18:10:44 2016 New Revision: 300691 URL: https://svnweb.freebsd.org/changeset/base/300691 Log: Fix issues found by Coverity in the rtld-elf.c:gethints(). Check that the dirlist path string specification does not cause overflow and is fully contained in the hints file. Check that the dirlist string is nul-terminated. Make 'hdr' static variable, so that hdr.dirlistlen is available when hints cached value is used on next function calls. Reset hdr.dirlistlen to zero if error was detected, so that allocations use reasonable size. Use 'hints', and not 'p' in the body, since p is only initialized on the first call. Reported and reviewed by: truckman (previous version) Sponsored by: The FreeBSD Foundation CIDs: 1006503, 1006504, 1006676, 1008488, 1007263 MFC after: 2 weeks Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed May 25 17:10:10 2016 (r300690) +++ head/libexec/rtld-elf/rtld.c Wed May 25 18:10:44 2016 (r300691) @@ -1667,14 +1667,16 @@ static const char * gethints(bool nostdlib) { static char *hints, *filtered_path; - struct elfhints_hdr hdr; + static struct elfhints_hdr hdr; struct fill_search_info_args sargs, hargs; struct dl_serinfo smeta, hmeta, *SLPinfo, *hintinfo; struct dl_serpath *SLPpath, *hintpath; char *p; + struct stat hint_stat; unsigned int SLPndx, hintndx, fndx, fcount; int fd; size_t flen; + uint32_t dl; bool skip; /* First call, read the hints file */ @@ -1684,19 +1686,38 @@ gethints(bool nostdlib) if ((fd = open(ld_elf_hints_path, O_RDONLY | O_CLOEXEC)) == -1) return (NULL); + + /* + * Check of hdr.dirlistlen value against type limit + * intends to pacify static analyzers. Further + * paranoia leads to checks that dirlist is fully + * contained in the file range. + */ if (read(fd, &hdr, sizeof hdr) != sizeof hdr || hdr.magic != ELFHINTS_MAGIC || - hdr.version != 1) { + hdr.version != 1 || hdr.dirlistlen > UINT_MAX / 2 || + fstat(fd, &hint_stat) == -1) { +cleanup1: close(fd); + hdr.dirlistlen = 0; return (NULL); } + dl = hdr.strtab; + if (dl + hdr.dirlist < dl) + goto cleanup1; + dl += hdr.dirlist; + if (dl + hdr.dirlistlen < dl) + goto cleanup1; + dl += hdr.dirlistlen; + if (dl > hint_stat.st_size) + goto cleanup1; p = xmalloc(hdr.dirlistlen + 1); + if (lseek(fd, hdr.strtab + hdr.dirlist, SEEK_SET) == -1 || read(fd, p, hdr.dirlistlen + 1) != - (ssize_t)hdr.dirlistlen + 1) { + (ssize_t)hdr.dirlistlen + 1 || p[hdr.dirlistlen] != '\0') { free(p); - close(fd); - return (NULL); + goto cleanup1; } hints = p; close(fd); @@ -1729,7 +1750,7 @@ gethints(bool nostdlib) hargs.serinfo = &hmeta; path_enumerate(ld_standard_library_path, fill_search_info, &sargs); - path_enumerate(p, fill_search_info, &hargs); + path_enumerate(hints, fill_search_info, &hargs); SLPinfo = xmalloc(smeta.dls_size); hintinfo = xmalloc(hmeta.dls_size); @@ -1748,7 +1769,7 @@ gethints(bool nostdlib) hargs.strspace = (char *)&hintinfo->dls_serpath[hmeta.dls_cnt]; path_enumerate(ld_standard_library_path, fill_search_info, &sargs); - path_enumerate(p, fill_search_info, &hargs); + path_enumerate(hints, fill_search_info, &hargs); /* * Now calculate the difference between two sets, by excluding From owner-svn-src-head@freebsd.org Wed May 25 18:38:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87EEBB49F03; Wed, 25 May 2016 18:38:31 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DCFC10FB; Wed, 25 May 2016 18:38:31 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PIcUKt032522; Wed, 25 May 2016 18:38:30 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PIcUhc032521; Wed, 25 May 2016 18:38:30 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605251838.u4PIcUhc032521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 May 2016 18:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300692 - head/bin/ed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 18:38:31 -0000 Author: truckman Date: Wed May 25 18:38:30 2016 New Revision: 300692 URL: https://svnweb.freebsd.org/changeset/base/300692 Log: Close the input FILE * in read_file() and the output FILE * in write_file() if read_stream() or write_stream() fails to avoid leaking the FILE. Reported by: Coverity CID: 977702 Reviewed by: pfg MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6554 Modified: head/bin/ed/io.c Modified: head/bin/ed/io.c ============================================================================== --- head/bin/ed/io.c Wed May 25 18:10:44 2016 (r300691) +++ head/bin/ed/io.c Wed May 25 18:38:30 2016 (r300692) @@ -36,20 +36,24 @@ read_file(char *fn, long n) { FILE *fp; long size; - + int cs; fp = (*fn == '!') ? popen(fn + 1, "r") : fopen(strip_escapes(fn), "r"); if (fp == NULL) { fprintf(stderr, "%s: %s\n", fn, strerror(errno)); errmsg = "cannot open input file"; return ERR; - } else if ((size = read_stream(fp, n)) < 0) - return ERR; - else if (((*fn == '!') ? pclose(fp) : fclose(fp)) < 0) { + } + if ((size = read_stream(fp, n)) < 0) { + fprintf(stderr, "%s: %s\n", fn, strerror(errno)); + errmsg = "error reading input file"; + } + if ((cs = (*fn == '!') ? pclose(fp) : fclose(fp)) < 0) { fprintf(stderr, "%s: %s\n", fn, strerror(errno)); errmsg = "cannot close input file"; - return ERR; } + if (size < 0 || cs < 0) + return ERR; if (!scripted) fprintf(stdout, "%lu\n", size); return current_addr - n; @@ -143,19 +147,24 @@ write_file(char *fn, const char *mode, l { FILE *fp; long size; + int cs; fp = (*fn == '!') ? popen(fn+1, "w") : fopen(strip_escapes(fn), mode); if (fp == NULL) { fprintf(stderr, "%s: %s\n", fn, strerror(errno)); errmsg = "cannot open output file"; return ERR; - } else if ((size = write_stream(fp, n, m)) < 0) - return ERR; - else if (((*fn == '!') ? pclose(fp) : fclose(fp)) < 0) { + } + if ((size = write_stream(fp, n, m)) < 0) { + fprintf(stderr, "%s: %s\n", fn, strerror(errno)); + errmsg = "error writing output file"; + } + if ((cs = (*fn == '!') ? pclose(fp) : fclose(fp)) < 0) { fprintf(stderr, "%s: %s\n", fn, strerror(errno)); errmsg = "cannot close output file"; - return ERR; } + if (size < 0 || cs < 0) + return ERR; if (!scripted) fprintf(stdout, "%lu\n", size); return n ? m - n + 1 : 0; From owner-svn-src-head@freebsd.org Wed May 25 19:44:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92851B490E5; Wed, 25 May 2016 19:44:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C1A11DFE; Wed, 25 May 2016 19:44:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PJiUGC054416; Wed, 25 May 2016 19:44:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PJiQGq054373; Wed, 25 May 2016 19:44:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605251944.u4PJiQGq054373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 25 May 2016 19:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300694 - in head/sys: arm/arm arm/include arm/mv 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 19:44:31 -0000 Author: ian Date: Wed May 25 19:44:26 2016 New Revision: 300694 URL: https://svnweb.freebsd.org/changeset/base/300694 Log: Include machine/acle-compat.h in cdefs.h on arm if the compiler doesn't have ACLE support built in. The ACLE (ARM C Language Extensions) defines a set of standardized symbols which indicate the architecture version and features available. ACLE support is built in to modern compilers (both clang and gcc), but absent from gcc prior to 4.4. ARM (the company) provides the acle-compat.h header file to define the right symbols for older versions of gcc. Basically, acle-compat.h does for arm about the same thing cdefs.h does for freebsd: defines standardized macros that work no matter which compiler you use. If ARM hadn't provided this file we would have ended up with a big #ifdef __arm__ section in cdefs.h with our own compatibility shims. Remove #include from the zillion other places (an ever-growing list) that it appears. Since style(9) requires sys/types.h or sys/param.h early in the include list, and both of those lead to including cdefs.h, only a couple special cases still need to include acle-compat.h directly. Loves it: imp Modified: head/sys/arm/arm/bcopyinout.S head/sys/arm/arm/bcopyinout_xscale.S head/sys/arm/arm/bus_space_base.c head/sys/arm/arm/copystr.S head/sys/arm/arm/cpu_asm-v6.S head/sys/arm/arm/cpufunc.c head/sys/arm/arm/disassem.c head/sys/arm/arm/elf_machdep.c head/sys/arm/arm/exception.S head/sys/arm/arm/fiq.c head/sys/arm/arm/fusu.S head/sys/arm/arm/genassym.c head/sys/arm/arm/locore-v6.S head/sys/arm/arm/machdep.c head/sys/arm/arm/mem.c head/sys/arm/arm/mp_machdep.c head/sys/arm/arm/stdatomic.c head/sys/arm/arm/swtch-v4.S head/sys/arm/arm/swtch-v6.S head/sys/arm/arm/sys_machdep.c head/sys/arm/arm/trap-v6.c head/sys/arm/arm/vm_machdep.c head/sys/arm/include/armreg.h head/sys/arm/include/asm.h head/sys/arm/include/atomic.h head/sys/arm/include/bus.h head/sys/arm/include/cpu-v4.h head/sys/arm/include/cpu-v6.h head/sys/arm/include/cpu.h head/sys/arm/include/db_machdep.h head/sys/arm/include/machdep.h head/sys/arm/include/param.h head/sys/arm/include/pcpu.h head/sys/arm/include/pmap.h head/sys/arm/include/sf_buf.h head/sys/arm/include/sysarch.h head/sys/arm/include/sysreg.h head/sys/arm/include/vm.h head/sys/arm/mv/mv_machdep.c head/sys/kern/imgact_elf.c head/sys/kern/subr_devmap.c head/sys/sys/cdefs.h Modified: head/sys/arm/arm/bcopyinout.S ============================================================================== --- head/sys/arm/arm/bcopyinout.S Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/bcopyinout.S Wed May 25 19:44:26 2016 (r300694) @@ -38,7 +38,6 @@ #include "assym.s" -#include #include #include Modified: head/sys/arm/arm/bcopyinout_xscale.S ============================================================================== --- head/sys/arm/arm/bcopyinout_xscale.S Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/bcopyinout_xscale.S Wed May 25 19:44:26 2016 (r300694) @@ -38,8 +38,6 @@ #include __FBSDID("$FreeBSD$"); -#include - .syntax unified .text .align 2 Modified: head/sys/arm/arm/bus_space_base.c ============================================================================== --- head/sys/arm/arm/bus_space_base.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/bus_space_base.c Wed May 25 19:44:26 2016 (r300694) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "opt_platform.h" Modified: head/sys/arm/arm/copystr.S ============================================================================== --- head/sys/arm/arm/copystr.S Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/copystr.S Wed May 25 19:44:26 2016 (r300694) @@ -39,7 +39,6 @@ */ #include "assym.s" -#include #include #include __FBSDID("$FreeBSD$"); Modified: head/sys/arm/arm/cpu_asm-v6.S ============================================================================== --- head/sys/arm/arm/cpu_asm-v6.S Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/cpu_asm-v6.S Wed May 25 19:44:26 2016 (r300694) @@ -28,7 +28,6 @@ */ #include "assym.s" -#include #include #include #include Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/cpufunc.c Wed May 25 19:44:26 2016 (r300694) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/arm/disassem.c ============================================================================== --- head/sys/arm/arm/disassem.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/disassem.c Wed May 25 19:44:26 2016 (r300694) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include /* Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/elf_machdep.c Wed May 25 19:44:26 2016 (r300694) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/exception.S Wed May 25 19:44:26 2016 (r300694) @@ -48,7 +48,6 @@ #include "assym.s" -#include #include #include #include Modified: head/sys/arm/arm/fiq.c ============================================================================== --- head/sys/arm/arm/fiq.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/fiq.c Wed May 25 19:44:26 2016 (r300694) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/arm/fusu.S ============================================================================== --- head/sys/arm/arm/fusu.S Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/fusu.S Wed May 25 19:44:26 2016 (r300694) @@ -33,7 +33,6 @@ * */ -#include #include #include #include "assym.s" Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/genassym.c Wed May 25 19:44:26 2016 (r300694) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/arm/locore-v6.S ============================================================================== --- head/sys/arm/arm/locore-v6.S Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/locore-v6.S Wed May 25 19:44:26 2016 (r300694) @@ -30,7 +30,6 @@ #include "assym.s" #include -#include #include #include #include Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/machdep.c Wed May 25 19:44:26 2016 (r300694) @@ -94,7 +94,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/arm/mem.c ============================================================================== --- head/sys/arm/arm/mem.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/mem.c Wed May 25 19:44:26 2016 (r300694) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/mp_machdep.c Wed May 25 19:44:26 2016 (r300694) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/arm/stdatomic.c ============================================================================== --- head/sys/arm/arm/stdatomic.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/stdatomic.c Wed May 25 19:44:26 2016 (r300694) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/arm/swtch-v4.S ============================================================================== --- head/sys/arm/arm/swtch-v4.S Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/swtch-v4.S Wed May 25 19:44:26 2016 (r300694) @@ -81,7 +81,6 @@ #include "assym.s" #include "opt_sched.h" -#include #include #include #include Modified: head/sys/arm/arm/swtch-v6.S ============================================================================== --- head/sys/arm/arm/swtch-v6.S Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/swtch-v6.S Wed May 25 19:44:26 2016 (r300694) @@ -81,7 +81,6 @@ #include "assym.s" #include "opt_sched.h" -#include #include #include #include Modified: head/sys/arm/arm/sys_machdep.c ============================================================================== --- head/sys/arm/arm/sys_machdep.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/sys_machdep.c Wed May 25 19:44:26 2016 (r300694) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/trap-v6.c Wed May 25 19:44:26 2016 (r300694) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/arm/vm_machdep.c Wed May 25 19:44:26 2016 (r300694) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -76,7 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/armreg.h Wed May 25 19:44:26 2016 (r300694) @@ -41,8 +41,6 @@ #ifndef MACHINE_ARMREG_H #define MACHINE_ARMREG_H -#include - #define INSN_SIZE 4 #define INSN_COND_MASK 0xf0000000 /* Condition mask */ #define PSR_MODE 0x0000001f /* mode mask */ Modified: head/sys/arm/include/asm.h ============================================================================== --- head/sys/arm/include/asm.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/asm.h Wed May 25 19:44:26 2016 (r300694) @@ -39,7 +39,6 @@ #ifndef _MACHINE_ASM_H_ #define _MACHINE_ASM_H_ #include -#include #include #define _C_LABEL(x) x Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/atomic.h Wed May 25 19:44:26 2016 (r300694) @@ -42,8 +42,6 @@ #include #include -#include - #ifndef _KERNEL #include #else Modified: head/sys/arm/include/bus.h ============================================================================== --- head/sys/arm/include/bus.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/bus.h Wed May 25 19:44:26 2016 (r300694) @@ -67,7 +67,6 @@ #define _MACHINE_BUS_H_ #include -#include /* * int bus_space_map (bus_space_tag_t t, bus_addr_t addr, Modified: head/sys/arm/include/cpu-v4.h ============================================================================== --- head/sys/arm/include/cpu-v4.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/cpu-v4.h Wed May 25 19:44:26 2016 (r300694) @@ -34,7 +34,6 @@ #error Only include this file in the kernel #endif -#include #include #include #include Modified: head/sys/arm/include/cpu-v6.h ============================================================================== --- head/sys/arm/include/cpu-v6.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/cpu-v6.h Wed May 25 19:44:26 2016 (r300694) @@ -34,7 +34,6 @@ #error Only include this file in the kernel #endif -#include #include #include #include Modified: head/sys/arm/include/cpu.h ============================================================================== --- head/sys/arm/include/cpu.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/cpu.h Wed May 25 19:44:26 2016 (r300694) @@ -4,7 +4,6 @@ #ifndef MACHINE_CPU_H #define MACHINE_CPU_H -#include #include #include Modified: head/sys/arm/include/db_machdep.h ============================================================================== --- head/sys/arm/include/db_machdep.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/db_machdep.h Wed May 25 19:44:26 2016 (r300694) @@ -33,7 +33,6 @@ #include #include #include -#include #define T_BREAKPOINT (1) #define T_WATCHPOINT (2) Modified: head/sys/arm/include/machdep.h ============================================================================== --- head/sys/arm/include/machdep.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/machdep.h Wed May 25 19:44:26 2016 (r300694) @@ -4,8 +4,6 @@ #ifndef _MACHDEP_BOOT_MACHDEP_H_ #define _MACHDEP_BOOT_MACHDEP_H_ -#include - /* Structs that need to be initialised by initarm */ #if __ARM_ARCH >= 6 extern vm_offset_t irqstack; Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/param.h Wed May 25 19:44:26 2016 (r300694) @@ -46,7 +46,6 @@ */ #include -#include #define STACKALIGNBYTES (8 - 1) #define STACKALIGN(p) ((u_int)(p) & ~STACKALIGNBYTES) Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/pcpu.h Wed May 25 19:44:26 2016 (r300694) @@ -32,7 +32,6 @@ #ifdef _KERNEL -#include #include #define ALT_STACK_SIZE 128 Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/pmap.h Wed May 25 19:44:26 2016 (r300694) @@ -30,8 +30,6 @@ #ifndef _MACHINE_PMAP_H_ #define _MACHINE_PMAP_H_ -#include - #if __ARM_ARCH >= 6 #include #else Modified: head/sys/arm/include/sf_buf.h ============================================================================== --- head/sys/arm/include/sf_buf.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/sf_buf.h Wed May 25 19:44:26 2016 (r300694) @@ -29,8 +29,6 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ -#include - static inline void sf_buf_map(struct sf_buf *sf, int flags) { Modified: head/sys/arm/include/sysarch.h ============================================================================== --- head/sys/arm/include/sysarch.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/sysarch.h Wed May 25 19:44:26 2016 (r300694) @@ -37,7 +37,6 @@ #ifndef _ARM_SYSARCH_H_ #define _ARM_SYSARCH_H_ -#include #include /* Modified: head/sys/arm/include/sysreg.h ============================================================================== --- head/sys/arm/include/sysreg.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/sysreg.h Wed May 25 19:44:26 2016 (r300694) @@ -39,8 +39,6 @@ #ifndef MACHINE_SYSREG_H #define MACHINE_SYSREG_H -#include - /* * CP14 registers */ Modified: head/sys/arm/include/vm.h ============================================================================== --- head/sys/arm/include/vm.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/include/vm.h Wed May 25 19:44:26 2016 (r300694) @@ -29,8 +29,6 @@ #ifndef _MACHINE_VM_H_ #define _MACHINE_VM_H_ -#include - #if __ARM_ARCH >= 6 #define VM_MEMATTR_WB_WA ((vm_memattr_t)0) #define VM_MEMATTR_NOCACHE ((vm_memattr_t)1) Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/arm/mv/mv_machdep.c Wed May 25 19:44:26 2016 (r300694) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/kern/imgact_elf.c Wed May 25 19:44:26 2016 (r300694) @@ -80,9 +80,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef __arm__ -#include -#endif #define ELF_NOTE_ROUNDSIZE 4 #define OLD_EI_BRAND 8 Modified: head/sys/kern/subr_devmap.c ============================================================================== --- head/sys/kern/subr_devmap.c Wed May 25 19:41:48 2016 (r300693) +++ head/sys/kern/subr_devmap.c Wed May 25 19:44:26 2016 (r300694) @@ -37,9 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef __arm__ -#include -#endif #include static const struct devmap_entry *devmap_table; Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Wed May 25 19:41:48 2016 (r300693) +++ head/sys/sys/cdefs.h Wed May 25 19:44:26 2016 (r300694) @@ -781,6 +781,14 @@ #endif /* + * Old versions of GCC use non-standard ARM arch symbols; acle-compat.h + * translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + */ +#if defined(__arm__) && !defined(__ARM_ARCH) +#include +#endif + +/* * Type Safety Checking * * Clang provides additional attributes to enable checking type safety From owner-svn-src-head@freebsd.org Wed May 25 20:56:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D234B4A838; Wed, 25 May 2016 20:56:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 202581B83; Wed, 25 May 2016 20:56:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PKuUl2085347; Wed, 25 May 2016 20:56:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PKuUX3085345; Wed, 25 May 2016 20:56:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605252056.u4PKuUX3085345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 25 May 2016 20:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300698 - in head: contrib/elftoolchain/elfcopy lib/libelftc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 20:56:31 -0000 Author: emaste Date: Wed May 25 20:56:30 2016 New Revision: 300698 URL: https://svnweb.freebsd.org/changeset/base/300698 Log: Update to ELF Tool Chain r3477 This fixes a EFI/PE header issue that prevented elfcopy-produced .efi files from working with Secure Boot: Make sure section raw size is always padded to multiple of FileAlignment from the optional header, as requested by the PE specification. This change should reduce the diff between PE image generated by Binutils objcopy and elftoolchain elfcopy. Submitted by: kaiw Reported by: ambrisko Modified: head/contrib/elftoolchain/elfcopy/pe.c head/lib/libelftc/elftc_version.c Directory Properties: head/contrib/elftoolchain/ (props changed) Modified: head/contrib/elftoolchain/elfcopy/pe.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/pe.c Wed May 25 20:50:05 2016 (r300697) +++ head/contrib/elftoolchain/elfcopy/pe.c Wed May 25 20:56:30 2016 (r300698) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: pe.c 3312 2016-01-10 09:23:51Z kaiwang27 $"); +ELFTC_VCSID("$Id: pe.c 3477 2016-05-25 20:00:42Z kaiwang27 $"); /* Convert ELF object to Portable Executable (PE). */ void @@ -54,7 +54,7 @@ create_pe(struct elfcopy *ecp, int ifd, PE_Buffer *pb; const char *name; size_t indx; - int elferr, i; + int elferr; if (ecp->otf == ETF_EFI || ecp->oem == EM_X86_64) po = PE_O_PE32P; @@ -175,7 +175,7 @@ create_pe(struct elfcopy *ecp, int ifd, psh.sh_addr = sh.sh_addr; psh.sh_virtsize = sh.sh_size; if (sh.sh_type != SHT_NOBITS) - psh.sh_rawsize = sh.sh_size; + psh.sh_rawsize = roundup(sh.sh_size, poh.oh_filealign); else psh.sh_char |= IMAGE_SCN_CNT_UNINITIALIZED_DATA; @@ -190,12 +190,6 @@ create_pe(struct elfcopy *ecp, int ifd, IMAGE_SCN_CNT_CODE; if ((sh.sh_flags & SHF_ALLOC) && (psh.sh_char & 0xF0) == 0) psh.sh_char |= IMAGE_SCN_CNT_INITIALIZED_DATA; - for (i = 0xE; i > 0; i--) { - if (sh.sh_addralign & (1U << (i - 1))) { - psh.sh_char |= i << 20; - break; - } - } /* Mark relocation section "discardable". */ if (strcmp(name, ".reloc") == 0) @@ -213,8 +207,12 @@ create_pe(struct elfcopy *ecp, int ifd, } pb->pb_align = 1; pb->pb_off = 0; - pb->pb_size = sh.sh_size; - pb->pb_buf = d->d_buf; + pb->pb_size = roundup(sh.sh_size, poh.oh_filealign); + if ((pb->pb_buf = calloc(1, pb->pb_size)) == NULL) { + warn("calloc failed"); + continue; + } + memcpy(pb->pb_buf, d->d_buf, sh.sh_size); } elferr = elf_errno(); if (elferr != 0) Modified: head/lib/libelftc/elftc_version.c ============================================================================== --- head/lib/libelftc/elftc_version.c Wed May 25 20:50:05 2016 (r300697) +++ head/lib/libelftc/elftc_version.c Wed May 25 20:56:30 2016 (r300698) @@ -6,5 +6,5 @@ const char * elftc_version(void) { - return "elftoolchain r3475M"; + return "elftoolchain r3477M"; } From owner-svn-src-head@freebsd.org Wed May 25 22:16:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF1CAB4A832; Wed, 25 May 2016 22:16:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 636A71706; Wed, 25 May 2016 22:16:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PMGBnK014919; Wed, 25 May 2016 22:16:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PMGBrb014918; Wed, 25 May 2016 22:16:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605252216.u4PMGBrb014918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 25 May 2016 22:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300699 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 22:16:12 -0000 Author: tuexen Date: Wed May 25 22:16:11 2016 New Revision: 300699 URL: https://svnweb.freebsd.org/changeset/base/300699 Log: When sending in ICMP response to an SCTP packet, * include the SCTP common header, if possible * include the first 8 bytes of the INIT chunk, if possible This provides the necesary information for the receiver of the ICMP packet to process it. MFC after: 1 week Modified: head/sys/netinet/ip_icmp.c Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Wed May 25 20:56:30 2016 (r300698) +++ head/sys/netinet/ip_icmp.c Wed May 25 22:16:11 2016 (r300699) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -249,6 +250,34 @@ icmp_error(struct mbuf *n, int type, int goto freeit; icmpelen = max(tcphlen, min(V_icmp_quotelen, ntohs(oip->ip_len) - oiphlen)); + } else if (oip->ip_p == IPPROTO_SCTP) { + struct sctphdr *sh; + struct sctp_chunkhdr *ch; + + if (ntohs(oip->ip_len) < oiphlen + sizeof(struct sctphdr)) + goto stdreply; + if (oiphlen + sizeof(struct sctphdr) > n->m_len && + n->m_next == NULL) + goto stdreply; + if (n->m_len < oiphlen + sizeof(struct sctphdr) && + (n = m_pullup(n, oiphlen + sizeof(struct sctphdr))) == NULL) + goto freeit; + icmpelen = max(sizeof(struct sctphdr), + min(V_icmp_quotelen, ntohs(oip->ip_len) - oiphlen)); + sh = (struct sctphdr *)((caddr_t)oip + oiphlen); + if (ntohl(sh->v_tag) == 0 && + ntohs(oip->ip_len) >= oiphlen + sizeof(struct sctphdr) + 8 && + (n->m_len >= oiphlen + sizeof(struct sctphdr) + 8 || + n->m_next != NULL)) { + if (n->m_len < oiphlen + sizeof(struct sctphdr) + 8 && + (n = m_pullup(n, oiphlen + sizeof(struct sctphdr) + 8)) == NULL) + goto freeit; + ch = (struct sctp_chunkhdr *)(sh + 1); + if (ch->chunk_type == SCTP_INITIATION) { + icmpelen = max(sizeof(struct sctphdr) + 8, + min(V_icmp_quotelen, ntohs(oip->ip_len) - oiphlen)); + } + } } else stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs(oip->ip_len) - oiphlen)); From owner-svn-src-head@freebsd.org Wed May 25 23:06:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA951B4A0C1; Wed, 25 May 2016 23:06:53 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69A011C3A; Wed, 25 May 2016 23:06:53 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4PN6qsY033021; Wed, 25 May 2016 23:06:52 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4PN6qAE033020; Wed, 25 May 2016 23:06:52 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605252306.u4PN6qAE033020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 25 May 2016 23:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300700 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2016 23:06:53 -0000 Author: jkim Date: Wed May 25 23:06:52 2016 New Revision: 300700 URL: https://svnweb.freebsd.org/changeset/base/300700 Log: Both Clang and GCC cannot generate efficient reserve_pv_entries(). http://docs.freebsd.org/cgi/mid.cgi?552BFEB2.8040407 Re-implement it entirely in inline assembly not to let compilers do silly spilling to memory. For non-POPCNT case, use newly added bit_count(3). Reported by: alc Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D6541 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed May 25 22:16:11 2016 (r300699) +++ head/sys/amd64/amd64/pmap.c Wed May 25 23:06:52 2016 (r300700) @@ -104,6 +104,7 @@ __FBSDID("$FreeBSD$"); #include "opt_vm.h" #include +#include #include #include #include @@ -585,7 +586,7 @@ static caddr_t crashdumpmap; static void free_pv_chunk(struct pv_chunk *pc); static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t pmap, struct rwlock **lockp); -static int popcnt_pc_map_elem_pq(uint64_t elem); +static int popcnt_pc_map_pq(uint64_t *map); static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp); static void reserve_pv_entries(pmap_t pmap, int needed, struct rwlock **lockp); @@ -3126,7 +3127,7 @@ retry: } /* - * Returns the number of one bits within the given PV chunk map element. + * Returns the number of one bits within the given PV chunk map. * * The erratas for Intel processors state that "POPCNT Instruction May * Take Longer to Execute Than Expected". It is believed that the @@ -3142,12 +3143,15 @@ retry: * 6th Gen Core: SKL029 */ static int -popcnt_pc_map_elem_pq(uint64_t elem) +popcnt_pc_map_pq(uint64_t *map) { - u_long result; + u_long result, tmp; - __asm __volatile("xorl %k0,%k0;popcntq %1,%0" - : "=&r" (result) : "rm" (elem)); + __asm __volatile("xorl %k0,%k0;popcntq %2,%0;" + "xorl %k1,%k1;popcntq %3,%1;addl %k1,%k0;" + "xorl %k1,%k1;popcntq %4,%1;addl %k1,%k0" + : "=&r" (result), "=&r" (tmp) + : "m" (map[0]), "m" (map[1]), "m" (map[2])); return (result); } @@ -3179,17 +3183,12 @@ retry: avail = 0; TAILQ_FOREACH(pc, &pmap->pm_pvchunk, pc_list) { #ifndef __POPCNT__ - if ((cpu_feature2 & CPUID2_POPCNT) == 0) { - free = bitcount64(pc->pc_map[0]); - free += bitcount64(pc->pc_map[1]); - free += bitcount64(pc->pc_map[2]); - } else + if ((cpu_feature2 & CPUID2_POPCNT) == 0) + bit_count((bitstr_t *)pc->pc_map, 0, + sizeof(pc->pc_map) * NBBY, &free); + else #endif - { - free = popcnt_pc_map_elem_pq(pc->pc_map[0]); - free += popcnt_pc_map_elem_pq(pc->pc_map[1]); - free += popcnt_pc_map_elem_pq(pc->pc_map[2]); - } + free = popcnt_pc_map_pq(pc->pc_map); if (free == 0) break; avail += free; From owner-svn-src-head@freebsd.org Thu May 26 00:03:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CCBCB4AD98; Thu, 26 May 2016 00:03:25 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0882C1301; Thu, 26 May 2016 00:03:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q03OO5054908; Thu, 26 May 2016 00:03:24 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q03NjC054902; Thu, 26 May 2016 00:03:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605260003.u4Q03NjC054902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 May 2016 00:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300701 - in head/sys: arm/arm arm/include sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 00:03:25 -0000 Author: ian Date: Thu May 26 00:03:23 2016 New Revision: 300701 URL: https://svnweb.freebsd.org/changeset/base/300701 Log: Disable alignment faults on armv6, adjust various alignment-related macros to match the new state of affairs. The hardware we support has always been able to do unaligned accesses, we've just never enabled it until now. This brings FreeBSD into line with all the other major OSes, and should help with the growing volume of 3rd-party software that assumes unaligned access will just work on armv6 and armv7. Modified: head/sys/arm/arm/locore-v6.S head/sys/arm/include/_align.h head/sys/arm/include/_types.h head/sys/arm/include/param.h head/sys/sys/param.h Modified: head/sys/arm/arm/locore-v6.S ============================================================================== --- head/sys/arm/arm/locore-v6.S Wed May 25 23:06:52 2016 (r300700) +++ head/sys/arm/arm/locore-v6.S Thu May 26 00:03:23 2016 (r300701) @@ -129,12 +129,12 @@ ASENTRY_NP(_start) */ 1: bic r7, #CPU_CONTROL_DC_ENABLE + bic r7, #CPU_CONTROL_AFLT_ENABLE bic r7, #CPU_CONTROL_MMU_ENABLE bic r7, #CPU_CONTROL_IC_ENABLE bic r7, #CPU_CONTROL_BPRD_ENABLE bic r7, #CPU_CONTROL_SW_ENABLE orr r7, #CPU_CONTROL_UNAL_ENABLE - orr r7, #CPU_CONTROL_AFLT_ENABLE orr r7, #CPU_CONTROL_VECRELOC mcr CP15_SCTLR(r7) DSB @@ -453,12 +453,12 @@ ASENTRY_NP(mpentry) /* Setup core, disable all caches. */ mrc CP15_SCTLR(r0) bic r0, #CPU_CONTROL_MMU_ENABLE + bic r0, #CPU_CONTROL_AFLT_ENABLE bic r0, #CPU_CONTROL_DC_ENABLE bic r0, #CPU_CONTROL_IC_ENABLE bic r0, #CPU_CONTROL_BPRD_ENABLE bic r0, #CPU_CONTROL_SW_ENABLE orr r0, #CPU_CONTROL_UNAL_ENABLE - orr r0, #CPU_CONTROL_AFLT_ENABLE orr r0, #CPU_CONTROL_VECRELOC mcr CP15_SCTLR(r0) DSB Modified: head/sys/arm/include/_align.h ============================================================================== --- head/sys/arm/include/_align.h Wed May 25 23:06:52 2016 (r300700) +++ head/sys/arm/include/_align.h Thu May 26 00:03:23 2016 (r300701) @@ -46,7 +46,11 @@ * is sufficient for any data type, pointer or numeric. The resulting type * is equivelent to arm's uintptr_t (but is purposely spelled "unsigned" here). */ +#if __ARM_ARCH >= 6 +#define _ALIGNBYTES (sizeof(int) - 1) +#else #define _ALIGNBYTES (sizeof(long long) - 1) +#endif #define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #endif /* !_ARM_INCLUDE__ALIGN_H_ */ Modified: head/sys/arm/include/_types.h ============================================================================== --- head/sys/arm/include/_types.h Wed May 25 23:06:52 2016 (r300700) +++ head/sys/arm/include/_types.h Thu May 26 00:03:23 2016 (r300701) @@ -43,6 +43,10 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#if __ARM_ARCH >= 6 +#define __NO_STRICT_ALIGNMENT +#endif + /* * Basic types upon which most other types are built. */ Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Wed May 25 23:06:52 2016 (r300700) +++ head/sys/arm/include/param.h Thu May 26 00:03:23 2016 (r300701) @@ -90,8 +90,16 @@ * is valid to fetch data elements of type t from on this architecture. * This does not reflect the optimal alignment, just the possibility * (within reasonable limits). + * + * armv4 and v5 require alignment to the type's size. armv6 and later require + * that an 8-byte type be aligned to at least a 4-byte boundary; access to + * smaller types can be unaligned. */ +#if __ARM_ARCH >= 6 +#define ALIGNED_POINTER(p, t) (((sizeof(t) != 8) || ((unsigned)(p) & 3) == 0)) +#else #define ALIGNED_POINTER(p, t) ((((unsigned)(p)) & (sizeof(t)-1)) == 0) +#endif /* * CACHE_LINE_SIZE is the compile-time maximum cache line size for an Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed May 25 23:06:52 2016 (r300700) +++ head/sys/sys/param.h Thu May 26 00:03:23 2016 (r300701) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100112 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100113 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu May 26 00:43:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86251B48394; Thu, 26 May 2016 00:43:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6093E12C8; Thu, 26 May 2016 00:43:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q0h8GW069174; Thu, 26 May 2016 00:43:08 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q0h8S5069171; Thu, 26 May 2016 00:43:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605260043.u4Q0h8S5069171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 26 May 2016 00:43:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300702 - head/sys/dev/bhnd/cores/chipc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 00:43:09 -0000 Author: adrian Date: Thu May 26 00:43:08 2016 New Revision: 300702 URL: https://svnweb.freebsd.org/changeset/base/300702 Log: [bhnd] Integrate bhnd_chipc's BUS_ADD_CHILD() with a child resource mapping table. This adds support for automatically configuring bhnd_chipc bus children with associated resources, using an internal 'hints' table based directly on Michael Zhilin's chipc resource mapping work. The bhnd_sprom_chipc driver has been converted to use DEVICE_IDENTIFY() with the new resource table. This should be nearly drop-in compatible with the child device drivers in D6250. Submitted by: Landon Fuller Reviewed by: Michael Zhilin Differential Revision: https://reviews.freebsd.org/D6525 Modified: head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/chipc/chipcreg.h Modified: head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c Thu May 26 00:03:23 2016 (r300701) +++ head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c Thu May 26 00:43:08 2016 (r300702) @@ -46,9 +46,23 @@ __FBSDID("$FreeBSD$"); #include #include -#include "bhnd_chipc_if.h" #include "bhnd_nvram_if.h" +#include "chipc.h" + +static void +chipc_sprom_identify(driver_t *driver, device_t parent) +{ + if (bhnd_chipc_nvram_src(parent) != BHND_NVRAM_SRC_SPROM) + return; + + if (device_find_child(parent, "bhnd_nvram", 0) != NULL) + return; + + if (BUS_ADD_CHILD(parent, 0, "bhnd_nvram", 0) == NULL) + device_printf(parent, "add bhnd_nvram failed\n"); +} + static int chipc_sprom_probe(device_t dev) { @@ -87,6 +101,7 @@ chipc_sprom_attach(device_t dev) static device_method_t chipc_sprom_methods[] = { /* Device interface */ + DEVMETHOD(device_identify, chipc_sprom_identify), DEVMETHOD(device_probe, chipc_sprom_probe), DEVMETHOD(device_attach, chipc_sprom_attach), DEVMETHOD_END Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Thu May 26 00:03:23 2016 (r300701) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Thu May 26 00:43:08 2016 (r300702) @@ -98,6 +98,32 @@ static struct bhnd_device_quirk chipc_qu BHND_DEVICE_QUIRK_END }; + +static const struct chipc_hint { + const char *name; + int unit; + int type; + int rid; + rman_res_t base; /* relative to parent resource */ + rman_res_t size; + u_int port; /* ignored if SYS_RES_IRQ */ + u_int region; +} chipc_hints[] = { + // FIXME: cfg/spi port1.1 mapping on siba(4) SoCs + /* device unit type rid base size port,region */ + { "bhnd_nvram", 0, SYS_RES_MEMORY, 0, CHIPC_SPROM_OTP, CHIPC_SPROM_OTP_SIZE, 0,0 }, + { "uart", 0, SYS_RES_MEMORY, 0, CHIPC_UART0_BASE, CHIPC_UART_SIZE, 0,0 }, + { "uart", 0, SYS_RES_IRQ, 0, 0, RM_MAX_END }, + { "uart", 1, SYS_RES_MEMORY, 0, CHIPC_UART1_BASE, CHIPC_UART_SIZE, 0,0 }, + { "uart", 1, SYS_RES_IRQ, 0, 0, RM_MAX_END }, + { "spi", 0, SYS_RES_MEMORY, 0, 0, RM_MAX_END, 1,1 }, + { "spi", 0, SYS_RES_MEMORY, 1, CHIPC_SFLASH_BASE, CHIPC_SFLASH_SIZE, 0,0 }, + { "cfi", 0, SYS_RES_MEMORY, 0, 0, RM_MAX_END, 1,1}, + { "cfi", 0, SYS_RES_MEMORY, 1, CHIPC_SFLASH_BASE, CHIPC_SFLASH_SIZE, 0,0 }, + { NULL } +}; + + static int chipc_try_activate_resource( struct chipc_softc *sc, device_t child, int type, int rid, struct resource *r, @@ -106,7 +132,6 @@ static int chipc_try_activate_resourc static int chipc_read_caps(struct chipc_softc *sc, struct chipc_caps *caps); -static int chipc_nvram_attach(struct chipc_softc *sc); static bhnd_nvram_src_t chipc_nvram_identify(struct chipc_softc *sc); static bool chipc_should_enable_sprom( struct chipc_softc *sc); @@ -210,12 +235,11 @@ chipc_attach(device_t dev) if (bootverbose) chipc_print_caps(sc->dev, &sc->caps); - /* Identify NVRAM source and add child device. */ + /* Identify NVRAM source */ sc->nvram_src = chipc_nvram_identify(sc); - if ((error = chipc_nvram_attach(sc))) - goto failed; - /* Standard bus probe */ + /* Probe and attach children */ + bus_generic_probe(dev); if ((error = bus_generic_attach(dev))) goto failed; @@ -335,51 +359,6 @@ chipc_read_caps(struct chipc_softc *sc, } /** - * If supported, add an appropriate NVRAM child device. - */ -static int -chipc_nvram_attach(struct chipc_softc *sc) -{ - device_t nvram_dev; - rman_res_t start; - int error; - - switch (sc->nvram_src) { - case BHND_NVRAM_SRC_OTP: - // TODO OTP support - device_printf(sc->dev, "OTP nvram source unsupported\n"); - return (0); - - case BHND_NVRAM_SRC_SPROM: - /* Add OTP/SPROM device */ - nvram_dev = BUS_ADD_CHILD(sc->dev, 0, "bhnd_nvram", -1); - if (nvram_dev == NULL) { - device_printf(sc->dev, "failed to add NVRAM device\n"); - return (ENXIO); - } - - start = rman_get_start(sc->core->res) + CHIPC_SPROM_OTP; - error = bus_set_resource(nvram_dev, SYS_RES_MEMORY, 0, start, - CHIPC_SPROM_OTP_SIZE); - return (error); - - case BHND_NVRAM_SRC_FLASH: - // TODO flash support - device_printf(sc->dev, "flash nvram source unsupported\n"); - return (0); - - case BHND_NVRAM_SRC_UNKNOWN: - /* Handled externally */ - return (0); - - default: - device_printf(sc->dev, "invalid nvram source: %u\n", - sc->nvram_src); - return (ENXIO); - } -} - -/** * Determine the NVRAM data source for this device. * * @param sc chipc driver state. @@ -500,7 +479,9 @@ static device_t chipc_add_child(device_t dev, u_int order, const char *name, int unit) { struct chipc_devinfo *dinfo; + const struct chipc_hint *hint; device_t child; + int error; child = device_add_child_ordered(dev, order, name, unit); if (child == NULL) @@ -513,10 +494,81 @@ chipc_add_child(device_t dev, u_int orde } resource_list_init(&dinfo->resources); - device_set_ivars(child, dinfo); + /* Hint matching requires a device name */ + if (name == NULL) + return (child); + + /* Use hint table to set child resources */ + for (hint = chipc_hints; hint->name != NULL; hint++) { + bhnd_addr_t region_addr; + bhnd_size_t region_size; + + if (strcmp(hint->name, name) != 0) + continue; + + switch (hint->type) { + case SYS_RES_IRQ: + /* Add child resource */ + error = bus_set_resource(child, hint->type, hint->rid, + hint->base, hint->size); + if (error) { + device_printf(dev, + "bus_set_resource() failed for %s: %d\n", + device_get_nameunit(child), error); + goto failed; + } + break; + + case SYS_RES_MEMORY: + /* Fetch region address and size */ + error = bhnd_get_region_addr(dev, BHND_PORT_DEVICE, + hint->port, hint->region, ®ion_addr, + ®ion_size); + if (error) { + device_printf(dev, + "lookup of %s%u.%u failed: %d\n", + bhnd_port_type_name(BHND_PORT_DEVICE), + hint->port, hint->region, error); + goto failed; + } + + /* Verify requested range is mappable */ + if (hint->base > region_size || + hint->size > region_size || + region_size - hint->base < hint->size ) + { + device_printf(dev, + "%s%u.%u region cannot map requested range " + "%#jx+%#jx\n", + bhnd_port_type_name(BHND_PORT_DEVICE), + hint->port, hint->region, hint->base, + hint->size); + } + + /* Add child resource */ + error = bus_set_resource(child, hint->type, + hint->rid, region_addr + hint->base, hint->size); + if (error) { + device_printf(dev, + "bus_set_resource() failed for %s: %d\n", + device_get_nameunit(child), error); + goto failed; + } + break; + default: + device_printf(child, "unknown hint resource type: %d\n", + hint->type); + break; + } + } + return (child); + +failed: + device_delete_child(dev, child); + return (NULL); } static void Modified: head/sys/dev/bhnd/cores/chipc/chipcreg.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipcreg.h Thu May 26 00:03:23 2016 (r300701) +++ head/sys/dev/bhnd/cores/chipc/chipcreg.h Thu May 26 00:43:08 2016 (r300702) @@ -61,6 +61,8 @@ #define CHIPC_JTAGDR 0x38 #define CHIPC_JTAGCTRL 0x3c +#define CHIPC_SFLASH_BASE 0x40 +#define CHIPC_SFLASH_SIZE 12 #define CHIPC_SFLASHCTRL 0x40 #define CHIPC_SFLASHADDR 0x44 #define CHIPC_SFLASHDATA 0x48 @@ -171,11 +173,15 @@ #define CHIPC_CLK_CTL_ST 0x1E0 #define CHIPC_SPROM_HWWAR 0x19 -#define CHIPC_UART0 0x300 -#define CHIPC_UART1 0x400 +#define CHIPC_UART_BASE 0x300 +#define CHIPC_UART_SIZE 0x100 +#define CHIPC_UART0_BASE CHIPC_UART_BASE +#define CHIPC_UART1_BASE (CHIPC_UART_BASE + CHIPC_UART_SIZE) /* PMU registers (rev >= 20) */ #define CHIPC_PMU_BASE 0x600 +#define CHIPC_PMU_SIZE 0x70 + #define CHIPC_PMU_CTRL 0x600 #define CHIPC_PMU_CAP 0x604 #define CHIPC_PMU_ST 0x608 From owner-svn-src-head@freebsd.org Thu May 26 00:44:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE99BB48405; Thu, 26 May 2016 00:44:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF0814C7; Thu, 26 May 2016 00:44:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q0iGOx069276; Thu, 26 May 2016 00:44:16 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q0iGcu069274; Thu, 26 May 2016 00:44:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605260044.u4Q0iGcu069274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 26 May 2016 00:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300703 - head/sys/dev/bhnd/cores/chipc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 00:44:17 -0000 Author: adrian Date: Thu May 26 00:44:16 2016 New Revision: 300703 URL: https://svnweb.freebsd.org/changeset/base/300703 Log: [bhnd] Fix release of uninitialized SPROM shadow in chipc detach. This was triggering a panic on detach; the SPROM shadow is now maintained by the bhnd_sprom_chipc driver, and should be removed from chipc. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6548 Modified: head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/chipc/chipcvar.h Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Thu May 26 00:43:08 2016 (r300702) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Thu May 26 00:44:16 2016 (r300703) @@ -269,7 +269,6 @@ chipc_detach(device_t dev) chipc_release_region(sc, sc->core_region, RF_ALLOCATED|RF_ACTIVE); chipc_free_rman(sc); - bhnd_sprom_fini(&sc->sprom); CHIPC_LOCK_DESTROY(sc); Modified: head/sys/dev/bhnd/cores/chipc/chipcvar.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipcvar.h Thu May 26 00:43:08 2016 (r300702) +++ head/sys/dev/bhnd/cores/chipc/chipcvar.h Thu May 26 00:44:16 2016 (r300703) @@ -186,12 +186,8 @@ struct chipc_softc { bhnd_nvram_src_t nvram_src; /**< identified NVRAM source */ struct mtx mtx; /**< state mutex. */ - - struct bhnd_sprom sprom; /**< OTP/SPROM shadow, if any */ - size_t sprom_refcnt; /**< SPROM hardware refcount */ - + size_t sprom_refcnt; /**< SPROM pin enable refcount */ struct rman mem_rman; /**< port memory manager */ - STAILQ_HEAD(, chipc_region) mem_regions;/**< memory allocation records */ }; From owner-svn-src-head@freebsd.org Thu May 26 01:19:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2A2FB48BCC; Thu, 26 May 2016 01:19:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83CA51117; Thu, 26 May 2016 01:19:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q1JDM6080364; Thu, 26 May 2016 01:19:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q1JDDp080363; Thu, 26 May 2016 01:19:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605260119.u4Q1JDDp080363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 26 May 2016 01:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300704 - head/sys/dev/flash X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 01:19:14 -0000 Author: adrian Date: Thu May 26 01:19:13 2016 New Revision: 300704 URL: https://svnweb.freebsd.org/changeset/base/300704 Log: [mx25l] add Winbond w25x64 support. PR: https://github.com/freebsd/freebsd/pull/16 Submitted by: https://github.com/epipenau Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Thu May 26 00:44:16 2016 (r300703) +++ head/sys/dev/flash/mx25l.c Thu May 26 01:19:13 2016 (r300704) @@ -124,6 +124,7 @@ struct mx25l_flash_ident flash_devices[] /* Winbond -- w25x "blocks" are 64K, "sectors" are 4KiB */ { "w25x32", 0xef, 0x3016, 64 * 1024, 64, FL_ERASE_4K }, + { "w25x64", 0xef, 0x3017, 64 * 1024, 128, FL_ERASE_4K }, { "w25q32", 0xef, 0x4016, 64 * 1024, 64, FL_ERASE_4K }, { "w25q64", 0xef, 0x4017, 64 * 1024, 128, FL_ERASE_4K }, { "w25q64bv", 0xef, 0x4017, 64 * 1024, 128, FL_ERASE_4K }, From owner-svn-src-head@freebsd.org Thu May 26 01:33:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA68FB492E9; Thu, 26 May 2016 01:33:25 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70E1F1CBC; Thu, 26 May 2016 01:33:25 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q1XOXS087711; Thu, 26 May 2016 01:33:24 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q1XOl5087710; Thu, 26 May 2016 01:33:24 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605260133.u4Q1XOl5087710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 26 May 2016 01:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300705 - head/usr.bin/fortune/unstr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 01:33:25 -0000 Author: truckman Date: Thu May 26 01:33:24 2016 New Revision: 300705 URL: https://svnweb.freebsd.org/changeset/base/300705 Log: Avoid buffer overflow when copying the input file name and appending .dat. Check the return value from fread() to be sure that it was successful. Reported by: Coverity CID: 1006709, 1009452 MFC after: 1 week Modified: head/usr.bin/fortune/unstr/unstr.c Modified: head/usr.bin/fortune/unstr/unstr.c ============================================================================== --- head/usr.bin/fortune/unstr/unstr.c Thu May 26 01:19:13 2016 (r300704) +++ head/usr.bin/fortune/unstr/unstr.c Thu May 26 01:33:24 2016 (r300705) @@ -86,13 +86,19 @@ main(int argc, char *argv[]) exit(1); } Infile = argv[1]; - strcpy(Datafile, Infile); - strcat(Datafile, ".dat"); + if ((size_t)snprintf(Datafile, sizeof(Datafile), "%s.dat", Infile) >= + sizeof(Datafile)) + errx(1, "%s name too long", Infile); if ((Inf = fopen(Infile, "r")) == NULL) err(1, "%s", Infile); if ((Dataf = fopen(Datafile, "r")) == NULL) err(1, "%s", Datafile); - fread((char *)&tbl, sizeof(tbl), 1, Dataf); + if (fread((char *)&tbl, sizeof(tbl), 1, Dataf) != 1) { + if (feof(Dataf)) + errx(1, "%s read EOF", Datafile); + else + err(1, "%s read", Datafile); + } tbl.str_version = be32toh(tbl.str_version); tbl.str_numstr = be32toh(tbl.str_numstr); tbl.str_longlen = be32toh(tbl.str_longlen); From owner-svn-src-head@freebsd.org Thu May 26 01:45:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79B5FB49591; Thu, 26 May 2016 01:45:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9B51157; Thu, 26 May 2016 01:45:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q1j4N2091336; Thu, 26 May 2016 01:45:04 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q1j4im091335; Thu, 26 May 2016 01:45:04 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605260145.u4Q1j4im091335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 26 May 2016 01:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300706 - head/usr.sbin/tzsetup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 01:45:05 -0000 Author: truckman Date: Thu May 26 01:45:04 2016 New Revision: 300706 URL: https://svnweb.freebsd.org/changeset/base/300706 Log: Avoid buffer overflow or truncation when constructing path_zoneinfo_file. Reported by: Coverity CID: 1011160 MFC after: 1 week Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Thu May 26 01:33:24 2016 (r300705) +++ head/usr.sbin/tzsetup/tzsetup.c Thu May 26 01:45:04 2016 (r300706) @@ -838,7 +838,9 @@ install_zoneinfo(const char *zoneinfo) FILE *f; char path_zoneinfo_file[MAXPATHLEN]; - sprintf(path_zoneinfo_file, "%s/%s", path_zoneinfo, zoneinfo); + if ((size_t)snprintf(path_zoneinfo_file, sizeof(path_zoneinfo_file), + "%s/%s", path_zoneinfo, zoneinfo) >= sizeof(path_zoneinfo_file)) + errx(1, "%s/%s name too long", path_zoneinfo, zoneinfo); rv = install_zoneinfo_file(path_zoneinfo_file); /* Save knowledge for later */ From owner-svn-src-head@freebsd.org Thu May 26 02:55:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCE85B4ADFF; Thu, 26 May 2016 02:55:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 936601240; Thu, 26 May 2016 02:55:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q2tfLD016895; Thu, 26 May 2016 02:55:41 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q2tfc4016894; Thu, 26 May 2016 02:55:41 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605260255.u4Q2tfc4016894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 May 2016 02:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300707 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 02:55:42 -0000 Author: ian Date: Thu May 26 02:55:41 2016 New Revision: 300707 URL: https://svnweb.freebsd.org/changeset/base/300707 Log: Add a convenience macro that masks all the bits related to clock divisors in all versions of the sdhci spec (the HI bits are just unused reserved bits in earlier versions). Modified: head/sys/dev/sdhci/sdhci.h Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Thu May 26 01:45:04 2016 (r300706) +++ head/sys/dev/sdhci/sdhci.h Thu May 26 02:55:41 2016 (r300707) @@ -153,6 +153,9 @@ #define SDHCI_CLOCK_CARD_EN 0x0004 #define SDHCI_CLOCK_INT_STABLE 0x0002 #define SDHCI_CLOCK_INT_EN 0x0001 +#define SDHCI_DIVIDERS_MASK \ + ((SDHCI_DIVIDER_MASK << SDHCI_DIVIDER_SHIFT) | \ + (SDHCI_DIVIDER_HI_MASK << SDHCI_DIVIDER_HI_SHIFT)) #define SDHCI_TIMEOUT_CONTROL 0x2E From owner-svn-src-head@freebsd.org Thu May 26 03:50:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DCD0B4A951; Thu, 26 May 2016 03:50:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 459F41158; Thu, 26 May 2016 03:50:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q3oqwD037268; Thu, 26 May 2016 03:50:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q3oqAg037266; Thu, 26 May 2016 03:50:52 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605260350.u4Q3oqAg037266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 26 May 2016 03:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300708 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 03:50:53 -0000 Author: sephe Date: Thu May 26 03:50:52 2016 New Revision: 300708 URL: https://svnweb.freebsd.org/changeset/base/300708 Log: hyperv: Rework guest id settings according to Hyper-V spec MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6553 Modified: head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hyperv_reg.h Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Thu May 26 02:55:41 2016 (r300707) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Thu May 26 03:50:52 2016 (r300708) @@ -52,34 +52,24 @@ __FBSDID("$FreeBSD$"); #define HYPERV_INTERFACE 0x31237648 /* HV#1 */ -/* - * The guest OS needs to register the guest ID with the hypervisor. - * The guest ID is a 64 bit entity and the structure of this ID is - * specified in the Hyper-V specification: - * - * http://msdn.microsoft.com/en-us/library/windows/ - * hardware/ff542653%28v=vs.85%29.aspx - * - * While the current guideline does not specify how FreeBSD guest ID(s) - * need to be generated, our plan is to publish the guidelines for - * FreeBSD and other guest operating systems that currently are hosted - * on Hyper-V. The implementation here conforms to this yet - * unpublished guidelines. - * - * Bit(s) - * 63 - Indicates if the OS is Open Source or not; 1 is Open Source - * 62:56 - Os Type: FreeBSD is 0x02 - * 55:48 - Distro specific identification - * 47:16 - FreeBSD kernel version number - * 15:0 - Distro specific identification - */ -#define HYPERV_GUESTID_OSS (0x1ULL << 63) -#define HYPERV_GUESTID_FREEBSD (0x02ULL << 56) -#define HYPERV_GUESTID(id) \ - (HYPERV_GUESTID_OSS | HYPERV_GUESTID_FREEBSD | \ - (((uint64_t)(((id) & 0xff0000) >> 16)) << 48) |\ - (((uint64_t)__FreeBSD_version) << 16) | \ - ((uint64_t)((id) & 0x00ffff))) +#define HYPERV_FREEBSD_BUILD 0ULL +#define HYPERV_FREEBSD_VERSION ((uint64_t)__FreeBSD_version) +#define HYPERV_FREEBSD_OSID 0ULL + +#define MSR_HV_GUESTID_BUILD_FREEBSD \ + (HYPERV_FREEBSD_BUILD & MSR_HV_GUESTID_BUILD_MASK) +#define MSR_HV_GUESTID_VERSION_FREEBSD \ + ((HYPERV_FREEBSD_VERSION << MSR_HV_GUESTID_VERSION_SHIFT) & \ + MSR_HV_GUESTID_VERSION_MASK) +#define MSR_HV_GUESTID_OSID_FREEBSD \ + ((HYPERV_FREEBSD_OSID << MSR_HV_GUESTID_OSID_SHIFT) & \ + MSR_HV_GUESTID_OSID_MASK) + +#define MSR_HV_GUESTID_FREEBSD \ + (MSR_HV_GUESTID_BUILD_FREEBSD | \ + MSR_HV_GUESTID_VERSION_FREEBSD | \ + MSR_HV_GUESTID_OSID_FREEBSD | \ + MSR_HV_GUESTID_OSTYPE_FREEBSD) struct hypercall_ctx { void *hc_addr; @@ -321,8 +311,8 @@ hyperv_init(void *dummy __unused) return; } - /* Write guest id */ - wrmsr(HV_X64_MSR_GUEST_OS_ID, HYPERV_GUESTID(0)); + /* Set guest id */ + wrmsr(MSR_HV_GUEST_OS_ID, MSR_HV_GUESTID_FREEBSD); if (hyperv_features & HV_FEATURE_MSR_TIME_REFCNT) { /* Register virtual timecount */ Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv_reg.h Thu May 26 02:55:41 2016 (r300707) +++ head/sys/dev/hyperv/vmbus/hyperv_reg.h Thu May 26 03:50:52 2016 (r300708) @@ -29,6 +29,20 @@ #ifndef _HYPERV_REG_H_ #define _HYPERV_REG_H_ +#define MSR_HV_GUEST_OS_ID 0x40000000 +#define MSR_HV_GUESTID_BUILD_MASK 0xffffULL +#define MSR_HV_GUESTID_VERSION_MASK 0x0000ffffffff0000ULL +#define MSR_HV_GUESTID_VERSION_SHIFT 16 +#define MSR_HV_GUESTID_OSID_MASK 0x00ff000000000000ULL +#define MSR_HV_GUESTID_OSID_SHIFT 48 +#define MSR_HV_GUESTID_OSTYPE_MASK 0x7f00000000000000ULL +#define MSR_HV_GUESTID_OSTYPE_SHIFT 56 +#define MSR_HV_GUESTID_OPENSRC 0x8000000000000000ULL +#define MSR_HV_GUESTID_OSTYPE_LINUX \ + ((0x01ULL << MSR_HV_GUESTID_OSTYPE_SHIFT) | MSR_HV_GUESTID_OPENSRC) +#define MSR_HV_GUESTID_OSTYPE_FREEBSD \ + ((0x02ULL << MSR_HV_GUESTID_OSTYPE_SHIFT) | MSR_HV_GUESTID_OPENSRC) + #define MSR_HV_HYPERCALL 0x40000001 #define MSR_HV_HYPERCALL_ENABLE 0x0001ULL #define MSR_HV_HYPERCALL_RSVD_MASK 0x0ffeULL From owner-svn-src-head@freebsd.org Thu May 26 03:55:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F097B4AAD5; Thu, 26 May 2016 03:55:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFCAF167D; Thu, 26 May 2016 03:55:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q3tSwe040072; Thu, 26 May 2016 03:55:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q3tStH040071; Thu, 26 May 2016 03:55:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605260355.u4Q3tStH040071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 May 2016 03:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300709 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 03:55:29 -0000 Author: ian Date: Thu May 26 03:55:27 2016 New Revision: 300709 URL: https://svnweb.freebsd.org/changeset/base/300709 Log: Another round of changes to add compatibility with the older ESHDC variety of hardware. Mostly this focuses on the big changes needed for setting the bus clock, because ESDHC is SDHCI v2.0 and USDHC is 3.0, and the number, location, and interpretation of clock divisor bits is vastly different between the two. This doesn't get the device all the way to functioning on ESDHC hardware yet, but it's much closer, now getting through all the card detection and negotiation of capabilties and speed (but it eventually hangs on what appears to be a missing interrupt). Another missing chunk of code for handling ESDHC's 32 bit command-and-mode register using sdhci's pair of 16 bit writes is added. This also does some leading whitespace cleanups and sorts some softc struct members by size, and adds some comments (because when do I ever touch code without adding comments?). Modified: head/sys/arm/freescale/imx/imx_sdhci.c Modified: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- head/sys/arm/freescale/imx/imx_sdhci.c Thu May 26 03:50:52 2016 (r300708) +++ head/sys/arm/freescale/imx/imx_sdhci.c Thu May 26 03:55:27 2016 (r300709) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -74,12 +75,12 @@ struct imx_sdhci_softc { struct callout r1bfix_callout; sbintime_t r1bfix_timeout_at; uint32_t baseclk_hz; - uint32_t sdclockreg_freq_bits; uint32_t cmd_and_mode; uint32_t r1bfix_intmask; + boolean_t force_card_present; + uint16_t sdclockreg_freq_bits; uint8_t r1bfix_type; uint8_t hwtype; - boolean_t force_card_present; }; #define R1BFIX_NONE 0 /* No fix needed at next interrupt. */ @@ -90,6 +91,12 @@ struct imx_sdhci_softc { #define HWTYPE_ESDHC 1 /* imx5x and earlier. */ #define HWTYPE_USDHC 2 /* imx6. */ +/* + * Freescale-specific registers, or in some cases the layout of bits within the + * sdhci-defined register is different on Freescale. These names all begin with + * SDHC_ (not SDHCI_). + */ + #define SDHC_WTMK_LVL 0x44 /* Watermark Level register. */ #define USDHC_MIX_CONTROL 0x48 /* Mix(ed) Control register. */ #define SDHC_VEND_SPEC 0xC0 /* Vendor-specific register. */ @@ -138,11 +145,20 @@ struct imx_sdhci_softc { #define SDHC_PROT_CDTL (1 << 6) #define SDHC_PROT_CDSS (1 << 7) +#define SDHC_SYS_CTRL 0x2c #define SDHC_INT_STATUS 0x30 +/* + * The clock enable bits exist in different registers for ESDHC vs USDHC, but + * they are the same bits in both cases. The divisor values go into the + * standard sdhci clock register, but in different bit positions and meanings + than the sdhci spec values. + */ #define SDHC_CLK_IPGEN (1 << 0) #define SDHC_CLK_HCKEN (1 << 1) #define SDHC_CLK_PEREN (1 << 2) +#define SDHC_CLK_SDCLKEN (1 << 3) +#define SDHC_CLK_ENABLE_MASK 0x0000000f #define SDHC_CLK_DIVISOR_MASK 0x000000f0 #define SDHC_CLK_DIVISOR_SHIFT 4 #define SDHC_CLK_PRESCALE_MASK 0x0000ff00 @@ -156,7 +172,8 @@ static struct ofw_compat_data compat_dat {NULL, HWTYPE_NONE}, }; -static void imx_sdhc_set_clock(struct imx_sdhci_softc *sc, int enable); +static uint16_t imx_sdhc_get_clock(struct imx_sdhci_softc *sc); +static void imx_sdhc_set_clock(struct imx_sdhci_softc *sc, uint16_t val); static void imx_sdhci_r1bfix_func(void *arg); static inline uint32_t @@ -186,7 +203,7 @@ imx_sdhci_read_1(device_t dev, struct sd */ if (off == SDHCI_HOST_CONTROL) { wrk32 = RD4(sc, SDHC_PROT_CTRL); - val32 = wrk32 & (SDHCI_CTRL_LED | SDHCI_CTRL_CARD_DET | + val32 = wrk32 & (SDHCI_CTRL_LED | SDHCI_CTRL_CARD_DET | SDHCI_CTRL_FORCE_CARD); switch (wrk32 & SDHC_PROT_WIDTH_MASK) { case SDHC_PROT_WIDTH_1BIT: @@ -204,7 +221,7 @@ imx_sdhci_read_1(device_t dev, struct sd /* Value is already 0. */ break; case SDHC_PROT_ADMA1: - /* This value is deprecated, should never appear. */ + /* This value is deprecated, should never appear. */ break; case SDHC_PROT_ADMA2: val32 |= SDHCI_CTRL_ADMA2; @@ -221,7 +238,7 @@ imx_sdhci_read_1(device_t dev, struct sd * power is always on and always set to the same voltage. */ if (off == SDHCI_POWER_CONTROL) { - return (SDHCI_POWER_ON | SDHCI_POWER_300); + return (SDHCI_POWER_ON | SDHCI_POWER_300); } @@ -232,7 +249,7 @@ static uint16_t imx_sdhci_read_2(device_t dev, struct sdhci_slot *slot, bus_size_t off) { struct imx_sdhci_softc *sc = device_get_softc(dev); - uint32_t val32, wrk32; + uint32_t val32; if (sc->hwtype == HWTYPE_USDHC) { /* @@ -258,9 +275,9 @@ imx_sdhci_read_2(device_t dev, struct sd * cached values last written. */ if (off == SDHCI_TRANSFER_MODE) { - return (sc->cmd_and_mode >> 16); - } else if (off == SDHCI_COMMAND_FLAGS) { return (sc->cmd_and_mode & 0x0000ffff); + } else if (off == SDHCI_COMMAND_FLAGS) { + return (sc->cmd_and_mode >> 16); } } @@ -276,22 +293,11 @@ imx_sdhci_read_2(device_t dev, struct sd } /* - * The clock enable bit is in the vendor register and the clock-stable - * bit is in the present state register. Transcribe them as if they - * were in the clock control register where they should be. - * XXX Is it important that we distinguish between "internal" and "card" - * clocks? Probably not; transcribe the card clock status to both bits. + * Clock bits are scattered into various registers which differ by + * hardware type, complex enough to have their own function. */ if (off == SDHCI_CLOCK_CONTROL) { - val32 = 0; - wrk32 = RD4(sc, SDHC_VEND_SPEC); - if (wrk32 & SDHC_VEND_FRC_SDCLK_ON) - val32 |= SDHCI_CLOCK_INT_EN | SDHCI_CLOCK_CARD_EN; - wrk32 = RD4(sc, SDHC_PRES_STATE); - if (wrk32 & SDHC_PRES_SDSTB) - val32 |= SDHCI_CLOCK_INT_STABLE; - val32 |= sc->sdclockreg_freq_bits; - return (val32); + return (imx_sdhc_get_clock(sc)); } return ((RD4(sc, off & ~3) >> (off & 3) * 8) & 0xffff); @@ -307,9 +313,11 @@ imx_sdhci_read_4(device_t dev, struct sd /* * The hardware leaves the base clock frequency out of the capabilities - * register; fill it in. The timeout clock is the same as the active - * output sdclock; we indicate that with a quirk setting so don't - * populate the timeout frequency bits. + * register, but we filled it in by setting slot->max_clk at attach time + * rather than here, because we can't represent frequencies above 63MHz + * in an sdhci 2.0 capabliities register. The timeout clock is the same + * as the active output sdclock; we indicate that with a quirk setting + * so don't populate the timeout frequency bits. * * XXX Turn off (for now) features the hardware can do but this driver * doesn't yet handle (1.8v, suspend/resume, etc). @@ -318,7 +326,6 @@ imx_sdhci_read_4(device_t dev, struct sd val32 &= ~SDHCI_CAN_VDD_180; val32 &= ~SDHCI_CAN_DO_SUSPEND; val32 |= SDHCI_CAN_DO_8BITBUS; - val32 |= (sc->baseclk_hz / 1000000) << SDHCI_CLOCK_BASE_SHIFT; return (val32); } @@ -326,7 +333,7 @@ imx_sdhci_read_4(device_t dev, struct sd * The hardware moves bits around in the present state register to make * room for all 8 data line state bits. To translate, mask out all the * bits which are not in the same position in both registers (this also - * masks out some freescale-specific bits in locations defined as + * masks out some Freescale-specific bits in locations defined as * reserved by sdhci), then shift the data line and retune request bits * down to their standard locations. */ @@ -404,31 +411,12 @@ imx_sdhci_write_2(device_t dev, struct s struct imx_sdhci_softc *sc = device_get_softc(dev); uint32_t val32; - /* The USDHC hardware moved the transfer mode bits to mixed control. */ - if (sc->hwtype == HWTYPE_USDHC) { - if (off == SDHCI_TRANSFER_MODE) { - val32 = RD4(sc, USDHC_MIX_CONTROL); - val32 &= ~0x3f; - val32 |= val & 0x37; - // XXX acmd23 not supported here (or by sdhci driver) - WR4(sc, USDHC_MIX_CONTROL, val32); - return; - } - } - /* - * The clock control stuff is complex enough to have its own routine - * that can both change speeds and en/disable the clock output. Also, - * save the register bits in SDHCI format so that we can play them back - * in the read2 routine without complex decoding. + * The clock control stuff is complex enough to have its own function + * that can handle the ESDHC versus USDHC differences. */ if (off == SDHCI_CLOCK_CONTROL) { - sc->sdclockreg_freq_bits = val & 0xffc0; - if (val & SDHCI_CLOCK_CARD_EN) { - imx_sdhc_set_clock(sc, true); - } else { - imx_sdhc_set_clock(sc, false); - } + imx_sdhc_set_clock(sc, val); return; } @@ -461,6 +449,35 @@ imx_sdhci_write_2(device_t dev, struct s } } + /* + * The USDHC hardware moved the transfer mode bits to mixed control; we + * just write them there and we're done. The ESDHC hardware has the + * typical combined cmd-and-mode register that allows only 32-bit + * access, so when writing the mode bits just save them, then later when + * writing the command bits, add in the saved mode bits. + */ + if (sc->hwtype == HWTYPE_USDHC) { + if (off == SDHCI_TRANSFER_MODE) { + val32 = RD4(sc, USDHC_MIX_CONTROL); + val32 &= ~0x3f; + val32 |= val & 0x37; + // XXX acmd23 not supported here (or by sdhci driver) + WR4(sc, USDHC_MIX_CONTROL, val32); + return; + } + } else if (sc->hwtype == HWTYPE_ESDHC) { + if (off == SDHCI_TRANSFER_MODE) { + sc->cmd_and_mode = + (sc->cmd_and_mode & 0xffff0000) | val; + return; + } else if (off == SDHCI_COMMAND_FLAGS) { + sc->cmd_and_mode = + (sc->cmd_and_mode & 0xffff) | (val << 16); + WR4(sc, SDHCI_TRANSFER_MODE, sc->cmd_and_mode); + return; + } + } + val32 = RD4(sc, off & ~3); val32 &= ~(0xffff << (off & 3) * 8); val32 |= ((val & 0xffff) << (off & 3) * 8); @@ -489,40 +506,103 @@ imx_sdhci_write_multi_4(device_t dev, st bus_write_multi_4(sc->mem_res, off, data, count); } -static void -imx_sdhc_set_clock(struct imx_sdhci_softc *sc, int enable) +static uint16_t +imx_sdhc_get_clock(struct imx_sdhci_softc *sc) { - uint32_t divisor, enable_bits, enable_reg, freq, prescale, val32; + uint16_t val; + + /* + * Whenever the sdhci driver writes the clock register we save a + * snapshot of just the frequency bits, so that we can play them back + * here on a register read without recalculating the frequency from the + * prescalar and divisor bits in the real register. We'll start with + * those bits, and mix in the clock status and enable bits that come + * from different places depending on which hardware we've got. + */ + val = sc->sdclockreg_freq_bits; + + /* + * The internal clock is always enabled (actually, the hardware manages + * it). Whether the internal clock is stable yet after a frequency + * change comes from the present-state register on both hardware types. + */ + val |= SDHCI_CLOCK_INT_EN; + if (RD4(sc, SDHC_PRES_STATE) & SDHC_PRES_SDSTB) + val |= SDHCI_CLOCK_INT_STABLE; + /* + * On ESDHC hardware the card bus clock enable is in the usual sdhci + * register but it's a different bit, so transcribe it (note the + * difference between standard SDHCI_ and Freescale SDHC_ prefixes + * here). On USDHC hardware there is a force-on bit, but no force-off + * for the card bus clock (the hardware runs the clock when transfers + * are active no matter what), so we always say the clock is on. + * XXX Maybe we should say it's in whatever state the sdhci driver last + * set it to. + */ if (sc->hwtype == HWTYPE_ESDHC) { - divisor = (sc->sdclockreg_freq_bits >> SDHCI_DIVIDER_SHIFT) & - SDHCI_DIVIDER_MASK; - enable_reg = SDHCI_CLOCK_CONTROL; - enable_bits = SDHC_CLK_IPGEN | SDHC_CLK_HCKEN | - SDHC_CLK_PEREN; + if (RD4(sc, SDHC_SYS_CTRL) & SDHC_CLK_SDCLKEN) + val |= SDHCI_CLOCK_CARD_EN; } else { - divisor = (sc->sdclockreg_freq_bits >> SDHCI_DIVIDER_SHIFT) & - SDHCI_DIVIDER_MASK; - divisor |= ((sc->sdclockreg_freq_bits >> - SDHCI_DIVIDER_HI_SHIFT) & - SDHCI_DIVIDER_HI_MASK) << SDHCI_DIVIDER_MASK_LEN; - enable_reg = SDHCI_CLOCK_CONTROL; - enable_bits = SDHC_VEND_IPGEN | SDHC_VEND_HCKEN | - SDHC_VEND_PEREN; + val |= SDHCI_CLOCK_CARD_EN; } - WR4(sc, SDHC_VEND_SPEC, - RD4(sc, SDHC_VEND_SPEC) & ~SDHC_VEND_FRC_SDCLK_ON); - WR4(sc, enable_reg, RD4(sc, enable_reg) & ~enable_bits); + return (val); +} - if (!enable) - return; +static void +imx_sdhc_set_clock(struct imx_sdhci_softc *sc, uint16_t val) +{ + uint32_t divisor, freq, prescale, val32; + + val32 = RD4(sc, SDHCI_CLOCK_CONTROL); + + /* + * Save the frequency-setting bits in SDHCI format so that we can play + * them back in get_clock without complex decoding of hardware regs, + * then deal with the freqency part of the value based on hardware type. + */ + sc->sdclockreg_freq_bits = val & SDHCI_DIVIDERS_MASK; + if (sc->hwtype == HWTYPE_ESDHC) { + /* + * The ESDHC hardware requires the driver to manually start and + * stop the sd bus clock. If the enable bit is not set, turn + * off the clock in hardware and we're done, otherwise decode + * the requested frequency. ESDHC hardware is sdhci 2.0; the + * sdhci driver will use the original 8-bit divisor field and + * the "base / 2^N" divisor scheme. + */ + if ((val & SDHCI_CLOCK_CARD_EN) == 0) { + WR4(sc, SDHCI_CLOCK_CONTROL, val32 & ~SDHC_CLK_SDCLKEN); + return; - if (divisor == 0) - freq = sc->baseclk_hz; - else - freq = sc->baseclk_hz / (2 * divisor); + } + divisor = (val >> SDHCI_DIVIDER_SHIFT) & SDHCI_DIVIDER_MASK; + freq = sc->baseclk_hz >> ffs(divisor); + } else { + /* + * The USDHC hardware provides only "force always on" control + * over the sd bus clock, but no way to turn it off. (If a cmd + * or data transfer is in progress the clock is on, otherwise it + * is off.) If the clock is being disabled, we can just return + * now, otherwise we decode the requested frequency. USDHC + * hardware is sdhci 3.0; the sdhci driver will use a 10-bit + * divisor using the "base / 2*N" divisor scheme. + */ + if ((val & SDHCI_CLOCK_CARD_EN) == 0) + return; + divisor = ((val >> SDHCI_DIVIDER_SHIFT) & SDHCI_DIVIDER_MASK) | + ((val >> SDHCI_DIVIDER_HI_SHIFT) & SDHCI_DIVIDER_HI_MASK) << + SDHCI_DIVIDER_MASK_LEN; + if (divisor == 0) + freq = sc->baseclk_hz; + else + freq = sc->baseclk_hz / (2 * divisor); + } + /* + * Get a prescaler and final divisor to achieve the desired frequency. + */ for (prescale = 2; freq < sc->baseclk_hz / (prescale * 16);) prescale <<= 1; @@ -536,19 +616,16 @@ imx_sdhc_set_clock(struct imx_sdhci_soft prescale, divisor); #endif + /* + * Adjust to zero-based values, and store them to the hardware. + */ prescale >>= 1; divisor -= 1; - val32 = RD4(sc, SDHCI_CLOCK_CONTROL); - val32 &= ~SDHC_CLK_DIVISOR_MASK; + val32 &= ~(SDHC_CLK_DIVISOR_MASK | SDHC_CLK_PRESCALE_MASK); val32 |= divisor << SDHC_CLK_DIVISOR_SHIFT; - val32 &= ~SDHC_CLK_PRESCALE_MASK; val32 |= prescale << SDHC_CLK_PRESCALE_SHIFT; WR4(sc, SDHCI_CLOCK_CONTROL, val32); - - WR4(sc, enable_reg, RD4(sc, enable_reg) | enable_bits); - WR4(sc, SDHC_VEND_SPEC, - RD4(sc, SDHC_VEND_SPEC) | SDHC_VEND_FRC_SDCLK_ON); } static boolean_t @@ -733,6 +810,7 @@ imx_sdhci_attach(device_t dev) WR4(sc, SDHC_WTMK_LVL, 0x08800880); sc->baseclk_hz = imx_ccm_sdhci_hz(); + sc->slot.max_clk = sc->baseclk_hz; /* * If the slot is flagged with the non-removable property, set our flag From owner-svn-src-head@freebsd.org Thu May 26 06:35:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69733B4A1CF; Thu, 26 May 2016 06:35:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16C3B16C9; Thu, 26 May 2016 06:35:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q6ZCvA097981; Thu, 26 May 2016 06:35:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q6ZC3U097979; Thu, 26 May 2016 06:35:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605260635.u4Q6ZC3U097979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 26 May 2016 06:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300710 - head/sys/dev/spibus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 06:35:13 -0000 Author: adrian Date: Thu May 26 06:35:11 2016 New Revision: 300710 URL: https://svnweb.freebsd.org/changeset/base/300710 Log: [spibus] add initial placeholders for transfer mode and frequency. This doesn't yet implement it in the controllers or the transfer calls, but it's a start. Obtained from: loos (frequency), ray/zrouter (transfer mode) Modified: head/sys/dev/spibus/spibus.c head/sys/dev/spibus/spibusvar.h Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Thu May 26 03:55:27 2016 (r300709) +++ head/sys/dev/spibus/spibus.c Thu May 26 06:35:11 2016 (r300710) @@ -105,6 +105,7 @@ spibus_print_child(device_t dev, device_ retval += bus_print_child_header(dev, child); retval += printf(" at cs %d", devi->cs); + retval += printf(" mode %d", devi->mode); retval += bus_print_child_footer(dev, child); return (retval); @@ -117,6 +118,7 @@ spibus_probe_nomatch(device_t bus, devic device_printf(bus, ""); printf(" at cs %d\n", devi->cs); + printf(" mode %d", devi->mode); return; } @@ -149,6 +151,11 @@ spibus_read_ivar(device_t bus, device_t case SPIBUS_IVAR_CS: *(uint32_t *)result = devi->cs; break; + case SPIBUS_IVAR_MODE: + *(uint32_t *)result = devi->mode; + break; + case SPIBUS_IVAR_CLOCK: + *(uint32_t *)result = devi->clock; } return (0); } @@ -179,7 +186,9 @@ spibus_hinted_child(device_t bus, const child = BUS_ADD_CHILD(bus, 0, dname, dunit); devi = SPIBUS_IVAR(child); + devi->mode = SPIBUS_MODE_NONE; resource_int_value(dname, dunit, "cs", &devi->cs); + resource_int_value(dname, dunit, "mode", &devi->mode); } static int Modified: head/sys/dev/spibus/spibusvar.h ============================================================================== --- head/sys/dev/spibus/spibusvar.h Thu May 26 03:55:27 2016 (r300709) +++ head/sys/dev/spibus/spibusvar.h Thu May 26 06:35:11 2016 (r300710) @@ -34,13 +34,22 @@ struct spibus_softc device_t dev; }; +#define SPIBUS_MODE_NONE 0 +#define SPIBUS_MODE_CPHA 1 +#define SPIBUS_MODE_CPOL 2 +#define SPIBUS_MODE_CPOL_CPHA 3 + struct spibus_ivar { uint32_t cs; + uint32_t mode; + uint32_t clock; }; enum { - SPIBUS_IVAR_CS /* chip select that we're on */ + SPIBUS_IVAR_CS, /* chip select that we're on */ + SPIBUS_IVAR_MODE, /* SPI mode (0-3) */ + SPIBUS_IVAR_CLOCK, /* maximum clock freq for device */ }; #define SPIBUS_ACCESSOR(A, B, T) \ @@ -52,6 +61,8 @@ spibus_get_ ## A(device_t dev, T *t) } SPIBUS_ACCESSOR(cs, CS, uint32_t) +SPIBUS_ACCESSOR(mode, MODE, uint32_t) +SPIBUS_ACCESSOR(clock, CLOCK, uint32_t) extern driver_t spibus_driver; extern devclass_t spibus_devclass; From owner-svn-src-head@freebsd.org Thu May 26 06:36:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79158B4A258; Thu, 26 May 2016 06:36:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 468411869; Thu, 26 May 2016 06:36:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q6awM3098078; Thu, 26 May 2016 06:36:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q6awoU098077; Thu, 26 May 2016 06:36:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605260636.u4Q6awoU098077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 26 May 2016 06:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300711 - head/sys/dev/spibus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 06:36:59 -0000 Author: adrian Date: Thu May 26 06:36:58 2016 New Revision: 300711 URL: https://svnweb.freebsd.org/changeset/base/300711 Log: [spibus] add missing break. Pointy hat to: me Modified: head/sys/dev/spibus/spibus.c Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Thu May 26 06:35:11 2016 (r300710) +++ head/sys/dev/spibus/spibus.c Thu May 26 06:36:58 2016 (r300711) @@ -156,6 +156,7 @@ spibus_read_ivar(device_t bus, device_t break; case SPIBUS_IVAR_CLOCK: *(uint32_t *)result = devi->clock; + break; } return (0); } From owner-svn-src-head@freebsd.org Thu May 26 06:37:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D57F4B4A2AF; Thu, 26 May 2016 06:37:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6D2E1A14; Thu, 26 May 2016 06:37:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q6bXkO098141; Thu, 26 May 2016 06:37:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q6bXH1098140; Thu, 26 May 2016 06:37:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605260637.u4Q6bXH1098140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 26 May 2016 06:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300712 - head/sys/dev/spibus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 06:37:34 -0000 Author: adrian Date: Thu May 26 06:37:33 2016 New Revision: 300712 URL: https://svnweb.freebsd.org/changeset/base/300712 Log: [spibus] implement maximum clock frequency lookup from ofw. Obtained from: loos Modified: head/sys/dev/spibus/ofw_spibus.c Modified: head/sys/dev/spibus/ofw_spibus.c ============================================================================== --- head/sys/dev/spibus/ofw_spibus.c Thu May 26 06:36:58 2016 (r300711) +++ head/sys/dev/spibus/ofw_spibus.c Thu May 26 06:37:33 2016 (r300712) @@ -78,7 +78,7 @@ ofw_spibus_attach(device_t dev) struct spibus_softc *sc = device_get_softc(dev); struct ofw_spibus_devinfo *dinfo; phandle_t child; - pcell_t paddr; + pcell_t clock, paddr; device_t childdev; sc->dev = dev; @@ -103,6 +103,14 @@ ofw_spibus_attach(device_t dev) } /* + * Get the maximum clock frequency for device, zero means + * use the default bus speed. + */ + if (OF_getencprop(child, "spi-max-frequency", &clock, + sizeof(clock)) == -1) + clock = 0; + + /* * Now set up the SPI and OFW bus layer devinfo and add it * to the bus. */ @@ -111,6 +119,7 @@ ofw_spibus_attach(device_t dev) if (dinfo == NULL) continue; dinfo->opd_dinfo.cs = paddr; + dinfo->opd_dinfo.clock = clock; if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) != 0) { free(dinfo, M_DEVBUF); From owner-svn-src-head@freebsd.org Thu May 26 07:02:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F43CB4A936; Thu, 26 May 2016 07:02:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD9381A25; Thu, 26 May 2016 07:02:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q72Lin008999; Thu, 26 May 2016 07:02:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q72KH0008996; Thu, 26 May 2016 07:02:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605260702.u4Q72KH0008996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 26 May 2016 07:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300713 - in head/sys: conf dev/spibus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 07:02:22 -0000 Author: adrian Date: Thu May 26 07:02:20 2016 New Revision: 300713 URL: https://svnweb.freebsd.org/changeset/base/300713 Log: [spigen] add initial spigen driver from green@ This is a simple ioctl and mmap API to issue SPI transactions from userland. It's useful for simple devices (eg spi temperature sensors, etc) for experimentation. TODO: * Write some documentation! Submitted by: green Added: head/sys/dev/spibus/spigen.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/spibus/spi.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 26 06:37:33 2016 (r300712) +++ head/sys/conf/files Thu May 26 07:02:20 2016 (r300713) @@ -2553,6 +2553,7 @@ dev/sound/midi/synth_if.m optional sound dev/spibus/ofw_spibus.c optional fdt spibus dev/spibus/spibus.c optional spibus \ dependency "spibus_if.h" +dev/spibus/spigen.c optional spigen dev/spibus/spibus_if.m optional spibus dev/ste/if_ste.c optional ste pci dev/stg/tmc18c30.c optional stg Modified: head/sys/dev/spibus/spi.h ============================================================================== --- head/sys/dev/spibus/spi.h Thu May 26 06:37:33 2016 (r300712) +++ head/sys/dev/spibus/spi.h Thu May 26 07:02:20 2016 (r300713) @@ -37,4 +37,6 @@ struct spi_command { uint32_t rx_data_sz; }; +#define SPI_COMMAND_INITIALIZER { 0 } + #define SPI_CHIP_SELECT_HIGH 0x1 /* Chip select high (else low) */ Added: head/sys/dev/spibus/spigen.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/spibus/spigen.c Thu May 26 07:02:20 2016 (r300713) @@ -0,0 +1,403 @@ +/*- + * Copyright (c) 2015 Brian Fundakowski Feldman. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "spibus_if.h" + +struct spigen_softc { + device_t sc_dev; + struct cdev *sc_cdev; + struct mtx sc_mtx; + uint32_t sc_clock_speed; + uint32_t sc_command_length_max; /* cannot change while mmapped */ + uint32_t sc_data_length_max; /* cannot change while mmapped */ + vm_object_t sc_mmap_buffer; /* command, then data */ + vm_offset_t sc_mmap_kvaddr; + size_t sc_mmap_buffer_size; + int sc_mmap_busy; + int sc_debug; +}; + +static int +spigen_probe(device_t dev) +{ + device_set_desc(dev, "SPI Generic IO"); + return (0); +} + +static int spigen_open(struct cdev *, int, int, struct thread *); +static int spigen_ioctl(struct cdev *, u_long, caddr_t, int, struct thread *); +static int spigen_close(struct cdev *, int, int, struct thread *); +static d_mmap_single_t spigen_mmap_single; + +static struct cdevsw spigen_cdevsw = { + .d_version = D_VERSION, + .d_name = "spigen", + .d_open = spigen_open, + .d_ioctl = spigen_ioctl, + .d_mmap_single = spigen_mmap_single, + .d_close = spigen_close +}; + +static int +spigen_command_length_max_proc(SYSCTL_HANDLER_ARGS) +{ + struct spigen_softc *sc = (struct spigen_softc *)arg1; + uint32_t command_length_max; + int error; + + mtx_lock(&sc->sc_mtx); + command_length_max = sc->sc_command_length_max; + mtx_unlock(&sc->sc_mtx); + error = sysctl_handle_int(oidp, &command_length_max, + sizeof(command_length_max), req); + if (error == 0 && req->newptr != NULL) { + mtx_lock(&sc->sc_mtx); + if (sc->sc_mmap_buffer != NULL) + error = EBUSY; + else + sc->sc_command_length_max = command_length_max; + mtx_unlock(&sc->sc_mtx); + } + return (error); +} + +static int +spigen_data_length_max_proc(SYSCTL_HANDLER_ARGS) +{ + struct spigen_softc *sc = (struct spigen_softc *)arg1; + uint32_t data_length_max; + int error; + + mtx_lock(&sc->sc_mtx); + data_length_max = sc->sc_data_length_max; + mtx_unlock(&sc->sc_mtx); + error = sysctl_handle_int(oidp, &data_length_max, + sizeof(data_length_max), req); + if (error == 0 && req->newptr != NULL) { + mtx_lock(&sc->sc_mtx); + if (sc->sc_mmap_buffer != NULL) + error = EBUSY; + else + sc->sc_data_length_max = data_length_max; + mtx_unlock(&sc->sc_mtx); + } + return (error); +} + +static void +spigen_sysctl_init(struct spigen_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree_node; + struct sysctl_oid_list *tree; + + /* + * Add system sysctl tree/handlers. + */ + ctx = device_get_sysctl_ctx(sc->sc_dev); + tree_node = device_get_sysctl_tree(sc->sc_dev); + tree = SYSCTL_CHILDREN(tree_node); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "command_length_max", + CTLFLAG_MPSAFE | CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + spigen_command_length_max_proc, "IU", "SPI command header portion (octets)"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "data_length_max", + CTLFLAG_MPSAFE | CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + spigen_data_length_max_proc, "IU", "SPI data trailer portion (octets)"); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "data", CTLFLAG_RW, + &sc->sc_debug, 0, "debug flags"); + +} + +static int +spigen_attach(device_t dev) +{ + struct spigen_softc *sc; + const int unit = device_get_unit(dev); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_cdev = make_dev(&spigen_cdevsw, unit, + UID_ROOT, GID_OPERATOR, 0660, "spigen%d", unit); + sc->sc_cdev->si_drv1 = dev; + sc->sc_command_length_max = PAGE_SIZE; + sc->sc_data_length_max = PAGE_SIZE; + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + spigen_sysctl_init(sc); + + return (0); +} + +static int +spigen_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + + return (0); +} + +static int +spigen_transfer(struct cdev *cdev, struct spigen_transfer *st) +{ + struct spi_command transfer = SPI_COMMAND_INITIALIZER; + device_t dev = cdev->si_drv1; + struct spigen_softc *sc = device_get_softc(dev); + int error = 0; + + mtx_lock(&sc->sc_mtx); + if (st->st_command.iov_len == 0 || st->st_data.iov_len == 0) + error = EINVAL; + else if (st->st_command.iov_len > sc->sc_command_length_max || + st->st_data.iov_len > sc->sc_data_length_max) + error = ENOMEM; + mtx_unlock(&sc->sc_mtx); + if (error) + return (error); + +#if 0 + device_printf(dev, "cmd %p %u data %p %u\n", st->st_command.iov_base, + st->st_command.iov_len, st->st_data.iov_base, st->st_data.iov_len); +#endif + transfer.tx_cmd = transfer.rx_cmd = malloc(st->st_command.iov_len, + M_DEVBUF, M_WAITOK); + if (transfer.tx_cmd == NULL) + return (ENOMEM); + transfer.tx_data = transfer.rx_data = malloc(st->st_data.iov_len, + M_DEVBUF, M_WAITOK); + if (transfer.tx_data == NULL) { + free(transfer.tx_cmd, M_DEVBUF); + return (ENOMEM); + } + + error = copyin(st->st_command.iov_base, transfer.tx_cmd, + transfer.tx_cmd_sz = transfer.rx_cmd_sz = st->st_command.iov_len); + if (error == 0) + error = copyin(st->st_data.iov_base, transfer.tx_data, + transfer.tx_data_sz = transfer.rx_data_sz = + st->st_data.iov_len); + if (error == 0) + error = SPIBUS_TRANSFER(device_get_parent(dev), dev, &transfer); + if (error == 0) { + error = copyout(transfer.rx_cmd, st->st_command.iov_base, + transfer.rx_cmd_sz); + if (error == 0) + error = copyout(transfer.rx_data, st->st_data.iov_base, + transfer.rx_data_sz); + } + + free(transfer.tx_cmd, M_DEVBUF); + free(transfer.tx_data, M_DEVBUF); + return (error); +} + +static int +spigen_transfer_mmapped(struct cdev *cdev, struct spigen_transfer_mmapped *stm) +{ + struct spi_command transfer = SPI_COMMAND_INITIALIZER; + device_t dev = cdev->si_drv1; + struct spigen_softc *sc = device_get_softc(dev); + int error = 0; + + mtx_lock(&sc->sc_mtx); + if (sc->sc_mmap_busy) + error = EBUSY; + else if (stm->stm_command_length > sc->sc_command_length_max || + stm->stm_data_length > sc->sc_data_length_max) + error = E2BIG; + else if (sc->sc_mmap_buffer == NULL) + error = EINVAL; + else if (sc->sc_mmap_buffer_size < + stm->stm_command_length + stm->stm_data_length) + error = ENOMEM; + if (error == 0) + sc->sc_mmap_busy = 1; + mtx_unlock(&sc->sc_mtx); + if (error) + return (error); + + transfer.tx_cmd = transfer.rx_cmd = (void *)sc->sc_mmap_kvaddr; + transfer.tx_cmd_sz = transfer.rx_cmd_sz = stm->stm_command_length; + transfer.tx_data = transfer.rx_data = + (void *)(sc->sc_mmap_kvaddr + stm->stm_command_length); + transfer.tx_data_sz = transfer.rx_data_sz = stm->stm_data_length; + error = SPIBUS_TRANSFER(device_get_parent(dev), dev, &transfer); + + mtx_lock(&sc->sc_mtx); + KASSERT(sc->sc_mmap_busy, ("mmap no longer marked busy")); + sc->sc_mmap_busy = 0; + mtx_unlock(&sc->sc_mtx); + return (error); +} + +static int +spigen_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + device_t dev = cdev->si_drv1; + struct spigen_softc *sc = device_get_softc(dev); + int error; + + switch (cmd) { + case SPIGENIOC_TRANSFER: + error = spigen_transfer(cdev, (struct spigen_transfer *)data); + break; + case SPIGENIOC_TRANSFER_MMAPPED: + error = spigen_transfer_mmapped(cdev, (struct spigen_transfer_mmapped *)data); + break; + case SPIGENIOC_GET_CLOCK_SPEED: + mtx_lock(&sc->sc_mtx); + *(uint32_t *)data = sc->sc_clock_speed; + /* XXX TODO: implement spibus ivar call */ + mtx_unlock(&sc->sc_mtx); + error = 0; + break; + case SPIGENIOC_SET_CLOCK_SPEED: + mtx_lock(&sc->sc_mtx); + sc->sc_clock_speed = *(uint32_t *)data; + mtx_unlock(&sc->sc_mtx); + error = 0; + break; + default: + error = EOPNOTSUPP; + } + return (error); +} + +static int +spigen_mmap_single(struct cdev *cdev, vm_ooffset_t *offset, + vm_size_t size, struct vm_object **object, int nprot) +{ + device_t dev = cdev->si_drv1; + struct spigen_softc *sc = device_get_softc(dev); + vm_page_t *m; + size_t n, pages; + + if (size == 0 || + (nprot & (PROT_EXEC | PROT_READ | PROT_WRITE)) + != (PROT_READ | PROT_WRITE)) + return (EINVAL); + size = roundup2(size, PAGE_SIZE); + pages = size / PAGE_SIZE; + + mtx_lock(&sc->sc_mtx); + if (sc->sc_mmap_buffer != NULL) { + mtx_unlock(&sc->sc_mtx); + return (EBUSY); + } else if (size > sc->sc_command_length_max + sc->sc_data_length_max) { + mtx_unlock(&sc->sc_mtx); + return (E2BIG); + } + sc->sc_mmap_buffer_size = size; + *offset = 0; + sc->sc_mmap_buffer = *object = vm_pager_allocate(OBJT_PHYS, 0, size, + nprot, *offset, curthread->td_ucred); + m = malloc(sizeof(*m) * pages, M_TEMP, M_WAITOK); + VM_OBJECT_WLOCK(*object); + vm_object_reference_locked(*object); // kernel and userland both + for (n = 0; n < pages; n++) { + m[n] = vm_page_grab(*object, n, + VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_WIRED); + m[n]->valid = VM_PAGE_BITS_ALL; + } + VM_OBJECT_WUNLOCK(*object); + sc->sc_mmap_kvaddr = kva_alloc(size); + pmap_qenter(sc->sc_mmap_kvaddr, m, pages); + free(m, M_TEMP); + mtx_unlock(&sc->sc_mtx); + + if (*object == NULL) + return (EINVAL); + return (0); +} + +static int +spigen_close(struct cdev *cdev, int fflag, int devtype, struct thread *td) +{ + device_t dev = cdev->si_drv1; + struct spigen_softc *sc = device_get_softc(dev); + + mtx_lock(&sc->sc_mtx); + if (sc->sc_mmap_buffer != NULL) { + pmap_qremove(sc->sc_mmap_kvaddr, + sc->sc_mmap_buffer_size / PAGE_SIZE); + kva_free(sc->sc_mmap_kvaddr, sc->sc_mmap_buffer_size); + sc->sc_mmap_kvaddr = 0; + vm_object_deallocate(sc->sc_mmap_buffer); + sc->sc_mmap_buffer = NULL; + sc->sc_mmap_buffer_size = 0; + } + mtx_unlock(&sc->sc_mtx); + return (0); +} + +static int +spigen_detach(device_t dev) +{ + + return (EIO); +} + +static devclass_t spigen_devclass; + +static device_method_t spigen_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, spigen_probe), + DEVMETHOD(device_attach, spigen_attach), + DEVMETHOD(device_detach, spigen_detach), + + { 0, 0 } +}; + +static driver_t spigen_driver = { + "spigen", + spigen_methods, + sizeof(struct spigen_softc), +}; + +DRIVER_MODULE(spigen, spibus, spigen_driver, spigen_devclass, 0, 0); From owner-svn-src-head@freebsd.org Thu May 26 07:09:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AE35B4AA59; Thu, 26 May 2016 07:09:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D12911CA0; Thu, 26 May 2016 07:09:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q79hsU009284; Thu, 26 May 2016 07:09:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q79h3u009283; Thu, 26 May 2016 07:09:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605260709.u4Q79h3u009283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 26 May 2016 07:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300714 - head/contrib/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 07:09:44 -0000 Author: ngie Date: Thu May 26 07:09:42 2016 New Revision: 300714 URL: https://svnweb.freebsd.org/changeset/base/300714 Log: The readme provides a high-level overview of how to upgrade top(1). Differential Revision: https://reviews.freebsd.org/D6493 MFC after: 1 week Reviewed By: ngie Submitted by: Randy Westlund Sponsored by: EMC / Isilon Storage Division Added: head/contrib/top/FREEBSD-upgrade Added: head/contrib/top/FREEBSD-upgrade ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/top/FREEBSD-upgrade Thu May 26 07:09:42 2016 (r300714) @@ -0,0 +1,22 @@ +$FreeBSD$ + +This file contains notes regarding the upgrade of top(1). See the vendor +import instructions at: + + https://www.freebsd.org/doc/en/articles/committers-guide/subversion-primer.html#svn-advanced-use-vendor-imports + +The upstream project pages for top(1) are: + + http://www.unixtop.org/ + + https://sourceforge.net/projects/unixtop/ + +contrib/top/machine.h specifies an interface that must be provided by the +target OS. That interface is implemented in usr.bin/top/machine.c + +To enable building on case-insensitive filesystems, the following files were +renamed: + + contrib/top/top.X -> contrib/top/top.xs + contrib/top/top.local.H -> contrib/top/top.local.hs + From owner-svn-src-head@freebsd.org Thu May 26 07:11:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 703D3B4AC76; Thu, 26 May 2016 07:11:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4005D1F6C; Thu, 26 May 2016 07:11:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id f144so14940841pfa.3; Thu, 26 May 2016 00:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=hTu6RcNsOKQEPEMlx+gUQ9s2Fe8Tvjson+/qkqGCcTo=; b=h3a/5NHY2zuGHVMmyTgszaRGgR/T3LdwHg2o5ZNdkZRwkZ1iDO5kNCwSia49mE38nf u4f43+lPHT5fCgHneaXMVMdiPazZgjoDUSeoL1V0a71X6CIhtbEuc21vKUTI5v5D2vD1 S9xHDB9aI7ZOzFoVoItVzOYTd+JK1gfL8cs81YW5Woe1urnYegRpKHxDGMU7lNYT1z1q lNyC77DZo9ZWdWVf08uIS+LOdA3MNf1AtmDX02R6WSd+61EIL9BxlqikWhGWA/nudUhg JUsvtyVZp4x2MFICm/SS0gdsjtJvqXhUrKt1DTtJ7dAh7+TPq8NVT16I28ui/a+m8pqN Cbvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=hTu6RcNsOKQEPEMlx+gUQ9s2Fe8Tvjson+/qkqGCcTo=; b=YKifElXHeZRLgwqmGMY82ePT1Pk3M39nIVqsOBWEPO6RDnpqTcs6RkTcsXLULaRWYh rgGidIh6mxWQIH2kgYH8rVlK3bsTkF7GpsU3t/swCJobcwFVh/RTmpyYOyclhDsGjtwB gieoNlBTbcgPoq7Gn/l1kmgNurdlJQ3ZMw3vkHirWLL9jHtja790pR/0mZJd25Cmf2dd KDePRbkQcvR4p7pbOnOSC+w6gb45Owa+pJe8TqmobXXPStA/OfnM1j0scD25O44QoiWc 2YGD7v2vNNogUGLAI/Ql4UkM4UCSU+A2uIzb53EiWwWIn5P6LWX3VdZqUIdHEMmCs1c2 qWZQ== X-Gm-Message-State: ALyK8tJYtI9qk/st2wyVXhu5CpKl5+i8e71rzwEHShhQJT2ofpwqQ9n5n/Bq8NPh67FLoQ== X-Received: by 10.98.4.195 with SMTP id 186mr11870693pfe.154.1464246687506; Thu, 26 May 2016 00:11:27 -0700 (PDT) Received: from pinklady.local (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id f67sm3259256pff.62.2016.05.26.00.11.26 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2016 00:11:26 -0700 (PDT) Subject: Re: svn commit: r300714 - head/contrib/top Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_41FE8064-6D91-4E95-9C37-6F670596C8CA"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201605260709.u4Q79h3u009283@repo.freebsd.org> Date: Thu, 26 May 2016 00:11:24 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201605260709.u4Q79h3u009283@repo.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 07:11:28 -0000 --Apple-Mail=_41FE8064-6D91-4E95-9C37-6F670596C8CA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 26, 2016, at 00:09, Garrett Cooper wrote: >=20 > Author: ngie > Date: Thu May 26 07:09:42 2016 > New Revision: 300714 > URL: https://svnweb.freebsd.org/changeset/base/300714 >=20 > Log: The summary should have also said: Add compat/top/FREEBSD-upgrade > The readme provides a high-level overview of how to upgrade top(1). >=20 > Differential Revision: https://reviews.freebsd.org/D6493 > MFC after: 1 week > Reviewed By: ngie > Submitted by: Randy Westlund > Sponsored by: EMC / Isilon Storage Division It was an experiment with trying to use arc commit. It comes close, but = it=E2=80=99s not perfect. Thanks! -Ngie --Apple-Mail=_41FE8064-6D91-4E95-9C37-6F670596C8CA 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 iQIcBAEBCgAGBQJXRqGdAAoJEPWDqSZpMIYVc6wP/3eSGF/fgkit/rkgELrhOn1V 22SvfNHCalkwCPSuSjd1K/zYNFX2G/c+kUfIk0Psf2ack6zWFmKUUVjHb8XS7bXr iXHAq7xrFJsm/0aLwQxiEL+vCb6Sb5mG+NoO5qqsYdngMafKwwqU1JBwAyP9lzfR q/bkMmtDtRAYR88qHFiiWjTuOqR2ii9X+nefCrCOy8yxqFZvNTzSIzBTs7WWpVwJ N+MyfJQEYRRSf06RqBQ8WxlzAnWoWy+eIg6x28RTiZShqo2KvYDIo54+zflBc1bx MQSQQlWI5UX8eiefV0flvDsrWSSLBemdnm5JKPdmqvJtdi8n/YD6vZ+xzeJMdEo4 iEdxWMS1nh5GeOgcKUZnVLUSq9j1PMHOaX8Ajo6SxEL8YpMh0KAFOBrOv9INq7pw gF0eXWA310c6j+BPSJPMo6kwGQvyNPmyYm2faJqBTpoNG9qBTc3lyGXNKEHID4iT OhYSTn2SNNpVOsj2wLDdo5ur7uiSPm+pyK6zabTNRnu27YZH7R0XzXjeheTeT9OR CcQvNGl8pg8IeMXIc5M1kn/ELHiur6saZzQe0YcYpk9hA7UF+svFIh/inFO7W3kI CH+HJU3vUrABXN8PuNGmzmsOPhp7mf5rO8sOR5s2PVdudUHfKikPNfoQm/vkbdwY y2OtA+z4Adp+F0WESwYZ =+QRN -----END PGP SIGNATURE----- --Apple-Mail=_41FE8064-6D91-4E95-9C37-6F670596C8CA-- From owner-svn-src-head@freebsd.org Thu May 26 07:20:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1713B4AF8D; Thu, 26 May 2016 07:20:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F17A170D; Thu, 26 May 2016 07:20:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q7KXTs013260; Thu, 26 May 2016 07:20:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q7KXGt013257; Thu, 26 May 2016 07:20:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605260720.u4Q7KXGt013257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 26 May 2016 07:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300715 - in head/sys: conf dev/gpio modules/gpio/gpiospi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 07:20:34 -0000 Author: adrian Date: Thu May 26 07:20:33 2016 New Revision: 300715 URL: https://svnweb.freebsd.org/changeset/base/300715 Log: [gpiospi] add initial gpio SPI bit bang driver. Submitted by: ray Obtained from: zrouter Added: head/sys/dev/gpio/gpiospi.c (contents, props changed) head/sys/modules/gpio/gpiospi/ head/sys/modules/gpio/gpiospi/Makefile (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 26 07:09:42 2016 (r300714) +++ head/sys/conf/files Thu May 26 07:20:33 2016 (r300715) @@ -1531,6 +1531,7 @@ dev/gpio/gpioc.c optional gpio \ dependency "gpio_if.h" dev/gpio/gpioiic.c optional gpioiic dev/gpio/gpioled.c optional gpioled +dev/gpio/gpiospi.c optional gpiospi dev/gpio/gpio_if.m optional gpio dev/gpio/gpiobus_if.m optional gpio dev/gpio/ofw_gpiobus.c optional fdt gpio Added: head/sys/dev/gpio/gpiospi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gpio/gpiospi.c Thu May 26 07:20:33 2016 (r300715) @@ -0,0 +1,402 @@ +/*- + * Copyright (c) 2011, Aleksandr Rybalko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_gpio.h" + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include "gpiobus_if.h" + +#include + +#include +#include +#include "spibus_if.h" + +#ifdef GPIO_SPI_DEBUG +#define dprintf printf +#else +#define dprintf(x, arg...) +#endif /* GPIO_SPI_DEBUG */ + +struct gpio_spi_softc { + device_t sc_dev; + device_t sc_busdev; + int sc_freq; + uint8_t sc_sclk; + uint8_t sc_miso; + uint8_t sc_mosi; + uint8_t sc_cs0; + uint8_t sc_cs1; + uint8_t sc_cs2; + uint8_t sc_cs3; +}; + +static void gpio_spi_chip_activate(struct gpio_spi_softc *, int); +static void gpio_spi_chip_deactivate(struct gpio_spi_softc *, int); + +static int +gpio_spi_probe(device_t dev) +{ + device_set_desc(dev, "GPIO SPI bit-banging driver"); + return (0); +} + +static void +gpio_delay(struct gpio_spi_softc *sc) +{ + int d; + + d = sc->sc_freq / 1000000; + if (d == 0) + d = 1; + + DELAY(d); +} + +static int +gpio_spi_attach(device_t dev) +{ + uint32_t value; + struct gpio_spi_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_busdev = device_get_parent(dev); + + /* Required variables */ + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), "sclk", &value)) + return (ENXIO); + sc->sc_sclk = value & 0xff; + + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), "mosi", &value)) + return (ENXIO); + sc->sc_mosi = value & 0xff; + + /* Handle no miso; we just never read back from the device */ + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), "miso", &value)) + value = 0xff; + sc->sc_miso = value & 0xff; + + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), "cs0", &value)) + return (ENXIO); + sc->sc_cs0 = value & 0xff; + + /* Optional variables */ + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), "cs1", &value)) + value = 0xff; + sc->sc_cs1 = value & 0xff; + + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), "cs2", &value)) + value = 0xff; + sc->sc_cs2 = value & 0xff; + + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), "cs3", &value)) + value = 0xff; + sc->sc_cs3 = value & 0xff; + + /* Default to 100KHz */ + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), "freq", &value)) { + value = 100000; + } + sc->sc_freq = value; + + if (bootverbose) { + device_printf(dev, "frequency: %d Hz\n", + sc->sc_freq); + device_printf(dev, + "Use GPIO pins: sclk=%d, mosi=%d, miso=%d, " + "cs0=%d, cs1=%d, cs2=%d, cs3=%d\n", + sc->sc_sclk, sc->sc_mosi, sc->sc_miso, + sc->sc_cs0, sc->sc_cs1, sc->sc_cs2, sc->sc_cs3); + } + + /* Set directions */ + GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, sc->sc_sclk, + GPIO_PIN_OUTPUT|GPIO_PIN_PULLDOWN); + GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, sc->sc_mosi, + GPIO_PIN_OUTPUT|GPIO_PIN_PULLDOWN); + if (sc->sc_miso != 0xff) { + GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, sc->sc_miso, + GPIO_PIN_INPUT|GPIO_PIN_PULLDOWN); + } + + GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, sc->sc_cs0, + GPIO_PIN_OUTPUT|GPIO_PIN_PULLUP); + + if (sc->sc_cs1 != 0xff) + GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, sc->sc_cs1, + GPIO_PIN_OUTPUT|GPIO_PIN_PULLUP); + if (sc->sc_cs2 != 0xff) + GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, sc->sc_cs2, + GPIO_PIN_OUTPUT|GPIO_PIN_PULLUP); + if (sc->sc_cs3 != 0xff) + GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, sc->sc_cs3, + GPIO_PIN_OUTPUT|GPIO_PIN_PULLUP); + + gpio_spi_chip_deactivate(sc, -1); + + device_add_child(dev, "spibus", -1); + return (bus_generic_attach(dev)); +} + +static int +gpio_spi_detach(device_t dev) +{ + + return (0); +} + +static void +gpio_spi_chip_activate(struct gpio_spi_softc *sc, int cs) +{ + + /* called with locked gpiobus */ + switch (cs) { + case 0: + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_cs0, 0); + break; + case 1: + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_cs1, 0); + break; + case 2: + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_cs2, 0); + break; + case 3: + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_cs3, 0); + break; + default: + device_printf(sc->sc_dev, "don't have CS%d\n", cs); + } + + gpio_delay(sc); +} + +static void +gpio_spi_chip_deactivate(struct gpio_spi_softc *sc, int cs) +{ + + /* called wth locked gpiobus */ + /* + * Put CSx to high + */ + switch (cs) { + case -1: + /* All CS */ + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_cs0, 1); + if (sc->sc_cs1 == 0xff) break; + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_cs1, 1); + if (sc->sc_cs2 == 0xff) break; + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_cs2, 1); + if (sc->sc_cs3 == 0xff) break; + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_cs3, 1); + break; + case 0: + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_cs0, 1); + break; + case 1: + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_cs1, 1); + break; + case 2: + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_cs2, 1); + break; + case 3: + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_cs3, 1); + break; + default: + device_printf(sc->sc_dev, "don't have CS%d\n", cs); + } +} + +static uint8_t +gpio_spi_txrx(struct gpio_spi_softc *sc, int cs, int mode, uint8_t data) +{ + uint32_t mask, out = 0; + unsigned int bit; + + + /* called with locked gpiobus */ + + for (mask = 0x80; mask > 0; mask >>= 1) { + if ((mode == SPIBUS_MODE_CPOL) || + (mode == SPIBUS_MODE_CPHA)) { + /* If mode 1 or 2 */ + + /* first step */ + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_mosi, (data & mask)?1:0); + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_sclk, 0); + gpio_delay(sc); + /* second step */ + if (sc->sc_miso != 0xff) { + GPIOBUS_PIN_GET(sc->sc_busdev, sc->sc_dev, + sc->sc_miso, &bit); + out |= bit?mask:0; + } + /* Data captured */ + gpio_delay(sc); + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_sclk, 1); + } else { + /* If mode 0 or 3 */ + + /* first step */ + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_mosi, (data & mask)?1:0); + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_sclk, 1); + gpio_delay(sc); + /* second step */ + if (sc->sc_miso != 0xff) { + GPIOBUS_PIN_GET(sc->sc_busdev, sc->sc_dev, + sc->sc_miso, &bit); + out |= bit?mask:0; + } + /* Data captured */ + gpio_delay(sc); + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_sclk, 0); + } + } + + return (out & 0xff); +} + +static int +gpio_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct gpio_spi_softc *sc; + uint8_t *buf_in, *buf_out; + struct spibus_ivar *devi = SPIBUS_IVAR(child); + int i; + + sc = device_get_softc(dev); + + KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, + ("TX/RX command sizes should be equal")); + KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, + ("TX/RX data sizes should be equal")); + + gpio_spi_chip_activate(sc, devi->cs); + + /* Preset pins */ + if ((devi->mode == SPIBUS_MODE_CPOL) || + (devi->mode == SPIBUS_MODE_CPHA)) { + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_sclk, 1); + } else { + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_sclk, 0); + } + + /* + * Transfer command + */ + buf_out = (uint8_t *)cmd->tx_cmd; + buf_in = (uint8_t *)cmd->rx_cmd; + + for (i = 0; i < cmd->tx_cmd_sz; i++) + buf_in[i] = gpio_spi_txrx(sc, devi->cs, devi->mode, buf_out[i]); + + /* + * Receive/transmit data (depends on command) + */ + buf_out = (uint8_t *)cmd->tx_data; + buf_in = (uint8_t *)cmd->rx_data; + for (i = 0; i < cmd->tx_data_sz; i++) + buf_in[i] = gpio_spi_txrx(sc, devi->cs, devi->mode, buf_out[i]); + + /* Return pins to mode default */ + if ((devi->mode == SPIBUS_MODE_CPOL) || + (devi->mode == SPIBUS_MODE_CPHA)) { + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_sclk, 1); + } else { + GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, + sc->sc_sclk, 0); + } + + gpio_spi_chip_deactivate(sc, devi->cs); + + return (0); +} + +static device_method_t gpio_spi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, gpio_spi_probe), + DEVMETHOD(device_attach, gpio_spi_attach), + DEVMETHOD(device_detach, gpio_spi_detach), + + DEVMETHOD(spibus_transfer, gpio_spi_transfer), + + {0, 0} +}; + +static driver_t gpio_spi_driver = { + "gpiospi", + gpio_spi_methods, + sizeof(struct gpio_spi_softc), +}; + +static devclass_t gpio_spi_devclass; + +DRIVER_MODULE(gpiospi, gpiobus, gpio_spi_driver, gpio_spi_devclass, 0, 0); +DRIVER_MODULE(spibus, gpiospi, spibus_driver, spibus_devclass, 0, 0); +MODULE_DEPEND(spi, gpiospi, 1, 1, 1); +MODULE_DEPEND(gpiobus, gpiospi, 1, 1, 1); Added: head/sys/modules/gpio/gpiospi/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/gpio/gpiospi/Makefile Thu May 26 07:20:33 2016 (r300715) @@ -0,0 +1,41 @@ +# +# Copyright (c) 2016 Adrian Chadd . +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer, +# without modification. +# 2. Redistributions in binary form must reproduce at minimum a disclaimer +# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any +# redistribution must be conditioned upon including a substantially +# similar Disclaimer requirement for further binary redistribution. +# +# NO WARRANTY +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY +# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, +# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +# THE POSSIBILITY OF SUCH DAMAGES. +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../dev/gpio/ + +KMOD= gpiospi +SRCS= gpiospi.c +SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h spibus_if.h +SRCS+= opt_gpio.h + +CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ + +.include From owner-svn-src-head@freebsd.org Thu May 26 08:41:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D80B4B77E; Thu, 26 May 2016 08:41:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE80F1E4D; Thu, 26 May 2016 08:41:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q8ftN7045566; Thu, 26 May 2016 08:41:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q8ft9r045564; Thu, 26 May 2016 08:41:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605260841.u4Q8ft9r045564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 26 May 2016 08:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300718 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 08:41:57 -0000 Author: hselasky Date: Thu May 26 08:41:55 2016 New Revision: 300718 URL: https://svnweb.freebsd.org/changeset/base/300718 Log: Add support for boolean sysctl's. Because the size of bool can be implementation defined, make a bool sysctl handler which handle bools. Userspace sees the bools like unsigned 8-bit integers. Values are filtered to either 1 or 0 upon read and write, similar to what a compiler would do. Requested by: kmacy @ Sponsored by: Mellanox Technologies Modified: head/sys/kern/kern_sysctl.c head/sys/sys/sysctl.h Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu May 26 08:31:09 2016 (r300717) +++ head/sys/kern/kern_sysctl.c Thu May 26 08:41:55 2016 (r300718) @@ -1181,6 +1181,41 @@ static SYSCTL_NODE(_sysctl, 5, oiddescr, */ /* + * Handle a bool. + * Two cases: + * a variable: point arg1 at it. + * a constant: pass it in arg2. + */ + +int +sysctl_handle_bool(SYSCTL_HANDLER_ARGS) +{ + uint8_t temp; + int error; + + /* + * Attempt to get a coherent snapshot by making a copy of the data. + */ + if (arg1) + temp = *(bool *)arg1 ? 1 : 0; + else + temp = arg2 ? 1 : 0; + + error = SYSCTL_OUT(req, &temp, sizeof(temp)); + if (error || !req->newptr) + return (error); + + if (!arg1) + error = EPERM; + else { + error = SYSCTL_IN(req, &temp, sizeof(temp)); + if (!error) + *(bool *)arg1 = temp ? 1 : 0; + } + return (error); +} + +/* * Handle an int8_t, signed or unsigned. * Two cases: * a variable: point arg1 at it. Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Thu May 26 08:31:09 2016 (r300717) +++ head/sys/sys/sysctl.h Thu May 26 08:41:55 2016 (r300718) @@ -194,6 +194,7 @@ struct sysctl_oid { #define SYSCTL_OUT(r, p, l) (r->oldfunc)(r, p, l) #define SYSCTL_OUT_STR(r, p) (r->oldfunc)(r, p, strlen(p) + 1) +int sysctl_handle_bool(SYSCTL_HANDLER_ARGS); int sysctl_handle_8(SYSCTL_HANDLER_ARGS); int sysctl_handle_16(SYSCTL_HANDLER_ARGS); int sysctl_handle_32(SYSCTL_HANDLER_ARGS); @@ -329,6 +330,24 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e __arg, len, sysctl_handle_string, "A", __DESCR(descr)); \ }) +/* Oid for a bool. If ptr is NULL, val is returned. */ +#define SYSCTL_NULL_BOOL_PTR ((bool *)NULL) +#define SYSCTL_BOOL(parent, nbr, name, access, ptr, val, descr) \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_U8 | CTLFLAG_MPSAFE | (access), \ + ptr, val, sysctl_handle_bool, "CU", descr); \ + CTASSERT(((access) & CTLTYPE) == 0 && \ + sizeof(bool) == sizeof(*(ptr))) + +#define SYSCTL_ADD_BOOL(ctx, parent, nbr, name, access, ptr, val, descr) \ +({ \ + bool *__ptr = (ptr); \ + CTASSERT(((access) & CTLTYPE) == 0); \ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_U8 | CTLFLAG_MPSAFE | (access), \ + __ptr, val, sysctl_handle_bool, "CU", __DESCR(descr)); \ +}) + /* Oid for a signed 8-bit int. If ptr is NULL, val is returned. */ #define SYSCTL_NULL_S8_PTR ((int8_t *)NULL) #define SYSCTL_S8(parent, nbr, name, access, ptr, val, descr) \ From owner-svn-src-head@freebsd.org Thu May 26 08:44:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A468B4B83C; Thu, 26 May 2016 08:44:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A43110B2; Thu, 26 May 2016 08:44:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q8iBi9047062; Thu, 26 May 2016 08:44:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q8iBNY047061; Thu, 26 May 2016 08:44:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605260844.u4Q8iBNY047061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 26 May 2016 08:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300719 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 08:44:12 -0000 Author: hselasky Date: Thu May 26 08:44:11 2016 New Revision: 300719 URL: https://svnweb.freebsd.org/changeset/base/300719 Log: Add support for boolean module parameters in the LinuxKPI. Requested by: kmacy @ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Modified: head/sys/compat/linuxkpi/common/include/linux/moduleparam.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Thu May 26 08:41:55 2016 (r300718) +++ head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Thu May 26 08:44:11 2016 (r300719) @@ -50,6 +50,12 @@ #define LINUXKPI_PARAM_DESC(name) LINUXKPI_PARAM_CONCAT(linuxkpi_,LINUXKPI_PARAM_PREFIX,name,_desc) #define LINUXKPI_PARAM_NAME(name) LINUXKPI_PARAM_CONCAT(LINUXKPI_PARAM_PREFIX,name,,) +#define LINUXKPI_PARAM_bool(name, var) \ + extern const char LINUXKPI_PARAM_DESC(name)[]; \ + LINUXKPI_PARAM_PASS(SYSCTL_BOOL(LINUXKPI_PARAM_PARENT, OID_AUTO,\ + LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_DESC(name))) + #define LINUXKPI_PARAM_byte(name, var) \ extern const char LINUXKPI_PARAM_DESC(name)[]; \ LINUXKPI_PARAM_PASS(SYSCTL_U8(LINUXKPI_PARAM_PARENT, OID_AUTO, \ From owner-svn-src-head@freebsd.org Thu May 26 08:47:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AAD5B4B908; Thu, 26 May 2016 08:47:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B4F212AB; Thu, 26 May 2016 08:47:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q8l6bW047244; Thu, 26 May 2016 08:47:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q8l6pY047243; Thu, 26 May 2016 08:47:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605260847.u4Q8l6pY047243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 26 May 2016 08:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300720 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 08:47:07 -0000 Author: hselasky Date: Thu May 26 08:47:06 2016 New Revision: 300720 URL: https://svnweb.freebsd.org/changeset/base/300720 Log: Add more module parameter macros to the LinuxKPI. Obtained from: kmacy @ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Modified: head/sys/compat/linuxkpi/common/include/linux/moduleparam.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Thu May 26 08:44:11 2016 (r300719) +++ head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Thu May 26 08:47:06 2016 (r300720) @@ -110,6 +110,12 @@ #define module_param(var, type, mode) \ LINUXKPI_PARAM_##type(var, var) +#define module_param_named_unsafe(name, var, type, mode) \ + LINUXKPI_PARAM_##type(name, var) + +#define module_param_unsafe(var, type, mode) \ + LINUXKPI_PARAM_##type(var, var) + #define module_param_array(var, type, addr_argc, mode) #define MODULE_PARM_DESC(name, desc) \ From owner-svn-src-head@freebsd.org Thu May 26 09:04:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00374B4BFF7; Thu, 26 May 2016 09:04:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2BCB10DC; Thu, 26 May 2016 09:04:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q94EoS054894; Thu, 26 May 2016 09:04:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q94EXw054893; Thu, 26 May 2016 09:04:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605260904.u4Q94EXw054893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 26 May 2016 09:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300721 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 09:04:16 -0000 Author: hselasky Date: Thu May 26 09:04:14 2016 New Revision: 300721 URL: https://svnweb.freebsd.org/changeset/base/300721 Log: Add support for runtime modifiable module parameters in the LinuxKPI. Linux module parameters have a permissions value. If any write bits are set we are allowed to modify the module parameter runtime. Reflect this when creating the static SYSCTL nodes. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Modified: head/sys/compat/linuxkpi/common/include/linux/moduleparam.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Thu May 26 08:47:06 2016 (r300720) +++ head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Thu May 26 09:04:14 2016 (r300721) @@ -44,77 +44,81 @@ #define LINUXKPI_PARAM_PREFIX /* empty prefix is the default */ #endif +#ifndef LINUXKPI_PARAM_PERM +#define LINUXKPI_PARAM_PERM(perm) (((perm) & 0222) ? CTLFLAG_RWTUN : CTLFLAG_RDTUN) +#endif + #define LINUXKPI_PARAM_CONCAT_SUB(a,b,c,d) a##b##c##d #define LINUXKPI_PARAM_CONCAT(...) LINUXKPI_PARAM_CONCAT_SUB(__VA_ARGS__) #define LINUXKPI_PARAM_PASS(...) __VA_ARGS__ #define LINUXKPI_PARAM_DESC(name) LINUXKPI_PARAM_CONCAT(linuxkpi_,LINUXKPI_PARAM_PREFIX,name,_desc) #define LINUXKPI_PARAM_NAME(name) LINUXKPI_PARAM_CONCAT(LINUXKPI_PARAM_PREFIX,name,,) -#define LINUXKPI_PARAM_bool(name, var) \ +#define LINUXKPI_PARAM_bool(name, var, perm) \ extern const char LINUXKPI_PARAM_DESC(name)[]; \ LINUXKPI_PARAM_PASS(SYSCTL_BOOL(LINUXKPI_PARAM_PARENT, OID_AUTO,\ - LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm), &(var), 0, \ LINUXKPI_PARAM_DESC(name))) -#define LINUXKPI_PARAM_byte(name, var) \ +#define LINUXKPI_PARAM_byte(name, var, perm) \ extern const char LINUXKPI_PARAM_DESC(name)[]; \ LINUXKPI_PARAM_PASS(SYSCTL_U8(LINUXKPI_PARAM_PARENT, OID_AUTO, \ - LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm), &(var), 0, \ LINUXKPI_PARAM_DESC(name))) -#define LINUXKPI_PARAM_short(name, var) \ +#define LINUXKPI_PARAM_short(name, var, perm) \ extern const char LINUXKPI_PARAM_DESC(name)[]; \ LINUXKPI_PARAM_PASS(SYSCTL_S16(LINUXKPI_PARAM_PARENT, OID_AUTO, \ - LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm), &(var), 0, \ LINUXKPI_PARAM_DESC(name))) -#define LINUXKPI_PARAM_ushort(name, var) \ +#define LINUXKPI_PARAM_ushort(name, var, perm) \ extern const char LINUXKPI_PARAM_DESC(name)[]; \ LINUXKPI_PARAM_PASS(SYSCTL_U16(LINUXKPI_PARAM_PARENT, OID_AUTO, \ - LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm), &(var), 0, \ LINUXKPI_PARAM_DESC(name))) -#define LINUXKPI_PARAM_int(name, var) \ +#define LINUXKPI_PARAM_int(name, var, perm) \ extern const char LINUXKPI_PARAM_DESC(name)[]; \ LINUXKPI_PARAM_PASS(SYSCTL_INT(LINUXKPI_PARAM_PARENT, OID_AUTO, \ - LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm), &(var), 0,\ LINUXKPI_PARAM_DESC(name))) -#define LINUXKPI_PARAM_uint(name, var) \ +#define LINUXKPI_PARAM_uint(name, var, perm) \ extern const char LINUXKPI_PARAM_DESC(name)[]; \ LINUXKPI_PARAM_PASS(SYSCTL_UINT(LINUXKPI_PARAM_PARENT, OID_AUTO, \ - LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm), &(var), 0, \ LINUXKPI_PARAM_DESC(name))) -#define LINUXKPI_PARAM_long(name, var) \ +#define LINUXKPI_PARAM_long(name, var, perm) \ extern const char LINUXKPI_PARAM_DESC(name)[]; \ LINUXKPI_PARAM_PASS(SYSCTL_LONG(LINUXKPI_PARAM_PARENT, OID_AUTO, \ - LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm), &(var), 0, \ LINUXKPI_PARAM_DESC(name))) -#define LINUXKPI_PARAM_ulong(name, var) \ +#define LINUXKPI_PARAM_ulong(name, var, perm) \ extern const char LINUXKPI_PARAM_DESC(name)[]; \ LINUXKPI_PARAM_PASS(SYSCTL_ULONG(LINUXKPI_PARAM_PARENT, OID_AUTO, \ - LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, &(var), 0, \ + LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm), &(var), 0, \ LINUXKPI_PARAM_DESC(name))) #define module_param_string(name, str, len, perm) \ extern const char LINUXKPI_PARAM_DESC(name)[]; \ LINUXKPI_PARAM_PASS(SYSCTL_STRING(LINUXKPI_PARAM_PARENT, OID_AUTO, \ - LINUXKPI_PARAM_NAME(name), CTLFLAG_RDTUN, (str), (len), \ + LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm), (str), (len), \ LINUXKPI_PARAM_DESC(name))) #define module_param_named(name, var, type, mode) \ - LINUXKPI_PARAM_##type(name, var) + LINUXKPI_PARAM_##type(name, var, mode) #define module_param(var, type, mode) \ - LINUXKPI_PARAM_##type(var, var) + LINUXKPI_PARAM_##type(var, var, mode) #define module_param_named_unsafe(name, var, type, mode) \ - LINUXKPI_PARAM_##type(name, var) + LINUXKPI_PARAM_##type(name, var, mode) #define module_param_unsafe(var, type, mode) \ - LINUXKPI_PARAM_##type(var, var) + LINUXKPI_PARAM_##type(var, var, mode) #define module_param_array(var, type, addr_argc, mode) From owner-svn-src-head@freebsd.org Thu May 26 09:09:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFBA2B4928C; Thu, 26 May 2016 09:09:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FC6918AA; Thu, 26 May 2016 09:09:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q99BKk055240; Thu, 26 May 2016 09:09:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q99Bhh055239; Thu, 26 May 2016 09:09:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605260909.u4Q99Bhh055239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 May 2016 09:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300722 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 09:09:12 -0000 Author: kib Date: Thu May 26 09:09:11 2016 New Revision: 300722 URL: https://svnweb.freebsd.org/changeset/base/300722 Log: Only calibrate ICR read loop when not in x2APIC mode. Run-time switching between LAPIC modes is not supported, and there is no need to wait for IPI ack in x2APIC mode. So the calibrated delay is only needed for !x2APIC. This saves around a second of boot time on the real hardware for x2APIC. Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Thu May 26 09:04:14 2016 (r300721) +++ head/sys/x86/x86/local_apic.c Thu May 26 09:09:11 2016 (r300722) @@ -525,19 +525,21 @@ native_lapic_init(vm_paddr_t addr) */ KASSERT((cpu_feature & CPUID_TSC) != 0 && tsc_freq != 0, ("TSC not initialized")); - r = rdtsc(); - for (rx = 0; rx < LOOPS; rx++) { - (void)lapic_read_icr_lo(); - ia32_pause(); - } - r = rdtsc() - r; - r1 = tsc_freq * LOOPS; - r2 = r * 1000000; - lapic_ipi_wait_mult = r1 >= r2 ? r1 / r2 : 1; - if (bootverbose) { - printf("LAPIC: ipi_wait() us multiplier %ju (r %ju tsc %ju)\n", - (uintmax_t)lapic_ipi_wait_mult, (uintmax_t)r, - (uintmax_t)tsc_freq); + if (!x2apic_mode) { + r = rdtsc(); + for (rx = 0; rx < LOOPS; rx++) { + (void)lapic_read_icr_lo(); + ia32_pause(); + } + r = rdtsc() - r; + r1 = tsc_freq * LOOPS; + r2 = r * 1000000; + lapic_ipi_wait_mult = r1 >= r2 ? r1 / r2 : 1; + if (bootverbose) { + printf("LAPIC: ipi_wait() us multiplier %ju (r %ju " + "tsc %ju)\n", (uintmax_t)lapic_ipi_wait_mult, + (uintmax_t)r, (uintmax_t)tsc_freq); + } } #undef LOOPS #endif /* SMP */ From owner-svn-src-head@freebsd.org Thu May 26 09:49:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58105B49B26; Thu, 26 May 2016 09:49:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 220021ABB; Thu, 26 May 2016 09:49:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q9nTiP069931; Thu, 26 May 2016 09:49:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q9nTx1069928; Thu, 26 May 2016 09:49:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605260949.u4Q9nTx1069928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 26 May 2016 09:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300723 - in head/sys: dev/iser modules/iser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 09:49:30 -0000 Author: trasz Date: Thu May 26 09:49:29 2016 New Revision: 300723 URL: https://svnweb.freebsd.org/changeset/base/300723 Log: Bring in the Mellanox implementation of iSER (iSCSI over RDMA) initiator, written by Sagi Grimberg and Max Gurtovoy . This code comes from https://github.com/sagigrimberg/iser-freebsd, branch iser-rebase-11-current-r291993. It's not connected to the build just yet; it still needs some tweaks to adapt to my changes to iSCSI infrastructure. Big thanks to Mellanox for their support for FreeBSD! Obtained from: Mellanox Technologies MFC after: 1 month Relnotes: yes Added: head/sys/dev/iser/ head/sys/dev/iser/icl_iser.c (contents, props changed) head/sys/dev/iser/icl_iser.h (contents, props changed) head/sys/dev/iser/iser_initiator.c (contents, props changed) head/sys/dev/iser/iser_memory.c (contents, props changed) head/sys/dev/iser/iser_verbs.c (contents, props changed) head/sys/modules/iser/ head/sys/modules/iser/Makefile (contents, props changed) Added: head/sys/dev/iser/icl_iser.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iser/icl_iser.c Thu May 26 09:49:29 2016 (r300723) @@ -0,0 +1,582 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2015, Mellanox Technologies, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "icl_iser.h" + +SYSCTL_NODE(_kern, OID_AUTO, iser, CTLFLAG_RW, 0, "iSER module"); +int iser_debug = 0; +SYSCTL_INT(_kern_iser, OID_AUTO, debug, CTLFLAG_RWTUN, + &iser_debug, 0, "Enable iser debug messages"); + +static MALLOC_DEFINE(M_ICL_ISER, "icl_iser", "iSCSI iser backend"); +static uma_zone_t icl_pdu_zone; + +static volatile u_int icl_iser_ncons; +struct iser_global ig; + +static icl_conn_new_pdu_t iser_conn_new_pdu; +static icl_conn_pdu_free_t iser_conn_pdu_free; +static icl_conn_pdu_data_segment_length_t iser_conn_pdu_data_segment_length; +static icl_conn_pdu_append_data_t iser_conn_pdu_append_data; +static icl_conn_pdu_queue_t iser_conn_pdu_queue; +static icl_conn_handoff_t iser_conn_handoff; +static icl_conn_free_t iser_conn_free; +static icl_conn_close_t iser_conn_close; +static icl_conn_release_t iser_conn_release; +static icl_conn_connect_t iser_conn_connect; +static icl_conn_connected_t iser_conn_connected; +static icl_conn_task_setup_t iser_conn_task_setup; +static icl_conn_task_done_t iser_conn_task_done; +static icl_conn_pdu_get_data_t iser_conn_pdu_get_data; + +static kobj_method_t icl_iser_methods[] = { + KOBJMETHOD(icl_conn_new_pdu, iser_conn_new_pdu), + KOBJMETHOD(icl_conn_pdu_free, iser_conn_pdu_free), + KOBJMETHOD(icl_conn_pdu_data_segment_length, iser_conn_pdu_data_segment_length), + KOBJMETHOD(icl_conn_pdu_append_data, iser_conn_pdu_append_data), + KOBJMETHOD(icl_conn_pdu_queue, iser_conn_pdu_queue), + KOBJMETHOD(icl_conn_handoff, iser_conn_handoff), + KOBJMETHOD(icl_conn_free, iser_conn_free), + KOBJMETHOD(icl_conn_close, iser_conn_close), + KOBJMETHOD(icl_conn_release, iser_conn_release), + KOBJMETHOD(icl_conn_connect, iser_conn_connect), + KOBJMETHOD(icl_conn_connected, iser_conn_connected), + KOBJMETHOD(icl_conn_task_setup, iser_conn_task_setup), + KOBJMETHOD(icl_conn_task_done, iser_conn_task_done), + KOBJMETHOD(icl_conn_pdu_get_data, iser_conn_pdu_get_data), + { 0, 0 } +}; + +DEFINE_CLASS(icl_iser, icl_iser_methods, sizeof(struct iser_conn)); + +/** + * iser_initialize_headers() - Initialize task headers + * @pdu: iser pdu + * @iser_conn: iser connection + * + * Notes: + * This routine may race with iser teardown flow for scsi + * error handling TMFs. So for TMF we should acquire the + * state mutex to avoid dereferencing the IB device which + * may have already been terminated (racing teardown sequence). + */ +int +iser_initialize_headers(struct icl_iser_pdu *pdu, struct iser_conn *iser_conn) +{ + struct iser_tx_desc *tx_desc = &pdu->desc; + struct iser_device *device = iser_conn->ib_conn.device; + u64 dma_addr; + int ret = 0; + + dma_addr = ib_dma_map_single(device->ib_device, (void *)tx_desc, + ISER_HEADERS_LEN, DMA_TO_DEVICE); + if (ib_dma_mapping_error(device->ib_device, dma_addr)) { + ret = -ENOMEM; + goto out; + } + + tx_desc->mapped = true; + tx_desc->dma_addr = dma_addr; + tx_desc->tx_sg[0].addr = tx_desc->dma_addr; + tx_desc->tx_sg[0].length = ISER_HEADERS_LEN; + tx_desc->tx_sg[0].lkey = device->mr->lkey; + +out: + + return (ret); +} + +int +iser_conn_pdu_append_data(struct icl_conn *ic, struct icl_pdu *request, + const void *addr, size_t len, int flags) +{ + struct iser_conn *iser_conn = icl_to_iser_conn(ic); + + if (request->ip_bhs->bhs_opcode & ISCSI_BHS_OPCODE_LOGIN_REQUEST || + request->ip_bhs->bhs_opcode & ISCSI_BHS_OPCODE_TEXT_REQUEST) { + ISER_DBG("copy to login buff"); + memcpy(iser_conn->login_req_buf, addr, len); + request->ip_data_len = len; + } + + return (0); +} + +void +iser_conn_pdu_get_data(struct icl_conn *ic, struct icl_pdu *ip, + size_t off, void *addr, size_t len) +{ + /* If we have a receive data, copy it to upper layer buffer */ + if (ip->ip_data_mbuf) + memcpy(addr, ip->ip_data_mbuf + off, len); +} + +/* + * Allocate icl_pdu with empty BHS to fill up by the caller. + */ +struct icl_pdu * +iser_new_pdu(struct icl_conn *ic, int flags) +{ + struct icl_iser_pdu *iser_pdu; + struct icl_pdu *ip; + struct iser_conn *iser_conn = icl_to_iser_conn(ic); + + iser_pdu = uma_zalloc(icl_pdu_zone, flags | M_ZERO); + if (iser_pdu == NULL) { + ISER_WARN("failed to allocate %zd bytes", sizeof(*iser_pdu)); + return (NULL); + } + + iser_pdu->iser_conn = iser_conn; + ip = &iser_pdu->icl_pdu; + ip->ip_conn = ic; + ip->ip_bhs = &iser_pdu->desc.iscsi_header; + + return (ip); +} + +struct icl_pdu * +iser_conn_new_pdu(struct icl_conn *ic, int flags) +{ + return (iser_new_pdu(ic, flags)); +} + +void +iser_pdu_free(struct icl_conn *ic, struct icl_pdu *ip) +{ + struct icl_iser_pdu *iser_pdu = icl_to_iser_pdu(ip); + + uma_zfree(icl_pdu_zone, iser_pdu); +} + +size_t +iser_conn_pdu_data_segment_length(struct icl_conn *ic, + const struct icl_pdu *request) +{ + uint32_t len = 0; + + len += request->ip_bhs->bhs_data_segment_len[0]; + len <<= 8; + len += request->ip_bhs->bhs_data_segment_len[1]; + len <<= 8; + len += request->ip_bhs->bhs_data_segment_len[2]; + + return (len); +} + +void +iser_conn_pdu_free(struct icl_conn *ic, struct icl_pdu *ip) +{ + iser_pdu_free(ic, ip); +} + +static bool +is_control_opcode(uint8_t opcode) +{ + bool is_control = false; + + switch (opcode & ISCSI_OPCODE_MASK) { + case ISCSI_BHS_OPCODE_NOP_OUT: + case ISCSI_BHS_OPCODE_LOGIN_REQUEST: + case ISCSI_BHS_OPCODE_LOGOUT_REQUEST: + case ISCSI_BHS_OPCODE_TEXT_REQUEST: + is_control = true; + break; + case ISCSI_BHS_OPCODE_SCSI_COMMAND: + is_control = false; + break; + default: + ISER_ERR("unknown opcode %d", opcode); + } + + return (is_control); +} + +void +iser_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip) +{ + struct iser_conn *iser_conn = icl_to_iser_conn(ic); + struct icl_iser_pdu *iser_pdu = icl_to_iser_pdu(ip); + int ret; + + ret = iser_initialize_headers(iser_pdu, iser_conn); + if (ret) { + ISER_ERR("Failed to map TX descriptor pdu %p", iser_pdu); + return; + } + + if (is_control_opcode(ip->ip_bhs->bhs_opcode)) { + ret = iser_send_control(iser_conn, iser_pdu); + if (unlikely(ret)) + ISER_ERR("Failed to send control pdu %p", iser_pdu); + } else { + ret = iser_send_command(iser_conn, iser_pdu); + if (unlikely(ret)) + ISER_ERR("Failed to send command pdu %p", iser_pdu); + } +} + +static struct icl_conn * +iser_new_conn(const char *name, struct mtx *lock) +{ + struct iser_conn *iser_conn; + struct icl_conn *ic; + + refcount_acquire(&icl_iser_ncons); + + iser_conn = (struct iser_conn *)kobj_create(&icl_iser_class, M_ICL_ISER, M_WAITOK | M_ZERO); + if (!iser_conn) { + ISER_ERR("failed to allocate iser conn"); + refcount_release(&icl_iser_ncons); + return (NULL); + } + + cv_init(&iser_conn->up_cv, "iser_cv"); + sx_init(&iser_conn->state_mutex, "iser_conn_state_mutex"); + mtx_init(&iser_conn->ib_conn.beacon.flush_lock, "flush_lock", NULL, MTX_DEF); + cv_init(&iser_conn->ib_conn.beacon.flush_cv, "flush_cv"); + mtx_init(&iser_conn->ib_conn.lock, "lock", NULL, MTX_DEF); + + ic = &iser_conn->icl_conn; + ic->ic_lock = lock; + ic->ic_name = name; + ic->ic_driver = strdup("iser", M_TEMP); + ic->ic_iser = true; + + return (ic); +} + +void +iser_conn_free(struct icl_conn *ic) +{ + struct iser_conn *iser_conn = icl_to_iser_conn(ic); + + cv_destroy(&iser_conn->ib_conn.beacon.flush_cv); + mtx_destroy(&iser_conn->ib_conn.beacon.flush_lock); + sx_destroy(&iser_conn->state_mutex); + cv_destroy(&iser_conn->up_cv); + kobj_delete((struct kobj *)iser_conn, M_ICL_ISER); + refcount_release(&icl_iser_ncons); +} + +int +iser_conn_handoff(struct icl_conn *ic, int cmds_max) +{ + struct iser_conn *iser_conn = icl_to_iser_conn(ic); + int error = 0; + + sx_xlock(&iser_conn->state_mutex); + if (iser_conn->state != ISER_CONN_UP) { + error = EINVAL; + ISER_ERR("iser_conn %p state is %d, teardown started\n", + iser_conn, iser_conn->state); + goto out; + } + + /* + * In discovery session no need to allocate rx desc and posting recv + * work request + */ + if (ic->ic_session_type_discovery(ic)) + goto out; + + error = iser_alloc_rx_descriptors(iser_conn, cmds_max); + if (error) + goto out; + + error = iser_post_recvm(iser_conn, iser_conn->min_posted_rx); + if (error) + goto post_error; + + sx_xunlock(&iser_conn->state_mutex); + return (error); + +post_error: + iser_free_rx_descriptors(iser_conn); +out: + sx_xunlock(&iser_conn->state_mutex); + return (error); + +} + +/** + * Frees all conn objects + */ +void +iser_conn_release(struct icl_conn *ic) +{ + struct iser_conn *iser_conn = icl_to_iser_conn(ic); + struct ib_conn *ib_conn = &iser_conn->ib_conn; + struct iser_conn *curr, *tmp; + + mtx_lock(&ig.connlist_mutex); + /* + * Search for iser connection in global list. + * It may not be there in case of failure in connection establishment + * stage. + */ + list_for_each_entry_safe(curr, tmp, &ig.connlist, conn_list) { + if (iser_conn == curr) { + ISER_WARN("found iser_conn %p", iser_conn); + list_del(&iser_conn->conn_list); + } + } + mtx_unlock(&ig.connlist_mutex); + + /* + * In case we reconnecting or removing session, we need to + * release IB resources (which is safe to call more than once). + */ + sx_xlock(&iser_conn->state_mutex); + iser_free_ib_conn_res(iser_conn, true); + sx_xunlock(&iser_conn->state_mutex); + + if (ib_conn->cma_id != NULL) { + rdma_destroy_id(ib_conn->cma_id); + ib_conn->cma_id = NULL; + } + +} + +void +iser_conn_close(struct icl_conn *ic) +{ + struct iser_conn *iser_conn = icl_to_iser_conn(ic); + + ISER_INFO("closing conn %p", iser_conn); + + sx_xlock(&iser_conn->state_mutex); + /* + * In case iser connection is waiting on conditional variable + * (state PENDING) and we try to close it before connection establishment, + * we need to signal it to continue releasing connection properly. + */ + if (!iser_conn_terminate(iser_conn) && iser_conn->state == ISER_CONN_PENDING) + cv_signal(&iser_conn->up_cv); + sx_xunlock(&iser_conn->state_mutex); + +} + +int +iser_conn_connect(struct icl_conn *ic, int domain, int socktype, + int protocol, struct sockaddr *from_sa, struct sockaddr *to_sa) +{ + struct iser_conn *iser_conn = icl_to_iser_conn(ic); + struct ib_conn *ib_conn = &iser_conn->ib_conn; + int err = 0; + + sx_xlock(&iser_conn->state_mutex); + /* the device is known only --after-- address resolution */ + ib_conn->device = NULL; + + iser_conn->state = ISER_CONN_PENDING; + + ib_conn->cma_id = rdma_create_id(iser_cma_handler, (void *)iser_conn, + RDMA_PS_TCP, IB_QPT_RC); + if (IS_ERR(ib_conn->cma_id)) { + err = -PTR_ERR(ib_conn->cma_id); + ISER_ERR("rdma_create_id failed: %d", err); + goto id_failure; + } + + err = rdma_resolve_addr(ib_conn->cma_id, from_sa, to_sa, 1000); + if (err) { + ISER_ERR("rdma_resolve_addr failed: %d", err); + if (err < 0) + err = -err; + goto addr_failure; + } + + ISER_DBG("before cv_wait: %p", iser_conn); + cv_wait(&iser_conn->up_cv, &iser_conn->state_mutex); + ISER_DBG("after cv_wait: %p", iser_conn); + + if (iser_conn->state != ISER_CONN_UP) { + err = EIO; + goto addr_failure; + } + + err = iser_alloc_login_buf(iser_conn); + if (err) + goto addr_failure; + sx_xunlock(&iser_conn->state_mutex); + + mtx_lock(&ig.connlist_mutex); + list_add(&iser_conn->conn_list, &ig.connlist); + mtx_unlock(&ig.connlist_mutex); + + return (0); + +id_failure: + ib_conn->cma_id = NULL; +addr_failure: + sx_xunlock(&iser_conn->state_mutex); + return (err); +} + +/** + * Called with session spinlock held. + * No need to lock state mutex on an advisory check. + **/ +bool +iser_conn_connected(struct icl_conn *ic) +{ + struct iser_conn *iser_conn = icl_to_iser_conn(ic); + + return (iser_conn->state == ISER_CONN_UP); +} + +int +iser_conn_task_setup(struct icl_conn *ic, struct ccb_scsiio *csio, + uint32_t *task_tagp, void **prvp, struct icl_pdu *ip) +{ + struct icl_iser_pdu *iser_pdu = icl_to_iser_pdu(ip); + + *prvp = ip; + iser_pdu->csio = csio; + + return (0); +} + +void +iser_conn_task_done(struct icl_conn *ic, void *prv) +{ + struct icl_pdu *ip = prv; + struct icl_iser_pdu *iser_pdu = icl_to_iser_pdu(ip); + struct iser_device *device = iser_pdu->iser_conn->ib_conn.device; + struct iser_tx_desc *tx_desc = &iser_pdu->desc; + + if (iser_pdu->dir[ISER_DIR_IN]) { + iser_unreg_rdma_mem(iser_pdu, ISER_DIR_IN); + iser_dma_unmap_task_data(iser_pdu, + &iser_pdu->data[ISER_DIR_IN], + DMA_FROM_DEVICE); + } + + if (iser_pdu->dir[ISER_DIR_OUT]) { + iser_unreg_rdma_mem(iser_pdu, ISER_DIR_OUT); + iser_dma_unmap_task_data(iser_pdu, + &iser_pdu->data[ISER_DIR_OUT], + DMA_TO_DEVICE); + } + + if (likely(tx_desc->mapped)) { + ib_dma_unmap_single(device->ib_device, tx_desc->dma_addr, + ISER_HEADERS_LEN, DMA_TO_DEVICE); + tx_desc->mapped = false; + } + + iser_pdu_free(ic, ip); +} + +static u_int32_t +iser_hba_misc() +{ + return (PIM_UNMAPPED); +} + +static int +iser_limits(size_t *limitp) +{ + *limitp = 128 * 1024; + + return (0); +} + +static int +icl_iser_load(void) +{ + int error; + + ISER_DBG("Starting iSER datamover..."); + + icl_pdu_zone = uma_zcreate("icl_iser_pdu", sizeof(struct icl_iser_pdu), + NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + /* FIXME: Check rc */ + + refcount_init(&icl_iser_ncons, 0); + + error = icl_register("iser", 0, iser_limits, iser_new_conn, iser_hba_misc); + KASSERT(error == 0, ("failed to register iser")); + + memset(&ig, 0, sizeof(struct iser_global)); + + /* device init is called only after the first addr resolution */ + sx_init(&ig.device_list_mutex, "global_device_lock"); + INIT_LIST_HEAD(&ig.device_list); + mtx_init(&ig.connlist_mutex, "global_conn_lock", NULL, MTX_DEF); + INIT_LIST_HEAD(&ig.connlist); + sx_init(&ig.close_conns_mutex, "global_close_conns_lock"); + + return (error); +} + +static int +icl_iser_unload(void) +{ + ISER_DBG("Removing iSER datamover..."); + + if (icl_iser_ncons != 0) + return (EBUSY); + + sx_destroy(&ig.close_conns_mutex); + mtx_destroy(&ig.connlist_mutex); + sx_destroy(&ig.device_list_mutex); + + icl_unregister("iser"); + + uma_zdestroy(icl_pdu_zone); + + return (0); +} + +static int +icl_iser_modevent(module_t mod, int what, void *arg) +{ + switch (what) { + case MOD_LOAD: + return (icl_iser_load()); + case MOD_UNLOAD: + return (icl_iser_unload()); + default: + return (EINVAL); + } +} + +moduledata_t icl_iser_data = { + .name = "icl_iser", + .evhand = icl_iser_modevent, + .priv = 0 +}; + +DECLARE_MODULE(icl_iser, icl_iser_data, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); +MODULE_DEPEND(icl_iser, icl, 1, 1, 1); +MODULE_DEPEND(icl_iser, iscsi, 1, 1, 1); +MODULE_DEPEND(icl_iser, ibcore, 1, 1, 1); +MODULE_DEPEND(icl_iser, linuxkpi, 1, 1, 1); +MODULE_VERSION(icl_iser, 1); + Added: head/sys/dev/iser/icl_iser.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iser/icl_iser.h Thu May 26 09:49:29 2016 (r300723) @@ -0,0 +1,547 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2015, Mellanox Technologies, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef ICL_ISER_H +#define ICL_ISER_H + +/* + * iSCSI Common Layer for RDMA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define ISER_DBG(X, ...) \ + do { \ + if (unlikely(iser_debug > 2)) \ + printf("DEBUG: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } while (0) + +#define ISER_INFO(X, ...) \ + do { \ + if (unlikely(iser_debug > 1)) \ + printf("INFO: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } while (0) + +#define ISER_WARN(X, ...) \ + do { \ + if (unlikely(iser_debug > 0)) { \ + printf("WARNING: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ + } while (0) + +#define ISER_ERR(X, ...) \ + printf("ERROR: %s: " X "\n", __func__, ## __VA_ARGS__) + +#define ISER_VER 0x10 +#define ISER_WSV 0x08 +#define ISER_RSV 0x04 + +#define ISER_FASTREG_LI_WRID 0xffffffffffffffffULL +#define ISER_BEACON_WRID 0xfffffffffffffffeULL + +#define SHIFT_4K 12 +#define SIZE_4K (1ULL << SHIFT_4K) +#define MASK_4K (~(SIZE_4K-1)) + +/* support up to 512KB in one RDMA */ +#define ISCSI_ISER_SG_TABLESIZE (0x80000 >> SHIFT_4K) +#define ISER_DEF_XMIT_CMDS_MAX 256 + +/* the max RX (recv) WR supported by the iSER QP is defined by * + * max_recv_wr = commands_max + recv_beacon */ +#define ISER_QP_MAX_RECV_DTOS (ISER_DEF_XMIT_CMDS_MAX + 1) +#define ISER_MIN_POSTED_RX (ISER_DEF_XMIT_CMDS_MAX >> 2) + +/* QP settings */ +/* Maximal bounds on received asynchronous PDUs */ +#define ISER_MAX_RX_MISC_PDUS 4 /* NOOP_IN(2) , ASYNC_EVENT(2) */ +#define ISER_MAX_TX_MISC_PDUS 6 /* NOOP_OUT(2), TEXT(1), SCSI_TMFUNC(2), LOGOUT(1) */ + +/* the max TX (send) WR supported by the iSER QP is defined by * + * max_send_wr = T * (1 + D) + C ; D is how many inflight dataouts we expect * + * to have at max for SCSI command. The tx posting & completion handling code * + * supports -EAGAIN scheme where tx is suspended till the QP has room for more * + * send WR. D=8 comes from 64K/8K */ + +#define ISER_INFLIGHT_DATAOUTS 8 + +/* the send_beacon increase the max_send_wr by 1 */ +#define ISER_QP_MAX_REQ_DTOS (ISER_DEF_XMIT_CMDS_MAX * \ + (1 + ISER_INFLIGHT_DATAOUTS) + \ + ISER_MAX_TX_MISC_PDUS + \ + ISER_MAX_RX_MISC_PDUS + 1) + +#define ISER_GET_MAX_XMIT_CMDS(send_wr) ((send_wr \ + - ISER_MAX_TX_MISC_PDUS \ + - ISER_MAX_RX_MISC_PDUS - 1) / \ + (1 + ISER_INFLIGHT_DATAOUTS)) + +#define ISER_WC_BATCH_COUNT 16 +#define ISER_SIGNAL_CMD_COUNT 32 + +/* Maximal QP's recommended per CQ. In case we use more QP's per CQ we might * + * encounter a CQ overrun state. */ +#define ISCSI_ISER_MAX_CONN 8 +#define ISER_MAX_RX_LEN (ISER_QP_MAX_RECV_DTOS * ISCSI_ISER_MAX_CONN) +#define ISER_MAX_TX_LEN (ISER_QP_MAX_REQ_DTOS * ISCSI_ISER_MAX_CONN) +#define ISER_MAX_CQ_LEN (ISER_MAX_RX_LEN + ISER_MAX_TX_LEN + \ + ISCSI_ISER_MAX_CONN) + +#define ISER_ZBVA_NOT_SUPPORTED 0x80 +#define ISER_SEND_W_INV_NOT_SUPPORTED 0x40 + +#define icl_to_iser_conn(ic) \ + container_of(ic, struct iser_conn, icl_conn) +#define icl_to_iser_pdu(ip) \ + container_of(ip, struct icl_iser_pdu, icl_pdu) + +/** + * struct iser_hdr - iSER header + * + * @flags: flags support (zbva, remote_inv) + * @rsvd: reserved + * @write_stag: write rkey + * @write_va: write virtual address + * @reaf_stag: read rkey + * @read_va: read virtual address + */ +struct iser_hdr { + u8 flags; + u8 rsvd[3]; + __be32 write_stag; + __be64 write_va; + __be32 read_stag; + __be64 read_va; +} __attribute__((packed)); + +struct iser_cm_hdr { + u8 flags; + u8 rsvd[3]; +} __packed; + +/* Constant PDU lengths calculations */ +#define ISER_HEADERS_LEN (sizeof(struct iser_hdr) + ISCSI_BHS_SIZE) + +#define ISER_RECV_DATA_SEG_LEN 128 +#define ISER_RX_PAYLOAD_SIZE (ISER_HEADERS_LEN + ISER_RECV_DATA_SEG_LEN) + +#define ISER_RX_LOGIN_SIZE (ISER_HEADERS_LEN + ISCSI_DEF_MAX_RECV_SEG_LEN) + +enum iser_conn_state { + ISER_CONN_INIT, /* descriptor allocd, no conn */ + ISER_CONN_PENDING, /* in the process of being established */ + ISER_CONN_UP, /* up and running */ + ISER_CONN_TERMINATING, /* in the process of being terminated */ + ISER_CONN_DOWN, /* shut down */ + ISER_CONN_STATES_NUM +}; + +enum iser_task_status { + ISER_TASK_STATUS_INIT = 0, + ISER_TASK_STATUS_STARTED, + ISER_TASK_STATUS_COMPLETED +}; + +enum iser_data_dir { + ISER_DIR_IN = 0, /* to initiator */ + ISER_DIR_OUT, /* from initiator */ + ISER_DIRS_NUM +}; + +/** + * struct iser_mem_reg - iSER memory registration info + * + * @sge: memory region sg element + * @rkey: memory region remote key + * @mem_h: pointer to registration context (FMR/Fastreg) + */ +struct iser_mem_reg { + struct ib_sge sge; + u32 rkey; + void *mem_h; +}; + +enum iser_desc_type { + ISCSI_TX_CONTROL , + ISCSI_TX_SCSI_COMMAND, + ISCSI_TX_DATAOUT +}; + +/** + * struct iser_data_buf - iSER data buffer + * + * @sg: pointer to the sg list + * @size: num entries of this sg + * @data_len: total beffer byte len + * @dma_nents: returned by dma_map_sg + * @copy_buf: allocated copy buf for SGs unaligned + * for rdma which are copied + * @orig_sg: pointer to the original sg list (in case + * we used a copy) + * @sg_single: SG-ified clone of a non SG SC or + * unaligned SG + */ +struct iser_data_buf { + struct scatterlist sgl[ISCSI_ISER_SG_TABLESIZE]; + void *sg; + unsigned int size; + unsigned long data_len; + unsigned int dma_nents; + char *copy_buf; + struct scatterlist *orig_sg; + struct scatterlist sg_single; + }; + +/* fwd declarations */ +struct iser_conn; +struct ib_conn; +struct iser_device; + +/** + * struct iser_tx_desc - iSER TX descriptor (for send wr_id) + * + * @iser_header: iser header + * @iscsi_header: iscsi header (bhs) + * @type: command/control/dataout + * @dma_addr: header buffer dma_address + * @tx_sg: sg[0] points to iser/iscsi headers + * sg[1] optionally points to either of immediate data + * unsolicited data-out or control + * @num_sge: number sges used on this TX task + * @mapped: indicates if the descriptor is dma mapped + */ +struct iser_tx_desc { + struct iser_hdr iser_header; + struct iscsi_bhs iscsi_header __attribute__((packed)); + enum iser_desc_type type; + u64 dma_addr; + struct ib_sge tx_sg[2]; + int num_sge; + bool mapped; +}; + +#define ISER_RX_PAD_SIZE (256 - (ISER_RX_PAYLOAD_SIZE + \ + sizeof(u64) + sizeof(struct ib_sge))) +/** + * struct iser_rx_desc - iSER RX descriptor (for recv wr_id) + * + * @iser_header: iser header + * @iscsi_header: iscsi header + * @data: received data segment + * @dma_addr: receive buffer dma address + * @rx_sg: ib_sge of receive buffer + * @pad: for sense data TODO: Modify to maximum sense length supported + */ +struct iser_rx_desc { + struct iser_hdr iser_header; + struct iscsi_bhs iscsi_header; + char data[ISER_RECV_DATA_SEG_LEN]; + u64 dma_addr; + struct ib_sge rx_sg; + char pad[ISER_RX_PAD_SIZE]; +} __attribute__((packed)); + +struct icl_iser_pdu { + struct icl_pdu icl_pdu; + struct iser_tx_desc desc; + struct iser_conn *iser_conn; + enum iser_task_status status; + struct ccb_scsiio *csio; + int command_sent; + int dir[ISER_DIRS_NUM]; + struct iser_mem_reg rdma_reg[ISER_DIRS_NUM]; + struct iser_data_buf data[ISER_DIRS_NUM]; +}; + +/** + * struct iser_comp - iSER completion context + * + * @device: pointer to device handle + * @cq: completion queue + * @wcs: work completion array + * @tq: taskqueue handle + * @task: task to run task_fn + * @active_qps: Number of active QPs attached + * to completion context + */ +struct iser_comp { + struct iser_device *device; + struct ib_cq *cq; + struct ib_wc wcs[ISER_WC_BATCH_COUNT]; + struct taskqueue *tq; + struct task task; + int active_qps; +}; + +/** + * struct iser_device - iSER device handle + * + * @ib_device: RDMA device + * @pd: Protection Domain for this device + * @dev_attr: Device attributes container + * @mr: Global DMA memory region + * @event_handler: IB events handle routine + * @ig_list: entry in devices list + * @refcount: Reference counter, dominated by open iser connections + * @comps_used: Number of completion contexts used, Min between online + * cpus and device max completion vectors + * @comps: Dinamically allocated array of completion handlers + */ +struct iser_device { + struct ib_device *ib_device; + struct ib_pd *pd; + struct ib_device_attr dev_attr; + struct ib_mr *mr; + struct ib_event_handler event_handler; + struct list_head ig_list; + int refcount; + int comps_used; + struct iser_comp *comps; +}; + +/** + * struct iser_reg_resources - Fast registration recources + * + * @mr: memory region + * @frpl: fast reg page list + * @mr_valid: is mr valid indicator + */ +struct iser_reg_resources { + struct ib_mr *mr; + struct ib_fast_reg_page_list *frpl; + u8 mr_valid:1; +}; + +/** + * struct fast_reg_descriptor - Fast registration descriptor + * + * @list: entry in connection fastreg pool + * @rsc: data buffer registration resources + */ +struct fast_reg_descriptor { + struct list_head list; + struct iser_reg_resources rsc; +}; + + +/** + * struct iser_beacon - beacon to signal all flush errors were drained + * + * @send: send wr + * @recv: recv wr + * @flush_lock: protects flush_cv + * @flush_cv: condition variable for beacon flush + */ +struct iser_beacon { + union { + struct ib_send_wr send; + struct ib_recv_wr recv; + }; + struct mtx flush_lock; + struct cv flush_cv; +}; + +/** + * struct ib_conn - Infiniband related objects + * + * @cma_id: rdma_cm connection maneger handle + * @qp: Connection Queue-pair + * @device: reference to iser device + * @comp: iser completion context + */ +struct ib_conn { + struct rdma_cm_id *cma_id; + struct ib_qp *qp; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu May 26 09:53:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CE14B49DFF; Thu, 26 May 2016 09:53:26 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E08CB1F21; Thu, 26 May 2016 09:53:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4Q9rPJd073487; Thu, 26 May 2016 09:53:25 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4Q9rPDl073486; Thu, 26 May 2016 09:53:25 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605260953.u4Q9rPDl073486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 26 May 2016 09:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300724 - head/sys/dev/iser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 09:53:26 -0000 Author: trasz Date: Thu May 26 09:53:24 2016 New Revision: 300724 URL: https://svnweb.freebsd.org/changeset/base/300724 Log: The taskqueue_enqueue_fast() was removed in r296272. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iser/iser_verbs.c Modified: head/sys/dev/iser/iser_verbs.c ============================================================================== --- head/sys/dev/iser/iser_verbs.c Thu May 26 09:49:29 2016 (r300723) +++ head/sys/dev/iser/iser_verbs.c Thu May 26 09:53:24 2016 (r300724) @@ -185,7 +185,7 @@ iser_cq_callback(struct ib_cq *cq, void { struct iser_comp *comp = cq_context; - taskqueue_enqueue_fast(comp->tq, &comp->task); + taskqueue_enqueue(comp->tq, &comp->task); } /** From owner-svn-src-head@freebsd.org Thu May 26 10:03:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C6EEB4A14A; Thu, 26 May 2016 10:03:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D9B51483; Thu, 26 May 2016 10:03:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QA3MAr077093; Thu, 26 May 2016 10:03:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QA3MSX077092; Thu, 26 May 2016 10:03:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605261003.u4QA3MSX077092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 26 May 2016 10:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300725 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 10:03:23 -0000 Author: hselasky Date: Thu May 26 10:03:22 2016 New Revision: 300725 URL: https://svnweb.freebsd.org/changeset/base/300725 Log: Define ATOMIC_LONG_INIT() in the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu May 26 09:53:24 2016 (r300724) +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu May 26 10:03:22 2016 (r300725) @@ -35,6 +35,8 @@ #include #include +#define ATOMIC_LONG_INIT(x) { .counter = (x) } + typedef struct { volatile long counter; } atomic_long_t; From owner-svn-src-head@freebsd.org Thu May 26 10:03:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 213A2B4A18B; Thu, 26 May 2016 10:03:32 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E528B1701; Thu, 26 May 2016 10:03:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QA3Vte077143; Thu, 26 May 2016 10:03:31 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QA3VYH077142; Thu, 26 May 2016 10:03:31 GMT (envelope-from br@FreeBSD.org) Message-Id: <201605261003.u4QA3VYH077142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 26 May 2016 10:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300726 - head/sys/riscv/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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 10:03:32 -0000 Author: br Date: Thu May 26 10:03:30 2016 New Revision: 300726 URL: https://svnweb.freebsd.org/changeset/base/300726 Log: Increase the size and alignment of the setjmp buffer. This is required for future CPU extentions. Reviewed by: brooks Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/riscv/include/setjmp.h Modified: head/sys/riscv/include/setjmp.h ============================================================================== --- head/sys/riscv/include/setjmp.h Thu May 26 10:03:22 2016 (r300725) +++ head/sys/riscv/include/setjmp.h Thu May 26 10:03:30 2016 (r300726) @@ -39,7 +39,7 @@ #include -#define _JBLEN 32 /* sp, ra, [f]s0-11, magic val, sigmask */ +#define _JBLEN 63 /* sp, ra, [f]s0-11, magic val, sigmask */ #define _JB_SIGMASK 21 #ifdef __ASSEMBLER__ @@ -54,10 +54,10 @@ * internally to avoid some run-time errors for mismatches. */ #if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE -typedef struct _sigjmp_buf { long _sjb[_JBLEN + 1]; } sigjmp_buf[1]; +typedef struct _sigjmp_buf { long _sjb[_JBLEN + 1] __aligned(16); } sigjmp_buf[1]; #endif -typedef struct _jmp_buf { long _jb[_JBLEN + 1]; } jmp_buf[1]; +typedef struct _jmp_buf { long _jb[_JBLEN + 1] __aligned(16); } jmp_buf[1]; #endif /* __ASSEMBLER__ */ #endif /* !_MACHINE_SETJMP_H_ */ From owner-svn-src-head@freebsd.org Thu May 26 10:30:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5408B4A8F6; Thu, 26 May 2016 10:30:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78CC612E9; Thu, 26 May 2016 10:30:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QAU3Qr084803; Thu, 26 May 2016 10:30:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QAU3KH084799; Thu, 26 May 2016 10:30:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605261030.u4QAU3KH084799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 26 May 2016 10:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300727 - head/sys/dev/iser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 10:30:04 -0000 Author: trasz Date: Thu May 26 10:30:03 2016 New Revision: 300727 URL: https://svnweb.freebsd.org/changeset/base/300727 Log: Make iser(4) buildable again by adjusting it for the recent changes in ICL interface. - the ordering of parameters to icl_conn_task_setup is different, so that the "cookie" is last. - the icl_conn_connected() method is gone, replaced by much simpler mechanism. I'd rather keep the ICL interface as small as possible. - I don't really like the s/offload/driver/g. The "tcp" is not a driver; "iser" is not really a driver either. I'd prefer to leave it as it is. - the check for ic_session_type_discovery() in iser_conn_handoff() is gone, as handoff cannot happen for discovery sessions. - ic_session_login_phase() and ic_session_type_discovery() are gone. If you had your handoff method called - you're no longer in either of those. - the way maxtags is passed is different; now it's simply ic->ic_maxtags. It's cleaner, and the old way would cause weird things to happen if fail_on_disconnection=1 and the user changed the maxtags sysctl before reconnecting (basically the CAM idea of maxtags would be different from iSER one). - icl_hba_misc() is gone; declare support for PIM_UNMAPPED by setting ic->ic_unmapped flag. - the way we find the "iser" ICL module is rewritten - we have a flag for icl_register() that says if the module is iSER-capable or not. - icl_conn_release() is gone; iser_conn_release() is called from iser_conn_free() (no functional change in this case) and at the beginning of icl_conn_connect(), to handle reconnection. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iser/icl_iser.c head/sys/dev/iser/icl_iser.h head/sys/dev/iser/iser_initiator.c Modified: head/sys/dev/iser/icl_iser.c ============================================================================== --- head/sys/dev/iser/icl_iser.c Thu May 26 10:03:30 2016 (r300726) +++ head/sys/dev/iser/icl_iser.c Thu May 26 10:30:03 2016 (r300727) @@ -37,6 +37,8 @@ static uma_zone_t icl_pdu_zone; static volatile u_int icl_iser_ncons; struct iser_global ig; +static void iser_conn_release(struct icl_conn *ic); + static icl_conn_new_pdu_t iser_conn_new_pdu; static icl_conn_pdu_free_t iser_conn_pdu_free; static icl_conn_pdu_data_segment_length_t iser_conn_pdu_data_segment_length; @@ -45,9 +47,7 @@ static icl_conn_pdu_queue_t iser_conn_pd static icl_conn_handoff_t iser_conn_handoff; static icl_conn_free_t iser_conn_free; static icl_conn_close_t iser_conn_close; -static icl_conn_release_t iser_conn_release; static icl_conn_connect_t iser_conn_connect; -static icl_conn_connected_t iser_conn_connected; static icl_conn_task_setup_t iser_conn_task_setup; static icl_conn_task_done_t iser_conn_task_done; static icl_conn_pdu_get_data_t iser_conn_pdu_get_data; @@ -61,9 +61,7 @@ static kobj_method_t icl_iser_methods[] KOBJMETHOD(icl_conn_handoff, iser_conn_handoff), KOBJMETHOD(icl_conn_free, iser_conn_free), KOBJMETHOD(icl_conn_close, iser_conn_close), - KOBJMETHOD(icl_conn_release, iser_conn_release), KOBJMETHOD(icl_conn_connect, iser_conn_connect), - KOBJMETHOD(icl_conn_connected, iser_conn_connected), KOBJMETHOD(icl_conn_task_setup, iser_conn_task_setup), KOBJMETHOD(icl_conn_task_done, iser_conn_task_done), KOBJMETHOD(icl_conn_pdu_get_data, iser_conn_pdu_get_data), @@ -263,8 +261,9 @@ iser_new_conn(const char *name, struct m ic = &iser_conn->icl_conn; ic->ic_lock = lock; ic->ic_name = name; - ic->ic_driver = strdup("iser", M_TEMP); + ic->ic_offload = strdup("iser", M_TEMP); ic->ic_iser = true; + ic->ic_unmapped = true; return (ic); } @@ -274,6 +273,7 @@ iser_conn_free(struct icl_conn *ic) { struct iser_conn *iser_conn = icl_to_iser_conn(ic); + iser_conn_release(ic); cv_destroy(&iser_conn->ib_conn.beacon.flush_cv); mtx_destroy(&iser_conn->ib_conn.beacon.flush_lock); sx_destroy(&iser_conn->state_mutex); @@ -283,7 +283,7 @@ iser_conn_free(struct icl_conn *ic) } int -iser_conn_handoff(struct icl_conn *ic, int cmds_max) +iser_conn_handoff(struct icl_conn *ic, int fd) { struct iser_conn *iser_conn = icl_to_iser_conn(ic); int error = 0; @@ -296,14 +296,7 @@ iser_conn_handoff(struct icl_conn *ic, i goto out; } - /* - * In discovery session no need to allocate rx desc and posting recv - * work request - */ - if (ic->ic_session_type_discovery(ic)) - goto out; - - error = iser_alloc_rx_descriptors(iser_conn, cmds_max); + error = iser_alloc_rx_descriptors(iser_conn, ic->ic_maxtags); if (error) goto out; @@ -311,6 +304,8 @@ iser_conn_handoff(struct icl_conn *ic, i if (error) goto post_error; + iser_conn->handoff_done = true; + sx_xunlock(&iser_conn->state_mutex); return (error); @@ -325,7 +320,7 @@ out: /** * Frees all conn objects */ -void +static void iser_conn_release(struct icl_conn *ic) { struct iser_conn *iser_conn = icl_to_iser_conn(ic); @@ -388,9 +383,12 @@ iser_conn_connect(struct icl_conn *ic, i struct ib_conn *ib_conn = &iser_conn->ib_conn; int err = 0; + iser_conn_release(ic); + sx_xlock(&iser_conn->state_mutex); /* the device is known only --after-- address resolution */ ib_conn->device = NULL; + iser_conn->handoff_done = false; iser_conn->state = ISER_CONN_PENDING; @@ -437,21 +435,10 @@ addr_failure: return (err); } -/** - * Called with session spinlock held. - * No need to lock state mutex on an advisory check. - **/ -bool -iser_conn_connected(struct icl_conn *ic) -{ - struct iser_conn *iser_conn = icl_to_iser_conn(ic); - - return (iser_conn->state == ISER_CONN_UP); -} - int -iser_conn_task_setup(struct icl_conn *ic, struct ccb_scsiio *csio, - uint32_t *task_tagp, void **prvp, struct icl_pdu *ip) +iser_conn_task_setup(struct icl_conn *ic, struct icl_pdu *ip, + struct ccb_scsiio *csio, + uint32_t *task_tagp, void **prvp) { struct icl_iser_pdu *iser_pdu = icl_to_iser_pdu(ip); @@ -492,12 +479,6 @@ iser_conn_task_done(struct icl_conn *ic, iser_pdu_free(ic, ip); } -static u_int32_t -iser_hba_misc() -{ - return (PIM_UNMAPPED); -} - static int iser_limits(size_t *limitp) { @@ -520,7 +501,7 @@ icl_iser_load(void) refcount_init(&icl_iser_ncons, 0); - error = icl_register("iser", 0, iser_limits, iser_new_conn, iser_hba_misc); + error = icl_register("iser", true, 0, iser_limits, iser_new_conn); KASSERT(error == 0, ("failed to register iser")); memset(&ig, 0, sizeof(struct iser_global)); @@ -547,7 +528,7 @@ icl_iser_unload(void) mtx_destroy(&ig.connlist_mutex); sx_destroy(&ig.device_list_mutex); - icl_unregister("iser"); + icl_unregister("iser", true); uma_zdestroy(icl_pdu_zone); @@ -575,8 +556,6 @@ moduledata_t icl_iser_data = { DECLARE_MODULE(icl_iser, icl_iser_data, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); MODULE_DEPEND(icl_iser, icl, 1, 1, 1); -MODULE_DEPEND(icl_iser, iscsi, 1, 1, 1); MODULE_DEPEND(icl_iser, ibcore, 1, 1, 1); MODULE_DEPEND(icl_iser, linuxkpi, 1, 1, 1); MODULE_VERSION(icl_iser, 1); - Modified: head/sys/dev/iser/icl_iser.h ============================================================================== --- head/sys/dev/iser/icl_iser.h Thu May 26 10:03:30 2016 (r300726) +++ head/sys/dev/iser/icl_iser.h Thu May 26 10:30:03 2016 (r300727) @@ -148,6 +148,9 @@ #define ISER_ZBVA_NOT_SUPPORTED 0x80 #define ISER_SEND_W_INV_NOT_SUPPORTED 0x40 +#define ISCSI_DEF_MAX_RECV_SEG_LEN 8192 +#define ISCSI_OPCODE_MASK 0x3f + #define icl_to_iser_conn(ic) \ container_of(ic, struct iser_conn, icl_conn) #define icl_to_iser_pdu(ip) \ @@ -445,6 +448,7 @@ struct iser_conn { unsigned int rx_desc_head; struct iser_rx_desc *rx_descs; u32 num_rx_descs; + bool handoff_done; }; /** Modified: head/sys/dev/iser/iser_initiator.c ============================================================================== --- head/sys/dev/iser/iser_initiator.c Thu May 26 10:03:30 2016 (r300726) +++ head/sys/dev/iser/iser_initiator.c Thu May 26 10:30:03 2016 (r300727) @@ -415,7 +415,6 @@ iser_send_control(struct iser_conn *iser struct iser_tx_desc *mdesc; struct iser_device *device; size_t datalen = iser_pdu->icl_pdu.ip_data_len; - struct icl_conn *ic = &iser_conn->icl_conn; int err; mdesc = &iser_pdu->desc; @@ -442,8 +441,8 @@ iser_send_control(struct iser_conn *iser mdesc->num_sge = 2; } - /* For discovery session we re-use the login buffer */ - if (ic->ic_session_login_phase(ic) || ic->ic_session_type_discovery(ic)) { + /* For login phase and discovery session we re-use the login buffer */ + if (!iser_conn->handoff_done) { err = iser_post_recvl(iser_conn); if (err) goto send_control_error; From owner-svn-src-head@freebsd.org Thu May 26 10:50:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7A80B4AE2A; Thu, 26 May 2016 10:50:40 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A25F1E4E; Thu, 26 May 2016 10:50:40 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QAodTa092303; Thu, 26 May 2016 10:50:39 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QAodIb092300; Thu, 26 May 2016 10:50:39 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605261050.u4QAodIb092300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 26 May 2016 10:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300728 - in head/sys: arm/allwinner 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 10:50:40 -0000 Author: jmcneill Date: Thu May 26 10:50:39 2016 New Revision: 300728 URL: https://svnweb.freebsd.org/changeset/base/300728 Log: Enable USB PHY regulators when requested by the host controller driver. Previously the USB PHY driver would enable all regulators at attach time. This prevented boards from booting when powered by the USB OTG port, as it didn't take VBUS presence into consideration. Modified: head/sys/arm/allwinner/a10_ehci.c head/sys/arm/allwinner/aw_usbphy.c head/sys/dev/usb/controller/generic_ohci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Thu May 26 10:30:03 2016 (r300727) +++ head/sys/arm/allwinner/a10_ehci.c Thu May 26 10:50:39 2016 (r300728) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define EHCI_HC_DEVSTR "Allwinner Integrated USB 2.0 controller" @@ -94,6 +95,7 @@ struct aw_ehci_softc { ehci_softc_t sc; clk_t clk; hwreset_t rst; + phy_t phy; }; struct aw_ehci_conf { @@ -225,6 +227,18 @@ a10_ehci_attach(device_t self) goto error; } + /* Enable USB PHY */ + err = phy_get_by_ofw_name(self, "usb", &aw_sc->phy); + if (err != 0) { + device_printf(self, "Could not get phy\n"); + goto error; + } + err = phy_enable(self, aw_sc->phy); + if (err != 0) { + device_printf(self, "Could not enable phy\n"); + goto error; + } + /* Enable passby */ reg_value = A10_READ_4(sc, SW_USB_PMU_IRQ_ENABLE); reg_value |= SW_AHB_INCR8; /* AHB INCR8 enable */ Modified: head/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- head/sys/arm/allwinner/aw_usbphy.c Thu May 26 10:30:03 2016 (r300727) +++ head/sys/arm/allwinner/aw_usbphy.c Thu May 26 10:50:39 2016 (r300728) @@ -43,12 +43,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include -#define USBPHY_NUMOFF 3 +#include "phy_if.h" + +#define USBPHY_NPHYS 4 static struct ofw_compat_data compat_data[] = { { "allwinner,sun4i-a10-usb-phy", 1 }, @@ -60,15 +64,28 @@ static struct ofw_compat_data compat_dat { NULL, 0 } }; +struct awusbphy_softc { + regulator_t reg[USBPHY_NPHYS]; + gpio_pin_t id_det_pin; + int id_det_valid; + gpio_pin_t vbus_det_pin; + int vbus_det_valid; +}; + static int awusbphy_init(device_t dev) { + struct awusbphy_softc *sc; + phandle_t node; char pname[20]; int error, off; regulator_t reg; hwreset_t rst; clk_t clk; + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + /* Enable clocks */ for (off = 0; clk_get_by_ofw_index(dev, off, &clk) == 0; off++) { error = clk_enable(clk); @@ -89,17 +106,80 @@ awusbphy_init(device_t dev) } } - /* Enable regulator(s) */ - for (off = 0; off < USBPHY_NUMOFF; off++) { + /* Get regulators */ + for (off = 0; off < USBPHY_NPHYS; off++) { snprintf(pname, sizeof(pname), "usb%d_vbus-supply", off); - if (regulator_get_by_ofw_property(dev, pname, ®) != 0) - continue; - error = regulator_enable(reg); - if (error != 0) { - device_printf(dev, "couldn't enable regulator %s\n", - pname); + if (regulator_get_by_ofw_property(dev, pname, ®) == 0) + sc->reg[off] = reg; + } + + /* Get GPIOs */ + error = gpio_pin_get_by_ofw_property(dev, node, "usb0_id_det-gpios", + &sc->id_det_pin); + if (error == 0) + sc->id_det_valid = 1; + error = gpio_pin_get_by_ofw_property(dev, node, "usb0_vbus_det-gpios", + &sc->vbus_det_pin); + if (error == 0) + sc->vbus_det_valid = 1; + + return (0); +} + +static int +awusbphy_vbus_detect(device_t dev, int *val) +{ + struct awusbphy_softc *sc; + bool active; + int error; + + sc = device_get_softc(dev); + + if (sc->vbus_det_valid) { + error = gpio_pin_is_active(sc->vbus_det_pin, &active); + if (error != 0) return (error); - } + *val = active; + return (0); + } + + *val = 1; + return (0); +} + +static int +awusbphy_phy_enable(device_t dev, int phy, bool enable) +{ + struct awusbphy_softc *sc; + regulator_t reg; + int error, vbus_det; + + if (phy < 0 || phy >= USBPHY_NPHYS) + return (ERANGE); + + sc = device_get_softc(dev); + + /* Regulators are optional. If not found, return success. */ + reg = sc->reg[phy]; + if (reg == NULL) + return (0); + + if (enable) { + /* If an external vbus is detected, do not enable phy 0 */ + if (phy == 0) { + error = awusbphy_vbus_detect(dev, &vbus_det); + if (error == 0 && vbus_det == 1) + return (0); + } else + error = 0; + if (error == 0) + error = regulator_enable(reg); + } else + error = regulator_disable(reg); + if (error != 0) { + device_printf(dev, "couldn't %s regulator for phy %d\n", + enable ? "enable" : "disable", phy); + return (error); } return (0); @@ -124,9 +204,13 @@ awusbphy_attach(device_t dev) int error; error = awusbphy_init(dev); - if (error) + if (error) { device_printf(dev, "failed to initialize USB PHY, error %d\n", error); + return (error); + } + + phy_register_provider(dev); return (error); } @@ -136,16 +220,20 @@ static device_method_t awusbphy_methods[ DEVMETHOD(device_probe, awusbphy_probe), DEVMETHOD(device_attach, awusbphy_attach), + /* PHY interface */ + DEVMETHOD(phy_enable, awusbphy_phy_enable), + DEVMETHOD_END }; static driver_t awusbphy_driver = { "awusbphy", awusbphy_methods, - 0, + sizeof(struct awusbphy_softc) }; static devclass_t awusbphy_devclass; -DRIVER_MODULE(awusbphy, simplebus, awusbphy_driver, awusbphy_devclass, 0, 0); +EARLY_DRIVER_MODULE(awusbphy, simplebus, awusbphy_driver, awusbphy_devclass, + 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(awusbphy, 1); Modified: head/sys/dev/usb/controller/generic_ohci.c ============================================================================== --- head/sys/dev/usb/controller/generic_ohci.c Thu May 26 10:30:03 2016 (r300727) +++ head/sys/dev/usb/controller/generic_ohci.c Thu May 26 10:50:39 2016 (r300728) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #ifdef EXT_RESOURCES #include #include +#include #endif #include "generic_usb_if.h" @@ -76,6 +77,7 @@ struct generic_ohci_softc { #ifdef EXT_RESOURCES hwreset_t rst; + phy_t phy; TAILQ_HEAD(, clk_list) clk_list; #endif }; @@ -180,6 +182,15 @@ generic_ohci_attach(device_t dev) goto error; } } + + /* Enable phy */ + if (phy_get_by_ofw_name(dev, "usb", &sc->phy) == 0) { + err = phy_enable(dev, sc->phy); + if (err != 0) { + device_printf(dev, "Could not enable phy\n"); + goto error; + } + } #endif if (GENERIC_USB_INIT(dev) != 0) { @@ -253,6 +264,14 @@ generic_ohci_detach(device_t dev) usb_bus_mem_free_all(&sc->ohci_sc.sc_bus, &ohci_iterate_hw_softc); #ifdef EXT_RESOURCES + /* Disable phy */ + if (sc->phy) { + err = phy_disable(dev, sc->phy); + if (err != 0) + device_printf(dev, "Could not disable phy\n"); + phy_release(sc->phy); + } + /* Disable clock */ TAILQ_FOREACH_SAFE(clk, &sc->clk_list, next, clk_tmp) { err = clk_disable(clk->clk); From owner-svn-src-head@freebsd.org Thu May 26 10:55:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F9B6B4AFD6; Thu, 26 May 2016 10:55:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E13D1234; Thu, 26 May 2016 10:55:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QAtJSR095689; Thu, 26 May 2016 10:55:19 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QAtJHU095688; Thu, 26 May 2016 10:55:19 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261055.u4QAtJHU095688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 10:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300729 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 10:55:20 -0000 Author: avos Date: Thu May 26 10:55:19 2016 New Revision: 300729 URL: https://svnweb.freebsd.org/changeset/base/300729 Log: wpi: refresh manpage. Reflect all recent changes in the manpage: - add adhoc-demo and hostap into list of supported modes; add few examples for them; - mention encryption/decryption offload for CCMP cipher; - extend list of driver messages in the DIAGNOSTICS; - document hostap mode limitations / powersave instability in the CAVEATS section. Differential Revision: https://reviews.freebsd.org/D5149 Modified: head/share/man/man4/wpi.4 Modified: head/share/man/man4/wpi.4 ============================================================================== --- head/share/man/man4/wpi.4 Thu May 26 10:50:39 2016 (r300728) +++ head/share/man/man4/wpi.4 Thu May 26 10:55:19 2016 (r300729) @@ -1,6 +1,8 @@ .\" Copyright (c) 2004-2007 .\" Damien Bergamini . All rights reserved. .\" Benjamin Close . All rights reserved. +.\" Copyright (c) 2016 Andriy Voskoboinyk +.\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -26,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 15, 2015 +.Dd January 31, 2016 .Dt WPI 4 .Os .Sh NAME @@ -57,20 +59,39 @@ The driver provides support for the .Tn Intel 3945ABG Wireless network adapter. -.Nm -supports +The driver supports .Cm station , .Cm adhoc , +.Cm adhoc-demo , +.Cm hostap , and .Cm monitor mode operation. Only one virtual interface may be configured at any time. -For more information on configuring this device, see -.Xr ifconfig 8 . +.Pp +The +.Nm +driver can be configured to use +Wired Equivalent Privacy (WEP) or +Wi-Fi Protected Access (WPA-PSK and WPA2-PSK). +WPA is the de facto encryption standard for wireless networks. +It is strongly recommended that WEP +not be used as the sole mechanism +to secure wireless communication, +due to serious weaknesses in it. +The +.Nm +driver offloads both encryption and decryption of data frames to the +hardware for the CCMP cipher. .Pp This driver requires the firmware built with the .Nm wpifw module to work. +.Pp +The +.Nm +driver can be configured at runtime with +.Xr ifconfig 8 . .Sh FILES .Bl -tag -width ".Pa /usr/share/doc/legal/intel_wpi.LICENSE" -compact .It Pa /usr/share/doc/legal/intel_wpi.LICENSE @@ -95,10 +116,26 @@ ifconfig wlan0 create wlandev wpi0 ssid wepmode on wepkey 0x1234567890 weptxkey 1 up .Ed .Pp -Join a specific BSS network with 128-bit WEP encryption: +Create an IBSS network with 128-bit WEP encryption on the channel 4: .Bd -literal -offset indent ifconfig wlan0 create wlandev wpi0 wlanmode adhoc ssid my_net \e - wepmode on wepkey 0x01020304050607080910111213 weptxkey 1 + wepmode on wepkey 0x01020304050607080910111213 weptxkey 1 \e + channel 4 +.Ed +.Pp +Join/create an 802.11b IBSS network with network name +.Dq Li my_net : +.Bd -literal -offset indent +ifconfig wlan0 create wlandev wpi0 wlanmode adhoc +ifconfig wlan0 inet 192.168.0.22 netmask 0xffffff00 ssid my_net \e + mode 11b +.Ed +.Pp +Create an 802.11g host-based access point: +.Bd -literal -offset indent +ifconfig wlan0 create wlandev wpi0 wlanmode hostap +ifconfig wlan0 inet 192.168.0.10 netmask 0xffffff00 ssid my_ap \e + mode 11g .Ed .Sh DIAGNOSTICS .Bl -diag @@ -109,20 +146,53 @@ subsystem. Verify the .Xr wpifw firmware module is installed. +.It "wpi%d: %s: timeout waiting for adapter to initialize, error %d" +The onboard microcontroller failed to initialize in time. +This should not happen. +.It "wpi%d: %s: could not load boot firmware" +An attempt to upload the boot firmware image to the onboard microcontroller +failed. +This should not happen. +.It "wpi%d: device timeout" +A frame dispatched to the hardware for transmission did not complete in time. +The driver will reset the hardware and continue. +This should not happen. +.It "wpi%d: scan timeout" +Firmware scan command response was not received in time. +The driver will reset the hardware and continue. +This should not happen. .It "wpi%d: fatal firmware error" -An unknown error has occurred in the uploaded firmware, you may have to -unload/reload the driver to continue. -.It "wpi%d: Radio transmitter is switched off" +The onboard microcontroller crashed for some reason. +The driver will reset the hardware and continue. +This should not happen. +.It "wpi%d: RF switch: radio disabled" The hardware switch controlling the radio is currently turned off. Data transmission is not possible in this state. +.It "wpi%d: can't map mem space" +The driver was unable to map the device registers into the host address space. +This should not happen. +.It "wpi%d: can't map interrupt" +The driver was unable to allocate an IRQ for the device interrupt. +This should not happen. +.It "wpi%d: can't establish interrupt, error %d" +The driver was unable to install the device interrupt handler. +This should not happen. +.It "wpi%d: %s: bus_dmamap_load failed, error %d" +The driver was unable to map newly allocated mbuf to device +visible address space. +Contents of currently received frame will be lost. +This should not happen. .El .Sh SEE ALSO .Xr pci 4 , .Xr wlan 4 , +.Xr wlan_amrr 4 , .Xr wlan_ccmp 4 , .Xr wlan_tkip 4 , .Xr wlan_wep 4 , +.Xr wlan_xauth 4 , .Xr wpifw 4 , +.Xr hostapd 8 , .Xr ifconfig 8 , .Xr wpa_supplicant 8 .Sh AUTHORS @@ -138,7 +208,11 @@ ported .Nm to .Fx . -.Sh BUGS -Not all the error messages are documented here. -.Pp -Background scanning is not currently supported. +.Sh CAVEATS +Hostap mode is not directly supported by the device; +it is implemented through IBSS mode (as a result, DFS/passive +channels are not available in this mode). +.Pp +Powersave may be unstable on some networks (results in +occasional 'wpi%d: device timeout' messages); you can try +to disable it to improve device stability. From owner-svn-src-head@freebsd.org Thu May 26 11:10:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D6F1B4B50B; Thu, 26 May 2016 11:10:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FE771D97; Thu, 26 May 2016 11:10:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QBAW5x099645; Thu, 26 May 2016 11:10:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QBAW7W099643; Thu, 26 May 2016 11:10:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605261110.u4QBAW7W099643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 26 May 2016 11:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300731 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 11:10:33 -0000 Author: hselasky Date: Thu May 26 11:10:31 2016 New Revision: 300731 URL: https://svnweb.freebsd.org/changeset/base/300731 Log: Use optimised complexity safe sorting routine instead of the kernel's "qsort()". The kernel's "qsort()" routine can in worst case spend O(N*N) amount of comparisons before the input array is sorted. It can also recurse a significant amount of times using up the kernel's interrupt thread stack. The custom sorting routine takes advantage of that the sorting key is only 64 bits. Based on set and cleared bits in the sorting key it partitions the array until it is sorted. This process has a recursion limit of 64 times, due to the number of set and cleared bits which can occur. Compiled with -O2 the sorting routine was measured to use 64-bytes of stack. Multiplying this by 64 gives a maximum stack consumption of 4096 bytes for AMD64. The same applies to the execution time, that the array to be sorted will not be traversed more than 64 times. When serving roughly 80Gb/s with 80K TCP connections, the old method consisting of "qsort()" and "tcp_lro_mbuf_compare_header()" used 1.4% CPU, while the new "tcp_lro_sort()" used 1.1% for LRO related sorting as measured by Intel Vtune. The testing was done using a sysctl to toggle between "qsort()" and "tcp_lro_sort()". Differential Revision: https://reviews.freebsd.org/D6472 Sponsored by: Mellanox Technologies Tested by: Netflix Reviewed by: gallatin, rrs, sephe, transport Modified: head/sys/netinet/tcp_lro.c head/sys/netinet/tcp_lro.h Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Thu May 26 11:01:25 2016 (r300730) +++ head/sys/netinet/tcp_lro.c Thu May 26 11:10:31 2016 (r300731) @@ -111,9 +111,9 @@ tcp_lro_init_args(struct lro_ctrl *lc, s LIST_INIT(&lc->lro_active); /* compute size to allocate */ - size = (lro_mbufs * sizeof(struct mbuf *)) + + size = (lro_mbufs * sizeof(struct lro_mbuf_sort)) + (lro_entries * sizeof(*le)); - lc->lro_mbuf_data = (struct mbuf **) + lc->lro_mbuf_data = (struct lro_mbuf_sort *) malloc(size, M_LRO, M_NOWAIT | M_ZERO); /* check for out of memory */ @@ -149,7 +149,7 @@ tcp_lro_free(struct lro_ctrl *lc) /* free mbuf array, if any */ for (x = 0; x != lc->lro_mbuf_count; x++) - m_freem(lc->lro_mbuf_data[x]); + m_freem(lc->lro_mbuf_data[x].mb); lc->lro_mbuf_count = 0; /* free allocated memory, if any */ @@ -365,32 +365,102 @@ tcp_lro_flush(struct lro_ctrl *lc, struc LIST_INSERT_HEAD(&lc->lro_free, le, next); } -static int -tcp_lro_mbuf_compare_header(const void *ppa, const void *ppb) +#ifdef HAVE_INLINE_FLSLL +#define tcp_lro_msb_64(x) (1ULL << (flsll(x) - 1)) +#else +static inline uint64_t +tcp_lro_msb_64(uint64_t x) { - const struct mbuf *ma = *((const struct mbuf * const *)ppa); - const struct mbuf *mb = *((const struct mbuf * const *)ppb); - int ret; + x |= (x >> 1); + x |= (x >> 2); + x |= (x >> 4); + x |= (x >> 8); + x |= (x >> 16); + x |= (x >> 32); + return (x & ~(x >> 1)); +} +#endif - ret = M_HASHTYPE_GET(ma) - M_HASHTYPE_GET(mb); - if (ret != 0) - goto done; +/* + * The tcp_lro_sort() routine is comparable to qsort(), except it has + * a worst case complexity limit of O(MIN(N,64)*N), where N is the + * number of elements to sort and 64 is the number of sequence bits + * available. The algorithm is bit-slicing the 64-bit sequence number, + * sorting one bit at a time from the most significant bit until the + * least significant one, skipping the constant bits. + */ +static void +tcp_lro_sort(struct lro_mbuf_sort *parray, uint32_t size) +{ + struct lro_mbuf_sort temp; + uint64_t ones; + uint64_t zeros; + uint32_t x; + uint32_t y; + +repeat: + /* for small arrays bubble sort is faster */ + if (size <= 12) { + for (x = 0; x != size; x++) { + for (y = x + 1; y != size; y++) { + if (parray[x].seq > parray[y].seq) { + /* swap entries */ + temp = parray[x]; + parray[x] = parray[y]; + parray[y] = temp; + } + } + } + return; + } - if (ma->m_pkthdr.flowid > mb->m_pkthdr.flowid) - return (1); - else if (ma->m_pkthdr.flowid < mb->m_pkthdr.flowid) - return (-1); + /* compute sequence bits which are constant */ + ones = 0; + zeros = 0; + for (x = 0; x != size; x++) { + ones |= parray[x].seq; + zeros |= ~parray[x].seq; + } - ret = TCP_LRO_SEQUENCE(ma) - TCP_LRO_SEQUENCE(mb); -done: - return (ret); + /* compute bits which are not constant into "ones" */ + ones &= zeros; + if (ones == 0) + return; + + /* pick the most significant bit which is not constant */ + ones = tcp_lro_msb_64(ones); + + /* + * Move entries having cleared sequence bits to the beginning + * of the array: + */ + for (x = y = 0; y != size; y++) { + /* skip set bits */ + if (parray[y].seq & ones) + continue; + /* swap entries */ + temp = parray[x]; + parray[x] = parray[y]; + parray[y] = temp; + x++; + } + + KASSERT(x != 0 && x != size, ("Memory is corrupted\n")); + + /* sort zeros */ + tcp_lro_sort(parray, x); + + /* sort ones */ + parray += x; + size -= x; + goto repeat; } void tcp_lro_flush_all(struct lro_ctrl *lc) { - uint32_t hashtype; - uint32_t flowid; + uint64_t seq; + uint64_t nseq; unsigned x; /* check if no mbufs to flush */ @@ -398,30 +468,27 @@ tcp_lro_flush_all(struct lro_ctrl *lc) goto done; /* sort all mbufs according to stream */ - qsort(lc->lro_mbuf_data, lc->lro_mbuf_count, sizeof(struct mbuf *), - &tcp_lro_mbuf_compare_header); + tcp_lro_sort(lc->lro_mbuf_data, lc->lro_mbuf_count); /* input data into LRO engine, stream by stream */ - flowid = 0; - hashtype = M_HASHTYPE_NONE; + seq = 0; for (x = 0; x != lc->lro_mbuf_count; x++) { struct mbuf *mb; - mb = lc->lro_mbuf_data[x]; + /* get mbuf */ + mb = lc->lro_mbuf_data[x].mb; + + /* get sequence number, masking away the packet index */ + nseq = lc->lro_mbuf_data[x].seq & (-1ULL << 24); /* check for new stream */ - if (mb->m_pkthdr.flowid != flowid || - M_HASHTYPE_GET(mb) != hashtype) { - flowid = mb->m_pkthdr.flowid; - hashtype = M_HASHTYPE_GET(mb); + if (seq != nseq) { + seq = nseq; /* flush active streams */ tcp_lro_rx_done(lc); } -#ifdef TCP_LRO_RESET_SEQUENCE - /* reset sequence number */ - TCP_LRO_SEQUENCE(mb) = 0; -#endif + /* add packet to LRO engine */ if (tcp_lro_rx(lc, mb, 0) != 0) { /* input packet to network layer */ @@ -799,11 +866,14 @@ tcp_lro_queue_mbuf(struct lro_ctrl *lc, if (__predict_false(lc->lro_mbuf_count == lc->lro_mbuf_max)) tcp_lro_flush_all(lc); - /* store sequence number */ - TCP_LRO_SEQUENCE(mb) = lc->lro_mbuf_count; + /* create sequence number */ + lc->lro_mbuf_data[lc->lro_mbuf_count].seq = + (((uint64_t)M_HASHTYPE_GET(mb)) << 56) | + (((uint64_t)mb->m_pkthdr.flowid) << 24) | + ((uint64_t)lc->lro_mbuf_count); /* enter mbuf */ - lc->lro_mbuf_data[lc->lro_mbuf_count++] = mb; + lc->lro_mbuf_data[lc->lro_mbuf_count++].mb = mb; } /* end */ Modified: head/sys/netinet/tcp_lro.h ============================================================================== --- head/sys/netinet/tcp_lro.h Thu May 26 11:01:25 2016 (r300730) +++ head/sys/netinet/tcp_lro.h Thu May 26 11:10:31 2016 (r300731) @@ -38,9 +38,6 @@ #define TCP_LRO_ENTRIES 8 #endif -#define TCP_LRO_SEQUENCE(mb) \ - (mb)->m_pkthdr.PH_loc.thirtytwo[0] - struct lro_entry { LIST_ENTRY(lro_entry) next; struct mbuf *m_head; @@ -80,10 +77,15 @@ LIST_HEAD(lro_head, lro_entry); #define source_ip6 lesource.s_ip6 #define dest_ip6 ledest.d_ip6 +struct lro_mbuf_sort { + uint64_t seq; + struct mbuf *mb; +}; + /* NB: This is part of driver structs. */ struct lro_ctrl { struct ifnet *ifp; - struct mbuf **lro_mbuf_data; + struct lro_mbuf_sort *lro_mbuf_data; uint64_t lro_queued; uint64_t lro_flushed; uint64_t lro_bad_csum; From owner-svn-src-head@freebsd.org Thu May 26 11:12:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74120B4B796; Thu, 26 May 2016 11:12:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 371AA12D7; Thu, 26 May 2016 11:12:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QBCa8M003380; Thu, 26 May 2016 11:12:36 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QBCark003377; Thu, 26 May 2016 11:12:36 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261112.u4QBCark003377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 11:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300732 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 11:12:37 -0000 Author: avos Date: Thu May 26 11:12:36 2016 New Revision: 300732 URL: https://svnweb.freebsd.org/changeset/base/300732 Log: iwn: add watchdog for scanning. Restart device if scanning was not done in time. Tested by: david@catwhisker.org PR: 209198 Differential Revision: https://reviews.freebsd.org/D6176 Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Thu May 26 11:10:31 2016 (r300731) +++ head/sys/dev/iwn/if_iwn.c Thu May 26 11:12:36 2016 (r300732) @@ -235,6 +235,7 @@ static void iwn_xmit_task(void *arg0, in static int iwn_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); static int iwn_transmit(struct ieee80211com *, struct mbuf *); +static void iwn_scan_timeout(void *); static void iwn_watchdog(void *); static int iwn_ioctl(struct ieee80211com *, u_long , void *); static void iwn_parent(struct ieee80211com *); @@ -675,6 +676,7 @@ iwn_attach(device_t dev) iwn_radiotap_attach(sc); callout_init_mtx(&sc->calib_to, &sc->sc_mtx, 0); + callout_init_mtx(&sc->scan_timeout, &sc->sc_mtx, 0); callout_init_mtx(&sc->watchdog_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_radioon_task, 0, iwn_radio_on, sc); TASK_INIT(&sc->sc_radiooff_task, 0, iwn_radio_off, sc); @@ -1406,6 +1408,7 @@ iwn_detach(device_t dev) taskqueue_free(sc->sc_tq); callout_drain(&sc->watchdog_to); + callout_drain(&sc->scan_timeout); callout_drain(&sc->calib_to); ieee80211_ifdetach(&sc->sc_ic); } @@ -3937,6 +3940,7 @@ iwn_notif_intr(struct iwn_softc *sc) scan->nchan, scan->status, scan->chan); #endif sc->sc_is_scanning = 0; + callout_stop(&sc->scan_timeout); IWN_UNLOCK(sc); ieee80211_scan_next(vap); IWN_LOCK(sc); @@ -4955,6 +4959,16 @@ iwn_transmit(struct ieee80211com *ic, st } static void +iwn_scan_timeout(void *arg) +{ + struct iwn_softc *sc = arg; + struct ieee80211com *ic = &sc->sc_ic; + + ic_printf(ic, "scan timeout\n"); + ieee80211_restart_all(ic); +} + +static void iwn_watchdog(void *arg) { struct iwn_softc *sc = arg; @@ -6972,6 +6986,8 @@ iwn_scan(struct iwn_softc *sc, struct ie hdr->nchan); error = iwn_cmd(sc, IWN_CMD_SCAN, buf, buflen, 1); free(buf, M_DEVBUF); + if (error == 0) + callout_reset(&sc->scan_timeout, 5*hz, iwn_scan_timeout, sc); DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Thu May 26 11:10:31 2016 (r300731) +++ head/sys/dev/iwn/if_iwnvar.h Thu May 26 11:12:36 2016 (r300732) @@ -317,6 +317,7 @@ struct iwn_softc { int calib_cnt; struct iwn_calib_state calib; int last_calib_ticks; + struct callout scan_timeout; struct callout watchdog_to; struct iwn_fw_info fw; struct iwn_calib_info calibcmd[IWN5000_PHY_CALIB_MAX_RESULT]; @@ -378,7 +379,6 @@ struct iwn_softc { uint8_t chainmask; int sc_tx_timer; - int sc_scan_timer; /* Are we doing a scan? */ int sc_is_scanning; From owner-svn-src-head@freebsd.org Thu May 26 11:38:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABEA1B4BF62; Thu, 26 May 2016 11:38:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 644B010E4; Thu, 26 May 2016 11:38:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QBcQ6F010670; Thu, 26 May 2016 11:38:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QBcQtw010668; Thu, 26 May 2016 11:38:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605261138.u4QBcQtw010668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 26 May 2016 11:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300733 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 11:38:27 -0000 Author: tuexen Date: Thu May 26 11:38:26 2016 New Revision: 300733 URL: https://svnweb.freebsd.org/changeset/base/300733 Log: Make struct sctp_paddrthlds compliant to RFC 7829. Modified: head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Thu May 26 11:12:36 2016 (r300732) +++ head/sys/netinet/sctp_uio.h Thu May 26 11:38:26 2016 (r300733) @@ -590,6 +590,7 @@ struct sctp_paddrthlds { sctp_assoc_t spt_assoc_id; uint16_t spt_pathmaxrxt; uint16_t spt_pathpfthld; + uint16_t spt_pathcpthld; }; struct sctp_paddrinfo { Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Thu May 26 11:12:36 2016 (r300732) +++ head/sys/netinet/sctp_usrreq.c Thu May 26 11:38:26 2016 (r300733) @@ -3304,9 +3304,11 @@ flags_out: if (net != NULL) { thlds->spt_pathmaxrxt = net->failure_threshold; thlds->spt_pathpfthld = net->pf_threshold; + thlds->spt_pathcpthld = 0xffff; } else { thlds->spt_pathmaxrxt = stcb->asoc.def_net_failure; thlds->spt_pathpfthld = stcb->asoc.def_net_pf_threshold; + thlds->spt_pathcpthld = 0xffff; } thlds->spt_assoc_id = sctp_get_associd(stcb); SCTP_TCB_UNLOCK(stcb); @@ -3318,6 +3320,7 @@ flags_out: SCTP_INP_RLOCK(inp); thlds->spt_pathmaxrxt = inp->sctp_ep.def_net_failure; thlds->spt_pathpfthld = inp->sctp_ep.def_net_pf_threshold; + thlds->spt_pathcpthld = 0xffff; SCTP_INP_RUNLOCK(inp); } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -6345,6 +6348,11 @@ sctp_setopt(struct socket *so, int optna break; } } + if (thlds->spt_pathcpthld != 0xffff) { + error = EINVAL; + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } if (stcb != NULL) { if (net != NULL) { net->failure_threshold = thlds->spt_pathmaxrxt; From owner-svn-src-head@freebsd.org Thu May 26 11:40:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A19C9B4A062; Thu, 26 May 2016 11:40:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EF7413B9; Thu, 26 May 2016 11:40:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QBe7Ae010791; Thu, 26 May 2016 11:40:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QBe7pj010790; Thu, 26 May 2016 11:40:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605261140.u4QBe7pj010790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 26 May 2016 11:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300734 - head/sys/dev/iser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 11:40:08 -0000 Author: trasz Date: Thu May 26 11:40:07 2016 New Revision: 300734 URL: https://svnweb.freebsd.org/changeset/base/300734 Log: Fix crash on removal of an unconnected iSER session. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iser/icl_iser.c Modified: head/sys/dev/iser/icl_iser.c ============================================================================== --- head/sys/dev/iser/icl_iser.c Thu May 26 11:38:26 2016 (r300733) +++ head/sys/dev/iser/icl_iser.c Thu May 26 11:40:07 2016 (r300734) @@ -220,6 +220,9 @@ iser_conn_pdu_queue(struct icl_conn *ic, struct icl_iser_pdu *iser_pdu = icl_to_iser_pdu(ip); int ret; + if (iser_conn->state != ISER_CONN_UP) + return; + ret = iser_initialize_headers(iser_pdu, iser_conn); if (ret) { ISER_ERR("Failed to map TX descriptor pdu %p", iser_pdu); From owner-svn-src-head@freebsd.org Thu May 26 11:58:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8B20B4A698; Thu, 26 May 2016 11:58:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95FCA1F52; Thu, 26 May 2016 11:58:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QBwaB2017853; Thu, 26 May 2016 11:58:36 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QBwaVF017852; Thu, 26 May 2016 11:58:36 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261158.u4QBwaVF017852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 11:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300735 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 11:58:37 -0000 Author: avos Date: Thu May 26 11:58:36 2016 New Revision: 300735 URL: https://svnweb.freebsd.org/changeset/base/300735 Log: bsdinstall: unbreak static address assignment for wired networks. This fixes regression introduced in r298946 (fixes static address assignment for wireless networks). Reported & submitted by: allanjude Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 ============================================================================== --- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Thu May 26 11:40:07 2016 (r300734) +++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Thu May 26 11:58:36 2016 (r300735) @@ -84,7 +84,11 @@ retval=$? if [ "$BSDINSTALL_CONFIGCURRENT" ]; then . $BSDINSTALL_TMPETC/._rc.conf.net - ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE | sed "s|$2||"` + if [ -n "$2" ]; then + ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE | sed "s|$2||"` + else + ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE` + fi if [ "$defaultrouter" ]; then route delete -inet default route add -inet default $defaultrouter From owner-svn-src-head@freebsd.org Thu May 26 12:11:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF8D4B49373 for ; Thu, 26 May 2016 12:11:00 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x229.google.com (mail-yw0-x229.google.com [IPv6:2607:f8b0:4002:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91FCB1BD2 for ; Thu, 26 May 2016 12:11:00 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x229.google.com with SMTP id o16so74342031ywd.2 for ; Thu, 26 May 2016 05:11:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=7PkxIwmWiUnfejhiREJ3Jy0X5M3vvSCer2uZf8UBZOk=; b=s807XaauJ2lFIWS4lsO4OfXt/hS8H078+EDT8uQnC4blnxdlWTf+gcDs6KrbQAKL31 sH4HkUEnxW0Ud0+HalCYPHJZYdfDE4LQ3jVEfH8Va5U78OwLXGmTGNhyCYXN4HoSV862 y4pHv9BwXqaNQjm/9H4hWQ+M97Wy4PXHmfd+tffxKg+HBGL0//HRIS7oniy9NTA/EMDU bIQlNCwqLdjjfepnEvGWjbYi+t5YTQ35N1kpnbTKWvkENgQHjTsUKaCKE5ixqbvpMAZG o3UZ7RXRrLzDoeCAkxcShi3BIXXyiUv5EjDyGdlxtgF6h4gn5meZIgvyGoTWrcn9akiD 0qsg== 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; bh=7PkxIwmWiUnfejhiREJ3Jy0X5M3vvSCer2uZf8UBZOk=; b=SVnuE3bYO/tzKFRRUE2lOsxDb+RTXrJMfZP/Lu5pKR+7zhXfrdsXlxdVT6xA5i4dPf 81SYG7uYy3chFscsTP1+HhL/TTB2CCa44Gw1ZrCT0in+QdJhpR/NNyOKWLlnA7Z9ngEB ieJfRCq6c12fyWWIui8w4wHOhG02xEa6G7xmvmTeIoWoVXbuqMBefZXdrJdUtHpZGqbY V14pzXN5PSdvNLO0AXXo/QCk5MP0F1WYAhswHbvfRtQkX2NLacV63OSIQUDanq+GOSSk 8w5AF2kMXNcVpUj2/wqmQOgDM0a/YdK36T499jLLY7wBMiGfXKaZF4tPSjVVpwPzEQOK KMaQ== X-Gm-Message-State: ALyK8tJVuieeC1YUjPHrs8LrOgBMUiu/7SY4MWp4bJWfvSpMQ/pbJOgIutuFTCnBT3FpUqZk94QPQtbAmU/hdw== MIME-Version: 1.0 X-Received: by 10.37.13.68 with SMTP id 65mr5085120ybn.163.1464264659540; Thu, 26 May 2016 05:10:59 -0700 (PDT) Received: by 10.13.201.199 with HTTP; Thu, 26 May 2016 05:10:59 -0700 (PDT) In-Reply-To: <201605261110.u4QBAW7W099643@repo.freebsd.org> References: <201605261110.u4QBAW7W099643@repo.freebsd.org> Date: Thu, 26 May 2016 14:10:59 +0200 Message-ID: Subject: Re: svn commit: r300731 - head/sys/netinet From: Ed Schouten To: Hans Petter Selasky Cc: src-committers , 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 12:11:00 -0000 Hi Hans, 2016-05-26 13:10 GMT+02:00 Hans Petter Selasky : > Use optimised complexity safe sorting routine instead of the kernel's > "qsort()". Cool! Thanks for working on this! > The custom sorting routine takes advantage of that the sorting key is > only 64 bits. Based on set and cleared bits in the sorting key it > partitions the array until it is sorted. A sorting algorithm that uses such an approach is typically called Radix Sort: https://en.wikipedia.org/wiki/Radix_sort Would it make sense to mention this in the comments, instead of referring to it as a "bit-slice sorter algorithm"? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Thu May 26 12:15:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91A9EB494A4; Thu, 26 May 2016 12:15:19 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C7001065; Thu, 26 May 2016 12:15:19 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id CD0261FE024; Thu, 26 May 2016 14:15:16 +0200 (CEST) Subject: Re: svn commit: r300731 - head/sys/netinet To: Ed Schouten References: <201605261110.u4QBAW7W099643@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Thu, 26 May 2016 14:18:36 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 12:15:19 -0000 On 05/26/16 14:10, Ed Schouten wrote: > Hi Hans, > > 2016-05-26 13:10 GMT+02:00 Hans Petter Selasky : >> Use optimised complexity safe sorting routine instead of the kernel's >> "qsort()". > > Cool! Thanks for working on this! > >> The custom sorting routine takes advantage of that the sorting key is >> only 64 bits. Based on set and cleared bits in the sorting key it >> partitions the array until it is sorted. > > A sorting algorithm that uses such an approach is typically called Radix Sort: > > https://en.wikipedia.org/wiki/Radix_sort > > Would it make sense to mention this in the comments, instead of > referring to it as a "bit-slice sorter algorithm"? Sure. Can you send me a patch? --HPS From owner-svn-src-head@freebsd.org Thu May 26 12:43:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46DC5B49E19; Thu, 26 May 2016 12:43:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A5C51067; Thu, 26 May 2016 12:43:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QChGoJ036216; Thu, 26 May 2016 12:43:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QChGLv036215; Thu, 26 May 2016 12:43:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605261243.u4QChGLv036215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 26 May 2016 12:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300737 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 12:43:17 -0000 Author: trasz Date: Thu May 26 12:43:15 2016 New Revision: 300737 URL: https://svnweb.freebsd.org/changeset/base/300737 Log: Add a special case for iSER data tranfers. Obtained from: Mellanox Technologies MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Thu May 26 12:00:14 2016 (r300736) +++ head/sys/dev/iscsi/iscsi.c Thu May 26 12:43:15 2016 (r300737) @@ -866,6 +866,7 @@ iscsi_pdu_handle_scsi_response(struct ic struct ccb_scsiio *csio; size_t data_segment_len, received; uint16_t sense_len; + uint32_t resid; is = PDU_SESSION(response); @@ -880,6 +881,22 @@ iscsi_pdu_handle_scsi_response(struct ic } ccb = io->io_ccb; + + /* + * With iSER, after getting good response we can be sure + * that all the data has been successfully transferred. + */ + if (is->is_conn->ic_iser) { + resid = ntohl(bhssr->bhssr_residual_count); + if (bhssr->bhssr_flags & BHSSR_FLAGS_RESIDUAL_UNDERFLOW) { + io->io_received = ccb->csio.dxfer_len - resid; + } else if (bhssr->bhssr_flags & BHSSR_FLAGS_RESIDUAL_OVERFLOW) { + ISCSI_SESSION_WARN(is, "overflow: target indicates %d", resid); + } else { + io->io_received = ccb->csio.dxfer_len; + } + } + received = io->io_received; iscsi_outstanding_remove(is, io); ISCSI_SESSION_UNLOCK(is); From owner-svn-src-head@freebsd.org Thu May 26 13:14:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA518B4B5D0; Thu, 26 May 2016 13:14:09 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9133110F6; Thu, 26 May 2016 13:14:09 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QDE8nZ047159; Thu, 26 May 2016 13:14:08 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QDE8VT047157; Thu, 26 May 2016 13:14:08 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261314.u4QDE8VT047157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 13:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300738 - in head: sbin/ifconfig sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 13:14:09 -0000 Author: avos Date: Thu May 26 13:14:08 2016 New Revision: 300738 URL: https://svnweb.freebsd.org/changeset/base/300738 Log: ifconfig: set by default FCC regulatory domain for wireless interfaces. Change default regulatory domain from DEBUG (no limitations; exposes all device channels) to FCC; as a result, newly created wireless interface with default settings will have less chances to violate country-specific regulations. This change will not affect drivers with pre-initialized regdomain structure (currentry ath(4) and mwl(4)); in that case, the default channel list must correspond to the default regdomain / country setting. You can switch to another regdomain / country via corresponding ifconfig(8) options; the driver must implement ic_getradiocaps() method to restore full channel list. Full country / regdomain list may be obtained via 'ifconfig list countries' command. Example: change country to Germany: ifconfig wlan0 down # all wlans on the device must be down ifconfig wlan0 country DE ifconfig wlan0 up # wpa_supplicant(8), dhclient(8) etc At the creation time: ifconfig wlan0 create wlandev wpi0 country DE To make changes permanent add the following line to the rc.conf(5): create_args_wlan0="country DE" Tested with - Intel 3945BG (wpi(4)). - WUSB54GC (rum(4)). Reviewed by: adrian Relnotes: yes Differential Revision: https://reviews.freebsd.org/D6228 Modified: head/sbin/ifconfig/ifieee80211.c head/sys/net80211/ieee80211_regdomain.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Thu May 26 12:43:15 2016 (r300737) +++ head/sbin/ifconfig/ifieee80211.c Thu May 26 13:14:08 2016 (r300738) @@ -5141,6 +5141,44 @@ print_string(const u_int8_t *buf, int le } } +static void +setdefregdomain(int s) +{ + struct regdata *rdp = getregdata(); + const struct regdomain *rd; + + /* Check if regdomain/country was already set by a previous call. */ + /* XXX is it possible? */ + if (regdomain.regdomain != 0 || + regdomain.country != CTRY_DEFAULT) + return; + + getregdomain(s); + + /* Check if it was already set by the driver. */ + if (regdomain.regdomain != 0 || + regdomain.country != CTRY_DEFAULT) + return; + + /* Set FCC/US as default. */ + rd = lib80211_regdomain_findbysku(rdp, SKU_FCC); + if (rd == NULL) + errx(1, "FCC regdomain was not found"); + + regdomain.regdomain = rd->sku; + if (rd->cc != NULL) + defaultcountry(rd); + + /* Send changes to net80211. */ + setregdomain_cb(s, ®domain); + + /* Cleanup (so it can be overriden by subsequent parameters). */ + regdomain.regdomain = 0; + regdomain.country = CTRY_DEFAULT; + regdomain.isocc[0] = 0; + regdomain.isocc[1] = 0; +} + /* * Virtual AP cloning support. */ @@ -5162,6 +5200,8 @@ wlan_create(int s, struct ifreq *ifr) ifr->ifr_data = (caddr_t) ¶ms; if (ioctl(s, SIOCIFCREATE2, ifr) < 0) err(1, "SIOCIFCREATE2"); + + setdefregdomain(s); } static Modified: head/sys/net80211/ieee80211_regdomain.c ============================================================================== --- head/sys/net80211/ieee80211_regdomain.c Thu May 26 12:43:15 2016 (r300737) +++ head/sys/net80211/ieee80211_regdomain.c Thu May 26 13:14:08 2016 (r300738) @@ -69,10 +69,7 @@ ieee80211_regdomain_attach(struct ieee80 { if (ic->ic_regdomain.regdomain == 0 && ic->ic_regdomain.country == CTRY_DEFAULT) { - ic->ic_regdomain.country = CTRY_UNITED_STATES; /* XXX */ ic->ic_regdomain.location = ' '; /* both */ - ic->ic_regdomain.isocc[0] = 'U'; /* XXX */ - ic->ic_regdomain.isocc[1] = 'S'; /* XXX */ /* NB: driver calls ieee80211_init_channels or similar */ } ic->ic_getradiocaps = null_getradiocaps; From owner-svn-src-head@freebsd.org Thu May 26 13:19:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C46AB4B8AC; Thu, 26 May 2016 13:19:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 097891B29; Thu, 26 May 2016 13:19:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QDJjfw047786; Thu, 26 May 2016 13:19:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QDJjpv047785; Thu, 26 May 2016 13:19:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605261319.u4QDJjpv047785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 26 May 2016 13:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300739 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 13:19:46 -0000 Author: arybchik Date: Thu May 26 13:19:44 2016 New Revision: 300739 URL: https://svnweb.freebsd.org/changeset/base/300739 Log: sfxge(4): correct parenthesis location in if coundition Found by lint on illumos. Submitted by: Garrett D'Amore Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Thu May 26 13:14:08 2016 (r300738) +++ head/sys/dev/sfxge/common/ef10_filter.c Thu May 26 13:19:44 2016 (r300739) @@ -970,7 +970,7 @@ ef10_filter_supported_filters( { efx_rc_t rc; - if ((rc = efx_mcdi_get_parser_disp_info(enp, list, length) != 0)) + if ((rc = efx_mcdi_get_parser_disp_info(enp, list, length)) != 0) goto fail1; return (0); From owner-svn-src-head@freebsd.org Thu May 26 13:49:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16B28B4B29B; Thu, 26 May 2016 13:49:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6FAF1FD0; Thu, 26 May 2016 13:49:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QDneiH059005; Thu, 26 May 2016 13:49:40 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QDneJN059004; Thu, 26 May 2016 13:49:40 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605261349.u4QDneJN059004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 26 May 2016 13:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300741 - head/usr.bin/ar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 13:49:42 -0000 Author: ed Date: Thu May 26 13:49:40 2016 New Revision: 300741 URL: https://svnweb.freebsd.org/changeset/base/300741 Log: Make code compile when basename() is POSIX compliant. In addition to the previous change I made to ar.c, pull in another basename() related fix. This change is similar to the one made to the ELF Toolchain version of ar, with the difference that the ELF Toolchain version lacks error handling for the strdup() call. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D6467 Modified: head/usr.bin/ar/write.c Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Thu May 26 13:34:08 2016 (r300740) +++ head/usr.bin/ar/write.c Thu May 26 13:49:40 2016 (r300741) @@ -124,6 +124,7 @@ create_obj_from_file(struct bsdar *bsdar struct ar_obj *obj; struct stat sb; const char *bname; + char *tmpname; if (name == NULL) return (NULL); @@ -137,7 +138,10 @@ create_obj_from_file(struct bsdar *bsdar return (NULL); } - if ((bname = basename(name)) == NULL) + tmpname = strdup(name); + if (tmpname == NULL) + bsdar_errc(bsdar, EX_SOFTWARE, errno, "strdup failed"); + if ((bname = basename(tmpname)) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, errno, "basename failed"); if (bsdar->options & AR_TR && strlen(bname) > _TRUNCATE_LEN) { if ((obj->name = malloc(_TRUNCATE_LEN + 1)) == NULL) @@ -147,6 +151,7 @@ create_obj_from_file(struct bsdar *bsdar } else if ((obj->name = strdup(bname)) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, errno, "strdup failed"); + free(tmpname); if (fstat(obj->fd, &sb) < 0) { bsdar_warnc(bsdar, errno, "can't fstat file: %s", obj->name); From owner-svn-src-head@freebsd.org Thu May 26 13:58:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 759EFB4B40D; Thu, 26 May 2016 13:58:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com [IPv6:2607:f8b0:4001:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 414D214A8; Thu, 26 May 2016 13:58:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x22d.google.com with SMTP id ww4so90986729igb.1; Thu, 26 May 2016 06:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=donDJVCfMBVs8OQYTGp2DB0Bw2Y1rv0ZdoymMHkrFKY=; b=JsiRkMF8wT+GlKaAYVeEukC8V356ylmtkRDvKDR8xsW21Y4ZFj1GE9b9hUvxAUnTx0 FIjh5L0JxIeddRyqWA6KPkc78WXMAa90Tu8usdcr1fJ7yAzFCUwXxsW0d/FN0kuZ1s0M ZTinXilJDOuFkw7c/BPodf1cEKyFt4K143yhYPGZsZApYCTh4ty5s2YlDfJ916ntxs4a kEBOxwtlJ09V577DCQqENxnCr/AfZIFszaaQCpqAs1gizVGkpv2gqoxYsLTyWMwA9vPC zRPHFl7R/Ncjf5uYsnRpudmpeGrUmfUVYPa4spGdykw7JNCjUOLNi32+jfNmC+CQvt62 IEeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=donDJVCfMBVs8OQYTGp2DB0Bw2Y1rv0ZdoymMHkrFKY=; b=mFVv8tsVsjWFMdanG5EBEEtCEz4pzfPQnm2BvxMMuaJBPfn2M5hDibSpfkVuYMWDAG CsljxQ7CIkK+g7U4upgXIBDYSax0+tuEld3cEJULkqI4qxOWqgCqGiReTr07yq4CY4wY wAMV2YRkrCLw8EOe7G7n/Mam7cJ+bWSmJmteg70/4j3tsf1A8xUzI1ZIfMPsoe/llPR+ qdTpPY5N/aNq900GZkaopxIxU1fn8vOKEEULpCInzgk17JbBQTCWwkewF7GNvLf9nkgy Wsyju/zFlhZs8x4r4E41Qy5+eE4AsbVvvOXzth69uQsokGMcauEW2VVPjK9qiGexxSeq QdYA== X-Gm-Message-State: ALyK8tJ92mfGiJWmgLcXk0f1B/WrkRf/AmGFIey2ih5k88bdW1GJ8YwZmiv7bIuesMnOErMZOfSEuEXouzvPDw== X-Received: by 10.50.59.211 with SMTP id b19mr3432910igr.58.1464271084568; Thu, 26 May 2016 06:58:04 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.27.197 with HTTP; Thu, 26 May 2016 06:57:45 -0700 (PDT) In-Reply-To: <201605261349.u4QDneJN059004@repo.freebsd.org> References: <201605261349.u4QDneJN059004@repo.freebsd.org> From: Ed Maste Date: Thu, 26 May 2016 09:57:45 -0400 X-Google-Sender-Auth: B9ICzLarOJM_wmdzBIWEzpKRbLs Message-ID: Subject: Re: svn commit: r300741 - head/usr.bin/ar To: Ed Schouten Cc: "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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 13:58:05 -0000 On 26 May 2016 at 09:49, Ed Schouten wrote: > This change is similar to the one made to the > ELF Toolchain version of ar, with the difference that the ELF Toolchain > version lacks error handling for the strdup() call. As an aside, I plan to migrate to the ELF Tool Chain version of brandelf, elfdump, and ar, after they gain any functionality that currently exists only in the versions in the FreeBSD tree. I'll bring the strdup error handling change from here upstream. From owner-svn-src-head@freebsd.org Thu May 26 14:17:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5571BB4BA61; Thu, 26 May 2016 14:17:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15AE917B4; Thu, 26 May 2016 14:17:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QEHwMC069938; Thu, 26 May 2016 14:17:58 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QEHwPg069936; Thu, 26 May 2016 14:17:58 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261417.u4QEHwPg069936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 14:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300744 - head/sys/dev/rtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 14:17:59 -0000 Author: avos Date: Thu May 26 14:17:57 2016 New Revision: 300744 URL: https://svnweb.freebsd.org/changeset/base/300744 Log: rtwn: replace hardcoded rate indices with their names (similar to r289758). - Use macros to define rate indices; don't hardcode them in code. - Add method for 'rate' -> 'rate index' conversion (and array for the opposite). - Determine if rate is CCK / OFDM via appropriate macro. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D4837 Modified: head/sys/dev/rtwn/if_rtwn.c head/sys/dev/rtwn/if_rtwnreg.h Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Thu May 26 14:13:09 2016 (r300743) +++ head/sys/dev/rtwn/if_rtwn.c Thu May 26 14:17:57 2016 (r300744) @@ -1044,40 +1044,56 @@ rtwn_read_rom(struct rtwn_softc *sc) IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, rom->macaddr); } +static __inline uint8_t +rate2ridx(uint8_t rate) +{ + switch (rate) { + case 12: return 4; + case 18: return 5; + case 24: return 6; + case 36: return 7; + case 48: return 8; + case 72: return 9; + case 96: return 10; + case 108: return 11; + case 2: return 0; + case 4: return 1; + case 11: return 2; + case 22: return 3; + default: return RTWN_RIDX_UNKNOWN; + } +} + /* * Initialize rate adaptation in firmware. */ static int rtwn_ra_init(struct rtwn_softc *sc) { - static const uint8_t map[] = - { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 }; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_node *ni = ieee80211_ref_node(vap->iv_bss); struct ieee80211_rateset *rs = &ni->ni_rates; struct r92c_fw_cmd_macid_cfg cmd; uint32_t rates, basicrates; - uint8_t mode; - int maxrate, maxbasicrate, error, i, j; + uint8_t maxrate, maxbasicrate, mode, ridx; + int error, i; /* Get normal and basic rates mask. */ rates = basicrates = 0; maxrate = maxbasicrate = 0; for (i = 0; i < rs->rs_nrates; i++) { /* Convert 802.11 rate to HW rate index. */ - for (j = 0; j < nitems(map); j++) - if ((rs->rs_rates[i] & IEEE80211_RATE_VAL) == map[j]) - break; - if (j == nitems(map)) /* Unknown rate, skip. */ + ridx = rate2ridx(IEEE80211_RV(rs->rs_rates[i])); + if (ridx == RTWN_RIDX_UNKNOWN) /* Unknown rate, skip. */ continue; - rates |= 1 << j; - if (j > maxrate) - maxrate = j; + rates |= 1 << ridx; + if (ridx > maxrate) + maxrate = ridx; if (rs->rs_rates[i] & IEEE80211_RATE_BASIC) { - basicrates |= 1 << j; - if (j > maxbasicrate) - maxbasicrate = j; + basicrates |= 1 << ridx; + if (ridx > maxbasicrate) + maxbasicrate = ridx; } } if (ic->ic_curmode == IEEE80211_MODE_11B) @@ -1358,7 +1374,7 @@ rtwn_update_avgrssi(struct rtwn_softc *s pwdb = 100; else pwdb = 100 + rssi; - if (rate <= 3) { + if (RTWN_RATE_IS_CCK(rate)) { /* CCK gain is smaller than OFDM/MCS gain. */ pwdb += 6; if (pwdb > 100) @@ -1390,7 +1406,7 @@ rtwn_get_rssi(struct rtwn_softc *sc, int uint8_t rpt; int8_t rssi; - if (rate <= 3) { + if (RTWN_RATE_IS_CCK(rate)) { cck = (struct r92c_rx_cck *)physt; if (sc->sc_flags & RTWN_FLAG_CCK_HIPWR) { rpt = (cck->agc_rpt >> 5) & 0x3; @@ -1503,22 +1519,7 @@ rtwn_rx_frame(struct rtwn_softc *sc, str tap->wr_flags = 0; if (!(rxdw3 & R92C_RXDW3_HT)) { - switch (rate) { - /* CCK. */ - case 0: tap->wr_rate = 2; break; - case 1: tap->wr_rate = 4; break; - case 2: tap->wr_rate = 11; break; - case 3: tap->wr_rate = 22; break; - /* OFDM. */ - case 4: tap->wr_rate = 12; break; - case 5: tap->wr_rate = 18; break; - case 6: tap->wr_rate = 24; break; - case 7: tap->wr_rate = 36; break; - case 8: tap->wr_rate = 48; break; - case 9: tap->wr_rate = 72; break; - case 10: tap->wr_rate = 96; break; - case 11: tap->wr_rate = 108; break; - } + tap->wr_rate = ridx2rate[rate]; } else if (rate >= 12) { /* MCS0~15. */ /* Bit 7 set means HT MCS instead of rate. */ tap->wr_rate = 0x80 | (rate - 12); @@ -1644,10 +1645,12 @@ rtwn_tx(struct rtwn_softc *sc, struct mb /* XXX TODO: implement rate control */ /* Send RTS at OFDM24. */ - txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, 8)); + txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, + RTWN_RIDX_OFDM24)); txd->txdw5 |= htole32(SM(R92C_TXDW5_RTSRATE_FBLIMIT, 0xf)); /* Send data at OFDM54. */ - txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 11)); + txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, + RTWN_RIDX_OFDM54)); txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE_FBLIMIT, 0x1f)); } else { @@ -1658,7 +1661,7 @@ rtwn_tx(struct rtwn_softc *sc, struct mb /* Force CCK1. */ txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); - txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 0)); + txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, RTWN_RIDX_CCK1)); } /* Set sequence number (already little endian). */ txd->txdseq = htole16(M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE); @@ -2577,10 +2580,10 @@ rtwn_get_txpower(struct rtwn_softc *sc, memset(power, 0, RTWN_RIDX_COUNT * sizeof(power[0])); if (sc->regulatory == 0) { - for (ridx = 0; ridx <= 3; ridx++) + for (ridx = RTWN_RIDX_CCK1; ridx <= RTWN_RIDX_CCK11; ridx++) power[ridx] = base->pwr[0][ridx]; } - for (ridx = 4; ridx < RTWN_RIDX_COUNT; ridx++) { + for (ridx = RTWN_RIDX_OFDM6; ridx < RTWN_RIDX_COUNT; ridx++) { if (sc->regulatory == 3) { power[ridx] = base->pwr[0][ridx]; /* Apply vendor limits. */ @@ -2600,7 +2603,7 @@ rtwn_get_txpower(struct rtwn_softc *sc, /* Compute per-CCK rate Tx power. */ cckpow = rom->cck_tx_pwr[chain][group]; - for (ridx = 0; ridx <= 3; ridx++) { + for (ridx = RTWN_RIDX_CCK1; ridx <= RTWN_RIDX_CCK11; ridx++) { power[ridx] += cckpow; if (power[ridx] > R92C_MAX_TX_PWR) power[ridx] = R92C_MAX_TX_PWR; @@ -2618,7 +2621,7 @@ rtwn_get_txpower(struct rtwn_softc *sc, diff = rom->ofdm_tx_pwr_diff[group]; diff = (diff >> (chain * 4)) & 0xf; ofdmpow = htpow + diff; /* HT->OFDM correction. */ - for (ridx = 4; ridx <= 11; ridx++) { + for (ridx = RTWN_RIDX_OFDM6; ridx <= RTWN_RIDX_OFDM54; ridx++) { power[ridx] += ofdmpow; if (power[ridx] > R92C_MAX_TX_PWR) power[ridx] = R92C_MAX_TX_PWR; @@ -2630,7 +2633,7 @@ rtwn_get_txpower(struct rtwn_softc *sc, diff = (diff >> (chain * 4)) & 0xf; htpow += diff; /* HT40->HT20 correction. */ } - for (ridx = 12; ridx <= 27; ridx++) { + for (ridx = RTWN_RIDX_MCS0; ridx <= RTWN_RIDX_MCS15; ridx++) { power[ridx] += htpow; if (power[ridx] > R92C_MAX_TX_PWR) power[ridx] = R92C_MAX_TX_PWR; @@ -2639,7 +2642,7 @@ rtwn_get_txpower(struct rtwn_softc *sc, if (sc->sc_debug >= 4) { /* Dump per-rate Tx power values. */ printf("Tx power for chain %d:\n", chain); - for (ridx = 0; ridx < RTWN_RIDX_COUNT; ridx++) + for (ridx = RTWN_RIDX_CCK1; ridx < RTWN_RIDX_COUNT; ridx++) printf("Rate %d = %u\n", ridx, power[ridx]); } #endif Modified: head/sys/dev/rtwn/if_rtwnreg.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnreg.h Thu May 26 14:13:09 2016 (r300743) +++ head/sys/dev/rtwn/if_rtwnreg.h Thu May 26 14:17:57 2016 (r300744) @@ -1158,6 +1158,25 @@ struct r92c_tx_desc { uint32_t reserved[4]; } __packed __attribute__((aligned(4))); +static const uint8_t ridx2rate[] = + { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 }; + +/* HW rate indices. */ +#define RTWN_RIDX_CCK1 0 +#define RTWN_RIDX_CCK11 3 +#define RTWN_RIDX_OFDM6 4 +#define RTWN_RIDX_OFDM24 8 +#define RTWN_RIDX_OFDM54 11 +#define RTWN_RIDX_MCS0 12 +#define RTWN_RIDX_MCS15 27 + +#define RTWN_RIDX_COUNT 28 +#define RTWN_RIDX_UNKNOWN (uint8_t)-1 + +#define RTWN_RATE_IS_CCK(rate) ((rate) <= RTWN_RIDX_CCK11) +#define RTWN_RATE_IS_OFDM(rate) ((rate) >= RTWN_RIDX_OFDM6 && \ + (rate) <= RTWN_RIDX_OFDM54) + /* * Driver definitions. @@ -1184,8 +1203,6 @@ struct r92c_tx_desc { #define RTWN_RXBUFSZ (16 * 1024) #define RTWN_TXBUFSZ (sizeof(struct r92c_tx_desc) + IEEE80211_MAX_LEN) -#define RTWN_RIDX_COUNT 28 - #define RTWN_TX_TIMEOUT 5000 /* ms */ #define RTWN_LED_LINK 0 From owner-svn-src-head@freebsd.org Thu May 26 14:19:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E62AB4BB04; Thu, 26 May 2016 14:19:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 002391A6E; Thu, 26 May 2016 14:19:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QEJOnR070172; Thu, 26 May 2016 14:19:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QEJOTv070171; Thu, 26 May 2016 14:19:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605261419.u4QEJOTv070171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 26 May 2016 14:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300745 - head/usr.bin/iscsictl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 14:19:25 -0000 Author: trasz Date: Thu May 26 14:19:24 2016 New Revision: 300745 URL: https://svnweb.freebsd.org/changeset/base/300745 Log: Make iscsictl(8) actually report non-zero status on errors. The "failed" is negative, because the error returned from calls to ioctl(2) is negative. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/iscsictl/iscsictl.c Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Thu May 26 14:17:57 2016 (r300744) +++ head/usr.bin/iscsictl/iscsictl.c Thu May 26 14:19:24 2016 (r300745) @@ -987,7 +987,7 @@ main(int argc, char **argv) if (error != 0) xo_err(1, "close"); - if (failed > 0) + if (failed != 0) return (1); xo_close_container("iscsictl"); From owner-svn-src-head@freebsd.org Thu May 26 14:21:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03F30B4BB7C; Thu, 26 May 2016 14:21:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5C601C4E; Thu, 26 May 2016 14:21:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QEL2H1070296; Thu, 26 May 2016 14:21:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QEL2aY070295; Thu, 26 May 2016 14:21:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605261421.u4QEL2aY070295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 26 May 2016 14:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300746 - head/usr.bin/iscsictl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 14:21:04 -0000 Author: trasz Date: Thu May 26 14:21:02 2016 New Revision: 300746 URL: https://svnweb.freebsd.org/changeset/base/300746 Log: Do libxo cleanup even in case of errors. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/iscsictl/iscsictl.c Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Thu May 26 14:19:24 2016 (r300745) +++ head/usr.bin/iscsictl/iscsictl.c Thu May 26 14:21:02 2016 (r300746) @@ -987,10 +987,11 @@ main(int argc, char **argv) if (error != 0) xo_err(1, "close"); + xo_close_container("iscsictl"); + xo_finish(); + if (failed != 0) return (1); - xo_close_container("iscsictl"); - xo_finish(); return (0); } From owner-svn-src-head@freebsd.org Thu May 26 14:26:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7560B4BE29; Thu, 26 May 2016 14:26:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 982D41186; Thu, 26 May 2016 14:26:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QEQnqv073716; Thu, 26 May 2016 14:26:49 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QEQn0a073715; Thu, 26 May 2016 14:26:49 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605261426.u4QEQn0a073715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 26 May 2016 14:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300747 - head/usr.sbin/extattr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 14:26:50 -0000 Author: asomers Date: Thu May 26 14:26:49 2016 New Revision: 300747 URL: https://svnweb.freebsd.org/changeset/base/300747 Log: rmextattr(8) man page clarifications regarding -qq Reviewed by: ngie MFC after: 6 days X-MFC-With: 299085 Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6422 Modified: head/usr.sbin/extattr/rmextattr.8 Modified: head/usr.sbin/extattr/rmextattr.8 ============================================================================== --- head/usr.sbin/extattr/rmextattr.8 Thu May 26 14:21:02 2016 (r300746) +++ head/usr.sbin/extattr/rmextattr.8 Thu May 26 14:26:49 2016 (r300747) @@ -108,7 +108,7 @@ Read attribute data from stdin instead o .It Fl q (Quiet.) Do not print out the pathname and suppress error messages. -When given twice, do not print a trailing newline. +When given twice, print only the attribute value, with no trailing newline. .It Fl s (Stringify.) Escape nonprinting characters and put quotes around the output. @@ -121,6 +121,7 @@ Print the output in hexadecimal. setextattr system md5 `md5 -q /boot/kernel/kernel` /boot/kernel/kernel md5 -q /boot/kernel/kernel | setextattr -i system md5 /boot/kernel/kernel getextattr system md5 /boot/kernel/kernel +getextattr -qq system md5 /boot/kernel/kernel | od -x lsextattr system /boot/kernel/kernel rmextattr system md5 /boot/kernel/kernel .Ed From owner-svn-src-head@freebsd.org Thu May 26 15:05:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 064E9B4BBA7; Thu, 26 May 2016 15:05:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C622E1FF7; Thu, 26 May 2016 15:05:38 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QF5b3N088495; Thu, 26 May 2016 15:05:37 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QF5bLU088493; Thu, 26 May 2016 15:05:37 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261505.u4QF5bLU088493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 15:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300748 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 15:05:39 -0000 Author: avos Date: Thu May 26 15:05:37 2016 New Revision: 300748 URL: https://svnweb.freebsd.org/changeset/base/300748 Log: run: switch to ieee80211_add_channel_list_*() - Use device's channel list instead of default one (from ieee80211_init_channels()). - Add ic_getradiocaps() method. Differential Revision: https://reviews.freebsd.org/D6144 Modified: head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runreg.h Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Thu May 26 14:26:49 2016 (r300747) +++ head/sys/dev/usb/wlan/if_run.c Thu May 26 15:05:37 2016 (r300748) @@ -423,6 +423,8 @@ static void run_rt5390_set_chan(struct r static void run_rt5592_set_chan(struct run_softc *, u_int); static int run_set_chan(struct run_softc *, struct ieee80211_channel *); static void run_set_channel(struct ieee80211com *); +static void run_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void run_scan_start(struct ieee80211com *); static void run_scan_end(struct ieee80211com *); static void run_update_beacon(struct ieee80211vap *, int); @@ -704,7 +706,6 @@ run_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct ieee80211com *ic = &sc->sc_ic; uint32_t ver; - uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; int ntries, error; @@ -786,20 +787,15 @@ run_attach(device_t self) ic->ic_flags |= IEEE80211_F_DATAPAD; ic->ic_flags_ext |= IEEE80211_FEXT_SWBMISS; - memset(bands, 0, sizeof(bands)); - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850 || - sc->rf_rev == RT3070_RF_3052 || sc->rf_rev == RT3593_RF_3053 || - sc->rf_rev == RT5592_RF_5592) - setbit(bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, bands); + run_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_ifattach(ic); ic->ic_scan_start = run_scan_start; ic->ic_scan_end = run_scan_end; ic->ic_set_channel = run_set_channel; + ic->ic_getradiocaps = run_getradiocaps; ic->ic_node_alloc = run_node_alloc; ic->ic_newassoc = run_newassoc; ic->ic_updateslot = run_updateslot; @@ -4784,6 +4780,28 @@ run_set_channel(struct ieee80211com *ic) } static void +run_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + struct run_softc *sc = ic->ic_softc; + uint8_t bands[IEEE80211_MODE_BYTES]; + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + run_chan_2ghz, nitems(run_chan_2ghz), bands, 0); + + if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850 || + sc->rf_rev == RT3070_RF_3052 || sc->rf_rev == RT3593_RF_3053 || + sc->rf_rev == RT5592_RF_5592) { + setbit(bands, IEEE80211_MODE_11A); + ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, + run_chan_5ghz, nitems(run_chan_5ghz), bands, 0); + } +} + +static void run_scan_start(struct ieee80211com *ic) { struct run_softc *sc = ic->ic_softc; Modified: head/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_runreg.h Thu May 26 14:26:49 2016 (r300747) +++ head/sys/dev/usb/wlan/if_runreg.h Thu May 26 15:05:37 2016 (r300748) @@ -1084,6 +1084,18 @@ struct rt2860_rxwi { { 137, 0x0f } /* + * Channel map for run(4) driver; taken from the table below. + */ +static const uint8_t run_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; + +static const uint8_t run_chan_5ghz[] = + { 36, 38, 40, 44, 46, 48, 52, 54, 56, 60, 62, 64, 100, 102, 104, + 108, 110, 112, 116, 118, 120, 124, 126, 128, 132, 134, 136, 140, + 149, 151, 153, 157, 159, 161, 165, 167, 169, 171, 173, + 184, 188, 192, 196, 208, 212, 216 }; + +/* * Default settings for RF registers; values derived from the reference driver. */ #define RT2860_RF2850 \ From owner-svn-src-head@freebsd.org Thu May 26 15:12:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A09FB4BF3E; Thu, 26 May 2016 15:12:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2204D18BF; Thu, 26 May 2016 15:12:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QFCsV4092159; Thu, 26 May 2016 15:12:54 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QFCs9R092158; Thu, 26 May 2016 15:12:54 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261512.u4QFCs9R092158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 15:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300749 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 15:12:55 -0000 Author: avos Date: Thu May 26 15:12:54 2016 New Revision: 300749 URL: https://svnweb.freebsd.org/changeset/base/300749 Log: ural: switch to ieee80211_add_channel_list_*() - Use device's channel list instead of default one (+ 12, 13 and 14 2GHz channels). - Add ic_getradiocaps() method. Differential Revision: https://reviews.freebsd.org/D6170 Modified: head/sys/dev/usb/wlan/if_ural.c Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Thu May 26 15:05:37 2016 (r300748) +++ head/sys/dev/usb/wlan/if_ural.c Thu May 26 15:12:54 2016 (r300749) @@ -166,6 +166,8 @@ static uint8_t ural_bbp_read(struct ura static void ural_rf_write(struct ural_softc *, uint8_t, uint32_t); static void ural_scan_start(struct ieee80211com *); static void ural_scan_end(struct ieee80211com *); +static void ural_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void ural_set_channel(struct ieee80211com *); static void ural_set_chan(struct ural_softc *, struct ieee80211_channel *); @@ -357,6 +359,14 @@ static const struct { { 161, 0x08808, 0x0242f, 0x00281 } }; +static const uint8_t ural_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; + +static const uint8_t ural_chan_5ghz[] = + { 36, 40, 44, 48, 52, 56, 60, 64, + 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, + 149, 153, 157, 161 }; + static const struct usb_config ural_config[URAL_N_TRANSFER] = { [URAL_BULK_WR] = { .type = UE_BULK, @@ -424,7 +434,6 @@ ural_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct ural_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; int error; @@ -474,18 +483,15 @@ ural_attach(device_t self) | IEEE80211_C_WPA /* 802.11i */ ; - memset(bands, 0, sizeof(bands)); - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - if (sc->rf_rev == RAL_RF_5222) - setbit(bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, bands); + ural_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_ifattach(ic); ic->ic_update_promisc = ural_update_promisc; ic->ic_raw_xmit = ural_raw_xmit; ic->ic_scan_start = ural_scan_start; ic->ic_scan_end = ural_scan_end; + ic->ic_getradiocaps = ural_getradiocaps; ic->ic_set_channel = ural_set_channel; ic->ic_parent = ural_parent; ic->ic_transmit = ural_transmit; @@ -1588,6 +1594,26 @@ ural_scan_end(struct ieee80211com *ic) } static void +ural_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + struct ural_softc *sc = ic->ic_softc; + uint8_t bands[IEEE80211_MODE_BYTES]; + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + ural_chan_2ghz, nitems(ural_chan_2ghz), bands, 0); + + if (sc->rf_rev == RAL_RF_5222) { + setbit(bands, IEEE80211_MODE_11A); + ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, + ural_chan_5ghz, nitems(ural_chan_5ghz), bands, 0); + } +} + +static void ural_set_channel(struct ieee80211com *ic) { struct ural_softc *sc = ic->ic_softc; From owner-svn-src-head@freebsd.org Thu May 26 15:45:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B371B4B885; Thu, 26 May 2016 15:45:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12A3A1CC4; Thu, 26 May 2016 15:45:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QFjbuE003364; Thu, 26 May 2016 15:45:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QFjaMH003360; Thu, 26 May 2016 15:45:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605261545.u4QFjaMH003360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 May 2016 15:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300750 - in head/sys/dev: extres/regulator gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 15:45:38 -0000 Author: ian Date: Thu May 26 15:45:36 2016 New Revision: 300750 URL: https://svnweb.freebsd.org/changeset/base/300750 Log: Rename gpiobus_map_pin() to gpiobus_acquire_pin(), to better reflect the fact that the caller is requesting exclusive use of the pin, and also to better match the inverse operation which is named gpiobus_release_pin(). Modified: head/sys/dev/extres/regulator/regulator_fixed.c head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/extres/regulator/regulator_fixed.c ============================================================================== --- head/sys/dev/extres/regulator/regulator_fixed.c Thu May 26 15:12:54 2016 (r300749) +++ head/sys/dev/extres/regulator/regulator_fixed.c Thu May 26 15:45:36 2016 (r300750) @@ -115,8 +115,8 @@ regnode_get_gpio_entry(struct gpiobus_pi } /* Reserve pin. */ - /* XXX Can we call gpiobus_map_pin() with gpio_list_mtx mutex held? */ - rv = gpiobus_map_pin(busdev, gpio_pin->pin); + /* XXX Can we call gpiobus_acquire_pin() with gpio_list_mtx held? */ + rv = gpiobus_acquire_pin(busdev, gpio_pin->pin); if (rv != 0) { mtx_unlock(&gpio_list_mtx); free(entry, M_FIXEDREGULATOR); Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu May 26 15:12:54 2016 (r300749) +++ head/sys/dev/gpio/gpiobus.c Thu May 26 15:45:36 2016 (r300750) @@ -260,7 +260,7 @@ gpiobus_free_ivars(struct gpiobus_ivar * } int -gpiobus_map_pin(device_t bus, uint32_t pin) +gpiobus_acquire_pin(device_t bus, uint32_t pin) { struct gpiobus_softc *sc; @@ -291,13 +291,13 @@ gpiobus_release_pin(device_t bus, uint32 /* Consistency check. */ if (pin >= sc->sc_npins) { device_printf(bus, - "gpiobus_map_pin: invalid pin %d, max=%d\n", + "gpiobus_acquire_pin: invalid pin %d, max=%d\n", pin, sc->sc_npins - 1); return (-1); } if (!sc->sc_pins[pin].mapped) { - device_printf(bus, "gpiobus_map_pin: pin %d is not mapped\n", pin); + device_printf(bus, "gpiobus_acquire_pin: pin %d is not mapped\n", pin); return (-1); } sc->sc_pins[pin].mapped = 0; @@ -330,7 +330,7 @@ gpiobus_parse_pins(struct gpiobus_softc if ((mask & (1 << i)) == 0) continue; /* Reserve the GPIO pin. */ - if (gpiobus_map_pin(sc->sc_busdev, i) != 0) { + if (gpiobus_acquire_pin(sc->sc_busdev, i) != 0) { gpiobus_free_ivars(devi); return (EINVAL); } Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Thu May 26 15:12:54 2016 (r300749) +++ head/sys/dev/gpio/gpiobusvar.h Thu May 26 15:45:36 2016 (r300750) @@ -137,7 +137,7 @@ int gpiobus_detach_bus(device_t); int gpiobus_init_softc(device_t); int gpiobus_alloc_ivars(struct gpiobus_ivar *); void gpiobus_free_ivars(struct gpiobus_ivar *); -int gpiobus_map_pin(device_t, uint32_t); +int gpiobus_acquire_pin(device_t, uint32_t); int gpiobus_release_pin(device_t, uint32_t); extern driver_t gpiobus_driver; Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu May 26 15:12:54 2016 (r300749) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu May 26 15:45:36 2016 (r300750) @@ -95,7 +95,7 @@ gpio_pin_get_by_ofw_impl(device_t consum return (ENXIO); /* Reserve GPIO pin. */ - rv = gpiobus_map_pin(busdev, pin.pin); + rv = gpiobus_acquire_pin(busdev, pin.pin); if (rv != 0) return (EBUSY); @@ -457,7 +457,7 @@ ofw_gpiobus_parse_gpios_impl(device_t co goto fail; } /* Reserve the GPIO pin. */ - if (gpiobus_map_pin(bussc->sc_busdev, (*pins)[j].pin) != 0) + if (gpiobus_acquire_pin(bussc->sc_busdev, (*pins)[j].pin) != 0) goto fail; j++; i += gpiocells + 1; From owner-svn-src-head@freebsd.org Thu May 26 15:56:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E71AB4BC16; Thu, 26 May 2016 15:56:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 306B71410; Thu, 26 May 2016 15:56:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QFuR9j007093; Thu, 26 May 2016 15:56:27 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QFuRHo007090; Thu, 26 May 2016 15:56:27 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261556.u4QFuRHo007090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 15:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300751 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 15:56:28 -0000 Author: avos Date: Thu May 26 15:56:27 2016 New Revision: 300751 URL: https://svnweb.freebsd.org/changeset/base/300751 Log: zyd: switch to ieee80211_add_channel_list_*() - Use device's channel list instead of default one (adds 12, 13 and 14 2GHz channels). - Add ic_getradiocaps() method. Differential Revision: https://reviews.freebsd.org/D6171 Modified: head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/usb/wlan/if_zydreg.h Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Thu May 26 15:45:36 2016 (r300750) +++ head/sys/dev/usb/wlan/if_zyd.c Thu May 26 15:56:27 2016 (r300751) @@ -164,6 +164,8 @@ static void zyd_stop(struct zyd_softc *) static int zyd_loadfirmware(struct zyd_softc *); static void zyd_scan_start(struct ieee80211com *); static void zyd_scan_end(struct ieee80211com *); +static void zyd_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void zyd_set_channel(struct ieee80211com *); static int zyd_rfmd_init(struct zyd_rf *); static int zyd_rfmd_switch_radio(struct zyd_rf *, int); @@ -334,7 +336,6 @@ zyd_attach(device_t dev) struct usb_attach_arg *uaa = device_get_ivars(dev); struct zyd_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; int error; @@ -388,15 +389,14 @@ zyd_attach(device_t dev) | IEEE80211_C_WPA /* 802.11i */ ; - memset(bands, 0, sizeof(bands)); - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - ieee80211_init_channels(ic, NULL, bands); + zyd_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_ifattach(ic); ic->ic_raw_xmit = zyd_raw_xmit; ic->ic_scan_start = zyd_scan_start; ic->ic_scan_end = zyd_scan_end; + ic->ic_getradiocaps = zyd_getradiocaps; ic->ic_set_channel = zyd_set_channel; ic->ic_vap_create = zyd_vap_create; ic->ic_vap_delete = zyd_vap_delete; @@ -2865,6 +2865,19 @@ zyd_scan_end(struct ieee80211com *ic) } static void +zyd_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + uint8_t bands[IEEE80211_MODE_BYTES]; + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + zyd_chan_2ghz, nitems(zyd_chan_2ghz), bands, 0); +} + +static void zyd_set_channel(struct ieee80211com *ic) { struct zyd_softc *sc = ic->ic_softc; Modified: head/sys/dev/usb/wlan/if_zydreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_zydreg.h Thu May 26 15:45:36 2016 (r300750) +++ head/sys/dev/usb/wlan/if_zydreg.h Thu May 26 15:56:27 2016 (r300751) @@ -421,6 +421,10 @@ #define ZYD_CR254 0x93f8 #define ZYD_CR255 0x93fc +/* nitems(ZYD_*_CHANTABLE) */ +static const uint8_t zyd_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; + /* copied nearly verbatim from the Linux driver rewrite */ #define ZYD_DEF_PHY \ { \ From owner-svn-src-head@freebsd.org Thu May 26 16:05:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68FDCB4BEFF; Thu, 26 May 2016 16:05:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43D431B46; Thu, 26 May 2016 16:05:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QG5J2e011014; Thu, 26 May 2016 16:05:19 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QG5JNJ011011; Thu, 26 May 2016 16:05:19 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261605.u4QG5JNJ011011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 16:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300752 - head/sys/dev/ral X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 16:05:20 -0000 Author: avos Date: Thu May 26 16:05:19 2016 New Revision: 300752 URL: https://svnweb.freebsd.org/changeset/base/300752 Log: ral: switch to ieee80211_add_channel_list_*() - Use device's channel list instead of default one (from ieee80211_init_channels()). - Add ic_getradiocaps() method. Added channels: - 2GHz (all): 12, 13, 14. - 5GHz: * rt2661: 165 * rt2860: 38, 46, 54, 62, 102, 110, 118, 126, 134, 151, 159, 165, 167, 169, 171, 173. Differential Revision: https://reviews.freebsd.org/D6182 Modified: head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2860.c Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Thu May 26 15:56:27 2016 (r300751) +++ head/sys/dev/ral/rt2560.c Thu May 26 16:05:19 2016 (r300752) @@ -117,6 +117,8 @@ static void rt2560_beacon_expire(struct static void rt2560_wakeup_expire(struct rt2560_softc *); static void rt2560_scan_start(struct ieee80211com *); static void rt2560_scan_end(struct ieee80211com *); +static void rt2560_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void rt2560_set_channel(struct ieee80211com *); static void rt2560_setup_tx_desc(struct rt2560_softc *, struct rt2560_tx_desc *, uint32_t, int, int, int, @@ -187,6 +189,14 @@ static const uint32_t rt2560_rf2525e_r2[ static const uint32_t rt2560_rf2526_r2[] = RT2560_RF2526_R2; static const uint32_t rt2560_rf2526_hi_r2[] = RT2560_RF2526_HI_R2; +static const uint8_t rt2560_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; + +static const uint8_t rt2560_chan_5ghz[] = + { 36, 40, 44, 48, 52, 56, 60, 64, + 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, + 149, 153, 157, 161 }; + static const struct { uint8_t chan; uint32_t r1, r2, r4; @@ -199,7 +209,6 @@ rt2560_attach(device_t dev, int id) { struct rt2560_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[IEEE80211_MODE_BYTES]; int error; sc->sc_dev = dev; @@ -278,12 +287,8 @@ rt2560_attach(device_t dev, int id) #endif ; - memset(bands, 0, sizeof(bands)); - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - if (sc->rf_rev == RT2560_RF_5222) - setbit(bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, bands); + rt2560_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_ifattach(ic); ic->ic_raw_xmit = rt2560_raw_xmit; @@ -291,6 +296,7 @@ rt2560_attach(device_t dev, int id) ic->ic_update_promisc = rt2560_update_promisc; ic->ic_scan_start = rt2560_scan_start; ic->ic_scan_end = rt2560_scan_end; + ic->ic_getradiocaps = rt2560_getradiocaps; ic->ic_set_channel = rt2560_set_channel; ic->ic_vap_create = rt2560_vap_create; @@ -2141,6 +2147,26 @@ rt2560_set_chan(struct rt2560_softc *sc, } static void +rt2560_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + struct rt2560_softc *sc = ic->ic_softc; + uint8_t bands[IEEE80211_MODE_BYTES]; + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + rt2560_chan_2ghz, nitems(rt2560_chan_2ghz), bands, 0); + + if (sc->rf_rev == RT2560_RF_5222) { + setbit(bands, IEEE80211_MODE_11A); + ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, + rt2560_chan_5ghz, nitems(rt2560_chan_5ghz), bands, 0); + } +} + +static void rt2560_set_channel(struct ieee80211com *ic) { struct rt2560_softc *sc = ic->ic_softc; Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Thu May 26 15:56:27 2016 (r300751) +++ head/sys/dev/ral/rt2661.c Thu May 26 16:05:19 2016 (r300752) @@ -113,6 +113,8 @@ static void rt2661_mcu_wakeup(struct rt static void rt2661_mcu_cmd_intr(struct rt2661_softc *); static void rt2661_scan_start(struct ieee80211com *); static void rt2661_scan_end(struct ieee80211com *); +static void rt2661_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void rt2661_set_channel(struct ieee80211com *); static void rt2661_setup_tx_desc(struct rt2661_softc *, struct rt2661_tx_desc *, uint32_t, uint16_t, int, @@ -193,13 +195,19 @@ static const struct rfprog { RT2661_RF5225_2 }; +static const uint8_t rt2661_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; +static const uint8_t rt2661_chan_5ghz[] = + { 36, 40, 44, 48, 52, 56, 60, 64, + 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, + 149, 153, 157, 161, 165 }; + int rt2661_attach(device_t dev, int id) { struct rt2661_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint32_t val; - uint8_t bands[IEEE80211_MODE_BYTES]; int error, ac, ntries; sc->sc_id = id; @@ -279,12 +287,8 @@ rt2661_attach(device_t dev, int id) #endif ; - memset(bands, 0, sizeof(bands)); - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - if (sc->rf_rev == RT2661_RF_5225 || sc->rf_rev == RT2661_RF_5325) - setbit(bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, bands); + rt2661_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_ifattach(ic); #if 0 @@ -2762,6 +2766,26 @@ rt2661_scan_end(struct ieee80211com *ic) } static void +rt2661_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + struct rt2661_softc *sc = ic->ic_softc; + uint8_t bands[IEEE80211_MODE_BYTES]; + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + rt2661_chan_2ghz, nitems(rt2661_chan_2ghz), bands, 0); + + if (sc->rf_rev == RT2661_RF_5225 || sc->rf_rev == RT2661_RF_5325) { + setbit(bands, IEEE80211_MODE_11A); + ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, + rt2661_chan_5ghz, nitems(rt2661_chan_5ghz), bands, 0); + } +} + +static void rt2661_set_channel(struct ieee80211com *ic) { struct rt2661_softc *sc = ic->ic_softc; Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Thu May 26 15:56:27 2016 (r300751) +++ head/sys/dev/ral/rt2860.c Thu May 26 16:05:19 2016 (r300752) @@ -138,6 +138,8 @@ static void rt2860_set_basicrates(struct const struct ieee80211_rateset *); static void rt2860_scan_start(struct ieee80211com *); static void rt2860_scan_end(struct ieee80211com *); +static void rt2860_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void rt2860_set_channel(struct ieee80211com *); static void rt2860_select_chan_group(struct rt2860_softc *, int); static void rt2860_set_chan(struct rt2860_softc *, u_int); @@ -226,13 +228,19 @@ static const struct { RT5392_DEF_RF }; +static const uint8_t rt2860_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; +static const uint8_t rt2860_chan_5ghz[] = + { 36, 38, 40, 44, 46, 48, 52, 54, 56, 60, 62, 64, 100, 102, 104, + 108, 110, 112, 116, 118, 120, 124, 126, 128, 132, 134, 136, 140, + 149, 151, 153, 157, 159, 161, 165, 167, 169, 171, 173 }; + int rt2860_attach(device_t dev, int id) { struct rt2860_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint32_t tmp; - uint8_t bands[IEEE80211_MODE_BYTES]; int error, ntries, qid; sc->sc_dev = dev; @@ -319,18 +327,15 @@ rt2860_attach(device_t dev, int id) | IEEE80211_C_WME /* 802.11e */ ; - memset(bands, 0, sizeof(bands)); - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850) - setbit(bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, bands); + rt2860_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_ifattach(ic); ic->ic_wme.wme_update = rt2860_updateedca; ic->ic_scan_start = rt2860_scan_start; ic->ic_scan_end = rt2860_scan_end; + ic->ic_getradiocaps = rt2860_getradiocaps; ic->ic_set_channel = rt2860_set_channel; ic->ic_updateslot = rt2860_updateslot; ic->ic_update_promisc = rt2860_update_promisc; @@ -2299,6 +2304,26 @@ rt2860_scan_end(struct ieee80211com *ic) } static void +rt2860_getradiocaps(struct ieee80211com *ic, int maxchans, int *nchans, + struct ieee80211_channel chans[]) +{ + struct rt2860_softc *sc = ic->ic_softc; + uint8_t bands[IEEE80211_MODE_BYTES]; + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + rt2860_chan_2ghz, nitems(rt2860_chan_2ghz), bands, 0); + + if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850) { + setbit(bands, IEEE80211_MODE_11A); + ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, + rt2860_chan_5ghz, nitems(rt2860_chan_5ghz), bands, 0); + } +} + +static void rt2860_set_channel(struct ieee80211com *ic) { struct rt2860_softc *sc = ic->ic_softc; From owner-svn-src-head@freebsd.org Thu May 26 16:15:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69335B4B218; Thu, 26 May 2016 16:15:11 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4332611E8; Thu, 26 May 2016 16:15:11 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QGFAuT014612; Thu, 26 May 2016 16:15:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QGFAfA014609; Thu, 26 May 2016 16:15:10 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261615.u4QGFAfA014609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 16:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300753 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 16:15:11 -0000 Author: avos Date: Thu May 26 16:15:10 2016 New Revision: 300753 URL: https://svnweb.freebsd.org/changeset/base/300753 Log: urtw: switch to ieee80211_add_channel_list_2ghz(). - Use device's channel list instead of default one (from ieee80211_init_channels()). - Add ic_getradiocaps() method. Modified: head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwreg.h Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Thu May 26 16:05:19 2016 (r300752) +++ head/sys/dev/usb/wlan/if_urtw.c Thu May 26 16:15:10 2016 (r300753) @@ -206,6 +206,9 @@ static uint8_t urtw_8225z2_agc[] = { 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31 }; +static const uint8_t urtw_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; + static uint32_t urtw_8225_channel[] = { 0x0000, /* dummy channel 0 */ 0x085c, /* 1 */ @@ -662,6 +665,8 @@ static int urtw_raw_xmit(struct ieee802 const struct ieee80211_bpf_params *); static void urtw_scan_start(struct ieee80211com *); static void urtw_scan_end(struct ieee80211com *); +static void urtw_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void urtw_set_channel(struct ieee80211com *); static void urtw_update_mcast(struct ieee80211com *); static int urtw_tx_start(struct urtw_softc *, @@ -785,7 +790,6 @@ urtw_attach(device_t dev) struct urtw_softc *sc = device_get_softc(dev); struct usb_attach_arg *uaa = device_get_ivars(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index = URTW_IFACE_INDEX; /* XXX */ uint16_t n_setup; uint32_t data; @@ -877,15 +881,16 @@ urtw_attach(device_t dev) IEEE80211_C_BGSCAN | /* capable of bg scanning */ IEEE80211_C_WPA; /* 802.11i */ - memset(bands, 0, sizeof(bands)); - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - ieee80211_init_channels(ic, NULL, bands); + /* XXX TODO: setup regdomain if URTW_EPROM_CHANPLAN_BY_HW bit is set.*/ + + urtw_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_ifattach(ic); ic->ic_raw_xmit = urtw_raw_xmit; ic->ic_scan_start = urtw_scan_start; ic->ic_scan_end = urtw_scan_end; + ic->ic_getradiocaps = urtw_getradiocaps; ic->ic_set_channel = urtw_set_channel; ic->ic_updateslot = urtw_updateslot; ic->ic_vap_create = urtw_vap_create; @@ -1564,6 +1569,19 @@ urtw_scan_end(struct ieee80211com *ic) } static void +urtw_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + uint8_t bands[IEEE80211_MODE_BYTES]; + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + urtw_chan_2ghz, nitems(urtw_chan_2ghz), bands, 0); +} + +static void urtw_set_channel(struct ieee80211com *ic) { struct urtw_softc *sc = ic->ic_softc; Modified: head/sys/dev/usb/wlan/if_urtwreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwreg.h Thu May 26 16:05:19 2016 (r300752) +++ head/sys/dev/usb/wlan/if_urtwreg.h Thu May 26 16:15:10 2016 (r300753) @@ -253,6 +253,7 @@ /* for EEPROM */ #define URTW_EPROM_CHANPLAN 0x03 +#define URTW_EPROM_CHANPLAN_BY_HW (0x80) #define URTW_EPROM_TXPW_BASE 0x05 #define URTW_EPROM_RFCHIPID 0x06 #define URTW_EPROM_RFCHIPID_RTL8225U (5) From owner-svn-src-head@freebsd.org Thu May 26 16:39:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3463AB4BBBB; Thu, 26 May 2016 16:39:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BCB41437; Thu, 26 May 2016 16:39:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QGdCH2022611; Thu, 26 May 2016 16:39:12 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QGdBZY022606; Thu, 26 May 2016 16:39:11 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261639.u4QGdBZY022606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 16:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300754 - in head/sys/dev: rtwn urtwn 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 16:39:13 -0000 Author: avos Date: Thu May 26 16:39:11 2016 New Revision: 300754 URL: https://svnweb.freebsd.org/changeset/base/300754 Log: urtwn, rtwn, rsu: switch to ieee80211_add_channel_list_2ghz(). - Use device's channel list instead of default one (from ieee80211_init_channels()); adds 12 - 14 2GHz channels. - Add ic_getradiocaps() method. Modified: head/sys/dev/rtwn/if_rtwn.c head/sys/dev/rtwn/if_rtwnreg.h head/sys/dev/urtwn/if_urtwn.c head/sys/dev/urtwn/if_urtwnreg.h head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Thu May 26 16:15:10 2016 (r300753) +++ head/sys/dev/rtwn/if_rtwn.c Thu May 26 16:39:11 2016 (r300754) @@ -172,6 +172,8 @@ static void rtwn_set_rx_bssid_all(struct static void rtwn_set_gain(struct rtwn_softc *, uint8_t); static void rtwn_scan_start(struct ieee80211com *); static void rtwn_scan_end(struct ieee80211com *); +static void rtwn_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void rtwn_set_channel(struct ieee80211com *); static void rtwn_update_mcast(struct ieee80211com *); static void rtwn_set_chan(struct rtwn_softc *, @@ -230,6 +232,9 @@ MODULE_DEPEND(rtwn, pci, 1, 1, 1); MODULE_DEPEND(rtwn, wlan, 1, 1, 1); MODULE_DEPEND(rtwn, firmware, 1, 1, 1); +static const uint8_t rtwn_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; + static int rtwn_probe(device_t dev) { @@ -251,7 +256,6 @@ rtwn_attach(device_t dev) struct rtwn_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint32_t lcsr; - uint8_t bands[IEEE80211_MODE_BYTES]; int i, count, error, rid; sc->sc_dev = dev; @@ -352,17 +356,18 @@ rtwn_attach(device_t dev) | IEEE80211_C_WME /* 802.11e */ ; - memset(bands, 0, sizeof(bands)); - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - ieee80211_init_channels(ic, NULL, bands); + /* XXX TODO: setup regdomain if R92C_CHANNEL_PLAN_BY_HW bit is set. */ + + rtwn_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_ifattach(ic); ic->ic_wme.wme_update = rtwn_updateedca; ic->ic_update_mcast = rtwn_update_mcast; - ic->ic_scan_start =rtwn_scan_start; + ic->ic_scan_start = rtwn_scan_start; ic->ic_scan_end = rtwn_scan_end; + ic->ic_getradiocaps = rtwn_getradiocaps; ic->ic_set_channel = rtwn_set_channel; ic->ic_raw_xmit = rtwn_raw_xmit; ic->ic_transmit = rtwn_transmit; @@ -2717,6 +2722,19 @@ rtwn_scan_end(struct ieee80211com *ic) } static void +rtwn_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + uint8_t bands[IEEE80211_MODE_BYTES]; + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + rtwn_chan_2ghz, nitems(rtwn_chan_2ghz), bands, 0); +} + +static void rtwn_set_channel(struct ieee80211com *ic) { struct rtwn_softc *sc = ic->ic_softc; Modified: head/sys/dev/rtwn/if_rtwnreg.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnreg.h Thu May 26 16:15:10 2016 (r300753) +++ head/sys/dev/rtwn/if_rtwnreg.h Thu May 26 16:39:11 2016 (r300754) @@ -1014,6 +1014,8 @@ struct r92c_rom { uint8_t rf_opt3; uint8_t rf_opt4; uint8_t channel_plan; +#define R92C_CHANNEL_PLAN_BY_HW 0x80 + uint8_t version; uint8_t curstomer_id; } __packed; Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Thu May 26 16:15:10 2016 (r300753) +++ head/sys/dev/urtwn/if_urtwn.c Thu May 26 16:39:11 2016 (r300754) @@ -350,6 +350,8 @@ static void urtwn_set_rx_bssid_all(stru static void urtwn_set_gain(struct urtwn_softc *, uint8_t); static void urtwn_scan_start(struct ieee80211com *); static void urtwn_scan_end(struct ieee80211com *); +static void urtwn_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void urtwn_set_channel(struct ieee80211com *); static int urtwn_wme_update(struct ieee80211com *); static void urtwn_update_slot(struct ieee80211com *); @@ -458,6 +460,9 @@ static const struct wme_to_queue { { R92C_EDCA_VO_PARAM, URTWN_BULK_TX_VO} }; +static const uint8_t urtwn_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; + static int urtwn_match(device_t self) { @@ -492,7 +497,6 @@ urtwn_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct urtwn_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[IEEE80211_MODE_BYTES]; int error; device_set_usb_desc(self); @@ -608,17 +612,16 @@ urtwn_attach(device_t self) ic->ic_rxstream = sc->nrxchains; } - memset(bands, 0, sizeof(bands)); - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - if (urtwn_enable_11n) - setbit(bands, IEEE80211_MODE_11NG); - ieee80211_init_channels(ic, NULL, bands); + /* XXX TODO: setup regdomain if R92C_CHANNEL_PLAN_BY_HW bit is set. */ + + urtwn_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_ifattach(ic); ic->ic_raw_xmit = urtwn_raw_xmit; ic->ic_scan_start = urtwn_scan_start; ic->ic_scan_end = urtwn_scan_end; + ic->ic_getradiocaps = urtwn_getradiocaps; ic->ic_set_channel = urtwn_set_channel; ic->ic_transmit = urtwn_transmit; ic->ic_parent = urtwn_parent; @@ -4744,6 +4747,21 @@ urtwn_scan_end(struct ieee80211com *ic) } static void +urtwn_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + uint8_t bands[IEEE80211_MODE_BYTES]; + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + if (urtwn_enable_11n) + setbit(bands, IEEE80211_MODE_11NG); + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + urtwn_chan_2ghz, nitems(urtwn_chan_2ghz), bands, 0); +} + +static void urtwn_set_channel(struct ieee80211com *ic) { struct urtwn_softc *sc = ic->ic_softc; Modified: head/sys/dev/urtwn/if_urtwnreg.h ============================================================================== --- head/sys/dev/urtwn/if_urtwnreg.h Thu May 26 16:15:10 2016 (r300753) +++ head/sys/dev/urtwn/if_urtwnreg.h Thu May 26 16:39:11 2016 (r300754) @@ -1018,6 +1018,8 @@ struct r92c_rom { uint8_t rf_opt3; uint8_t rf_opt4; uint8_t channel_plan; +#define R92C_CHANNEL_PLAN_BY_HW 0x80 + uint8_t version; uint8_t customer_id; } __packed; Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Thu May 26 16:15:10 2016 (r300753) +++ head/sys/dev/usb/wlan/if_rsu.c Thu May 26 16:39:11 2016 (r300754) @@ -170,6 +170,8 @@ static struct ieee80211vap * static void rsu_vap_delete(struct ieee80211vap *); static void rsu_scan_start(struct ieee80211com *); static void rsu_scan_end(struct ieee80211com *); +static void rsu_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void rsu_set_channel(struct ieee80211com *); static void rsu_update_mcast(struct ieee80211com *); static int rsu_alloc_rx_list(struct rsu_softc *); @@ -252,6 +254,9 @@ MODULE_DEPEND(rsu, firmware, 1, 1, 1); MODULE_VERSION(rsu, 1); USB_PNP_HOST_INFO(rsu_devs); +static const uint8_t rsu_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; + static uint8_t rsu_wme_ac_xfer_map[4] = { [WME_AC_BE] = RSU_BULK_TX_BE_BK, [WME_AC_BK] = RSU_BULK_TX_BE_BK, @@ -404,7 +409,6 @@ rsu_attach(device_t self) struct rsu_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; int error; - uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; struct usb_interface *iface; const char *rft; @@ -534,18 +538,14 @@ rsu_attach(device_t self) ic->ic_rxstream = sc->sc_nrxstream; } - /* Set supported .11b and .11g rates. */ - memset(bands, 0, sizeof(bands)); - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - if (sc->sc_ht) - setbit(bands, IEEE80211_MODE_11NG); - ieee80211_init_channels(ic, NULL, bands); + rsu_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_ifattach(ic); ic->ic_raw_xmit = rsu_raw_xmit; ic->ic_scan_start = rsu_scan_start; ic->ic_scan_end = rsu_scan_end; + ic->ic_getradiocaps = rsu_getradiocaps; ic->ic_set_channel = rsu_set_channel; ic->ic_vap_create = rsu_vap_create; ic->ic_vap_delete = rsu_vap_delete; @@ -699,6 +699,23 @@ rsu_scan_end(struct ieee80211com *ic) } static void +rsu_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + struct rsu_softc *sc = ic->ic_softc; + uint8_t bands[IEEE80211_MODE_BYTES]; + + /* Set supported .11b and .11g rates. */ + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + if (sc->sc_ht) + setbit(bands, IEEE80211_MODE_11NG); + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + rsu_chan_2ghz, nitems(rsu_chan_2ghz), bands, 0); +} + +static void rsu_set_channel(struct ieee80211com *ic __unused) { /* We are unable to switch channels, yet. */ From owner-svn-src-head@freebsd.org Thu May 26 16:48:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8750FB4BD76; Thu, 26 May 2016 16:48:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E52E1A52; Thu, 26 May 2016 16:48:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QGmKw5026150; Thu, 26 May 2016 16:48:20 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QGmKZ2026149; Thu, 26 May 2016 16:48:20 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261648.u4QGmKZ2026149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 16:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300755 - head/sys/dev/bwi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 16:48:21 -0000 Author: avos Date: Thu May 26 16:48:20 2016 New Revision: 300755 URL: https://svnweb.freebsd.org/changeset/base/300755 Log: bwi: switch to ieee80211_add_channel_list_2ghz(). - Use device's channel list instead of default one (from ieee80211_init_channels()); adds 12 - 14 2GHz channels. - Add ic_getradiocaps() method. Modified: head/sys/dev/bwi/if_bwi.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Thu May 26 16:39:11 2016 (r300754) +++ head/sys/dev/bwi/if_bwi.c Thu May 26 16:48:20 2016 (r300755) @@ -110,6 +110,8 @@ static int bwi_raw_xmit(struct ieee80211 const struct ieee80211_bpf_params *); static void bwi_watchdog(void *); static void bwi_scan_start(struct ieee80211com *); +static void bwi_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel[]); static void bwi_set_channel(struct ieee80211com *); static void bwi_scan_end(struct ieee80211com *); static int bwi_newstate(struct ieee80211vap *, enum ieee80211_state, int); @@ -303,6 +305,9 @@ static const struct { [108] = { 7, 3 } }; +static const uint8_t bwi_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; + #ifdef BWI_DEBUG #ifdef BWI_DEBUG_VERBOSE static uint32_t bwi_debug = BWI_DBG_ATTACH | BWI_DBG_INIT | BWI_DBG_TXPOWER; @@ -356,7 +361,6 @@ bwi_attach(struct bwi_softc *sc) device_t dev = sc->sc_dev; struct bwi_mac *mac; struct bwi_phy *phy; - uint8_t bands[IEEE80211_MODE_BYTES]; int i, error; BWI_LOCK_INIT(sc); @@ -453,15 +457,12 @@ bwi_attach(struct bwi_softc *sc) /* * Setup ratesets, phytype, channels and get MAC address */ - memset(bands, 0, sizeof(bands)); if (phy->phy_mode == IEEE80211_MODE_11B || phy->phy_mode == IEEE80211_MODE_11G) { - setbit(bands, IEEE80211_MODE_11B); if (phy->phy_mode == IEEE80211_MODE_11B) { ic->ic_phytype = IEEE80211_T_DS; } else { ic->ic_phytype = IEEE80211_T_OFDM; - setbit(bands, IEEE80211_MODE_11G); } bwi_get_eaddr(sc, BWI_SPROM_11BG_EADDR, ic->ic_macaddr); @@ -475,7 +476,6 @@ bwi_attach(struct bwi_softc *sc) } } else if (phy->phy_mode == IEEE80211_MODE_11A) { /* TODO:11A */ - setbit(bands, IEEE80211_MODE_11A); error = ENXIO; goto fail; } else { @@ -487,7 +487,8 @@ bwi_attach(struct bwi_softc *sc) BWI_SPROM_CARD_INFO_LOCALE); DPRINTF(sc, BWI_DBG_ATTACH, "locale: %d\n", sc->sc_locale); /* XXX use locale */ - ieee80211_init_channels(ic, NULL, bands); + bwi_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ic->ic_softc = sc; ic->ic_name = device_get_nameunit(dev); @@ -509,6 +510,7 @@ bwi_attach(struct bwi_softc *sc) ic->ic_updateslot = bwi_updateslot; ic->ic_scan_start = bwi_scan_start; ic->ic_scan_end = bwi_scan_end; + ic->ic_getradiocaps = bwi_getradiocaps; ic->ic_set_channel = bwi_set_channel; ic->ic_transmit = bwi_transmit; ic->ic_parent = bwi_parent; @@ -1676,6 +1678,43 @@ bwi_scan_start(struct ieee80211com *ic) } static void +bwi_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + struct bwi_softc *sc = ic->ic_softc; + struct bwi_mac *mac; + struct bwi_phy *phy; + uint8_t bands[IEEE80211_MODE_BYTES]; + + /* + * XXX First MAC is known to exist + * TODO2 + */ + mac = &sc->sc_mac[0]; + phy = &mac->mac_phy; + + memset(bands, 0, sizeof(bands)); + switch (phy->phy_mode) { + case IEEE80211_MODE_11G: + setbit(bands, IEEE80211_MODE_11G); + /* FALLTHROUGH */ + case IEEE80211_MODE_11B: + setbit(bands, IEEE80211_MODE_11B); + break; + case IEEE80211_MODE_11A: + /* TODO:11A */ + setbit(bands, IEEE80211_MODE_11A); + device_printf(sc->sc_dev, "no 11a support\n"); + return; + default: + panic("unknown phymode %d\n", phy->phy_mode); + } + + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + bwi_chan_2ghz, nitems(bwi_chan_2ghz), bands, 0); +} + +static void bwi_set_channel(struct ieee80211com *ic) { struct bwi_softc *sc = ic->ic_softc; From owner-svn-src-head@freebsd.org Thu May 26 16:51:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 783DBB4BEDD; Thu, 26 May 2016 16:51:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AB3B1D7B; Thu, 26 May 2016 16:51:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QGpc1i026892; Thu, 26 May 2016 16:51:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QGpcOQ026891; Thu, 26 May 2016 16:51:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605261651.u4QGpcOQ026891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 May 2016 16:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300756 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 16:51:39 -0000 Author: kib Date: Thu May 26 16:51:38 2016 New Revision: 300756 URL: https://svnweb.freebsd.org/changeset/base/300756 Log: Style changes to some most outrageous violations in vm_object_collapse(). Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu May 26 16:48:20 2016 (r300755) +++ head/sys/vm/vm_object.c Thu May 26 16:51:38 2016 (r300756) @@ -1669,11 +1669,11 @@ vm_object_qcollapse(vm_object_t object) void vm_object_collapse(vm_object_t object) { + vm_object_t backing_object, new_backing_object; + VM_OBJECT_ASSERT_WLOCKED(object); - - while (TRUE) { - vm_object_t backing_object; + while (TRUE) { /* * Verify that the conditions are right for collapse: * @@ -1699,14 +1699,13 @@ vm_object_collapse(vm_object_t object) break; } - if ( - object->paging_in_progress != 0 || - backing_object->paging_in_progress != 0 - ) { + if (object->paging_in_progress != 0 || + backing_object->paging_in_progress != 0) { vm_object_qcollapse(object); VM_OBJECT_WUNLOCK(backing_object); break; } + /* * We know that we can either collapse the backing object (if * the parent is the only reference to it) or (perhaps) have @@ -1796,8 +1795,6 @@ vm_object_collapse(vm_object_t object) object_collapses++; } else { - vm_object_t new_backing_object; - /* * If we do not entirely shadow the backing object, * there is nothing we can do so we give up. From owner-svn-src-head@freebsd.org Thu May 26 16:53:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA1DAB4BFD9; Thu, 26 May 2016 16:53:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B80371FD3; Thu, 26 May 2016 16:53:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QGrovj029605; Thu, 26 May 2016 16:53:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QGroHo029604; Thu, 26 May 2016 16:53:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605261653.u4QGroHo029604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 May 2016 16:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300757 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 16:53:52 -0000 Author: ian Date: Thu May 26 16:53:50 2016 New Revision: 300757 URL: https://svnweb.freebsd.org/changeset/base/300757 Log: Fix a typo in a comment. Modified: head/sys/dev/ofw/ofw_bus_subr.h Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Thu May 26 16:51:38 2016 (r300756) +++ head/sys/dev/ofw/ofw_bus_subr.h Thu May 26 16:53:50 2016 (r300757) @@ -114,7 +114,7 @@ phandle_t ofw_bus_find_compatible(phandl /* Helper to search for a child with a given name */ phandle_t ofw_bus_find_child(phandle_t, const char *); -/* Helper routine to find a device_t child matchig a given phandle_t */ +/* Helper routine to find a device_t child matching a given phandle_t */ device_t ofw_bus_find_child_device_by_phandle(device_t bus, phandle_t node); /* Helper routines for parsing lists */ From owner-svn-src-head@freebsd.org Thu May 26 16:59:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E23A4B4A0E8; Thu, 26 May 2016 16:59:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B02701201; Thu, 26 May 2016 16:59:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QGxTKk029855; Thu, 26 May 2016 16:59:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QGxTkx029854; Thu, 26 May 2016 16:59:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605261659.u4QGxTkx029854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 May 2016 16:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300758 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 16:59:31 -0000 Author: kib Date: Thu May 26 16:59:29 2016 New Revision: 300758 URL: https://svnweb.freebsd.org/changeset/base/300758 Log: Prevent parallel object collapses. Both vm_object_collapse_scan() and swap_pager_copy() might unlock the object, which allows the parallel collapse to execute. Besides destroying the object, it also might move the reference from parent to the backing object, firing the assertion ref_count == 1. Collapses are prevented by bumping paging_in_progress counters on both the object and its backing object. Reported by: cem Tested by: pho (previous version) Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D6085 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu May 26 16:53:50 2016 (r300757) +++ head/sys/vm/vm_object.c Thu May 26 16:59:29 2016 (r300758) @@ -1717,6 +1717,9 @@ vm_object_collapse(vm_object_t object) * case. */ if (backing_object->ref_count == 1) { + vm_object_pip_add(object, 1); + vm_object_pip_add(backing_object, 1); + /* * If there is exactly one reference to the backing * object, we can collapse it into the parent. @@ -1788,11 +1791,13 @@ vm_object_collapse(vm_object_t object) KASSERT(backing_object->ref_count == 1, ( "backing_object %p was somehow re-referenced during collapse!", backing_object)); + vm_object_pip_wakeup(backing_object); backing_object->type = OBJT_DEAD; backing_object->ref_count = 0; VM_OBJECT_WUNLOCK(backing_object); vm_object_destroy(backing_object); + vm_object_pip_wakeup(object); object_collapses++; } else { /* From owner-svn-src-head@freebsd.org Thu May 26 17:06:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7A63B4A347; Thu, 26 May 2016 17:06:44 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A8A81886; Thu, 26 May 2016 17:06:44 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QH6hnA033458; Thu, 26 May 2016 17:06:43 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QH6hUF033457; Thu, 26 May 2016 17:06:43 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605261706.u4QH6hUF033457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 17:06:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300759 - head/sys/dev/ral X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 17:06:44 -0000 Author: avos Date: Thu May 26 17:06:43 2016 New Revision: 300759 URL: https://svnweb.freebsd.org/changeset/base/300759 Log: ral: add missing ic_getradiocaps() assignment. Modified: head/sys/dev/ral/rt2661.c Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Thu May 26 16:59:29 2016 (r300758) +++ head/sys/dev/ral/rt2661.c Thu May 26 17:06:43 2016 (r300759) @@ -296,6 +296,7 @@ rt2661_attach(device_t dev, int id) #endif ic->ic_scan_start = rt2661_scan_start; ic->ic_scan_end = rt2661_scan_end; + ic->ic_getradiocaps = rt2661_getradiocaps; ic->ic_set_channel = rt2661_set_channel; ic->ic_updateslot = rt2661_update_slot; ic->ic_update_promisc = rt2661_update_promisc; From owner-svn-src-head@freebsd.org Thu May 26 17:54:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A22E4B4B25F; Thu, 26 May 2016 17:54:23 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C8D91474; Thu, 26 May 2016 17:54:23 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from toad2.stack.nl (toad2.stack.nl [IPv6:2001:610:1108:5010::161]) by mx1.stack.nl (Postfix) with ESMTP id E9DA1B80A9; Thu, 26 May 2016 19:54:19 +0200 (CEST) Received: by toad2.stack.nl (Postfix, from userid 1677) id E10A4892B2; Thu, 26 May 2016 19:54:20 +0200 (CEST) Date: Thu, 26 May 2016 19:54:20 +0200 From: Jilles Tjoelker To: John Baldwin Cc: Alan Somers , Peter Wemm , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r300557 - head/usr.sbin/apmd Message-ID: <20160526175420.GA31199@stack.nl> References: <201605240315.u4O3FkMt001717@repo.freebsd.org> <2084098.Ir36lcS1Gf@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2084098.Ir36lcS1Gf@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 17:54:23 -0000 On Tue, May 24, 2016 at 08:52:32AM -0700, John Baldwin wrote: > On Monday, May 23, 2016 09:24:41 PM Alan Somers wrote: > > On Mon, May 23, 2016 at 9:15 PM, Peter Wemm wrote: > > > Author: peter > > > Date: Tue May 24 03:15:46 2016 > > > New Revision: 300557 > > > URL: https://svnweb.freebsd.org/changeset/base/300557 > > > Log: > > > It seems is a new prerequisite for after > > > r300539. Attempt to fix the build for i386. > > > Modified: > > > head/usr.sbin/apmd/apmd.c > > > head/usr.sbin/apmd/apmdlex.l > > > head/usr.sbin/apmd/apmdparse.y > > Are you sure this is necessary, even after 300544? > Actually, we try to avoid nested includes when possible for userland, > so I'd be inclined to drop the nested include and just > add to the places that need it. Userland code in the > base system is supposed to have or as the > first #include anyway (which apmd was not following), so any fixes to > userland are probably style fixes anyway. This is traditional BSD convention, but headers specified by POSIX work differently. POSIX headers can be included alone, so files that only include POSIX headers rarely need #include . This often causes some ugliness in the header file to use hidden names for things to reduce namespace pollution. Since is not specified by POSIX, it is not required to work without prerequisites. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Thu May 26 18:01:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 908CAB4B3CB; Thu, 26 May 2016 18:01:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 492D519EC; Thu, 26 May 2016 18:01:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QI13iq051784; Thu, 26 May 2016 18:01:03 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QI13ui051783; Thu, 26 May 2016 18:01:03 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605261801.u4QI13ui051783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 26 May 2016 18:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300760 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 18:01:04 -0000 Author: adrian Date: Thu May 26 18:01:03 2016 New Revision: 300760 URL: https://svnweb.freebsd.org/changeset/base/300760 Log: [siba] use the generic bus methods where appropriate. Submitted by: jhibbits Differential Revision: https://reviews.freebsd.org/D802 Modified: head/sys/dev/siba/siba_bwn.c Modified: head/sys/dev/siba/siba_bwn.c ============================================================================== --- head/sys/dev/siba/siba_bwn.c Thu May 26 17:06:43 2016 (r300759) +++ head/sys/dev/siba/siba_bwn.c Thu May 26 18:01:03 2016 (r300760) @@ -177,43 +177,17 @@ siba_bwn_detach(device_t dev) } static int -siba_bwn_shutdown(device_t dev) -{ - device_t *devlistp; - int devcnt, error = 0, i; - - error = device_get_children(dev, &devlistp, &devcnt); - if (error != 0) - return (error); - - for (i = 0 ; i < devcnt ; i++) - device_shutdown(devlistp[i]); - free(devlistp, M_TEMP); - return (0); -} - -static int siba_bwn_suspend(device_t dev) { struct siba_bwn_softc *ssc = device_get_softc(dev); struct siba_softc *siba = &ssc->ssc_siba; - device_t *devlistp; - int devcnt, error = 0, i, j; + int error; + + error = bus_generic_suspend(dev); - error = device_get_children(dev, &devlistp, &devcnt); if (error != 0) return (error); - for (i = 0 ; i < devcnt ; i++) { - error = DEVICE_SUSPEND(devlistp[i]); - if (error) { - for (j = 0; j < i; j++) - DEVICE_RESUME(devlistp[j]); - free(devlistp, M_TEMP); - return (error); - } - } - free(devlistp, M_TEMP); return (siba_core_suspend(siba)); } @@ -222,20 +196,14 @@ siba_bwn_resume(device_t dev) { struct siba_bwn_softc *ssc = device_get_softc(dev); struct siba_softc *siba = &ssc->ssc_siba; - device_t *devlistp; - int devcnt, error = 0, i; + int error; error = siba_core_resume(siba); if (error != 0) return (error); - error = device_get_children(dev, &devlistp, &devcnt); - if (error != 0) - return (error); + bus_generic_resume(dev); - for (i = 0 ; i < devcnt ; i++) - DEVICE_RESUME(devlistp[i]); - free(devlistp, M_TEMP); return (0); } @@ -410,7 +378,7 @@ static device_method_t siba_bwn_methods[ DEVMETHOD(device_probe, siba_bwn_probe), DEVMETHOD(device_attach, siba_bwn_attach), DEVMETHOD(device_detach, siba_bwn_detach), - DEVMETHOD(device_shutdown, siba_bwn_shutdown), + DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, siba_bwn_suspend), DEVMETHOD(device_resume, siba_bwn_resume), From owner-svn-src-head@freebsd.org Thu May 26 18:18:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B04AB4B852; Thu, 26 May 2016 18:18:09 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1794412CD; Thu, 26 May 2016 18:18:09 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id C3DC7CCD; Thu, 26 May 2016 11:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1464286688; bh=TIlevw0EqVITpSr4tPhOTiHmfKvwMHR7FBuekkRJoaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iZkyHnQmOf+MVqHEaS5yQ6y/i2kIIKLzZU9cWtpNK/dKVa3XWf8dBzmCaCdMbnLsi nmPX/L0tDZ+G4KFndahw0Ml9mVFVpLI7wSxlWMmekJKudWv/EaVvqyuMCsCp7Aexsj 28AYhm/Pr1vEvq4IZUiUB3XrQGs89E3CHVNjrrdA= From: Peter Wemm To: Jilles Tjoelker Cc: John Baldwin , Alan Somers , Peter Wemm , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r300557 - head/usr.sbin/apmd Date: Thu, 26 May 2016 11:18:03 -0700 Message-ID: <47237366.96sRQ3voAD@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160526175420.GA31199@stack.nl> References: <201605240315.u4O3FkMt001717@repo.freebsd.org> <2084098.Ir36lcS1Gf@ralph.baldwin.cx> <20160526175420.GA31199@stack.nl> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1848827.f2x5KYXUg7"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 18:18:09 -0000 --nextPart1848827.f2x5KYXUg7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Thursday, May 26, 2016 07:54:20 PM Jilles Tjoelker wrote: > On Tue, May 24, 2016 at 08:52:32AM -0700, John Baldwin wrote: > > On Monday, May 23, 2016 09:24:41 PM Alan Somers wrote: > > > On Mon, May 23, 2016 at 9:15 PM, Peter Wemm w= rote: > > > > Author: peter > > > > Date: Tue May 24 03:15:46 2016 > > > > New Revision: 300557 > > > > URL: https://svnweb.freebsd.org/changeset/base/300557 > > > >=20 > > > > Log: > > > > It seems is a new prerequisite for after > > > > r300539. Attempt to fix the build for i386. > > > >=20 > > > > Modified: > > > > head/usr.sbin/apmd/apmd.c > > > > head/usr.sbin/apmd/apmdlex.l > > > > head/usr.sbin/apmd/apmdparse.y > > >=20 > > > Are you sure this is necessary, even after 300544? > >=20 > > Actually, we try to avoid nested includes when possible for userlan= d, > > so I'd be inclined to drop the nested include and jus= t > > add to the places that need it. Userland code in the= > > base system is supposed to have or as t= he > > first #include anyway (which apmd was not following), so any fixes = to > > userland are probably style fixes anyway. >=20 > This is traditional BSD convention, but headers specified by POSIX wo= rk > differently. POSIX headers can be included alone, so files that only > include POSIX headers rarely need #include . This often > causes some ugliness in the header file to use hidden names for thing= s > to reduce namespace pollution. >=20 > Since is not specified by POSIX, it is not required to > work without prerequisites. FWIW I have no investment in the commit I made - I needed it to compile= for=20 the cluster. Feel free to change/revert my commit so long as world com= piles. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart1848827.f2x5KYXUg7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJXRz3bAAoJEDXWlwnsgJ4EgQIIANHjw5AVkQjvTr9493oSXrqD qLb5GQLL95B2CMcTK8R121R2AEnaK/QsvebrIwMSrvD7EiKZbvKoCmTWy0tIjMc3 YumfZ0TmCw9NMbQ3rZR1LtECyxKshz+tc8EtfnbipUxZJrc75AFY5txzgQSwNvAN aMKrj9XSk9jCSmjXqa6X/gNzDjg9M73M7L4rzZSq6pEkyYvIk8mXNldKtJfcQ7c0 Lkv64X2TNUtOlNTHQ0ARY2DrIh0rMKdOEhOXSBMab5lHK5C+N5dUy1caIjOHGkxT j+00YGKBWg4xchPLg5ZlFQED+ZEP6zSPPwuMWC0zPzRmEaR4D4kBHg5MZt9HP28= =mt8b -----END PGP SIGNATURE----- --nextPart1848827.f2x5KYXUg7-- From owner-svn-src-head@freebsd.org Thu May 26 18:24:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A707B4BA58; Thu, 26 May 2016 18:24:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D2741A5B; Thu, 26 May 2016 18:24:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QIO0rr062742; Thu, 26 May 2016 18:24:00 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QIO0if062741; Thu, 26 May 2016 18:24:00 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605261824.u4QIO0if062741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 26 May 2016 18:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300761 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 18:24:01 -0000 Author: gjb Date: Thu May 26 18:24:00 2016 New Revision: 300761 URL: https://svnweb.freebsd.org/changeset/base/300761 Log: Disconnect the AZURE target from the CLOUDWARE list. Microsoft has graciously overtaken publication of FreeBSD on Azure since 10.3-RELEASE. Many thanks to Microsoft for their support of FreeBSD on Azure. The configuration file and Makefile.azure are not (yet) planned to be removed, as they may be useful in the future. Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.vm Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Thu May 26 18:01:03 2016 (r300760) +++ head/release/Makefile.vm Thu May 26 18:24:00 2016 (r300761) @@ -15,8 +15,7 @@ VMDK_DESC= VMWare, VirtualBox disk image QCOW2_DESC= Qemu, KVM disk image RAW_DESC= Unformatted raw disk image -CLOUDWARE?= AZURE \ - EC2 \ +CLOUDWARE?= EC2 \ GCE \ OPENSTACK \ VAGRANT-VIRTUALBOX \ From owner-svn-src-head@freebsd.org Thu May 26 18:26:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9997B4BB2F; Thu, 26 May 2016 18:26:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA4CB1C9B; Thu, 26 May 2016 18:26:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QIQi8e062913; Thu, 26 May 2016 18:26:44 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QIQipa062912; Thu, 26 May 2016 18:26:44 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605261826.u4QIQipa062912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 26 May 2016 18:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300762 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 18:26:46 -0000 Author: gjb Date: Thu May 26 18:26:44 2016 New Revision: 300762 URL: https://svnweb.freebsd.org/changeset/base/300762 Log: Disconnect the OPENSTACK target from the CLOUDWARE list. This was reported to not work as expected, and feedback following the report was never received. In addition, we do not publish these anywhere publicly. The configuration file is not (yet) removed, in hopes that the remaining details on the original issues can be resolved, and we can publish the resulting images in the future. Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.vm Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Thu May 26 18:24:00 2016 (r300761) +++ head/release/Makefile.vm Thu May 26 18:26:44 2016 (r300762) @@ -17,7 +17,6 @@ RAW_DESC= Unformatted raw disk image CLOUDWARE?= EC2 \ GCE \ - OPENSTACK \ VAGRANT-VIRTUALBOX \ VAGRANT-VMWARE AZURE_FORMAT= vhdf From owner-svn-src-head@freebsd.org Thu May 26 18:28:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A3E4B4BBB7; Thu, 26 May 2016 18:28:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A6CB1E15; Thu, 26 May 2016 18:28:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QISAHw063004; Thu, 26 May 2016 18:28:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QISA6e063003; Thu, 26 May 2016 18:28:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605261828.u4QISA6e063003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 26 May 2016 18:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300763 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 18:28:11 -0000 Author: jhb Date: Thu May 26 18:28:10 2016 New Revision: 300763 URL: https://svnweb.freebsd.org/changeset/base/300763 Log: Update default KMODDIR in comment after r299393. Submitted by: hselasky Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Thu May 26 18:26:44 2016 (r300762) +++ head/share/mk/bsd.own.mk Thu May 26 18:28:10 2016 (r300763) @@ -49,7 +49,7 @@ # # # KMODDIR Base path for loadable kernel modules -# (see kld(4)). [/boot/kernel] +# (see kld(4)). [/boot/module] # # KMODOWN Kernel and KLD owner. [${BINOWN}] # From owner-svn-src-head@freebsd.org Thu May 26 18:28:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E558CB4BC06; Thu, 26 May 2016 18:28:38 +0000 (UTC) (envelope-from jhb@freebsd.org) 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 C6D9D1F8B; Thu, 26 May 2016 18:28:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A4ED0B97D; Thu, 26 May 2016 14:28:37 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299393 - in head: . share/mk Date: Thu, 26 May 2016 11:28:33 -0700 Message-ID: <6335113.N7gIF2Maer@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <08cfa0ac-ad92-c8f9-2141-e72088b17d41@selasky.org> References: <201605102232.u4AMWNvp000287@repo.freebsd.org> <08cfa0ac-ad92-c8f9-2141-e72088b17d41@selasky.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); Thu, 26 May 2016 14:28:37 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 18:28:39 -0000 On Wednesday, May 25, 2016 03:27:07 PM Hans Petter Selasky wrote: > On 05/11/16 00:32, John Baldwin wrote: > > Author: jhb > > Date: Tue May 10 22:32:23 2016 > > New Revision: 299393 > > URL: https://svnweb.freebsd.org/changeset/base/299393 > > > > Log: > > Change the default installation directory for modules to /boot/modules. > > > > Kernel installs always override KMODDIR when installing modules, so > > this default setting is only used for standalone module builds. Many > > out-of-tree modules manually override KMODDIR already to avoid placing > > modules in /boot/kernel. This now makes that behavior the default. > > > > Discussed on: arch@ > > Reviewed by: imp > > Relnotes: yes > > > > Just a small nit: > > There is a comment in bsd.own.mk which needs updating too: > > > # > > # KMODDIR Base path for loadable kernel modules > > # (see kld(4)). [/boot/kernel] Oops, thanks. Fixed. -- John Baldwin From owner-svn-src-head@freebsd.org Thu May 26 18:35:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEBF0B4BE29; Thu, 26 May 2016 18:35:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 719A214EB; Thu, 26 May 2016 18:35:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QIZbSN066705; Thu, 26 May 2016 18:35:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QIZblp066704; Thu, 26 May 2016 18:35:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605261835.u4QIZblp066704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 26 May 2016 18:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300764 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 18:35:38 -0000 Author: jhb Date: Thu May 26 18:35:37 2016 New Revision: 300764 URL: https://svnweb.freebsd.org/changeset/base/300764 Log: Don't reuse the source mbuf in tcp_respond() if it is not writable. Not all mbufs passed up from device drivers are M_WRITABLE(). In particular, the Chelsio T4/T5 driver uses a feature called "buffer packing" to receive multiple frames in a single receive buffer. The mbufs for these frames all share the same external storage so are treated as read-only by the rest of the stack when multiple frames are in flight. Previously tcp_respond() would blindly overwrite read-only mbufs when INVARIANTS was disabled or panic with an assertion failure if INVARIANTS was enabled. Note that the new case is a bit of a mix of the two other cases in tcp_respond(). The TCP and IP headers must be copied explicitly into the new mbuf instead of being inherited (similar to the m == NULL case), but the addresses and ports must be swapped in the reply (similar to the m != NULL case). Reviewed by: glebius Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu May 26 18:28:10 2016 (r300763) +++ head/sys/netinet/tcp_subr.c Thu May 26 18:35:37 2016 (r300764) @@ -934,16 +934,54 @@ tcp_respond(struct tcpcb *tp, void *ipge } bcopy((caddr_t)th, (caddr_t)nth, sizeof(struct tcphdr)); flags = TH_ACK; + } else if (!M_WRITABLE(m)) { + struct mbuf *n; + + /* Can't reuse 'm', allocate a new mbuf. */ + n = m_gethdr(M_NOWAIT, MT_DATA); + if (n == NULL) { + m_freem(m); + return; + } + + if (!m_dup_pkthdr(n, m, M_NOWAIT)) { + m_freem(m); + m_freem(n); + return; + } + + n->m_data += max_linkhdr; + /* m_len is set later */ +#define xchg(a,b,type) { type t; t=a; a=b; b=t; } +#ifdef INET6 + if (isipv6) { + bcopy((caddr_t)ip6, mtod(n, caddr_t), + sizeof(struct ip6_hdr)); + ip6 = mtod(n, struct ip6_hdr *); + xchg(ip6->ip6_dst, ip6->ip6_src, struct in6_addr); + nth = (struct tcphdr *)(ip6 + 1); + } else +#endif /* INET6 */ + { + bcopy((caddr_t)ip, mtod(n, caddr_t), sizeof(struct ip)); + ip = mtod(n, struct ip *); + xchg(ip->ip_dst.s_addr, ip->ip_src.s_addr, uint32_t); + nth = (struct tcphdr *)(ip + 1); + } + bcopy((caddr_t)th, (caddr_t)nth, sizeof(struct tcphdr)); + xchg(nth->th_dport, nth->th_sport, uint16_t); + th = nth; + m_freem(m); + m = n; } else { /* * reuse the mbuf. - * XXX MRT We inherrit the FIB, which is lucky. + * XXX MRT We inherit the FIB, which is lucky. */ m_freem(m->m_next); m->m_next = NULL; m->m_data = (caddr_t)ipgen; /* m_len is set later */ -#define xchg(a,b,type) { type t; t=a; a=b; b=t; } #ifdef INET6 if (isipv6) { xchg(ip6->ip6_dst, ip6->ip6_src, struct in6_addr); From owner-svn-src-head@freebsd.org Thu May 26 18:48:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81F4AB4B0BB; Thu, 26 May 2016 18:48:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FFD81E5C; Thu, 26 May 2016 18:48:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QImbC9070492; Thu, 26 May 2016 18:48:37 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QImbaT070491; Thu, 26 May 2016 18:48:37 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605261848.u4QImbaT070491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 26 May 2016 18:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300767 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 18:48:38 -0000 Author: gjb Date: Thu May 26 18:48:37 2016 New Revision: 300767 URL: https://svnweb.freebsd.org/changeset/base/300767 Log: Remove the cw*-install target. All operations are performed on the original output file, and nothing is ever done with the copied file (as in, no modifications and/or publication from the copied file). Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.vm Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Thu May 26 18:39:18 2016 (r300766) +++ head/release/Makefile.vm Thu May 26 18:48:37 2016 (r300767) @@ -62,15 +62,6 @@ cw-${_CW:tl}: -S ${WORLDDIR} -o ${.OBJDIR}/${${_CW}IMAGE} -c ${${_CW}CONF} touch ${.TARGET} -cw${_CW:tl}-install: - mkdir -p ${DESTDIR}/${_CW:tl} - cp -p ${${_CW}IMAGE} \ - ${DESTDIR}/${_CW:tl}/${${_CW}_DISK} - cd ${DESTDIR}/${_CW:tl} && sha512 ${${_CW}_DISK}* > \ - ${DESTDIR}/${_CW:tl}/CHECKSUM.SHA512 - cd ${DESTDIR}/${_CW:tl} && sha256 ${${_CW}_DISK}* > \ - ${DESTDIR}/${_CW:tl}/CHECKSUM.SHA256 - cw${_CW:tl}-package: @# Special target to handle packaging cloud images in the formats @# specific to each hosting provider. From owner-svn-src-head@freebsd.org Thu May 26 18:50:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A20F3B4B12E; Thu, 26 May 2016 18:50:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F427106E; Thu, 26 May 2016 18:50:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QIovA6071202; Thu, 26 May 2016 18:50:57 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QIovbY071201; Thu, 26 May 2016 18:50:57 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605261850.u4QIovbY071201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 26 May 2016 18:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300768 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 18:50:58 -0000 Author: gjb Date: Thu May 26 18:50:57 2016 New Revision: 300768 URL: https://svnweb.freebsd.org/changeset/base/300768 Log: Update a commented line to replace recently-removed images with images that are published. Sponsored by: The FreeBSD Foundation Modified: head/release/release.conf.sample Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Thu May 26 18:48:37 2016 (r300767) +++ head/release/release.conf.sample Thu May 26 18:50:57 2016 (r300768) @@ -109,4 +109,4 @@ PORTBRANCH="ports/head@rHEAD" ## If WITH_CLOUDWARE is set to a non-empty value, this is a list of providers ## to create disk images. -#CLOUDWARE="AZURE OPENSTACK" +#CLOUDWARE="EC2 GCE VAGRANT-VIRTUALBOX VAGRANT-VMWARE" From owner-svn-src-head@freebsd.org Thu May 26 18:52:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E0F7B4B278; Thu, 26 May 2016 18:52:28 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3DF713DE; Thu, 26 May 2016 18:52:27 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QIqRrL073898; Thu, 26 May 2016 18:52:27 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QIqRGn073897; Thu, 26 May 2016 18:52:27 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201605261852.u4QIqRGn073897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 26 May 2016 18:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300769 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 18:52:28 -0000 Author: loos Date: Thu May 26 18:52:26 2016 New Revision: 300769 URL: https://svnweb.freebsd.org/changeset/base/300769 Log: Only do the touch screen setup when the 'ti,wires' property is present. While here fix a typo in a debug message. Modified: head/sys/arm/ti/ti_adc.c Modified: head/sys/arm/ti/ti_adc.c ============================================================================== --- head/sys/arm/ti/ti_adc.c Thu May 26 18:50:57 2016 (r300768) +++ head/sys/arm/ti/ti_adc.c Thu May 26 18:52:26 2016 (r300769) @@ -732,7 +732,7 @@ ti_adc_attach(device_t dev) sc->sc_charge_delay = DEFAULT_CHARGE_DELAY; /* Read "tsc" node properties */ child = ofw_bus_find_child(node, "tsc"); - if (child != 0) { + if (child != 0 && OF_hasprop(child, "ti,wires")) { if ((OF_getprop(child, "ti,wires", &cell, sizeof(cell))) > 0) sc->sc_tsc_wires = fdt32_to_cpu(cell); if ((OF_getprop(child, "ti,coordinate-readouts", &cell, sizeof(cell))) > 0) @@ -745,7 +745,7 @@ ti_adc_attach(device_t dev) sizeof(*wire_configs), (void **)&wire_configs); if (nwire_configs != sc->sc_tsc_wires) { device_printf(sc->sc_dev, - "invalid nubmer of ti,wire-config: %d (should be %d)\n", + "invalid number of ti,wire-config: %d (should be %d)\n", nwire_configs, sc->sc_tsc_wires); OF_prop_free(wire_configs); return (EINVAL); From owner-svn-src-head@freebsd.org Thu May 26 18:52:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB634B4B2C1; Thu, 26 May 2016 18:52:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89D4716CE; Thu, 26 May 2016 18:52:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QIqnj8073958; Thu, 26 May 2016 18:52:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QIqn5w073953; Thu, 26 May 2016 18:52:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201605261852.u4QIqn5w073953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 26 May 2016 18:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 18:52:51 -0000 Author: dim Date: Thu May 26 18:52:49 2016 New Revision: 300770 URL: https://svnweb.freebsd.org/changeset/base/300770 Log: Update libc++ to 3.8.0. Excerpted list of fixes (with upstream revision numbers): r242679 Implement the plugin-based version of std::search. There are no searchers yet; those are coming soon. r242682 Implement the default searcher for std::experimental::search. r243728 Add v2. r245330 implement more of N4258 - Cleaning up noexcept in the standard library. Specifically add new noexcept stuff to vector and string's move-assignment operations r245334 Fix PR22606 - Leak pthread_key with static storage duration to ensure all of thread-local destructors are called. r245335 Fix PR23589: std::function doesn't recognize null pointer to varargs function. r247036 Implementation of Boyer-Moore and Boyer-Moore-Horspool searchers for the LFTS. r249325 Implement LWG#2063, and update the issues links to point to the github generated pages r249738 Split out of . r249739 Split out of . r249740 Split out of . r249741 Split out of . r249742 Split out of . r249743 Split out of . r249761 Split out of . r249798 Split out of . r249800 Split out of . r249889 Split out of . r249890 Split out of . r249929 Split out of . r250254 ABI versioning macros for libc++. r251246 Fix LWG#2244: basic_istream::seekg r251247 Fix LWG#2127: Move-construction with raw_storage_iterator. r251253 Fix LWG#2476: scoped_allocator_adaptor is not assignable r251257 Fix LWG#2489: mem_fn() should be noexcept r251618 Implement P0004R1 'Remove Deprecated iostreams aliases' r251766 Implement the first part of P0006R0: Adopt Type Traits Variable Templates for C++17. r252195 Implement P0092R1 for C++1z r252350 Allow deque to handle incomplete types. r252406 More of P0006R0: type traits variable aliases for C++17. r252407 Implement LWG#2353: std::next is over-constrained r252905 Implement P0074: Making owner_less more flexible r253215 Implement P0013R1: Logical Operator Type Traits. r253274 Implement P0007: Constant View: A proposal for a std::as_const helper function template. r254119 Add static_assert to set/multiset/map/multimap/forward_list/deque that the allocator's value_type match the container's value_type. r254283 Implement more of P0006; Type Traits Variable Templates. r255941 LWG2485: get() should be overloaded for const tuple&&. r256325 Fix LWG Issue #2367 - Fixing std::tuple and std::pair's default constructors. r256652 Fix for ALL undefined behavior in . r256859 First half of LWG#2354: 'Unnecessary copying when inserting into maps with braced-init syntax' Exp-run: antoine Relnotes: yes Added: head/contrib/libc++/include/__nullptr - copied unchanged from r298146, vendor/libc++/dist/include/__nullptr head/contrib/libc++/include/ctype.h - copied unchanged from r298146, vendor/libc++/dist/include/ctype.h head/contrib/libc++/include/errno.h - copied unchanged from r298146, vendor/libc++/dist/include/errno.h head/contrib/libc++/include/experimental/any - copied unchanged from r298146, vendor/libc++/dist/include/experimental/any head/contrib/libc++/include/experimental/functional - copied unchanged from r298146, vendor/libc++/dist/include/experimental/functional head/contrib/libc++/include/float.h - copied unchanged from r298146, vendor/libc++/dist/include/float.h head/contrib/libc++/include/inttypes.h - copied unchanged from r298146, vendor/libc++/dist/include/inttypes.h head/contrib/libc++/include/math.h - copied unchanged from r298146, vendor/libc++/dist/include/math.h head/contrib/libc++/include/setjmp.h - copied unchanged from r298146, vendor/libc++/dist/include/setjmp.h head/contrib/libc++/include/stddef.h - copied unchanged from r298146, vendor/libc++/dist/include/stddef.h head/contrib/libc++/include/stdio.h - copied unchanged from r298146, vendor/libc++/dist/include/stdio.h head/contrib/libc++/include/stdlib.h - copied unchanged from r298146, vendor/libc++/dist/include/stdlib.h head/contrib/libc++/include/wchar.h - copied unchanged from r298146, vendor/libc++/dist/include/wchar.h head/contrib/libc++/include/wctype.h - copied unchanged from r298146, vendor/libc++/dist/include/wctype.h head/contrib/libc++/src/any.cpp - copied unchanged from r298146, vendor/libc++/dist/src/any.cpp head/contrib/libc++/src/include/ - copied from r298146, vendor/libc++/dist/src/include/ Deleted: head/contrib/libc++/src/config_elast.h head/contrib/libc++/src/support/ Modified: head/Makefile.inc1 head/contrib/libc++/include/__config head/contrib/libc++/include/__functional_03 head/contrib/libc++/include/__functional_base head/contrib/libc++/include/__functional_base_03 head/contrib/libc++/include/__hash_table head/contrib/libc++/include/__locale head/contrib/libc++/include/__mutex_base head/contrib/libc++/include/__split_buffer head/contrib/libc++/include/__tree head/contrib/libc++/include/__tuple head/contrib/libc++/include/algorithm head/contrib/libc++/include/array head/contrib/libc++/include/atomic head/contrib/libc++/include/bitset head/contrib/libc++/include/cctype head/contrib/libc++/include/cerrno head/contrib/libc++/include/cfenv head/contrib/libc++/include/cfloat head/contrib/libc++/include/chrono head/contrib/libc++/include/cinttypes head/contrib/libc++/include/cmath head/contrib/libc++/include/complex.h head/contrib/libc++/include/condition_variable head/contrib/libc++/include/csetjmp head/contrib/libc++/include/cstddef head/contrib/libc++/include/cstdio head/contrib/libc++/include/cstdlib head/contrib/libc++/include/cwchar head/contrib/libc++/include/cwctype head/contrib/libc++/include/deque head/contrib/libc++/include/exception head/contrib/libc++/include/experimental/algorithm head/contrib/libc++/include/experimental/dynarray head/contrib/libc++/include/ext/hash_map head/contrib/libc++/include/forward_list head/contrib/libc++/include/functional head/contrib/libc++/include/future head/contrib/libc++/include/ios head/contrib/libc++/include/istream head/contrib/libc++/include/iterator head/contrib/libc++/include/limits head/contrib/libc++/include/list head/contrib/libc++/include/locale head/contrib/libc++/include/map head/contrib/libc++/include/memory head/contrib/libc++/include/module.modulemap head/contrib/libc++/include/mutex head/contrib/libc++/include/random head/contrib/libc++/include/ratio head/contrib/libc++/include/regex head/contrib/libc++/include/scoped_allocator head/contrib/libc++/include/set head/contrib/libc++/include/string head/contrib/libc++/include/thread head/contrib/libc++/include/tuple head/contrib/libc++/include/type_traits head/contrib/libc++/include/unordered_map head/contrib/libc++/include/utility head/contrib/libc++/include/valarray head/contrib/libc++/include/vector head/contrib/libc++/src/exception.cpp head/contrib/libc++/src/future.cpp head/contrib/libc++/src/ios.cpp head/contrib/libc++/src/locale.cpp head/contrib/libc++/src/memory.cpp head/contrib/libc++/src/mutex.cpp head/contrib/libc++/src/new.cpp head/contrib/libc++/src/stdexcept.cpp head/contrib/libc++/src/system_error.cpp head/contrib/libc++/src/typeinfo.cpp head/lib/libc++/Makefile Directory Properties: head/contrib/libc++/ (props changed) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 26 18:52:26 2016 (r300769) +++ head/Makefile.inc1 Thu May 26 18:52:49 2016 (r300770) @@ -500,7 +500,7 @@ HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MT HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT .endif -CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \ +CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCXXFLAGS} ${XCFLAGS}" \ CPP="${XCPP} ${XCFLAGS}" \ AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ OBJDUMP=${XOBJDUMP} OBJCOPY="${XOBJCOPY}" \ Modified: head/contrib/libc++/include/__config ============================================================================== --- head/contrib/libc++/include/__config Thu May 26 18:52:26 2016 (r300769) +++ head/contrib/libc++/include/__config Thu May 26 18:52:49 2016 (r300770) @@ -11,19 +11,37 @@ #ifndef _LIBCPP_CONFIG #define _LIBCPP_CONFIG -#if !defined(_MSC_VER) || defined(__clang__) +#if defined(_MSC_VER) && !defined(__clang__) +#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +#endif + +#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER #pragma GCC system_header #endif +#ifdef __cplusplus + #ifdef __GNUC__ #define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__) #else #define _GNUC_VER 0 #endif -#define _LIBCPP_VERSION 3700 +#define _LIBCPP_VERSION 3800 +#ifndef _LIBCPP_ABI_VERSION #define _LIBCPP_ABI_VERSION 1 +#endif + +#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2 +// Change short string represention so that string data starts at offset 0, +// improving its alignment in some cases. +#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT +// Fix deque iterator type in order to support incomplete types. +#define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE +// Fix undefined behavior in how std::list stores it's linked nodes. +#define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB +#endif #define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y #define _LIBCPP_CONCAT(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) @@ -37,6 +55,9 @@ #ifndef __has_builtin #define __has_builtin(__x) 0 #endif +#ifndef __has_extension +#define __has_extension(__x) 0 +#endif #ifndef __has_feature #define __has_feature(__x) 0 #endif @@ -61,6 +82,16 @@ #endif // __BIG_ENDIAN__ #endif // __BIG_ENDIAN__ +#ifdef __BYTE_ORDER__ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define _LIBCPP_LITTLE_ENDIAN 1 +#define _LIBCPP_BIG_ENDIAN 0 +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#define _LIBCPP_LITTLE_ENDIAN 0 +#define _LIBCPP_BIG_ENDIAN 1 +#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#endif // __BYTE_ORDER__ + #ifdef __FreeBSD__ # include # if _BYTE_ORDER == _LITTLE_ENDIAN @@ -227,9 +258,12 @@ #if defined(__clang__) -#if defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \ - !defined(__arm__) -#define _LIBCPP_ALTERNATE_STRING_LAYOUT +// _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for +// _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility. +#if (defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \ + !defined(__arm__)) || \ + defined(_LIBCPP_ALTERNATE_STRING_LAYOUT) +#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT #endif #if __has_feature(cxx_alignas) @@ -273,6 +307,10 @@ typedef __char32_t char32_t; #define _LIBCPP_UNUSED __attribute__((__unused__)) +#if !(__has_feature(cxx_default_function_template_args)) +#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS +#endif + #if !(__has_feature(cxx_defaulted_functions)) #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS #endif // !(__has_feature(cxx_defaulted_functions)) @@ -354,14 +392,19 @@ typedef __char32_t char32_t; #elif defined(__ANDROID__) #define _LIBCPP_HAS_QUICK_EXIT #elif defined(__linux__) -#include +#if !defined(_LIBCPP_HAS_MUSL_LIBC) +# include #if __GLIBC_PREREQ(2, 15) #define _LIBCPP_HAS_QUICK_EXIT #endif #if __GLIBC_PREREQ(2, 17) #define _LIBCPP_HAS_C11_FEATURES #endif +#else // defined(_LIBCPP_HAS_MUSL_LIBC) +#define _LIBCPP_HAS_QUICK_EXIT +#define _LIBCPP_HAS_C11_FEATURES #endif +#endif // __linux__ #endif #if !(__has_feature(cxx_noexcept)) @@ -390,6 +433,11 @@ namespace std { #define _LIBCPP_HAS_NO_ASAN #endif +// Allow for build-time disabling of unsigned integer sanitization +#ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK +#define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute((no_sanitize("unsigned-integer-overflow"))) +#endif + #elif defined(__GNUC__) #define _ALIGNAS(x) __attribute__((__aligned__(x))) @@ -437,6 +485,7 @@ namespace std { #define _LIBCPP_HAS_NO_ADVANCED_SFINAE #define _LIBCPP_HAS_NO_DECLTYPE +#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS #define _LIBCPP_HAS_NO_NULLPTR @@ -444,22 +493,18 @@ namespace std { #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_NO_VARIADICS #define _LIBCPP_HAS_NO_RVALUE_REFERENCES -#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS #define _LIBCPP_HAS_NO_STRONG_ENUMS #define _LIBCPP_HAS_NO_NOEXCEPT #else // __GXX_EXPERIMENTAL_CXX0X__ -#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS - #if _GNUC_VER < 403 +#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS #define _LIBCPP_HAS_NO_RVALUE_REFERENCES -#endif - -#if _GNUC_VER < 403 #define _LIBCPP_HAS_NO_STATIC_ASSERT #endif + #if _GNUC_VER < 404 #define _LIBCPP_HAS_NO_DECLTYPE #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS @@ -498,7 +543,6 @@ using namespace _LIBCPP_NAMESPACE __attr #elif defined(_LIBCPP_MSVC) #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES -#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER #define _LIBCPP_HAS_NO_CONSTEXPR #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES @@ -532,9 +576,9 @@ namespace std { #define _LIBCPP_NORETURN __attribute__((noreturn)) #define _LIBCPP_UNUSED +#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES #define _LIBCPP_HAS_NO_ADVANCED_SFINAE -#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS #define _LIBCPP_HAS_NO_NOEXCEPT #define _LIBCPP_HAS_NO_NULLPTR @@ -579,9 +623,11 @@ typedef unsigned int char32_t; #ifdef _LIBCPP_HAS_NO_STATIC_ASSERT +extern "C++" { template struct __static_assert_test; template <> struct __static_assert_test {}; template struct __static_assert_check {}; +} #define static_assert(__b, __m) \ typedef __static_assert_check)> \ _LIBCPP_CONCAT(__t, __LINE__) @@ -724,6 +770,12 @@ template struct __static_asse #define _LIBCPP_CONSTEXPR_AFTER_CXX11 #endif +#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES +# define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x) +#else +# define _LIBCPP_EXPLICIT_MOVE(x) (x) +#endif + #ifndef _LIBCPP_HAS_NO_ASAN extern "C" void __sanitizer_annotate_contiguous_container( const void *, const void *, const void *, const void *); @@ -733,7 +785,7 @@ extern "C" void __sanitizer_annotate_con // g++ and cl.exe have RTTI on by default and define a macro when it is. // g++ only defines the macro in 4.3.2 and onwards. #if !defined(_LIBCPP_NO_RTTI) -# if defined(__GNUG__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \ +# if defined(__GNUC__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \ (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI) # define _LIBCPP_NO_RTTI # elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI) @@ -765,7 +817,7 @@ extern "C" void __sanitizer_annotate_con #define _LIBCPP_HAS_NO_STDOUT #endif -#if defined(__ANDROID__) || defined(__CloudABI__) +#if defined(__ANDROID__) || defined(__CloudABI__) || defined(_LIBCPP_HAS_MUSL_LIBC) #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE #endif @@ -775,4 +827,21 @@ extern "C" void __sanitizer_annotate_con #define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS #endif -#endif // _LIBCPP_CONFIG +#if __has_feature(cxx_atomic) || __has_extension(c_atomic) +#define _LIBCPP_HAS_C_ATOMIC_IMP +#elif _GNUC_VER > 407 +#define _LIBCPP_HAS_GCC_ATOMIC_IMP +#endif + +#if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)) \ + || defined(_LIBCPP_HAS_NO_THREADS) +#define _LIBCPP_HAS_NO_ATOMIC_HEADER +#endif + +#ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK +#define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK +#endif + +#endif // __cplusplus + +#endif // _LIBCPP_CONFIG Modified: head/contrib/libc++/include/__functional_03 ============================================================================== --- head/contrib/libc++/include/__functional_03 Thu May 26 18:52:26 2016 (r300769) +++ head/contrib/libc++/include/__functional_03 Thu May 26 18:52:49 2016 (r300770) @@ -17,218 +17,7 @@ #pragma GCC system_header #endif -template -class __mem_fn - : public __weak_result_type<_Tp> -{ -public: - // types - typedef _Tp type; -private: - type __f_; - -public: - _LIBCPP_INLINE_VISIBILITY __mem_fn(type __f) : __f_(__f) {} - - // invoke - - typename __invoke_return::type - operator() () const - { - return __invoke(__f_); - } - - template - typename __invoke_return0::type - operator() (_A0& __a0) const - { - return __invoke(__f_, __a0); - } - - template - typename __invoke_return1::type - operator() (_A0& __a0, _A1& __a1) const - { - return __invoke(__f_, __a0, __a1); - } - - template - typename __invoke_return2::type - operator() (_A0& __a0, _A1& __a1, _A2& __a2) const - { - return __invoke(__f_, __a0, __a1, __a2); - } -}; - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp _Tp::*> -mem_fn(_Rp _Tp::* __pm) -{ - return __mem_fn<_Rp _Tp::*>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)()> -mem_fn(_Rp (_Tp::* __pm)()) -{ - return __mem_fn<_Rp (_Tp::*)()>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0)> -mem_fn(_Rp (_Tp::* __pm)(_A0)) -{ - return __mem_fn<_Rp (_Tp::*)(_A0)>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1)> -mem_fn(_Rp (_Tp::* __pm)(_A0, _A1)) -{ - return __mem_fn<_Rp (_Tp::*)(_A0, _A1)>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)> -mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2)) -{ - return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)() const> -mem_fn(_Rp (_Tp::* __pm)() const) -{ - return __mem_fn<_Rp (_Tp::*)() const>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0) const> -mem_fn(_Rp (_Tp::* __pm)(_A0) const) -{ - return __mem_fn<_Rp (_Tp::*)(_A0) const>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1) const> -mem_fn(_Rp (_Tp::* __pm)(_A0, _A1) const) -{ - return __mem_fn<_Rp (_Tp::*)(_A0, _A1) const>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) const> -mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2) const) -{ - return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) const>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)() volatile> -mem_fn(_Rp (_Tp::* __pm)() volatile) -{ - return __mem_fn<_Rp (_Tp::*)() volatile>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0) volatile> -mem_fn(_Rp (_Tp::* __pm)(_A0) volatile) -{ - return __mem_fn<_Rp (_Tp::*)(_A0) volatile>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1) volatile> -mem_fn(_Rp (_Tp::* __pm)(_A0, _A1) volatile) -{ - return __mem_fn<_Rp (_Tp::*)(_A0, _A1) volatile>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) volatile> -mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2) volatile) -{ - return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) volatile>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)() const volatile> -mem_fn(_Rp (_Tp::* __pm)() const volatile) -{ - return __mem_fn<_Rp (_Tp::*)() const volatile>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0) const volatile> -mem_fn(_Rp (_Tp::* __pm)(_A0) const volatile) -{ - return __mem_fn<_Rp (_Tp::*)(_A0) const volatile>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1) const volatile> -mem_fn(_Rp (_Tp::* __pm)(_A0, _A1) const volatile) -{ - return __mem_fn<_Rp (_Tp::*)(_A0, _A1) const volatile>(__pm); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) const volatile> -mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2) const volatile) -{ - return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) const volatile>(__pm); -} - -// bad_function_call - -class _LIBCPP_EXCEPTION_ABI bad_function_call - : public exception -{ -}; - -template class _LIBCPP_TYPE_VIS_ONLY function; // undefined - -namespace __function -{ - -template -struct __maybe_derive_from_unary_function -{ -}; - -template -struct __maybe_derive_from_unary_function<_Rp(_A1)> - : public unary_function<_A1, _Rp> -{ -}; - -template -struct __maybe_derive_from_binary_function -{ -}; - -template -struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)> - : public binary_function<_A1, _A2, _Rp> -{ -}; +namespace __function { template class __base; @@ -662,15 +451,6 @@ class _LIBCPP_TYPE_VIS_ONLY function<_Rp aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const _Fp&) {return true;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (*__p)()) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const function<_R2()>& __p) {return __p;} public: typedef _Rp result_type; @@ -769,7 +549,7 @@ function<_Rp()>::function(_Fp __f, typename enable_if::value>::type*) : __f_(0) { - if (__not_null(__f)) + if (__function::__not_null(__f)) { typedef __function::__func<_Fp, allocator<_Fp>, _Rp()> _FF; if (sizeof(_FF) <= sizeof(__buf_)) @@ -796,7 +576,7 @@ function<_Rp()>::function(allocator_arg_ : __f_(0) { typedef allocator_traits<_Alloc> __alloc_traits; - if (__not_null(__f)) + if (__function::__not_null(__f)) { typedef __function::__func<_Fp, _Alloc, _Rp()> _FF; if (sizeof(_FF) <= sizeof(__buf_)) @@ -947,27 +727,6 @@ class _LIBCPP_TYPE_VIS_ONLY function<_Rp aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const _Fp&) {return true;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (*__p)(_B0)) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_Cp::*__p)()) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_Cp::*__p)() const) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_Cp::*__p)() volatile) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_Cp::*__p)() const volatile) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const function<_R2(_B0)>& __p) {return __p;} public: typedef _Rp result_type; @@ -1066,7 +825,7 @@ function<_Rp(_A0)>::function(_Fp __f, typename enable_if::value>::type*) : __f_(0) { - if (__not_null(__f)) + if (__function::__not_null(__f)) { typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) @@ -1093,7 +852,7 @@ function<_Rp(_A0)>::function(allocator_a : __f_(0) { typedef allocator_traits<_Alloc> __alloc_traits; - if (__not_null(__f)) + if (__function::__not_null(__f)) { typedef __function::__func<_Fp, _Alloc, _Rp(_A0)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) @@ -1244,27 +1003,6 @@ class _LIBCPP_TYPE_VIS_ONLY function<_Rp aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const _Fp&) {return true;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (*__p)(_B0, _B1)) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_Cp::*__p)(_B1)) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_Cp::*__p)(_B1) const) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_Cp::*__p)(_B1) volatile) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_Cp::*__p)(_B1) const volatile) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const function<_R2(_B0, _B1)>& __p) {return __p;} public: typedef _Rp result_type; @@ -1363,7 +1101,7 @@ function<_Rp(_A0, _A1)>::function(_Fp __ typename enable_if::value>::type*) : __f_(0) { - if (__not_null(__f)) + if (__function::__not_null(__f)) { typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0, _A1)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) @@ -1390,7 +1128,7 @@ function<_Rp(_A0, _A1)>::function(alloca : __f_(0) { typedef allocator_traits<_Alloc> __alloc_traits; - if (__not_null(__f)) + if (__function::__not_null(__f)) { typedef __function::__func<_Fp, _Alloc, _Rp(_A0, _A1)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) @@ -1540,27 +1278,6 @@ class _LIBCPP_TYPE_VIS_ONLY function<_Rp aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const _Fp&) {return true;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (*__p)(_B0, _B1, _B2)) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_Cp::*__p)(_B1, _B2)) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_Cp::*__p)(_B1, _B2) const) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_Cp::*__p)(_B1, _B2) volatile) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(_R2 (_Cp::*__p)(_B1, _B2) const volatile) {return __p;} - template - _LIBCPP_INLINE_VISIBILITY - static bool __not_null(const function<_R2(_B0, _B1, _B2)>& __p) {return __p;} public: typedef _Rp result_type; @@ -1660,7 +1377,7 @@ function<_Rp(_A0, _A1, _A2)>::function(_ typename enable_if::value>::type*) : __f_(0) { - if (__not_null(__f)) + if (__function::__not_null(__f)) { typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0, _A1, _A2)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) @@ -1687,7 +1404,7 @@ function<_Rp(_A0, _A1, _A2)>::function(a : __f_(0) { typedef allocator_traits<_Alloc> __alloc_traits; - if (__not_null(__f)) + if (__function::__not_null(__f)) { typedef __function::__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) @@ -1856,274 +1573,4 @@ void swap(function<_Fp>& __x, function<_Fp>& __y) {return __x.swap(__y);} -template struct __is_bind_expression : public false_type {}; -template struct _LIBCPP_TYPE_VIS_ONLY is_bind_expression - : public __is_bind_expression::type> {}; - -template struct __is_placeholder : public integral_constant {}; -template struct _LIBCPP_TYPE_VIS_ONLY is_placeholder - : public __is_placeholder::type> {}; - -namespace placeholders -{ - -template struct __ph {}; - -extern __ph<1> _1; -extern __ph<2> _2; -extern __ph<3> _3; -extern __ph<4> _4; -extern __ph<5> _5; -extern __ph<6> _6; -extern __ph<7> _7; -extern __ph<8> _8; -extern __ph<9> _9; -extern __ph<10> _10; - -} // placeholders - -template -struct __is_placeholder > - : public integral_constant {}; - -template -inline _LIBCPP_INLINE_VISIBILITY -_Tp& -__mu(reference_wrapper<_Tp> __t, _Uj&) -{ - return __t.get(); -} -/* -template -struct __mu_return1 {}; - -template -struct __mu_return1 -{ - typedef typename result_of<_Ti(_Uj...)>::type type; -}; - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __mu_return1::type -__mu_expand(_Ti& __ti, tuple<_Uj...>&& __uj, __tuple_indices<_Indx...>) -{ - __ti(_VSTD::forward::type>(_VSTD::get<_Indx>(__uj))...); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - is_bind_expression<_Ti>::value, - typename __mu_return1::value, _Ti, _Uj...>::type ->::type -__mu(_Ti& __ti, tuple<_Uj...>& __uj) -{ - typedef typename __make_tuple_indices::type __indices; - return __mu_expand(__ti, __uj, __indices()); -} - -template -struct __mu_return2 {}; - -template -struct __mu_return2 -{ - typedef typename tuple_element::value - 1, _Uj>::type type; -}; - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - 0 < is_placeholder<_Ti>::value, - typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type ->::type -__mu(_Ti&, _Uj& __uj) -{ - const size_t _Indx = is_placeholder<_Ti>::value - 1; - // compiler bug workaround - typename tuple_element<_Indx, _Uj>::type __t = _VSTD::get<_Indx>(__uj); - return __t; -// return _VSTD::forward::type>(_VSTD::get<_Indx>(__uj)); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - !is_bind_expression<_Ti>::value && - is_placeholder<_Ti>::value == 0 && - !__is_reference_wrapper<_Ti>::value, - _Ti& ->::type -__mu(_Ti& __ti, _Uj& __uj) -{ - return __ti; -} - -template -struct ____mu_return; - -template -struct ____mu_return<_Ti, true, false, tuple<_Uj...> > -{ - typedef typename result_of<_Ti(_Uj...)>::type type; -}; - -template -struct ____mu_return<_Ti, false, true, _TupleUj> -{ - typedef typename tuple_element::value - 1, - _TupleUj>::type&& type; -}; - -template -struct ____mu_return<_Ti, false, false, _TupleUj> -{ - typedef _Ti& type; -}; - -template -struct __mu_return - : public ____mu_return<_Ti, - is_bind_expression<_Ti>::value, - 0 < is_placeholder<_Ti>::value, - _TupleUj> -{ -}; - -template -struct __mu_return, _TupleUj> -{ - typedef _Ti& type; -}; - -template -struct __bind_return; - -template -struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj> -{ - typedef typename __ref_return - < - _Fp&, - typename __mu_return - < - _BoundArgs, - _TupleUj - >::type... - >::type type; -}; - -template -struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj> -{ - typedef typename __ref_return - < - _Fp&, - typename __mu_return - < - const _BoundArgs, - _TupleUj - >::type... - >::type type; -}; - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __bind_return<_Fp, _BoundArgs, _Args>::type -__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>, - _Args&& __args) -{ - return __invoke(__f, __mu(_VSTD::get<_Indx>(__bound_args), __args)...); -} - -template -class __bind -{ - _Fp __f_; - tuple<_BoundArgs...> __bound_args_; - - typedef typename __make_tuple_indices::type __indices; -public: - template - explicit __bind(_Gp&& __f, _BA&& ...__bound_args) - : __f_(_VSTD::forward<_Gp>(__f)), - __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {} - - template - typename __bind_return<_Fp, tuple<_BoundArgs...>, tuple<_Args&&...> >::type - operator()(_Args&& ...__args) - { - // compiler bug workaround - return __apply_functor(__f_, __bound_args_, __indices(), - tuple<_Args&&...>(__args...)); - } - - template - typename __bind_return<_Fp, tuple<_BoundArgs...>, tuple<_Args&&...> >::type - operator()(_Args&& ...__args) const - { - return __apply_functor(__f_, __bound_args_, __indices(), - tuple<_Args&&...>(__args...)); - } -}; - -template -struct __is_bind_expression<__bind<_Fp, _BoundArgs...> > : public true_type {}; - -template -class __bind_r - : public __bind<_Fp, _BoundArgs...> -{ - typedef __bind<_Fp, _BoundArgs...> base; -public: - typedef _Rp result_type; - - template - explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args) - : base(_VSTD::forward<_Gp>(__f), - _VSTD::forward<_BA>(__bound_args)...) {} - - template - result_type - operator()(_Args&& ...__args) - { - typedef __invoke_void_return_wrapper<_Rp> _Invoker; - return _Invoker::__call(static_cast(*this), _VSTD::forward<_Args>(__args)...); - } - - template - result_type - operator()(_Args&& ...__args) const - { - typedef __invoke_void_return_wrapper<_Rp> _Invoker; - return _Invoker::__call(static_cast(*this), _VSTD::forward<_Args>(__args)...); - } -}; - -template -struct __is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {}; - -template -inline _LIBCPP_INLINE_VISIBILITY -__bind::type, typename decay<_BoundArgs>::type...> -bind(_Fp&& __f, _BoundArgs&&... __bound_args) -{ - typedef __bind::type, typename decay<_BoundArgs>::type...> type; - return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__bind_r<_Rp, typename decay<_Fp>::type, typename decay<_BoundArgs>::type...> -bind(_Fp&& __f, _BoundArgs&&... __bound_args) -{ - typedef __bind_r<_Rp, typename decay<_Fp>::type, typename decay<_BoundArgs>::type...> type; - return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); -} -*/ - #endif // _LIBCPP_FUNCTIONAL_03 Modified: head/contrib/libc++/include/__functional_base ============================================================================== --- head/contrib/libc++/include/__functional_base Thu May 26 18:52:26 2016 (r300769) +++ head/contrib/libc++/include/__functional_base Thu May 26 18:52:49 2016 (r300770) @@ -77,62 +77,6 @@ struct _LIBCPP_TYPE_VIS_ONLY less }; #endif -// addressof - -template -inline _LIBCPP_INLINE_VISIBILITY -_Tp* -addressof(_Tp& __x) _NOEXCEPT -{ - return (_Tp*)&reinterpret_cast(__x); -} - -#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF) -// Objective-C++ Automatic Reference Counting uses qualified pointers -// that require special addressof() signatures. When -// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler -// itself is providing these definitions. Otherwise, we provide them. -template -inline _LIBCPP_INLINE_VISIBILITY -__strong _Tp* -addressof(__strong _Tp& __x) _NOEXCEPT -{ - return &__x; -} - -#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK -template -inline _LIBCPP_INLINE_VISIBILITY -__weak _Tp* -addressof(__weak _Tp& __x) _NOEXCEPT -{ - return &__x; -} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -__autoreleasing _Tp* -addressof(__autoreleasing _Tp& __x) _NOEXCEPT -{ - return &__x; -} - -template -inline _LIBCPP_INLINE_VISIBILITY -__unsafe_unretained _Tp* -addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT -{ - return &__x; -} -#endif - -#ifdef _LIBCPP_HAS_NO_VARIADICS - -#include <__functional_base_03> - -#else // _LIBCPP_HAS_NO_VARIADICS - // __weak_result_type template @@ -314,6 +258,8 @@ struct __weak_result_type<_Rp (_Cp::*)(_ { }; + +#ifndef _LIBCPP_HAS_NO_VARIADICS // 3 or more arguments *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu May 26 18:57:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6DB3B4B375; Thu, 26 May 2016 18:57:27 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F32218B5; Thu, 26 May 2016 18:57:27 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QIvQ6v074168; Thu, 26 May 2016 18:57:26 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QIvQpN074167; Thu, 26 May 2016 18:57:26 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605261857.u4QIvQpN074167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 26 May 2016 18:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300771 - head/sys/netgraph/netflow X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 18:57:27 -0000 Author: jkim Date: Thu May 26 18:57:26 2016 New Revision: 300771 URL: https://svnweb.freebsd.org/changeset/base/300771 Log: Use bit_count(3) instead of four bitcount32() calls. Reviewed by: asomers, ngie Differential Revision: https://reviews.freebsd.org/D6543 Modified: head/sys/netgraph/netflow/netflow.c Modified: head/sys/netgraph/netflow/netflow.c ============================================================================== --- head/sys/netgraph/netflow/netflow.c Thu May 26 18:52:49 2016 (r300770) +++ head/sys/netgraph/netflow/netflow.c Thu May 26 18:57:26 2016 (r300771) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_route.h" #include +#include #include #include #include @@ -147,6 +148,19 @@ ip6_hash(struct flow6_rec *r) r->dst.r_dst6.__u6_addr.__u6_addr32[3]); } } + +static inline int +ip6_masklen(struct in6_addr *saddr, struct rt_addrinfo *info) +{ + const int nbits = sizeof(*saddr) * NBBY; + int mlen; + + if (info->rti_addrs & RTA_NETMASK) + bit_count((bitstr_t *)saddr, 0, nbits, &mlen); + else + mlen = nbits; + return (mlen); +} #endif /* @@ -399,11 +413,6 @@ hash_insert(priv_p priv, struct flow_has } #ifdef INET6 -/* XXX: make normal function, instead of.. */ -#define ipv6_masklen(x) bitcount32((x).__u6_addr.__u6_addr32[0]) + \ - bitcount32((x).__u6_addr.__u6_addr32[1]) + \ - bitcount32((x).__u6_addr.__u6_addr32[2]) + \ - bitcount32((x).__u6_addr.__u6_addr32[3]) static int hash6_insert(priv_p priv, struct flow_hash_entry *hsh6, struct flow6_rec *r, int plen, uint8_t flags, uint8_t tcp_flags) @@ -460,11 +469,7 @@ hash6_insert(priv_p priv, struct flow_ha fle6->f.n.next_hop6 = ((struct sockaddr_in6 *)&rt_gateway)->sin6_addr; - if (info.rti_addrs & RTA_NETMASK) - fle6->f.dst_mask = - ipv6_masklen(sin6_mask.sin6_addr); - else - fle6->f.dst_mask = 128; + fle6->f.dst_mask = ip6_masklen(&sin6_mask.sin6_addr, &info); rib_free_info(&info); } @@ -483,13 +488,8 @@ hash6_insert(priv_p priv, struct flow_ha info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&sin6_mask; if (rib_lookup_info(r->fib, (struct sockaddr *)&sin6, 0, 0, - &info) == 0) { - if (info.rti_addrs & RTA_NETMASK) - fle6->f.src_mask = - ipv6_masklen(sin6_mask.sin6_addr); - else - fle6->f.src_mask = 128; - } + &info) == 0) + fle6->f.src_mask = ip6_masklen(&sin6_mask.sin6_addr, &info); } /* Push new flow at the and of hash. */ @@ -497,7 +497,6 @@ hash6_insert(priv_p priv, struct flow_ha return (0); } -#undef ipv6_masklen #endif From owner-svn-src-head@freebsd.org Thu May 26 19:17:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E608FB4B9C8; Thu, 26 May 2016 19:17:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B79441515; Thu, 26 May 2016 19:17:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QJHpED081504; Thu, 26 May 2016 19:17:51 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QJHpPx081503; Thu, 26 May 2016 19:17:51 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605261917.u4QJHpPx081503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 26 May 2016 19:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300772 - head/sys/netgraph/netflow X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 19:17:53 -0000 Author: jkim Date: Thu May 26 19:17:51 2016 New Revision: 300772 URL: https://svnweb.freebsd.org/changeset/base/300772 Log: Fix style(9). Modified: head/sys/netgraph/netflow/netflow.c Modified: head/sys/netgraph/netflow/netflow.c ============================================================================== --- head/sys/netgraph/netflow/netflow.c Thu May 26 18:57:26 2016 (r300771) +++ head/sys/netgraph/netflow/netflow.c Thu May 26 19:17:51 2016 (r300772) @@ -469,7 +469,8 @@ hash6_insert(priv_p priv, struct flow_ha fle6->f.n.next_hop6 = ((struct sockaddr_in6 *)&rt_gateway)->sin6_addr; - fle6->f.dst_mask = ip6_masklen(&sin6_mask.sin6_addr, &info); + fle6->f.dst_mask = + ip6_masklen(&sin6_mask.sin6_addr, &info); rib_free_info(&info); } @@ -489,7 +490,8 @@ hash6_insert(priv_p priv, struct flow_ha if (rib_lookup_info(r->fib, (struct sockaddr *)&sin6, 0, 0, &info) == 0) - fle6->f.src_mask = ip6_masklen(&sin6_mask.sin6_addr, &info); + fle6->f.src_mask = + ip6_masklen(&sin6_mask.sin6_addr, &info); } /* Push new flow at the and of hash. */ From owner-svn-src-head@freebsd.org Thu May 26 19:29:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B465AB4BED5; Thu, 26 May 2016 19:29:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D3BA1F3A; Thu, 26 May 2016 19:29:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QJTU13085436; Thu, 26 May 2016 19:29:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QJTTV5085421; Thu, 26 May 2016 19:29:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605261929.u4QJTTV5085421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 26 May 2016 19:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300773 - in head/sys: crypto crypto/aesni crypto/sha2 crypto/siphash 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 19:29:31 -0000 Author: cem Date: Thu May 26 19:29:29 2016 New Revision: 300773 URL: https://svnweb.freebsd.org/changeset/base/300773 Log: crypto routines: Hint minimum buffer sizes to the compiler Use the C99 'static' keyword to hint to the compiler IVs and output digest sizes. The keyword informs the compiler of the minimum valid size for a given array. Obviously not every pointer can be validated (i.e., the compiler can produce false negative but not false positive reports). No functional change. No ABI change. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/crypto/aesni/aesni.h head/sys/crypto/aesni/aesni_wrap.c head/sys/crypto/sha1.c head/sys/crypto/sha1.h head/sys/crypto/sha2/sha256.h head/sys/crypto/sha2/sha256c.c head/sys/crypto/sha2/sha384.h head/sys/crypto/sha2/sha512.h head/sys/crypto/sha2/sha512c.c head/sys/crypto/siphash/siphash.c head/sys/crypto/siphash/siphash.h head/sys/kern/md4c.c head/sys/kern/md5c.c head/sys/sys/md4.h head/sys/sys/md5.h Modified: head/sys/crypto/aesni/aesni.h ============================================================================== --- head/sys/crypto/aesni/aesni.h Thu May 26 19:17:51 2016 (r300772) +++ head/sys/crypto/aesni/aesni.h Thu May 26 19:29:29 2016 (r300773) @@ -79,23 +79,23 @@ void aesni_set_deckey(const uint8_t *enc */ void aesni_encrypt_cbc(int rounds, const void *key_schedule /*__aligned(16)*/, size_t len, const uint8_t *from, uint8_t *to, - const uint8_t iv[AES_BLOCK_LEN]); + const uint8_t iv[static AES_BLOCK_LEN]); void aesni_decrypt_cbc(int rounds, const void *key_schedule /*__aligned(16)*/, - size_t len, uint8_t *buf, const uint8_t iv[AES_BLOCK_LEN]); + size_t len, uint8_t *buf, const uint8_t iv[static AES_BLOCK_LEN]); void aesni_encrypt_ecb(int rounds, const void *key_schedule /*__aligned(16)*/, size_t len, const uint8_t *from, uint8_t *to); void aesni_decrypt_ecb(int rounds, const void *key_schedule /*__aligned(16)*/, size_t len, const uint8_t *from, uint8_t *to); void aesni_encrypt_icm(int rounds, const void *key_schedule /*__aligned(16)*/, size_t len, const uint8_t *from, uint8_t *to, - const uint8_t iv[AES_BLOCK_LEN]); + const uint8_t iv[static AES_BLOCK_LEN]); void aesni_encrypt_xts(int rounds, const void *data_schedule /*__aligned(16)*/, const void *tweak_schedule /*__aligned(16)*/, size_t len, - const uint8_t *from, uint8_t *to, const uint8_t iv[AES_BLOCK_LEN]); + const uint8_t *from, uint8_t *to, const uint8_t iv[static AES_BLOCK_LEN]); void aesni_decrypt_xts(int rounds, const void *data_schedule /*__aligned(16)*/, const void *tweak_schedule /*__aligned(16)*/, size_t len, - const uint8_t *from, uint8_t *to, const uint8_t iv[AES_BLOCK_LEN]); + const uint8_t *from, uint8_t *to, const uint8_t iv[static AES_BLOCK_LEN]); /* GCM & GHASH functions */ void AES_GCM_encrypt(const unsigned char *in, unsigned char *out, Modified: head/sys/crypto/aesni/aesni_wrap.c ============================================================================== --- head/sys/crypto/aesni/aesni_wrap.c Thu May 26 19:17:51 2016 (r300772) +++ head/sys/crypto/aesni/aesni_wrap.c Thu May 26 19:29:29 2016 (r300773) @@ -55,7 +55,7 @@ struct blocks8 { void aesni_encrypt_cbc(int rounds, const void *key_schedule, size_t len, - const uint8_t *from, uint8_t *to, const uint8_t iv[AES_BLOCK_LEN]) + const uint8_t *from, uint8_t *to, const uint8_t iv[static AES_BLOCK_LEN]) { __m128i tot, ivreg; size_t i; @@ -74,7 +74,7 @@ aesni_encrypt_cbc(int rounds, const void void aesni_decrypt_cbc(int rounds, const void *key_schedule, size_t len, - uint8_t *buf, const uint8_t iv[AES_BLOCK_LEN]) + uint8_t *buf, const uint8_t iv[static AES_BLOCK_LEN]) { __m128i blocks[8]; struct blocks8 *blks; @@ -204,7 +204,7 @@ nextc(__m128i x) void aesni_encrypt_icm(int rounds, const void *key_schedule, size_t len, - const uint8_t *from, uint8_t *to, const uint8_t iv[AES_BLOCK_LEN]) + const uint8_t *from, uint8_t *to, const uint8_t iv[static AES_BLOCK_LEN]) { __m128i tot; __m128i tmp1, tmp2, tmp3, tmp4; @@ -378,7 +378,7 @@ aesni_crypt_xts_block8(int rounds, const static void aesni_crypt_xts(int rounds, const __m128i *data_schedule, const __m128i *tweak_schedule, size_t len, const uint8_t *from, - uint8_t *to, const uint8_t iv[AES_BLOCK_LEN], int do_encrypt) + uint8_t *to, const uint8_t iv[static AES_BLOCK_LEN], int do_encrypt) { __m128i tweakreg; uint8_t tweak[AES_XTS_BLOCKSIZE] __aligned(16); @@ -418,7 +418,7 @@ aesni_crypt_xts(int rounds, const __m128 void aesni_encrypt_xts(int rounds, const void *data_schedule, const void *tweak_schedule, size_t len, const uint8_t *from, uint8_t *to, - const uint8_t iv[AES_BLOCK_LEN]) + const uint8_t iv[static AES_BLOCK_LEN]) { aesni_crypt_xts(rounds, data_schedule, tweak_schedule, len, from, to, @@ -428,7 +428,7 @@ aesni_encrypt_xts(int rounds, const void void aesni_decrypt_xts(int rounds, const void *data_schedule, const void *tweak_schedule, size_t len, const uint8_t *from, uint8_t *to, - const uint8_t iv[AES_BLOCK_LEN]) + const uint8_t iv[static AES_BLOCK_LEN]) { aesni_crypt_xts(rounds, data_schedule, tweak_schedule, len, from, to, Modified: head/sys/crypto/sha1.c ============================================================================== --- head/sys/crypto/sha1.c Thu May 26 19:17:51 2016 (r300772) +++ head/sys/crypto/sha1.c Thu May 26 19:29:29 2016 (r300773) @@ -249,16 +249,14 @@ sha1_loop(ctxt, input, len) } void -sha1_result(ctxt, digest0) - struct sha1_ctxt *ctxt; - caddr_t digest0; +sha1_result(struct sha1_ctxt *ctxt, char digest0[static SHA1_RESULTLEN]) { u_int8_t *digest; digest = (u_int8_t *)digest0; sha1_pad(ctxt); #if BYTE_ORDER == BIG_ENDIAN - bcopy(&ctxt->h.b8[0], digest, 20); + bcopy(&ctxt->h.b8[0], digest, SHA1_RESULTLEN); #else digest[0] = ctxt->h.b8[3]; digest[1] = ctxt->h.b8[2]; digest[2] = ctxt->h.b8[1]; digest[3] = ctxt->h.b8[0]; Modified: head/sys/crypto/sha1.h ============================================================================== --- head/sys/crypto/sha1.h Thu May 26 19:17:51 2016 (r300772) +++ head/sys/crypto/sha1.h Thu May 26 19:29:29 2016 (r300773) @@ -35,8 +35,8 @@ * implemented by Jun-ichiro itojun Itoh */ -#ifndef _NETINET6_SHA1_H_ -#define _NETINET6_SHA1_H_ +#ifndef _CRYPTO_SHA1_H_ +#define _CRYPTO_SHA1_H_ struct sha1_ctxt { union { @@ -55,11 +55,13 @@ struct sha1_ctxt { }; typedef struct sha1_ctxt SHA1_CTX; +#define SHA1_RESULTLEN (160/8) + #ifdef _KERNEL extern void sha1_init(struct sha1_ctxt *); extern void sha1_pad(struct sha1_ctxt *); extern void sha1_loop(struct sha1_ctxt *, const u_int8_t *, size_t); -extern void sha1_result(struct sha1_ctxt *, caddr_t); +extern void sha1_result(struct sha1_ctxt *, char[static SHA1_RESULTLEN]); /* compatibilty with other SHA1 source codes */ #define SHA1Init(x) sha1_init((x)) @@ -67,6 +69,4 @@ extern void sha1_result(struct sha1_ctxt #define SHA1Final(x, y) sha1_result((y), (x)) #endif /* _KERNEL */ -#define SHA1_RESULTLEN (160/8) - -#endif /*_NETINET6_SHA1_H_*/ +#endif /*_CRYPTO_SHA1_H_*/ Modified: head/sys/crypto/sha2/sha256.h ============================================================================== --- head/sys/crypto/sha2/sha256.h Thu May 26 19:17:51 2016 (r300772) +++ head/sys/crypto/sha2/sha256.h Thu May 26 19:29:29 2016 (r300773) @@ -78,7 +78,7 @@ __BEGIN_DECLS void SHA256_Init(SHA256_CTX *); void SHA256_Update(SHA256_CTX *, const void *, size_t); -void SHA256_Final(unsigned char [SHA256_DIGEST_LENGTH], SHA256_CTX *); +void SHA256_Final(unsigned char [static SHA256_DIGEST_LENGTH], SHA256_CTX *); #ifndef _KERNEL char *SHA256_End(SHA256_CTX *, char *); char *SHA256_Data(const void *, unsigned int, char *); Modified: head/sys/crypto/sha2/sha256c.c ============================================================================== --- head/sys/crypto/sha2/sha256c.c Thu May 26 19:17:51 2016 (r300772) +++ head/sys/crypto/sha2/sha256c.c Thu May 26 19:29:29 2016 (r300773) @@ -287,17 +287,17 @@ SHA256_Update(SHA256_CTX * ctx, const vo * and clears the context state. */ void -SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx) +SHA256_Final(unsigned char digest[static SHA256_DIGEST_LENGTH], SHA256_CTX *ctx) { /* Add padding */ SHA256_Pad(ctx); /* Write the hash */ - be32enc_vect(digest, ctx->state, 32); + be32enc_vect(digest, ctx->state, SHA256_DIGEST_LENGTH); /* Clear the context state */ - memset((void *)ctx, 0, sizeof(*ctx)); + memset(ctx, 0, sizeof(*ctx)); } #ifdef WEAK_REFS Modified: head/sys/crypto/sha2/sha384.h ============================================================================== --- head/sys/crypto/sha2/sha384.h Thu May 26 19:17:51 2016 (r300772) +++ head/sys/crypto/sha2/sha384.h Thu May 26 19:29:29 2016 (r300773) @@ -74,7 +74,7 @@ __BEGIN_DECLS void SHA384_Init(SHA384_CTX *); void SHA384_Update(SHA384_CTX *, const void *, size_t); -void SHA384_Final(unsigned char [SHA384_DIGEST_LENGTH], SHA384_CTX *); +void SHA384_Final(unsigned char [static SHA384_DIGEST_LENGTH], SHA384_CTX *); #ifndef _KERNEL char *SHA384_End(SHA384_CTX *, char *); char *SHA384_Data(const void *, unsigned int, char *); Modified: head/sys/crypto/sha2/sha512.h ============================================================================== --- head/sys/crypto/sha2/sha512.h Thu May 26 19:17:51 2016 (r300772) +++ head/sys/crypto/sha2/sha512.h Thu May 26 19:29:29 2016 (r300773) @@ -77,7 +77,7 @@ __BEGIN_DECLS void SHA512_Init(SHA512_CTX *); void SHA512_Update(SHA512_CTX *, const void *, size_t); -void SHA512_Final(unsigned char [SHA512_DIGEST_LENGTH], SHA512_CTX *); +void SHA512_Final(unsigned char [static SHA512_DIGEST_LENGTH], SHA512_CTX *); #ifndef _KERNEL char *SHA512_End(SHA512_CTX *, char *); char *SHA512_Data(const void *, unsigned int, char *); Modified: head/sys/crypto/sha2/sha512c.c ============================================================================== --- head/sys/crypto/sha2/sha512c.c Thu May 26 19:17:51 2016 (r300772) +++ head/sys/crypto/sha2/sha512c.c Thu May 26 19:29:29 2016 (r300773) @@ -311,7 +311,7 @@ SHA512_Update(SHA512_CTX * ctx, const vo * and clears the context state. */ void -SHA512_Final(unsigned char digest[SHA512_DIGEST_LENGTH], SHA512_CTX * ctx) +SHA512_Final(unsigned char digest[static SHA512_DIGEST_LENGTH], SHA512_CTX *ctx) { /* Add padding */ @@ -321,7 +321,7 @@ SHA512_Final(unsigned char digest[SHA512 be64enc_vect(digest, ctx->state, SHA512_DIGEST_LENGTH); /* Clear the context state */ - memset((void *)ctx, 0, sizeof(*ctx)); + memset(ctx, 0, sizeof(*ctx)); } /*** SHA-384: *********************************************************/ @@ -361,7 +361,7 @@ SHA384_Update(SHA384_CTX * ctx, const vo * and clears the context state. */ void -SHA384_Final(unsigned char digest[SHA384_DIGEST_LENGTH], SHA384_CTX * ctx) +SHA384_Final(unsigned char digest[static SHA384_DIGEST_LENGTH], SHA384_CTX *ctx) { /* Add padding */ @@ -371,7 +371,7 @@ SHA384_Final(unsigned char digest[SHA384 be64enc_vect(digest, ctx->state, SHA384_DIGEST_LENGTH); /* Clear the context state */ - memset((void *)ctx, 0, sizeof(*ctx)); + memset(ctx, 0, sizeof(*ctx)); } #ifdef WEAK_REFS Modified: head/sys/crypto/siphash/siphash.c ============================================================================== --- head/sys/crypto/siphash/siphash.c Thu May 26 19:17:51 2016 (r300772) +++ head/sys/crypto/siphash/siphash.c Thu May 26 19:29:29 2016 (r300773) @@ -71,7 +71,7 @@ SipHash_InitX(SIPHASH_CTX *ctx, int rc, } void -SipHash_SetKey(SIPHASH_CTX *ctx, const uint8_t key[16]) +SipHash_SetKey(SIPHASH_CTX *ctx, const uint8_t key[static SIPHASH_KEY_LENGTH]) { uint64_t k[2]; @@ -167,7 +167,7 @@ SipHash_Update(SIPHASH_CTX *ctx, const v } void -SipHash_Final(void *dst, SIPHASH_CTX *ctx) +SipHash_Final(uint8_t dst[static SIPHASH_DIGEST_LENGTH], SIPHASH_CTX *ctx) { uint64_t r; @@ -196,8 +196,8 @@ SipHash_End(SIPHASH_CTX *ctx) } uint64_t -SipHashX(SIPHASH_CTX *ctx, int rc, int rf, const uint8_t key[16], - const void *src, size_t len) +SipHashX(SIPHASH_CTX *ctx, int rc, int rf, + const uint8_t key[static SIPHASH_KEY_LENGTH], const void *src, size_t len) { SipHash_InitX(ctx, rc, rf); Modified: head/sys/crypto/siphash/siphash.h ============================================================================== --- head/sys/crypto/siphash/siphash.h Thu May 26 19:17:51 2016 (r300772) +++ head/sys/crypto/siphash/siphash.h Thu May 26 19:29:29 2016 (r300773) @@ -68,14 +68,14 @@ typedef struct _SIPHASH_CTX { #define SipHash24_Init(x) SipHash_InitX((x), 2, 4) #define SipHash48_Init(x) SipHash_InitX((x), 4, 8) void SipHash_InitX(SIPHASH_CTX *, int, int); -void SipHash_SetKey(SIPHASH_CTX *, const uint8_t [16]); +void SipHash_SetKey(SIPHASH_CTX *, const uint8_t[static SIPHASH_KEY_LENGTH]); void SipHash_Update(SIPHASH_CTX *, const void *, size_t); -void SipHash_Final(void *, SIPHASH_CTX *); +void SipHash_Final(uint8_t[static SIPHASH_DIGEST_LENGTH], SIPHASH_CTX *); uint64_t SipHash_End(SIPHASH_CTX *); #define SipHash24(x, y, z, i) SipHashX((x), 2, 4, (y), (z), (i)); #define SipHash48(x, y, z, i) SipHashX((x), 4, 8, (y), (z), (i)); -uint64_t SipHashX(SIPHASH_CTX *, int, int, const uint8_t [16], const void *, +uint64_t SipHashX(SIPHASH_CTX *, int, int, const uint8_t[static SIPHASH_KEY_LENGTH], const void *, size_t); int SipHash24_TestVectors(void); Modified: head/sys/kern/md4c.c ============================================================================== --- head/sys/kern/md4c.c Thu May 26 19:17:51 2016 (r300772) +++ head/sys/kern/md4c.c Thu May 26 19:29:29 2016 (r300773) @@ -164,9 +164,7 @@ MD4_CTX *context; /* MD4 finalization. Ends an MD4 message-digest operation, writing the the message digest and zeroizing the context. */ -void MD4Final (digest, context) -unsigned char digest[16]; /* message digest */ -MD4_CTX *context; /* context */ +void MD4Final (unsigned char digest[static 16], MD4_CTX *context) { /* Do padding */ MD4Pad (context); @@ -176,7 +174,7 @@ MD4_CTX *context; /* Zeroize sensitive information. */ - bzero((POINTER)context, sizeof (*context)); + bzero(context, sizeof (*context)); } /* MD4 basic transformation. Transforms state based on block. Modified: head/sys/kern/md5c.c ============================================================================== --- head/sys/kern/md5c.c Thu May 26 19:17:51 2016 (r300772) +++ head/sys/kern/md5c.c Thu May 26 19:29:29 2016 (r300773) @@ -217,18 +217,16 @@ MD5Pad (MD5_CTX *context) */ void -MD5Final (digest, context) - unsigned char digest[16]; - MD5_CTX *context; +MD5Final(unsigned char digest[static MD5_DIGEST_LENGTH], MD5_CTX *context) { /* Do padding. */ MD5Pad (context); /* Store state in digest */ - Encode (digest, context->state, 16); + Encode (digest, context->state, MD5_DIGEST_LENGTH); /* Zeroize sensitive information. */ - memset ((void *)context, 0, sizeof (*context)); + memset (context, 0, sizeof (*context)); } /* MD5 basic transformation. Transforms state based on block. */ Modified: head/sys/sys/md4.h ============================================================================== --- head/sys/sys/md4.h Thu May 26 19:17:51 2016 (r300772) +++ head/sys/sys/md4.h Thu May 26 19:29:29 2016 (r300773) @@ -39,10 +39,7 @@ __BEGIN_DECLS void MD4Init(MD4_CTX *); void MD4Update(MD4_CTX *, const unsigned char *, unsigned int); void MD4Pad(MD4_CTX *); -void MD4Final(unsigned char [16], MD4_CTX *); -char * MD4End(MD4_CTX *, char *); -char * MD4File(const char *, char *); -char * MD4Data(const unsigned char *, unsigned int, char *); +void MD4Final(unsigned char [static 16], MD4_CTX *); __END_DECLS #endif /* _MD4_H_ */ Modified: head/sys/sys/md5.h ============================================================================== --- head/sys/sys/md5.h Thu May 26 19:17:51 2016 (r300772) +++ head/sys/sys/md5.h Thu May 26 19:29:29 2016 (r300773) @@ -44,10 +44,6 @@ typedef struct MD5Context { __BEGIN_DECLS void MD5Init (MD5_CTX *); void MD5Update (MD5_CTX *, const void *, unsigned int); -void MD5Final (unsigned char [16], MD5_CTX *); -char * MD5End(MD5_CTX *, char *); -char * MD5File(const char *, char *); -char * MD5FileChunk(const char *, char *, off_t, off_t); -char * MD5Data(const void *, unsigned int, char *); +void MD5Final (unsigned char[static MD5_DIGEST_LENGTH], MD5_CTX *); __END_DECLS #endif /* _SYS_MD5_H_ */ From owner-svn-src-head@freebsd.org Thu May 26 20:19:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45F37B4BB9E; Thu, 26 May 2016 20:19:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 36E601D59; Thu, 26 May 2016 20:19:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id D96C01AF2; Thu, 26 May 2016 20:19:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Thu, 26 May 2016 20:19:57 +0000 From: Glen Barber To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300773 - in head/sys: crypto crypto/aesni crypto/sha2 crypto/siphash kern sys Message-ID: <20160526201957.GU3335@FreeBSD.org> References: <201605261929.u4QJTTV5085421@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dw6fAZ2Gq7hkCwZ4" Content-Disposition: inline In-Reply-To: <201605261929.u4QJTTV5085421@repo.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 20:19:59 -0000 --dw6fAZ2Gq7hkCwZ4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 26, 2016 at 07:29:29PM +0000, Conrad E. Meyer wrote: > Author: cem > Date: Thu May 26 19:29:29 2016 > New Revision: 300773 > URL: https://svnweb.freebsd.org/changeset/base/300773 >=20 > Log: > crypto routines: Hint minimum buffer sizes to the compiler > =20 > Use the C99 'static' keyword to hint to the compiler IVs and output dig= est > sizes. The keyword informs the compiler of the minimum valid size for = a given > array. Obviously not every pointer can be validated (i.e., the compile= r can > produce false negative but not false positive reports). > =20 > No functional change. No ABI change. > =20 >=20 This change breaks -CURRENT. --- lib/libmd__L --- md5hl.c:48:10: warning: implicit declaration of function '_libmd_MD5FileChu= nk' is invalid in C99 [-Wimplicit-function-declaration] return (MD5FileChunk(filename, buf, 0, 0)); ^ /usr/src/lib/libmd/md5.h:32:22: note: expanded from macro 'MD5FileChunk' #define MD5FileChunk _libmd_MD5FileChunk ^ Glen --dw6fAZ2Gq7hkCwZ4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXR1ptAAoJEAMUWKVHj+KTOCIP/A6fXVR8MGtkeWDyeFgOdjuD y9Uu/9EXXzqwrE5FwwTryfSNG3uUll6kZE79bjTbkMR59McSt214IU9puo11+980 1GAThTp6K6boG0sxPBFOr2rEjGd3PO3t5OS9/wrHQsSfmdNn2a2V1G/RbDeMGEq+ yVldBpD5RchlmuQb/hf6hknTZ/MOe/MT1spf1NPXZRJMAI/D76jCL9TKpHxuVc3K gdV92YUpbAFkiQeAljR35+Y6o1bCPfPk22vlPoCYda0OCTq05u1TK6fd8hM6WYdB ETy9uNhS/2TRz98fc447sa624hraAmyhfpopQ1GDwWauLoIYA9N4/Pi7p41gtIpt ilTc6dW4jBtl8B+EaOV8uUckaWwDV+lZ29JxB19OG293cVZZpFeONhrIACdxuTlE 9kuUeINPTs0X0v5/Lp2ldV+oDmagZeNMjuW1GN6MrD4I1B8Fdej3P8Fda7J1Fn4d U8d5Lwd4L4Sc0NJg5cOC4s/c0onWjLsjLMvvlEEGQqr2qU5fAAyw9Jx+0M+tyYZR V+8ag3/StByTE00oI8sVt4+eowja9SHmRVCXkDgMxMlew5Apf98jPKmWULwSJrs4 nibpVsyR4/DO2HevdmRLzIF2pnDtuTBkLsRHFRVrOSrGO81IHIIWQlSnCN+vixrF 8s9K9zYhdIEMwmLc+9e4 =rlt8 -----END PGP SIGNATURE----- --dw6fAZ2Gq7hkCwZ4-- From owner-svn-src-head@freebsd.org Thu May 26 20:37:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 193A0B4B258; Thu, 26 May 2016 20:37:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF7A51A39; Thu, 26 May 2016 20:37:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QKbo1j010356; Thu, 26 May 2016 20:37:50 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QKboBj010354; Thu, 26 May 2016 20:37:50 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605262037.u4QKboBj010354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 26 May 2016 20:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300774 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 20:37:51 -0000 Author: cem Date: Thu May 26 20:37:49 2016 New Revision: 300774 URL: https://svnweb.freebsd.org/changeset/base/300774 Log: Ifndef KERNEL the userspace-only routines in sys/md[45].h A follow-up to r300773. Nothing in the kernel uses those definitions, but apparently libmd includes the sys/md45 headers. Fix the build. Reported by: gjb Pointy-hat: cem Sponsored by: EMC / Isilon Storage Division Modified: head/sys/sys/md4.h head/sys/sys/md5.h Modified: head/sys/sys/md4.h ============================================================================== --- head/sys/sys/md4.h Thu May 26 19:29:29 2016 (r300773) +++ head/sys/sys/md4.h Thu May 26 20:37:49 2016 (r300774) @@ -40,6 +40,11 @@ void MD4Init(MD4_CTX *); void MD4Update(MD4_CTX *, const unsigned char *, unsigned int); void MD4Pad(MD4_CTX *); void MD4Final(unsigned char [static 16], MD4_CTX *); +#ifndef _KERNEL +char * MD4End(MD4_CTX *, char *); +char * MD4File(const char *, char *); +char * MD4Data(const unsigned char *, unsigned int, char *); +#endif __END_DECLS #endif /* _MD4_H_ */ Modified: head/sys/sys/md5.h ============================================================================== --- head/sys/sys/md5.h Thu May 26 19:29:29 2016 (r300773) +++ head/sys/sys/md5.h Thu May 26 20:37:49 2016 (r300774) @@ -45,5 +45,11 @@ __BEGIN_DECLS void MD5Init (MD5_CTX *); void MD5Update (MD5_CTX *, const void *, unsigned int); void MD5Final (unsigned char[static MD5_DIGEST_LENGTH], MD5_CTX *); +#ifndef _KERNEL +char * MD5End(MD5_CTX *, char *); +char * MD5File(const char *, char *); +char * MD5FileChunk(const char *, char *, off_t, off_t); +char * MD5Data(const void *, unsigned int, char *); +#endif __END_DECLS #endif /* _SYS_MD5_H_ */ From owner-svn-src-head@freebsd.org Thu May 26 20:45:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77C45B4B432; Thu, 26 May 2016 20:45:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 0E64A1EB4; Thu, 26 May 2016 20:45:07 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r300774 - head/sys/sys To: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605262037.u4QKboBj010354@repo.freebsd.org> From: Jung-uk Kim Message-ID: <34b0824d-3e31-beb3-5d77-81ef980c435f@FreeBSD.org> Date: Thu, 26 May 2016 16:45:02 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605262037.u4QKboBj010354@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3D4NKI4oEkEHNqc7tAmfnLCwo1T7cX3dk" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 20:45:08 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3D4NKI4oEkEHNqc7tAmfnLCwo1T7cX3dk Content-Type: multipart/mixed; boundary="N7AqxerXXPreDAl1kIxwdFp56hXdvsg71" From: Jung-uk Kim To: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <34b0824d-3e31-beb3-5d77-81ef980c435f@FreeBSD.org> Subject: Re: svn commit: r300774 - head/sys/sys References: <201605262037.u4QKboBj010354@repo.freebsd.org> In-Reply-To: <201605262037.u4QKboBj010354@repo.freebsd.org> --N7AqxerXXPreDAl1kIxwdFp56hXdvsg71 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/26/16 04:37 PM, Conrad E. Meyer wrote: > Author: cem > Date: Thu May 26 20:37:49 2016 > New Revision: 300774 > URL: https://svnweb.freebsd.org/changeset/base/300774 >=20 > Log: > Ifndef KERNEL the userspace-only routines in sys/md[45].h > =20 > A follow-up to r300773. Nothing in the kernel uses those definitions= , but > apparently libmd includes the sys/md45 headers. Fix the build. =2E.. libmd/md4.h does not include sys/md4.h. Jung-uk Kim --N7AqxerXXPreDAl1kIxwdFp56hXdvsg71-- --3D4NKI4oEkEHNqc7tAmfnLCwo1T7cX3dk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXR2BTAAoJEHyflib82/FGud0H/jNGZHDVoXni7BMZecHH5KB4 lFvOyi5NeMZDEfdRjMKRteTPmRWrlESEt1U0LCXb0lWwlz5lmhPR4F7kNdDrsl3X AzWtBPRFEpyVcySAUZJMrPSYotZ/K2gpI/AWb5fqptyajUw8TBTWa64w5lrasRin nF4HSnwapvzGYhLltfsQfJio8vUjaKwG+XmboujH0dQ9PVnAdGOkeFllrAI//tF9 73Efi3FT/cU16NEQ1HEC4ypYVm//OmwSp31hiUOSryDCyfxFiea5LxGyl8iZTY4u c0ZpodU/nJwttqbXND9DxBviiDlnVberszym0xGZQv87Wb90f7k3slQCz1kFcYc= =0yxO -----END PGP SIGNATURE----- --3D4NKI4oEkEHNqc7tAmfnLCwo1T7cX3dk-- From owner-svn-src-head@freebsd.org Thu May 26 20:55:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62652B4B72D; Thu, 26 May 2016 20:55:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1629814B7; Thu, 26 May 2016 20:55:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QKtF8h017469; Thu, 26 May 2016 20:55:15 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QKtFcJ017468; Thu, 26 May 2016 20:55:15 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201605262055.u4QKtFcJ017468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 26 May 2016 20:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300775 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 20:55:16 -0000 Author: ed Date: Thu May 26 20:55:15 2016 New Revision: 300775 URL: https://svnweb.freebsd.org/changeset/base/300775 Log: Let l64a() properly null terminate its result. Though the buffer used by l64a() is initialized with null bytes, repetetive calls may end up having trailing garbage of previous invocations because we don't end up terminating the string. Instead of importing NetBSD's fix, use this opportunity to simplify this function dramatically, for example by just storing the Base64 character set in a string. There is also no need to do the bitmasking, as we can just use the proper integer type from . MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D6511 Modified: head/lib/libc/stdlib/l64a.c Modified: head/lib/libc/stdlib/l64a.c ============================================================================== --- head/lib/libc/stdlib/l64a.c Thu May 26 20:37:49 2016 (r300774) +++ head/lib/libc/stdlib/l64a.c Thu May 26 20:55:15 2016 (r300775) @@ -12,18 +12,13 @@ __RCSID("$NetBSD: l64a.c,v 1.13 2003/07/ #include __FBSDID("$FreeBSD$"); +#include #include -#define ADOT 46 /* ASCII '.' */ -#define ASLASH ADOT + 1 /* ASCII '/' */ -#define A0 48 /* ASCII '0' */ -#define AA 65 /* ASCII 'A' */ -#define Aa 97 /* ASCII 'a' */ - char * l64a(long value) { - static char buf[8]; + static char buf[7]; (void)l64a_r(value, buf, sizeof(buf)); return (buf); @@ -32,21 +27,18 @@ l64a(long value) int l64a_r(long value, char *buffer, int buflen) { - long v; - int digit; - - v = value & (long)0xffffffff; - for (; v != 0 && buflen > 1; buffer++, buflen--) { - digit = v & 0x3f; - if (digit < 2) - *buffer = digit + ADOT; - else if (digit < 12) - *buffer = digit + A0 - 2; - else if (digit < 38) - *buffer = digit + AA - 12; - else - *buffer = digit + Aa - 38; + static const char chars[] = + "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + uint32_t v; + + v = value; + while (buflen-- > 0) { + if (v == 0) { + *buffer = '\0'; + return (0); + } + *buffer++ = chars[v & 0x3f]; v >>= 6; } - return (v == 0 ? 0 : -1); + return (-1); } From owner-svn-src-head@freebsd.org Thu May 26 21:07:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E8C7B4BA5C; Thu, 26 May 2016 21:07:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 688101BEA; Thu, 26 May 2016 21:07:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u4QL7UOg009283 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 26 May 2016 14:07:31 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u4QL7Ujs009282; Thu, 26 May 2016 14:07:30 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 26 May 2016 14:07:30 -0700 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300489 - head/sys/kern Message-ID: <20160526210730.GH58287@FreeBSD.org> References: <201605231031.u4NAVspJ081312@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605231031.u4NAVspJ081312@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 21:07:32 -0000 On Mon, May 23, 2016 at 10:31:54AM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Mon May 23 10:31:54 2016 H> New Revision: 300489 H> URL: https://svnweb.freebsd.org/changeset/base/300489 H> H> Log: H> Use DELAY() instead of _sleep() when SCHEDULER_STOPPED() is set inside H> pause_sbt(). This allows pause() to continue working during a panic() H> which is not invoking KDB. This is useful when debugging graphics H> drivers using the LinuxKPI. H> H> Obtained from: kmacy @ H> MFC after: 1 week I wonder if this will help me with my freezes after panics in geom_mirror() and in mps(4), which I handled as similar patches to these drivers theirselves. Thanks! H> Modified: head/sys/kern/kern_synch.c H> ============================================================================== H> --- head/sys/kern/kern_synch.c Mon May 23 09:44:06 2016 (r300488) H> +++ head/sys/kern/kern_synch.c Mon May 23 10:31:54 2016 (r300489) H> @@ -327,7 +327,7 @@ pause_sbt(const char *wmesg, sbintime_t H> if (sbt == 0) H> sbt = tick_sbt; H> H> - if (cold || kdb_active) { H> + if (cold || kdb_active || SCHEDULER_STOPPED()) { H> /* H> * We delay one second at a time to avoid overflowing the H> * system specific DELAY() function(s): -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu May 26 21:08:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FD0DB4BB02; Thu, 26 May 2016 21:08:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5A5E1D82; Thu, 26 May 2016 21:08:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QL8jfe021336; Thu, 26 May 2016 21:08:45 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QL8iY7021334; Thu, 26 May 2016 21:08:44 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605262108.u4QL8iY7021334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 26 May 2016 21:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300776 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 21:08:46 -0000 Author: gjb Date: Thu May 26 21:08:44 2016 New Revision: 300776 URL: https://svnweb.freebsd.org/changeset/base/300776 Log: Remove vestigial cloudware-install bits missed in r300767. Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile head/release/Makefile.vm Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Thu May 26 20:55:15 2016 (r300775) +++ head/release/Makefile Thu May 26 21:08:44 2016 (r300776) @@ -291,7 +291,7 @@ real-release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS} -install: release-install vm-install cloudware-install +install: release-install vm-install release-install: .if defined(DESTDIR) && !empty(DESTDIR) Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Thu May 26 20:55:15 2016 (r300775) +++ head/release/Makefile.vm Thu May 26 21:08:44 2016 (r300776) @@ -46,7 +46,6 @@ CLEANFILES+= ${_CW:tl}.img \ ${_CW:tl}.${${_CW:tu}_FORMAT} \ ${_CW:tl}.${${_CW:tu}_FORMAT}.raw \ cw${_CW:tl}-package -CLOUDINSTALL+= cw${_CW:tl}-install CLOUDPACKAGE+= cw${_CW:tl}-package ${_CW:tu}IMAGE= ${_CW:tl}.${${_CW:tu}_FORMAT} . if exists(${.CURDIR}/tools/${_CW:tl}.conf) && !defined(${_CW:tu}CONF) @@ -145,11 +144,6 @@ cloudware-release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS} .endif -cloudware-install: -.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) - ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDINSTALL} -.endif - .include "${.CURDIR}/Makefile.ec2" .include "${.CURDIR}/Makefile.azure" .include "${.CURDIR}/Makefile.gce" From owner-svn-src-head@freebsd.org Thu May 26 21:09:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 432D4B4BB68; Thu, 26 May 2016 21:09:09 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EE621EE8; Thu, 26 May 2016 21:09:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QL98qG021404; Thu, 26 May 2016 21:09:08 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QL97Hl021395; Thu, 26 May 2016 21:09:07 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201605262109.u4QL97Hl021395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 May 2016 21:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300777 - in head/sys: arm/allwinner boot/fdt/dts/arm dev/iicbus/twsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 21:09:09 -0000 Author: manu Date: Thu May 26 21:09:07 2016 New Revision: 300777 URL: https://svnweb.freebsd.org/changeset/base/300777 Log: Add support for interrupts, sensors and GPIO for AXP209 PMIC. Pressing the PEK (power enable key) will shutdown the board. Some events are reported to devd via system "PMU" and subsystem "Battery", "AC" and "USB" such as connected/disconnected. Some sensors values (power source voltage/current) are reported via sysctl (dev.axp209_pmu.X.) It also expose a gpioc node usable in kernel and userland. Only 3 of the 4 GPIO are exposed (The GPIO3 is different and mostly unused on boards). Most popular boards uses GPIO1 as a sense pin for OTG power. Add a dtsi file that adds gpio-controller capability to the device as upstream doesn't defined it and include it in our custom DTS. Reviewed by: jmcneill Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D6135 Added: head/sys/arm/allwinner/axp209reg.h (contents, props changed) head/sys/boot/fdt/dts/arm/xpowers-axp209.dtsi (contents, props changed) Modified: head/sys/arm/allwinner/axp209.c head/sys/boot/fdt/dts/arm/bananapi.dts head/sys/boot/fdt/dts/arm/cubieboard.dts head/sys/boot/fdt/dts/arm/cubieboard2.dts head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts head/sys/boot/fdt/dts/arm/olinuxino-lime.dts head/sys/dev/iicbus/twsi/a10_twsi.c Modified: head/sys/arm/allwinner/axp209.c ============================================================================== --- head/sys/arm/allwinner/axp209.c Thu May 26 21:08:44 2016 (r300776) +++ head/sys/arm/allwinner/axp209.c Thu May 26 21:09:07 2016 (r300777) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2015 Emmanuel Vadot + * Copyright (c) 2015-2016 Emmanuel Vadot + * Copyright (c) 2016 Jared McNeill * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -46,40 +48,45 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include -#include "iicbus_if.h" - -/* Power State Register */ -#define AXP209_PSR 0x00 -#define AXP209_PSR_ACIN 0x80 -#define AXP209_PSR_ACIN_SHIFT 7 -#define AXP209_PSR_VBUS 0x20 -#define AXP209_PSR_VBUS_SHIFT 5 - -/* Shutdown and battery control */ -#define AXP209_SHUTBAT 0x32 -#define AXP209_SHUTBAT_SHUTDOWN 0x80 - -/* Temperature monitor */ -#define AXP209_TEMPMON 0x5e -#define AXP209_TEMPMON_H(a) ((a) << 4) -#define AXP209_TEMPMON_L(a) ((a) & 0xf) -#define AXP209_TEMPMON_MIN 1447 /* -144.7C */ +#include -#define AXP209_0C_TO_K 2731 +#include "iicbus_if.h" +#include "gpio_if.h" struct axp209_softc { + device_t dev; uint32_t addr; - struct intr_config_hook enum_hook; + struct resource * res[1]; + void * intrcookie; + struct intr_config_hook intr_hook; + device_t gpiodev; + struct mtx mtx; +}; + +/* GPIO3 is different, don't expose it for now */ +static const struct { + const char *name; + uint8_t ctrl_reg; +} axp209_pins[] = { + { "GPIO0", AXP209_GPIO0_CTRL }, + { "GPIO1", AXP209_GPIO1_CTRL }, + { "GPIO2", AXP209_GPIO2_CTRL }, }; -enum axp209_sensor { - AXP209_TEMP +static struct resource_spec axp_res_spec[] = { + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0, 0 } }; +#define AXP_LOCK(sc) mtx_lock(&(sc)->mtx) +#define AXP_UNLOCK(sc) mtx_unlock(&(sc)->mtx) + static int axp209_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { @@ -125,16 +132,75 @@ axp209_sysctl(SYSCTL_HANDLER_ARGS) uint8_t data[2]; int val, error; - if (sensor != AXP209_TEMP) + switch (sensor) { + case AXP209_TEMP: + error = axp209_read(dev, AXP209_TEMPMON, data, 2); + if (error != 0) + return (error); + + /* Temperature is between -144.7C and 264.8C, step +0.1C */ + val = (AXP209_SENSOR_H(data[0]) | AXP209_SENSOR_L(data[1])) - + AXP209_TEMPMON_MIN + AXP209_0C_TO_K; + break; + case AXP209_ACVOLT: + error = axp209_read(dev, AXP209_ACIN_VOLTAGE, data, 2); + if (error != 0) + return (error); + + val = (AXP209_SENSOR_H(data[0]) | AXP209_SENSOR_L(data[1])) * + AXP209_VOLT_STEP; + break; + case AXP209_ACCURRENT: + error = axp209_read(dev, AXP209_ACIN_CURRENT, data, 2); + if (error != 0) + return (error); + + val = (AXP209_SENSOR_H(data[0]) | AXP209_SENSOR_L(data[1])) * + AXP209_ACCURRENT_STEP; + break; + case AXP209_VBUSVOLT: + error = axp209_read(dev, AXP209_VBUS_VOLTAGE, data, 2); + if (error != 0) + return (error); + + val = (AXP209_SENSOR_H(data[0]) | AXP209_SENSOR_L(data[1])) * + AXP209_VOLT_STEP; + break; + case AXP209_VBUSCURRENT: + error = axp209_read(dev, AXP209_VBUS_CURRENT, data, 2); + if (error != 0) + return (error); + + val = (AXP209_SENSOR_H(data[0]) | AXP209_SENSOR_L(data[1])) * + AXP209_VBUSCURRENT_STEP; + break; + case AXP209_BATVOLT: + error = axp209_read(dev, AXP209_BAT_VOLTAGE, data, 2); + if (error != 0) + return (error); + + val = (AXP209_SENSOR_H(data[0]) | AXP209_SENSOR_L(data[1])) * + AXP209_BATVOLT_STEP; + break; + case AXP209_BATCHARGECURRENT: + error = axp209_read(dev, AXP209_BAT_CHARGE_CURRENT, data, 2); + if (error != 0) + return (error); + + val = (AXP209_SENSOR_H(data[0]) | AXP209_SENSOR_L(data[1])) * + AXP209_BATCURRENT_STEP; + break; + case AXP209_BATDISCHARGECURRENT: + error = axp209_read(dev, AXP209_BAT_DISCHARGE_CURRENT, data, 2); + if (error != 0) + return (error); + + val = (AXP209_SENSOR_BAT_H(data[0]) | + AXP209_SENSOR_BAT_L(data[1])) * AXP209_BATCURRENT_STEP; + break; + default: return (ENOENT); - - error = axp209_read(dev, AXP209_TEMPMON, data, 2); - if (error != 0) - return (error); - - /* Temperature is between -144.7C and 264.8C, step +0.1C */ - val = (AXP209_TEMPMON_H(data[0]) | AXP209_TEMPMON_L(data[1])) - - AXP209_TEMPMON_MIN + AXP209_0C_TO_K; + } return sysctl_handle_opaque(oidp, &val, sizeof(val), req); } @@ -154,32 +220,317 @@ axp209_shutdown(void *devp, int howto) axp209_write(dev, AXP209_SHUTBAT, AXP209_SHUTBAT_SHUTDOWN); } +static void +axp_intr(void *arg) +{ + struct axp209_softc *sc; + uint8_t reg; + + sc = arg; + + axp209_read(sc->dev, AXP209_IRQ1_STATUS, ®, 1); + if (reg) { + if (reg & AXP209_IRQ1_AC_OVERVOLT) + devctl_notify("PMU", "AC", "overvoltage", NULL); + if (reg & AXP209_IRQ1_VBUS_OVERVOLT) + devctl_notify("PMU", "USB", "overvoltage", NULL); + if (reg & AXP209_IRQ1_VBUS_LOW) + devctl_notify("PMU", "USB", "undervoltage", NULL); + if (reg & AXP209_IRQ1_AC_CONN) + devctl_notify("PMU", "AC", "plugged", NULL); + if (reg & AXP209_IRQ1_AC_DISCONN) + devctl_notify("PMU", "AC", "unplugged", NULL); + if (reg & AXP209_IRQ1_VBUS_CONN) + devctl_notify("PMU", "USB", "plugged", NULL); + if (reg & AXP209_IRQ1_VBUS_DISCONN) + devctl_notify("PMU", "USB", "unplugged", NULL); + axp209_write(sc->dev, AXP209_IRQ1_STATUS, AXP209_IRQ_ACK); + } + + axp209_read(sc->dev, AXP209_IRQ2_STATUS, ®, 1); + if (reg) { + if (reg & AXP209_IRQ2_BATT_CHARGED) + devctl_notify("PMU", "Battery", "charged", NULL); + if (reg & AXP209_IRQ2_BATT_CHARGING) + devctl_notify("PMU", "Battery", "charging", NULL); + if (reg & AXP209_IRQ2_BATT_CONN) + devctl_notify("PMU", "Battery", "connected", NULL); + if (reg & AXP209_IRQ2_BATT_DISCONN) + devctl_notify("PMU", "Battery", "disconnected", NULL); + if (reg & AXP209_IRQ2_BATT_TEMP_LOW) + devctl_notify("PMU", "Battery", "low temp", NULL); + if (reg & AXP209_IRQ2_BATT_TEMP_OVER) + devctl_notify("PMU", "Battery", "high temp", NULL); + axp209_write(sc->dev, AXP209_IRQ2_STATUS, AXP209_IRQ_ACK); + } + + axp209_read(sc->dev, AXP209_IRQ3_STATUS, ®, 1); + if (reg) { + if (reg & AXP209_IRQ3_PEK_SHORT) + shutdown_nice(RB_POWEROFF); + axp209_write(sc->dev, AXP209_IRQ3_STATUS, AXP209_IRQ_ACK); + } + + axp209_read(sc->dev, AXP209_IRQ4_STATUS, ®, 1); + if (reg) { + axp209_write(sc->dev, AXP209_IRQ4_STATUS, AXP209_IRQ_ACK); + } + + axp209_read(sc->dev, AXP209_IRQ5_STATUS, ®, 1); + if (reg) { + axp209_write(sc->dev, AXP209_IRQ5_STATUS, AXP209_IRQ_ACK); + } +} + +static device_t +axp209_gpio_get_bus(device_t dev) +{ + struct axp209_softc *sc; + + sc = device_get_softc(dev); + + return (sc->gpiodev); +} + static int -axp209_probe(device_t dev) +axp209_gpio_pin_max(device_t dev, int *maxpin) { + *maxpin = nitems(axp209_pins) - 1; - if (!ofw_bus_status_okay(dev)) - return (ENXIO); + return (0); +} - if (!ofw_bus_is_compatible(dev, "x-powers,axp209")) - return (ENXIO); +static int +axp209_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + if (pin >= nitems(axp209_pins)) + return (EINVAL); - device_set_desc(dev, "X-Power AXP209 Power Management Unit"); + snprintf(name, GPIOMAXNAME, "%s", axp209_pins[pin].name); - return (BUS_PROBE_DEFAULT); + return (0); } static int -axp209_attach(device_t dev) +axp209_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + if (pin >= nitems(axp209_pins)) + return (EINVAL); + + *caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; + + return (0); +} + +static int +axp209_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) { struct axp209_softc *sc; + uint8_t data, func; + int error; + + if (pin >= nitems(axp209_pins)) + return (EINVAL); + + sc = device_get_softc(dev); + + AXP_LOCK(sc); + error = axp209_read(dev, axp209_pins[pin].ctrl_reg, &data, 1); + if (error == 0) { + func = data & AXP209_GPIO_FUNC_MASK; + if (func == AXP209_GPIO_FUNC_INPUT) + *flags = GPIO_PIN_INPUT; + else if (func == AXP209_GPIO_FUNC_DRVLO || + func == AXP209_GPIO_FUNC_DRVHI) + *flags = GPIO_PIN_OUTPUT; + else + *flags = 0; + } + AXP_UNLOCK(sc); + + return (error); +} + +static int +axp209_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct axp209_softc *sc; + uint8_t data; + int error; + + if (pin >= nitems(axp209_pins)) + return (EINVAL); + + sc = device_get_softc(dev); + + AXP_LOCK(sc); + error = axp209_read(dev, axp209_pins[pin].ctrl_reg, &data, 1); + if (error == 0) { + data &= ~AXP209_GPIO_FUNC_MASK; + if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) != 0) { + if ((flags & GPIO_PIN_OUTPUT) == 0) + data |= AXP209_GPIO_FUNC_INPUT; + } + error = axp209_write(dev, axp209_pins[pin].ctrl_reg, data); + } + AXP_UNLOCK(sc); + + return (error); +} + +static int +axp209_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct axp209_softc *sc; + uint8_t data, func; + int error; + + if (pin >= nitems(axp209_pins)) + return (EINVAL); + + sc = device_get_softc(dev); + + AXP_LOCK(sc); + error = axp209_read(dev, axp209_pins[pin].ctrl_reg, &data, 1); + if (error == 0) { + func = data & AXP209_GPIO_FUNC_MASK; + switch (func) { + case AXP209_GPIO_FUNC_DRVLO: + *val = 0; + break; + case AXP209_GPIO_FUNC_DRVHI: + *val = 1; + break; + case AXP209_GPIO_FUNC_INPUT: + error = axp209_read(dev, AXP209_GPIO_STATUS, &data, 1); + if (error == 0) + *val = (data & AXP209_GPIO_DATA(pin)) ? 1 : 0; + break; + default: + error = EIO; + break; + } + } + AXP_UNLOCK(sc); + + return (error); +} + +static int +axp209_gpio_pin_set(device_t dev, uint32_t pin, unsigned int val) +{ + struct axp209_softc *sc; + uint8_t data, func; + int error; + + if (pin >= nitems(axp209_pins)) + return (EINVAL); + + sc = device_get_softc(dev); + + AXP_LOCK(sc); + error = axp209_read(dev, axp209_pins[pin].ctrl_reg, &data, 1); + if (error == 0) { + func = data & AXP209_GPIO_FUNC_MASK; + switch (func) { + case AXP209_GPIO_FUNC_DRVLO: + case AXP209_GPIO_FUNC_DRVHI: + /* GPIO2 can't be set to 1 */ + if (pin == 2 && val == 1) { + error = EINVAL; + break; + } + data &= ~AXP209_GPIO_FUNC_MASK; + data |= val; + break; + default: + error = EIO; + break; + } + } + if (error == 0) + error = axp209_write(dev, axp209_pins[pin].ctrl_reg, data); + AXP_UNLOCK(sc); + + return (error); +} + + +static int +axp209_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct axp209_softc *sc; + uint8_t data, func; + int error; + + if (pin >= nitems(axp209_pins)) + return (EINVAL); + + sc = device_get_softc(dev); + + AXP_LOCK(sc); + error = axp209_read(dev, axp209_pins[pin].ctrl_reg, &data, 1); + if (error == 0) { + func = data & AXP209_GPIO_FUNC_MASK; + switch (func) { + case AXP209_GPIO_FUNC_DRVLO: + /* Pin 2 can't be set to 1*/ + if (pin == 2) { + error = EINVAL; + break; + } + data &= ~AXP209_GPIO_FUNC_MASK; + data |= AXP209_GPIO_FUNC_DRVHI; + break; + case AXP209_GPIO_FUNC_DRVHI: + data &= ~AXP209_GPIO_FUNC_MASK; + data |= AXP209_GPIO_FUNC_DRVLO; + break; + default: + error = EIO; + break; + } + } + if (error == 0) + error = axp209_write(dev, axp209_pins[pin].ctrl_reg, data); + AXP_UNLOCK(sc); + + return (error); +} + +static int +axp209_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, + int gcells, pcell_t *gpios, uint32_t *pin, uint32_t *flags) +{ + if (gpios[0] >= nitems(axp209_pins)) + return (EINVAL); + + *pin = gpios[0]; + *flags = gpios[1]; + + return (0); +} + +static phandle_t +axp209_get_node(device_t dev, device_t bus) +{ + return (ofw_bus_get_node(dev)); +} + +static void +axp209_start(void *pdev) +{ + device_t dev; + struct axp209_softc *sc; const char *pwr_name[] = {"Battery", "AC", "USB", "AC and USB"}; uint8_t data; uint8_t pwr_src; - sc = device_get_softc(dev); + dev = pdev; + sc = device_get_softc(dev); sc->addr = iicbus_get_addr(dev); + sc->dev = dev; if (bootverbose) { /* @@ -195,22 +546,154 @@ axp209_attach(device_t dev) pwr_name[pwr_src]); } + /* Only enable interrupts that we are interested in */ + axp209_write(dev, AXP209_IRQ1_ENABLE, + AXP209_IRQ1_AC_OVERVOLT | + AXP209_IRQ1_AC_DISCONN | + AXP209_IRQ1_AC_CONN | + AXP209_IRQ1_VBUS_OVERVOLT | + AXP209_IRQ1_VBUS_DISCONN | + AXP209_IRQ1_VBUS_CONN); + axp209_write(dev, AXP209_IRQ2_ENABLE, + AXP209_IRQ2_BATT_CONN | + AXP209_IRQ2_BATT_DISCONN | + AXP209_IRQ2_BATT_CHARGE_ACCT_ON | + AXP209_IRQ2_BATT_CHARGE_ACCT_OFF | + AXP209_IRQ2_BATT_CHARGING | + AXP209_IRQ2_BATT_CHARGED | + AXP209_IRQ2_BATT_TEMP_OVER | + AXP209_IRQ2_BATT_TEMP_LOW); + axp209_write(dev, AXP209_IRQ3_ENABLE, + AXP209_IRQ3_PEK_SHORT | AXP209_IRQ3_PEK_LONG); + axp209_write(dev, AXP209_IRQ4_ENABLE, AXP209_IRQ4_APS_LOW_2); + axp209_write(dev, AXP209_IRQ5_ENABLE, 0x0); + EVENTHANDLER_REGISTER(shutdown_final, axp209_shutdown, dev, SHUTDOWN_PRI_LAST); + /* Enable ADC sensors */ + if (axp209_write(dev, AXP209_ADC_ENABLE1, + AXP209_ADC1_BATVOLT | AXP209_ADC1_BATCURRENT | + AXP209_ADC1_ACVOLT | AXP209_ADC1_ACCURRENT | + AXP209_ADC1_VBUSVOLT | AXP209_ADC1_VBUSCURRENT) != -1) { + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "acvolt", + CTLTYPE_INT | CTLFLAG_RD, + dev, AXP209_ACVOLT, axp209_sysctl, "I", + "AC Voltage (microVolt)"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "accurrent", + CTLTYPE_INT | CTLFLAG_RD, + dev, AXP209_ACCURRENT, axp209_sysctl, "I", + "AC Current (microAmpere)"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "vbusvolt", + CTLTYPE_INT | CTLFLAG_RD, + dev, AXP209_VBUSVOLT, axp209_sysctl, "I", + "VBUS Voltage (microVolt)"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "vbuscurrent", + CTLTYPE_INT | CTLFLAG_RD, + dev, AXP209_VBUSCURRENT, axp209_sysctl, "I", + "VBUS Current (microAmpere)"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "batvolt", + CTLTYPE_INT | CTLFLAG_RD, + dev, AXP209_BATVOLT, axp209_sysctl, "I", + "Battery Voltage (microVolt)"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "batchargecurrent", + CTLTYPE_INT | CTLFLAG_RD, + dev, AXP209_BATCHARGECURRENT, axp209_sysctl, "I", + "Battery Charging Current (microAmpere)"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "batdischargecurrent", + CTLTYPE_INT | CTLFLAG_RD, + dev, AXP209_BATDISCHARGECURRENT, axp209_sysctl, "I", + "Battery Discharging Current (microAmpere)"); + } else { + device_printf(dev, "Couldn't enable ADC sensors\n"); + } + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "temp", CTLTYPE_INT | CTLFLAG_RD, dev, AXP209_TEMP, axp209_sysctl, "IK", "Internal temperature"); + if ((bus_setup_intr(dev, sc->res[0], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, axp_intr, sc, &sc->intrcookie))) + device_printf(dev, "unable to register interrupt handler\n"); + + config_intrhook_disestablish(&sc->intr_hook); +} + +static int +axp209_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "x-powers,axp209")) + return (ENXIO); + + device_set_desc(dev, "X-Powers AXP209 Power Management Unit"); + + return (BUS_PROBE_DEFAULT); +} + +static int +axp209_attach(device_t dev) +{ + struct axp209_softc *sc; + + sc = device_get_softc(dev); + mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + if (bus_alloc_resources(dev, axp_res_spec, sc->res) != 0) { + device_printf(dev, "can't allocate device resources\n"); + return (ENXIO); + } + + sc->intr_hook.ich_func = axp209_start; + sc->intr_hook.ich_arg = dev; + + if (config_intrhook_establish(&sc->intr_hook) != 0) + return (ENOMEM); + + sc->gpiodev = gpiobus_attach_bus(dev); + return (0); } static device_method_t axp209_methods[] = { DEVMETHOD(device_probe, axp209_probe), DEVMETHOD(device_attach, axp209_attach), - {0, 0}, + + /* GPIO interface */ + DEVMETHOD(gpio_get_bus, axp209_gpio_get_bus), + DEVMETHOD(gpio_pin_max, axp209_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, axp209_gpio_pin_getname), + DEVMETHOD(gpio_pin_getcaps, axp209_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_getflags, axp209_gpio_pin_getflags), + DEVMETHOD(gpio_pin_setflags, axp209_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, axp209_gpio_pin_get), + DEVMETHOD(gpio_pin_set, axp209_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, axp209_gpio_pin_toggle), + DEVMETHOD(gpio_map_gpios, axp209_gpio_map_gpios), + + /* OFW bus interface */ + DEVMETHOD(ofw_bus_get_node, axp209_get_node), + + DEVMETHOD_END }; static driver_t axp209_driver = { @@ -220,7 +703,14 @@ static driver_t axp209_driver = { }; static devclass_t axp209_devclass; +extern devclass_t ofwgpiobus_devclass, gpioc_devclass; +extern driver_t ofw_gpiobus_driver, gpioc_driver; -DRIVER_MODULE(axp209, iicbus, axp209_driver, axp209_devclass, 0, 0); +EARLY_DRIVER_MODULE(axp209, iicbus, axp209_driver, axp209_devclass, + 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); +EARLY_DRIVER_MODULE(ofw_gpiobus, axp209_pmu, ofw_gpiobus_driver, + ofwgpiobus_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); +EARLY_DRIVER_MODULE(gpioc, axp209_pmu, gpioc_driver, gpioc_devclass, + 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(axp209, 1); MODULE_DEPEND(axp209, iicbus, 1, 1, 1); Added: head/sys/arm/allwinner/axp209reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/axp209reg.h Thu May 26 21:09:07 2016 (r300777) @@ -0,0 +1,160 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _AXP209REG_H_ +#define _AXP209REG_H_ + +/* Power State Register */ +#define AXP209_PSR 0x00 +#define AXP209_PSR_ACIN 0x80 +#define AXP209_PSR_ACIN_SHIFT 7 +#define AXP209_PSR_VBUS 0x20 +#define AXP209_PSR_VBUS_SHIFT 5 + +/* Shutdown and battery control */ +#define AXP209_SHUTBAT 0x32 +#define AXP209_SHUTBAT_SHUTDOWN 0x80 + +/* Voltage/Current Monitor */ +#define AXP209_ACIN_VOLTAGE 0x56 +#define AXP209_ACIN_CURRENT 0x58 +#define AXP209_VBUS_VOLTAGE 0x5A +#define AXP209_VBUS_CURRENT 0x5C +#define AXP209_BAT_VOLTAGE 0x78 +#define AXP209_BAT_CHARGE_CURRENT 0x7A +#define AXP209_BAT_DISCHARGE_CURRENT 0x7C + +#define AXP209_VOLT_STEP 1700 +#define AXP209_BATVOLT_STEP 1100 +#define AXP209_ACCURRENT_STEP 625 +#define AXP209_VBUSCURRENT_STEP 375 +#define AXP209_BATCURRENT_STEP 500 + +/* Temperature monitor */ +#define AXP209_TEMPMON 0x5e +#define AXP209_TEMPMON_MIN 1447 /* -144.7C */ + +/* Sensors conversion macros */ +#define AXP209_SENSOR_H(a) ((a) << 4) +#define AXP209_SENSOR_L(a) ((a) & 0xf) +#define AXP209_SENSOR_BAT_H(a) ((a) << 5) +#define AXP209_SENSOR_BAT_L(a) ((a) & 0x1f) + +#define AXP209_0C_TO_K 2732 + +/* ADC Sensors */ +#define AXP209_ADC_ENABLE1 0x82 +#define AXP209_ADC_ENABLE2 0x83 + +#define AXP209_ADC1_BATVOLT (1 << 7) +#define AXP209_ADC1_BATCURRENT (1 << 6) +#define AXP209_ADC1_ACVOLT (1 << 5) +#define AXP209_ADC1_ACCURRENT (1 << 4) +#define AXP209_ADC1_VBUSVOLT (1 << 3) +#define AXP209_ADC1_VBUSCURRENT (1 << 2) + +/* Interrupt related registers */ +#define AXP209_IRQ1_ENABLE 0x40 +#define AXP209_IRQ1_STATUS 0x48 +#define AXP209_IRQ1_AC_OVERVOLT (1 << 7) +#define AXP209_IRQ1_AC_CONN (1 << 6) +#define AXP209_IRQ1_AC_DISCONN (1 << 5) +#define AXP209_IRQ1_VBUS_OVERVOLT (1 << 4) +#define AXP209_IRQ1_VBUS_CONN (1 << 3) +#define AXP209_IRQ1_VBUS_DISCONN (1 << 2) +#define AXP209_IRQ1_VBUS_LOW (1 << 1) + +#define AXP209_IRQ2_ENABLE 0x41 +#define AXP209_IRQ2_STATUS 0x49 +#define AXP209_IRQ2_BATT_CONN (1 << 7) +#define AXP209_IRQ2_BATT_DISCONN (1 << 6) +#define AXP209_IRQ2_BATT_CHARGE_ACCT_ON (1 << 5) +#define AXP209_IRQ2_BATT_CHARGE_ACCT_OFF (1 << 4) +#define AXP209_IRQ2_BATT_CHARGING (1 << 3) +#define AXP209_IRQ2_BATT_CHARGED (1 << 2) +#define AXP209_IRQ2_BATT_TEMP_OVER (1 << 1) +#define AXP209_IRQ2_BATT_TEMP_LOW (1 << 0) + +#define AXP209_IRQ3_ENABLE 0x42 +#define AXP209_IRQ3_STATUS 0x4A +#define AXP209_IRQ3_TEMP_OVER (1 << 7) +#define AXP209_IRQ3_CHARGE_CURRENT_LOW (1 << 6) +#define AXP209_IRQ3_DCDC2_LOW (1 << 4) +#define AXP209_IRQ3_DCDC3_LOW (1 << 3) +#define AXP209_IRQ3_LDO3_LOW (1 << 2) +#define AXP209_IRQ3_PEK_SHORT (1 << 1) +#define AXP209_IRQ3_PEK_LONG (1 << 0) + +#define AXP209_IRQ4_ENABLE 0x43 +#define AXP209_IRQ4_STATUS 0x4B +#define AXP209_IRQ4_NOE_START (1 << 7) +#define AXP209_IRQ4_NOE_SHUT (1 << 6) +#define AXP209_IRQ4_VBUS_VALID (1 << 5) +#define AXP209_IRQ4_VBUS_INVALID (1 << 4) +#define AXP209_IRQ4_VBUS_SESSION (1 << 3) +#define AXP209_IRQ4_VBUS_SESSION_END (1 << 2) +#define AXP209_IRQ4_APS_LOW_1 (1 << 1) +#define AXP209_IRQ4_APS_LOW_2 (1 << 0) + +#define AXP209_IRQ5_ENABLE 0x44 +#define AXP209_IRQ5_STATUS 0x4C +#define AXP209_IRQ5_TIMER_EXPIRE (1 << 7) +#define AXP209_IRQ5_PEK_RISE_EDGE (1 << 6) +#define AXP209_IRQ5_PEK_FALL_EDGE (1 << 5) +#define AXP209_IRQ5_GPIO3 (1 << 3) +#define AXP209_IRQ5_GPIO2 (1 << 2) +#define AXP209_IRQ5_GPIO1 (1 << 1) +#define AXP209_IRQ5_GPIO0 (1 << 0) + +#define AXP209_IRQ_ACK 0xff + +/* GPIOs registers */ +#define AXP209_GPIO_FUNC_MASK 0x7 + +#define AXP209_GPIO_FUNC_DRVLO 0x0 +#define AXP209_GPIO_FUNC_DRVHI 0x1 +#define AXP209_GPIO_FUNC_INPUT 0x2 + +#define AXP209_GPIO0_CTRL 0x90 +#define AXP209_GPIO1_CTRL 0x92 +#define AXP209_GPIO2_CTRL 0x93 +#define AXP209_GPIO_STATUS 0x94 + +#define AXP209_GPIO_DATA(x) (1 << (x + 4)) + +enum axp209_sensor { + AXP209_TEMP, + AXP209_ACVOLT, + AXP209_ACCURRENT, + AXP209_VBUSVOLT, + AXP209_VBUSCURRENT, + AXP209_BATVOLT, + AXP209_BATCHARGECURRENT, + AXP209_BATDISCHARGECURRENT, +}; + +#endif /* _AXP209REG_H_ */ Modified: head/sys/boot/fdt/dts/arm/bananapi.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/bananapi.dts Thu May 26 21:08:44 2016 (r300776) +++ head/sys/boot/fdt/dts/arm/bananapi.dts Thu May 26 21:09:07 2016 (r300777) @@ -28,6 +28,7 @@ #include "sun7i-a20-bananapi.dts" #include "sun7i-a20-hdmi.dtsi" +#include "xpowers-axp209.dtsi" / { soc@01c00000 { Modified: head/sys/boot/fdt/dts/arm/cubieboard.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/cubieboard.dts Thu May 26 21:08:44 2016 (r300776) +++ head/sys/boot/fdt/dts/arm/cubieboard.dts Thu May 26 21:09:07 2016 (r300777) @@ -27,3 +27,4 @@ */ #include "sun4i-a10-cubieboard.dts" +#include "xpowers-axp209.dtsi" Modified: head/sys/boot/fdt/dts/arm/cubieboard2.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/cubieboard2.dts Thu May 26 21:08:44 2016 (r300776) +++ head/sys/boot/fdt/dts/arm/cubieboard2.dts Thu May 26 21:09:07 2016 (r300777) @@ -29,6 +29,7 @@ #include "sun7i-a20-cubieboard2.dts" #include "sun7i-a20-hdmi.dtsi" +#include "xpowers-axp209.dtsi" / { soc@01c00000 { Modified: head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts Thu May 26 21:08:44 2016 (r300776) +++ head/sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts Thu May 26 21:09:07 2016 (r300777) @@ -28,6 +28,7 @@ #include "sun7i-a20-olimex-som-evb.dts" #include "sun7i-a20-hdmi.dtsi" +#include "xpowers-axp209.dtsi" / { soc@01c00000 { Modified: head/sys/boot/fdt/dts/arm/olinuxino-lime.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/olinuxino-lime.dts Thu May 26 21:08:44 2016 (r300776) +++ head/sys/boot/fdt/dts/arm/olinuxino-lime.dts Thu May 26 21:09:07 2016 (r300777) @@ -27,3 +27,4 @@ */ #include "sun4i-a10-olinuxino-lime.dts" +#include "xpowers-axp209.dtsi" Added: head/sys/boot/fdt/dts/arm/xpowers-axp209.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/xpowers-axp209.dtsi Thu May 26 21:09:07 2016 (r300777) @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * 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$ + */ + + +&axp209 { + gpio-controller; + #gpio-cells = <1>; +}; Modified: head/sys/dev/iicbus/twsi/a10_twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/a10_twsi.c Thu May 26 21:08:44 2016 (r300776) +++ head/sys/dev/iicbus/twsi/a10_twsi.c Thu May 26 21:09:07 2016 (r300777) @@ -153,6 +153,8 @@ DEFINE_CLASS_1(iichb, a10_twsi_driver, a static devclass_t a10_twsi_devclass; -DRIVER_MODULE(a10_twsi, simplebus, a10_twsi_driver, a10_twsi_devclass, 0, 0); -DRIVER_MODULE(iicbus, a10_twsi, iicbus_driver, iicbus_devclass, 0, 0); +EARLY_DRIVER_MODULE(a10_twsi, simplebus, a10_twsi_driver, a10_twsi_devclass, + 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +EARLY_DRIVER_MODULE(iicbus, a10_twsi, iicbus_driver, iicbus_devclass, + 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_DEPEND(a10_twsi, iicbus, 1, 1, 1); From owner-svn-src-head@freebsd.org Thu May 26 21:25:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80060B4BFB9; Thu, 26 May 2016 21:25:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DCF2186B; Thu, 26 May 2016 21:25:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u4QLPglV009394 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 26 May 2016 14:25:42 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u4QLPfow009393; Thu, 26 May 2016 14:25:41 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 26 May 2016 14:25:41 -0700 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300671 - in head/sys/compat/linuxkpi/common: include/linux src Message-ID: <20160526212541.GI58287@FreeBSD.org> References: <201605250904.u4P946CY055112@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605250904.u4P946CY055112@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 21:25:43 -0000 Hi! The SCHEDULER_STOPPED() already has __predict_false() in it, so unlikely() is superfluous. On Wed, May 25, 2016 at 09:04:06AM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Wed May 25 09:04:06 2016 H> New Revision: 300671 H> URL: https://svnweb.freebsd.org/changeset/base/300671 H> H> Log: H> Add checks for SCHEDULER_STOPPED() so that code using the LinuxKPI can H> run after a panic(). This for example allows a LinuxKPI based graphics H> stack to receive prints during a panic. H> H> Obtained from: kmacy @ H> MFC after: 1 week H> Sponsored by: Mellanox Technologies H> H> Modified: H> head/sys/compat/linuxkpi/common/include/linux/sched.h H> head/sys/compat/linuxkpi/common/include/linux/wait.h H> head/sys/compat/linuxkpi/common/src/linux_compat.c H> H> Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h H> ============================================================================== H> --- head/sys/compat/linuxkpi/common/include/linux/sched.h Wed May 25 09:00:05 2016 (r300670) H> +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Wed May 25 09:04:06 2016 (r300671) H> @@ -91,7 +91,7 @@ CTASSERT(sizeof(((struct thread *)0)->td H> do { \ H> void *c; \ H> \ H> - if (cold) \ H> + if (cold || SCHEDULER_STOPPED()) \ H> break; \ H> c = curthread; \ H> sleepq_lock(c); \ H> H> Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h H> ============================================================================== H> --- head/sys/compat/linuxkpi/common/include/linux/wait.h Wed May 25 09:00:05 2016 (r300670) H> +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Wed May 25 09:04:06 2016 (r300671) H> @@ -31,6 +31,7 @@ H> #ifndef _LINUX_WAIT_H_ H> #define _LINUX_WAIT_H_ H> H> +#include H> #include H> #include H> #include H> @@ -81,6 +82,8 @@ do { \ H> void *c = &(q).wchan; \ H> if (!(cond)) { \ H> for (;;) { \ H> + if (unlikely(SCHEDULER_STOPPED())) \ H> + break; \ H> sleepq_lock(c); \ H> if (cond) { \ H> sleepq_release(c); \ H> @@ -100,6 +103,8 @@ do { \ H> _error = 0; \ H> if (!(cond)) { \ H> for (; _error == 0;) { \ H> + if (unlikely(SCHEDULER_STOPPED())) \ H> + break; \ H> sleepq_lock(c); \ H> if (cond) { \ H> sleepq_release(c); \ H> @@ -123,6 +128,8 @@ do { \ H> \ H> if (!(cond)) { \ H> for (; __rc == 0;) { \ H> + if (unlikely(SCHEDULER_STOPPED())) \ H> + break; \ H> sleepq_lock(c); \ H> if (cond) { \ H> sleepq_release(c); \ H> H> Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c H> ============================================================================== H> --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 25 09:00:05 2016 (r300670) H> +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 25 09:04:06 2016 (r300671) H> @@ -1093,6 +1093,8 @@ linux_complete_common(struct completion H> long H> linux_wait_for_common(struct completion *c, int flags) H> { H> + if (unlikely(SCHEDULER_STOPPED())) H> + return (0); H> H> if (flags != 0) H> flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; H> @@ -1123,6 +1125,9 @@ linux_wait_for_timeout_common(struct com H> { H> long end = jiffies + timeout; H> H> + if (unlikely(SCHEDULER_STOPPED())) H> + return (0); H> + H> if (flags != 0) H> flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; H> else H> _______________________________________________ H> svn-src-all@freebsd.org mailing list H> https://lists.freebsd.org/mailman/listinfo/svn-src-all H> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu May 26 21:33:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 879BDB4C1B3; Thu, 26 May 2016 21:33:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7272E1E0C; Thu, 26 May 2016 21:33:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u4QLX8FC009446 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 26 May 2016 14:33:08 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u4QLX8U6009445; Thu, 26 May 2016 14:33:08 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 26 May 2016 14:33:08 -0700 From: Gleb Smirnoff To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300679 - head/sys/netinet Message-ID: <20160526213308.GJ58287@FreeBSD.org> References: <201605251348.u4PDmQdA040104@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605251348.u4PDmQdA040104@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 21:33:09 -0000 Michael, On Wed, May 25, 2016 at 01:48:26PM +0000, Michael Tuexen wrote: M> Author: tuexen M> Date: Wed May 25 13:48:26 2016 M> New Revision: 300679 M> URL: https://svnweb.freebsd.org/changeset/base/300679 M> M> Log: M> Count packets as not being delivered only if they are neither M> processed by a kernel handler nor by a raw socket. M> M> MFC after: 1 week M> M> Modified: M> head/sys/netinet/raw_ip.c M> M> Modified: head/sys/netinet/raw_ip.c M> ============================================================================== M> --- head/sys/netinet/raw_ip.c Wed May 25 13:09:06 2016 (r300678) M> +++ head/sys/netinet/raw_ip.c Wed May 25 13:48:26 2016 (r300679) M> @@ -132,6 +132,8 @@ int (*ip_rsvp_vif)(struct socket *, stru M> void (*ip_rsvp_force_done)(struct socket *); M> #endif /* INET */ M> M> +extern struct protosw inetsw[]; M> + M> u_long rip_sendspace = 9216; M> SYSCTL_ULONG(_net_inet_raw, OID_AUTO, maxdgram, CTLFLAG_RW, M> &rip_sendspace, 0, "Maximum outgoing raw IP datagram size"); M> @@ -411,9 +413,11 @@ rip_input(struct mbuf **mp, int *offp, i M> IPSTAT_INC(ips_delivered); M> INP_RUNLOCK(last); M> } else { M> + if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) { M> + IPSTAT_INC(ips_noproto); M> + IPSTAT_DEC(ips_delivered); M> + } M> m_freem(m); M> - IPSTAT_INC(ips_noproto); M> - IPSTAT_DEC(ips_delivered); M> } M> return (IPPROTO_DONE); M> } How could it happen at this place that inetsw[ip_protox[ip->ip_p]].pr_input != rip_input? Another question. Can we get rid of ugly IPSTAT_DEC()? Since pr_input is an integer, we could return error up to ip_input() that would indicate non-delivery. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu May 26 21:37:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D6BCB4C330; Thu, 26 May 2016 21:37:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 04392101F; Thu, 26 May 2016 21:37:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u4QLbG8j009463 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 26 May 2016 14:37:16 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u4QLbGvo009462; Thu, 26 May 2016 14:37:16 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 26 May 2016 14:37:16 -0700 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300718 - in head/sys: kern sys Message-ID: <20160526213716.GK58287@FreeBSD.org> References: <201605260841.u4Q8ft9r045564@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605260841.u4Q8ft9r045564@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 21:37:18 -0000 Hans, On Thu, May 26, 2016 at 08:41:55AM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Thu May 26 08:41:55 2016 H> New Revision: 300718 H> URL: https://svnweb.freebsd.org/changeset/base/300718 H> H> Log: H> Add support for boolean sysctl's. H> H> Because the size of bool can be implementation defined, make a bool H> sysctl handler which handle bools. Userspace sees the bools like H> unsigned 8-bit integers. Values are filtered to either 1 or 0 upon H> read and write, similar to what a compiler would do. H> H> Requested by: kmacy @ H> Sponsored by: Mellanox Technologies Would be nice if sysctl(8) would explicitly display them as "true" or "false" instead of 0 and 1. Now the userland can't differ them from uint8_t oids. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu May 26 21:40:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E061BB4C3BB; Thu, 26 May 2016 21:40:14 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F59B11CA; Thu, 26 May 2016 21:40:14 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QLeDNw032213; Thu, 26 May 2016 21:40:13 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QLeDsn032206; Thu, 26 May 2016 21:40:13 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605262140.u4QLeDsn032206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 26 May 2016 21:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300779 - in head: sbin/ipfw sys/modules/dummynet sys/netinet sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 21:40:15 -0000 Author: truckman Date: Thu May 26 21:40:13 2016 New Revision: 300779 URL: https://svnweb.freebsd.org/changeset/base/300779 Log: Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). Centre for Advanced Internet Architectures Implementing AQM in FreeBSD * Overview * Articles, Papers and Presentations * Patches and Tools Overview Recent years have seen a resurgence of interest in better managing the depth of bottleneck queues in routers, switches and other places that get congested. Solutions include transport protocol enhancements at the end-hosts (such as delay-based or hybrid congestion control schemes) and active queue management (AQM) schemes applied within bottleneck queues. The notion of AQM has been around since at least the late 1990s (e.g. RFC 2309). In recent years the proliferation of oversized buffers in all sorts of network devices (aka bufferbloat) has stimulated keen community interest in four new AQM schemes -- CoDel, FQ-CoDel, PIE and FQ-PIE. The IETF AQM working group is looking to document these schemes, and independent implementations are a corner-stone of the IETF's process for confirming the clarity of publicly available protocol descriptions. While significant development work on all three schemes has occured in the Linux kernel, there is very little in FreeBSD. Project Goals This project began in late 2015, and aims to design and implement functionally-correct versions of CoDel, FQ-CoDel, PIE and FQ_PIE in FreeBSD (with code BSD-licensed as much as practical). We have chosen to do this as extensions to FreeBSD's ipfw/dummynet firewall and traffic shaper. Implementation of these AQM schemes in FreeBSD will: * Demonstrate whether the publicly available documentation is sufficient to enable independent, functionally equivalent implementations * Provide a broader suite of AQM options for sections the networking community that rely on FreeBSD platforms Program Members: * Rasool Al Saadi (developer) * Grenville Armitage (project lead) Acknowledgements: This project has been made possible in part by a gift from the Comcast Innovation Fund. Submitted by: Rasool Al-Saadi X-No objection: core MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6388 Added: head/sys/netpfil/ipfw/dn_aqm.h (contents, props changed) head/sys/netpfil/ipfw/dn_aqm_codel.c (contents, props changed) head/sys/netpfil/ipfw/dn_aqm_codel.h (contents, props changed) head/sys/netpfil/ipfw/dn_aqm_pie.c (contents, props changed) head/sys/netpfil/ipfw/dn_aqm_pie.h (contents, props changed) head/sys/netpfil/ipfw/dn_sched_fq_codel.c (contents, props changed) head/sys/netpfil/ipfw/dn_sched_fq_codel.h (contents, props changed) head/sys/netpfil/ipfw/dn_sched_fq_codel_helper.h (contents, props changed) head/sys/netpfil/ipfw/dn_sched_fq_pie.c (contents, props changed) Modified: head/sbin/ipfw/dummynet.c head/sbin/ipfw/ipfw2.h head/sys/modules/dummynet/Makefile head/sys/netinet/ip_dummynet.h head/sys/netpfil/ipfw/dn_sched.h head/sys/netpfil/ipfw/dn_sched_fifo.c head/sys/netpfil/ipfw/dn_sched_prio.c head/sys/netpfil/ipfw/dn_sched_qfq.c head/sys/netpfil/ipfw/dn_sched_rr.c head/sys/netpfil/ipfw/dn_sched_wf2q.c head/sys/netpfil/ipfw/ip_dn_glue.c head/sys/netpfil/ipfw/ip_dn_io.c head/sys/netpfil/ipfw/ip_dn_private.h head/sys/netpfil/ipfw/ip_dummynet.c Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Thu May 26 21:32:16 2016 (r300778) +++ head/sbin/ipfw/dummynet.c Thu May 26 21:40:13 2016 (r300779) @@ -1,4 +1,11 @@ /* + * Codel/FQ_Codel and PIE/FQ_PIE Code: + * Copyright (C) 2016 Centre for Advanced Internet Architectures, + * Swinburne University of Technology, Melbourne, Australia. + * Portions of this code were made possible in part by a gift from + * The Comcast Innovation Fund. + * Implemented by Rasool Al-Saadi + * * Copyright (c) 2002-2003,2010 Luigi Rizzo * * Redistribution and use in source forms, with and without modification, @@ -15,6 +22,7 @@ * dummynet support */ +#define NEW_AQM #include #include /* XXX there are several sysctl leftover here */ @@ -22,6 +30,10 @@ #include "ipfw2.h" +#ifdef NEW_AQM +#include +#endif + #include #include #include @@ -59,6 +71,12 @@ static struct _s_x dummynet_params[] = { { "ecn", TOK_ECN }, { "red", TOK_RED }, { "gred", TOK_GRED }, +#ifdef NEW_AQM + { "codel", TOK_CODEL}, /* Codel AQM */ + { "fq_codel", TOK_FQ_CODEL}, /* FQ-Codel */ + { "pie", TOK_PIE}, /* PIE AQM */ + { "fq_pie", TOK_FQ_PIE}, /* FQ-PIE */ +#endif { "bw", TOK_BW }, { "bandwidth", TOK_BW }, { "delay", TOK_DELAY }, @@ -81,6 +99,32 @@ static struct _s_x dummynet_params[] = { { NULL, 0 } /* terminator */ }; +#ifdef NEW_AQM +/* AQM/extra sched parameters tokens*/ +static struct _s_x aqm_params[] = { + { "target", TOK_TARGET}, + { "interval", TOK_INTERVAL}, + { "limit", TOK_LIMIT}, + { "flows", TOK_FLOWS}, + { "quantum", TOK_QUANTUM}, + { "ecn", TOK_ECN}, + { "noecn", TOK_NO_ECN}, + { "tupdate", TOK_TUPDATE}, + { "max_burst", TOK_MAX_BURST}, + { "max_ecnth", TOK_MAX_ECNTH}, + { "alpha", TOK_ALPHA}, + { "beta", TOK_BETA}, + { "capdrop", TOK_CAPDROP}, + { "nocapdrop", TOK_NO_CAPDROP}, + { "onoff", TOK_ONOFF}, + { "dre", TOK_DRE}, + { "ts", TOK_TS}, + { "derand", TOK_DERAND}, + { "noderand", TOK_NO_DERAND}, + { NULL, 0 } /* terminator */ +}; +#endif + #define O_NEXT(p, len) ((void *)((char *)p + len)) static void @@ -102,6 +146,214 @@ o_next(struct dn_id **o, int len, int ty return ret; } +#ifdef NEW_AQM + +/* Codel flags */ +enum { + CODEL_ECN_ENABLED = 1 +}; + +/* PIE flags, from PIE kernel module */ +enum { + PIE_ECN_ENABLED = 1, + PIE_CAPDROP_ENABLED = 2, + PIE_ON_OFF_MODE_ENABLED = 4, + PIE_DEPRATEEST_ENABLED = 8, + PIE_DERAND_ENABLED = 16 +}; + +#define PIE_FIX_POINT_BITS 13 +#define PIE_SCALE (1L<15) + return -1; + for (i = 0; ioid, l, DN_CMD_GET, DN_API_VERSION); + ep->oid.len = l; + ep->oid.subtype = subtype; + ep->nr = nr; + + ret = do_cmd(-IP_DUMMYNET3, ep, (uintptr_t)&l); + if (ret) { + free(ep); + errx(EX_DATAERR, "Error getting extra parameters\n"); + } + + switch (subtype) { + case DN_AQM_PARAMS: + if( !strcasecmp(ep->name, "codel")) { + us_to_time(ep->par[0], strt1); + us_to_time(ep->par[1], strt2); + l = sprintf(out, " AQM CoDel target %s interval %s", + strt1, strt2); + if (ep->par[2] & CODEL_ECN_ENABLED) + l = sprintf(out + l, " ECN"); + else + l += sprintf(out + l, " NoECN"); + } else if( !strcasecmp(ep->name, "pie")) { + us_to_time(ep->par[0], strt1); + us_to_time(ep->par[1], strt2); + us_to_time(ep->par[2], strt3); + l = sprintf(out, " AQM type PIE target %s tupdate %s alpha " + "%g beta %g max_burst %s max_ecnth %.3g", + strt1, + strt2, + ep->par[4] / (float) PIE_SCALE, + ep->par[5] / (float) PIE_SCALE, + strt3, + ep->par[3] / (float) PIE_SCALE + ); + + if (ep->par[6] & PIE_ECN_ENABLED) + l += sprintf(out + l, " ECN"); + else + l += sprintf(out + l, " NoECN"); + if (ep->par[6] & PIE_CAPDROP_ENABLED) + l += sprintf(out + l, " CapDrop"); + else + l += sprintf(out + l, " NoCapDrop"); + if (ep->par[6] & PIE_ON_OFF_MODE_ENABLED) + l += sprintf(out + l, " OnOff"); + if (ep->par[6] & PIE_DEPRATEEST_ENABLED) + l += sprintf(out + l, " DRE"); + else + l += sprintf(out + l, " TS"); + if (ep->par[6] & PIE_DERAND_ENABLED) + l += sprintf(out + l, " Derand"); + else + l += sprintf(out + l, " NoDerand"); + } + break; + + case DN_SCH_PARAMS: + if (!strcasecmp(ep->name,"FQ_CODEL")) { + us_to_time(ep->par[0], strt1); + us_to_time(ep->par[1], strt2); + l = sprintf(out," FQ_CODEL target %s interval %s" + " quantum %jd limit %jd flows %jd", + strt1, strt2, + (intmax_t) ep->par[3], + (intmax_t) ep->par[4], + (intmax_t) ep->par[5] + ); + if (ep->par[2] & CODEL_ECN_ENABLED) + l += sprintf(out + l, " ECN"); + else + l += sprintf(out + l, " NoECN"); + l += sprintf(out + l, "\n"); + } else if (!strcasecmp(ep->name,"FQ_PIE")) { + us_to_time(ep->par[0], strt1); + us_to_time(ep->par[1], strt2); + us_to_time(ep->par[2], strt3); + l = sprintf(out, " FQ_PIE target %s tupdate %s alpha " + "%g beta %g max_burst %s max_ecnth %.3g" + " quantum %jd limit %jd flows %jd", + strt1, + strt2, + ep->par[4] / (float) PIE_SCALE, + ep->par[5] / (float) PIE_SCALE, + strt3, + ep->par[3] / (float) PIE_SCALE, + (intmax_t) ep->par[7], + (intmax_t) ep->par[8], + (intmax_t) ep->par[9] + ); + + if (ep->par[6] & PIE_ECN_ENABLED) + l += sprintf(out + l, " ECN"); + else + l += sprintf(out + l, " NoECN"); + if (ep->par[6] & PIE_CAPDROP_ENABLED) + l += sprintf(out + l, " CapDrop"); + else + l += sprintf(out + l, " NoCapDrop"); + if (ep->par[6] & PIE_ON_OFF_MODE_ENABLED) + l += sprintf(out + l, " OnOff"); + if (ep->par[6] & PIE_DEPRATEEST_ENABLED) + l += sprintf(out + l, " DRE"); + else + l += sprintf(out + l, " TS"); + if (ep->par[6] & PIE_DERAND_ENABLED) + l += sprintf(out + l, " Derand"); + else + l += sprintf(out + l, " NoDerand"); + l += sprintf(out + l, "\n"); + } + break; + } + + free(ep); +} +#endif + + #if 0 static int sort_q(void *arg, const void *pa, const void *pb) @@ -221,7 +473,7 @@ print_flowset_parms(struct dn_fs *fs, ch int l; char qs[30]; char plr[30]; - char red[90]; /* Display RED parameters */ + char red[200]; /* Display RED parameters */ l = fs->qsize; if (fs->flags & DN_QSIZE_BYTES) { @@ -246,6 +498,11 @@ print_flowset_parms(struct dn_fs *fs, ch 1.0 * fs->max_p / (double)(1 << SCALE_RED)); if (fs->flags & DN_IS_ECN) strncat(red, " (ecn)", 6); +#ifdef NEW_AQM + /* get AQM parameters */ + } else if (fs->flags & DN_IS_AQM) { + get_extra_parms(fs->fs_nr, red, DN_AQM_PARAMS); +#endif } else sprintf(red, "droptail"); @@ -338,6 +595,11 @@ list_pipes(struct dn_id *oid, struct dn_ printf(" sched %d type %s flags 0x%x %d buckets %d active\n", s->sched_nr, s->name, s->flags, s->buckets, s->oid.id); +#ifdef NEW_AQM + char parms[200]; + get_extra_parms(s->sched_nr, parms, DN_SCH_PARAMS); + printf("%s",parms); +#endif if (s->flags & DN_HAVE_MASK) print_mask(&s->sched_mask); } @@ -745,6 +1007,242 @@ load_extra_delays(const char *filename, strncpy(p->name, profile_name, sizeof(p->name)); } +#ifdef NEW_AQM + +/* Parse AQM/extra scheduler parameters */ +static int +process_extra_parms(int *ac, char **av, struct dn_extra_parms *ep, + uint16_t type) +{ + int i; + + /* use kernel defaults */ + for (i=0; ipar[i] = -1; + + switch(type) { + case TOK_CODEL: + case TOK_FQ_CODEL: + /* Codel + * 0- target, 1- interval, 2- flags, + * FQ_CODEL + * 3- quantum, 4- limit, 5- flows + */ + if (type==TOK_CODEL) + ep->par[2] = 0; + else + ep->par[2] = CODEL_ECN_ENABLED; + + while (*ac > 0) { + int tok = match_token(aqm_params, *av); + (*ac)--; av++; + switch(tok) { + case TOK_TARGET: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "target needs time\n"); + + ep->par[0] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_INTERVAL: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "interval needs time\n"); + + ep->par[1] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_ECN: + ep->par[2] = CODEL_ECN_ENABLED; + break; + case TOK_NO_ECN: + ep->par[2] &= ~CODEL_ECN_ENABLED; + break; + /* Config fq_codel parameters */ + case TOK_QUANTUM: + if (type != TOK_FQ_CODEL) + errx(EX_DATAERR, "quantum is not for codel\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "quantum needs number\n"); + + ep->par[3]= atoi(av[0]); + (*ac)--; av++; + break; + + case TOK_LIMIT: + if (type != TOK_FQ_CODEL) + errx(EX_DATAERR, "limit is not for codel, use queue instead\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "limit needs number\n"); + + ep->par[4] = atoi(av[0]); + (*ac)--; av++; + break; + + case TOK_FLOWS: + if (type != TOK_FQ_CODEL) + errx(EX_DATAERR, "flows is not for codel\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "flows needs number\n"); + + ep->par[5] = atoi(av[0]); + (*ac)--; av++; + break; + + default: + printf("%s is Invalid parameter\n", av[-1]); + } + } + break; + case TOK_PIE: + case TOK_FQ_PIE: + /* PIE + * 0- target , 1- tupdate, 2- max_burst, + * 3- max_ecnth, 4- alpha, + * 5- beta, 6- flags + * FQ_CODEL + * 7- quantum, 8- limit, 9- flows + */ + + if ( type == TOK_PIE) + ep->par[6] = PIE_CAPDROP_ENABLED | PIE_DEPRATEEST_ENABLED + | PIE_DERAND_ENABLED; + else + /* for FQ-PIE, use TS mode */ + ep->par[6] = PIE_CAPDROP_ENABLED | PIE_DERAND_ENABLED + | PIE_ECN_ENABLED; + + while (*ac > 0) { + int tok = match_token(aqm_params, *av); + (*ac)--; av++; + switch(tok) { + case TOK_TARGET: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "target needs time\n"); + + ep->par[0] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_TUPDATE: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "tupdate needs time\n"); + + ep->par[1] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_MAX_BURST: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "max_burst needs time\n"); + + ep->par[2] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_MAX_ECNTH: + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "max_ecnth needs number\n"); + + ep->par[3] = atof(av[0]) * PIE_SCALE; + (*ac)--; av++; + break; + + case TOK_ALPHA: + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "alpha needs number\n"); + + ep->par[4] = atof(av[0]) * PIE_SCALE; + (*ac)--; av++; + break; + + case TOK_BETA: + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "beta needs number\n"); + + ep->par[5] = atof(av[0]) * PIE_SCALE; + (*ac)--; av++; + break; + + case TOK_ECN: + ep->par[6] |= PIE_ECN_ENABLED; + break; + case TOK_NO_ECN: + ep->par[6] &= ~PIE_ECN_ENABLED; + break; + + case TOK_CAPDROP: + ep->par[6] |= PIE_CAPDROP_ENABLED; + break; + case TOK_NO_CAPDROP: + ep->par[6] &= ~PIE_CAPDROP_ENABLED; + break; + + case TOK_ONOFF: + ep->par[6] |= PIE_ON_OFF_MODE_ENABLED; + break; + + case TOK_DRE: + ep->par[6] |= PIE_DEPRATEEST_ENABLED; + break; + + case TOK_TS: + ep->par[6] &= ~PIE_DEPRATEEST_ENABLED; + break; + + case TOK_DERAND: + ep->par[6] |= PIE_DERAND_ENABLED; + break; + case TOK_NO_DERAND: + ep->par[6] &= ~PIE_DERAND_ENABLED; + break; + + /* Config fq_pie parameters */ + case TOK_QUANTUM: + if (type != TOK_FQ_PIE) + errx(EX_DATAERR, "quantum is not for pie\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "quantum needs number\n"); + + ep->par[7]= atoi(av[0]); + (*ac)--; av++; + break; + + case TOK_LIMIT: + if (type != TOK_FQ_PIE) + errx(EX_DATAERR, "limit is not for pie, use queue instead\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "limit needs number\n"); + + ep->par[8] = atoi(av[0]); + (*ac)--; av++; + break; + + case TOK_FLOWS: + if (type != TOK_FQ_PIE) + errx(EX_DATAERR, "flows is not for pie\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "flows needs number\n"); + + ep->par[9] = atoi(av[0]); + (*ac)--; av++; + break; + + + default: + printf("%s is invalid parameter\n", av[-1]); + } + } + break; + } + + return 0; +} + +#endif + + /* * configuration of pipes, schedulers, flowsets. * When we configure a new scheduler, an empty pipe is created, so: @@ -776,6 +1274,12 @@ ipfw_config_pipe(int ac, char **av) struct dn_fs *fs = NULL; struct dn_profile *pf = NULL; struct ipfw_flow_id *mask = NULL; +#ifdef NEW_AQM + struct dn_extra_parms *aqm_extra; + struct dn_extra_parms *sch_extra; + int lmax_extra; +#endif + int lmax; uint32_t _foo = 0, *flags = &_foo , *buckets = &_foo; @@ -787,6 +1291,15 @@ ipfw_config_pipe(int ac, char **av) lmax += sizeof(struct dn_sch) + sizeof(struct dn_link) + sizeof(struct dn_fs) + sizeof(struct dn_profile); +#ifdef NEW_AQM + /* Extra Params */ + lmax_extra = sizeof(struct dn_extra_parms); + /* two lmax_extra because one for AQM params and another + * sch params + */ + lmax += lmax_extra*2; +#endif + av++; ac--; /* Pipe number */ if (ac && isdigit(**av)) { @@ -812,8 +1325,16 @@ ipfw_config_pipe(int ac, char **av) * The FIFO scheduler and link are derived from the * WF2Q+ one in the kernel. */ +#ifdef NEW_AQM + sch_extra = o_next(&buf, lmax_extra, DN_TEXT); + sch_extra ->oid.subtype = 0; /* don't configure scheduler */ +#endif sch = o_next(&buf, sizeof(*sch), DN_SCH); p = o_next(&buf, sizeof(*p), DN_LINK); +#ifdef NEW_AQM + aqm_extra = o_next(&buf, lmax_extra, DN_TEXT); + aqm_extra ->oid.subtype = 0; /* don't configure AQM */ +#endif fs = o_next(&buf, sizeof(*fs), DN_FS); sch->sched_nr = i; @@ -831,6 +1352,10 @@ ipfw_config_pipe(int ac, char **av) break; case 2: /* "queue N config ... " */ +#ifdef NEW_AQM + aqm_extra = o_next(&buf, lmax_extra, DN_TEXT); + aqm_extra ->oid.subtype = 0; +#endif fs = o_next(&buf, sizeof(*fs), DN_FS); fs->fs_nr = i; mask = &fs->flow_mask; @@ -839,7 +1364,15 @@ ipfw_config_pipe(int ac, char **av) break; case 3: /* "sched N config ..." */ +#ifdef NEW_AQM + sch_extra = o_next(&buf, lmax_extra, DN_TEXT); + sch_extra ->oid.subtype = 0; +#endif sch = o_next(&buf, sizeof(*sch), DN_SCH); +#ifdef NEW_AQM + aqm_extra = o_next(&buf, lmax_extra, DN_TEXT); + aqm_extra ->oid.subtype = 0; +#endif fs = o_next(&buf, sizeof(*fs), DN_FS); sch->sched_nr = i; mask = &sch->sched_mask; @@ -1026,7 +1559,31 @@ ipfw_config_pipe(int ac, char **av) } /* end while, config masks */ end_mask: break; +#ifdef NEW_AQM + case TOK_CODEL: + case TOK_PIE: + NEED(fs, "codel/pie is only for flowsets"); + + fs->flags &= ~(DN_IS_RED|DN_IS_GENTLE_RED); + fs->flags |= DN_IS_AQM; + + strcpy(aqm_extra->name,av[-1]); + aqm_extra->oid.subtype = DN_AQM_PARAMS; + + process_extra_parms(&ac, av, aqm_extra, tok); + break; + case TOK_FQ_CODEL: + case TOK_FQ_PIE: + if (!strcmp(av[-1],"type")) + errx(EX_DATAERR, "use type before fq_codel/fq_pie"); + + NEED(sch, "fq_codel/fq_pie is only for schd"); + strcpy(sch_extra->name,av[-1]); + sch_extra->oid.subtype = DN_SCH_PARAMS; + process_extra_parms(&ac, av, sch_extra, tok); + break; +#endif case TOK_RED: case TOK_GRED: NEED1("red/gred needs w_q/min_th/max_th/max_p\n"); @@ -1093,7 +1650,20 @@ end_mask: errx(1, "type %s too long\n", av[0]); strcpy(sch->name, av[0]); sch->oid.subtype = 0; /* use string */ - ac--; av++; +#ifdef NEW_AQM + /* if fq_codel is selected, consider all tokens after it + * as parameters + */ + if (!strcasecmp(av[0],"fq_codel") || !strcasecmp(av[0],"fq_pie")){ + strcpy(sch_extra->name,av[0]); + sch_extra->oid.subtype = DN_SCH_PARAMS; + process_extra_parms(&ac, av, sch_extra, tok); + } else { + ac--;av++; + } +#else + ac--;av++; +#endif break; } @@ -1187,9 +1757,17 @@ end_mask: errx(EX_DATAERR, "2 <= queue size <= %ld", limit); } +#ifdef NEW_AQM + if ((fs->flags & DN_IS_ECN) && !((fs->flags & DN_IS_RED)|| + (fs->flags & DN_IS_AQM))) + errx(EX_USAGE, "ECN can be used with red/gred/" + "codel/fq_codel only!"); +#else if ((fs->flags & DN_IS_ECN) && !(fs->flags & DN_IS_RED)) errx(EX_USAGE, "enable red/gred for ECN"); +#endif + if (fs->flags & DN_IS_RED) { size_t len; int lookup_depth, avg_pkt_size; Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Thu May 26 21:32:16 2016 (r300778) +++ head/sbin/ipfw/ipfw2.h Thu May 26 21:40:13 2016 (r300779) @@ -171,6 +171,31 @@ enum tokens { TOK_ECN, TOK_DROPTAIL, TOK_PROTO, +#ifdef NEW_AQM + /* AQM tokens*/ + TOK_NO_ECN, + TOK_CODEL, + TOK_FQ_CODEL, + TOK_TARGET, + TOK_INTERVAL, + TOK_FLOWS, + TOK_QUANTUM, + + TOK_PIE, + TOK_FQ_PIE, + TOK_TUPDATE, + TOK_MAX_BURST, + TOK_MAX_ECNTH, + TOK_ALPHA, + TOK_BETA, + TOK_CAPDROP, + TOK_NO_CAPDROP, + TOK_ONOFF, + TOK_DRE, + TOK_TS, + TOK_DERAND, + TOK_NO_DERAND, +#endif /* dummynet tokens */ TOK_WEIGHT, TOK_LMAX, Modified: head/sys/modules/dummynet/Makefile ============================================================================== --- head/sys/modules/dummynet/Makefile Thu May 26 21:32:16 2016 (r300778) +++ head/sys/modules/dummynet/Makefile Thu May 26 21:40:13 2016 (r300779) @@ -4,8 +4,9 @@ KMOD= dummynet SRCS= ip_dummynet.c SRCS+= ip_dn_glue.c ip_dn_io.c +SRCS+= dn_aqm_codel.c dn_aqm_pie.c SRCS+= dn_heap.c dn_sched_fifo.c dn_sched_qfq.c dn_sched_rr.c dn_sched_wf2q.c -SRCS+= dn_sched_prio.c +SRCS+= dn_sched_prio.c dn_sched_fq_codel.c dn_sched_fq_pie.c SRCS+= opt_inet6.h .include Modified: head/sys/netinet/ip_dummynet.h ============================================================================== --- head/sys/netinet/ip_dummynet.h Thu May 26 21:32:16 2016 (r300778) +++ head/sys/netinet/ip_dummynet.h Thu May 26 21:40:13 2016 (r300779) @@ -29,7 +29,7 @@ #ifndef _IP_DUMMYNET_H #define _IP_DUMMYNET_H - +#define NEW_AQM /* * Definition of the kernel-userland API for dummynet. * @@ -85,7 +85,13 @@ enum { /* special commands for emulation of sysctl variables */ DN_SYSCTL_GET, DN_SYSCTL_SET, - +#ifdef NEW_AQM + /* subtypes used for setting/getting extra parameters. + * these subtypes used with IP_DUMMYNET3 command (get) + * and DN_TEXT (set). */ + DN_AQM_PARAMS, /* AQM extra params */ + DN_SCH_PARAMS, /* scheduler extra params */ +#endif DN_LAST, }; @@ -105,6 +111,9 @@ enum { /* user flags */ DN_IS_RED = 0x0020, DN_IS_GENTLE_RED= 0x0040, DN_IS_ECN = 0x0080, + #ifdef NEW_AQM + DN_IS_AQM = 0x0100, /* AQMs: e.g Codel & PIE */ + #endif DN_PIPE_CMD = 0x1000, /* pipe config... */ }; @@ -210,7 +219,19 @@ struct dn_profile { int samples[ED_MAX_SAMPLES_NO]; /* may be shorter */ }; - +#ifdef NEW_AQM +/* Extra parameters for AQM and scheduler. + * This struct is used to pass and retrieve parameters (configurations) + * to/from AQM and Scheduler. + */ +struct dn_extra_parms { + struct dn_id oid; + char name[16]; + uint32_t nr; +#define DN_MAX_EXTRA_PARM 10 + int64_t par[DN_MAX_EXTRA_PARM]; +}; +#endif /* * Overall structure of dummynet Added: head/sys/netpfil/ipfw/dn_aqm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netpfil/ipfw/dn_aqm.h Thu May 26 21:40:13 2016 (r300779) @@ -0,0 +1,167 @@ +/*- + * Copyright (C) 2016 Centre for Advanced Internet Architectures, + * Swinburne University of Technology, Melbourne, Australia. + * Portions of this code were made possible in part by a gift from + * The Comcast Innovation Fund. + * Implemented by Rasool Al-Saadi + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that 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. + */ + +/* + * API for writting an Active Queue Management algorithm for Dummynet + * + * $FreeBSD$ + */ + +#ifndef _IP_DN_AQM_H +#define _IP_DN_AQM_H + + +/* NOW is the current time in millisecond*/ +#define NOW ((dn_cfg.curr_time * tick) / 1000) + +#define AQM_UNOW (dn_cfg.curr_time * tick) +#define AQM_TIME_1US ((aqm_time_t)(1)) +#define AQM_TIME_1MS ((aqm_time_t)(1000)) +#define AQM_TIME_1S ((aqm_time_t)(AQM_TIME_1MS * 1000)) + +/* aqm time allows to store up to 4294 seconds */ +typedef uint32_t aqm_time_t; +typedef int32_t aqm_stime_t; + +#define DN_AQM_MTAG_TS 55345 + +/* Macro for variable bounding */ +#define BOUND_VAR(x,l,h) (x < l? l : x > h? h : x) + +/* sysctl variable to count number of droped packets */ +extern unsigned long io_pkt_drop; + +/* + * Structure for holding data and function pointers that together represent a + * AQM algorithm. + */ + struct dn_aqm { +#define DN_AQM_NAME_MAX 50 + char name[DN_AQM_NAME_MAX]; /* name of AQM algorithm */ + uint32_t type; /* AQM type number */ + + /* Methods implemented by AQM algorithm: + * + * enqueue enqueue packet 'm' on queue 'q'. + * Return 0 on success, 1 on drop. + * + * dequeue dequeue a packet from queue 'q'. + * Return a packet, NULL if no packet available. + * + * config configure AQM algorithm + * If required, this function should allocate space to store + * the configurations and set 'fs->aqmcfg' to point to this space. + * 'dn_extra_parms' includes array of parameters send + * from ipfw userland command. + * Return 0 on success, non-zero otherwise. + * + * deconfig deconfigure AQM algorithm. + * The allocated configuration memory space should be freed here. + * Return 0 on success, non-zero otherwise. + * + * init initialise AQM status variables of queue 'q' + * This function is used to allocate space and init AQM status for a + * queue and q->aqm_status to point to this space. + * Return 0 on success, non-zero otherwise. + * + * cleanup cleanup AQM status variables of queue 'q' + * The allocated memory space for AQM status should be freed here. + * Return 0 on success, non-zero otherwise. + * + * getconfig retrieve AQM configurations + * This function is used to return AQM parameters to userland + * command. The function should fill 'dn_extra_parms' struct with + * the AQM configurations using 'par' array. + * + */ + + int (*enqueue)(struct dn_queue *, struct mbuf *); + struct mbuf * (*dequeue)(struct dn_queue *); + int (*config)(struct dn_fsk *, struct dn_extra_parms *ep, int); + int (*deconfig)(struct dn_fsk *); + int (*init)(struct dn_queue *); + int (*cleanup)(struct dn_queue *); + int (*getconfig)(struct dn_fsk *, struct dn_extra_parms *); + + int ref_count; /*Number of queues instances in the system */ + int cfg_ref_count; /*Number of AQM instances in the system */ + SLIST_ENTRY (dn_aqm) next; /* Next AQM in the list */ +}; + +/* Helper function to update queue and scheduler statistics. + * negative len + drop -> drop + * negative len -> dequeue + * positive len -> enqueue + * positive len + drop -> drop during enqueue + */ +__inline static void +update_stats(struct dn_queue *q, int len, int drop) +{ + int inc = 0; + struct dn_flow *sni; + struct dn_flow *qni; + + sni = &q->_si->ni; + qni = &q->ni; + + if (len < 0) + inc = -1; + else if(len > 0) + inc = 1; + + if (drop) { + qni->drops++; + sni->drops++; + io_pkt_drop++; + } else { + /*update queue stats */ + qni->length += inc; + qni->len_bytes += len; + + /*update scheduler instance stats */ + sni->length += inc; + sni->len_bytes += len; + } + /* tot_pkts is updated in dn_enqueue function */ +} + + +/* kernel module related function */ +int +dn_aqm_modevent(module_t mod, int cmd, void *arg); + +#define DECLARE_DNAQM_MODULE(name, dnaqm) \ + static moduledata_t name##_mod = { \ + #name, dn_aqm_modevent, dnaqm \ + }; \ + DECLARE_MODULE(name, name##_mod, \ + SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); \ + MODULE_DEPEND(name, dummynet, 3, 3, 3) + +#endif Added: head/sys/netpfil/ipfw/dn_aqm_codel.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netpfil/ipfw/dn_aqm_codel.c Thu May 26 21:40:13 2016 (r300779) @@ -0,0 +1,444 @@ +/* + * Codel - The Controlled-Delay Active Queue Management algorithm. + * + * $FreeBSD$ + * + * Copyright (C) 2016 Centre for Advanced Internet Architectures, + * Swinburne University of Technology, Melbourne, Australia. + * Portions of this code were made possible in part by a gift from *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu May 26 21:43:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 198E0B4C57E; Thu, 26 May 2016 21:43:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFCC2176A; Thu, 26 May 2016 21:43:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QLhNb9035853; Thu, 26 May 2016 21:43:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QLhMRq035850; Thu, 26 May 2016 21:43:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605262143.u4QLhMRq035850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 26 May 2016 21:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300780 - in head/sys/boot/efi: include libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 21:43:24 -0000 Author: jhb Date: Thu May 26 21:43:22 2016 New Revision: 300780 URL: https://svnweb.freebsd.org/changeset/base/300780 Log: Add some routines for working with EFI DEVICE_PATH objects. - efi_lookup_devpath() uses the DEVICE_PATH_PROTOCOL to obtain the DEVICE_PATH for a given EFI handle. - efi_lookup_image_devpath() uses the LOADED_IMAGE_DEVICE_PATH_PROTOCOL to lookup the device path of the device used to load a loaded image. - efi_devpath_name() uses the DEVICE_PATH_TO_TEXT_PROTOCOL to generate a string description of a device path. The returned string is a CHAR16 string that can be printed via the recently added '%S' format in libstand's printf(). Note that the returned string is returned in allocated storage that should be freed by calling efi_free_devpath_name(). - efi_devpath_last_node() walks a DEVICE_PATH returning a pointer to the final node in the path (not counting the terminating node). That is, it returns a pointer to the last meaninful node in a DEVICE_PATH. - efi_devpath_trim() generates a new DEVICE_PATH from an existing DEVICE_PATH. The new DEVICE_PATH does not include the last non-terminating node in the original path. If the original DEVICE_PATH only contains the terminating node, this function returns NULL. The caller is responsible for freeing the returned DEVICE_PATH via free(). - efi_devpath_handle() attempts to find a handle that corresponds to a given device path. However, if nodes at the end of the device path do not have valid handles associated with them, this function will return a handle that matches a node earlier in the device path. In particular, this function returns a handle for the node closest to the end of the device path which has a valid handle. Sponsored by: Cisco Systems Added: head/sys/boot/efi/libefi/devpath.c (contents, props changed) Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/libefi/Makefile Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Thu May 26 21:40:13 2016 (r300779) +++ head/sys/boot/efi/include/efilib.h Thu May 26 21:43:22 2016 (r300780) @@ -45,6 +45,14 @@ EFI_HANDLE efi_find_handle(struct devsw int efi_handle_lookup(EFI_HANDLE, struct devsw **, int *, uint64_t *); int efi_handle_update_dev(EFI_HANDLE, struct devsw *, int, uint64_t); +EFI_DEVICE_PATH *efi_lookup_image_devpath(EFI_HANDLE); +EFI_DEVICE_PATH *efi_lookup_devpath(EFI_HANDLE); +EFI_HANDLE efi_devpath_handle(EFI_DEVICE_PATH *); +EFI_DEVICE_PATH *efi_devpath_last_node(EFI_DEVICE_PATH *); +EFI_DEVICE_PATH *efi_devpath_trim(EFI_DEVICE_PATH *); +CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *); +void efi_free_devpath_name(CHAR16 *); + int efi_status_to_errno(EFI_STATUS); EFI_STATUS main(int argc, CHAR16 *argv[]); Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Thu May 26 21:40:13 2016 (r300779) +++ head/sys/boot/efi/libefi/Makefile Thu May 26 21:43:22 2016 (r300780) @@ -4,8 +4,8 @@ LIB= efi INTERNALLIB= WARNS?= 2 -SRCS= delay.c efi_console.c efinet.c efipart.c env.c errno.c handles.c \ - libefi.c time.c +SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \ + handles.c libefi.c time.c .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -msoft-float -mgeneral-regs-only Added: head/sys/boot/efi/libefi/devpath.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/libefi/devpath.c Thu May 26 21:43:22 2016 (r300780) @@ -0,0 +1,167 @@ +/*- + * Copyright (c) 2016 John Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +/* XXX: This belongs in an efifoo.h header. */ +#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \ + { 0xbc62157e, 0x3e33, 0x4fec, { 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } } + +#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \ + { 0x8b843e20, 0x8132, 0x4852, { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } } + +INTERFACE_DECL(_EFI_DEVICE_PATH_PROTOCOL); + +typedef +CHAR16* +(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) ( + IN struct _EFI_DEVICE_PATH *This, + IN BOOLEAN DisplayOnly, + IN BOOLEAN AllowShortCuts + ); + +typedef +CHAR16* +(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) ( + IN struct _EFI_DEVICE_PATH *This, + IN BOOLEAN DisplayOnly, + IN BOOLEAN AllowShortCuts + ); + +typedef struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL { + EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText; + EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText; +} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL; + +static EFI_GUID ImageDevicePathGUID = + EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID; +static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; +static EFI_GUID DevicePathToTextGUID = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID; +static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *textProtocol; + +EFI_DEVICE_PATH * +efi_lookup_image_devpath(EFI_HANDLE handle) +{ + EFI_DEVICE_PATH *devpath; + EFI_STATUS status; + + status = BS->HandleProtocol(handle, &ImageDevicePathGUID, + (VOID **)&devpath); + if (EFI_ERROR(status)) + devpath = NULL; + return (devpath); +} + +EFI_DEVICE_PATH * +efi_lookup_devpath(EFI_HANDLE handle) +{ + EFI_DEVICE_PATH *devpath; + EFI_STATUS status; + + status = BS->HandleProtocol(handle, &DevicePathGUID, (VOID **)&devpath); + if (EFI_ERROR(status)) + devpath = NULL; + return (devpath); +} + +CHAR16 * +efi_devpath_name(EFI_DEVICE_PATH *devpath) +{ + static int once = 1; + EFI_STATUS status; + + if (devpath == NULL) + return (NULL); + if (once) { + status = BS->LocateProtocol(&DevicePathToTextGUID, NULL, + (VOID **)&textProtocol); + if (EFI_ERROR(status)) + textProtocol = NULL; + once = 0; + } + if (textProtocol == NULL) + return (NULL); + + return (textProtocol->ConvertDevicePathToText(devpath, TRUE, TRUE)); +} + +void +efi_free_devpath_name(CHAR16 *text) +{ + + BS->FreePool(text); +} + +EFI_DEVICE_PATH * +efi_devpath_last_node(EFI_DEVICE_PATH *devpath) +{ + + if (IsDevicePathEnd(devpath)) + return (NULL); + while (!IsDevicePathEnd(NextDevicePathNode(devpath))) + devpath = NextDevicePathNode(devpath); + return (devpath); +} + +EFI_DEVICE_PATH * +efi_devpath_trim(EFI_DEVICE_PATH *devpath) +{ + EFI_DEVICE_PATH *node, *copy; + size_t prefix, len; + + node = efi_devpath_last_node(devpath); + prefix = (UINT8 *)node - (UINT8 *)devpath; + if (prefix == 0) + return (NULL); + len = prefix + DevicePathNodeLength(NextDevicePathNode(node)); + copy = malloc(len); + memcpy(copy, devpath, prefix); + node = (EFI_DEVICE_PATH *)((UINT8 *)copy + prefix); + SetDevicePathEndNode(node); + return (copy); +} + +EFI_HANDLE +efi_devpath_handle(EFI_DEVICE_PATH *devpath) +{ + EFI_STATUS status; + EFI_HANDLE h; + + /* + * There isn't a standard way to locate a handle for a given + * device path. However, querying the EFI_DEVICE_PATH protocol + * for a given device path should give us a handle for the + * closest node in the path to the end that is valid. + */ + status = BS->LocateDevicePath(&DevicePathGUID, &devpath, &h); + if (EFI_ERROR(status)) + return (NULL); + return (h); +} From owner-svn-src-head@freebsd.org Thu May 26 21:44:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45377B4C631; Thu, 26 May 2016 21:44:53 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1679D1A52; Thu, 26 May 2016 21:44:53 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QLiq1V035960; Thu, 26 May 2016 21:44:52 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QLiqT8035959; Thu, 26 May 2016 21:44:52 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605262144.u4QLiqT8035959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 26 May 2016 21:44:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300781 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 21:44:53 -0000 Author: truckman Date: Thu May 26 21:44:52 2016 New Revision: 300781 URL: https://svnweb.freebsd.org/changeset/base/300781 Log: Modify BOUND_VAR() macro to wrap all of its arguments in () and tweak its expression to work on powerpc and sparc64 (gcc compatibility). Correct a typo in a nearby comment. MFC after: 2 weeks (with r300779) Modified: head/sys/netpfil/ipfw/dn_aqm.h Modified: head/sys/netpfil/ipfw/dn_aqm.h ============================================================================== --- head/sys/netpfil/ipfw/dn_aqm.h Thu May 26 21:43:22 2016 (r300780) +++ head/sys/netpfil/ipfw/dn_aqm.h Thu May 26 21:44:52 2016 (r300781) @@ -52,9 +52,9 @@ typedef int32_t aqm_stime_t; #define DN_AQM_MTAG_TS 55345 /* Macro for variable bounding */ -#define BOUND_VAR(x,l,h) (x < l? l : x > h? h : x) +#define BOUND_VAR(x,l,h) ((x) > (h)? (h) : ((x) > (l)? (x) : (l))) -/* sysctl variable to count number of droped packets */ +/* sysctl variable to count number of dropped packets */ extern unsigned long io_pkt_drop; /* From owner-svn-src-head@freebsd.org Thu May 26 21:45:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55891B4C68D; Thu, 26 May 2016 21:45:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4116D1BED; Thu, 26 May 2016 21:45:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u4QLjj8X009550 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 26 May 2016 14:45:45 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u4QLjj4A009549; Thu, 26 May 2016 14:45:45 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 26 May 2016 14:45:44 -0700 From: Gleb Smirnoff To: Jung-uk Kim Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300771 - head/sys/netgraph/netflow Message-ID: <20160526214544.GL58287@FreeBSD.org> References: <201605261857.u4QIvQpN074167@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605261857.u4QIvQpN074167@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 21:45:46 -0000 On Thu, May 26, 2016 at 06:57:26PM +0000, Jung-uk Kim wrote: J> Author: jkim J> Date: Thu May 26 18:57:26 2016 J> New Revision: 300771 J> URL: https://svnweb.freebsd.org/changeset/base/300771 J> J> Log: J> Use bit_count(3) instead of four bitcount32() calls. J> J> Reviewed by: asomers, ngie J> Differential Revision: https://reviews.freebsd.org/D6543 The bitcount32() is still used for IPv4 addresses. Is that intentional? -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu May 26 21:48:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 791CFB4C70B; Thu, 26 May 2016 21:48:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49C851D86; Thu, 26 May 2016 21:48:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QLmdWb036119; Thu, 26 May 2016 21:48:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QLmdoY036118; Thu, 26 May 2016 21:48:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605262148.u4QLmdoY036118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 26 May 2016 21:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300782 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 21:48:40 -0000 Author: jhb Date: Thu May 26 21:48:39 2016 New Revision: 300782 URL: https://svnweb.freebsd.org/changeset/base/300782 Log: Output the device path description for EFI network devices. Lookup the DEVICE_PATH for each EFI network device handle and output the string description using printf with '%S'. To honor the pager, the newline at the end of each line is still output with pager_output(). Sponsored by: Cisco Systems Modified: head/sys/boot/efi/libefi/efinet.c Modified: head/sys/boot/efi/libefi/efinet.c ============================================================================== --- head/sys/boot/efi/libefi/efinet.c Thu May 26 21:44:52 2016 (r300781) +++ head/sys/boot/efi/libefi/efinet.c Thu May 26 21:48:39 2016 (r300782) @@ -325,15 +325,20 @@ efinet_dev_init() static void efinet_dev_print(int verbose) { - char line[80]; + CHAR16 *text; EFI_HANDLE h; int unit; pager_open(); for (unit = 0, h = efi_find_handle(&efinet_dev, 0); h != NULL; h = efi_find_handle(&efinet_dev, ++unit)) { - sprintf(line, " %s%d:\n", efinet_dev.dv_name, unit); - if (pager_output(line)) + printf(" %s%d:", efinet_dev.dv_name, unit); + text = efi_devpath_name(efi_lookup_devpath(h)); + if (text != NULL) { + printf(" %S", text); + efi_free_devpath_name(text); + } + if (pager_output("\n")) break; } pager_close(); From owner-svn-src-head@freebsd.org Thu May 26 22:00:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 042DDB4C906; Thu, 26 May 2016 22:00:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 7EFD313AC; Thu, 26 May 2016 22:00:02 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r300771 - head/sys/netgraph/netflow To: Gleb Smirnoff References: <201605261857.u4QIvQpN074167@repo.freebsd.org> <20160526214544.GL58287@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jung-uk Kim Message-ID: Date: Thu, 26 May 2016 17:59:55 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160526214544.GL58287@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FqaTNpHGIEQMIOqB4EEjcXKDDGfHLmxv1" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 22:00:03 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --FqaTNpHGIEQMIOqB4EEjcXKDDGfHLmxv1 Content-Type: multipart/mixed; boundary="pk8geoWrOJ06QXrQL2SsXPliUtjKRfMMn" From: Jung-uk Kim To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r300771 - head/sys/netgraph/netflow References: <201605261857.u4QIvQpN074167@repo.freebsd.org> <20160526214544.GL58287@FreeBSD.org> In-Reply-To: <20160526214544.GL58287@FreeBSD.org> --pk8geoWrOJ06QXrQL2SsXPliUtjKRfMMn Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 05/26/16 05:45 PM, Gleb Smirnoff wrote: > On Thu, May 26, 2016 at 06:57:26PM +0000, Jung-uk Kim wrote: > J> Author: jkim > J> Date: Thu May 26 18:57:26 2016 > J> New Revision: 300771 > J> URL: https://svnweb.freebsd.org/changeset/base/300771 > J>=20 > J> Log: > J> Use bit_count(3) instead of four bitcount32() calls. > J> =20 > J> Reviewed by: asomers, ngie > J> Differential Revision: https://reviews.freebsd.org/D6543 >=20 > The bitcount32() is still used for IPv4 addresses. Is that intentional?= Yes. bit_count(3) is only useful when data is bigger than long. Jung-uk Kim --pk8geoWrOJ06QXrQL2SsXPliUtjKRfMMn-- --FqaTNpHGIEQMIOqB4EEjcXKDDGfHLmxv1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXR3HcAAoJEHyflib82/FGfXAH/1AwKoYcpl1zpACvv99tpErm itVYi1Se8ggU2Di83nADuDVnFdycZyq1X+kQZCbxeYFqc2mH2oggYUIJXRom6yDP DiL1V7yHyQIwxtcGx3B9kBWTdFOsbub9zXmGoFC+llkTk9eIzWDAw7wmwlS+KwdE clB7bLyYcxoyKBn46BgslObbVKsWnfNIyRAqFB6Z/4obrYMDorT506acoxnG5jeU 5EFss90m4ZqUgCrOgy9DkEp5+eOfOkq1rTB24FXo1WYMOGheQQagZmKg2KuAWm7c QPaZ2SxCLvk2L27tOQRSJD1Q2m2I+545SSmn+9sux/5lCJHOZowJd/PgbO9FnRQ= =EltX -----END PGP SIGNATURE----- --FqaTNpHGIEQMIOqB4EEjcXKDDGfHLmxv1-- From owner-svn-src-head@freebsd.org Thu May 26 22:03:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1505CB4CA9C; Thu, 26 May 2016 22:03:30 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA89F1A9A; Thu, 26 May 2016 22:03:29 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QM3TmP043276; Thu, 26 May 2016 22:03:29 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QM3TdE043275; Thu, 26 May 2016 22:03:29 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605262203.u4QM3TdE043275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 26 May 2016 22:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300783 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 22:03:30 -0000 Author: truckman Date: Thu May 26 22:03:28 2016 New Revision: 300783 URL: https://svnweb.freebsd.org/changeset/base/300783 Log: Correct a typo in a comment. MFC after: 2 weeks (with r300779) Modified: head/sys/netpfil/ipfw/dn_aqm.h Modified: head/sys/netpfil/ipfw/dn_aqm.h ============================================================================== --- head/sys/netpfil/ipfw/dn_aqm.h Thu May 26 21:48:39 2016 (r300782) +++ head/sys/netpfil/ipfw/dn_aqm.h Thu May 26 22:03:28 2016 (r300783) @@ -28,7 +28,7 @@ */ /* - * API for writting an Active Queue Management algorithm for Dummynet + * API for writing an Active Queue Management algorithm for Dummynet * * $FreeBSD$ */ From owner-svn-src-head@freebsd.org Thu May 26 22:07:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7962B4CB84; Thu, 26 May 2016 22:07:10 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA0601D24; Thu, 26 May 2016 22:07:10 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QM79xT043434; Thu, 26 May 2016 22:07:09 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QM79hs043433; Thu, 26 May 2016 22:07:09 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605262207.u4QM79hs043433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 26 May 2016 22:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300784 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 22:07:11 -0000 Author: truckman Date: Thu May 26 22:07:09 2016 New Revision: 300784 URL: https://svnweb.freebsd.org/changeset/base/300784 Log: Include the new AQM files when compiling a kernel with options DUMMYNET. Reported by: Nikolay Denev MFC after: 2 weeks (with r300779) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 26 22:03:28 2016 (r300783) +++ head/sys/conf/files Thu May 26 22:07:09 2016 (r300784) @@ -3793,8 +3793,12 @@ netipsec/xform_tcp.c optional ipsec ine netnatm/natm.c optional natm netnatm/natm_pcb.c optional natm netnatm/natm_proto.c optional natm +netpfil/ipfw/dn_aqm_codel.c optional inet dummynet +netpfil/ipfw/dn_aqm_pie.c optional inet dummynet netpfil/ipfw/dn_heap.c optional inet dummynet netpfil/ipfw/dn_sched_fifo.c optional inet dummynet +netpfil/ipfw/dn_sched_fq_codel.c optional inet dummynet +netpfil/ipfw/dn_sched_fq_pie.c optional inet dummynet netpfil/ipfw/dn_sched_prio.c optional inet dummynet netpfil/ipfw/dn_sched_qfq.c optional inet dummynet netpfil/ipfw/dn_sched_rr.c optional inet dummynet From owner-svn-src-head@freebsd.org Thu May 26 22:13:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4879B4CD36; Thu, 26 May 2016 22:13:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BFD4122A; Thu, 26 May 2016 22:13:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QMDe9t047111; Thu, 26 May 2016 22:13:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QMDec0047110; Thu, 26 May 2016 22:13:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605262213.u4QMDec0047110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 26 May 2016 22:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300785 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 22:13:41 -0000 Author: jhb Date: Thu May 26 22:13:40 2016 New Revision: 300785 URL: https://svnweb.freebsd.org/changeset/base/300785 Log: Use routines from the recently added devpath.c. These efipart layer did several devpath related operations inline. This just switches it over to using shared code for working with device paths. Sponsored by: Cisco Systems Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Thu May 26 22:07:09 2016 (r300784) +++ head/sys/boot/efi/libefi/efipart.c Thu May 26 22:13:40 2016 (r300785) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include static EFI_GUID blkio_guid = BLOCK_IO_PROTOCOL; -static EFI_GUID devpath_guid = DEVICE_PATH_PROTOCOL; static int efipart_init(void); static int efipart_strategy(void *, int, daddr_t, size_t, size_t, char *, @@ -85,7 +84,6 @@ efipart_init(void) UINTN sz; u_int n, nin, nout; int err; - size_t devpathlen; sz = 0; hin = NULL; @@ -112,20 +110,11 @@ efipart_init(void) return (ENOMEM); for (n = 0; n < nin; n++) { - status = BS->HandleProtocol(hin[n], &devpath_guid, - (void **)&devpath); - if (EFI_ERROR(status)) { + devpath = efi_lookup_devpath(hin[n]); + if (devpath == NULL) { continue; } - node = devpath; - devpathlen = DevicePathNodeLength(node); - while (!IsDevicePathEnd(NextDevicePathNode(node))) { - node = NextDevicePathNode(node); - devpathlen += DevicePathNodeLength(node); - } - devpathlen += DevicePathNodeLength(NextDevicePathNode(node)); - status = BS->HandleProtocol(hin[n], &blkio_guid, (void**)&blkio); if (EFI_ERROR(status)) @@ -140,14 +129,10 @@ efipart_init(void) * we try to find the parent device and add that instead as * that will be the CD filesystem. */ + node = efi_devpath_last_node(devpath); if (DevicePathType(node) == MEDIA_DEVICE_PATH && DevicePathSubType(node) == MEDIA_CDROM_DP) { - devpathcpy = malloc(devpathlen); - memcpy(devpathcpy, devpath, devpathlen); - node = devpathcpy; - while (!IsDevicePathEnd(NextDevicePathNode(node))) - node = NextDevicePathNode(node); - SetDevicePathEndNode(node); + devpathcpy = efi_devpath_trim(devpath); tmpdevpath = devpathcpy; status = BS->LocateDevicePath(&blkio_guid, &tmpdevpath, &handle); From owner-svn-src-head@freebsd.org Thu May 26 22:34:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA8F4B470B3; Thu, 26 May 2016 22:34:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACE1A1C66; Thu, 26 May 2016 22:34:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QMYPWU054461; Thu, 26 May 2016 22:34:25 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QMYP3T054460; Thu, 26 May 2016 22:34:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605262234.u4QMYP3T054460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 May 2016 22:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300786 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 22:34:27 -0000 Author: ian Date: Thu May 26 22:34:25 2016 New Revision: 300786 URL: https://svnweb.freebsd.org/changeset/base/300786 Log: Add support for triggering interrupts on both rising and falling edges. Also, EOI a gpio interrupt in the post_ithread routine before re-enabling. Modified: head/sys/arm/freescale/imx/imx_gpio.c Modified: head/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpio.c Thu May 26 22:13:40 2016 (r300785) +++ head/sys/arm/freescale/imx/imx_gpio.c Thu May 26 22:34:25 2016 (r300786) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #define GPIO_ICR_COND_HIGH 1 #define GPIO_ICR_COND_RISE 2 #define GPIO_ICR_COND_FALL 3 +#define GPIO_ICR_COND_MASK 0x3 #define IMX_GPIO_IMR_REG 0x014 /* Interrupt Mask Register */ #define IMX_GPIO_ISR_REG 0x018 /* Interrupt Status Register */ #define IMX_GPIO_EDGE_REG 0x01C /* Edge Detect Register */ @@ -91,7 +92,7 @@ __FBSDID("$FreeBSD$"); #ifdef INTRNG #define DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ GPIO_INTR_LEVEL_LOW | GPIO_INTR_LEVEL_HIGH | GPIO_INTR_EDGE_RISING | \ - GPIO_INTR_EDGE_FALLING ) + GPIO_INTR_EDGE_FALLING | GPIO_INTR_EDGE_BOTH) #else #define DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) #endif @@ -177,7 +178,8 @@ gpio_pic_map_fdt(struct imx51_gpio_softc * 2 = high-to-low edge triggered. * 4 = active high level-sensitive. * 8 = active low level-sensitive. - * We can do any single one of these modes, but nothing in combo. + * We can do any single one of these modes, and also edge low+high + * (i.e., trigger on both edges); other combinations are not supported. */ if (daf->ncells != 2) { @@ -197,6 +199,9 @@ gpio_pic_map_fdt(struct imx51_gpio_softc case 2: mode = GPIO_INTR_EDGE_FALLING; break; + case 3: + mode = GPIO_INTR_EDGE_BOTH; + break; case 4: mode = GPIO_INTR_LEVEL_HIGH; break; @@ -219,7 +224,6 @@ gpio_pic_map_gpio(struct imx51_gpio_soft u_int *irqp, uint32_t *modep) { u_int irq; - uint32_t mode; irq = dag->gpio_pin_num; if (irq >= sc->gpio_npins) { @@ -227,17 +231,22 @@ gpio_pic_map_gpio(struct imx51_gpio_soft return (EINVAL); } - mode = dag->gpio_intr_mode; - if (mode != GPIO_INTR_LEVEL_LOW && mode != GPIO_INTR_LEVEL_HIGH && - mode != GPIO_INTR_EDGE_RISING && mode != GPIO_INTR_EDGE_FALLING) { + switch (dag->gpio_intr_mode) { + case GPIO_INTR_LEVEL_LOW: + case GPIO_INTR_LEVEL_HIGH: + case GPIO_INTR_EDGE_RISING: + case GPIO_INTR_EDGE_FALLING: + case GPIO_INTR_EDGE_BOTH: + break; + default: device_printf(sc->dev, "Unsupported interrupt mode 0x%8x\n", - mode); + dag->gpio_intr_mode); return (EINVAL); } *irqp = irq; if (modep != NULL) - *modep = mode; + *modep = dag->gpio_intr_mode; return (0); } @@ -300,8 +309,8 @@ gpio_pic_setup_intr(device_t dev, struct { struct imx51_gpio_softc *sc; struct gpio_irqsrc *gi; - int error, icfg; - u_int irq, reg, shift, wrk; + int error; + u_int icfg, irq, reg, shift, wrk; uint32_t mode; if (data == NULL) @@ -320,39 +329,52 @@ gpio_pic_setup_intr(device_t dev, struct /* Compare config if this is not first setup. */ if (isrc->isrc_handlers != 0) return (gi->gi_mode == mode ? 0 : EINVAL); - gi->gi_mode = mode; - switch (mode) { - case GPIO_INTR_LEVEL_LOW: - icfg = GPIO_ICR_COND_LOW; - break; - case GPIO_INTR_LEVEL_HIGH: - icfg = GPIO_ICR_COND_HIGH; - break; - case GPIO_INTR_EDGE_RISING: - icfg = GPIO_ICR_COND_RISE; - break; - case GPIO_INTR_EDGE_FALLING: - icfg = GPIO_ICR_COND_FALL; - break; - } - if (irq < 16) { - reg = IMX_GPIO_ICR1_REG; - shift = 2 * irq; + /* + * To interrupt on both edges we have to use the EDGE register. The + * manual says it only exists for backwards compatibilty with older imx + * chips, but it's also the only way to configure interrupting on both + * edges. If the EDGE bit is on, the corresponding ICRn bit is ignored. + */ + mtx_lock_spin(&sc->sc_mtx); + if (mode == GPIO_INTR_EDGE_BOTH) { + SET4(sc, IMX_GPIO_EDGE_REG, (1u << irq)); } else { - reg = IMX_GPIO_ICR2_REG; - shift = 2 * (irq - 16); + CLEAR4(sc, IMX_GPIO_EDGE_REG, (1u << irq)); + switch (mode) { + default: + /* silence warnings; default can't actually happen. */ + /* FALLTHROUGH */ + case GPIO_INTR_LEVEL_LOW: + icfg = GPIO_ICR_COND_LOW; + break; + case GPIO_INTR_LEVEL_HIGH: + icfg = GPIO_ICR_COND_HIGH; + break; + case GPIO_INTR_EDGE_RISING: + icfg = GPIO_ICR_COND_RISE; + break; + case GPIO_INTR_EDGE_FALLING: + icfg = GPIO_ICR_COND_FALL; + break; + } + if (irq < 16) { + reg = IMX_GPIO_ICR1_REG; + shift = 2 * irq; + } else { + reg = IMX_GPIO_ICR2_REG; + shift = 2 * (irq - 16); + } + wrk = READ4(sc, reg); + wrk &= ~(GPIO_ICR_COND_MASK << shift); + wrk |= icfg << shift; + WRITE4(sc, reg, wrk); } - - mtx_lock_spin(&sc->sc_mtx); - CLEAR4(sc, IMX_GPIO_IMR_REG, (1U << irq)); - WRITE4(sc, IMX_GPIO_ISR_REG, (1U << irq)); - wrk = READ4(sc, reg); - wrk &= ~(0x03 << shift); - wrk |= icfg << shift; - WRITE4(sc, reg, wrk); + WRITE4(sc, IMX_GPIO_ISR_REG, (1u << irq)); + SET4(sc, IMX_GPIO_IMR_REG, (1u << irq)); mtx_unlock_spin(&sc->sc_mtx); + return (0); } @@ -407,15 +429,21 @@ gpio_pic_post_filter(device_t dev, struc static void gpio_pic_post_ithread(device_t dev, struct intr_irqsrc *isrc) { + struct imx51_gpio_softc *sc; + u_int irq; + + sc = device_get_softc(dev); + irq = ((struct gpio_irqsrc *)isrc)->gi_irq; arm_irq_memory_barrier(0); + /* EOI. W1C reg so no r-m-w, no locking needed. */ + WRITE4(sc, IMX_GPIO_ISR_REG, (1U << irq)); gpio_pic_enable_intr(dev, isrc); } static void gpio_pic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) { - gpio_pic_disable_intr(dev, isrc); } From owner-svn-src-head@freebsd.org Thu May 26 22:35:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D239FB47147; Thu, 26 May 2016 22:35:53 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A23D41DDE; Thu, 26 May 2016 22:35:53 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QMZqoO054561; Thu, 26 May 2016 22:35:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QMZq7r054559; Thu, 26 May 2016 22:35:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605262235.u4QMZq7r054559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 May 2016 22:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300787 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 22:35:53 -0000 Author: ian Date: Thu May 26 22:35:52 2016 New Revision: 300787 URL: https://svnweb.freebsd.org/changeset/base/300787 Log: Add a convenience function to get a gpio pin's capabilties. Modified: head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Thu May 26 22:34:25 2016 (r300786) +++ head/sys/dev/gpio/gpiobusvar.h Thu May 26 22:35:52 2016 (r300787) @@ -123,6 +123,7 @@ int gpio_pin_get_by_ofw_idx(device_t con int gpio_pin_get_by_ofw_property(device_t consumer, phandle_t node, char *name, gpio_pin_t *gpio); void gpio_pin_release(gpio_pin_t gpio); +int gpio_pin_getcaps(gpio_pin_t pin, uint32_t *caps); int gpio_pin_is_active(gpio_pin_t pin, bool *active); int gpio_pin_set_active(gpio_pin_t pin, bool active); int gpio_pin_setflags(gpio_pin_t pin, uint32_t flags); Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu May 26 22:34:25 2016 (r300786) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu May 26 22:35:52 2016 (r300787) @@ -155,6 +155,15 @@ gpio_pin_release(gpio_pin_t gpio) } int +gpio_pin_getcaps(gpio_pin_t pin, uint32_t *caps) +{ + + KASSERT(pin != NULL, ("GPIO pin is NULL.")); + KASSERT(pin->dev != NULL, ("GPIO pin device is NULL.")); + return (GPIO_PIN_GETCAPS(pin->dev, pin->pin, caps)); +} + +int gpio_pin_is_active(gpio_pin_t pin, bool *active) { int rv; From owner-svn-src-head@freebsd.org Thu May 26 22:39:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44435B471F9; Thu, 26 May 2016 22:39:46 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 05D691FB2; Thu, 26 May 2016 22:39:45 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4QMdaa4012206; Thu, 26 May 2016 15:39:40 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605262239.u4QMdaa4012206@gw.catspoiler.org> Date: Thu, 26 May 2016 15:39:36 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r300779 - in head: sbin/ipfw sys/modules/dummynet sys/netinet sys/netpfil/ipfw To: src-committers@freebsd.org cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605262140.u4QLeDsn032206@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 22:39:46 -0000 On 26 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Thu May 26 21:40:13 2016 > New Revision: 300779 > URL: https://svnweb.freebsd.org/changeset/base/300779 > > Log: > Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). > > Centre for Advanced Internet Architectures > > Implementing AQM in FreeBSD > > * Overview > > * Articles, Papers and Presentations > > > * Patches and Tools > > Overview > > Recent years have seen a resurgence of interest in better managing > the depth of bottleneck queues in routers, switches and other places > that get congested. Solutions include transport protocol enhancements > at the end-hosts (such as delay-based or hybrid congestion control > schemes) and active queue management (AQM) schemes applied within > bottleneck queues. > > The notion of AQM has been around since at least the late 1990s > (e.g. RFC 2309). In recent years the proliferation of oversized > buffers in all sorts of network devices (aka bufferbloat) has > stimulated keen community interest in four new AQM schemes -- CoDel, > FQ-CoDel, PIE and FQ-PIE. > > The IETF AQM working group is looking to document these schemes, > and independent implementations are a corner-stone of the IETF's > process for confirming the clarity of publicly available protocol > descriptions. While significant development work on all three schemes > has occured in the Linux kernel, there is very little in FreeBSD. > > Project Goals > > This project began in late 2015, and aims to design and implement > functionally-correct versions of CoDel, FQ-CoDel, PIE and FQ_PIE > in FreeBSD (with code BSD-licensed as much as practical). We have > chosen to do this as extensions to FreeBSD's ipfw/dummynet firewall > and traffic shaper. Implementation of these AQM schemes in FreeBSD > will: > * Demonstrate whether the publicly available documentation is > sufficient to enable independent, functionally equivalent implementations > > * Provide a broader suite of AQM options for sections the networking > community that rely on FreeBSD platforms > > Program Members: > > * Rasool Al Saadi (developer) > > * Grenville Armitage (project lead) > > Acknowledgements: > > This project has been made possible in part by a gift from the > Comcast Innovation Fund. > > Submitted by: Rasool Al-Saadi > X-No objection: core > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D6388 Sigh ... should also be: Relnotes: yes From owner-svn-src-head@freebsd.org Thu May 26 22:43:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1D4DB47403; Thu, 26 May 2016 22:43:03 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A517140F; Thu, 26 May 2016 22:43:03 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QMh2mR058020; Thu, 26 May 2016 22:43:02 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QMh2Zo058018; Thu, 26 May 2016 22:43:02 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605262243.u4QMh2Zo058018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 26 May 2016 22:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300788 - in head/sys/dev: rtwn urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 22:43:03 -0000 Author: avos Date: Thu May 26 22:43:02 2016 New Revision: 300788 URL: https://svnweb.freebsd.org/changeset/base/300788 Log: rtwn, urtwn: drop unused structures. urtwn(4) uses another implementation of command queue; rtwn(4) don't need it at all. Modified: head/sys/dev/rtwn/if_rtwnreg.h head/sys/dev/urtwn/if_urtwnvar.h Modified: head/sys/dev/rtwn/if_rtwnreg.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnreg.h Thu May 26 22:35:52 2016 (r300787) +++ head/sys/dev/rtwn/if_rtwnreg.h Thu May 26 22:43:02 2016 (r300788) @@ -1236,8 +1236,6 @@ struct rtwn_tx_radiotap_header { (1 << IEEE80211_RADIOTAP_FLAGS | \ 1 << IEEE80211_RADIOTAP_CHANNEL) -struct rtwn_softc; - struct rtwn_rx_data { bus_dmamap_t map; struct mbuf *m; @@ -1272,23 +1270,6 @@ struct rtwn_tx_ring { int cur; }; -struct rtwn_host_cmd { - void (*cb)(struct rtwn_softc *, void *); - uint8_t data[256]; -}; - -struct rtwn_cmd_key { - struct ieee80211_key key; - uint16_t associd; -}; - -struct rtwn_host_cmd_ring { - struct rtwn_host_cmd cmd[RTWN_HOST_CMD_RING_COUNT]; - int cur; - int next; - int queued; -}; - struct rtwn_vap { struct ieee80211vap vap; int (*newstate)(struct ieee80211vap *, Modified: head/sys/dev/urtwn/if_urtwnvar.h ============================================================================== --- head/sys/dev/urtwn/if_urtwnvar.h Thu May 26 22:35:52 2016 (r300787) +++ head/sys/dev/urtwn/if_urtwnvar.h Thu May 26 22:43:02 2016 (r300788) @@ -116,21 +116,6 @@ struct urtwn_vap { }; #define URTWN_VAP(vap) ((struct urtwn_vap *)(vap)) -struct urtwn_host_cmd { - void (*cb)(struct urtwn_softc *, void *); - uint8_t data[256]; -}; - -struct urtwn_cmd_newstate { - enum ieee80211_state state; - int arg; -}; - -struct urtwn_cmd_key { - struct ieee80211_key key; - uint16_t associd; -}; - enum { URTWN_BULK_RX, URTWN_BULK_TX_BE, /* = WME_AC_BE */ From owner-svn-src-head@freebsd.org Thu May 26 22:54:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 092FAB47890 for ; Thu, 26 May 2016 22:54:57 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C58011C93 for ; Thu, 26 May 2016 22:54:56 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ece969a8-2394-11e6-9de8-1b78d5a2543b X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 26 May 2016 22:55:21 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u4QMsmew005953; Thu, 26 May 2016 16:54:48 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1464303288.1204.65.camel@freebsd.org> Subject: Re: svn commit: r300718 - in head/sys: kern sys From: Ian Lepore To: Gleb Smirnoff , Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 26 May 2016 16:54:48 -0600 In-Reply-To: <20160526213716.GK58287@FreeBSD.org> References: <201605260841.u4Q8ft9r045564@repo.freebsd.org> <20160526213716.GK58287@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 22:54:57 -0000 On Thu, 2016-05-26 at 14:37 -0700, Gleb Smirnoff wrote: > Hans, > > On Thu, May 26, 2016 at 08:41:55AM +0000, Hans Petter Selasky wrote: > H> Author: hselasky > H> Date: Thu May 26 08:41:55 2016 > H> New Revision: 300718 > H> URL: https://svnweb.freebsd.org/changeset/base/300718 > H> > H> Log: > H> Add support for boolean sysctl's. > H> > H> Because the size of bool can be implementation defined, make a > bool > H> sysctl handler which handle bools. Userspace sees the bools like > H> unsigned 8-bit integers. Values are filtered to either 1 or 0 > upon > H> read and write, similar to what a compiler would do. > H> > H> Requested by: kmacy @ > H> Sponsored by: Mellanox Technologies > > Would be nice if sysctl(8) would explicitly display them as "true" or > "false" > instead of 0 and 1. Now the userland can't differ them from uint8_t > oids. If it displayed them that way, then users would want to set them using the true/false strings too. If you start down that path you eventually end up adding support for 0/1/true/false/yes/no/on/off, and if you don't do that in exactly once place you end up with some oids accepting all the values and others accepting only some of them, and the user experience is confusing at best. -- Ian From owner-svn-src-head@freebsd.org Thu May 26 23:06:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92A4EB47B59; Thu, 26 May 2016 23:06:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F97111CE; Thu, 26 May 2016 23:06:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QN6a5G065572; Thu, 26 May 2016 23:06:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QN6a1r065571; Thu, 26 May 2016 23:06:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605262306.u4QN6a1r065571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 26 May 2016 23:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300789 - head/sys/boot/efi/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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:06:37 -0000 Author: jhb Date: Thu May 26 23:06:36 2016 New Revision: 300789 URL: https://svnweb.freebsd.org/changeset/base/300789 Log: Remove second copy of the -Wno-format band-aid for printf %S. Modified: head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Thu May 26 22:43:02 2016 (r300788) +++ head/sys/boot/efi/loader/Makefile Thu May 26 23:06:36 2016 (r300789) @@ -30,10 +30,6 @@ CWARNFLAGS.zfs.c+= -Wno-sign-compare CWARNFLAGS.zfs.c+= -Wno-array-bounds CWARNFLAGS.zfs.c+= -Wno-missing-prototypes .endif -# In the loader, %S is for CHAR16 strings, not wchar_t strings. This -# mismatch causes issues on some archs, so just ignore it for now. -# The printf in libstand implements CHAR16 strings always. -CWARNFLAGS.main.c+= -Wno-format # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only From owner-svn-src-head@freebsd.org Thu May 26 23:07:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2F9FB47BB9; Thu, 26 May 2016 23:07:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C53B4133A; Thu, 26 May 2016 23:07:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QN7LLu065638; Thu, 26 May 2016 23:07:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QN7LK8065637; Thu, 26 May 2016 23:07:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605262307.u4QN7LK8065637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 26 May 2016 23:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300790 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:07:22 -0000 Author: jhb Date: Thu May 26 23:07:20 2016 New Revision: 300790 URL: https://svnweb.freebsd.org/changeset/base/300790 Log: Apply the printf %S band-aid for efinet.c to fix the arm64 build. Modified: head/sys/boot/efi/libefi/Makefile Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Thu May 26 23:06:36 2016 (r300789) +++ head/sys/boot/efi/libefi/Makefile Thu May 26 23:07:20 2016 (r300790) @@ -7,6 +7,13 @@ WARNS?= 2 SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \ handles.c libefi.c time.c +# We implement a slightly non-standard %S in that it always takes a +# CHAR16 that's common in UEFI-land instead of a wchar_t. This only +# seems to matter on arm64 where wchar_t defaults to an int instead +# of a short. There's no good cast to use here so just ignore the +# warnings for now. +CWARNFLAGS.efinet.c+= -Wno-format + .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -msoft-float -mgeneral-regs-only .endif From owner-svn-src-head@freebsd.org Thu May 26 23:08:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEE39B47C90; Thu, 26 May 2016 23:08:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF58B16B5; Thu, 26 May 2016 23:08:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QN8vTe065728; Thu, 26 May 2016 23:08:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QN8vc3065727; Thu, 26 May 2016 23:08:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605262308.u4QN8vc3065727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 26 May 2016 23:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300791 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:08:59 -0000 Author: jhb Date: Thu May 26 23:08:57 2016 New Revision: 300791 URL: https://svnweb.freebsd.org/changeset/base/300791 Log: Use a unique error message if we fail to find the simple network protocol. While here, fix the various net driver callbacks to return early instead of crashing if this fails. (The 'init' callback from the netif interface doesn't return an error if the protocol lookup fails.) Sponsored by: Cisco Systems Modified: head/sys/boot/efi/libefi/efinet.c Modified: head/sys/boot/efi/libefi/efinet.c ============================================================================== --- head/sys/boot/efi/libefi/efinet.c Thu May 26 23:07:20 2016 (r300790) +++ head/sys/boot/efi/libefi/efinet.c Thu May 26 23:08:57 2016 (r300791) @@ -122,6 +122,8 @@ efinet_put(struct iodesc *desc, void *pk void *buf; net = nif->nif_devdata; + if (net == NULL) + return (-1); status = net->Transmit(net, 0, len, pkt, 0, 0, 0); if (status != EFI_SUCCESS) @@ -152,6 +154,8 @@ efinet_get(struct iodesc *desc, void *pk char buf[2048]; net = nif->nif_devdata; + if (net == NULL) + return (0); t = time(0); while ((time(0) - t) < timeout) { @@ -192,7 +196,7 @@ efinet_init(struct iodesc *desc, void *m h = nif->nif_driver->netif_ifs[nif->nif_unit].dif_private; status = BS->HandleProtocol(h, &sn_guid, (VOID **)&nif->nif_devdata); if (status != EFI_SUCCESS) { - printf("net%d: cannot start interface (status=%lu)\n", + printf("net%d: cannot fetch interface data (status=%lu)\n", nif->nif_unit, EFI_ERROR_CODE(status)); return; } @@ -241,6 +245,9 @@ efinet_end(struct netif *nif) { EFI_SIMPLE_NETWORK *net = nif->nif_devdata; + if (net == NULL) + return; + net->Shutdown(net); } From owner-svn-src-head@freebsd.org Thu May 26 23:18:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32185B47F64; Thu, 26 May 2016 23:18:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E82381CF3; Thu, 26 May 2016 23:18:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNItif069690; Thu, 26 May 2016 23:18:55 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNIteu069688; Thu, 26 May 2016 23:18:55 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262318.u4QNIteu069688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300792 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:18:56 -0000 Author: bdrewery Date: Thu May 26 23:18:54 2016 New Revision: 300792 URL: https://svnweb.freebsd.org/changeset/base/300792 Log: exec: Add credential change information into imgp for process_exec hook. This allows an EVENTHANDLER(process_exec) hook to see if the new image will cause credentials to change whether due to setgid/setuid or because of POSIX saved-id semantics. This adds 3 new fields into image_params: struct ucred *newcred Non-null if the credentials will change. bool credential_setid True if the new image is setuid or setgid. This will pre-determine the new credentials before invoking the image activators, where the process_exec hook is called. The new credentials will be installed into the process in the same place as before, after image activators are done handling the image. MFC after: 2 weeks Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6544 Modified: head/sys/kern/kern_exec.c head/sys/sys/imgact.h Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu May 26 23:08:57 2016 (r300791) +++ head/sys/kern/kern_exec.c Thu May 26 23:18:54 2016 (r300792) @@ -356,7 +356,7 @@ do_execve(td, args, mac_p) { struct proc *p = td->td_proc; struct nameidata nd; - struct ucred *newcred = NULL, *oldcred; + struct ucred *oldcred; struct uidinfo *euip = NULL; register_t *stack_base; int error, i; @@ -404,6 +404,7 @@ do_execve(td, args, mac_p) imgp->proc = p; imgp->attr = &attr; imgp->args = args; + oldcred = p->p_ucred; #ifdef MAC error = mac_execve_enter(imgp, mac_p); @@ -485,6 +486,87 @@ interpret: goto exec_fail_dealloc; imgp->proc->p_osrel = 0; + + /* + * Implement image setuid/setgid. + * + * Determine new credentials before attempting image activators + * so that it can be used by process_exec handlers to determine + * credential/setid changes. + * + * Don't honor setuid/setgid if the filesystem prohibits it or if + * the process is being traced. + * + * We disable setuid/setgid/etc in capability mode on the basis + * that most setugid applications are not written with that + * environment in mind, and will therefore almost certainly operate + * incorrectly. In principle there's no reason that setugid + * applications might not be useful in capability mode, so we may want + * to reconsider this conservative design choice in the future. + * + * XXXMAC: For the time being, use NOSUID to also prohibit + * transitions on the file system. + */ + credential_changing = 0; + credential_changing |= (attr.va_mode & S_ISUID) && + oldcred->cr_uid != attr.va_uid; + credential_changing |= (attr.va_mode & S_ISGID) && + oldcred->cr_gid != attr.va_gid; +#ifdef MAC + will_transition = mac_vnode_execve_will_transition(oldcred, imgp->vp, + interpvplabel, imgp); + credential_changing |= will_transition; +#endif + + if (credential_changing && +#ifdef CAPABILITY_MODE + ((oldcred->cr_flags & CRED_FLAG_CAPMODE) == 0) && +#endif + (imgp->vp->v_mount->mnt_flag & MNT_NOSUID) == 0 && + (p->p_flag & P_TRACED) == 0) { + imgp->credential_setid = true; + VOP_UNLOCK(imgp->vp, 0); + imgp->newcred = crdup(oldcred); + if (attr.va_mode & S_ISUID) { + euip = uifind(attr.va_uid); + change_euid(imgp->newcred, euip); + } + vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + if (attr.va_mode & S_ISGID) + change_egid(imgp->newcred, attr.va_gid); + /* + * Implement correct POSIX saved-id behavior. + * + * XXXMAC: Note that the current logic will save the + * uid and gid if a MAC domain transition occurs, even + * though maybe it shouldn't. + */ + change_svuid(imgp->newcred, imgp->newcred->cr_uid); + change_svgid(imgp->newcred, imgp->newcred->cr_gid); + } else { + /* + * Implement correct POSIX saved-id behavior. + * + * XXX: It's not clear that the existing behavior is + * POSIX-compliant. A number of sources indicate that the + * saved uid/gid should only be updated if the new ruid is + * not equal to the old ruid, or the new euid is not equal + * to the old euid and the new euid is not equal to the old + * ruid. The FreeBSD code always updates the saved uid/gid. + * Also, this code uses the new (replaced) euid and egid as + * the source, which may or may not be the right ones to use. + */ + if (oldcred->cr_svuid != oldcred->cr_uid || + oldcred->cr_svgid != oldcred->cr_gid) { + VOP_UNLOCK(imgp->vp, 0); + imgp->newcred = crdup(oldcred); + vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + change_svuid(imgp->newcred, imgp->newcred->cr_uid); + change_svgid(imgp->newcred, imgp->newcred->cr_gid); + } + } + /* The new credentials are installed into the process later. */ + /* * If the current process has a special image activator it * wants to try first, call it. For example, emulating shell @@ -542,6 +624,11 @@ interpret: vput(newtextvp); vm_object_deallocate(imgp->object); imgp->object = NULL; + imgp->credential_setid = false; + if (imgp->newcred != NULL) { + crfree(imgp->newcred); + imgp->newcred = NULL; + } /* set new name to that of the interpreter */ NDINIT(&nd, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME, UIO_SYSSPACE, imgp->interpreter_name, td); @@ -639,7 +726,6 @@ interpret: PROC_LOCK(p); if (oldsigacts) p->p_sigacts = newsigacts; - oldcred = p->p_ucred; /* Stop profiling */ stopprofclock(p); @@ -671,38 +757,9 @@ interpret: } /* - * Implement image setuid/setgid. - * - * Don't honor setuid/setgid if the filesystem prohibits it or if - * the process is being traced. - * - * We disable setuid/setgid/etc in capability mode on the basis - * that most setugid applications are not written with that - * environment in mind, and will therefore almost certainly operate - * incorrectly. In principle there's no reason that setugid - * applications might not be useful in capability mode, so we may want - * to reconsider this conservative design choice in the future. - * - * XXXMAC: For the time being, use NOSUID to also prohibit - * transitions on the file system. + * Implement image setuid/setgid installation. */ - credential_changing = 0; - credential_changing |= (attr.va_mode & S_ISUID) && oldcred->cr_uid != - attr.va_uid; - credential_changing |= (attr.va_mode & S_ISGID) && oldcred->cr_gid != - attr.va_gid; -#ifdef MAC - will_transition = mac_vnode_execve_will_transition(oldcred, imgp->vp, - interpvplabel, imgp); - credential_changing |= will_transition; -#endif - - if (credential_changing && -#ifdef CAPABILITY_MODE - ((oldcred->cr_flags & CRED_FLAG_CAPMODE) == 0) && -#endif - (imgp->vp->v_mount->mnt_flag & MNT_NOSUID) == 0 && - (p->p_flag & P_TRACED) == 0) { + if (imgp->credential_setid) { /* * Turn off syscall tracing for set-id programs, except for * root. Record any set-id flags first to make sure that @@ -728,61 +785,24 @@ interpret: error = fdcheckstd(td); if (error != 0) goto done1; - newcred = crdup(oldcred); - euip = uifind(attr.va_uid); vn_lock(imgp->vp, LK_SHARED | LK_RETRY); PROC_LOCK(p); - /* - * Set the new credentials. - */ - if (attr.va_mode & S_ISUID) - change_euid(newcred, euip); - if (attr.va_mode & S_ISGID) - change_egid(newcred, attr.va_gid); #ifdef MAC if (will_transition) { - mac_vnode_execve_transition(oldcred, newcred, imgp->vp, - interpvplabel, imgp); + mac_vnode_execve_transition(oldcred, imgp->newcred, + imgp->vp, interpvplabel, imgp); } #endif - /* - * Implement correct POSIX saved-id behavior. - * - * XXXMAC: Note that the current logic will save the - * uid and gid if a MAC domain transition occurs, even - * though maybe it shouldn't. - */ - change_svuid(newcred, newcred->cr_uid); - change_svgid(newcred, newcred->cr_gid); - proc_set_cred(p, newcred); } else { if (oldcred->cr_uid == oldcred->cr_ruid && oldcred->cr_gid == oldcred->cr_rgid) p->p_flag &= ~P_SUGID; - /* - * Implement correct POSIX saved-id behavior. - * - * XXX: It's not clear that the existing behavior is - * POSIX-compliant. A number of sources indicate that the - * saved uid/gid should only be updated if the new ruid is - * not equal to the old ruid, or the new euid is not equal - * to the old euid and the new euid is not equal to the old - * ruid. The FreeBSD code always updates the saved uid/gid. - * Also, this code uses the new (replaced) euid and egid as - * the source, which may or may not be the right ones to use. - */ - if (oldcred->cr_svuid != oldcred->cr_uid || - oldcred->cr_svgid != oldcred->cr_gid) { - PROC_UNLOCK(p); - VOP_UNLOCK(imgp->vp, 0); - newcred = crdup(oldcred); - vn_lock(imgp->vp, LK_SHARED | LK_RETRY); - PROC_LOCK(p); - change_svuid(newcred, newcred->cr_uid); - change_svgid(newcred, newcred->cr_gid); - proc_set_cred(p, newcred); - } } + /* + * Set the new credentials. + */ + if (imgp->newcred != NULL) + proc_set_cred(p, imgp->newcred); /* * Store the vp for use in procfs. This vnode was referenced by namei @@ -856,14 +876,6 @@ interpret: VOP_UNLOCK(imgp->vp, 0); done1: /* - * Free any resources malloc'd earlier that we didn't use. - */ - if (euip != NULL) - uifree(euip); - if (newcred != NULL) - crfree(oldcred); - - /* * Handle deferred decrement of ref counts. */ if (oldtextvp != NULL) @@ -881,10 +893,12 @@ done1: sigacts_free(oldsigacts); exec_fail_dealloc: - /* * free various allocated resources */ + if (euip != NULL) + uifree(euip); + if (imgp->firstpage != NULL) exec_unmap_first_page(imgp); @@ -926,6 +940,8 @@ exec_fail: SDT_PROBE1(proc, , , exec__failure, error); done2: + if (imgp->newcred != NULL) + crfree(oldcred); #ifdef MAC mac_execve_exit(imgp); mac_execve_interpreter_exit(interpvplabel); Modified: head/sys/sys/imgact.h ============================================================================== --- head/sys/sys/imgact.h Thu May 26 23:08:57 2016 (r300791) +++ head/sys/sys/imgact.h Thu May 26 23:18:54 2016 (r300792) @@ -38,6 +38,8 @@ #define MAXSHELLCMDLEN PAGE_SIZE +struct ucred; + struct image_args { char *buf; /* pointer to string buffer */ char *begin_argv; /* beginning of argv in buf */ @@ -82,6 +84,8 @@ struct image_params { int pagesizeslen; vm_prot_t stack_prot; u_long stack_sz; + struct ucred *newcred; /* new credentials if changing */ + bool credential_setid; /* true if becoming setid */ }; #ifdef _KERNEL From owner-svn-src-head@freebsd.org Thu May 26 23:19:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 596E7B48040; Thu, 26 May 2016 23:19:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FE0B1FC3; Thu, 26 May 2016 23:19:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNJdrd069755; Thu, 26 May 2016 23:19:39 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNJdkb069754; Thu, 26 May 2016 23:19:39 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262319.u4QNJdkb069754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300793 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:19:40 -0000 Author: bdrewery Date: Thu May 26 23:19:39 2016 New Revision: 300793 URL: https://svnweb.freebsd.org/changeset/base/300793 Log: exec: Provide execpath in imgp for the process_exec hook. This was previously set after the hook and only if auxargs were present. Now always provide it if possible. MFC after: 2 weeks Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6546 Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu May 26 23:18:54 2016 (r300792) +++ head/sys/kern/kern_exec.c Thu May 26 23:19:39 2016 (r300793) @@ -568,6 +568,19 @@ interpret: /* The new credentials are installed into the process later. */ /* + * Do the best to calculate the full path to the image file. + */ + if (args->fname != NULL && args->fname[0] == '/') + imgp->execpath = args->fname; + else { + VOP_UNLOCK(imgp->vp, 0); + if (vn_fullpath(td, imgp->vp, &imgp->execpath, + &imgp->freepath) != 0) + imgp->execpath = args->fname; + vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + } + + /* * If the current process has a special image activator it * wants to try first, call it. For example, emulating shell * scripts differently. @@ -629,6 +642,9 @@ interpret: crfree(imgp->newcred); imgp->newcred = NULL; } + imgp->execpath = NULL; + free(imgp->freepath, M_TEMP); + imgp->freepath = NULL; /* set new name to that of the interpreter */ NDINIT(&nd, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME, UIO_SYSSPACE, imgp->interpreter_name, td); @@ -642,14 +658,6 @@ interpret: */ VOP_UNLOCK(imgp->vp, 0); - /* - * Do the best to calculate the full path to the image file. - */ - if (imgp->auxargs != NULL && - ((args->fname != NULL && args->fname[0] == '/') || - vn_fullpath(td, imgp->vp, &imgp->execpath, &imgp->freepath) != 0)) - imgp->execpath = args->fname; - if (disallow_high_osrel && P_OSREL_MAJOR(p->p_osrel) > P_OSREL_MAJOR(__FreeBSD_version)) { error = ENOEXEC; From owner-svn-src-head@freebsd.org Thu May 26 23:19:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30D68B4808D; Thu, 26 May 2016 23:19:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F28A41159; Thu, 26 May 2016 23:19:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNJwpI069808; Thu, 26 May 2016 23:19:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNJwbd069807; Thu, 26 May 2016 23:19:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262319.u4QNJwbd069807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300794 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:19:59 -0000 Author: bdrewery Date: Thu May 26 23:19:57 2016 New Revision: 300794 URL: https://svnweb.freebsd.org/changeset/base/300794 Log: Remove leftover _crunchide from r283108 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 26 23:19:39 2016 (r300793) +++ head/Makefile.inc1 Thu May 26 23:19:57 2016 (r300794) @@ -1798,7 +1798,6 @@ cross-tools: .MAKE .PHONY ${_dtrace_tools} \ ${_cc} \ ${_btxld} \ - ${_crunchide} \ ${_usb_tools} ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ cd ${.CURDIR}/${_tool}; \ From owner-svn-src-head@freebsd.org Thu May 26 23:20:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92FCEB480CA; Thu, 26 May 2016 23:20:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6BB71189; Thu, 26 May 2016 23:20:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNK17g069880; Thu, 26 May 2016 23:20:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNK1ck069877; Thu, 26 May 2016 23:20:01 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNK1ck069877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300795 - in head: . sys/conf targets/pseudo/kernel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:03 -0000 Author: bdrewery Date: Thu May 26 23:20:01 2016 New Revision: 300795 URL: https://svnweb.freebsd.org/changeset/base/300795 Log: WITH_META_MODE: Move the kernel support to kern.pre.mk. This allows using META_MODE directly from the kernel build directory. This also allows removing a hack from the DIRDEPS_BUILD kernel target. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/sys/conf/kern.pre.mk head/targets/pseudo/kernel/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 26 23:19:57 2016 (r300794) +++ head/Makefile.inc1 Thu May 26 23:20:01 2016 (r300795) @@ -591,11 +591,6 @@ IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLA # kernel stage KMAKEENV= ${WMAKEENV} KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} -.if ${MK_META_MODE} == "yes" -# meta mode normally is disallowed when building from curdir==objdir, but we -# want to allow it for the kernel build. -KMAKEENV+= META_MODE="${.MAKE.MODE} curdirOk=yes" -.endif # # buildworld Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu May 26 23:19:57 2016 (r300794) +++ head/sys/conf/kern.pre.mk Thu May 26 23:20:01 2016 (r300795) @@ -19,6 +19,11 @@ _srcconf_included_: .include .include "kern.opts.mk" +# The kernel build always occurs in the object directory which is .CURDIR. +.if ${.MAKE.MODE:Unormal:Mmeta} +.MAKE.MODE+= curdirOk=yes +.endif + # Can be overridden by makeoptions or /etc/make.conf KERNEL_KO?= kernel KERNEL?= kernel Modified: head/targets/pseudo/kernel/Makefile ============================================================================== --- head/targets/pseudo/kernel/Makefile Thu May 26 23:19:57 2016 (r300794) +++ head/targets/pseudo/kernel/Makefile Thu May 26 23:20:01 2016 (r300795) @@ -15,10 +15,8 @@ ${KERNCONF}.config: .MAKE ${META_DEPS} (cd ${KERN_CONFDIR} && \ ${CONFIG} ${CONFIGARGS} -d ${KERN_OBJDIR} ${KERNCONF}) -# we need to pass curdirOk=yes to meta mode, since we want .meta files -# in ${KERN_OBJDIR} ${KERNCONF}.build: .MAKE ${KERNCONF}.config - (cd ${KERN_OBJDIR} && META_MODE="${.MAKE.MODE} curdirOk=yes" ${.MAKE}) + (cd ${KERN_OBJDIR} && ${.MAKE}) .if ${.MAKE.LEVEL} > 0 all: ${KERNCONF}.build From owner-svn-src-head@freebsd.org Thu May 26 23:20:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85D66B48178; Thu, 26 May 2016 23:20:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBF6E16BE; Thu, 26 May 2016 23:20:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNKHu0070113; Thu, 26 May 2016 23:20:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNKHP3070112; Thu, 26 May 2016 23:20:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNKHP3070112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300800 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:19 -0000 Author: bdrewery Date: Thu May 26 23:20:17 2016 New Revision: 300800 URL: https://svnweb.freebsd.org/changeset/base/300800 Log: Use netinet/in.h to avoid include/arpa dependency for DIRDEPS_BUILD. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/cddl/boot/zfs/lz4.c Modified: head/sys/cddl/boot/zfs/lz4.c ============================================================================== --- head/sys/cddl/boot/zfs/lz4.c Thu May 26 23:20:14 2016 (r300799) +++ head/sys/cddl/boot/zfs/lz4.c Thu May 26 23:20:17 2016 (r300800) @@ -34,7 +34,7 @@ * $FreeBSD$ */ -#include +#include static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, int isize, int maxOutputSize); From owner-svn-src-head@freebsd.org Thu May 26 23:20:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E349B480EF; Thu, 26 May 2016 23:20:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD65F11ED; Thu, 26 May 2016 23:20:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNK4tA069928; Thu, 26 May 2016 23:20:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNK4so069927; Thu, 26 May 2016 23:20:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNK4so069927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300796 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:06 -0000 Author: bdrewery Date: Thu May 26 23:20:04 2016 New Revision: 300796 URL: https://svnweb.freebsd.org/changeset/base/300796 Log: Fix MAKESYSPATH not being sent to sub-makes after r266566. Because bmake defaults to .../share/mk now, this code was not doing anything to help objdir builds (such as the rescue build). Export the same default. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.sys.env.mk Modified: head/share/mk/src.sys.env.mk ============================================================================== --- head/share/mk/src.sys.env.mk Thu May 26 23:20:01 2016 (r300795) +++ head/share/mk/src.sys.env.mk Thu May 26 23:20:04 2016 (r300796) @@ -34,4 +34,7 @@ MK_META_MODE= no .if ${MAKESYSPATH:Uno:M*.../*} != "" MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${.PARSEDIR:tA},} .export MAKESYSPATH +.elif empty(MAKESYSPATH) +MAKESYSPATH:= ${.PARSEDIR:tA} +.export MAKESYSPATH .endif From owner-svn-src-head@freebsd.org Thu May 26 23:20:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EAE0B4811F; Thu, 26 May 2016 23:20:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DAED138B; Thu, 26 May 2016 23:20:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNKBa6070019; Thu, 26 May 2016 23:20:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNKBUR070018; Thu, 26 May 2016 23:20:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNKBUR070018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300798 - head/targets/pseudo/kernel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:12 -0000 Author: bdrewery Date: Thu May 26 23:20:10 2016 New Revision: 300798 URL: https://svnweb.freebsd.org/changeset/base/300798 Log: DIRDEPS_BUILD: Build the kernel in the same place as buildkernel would. Sponsored by: EMC / Isilon Storage Division Modified: head/targets/pseudo/kernel/Makefile Modified: head/targets/pseudo/kernel/Makefile ============================================================================== --- head/targets/pseudo/kernel/Makefile Thu May 26 23:20:07 2016 (r300797) +++ head/targets/pseudo/kernel/Makefile Thu May 26 23:20:10 2016 (r300798) @@ -5,7 +5,7 @@ KERNCONF?= ${KERNEL:UGENERIC} TARGET?= ${MACHINE} # keep this compatible with peoples expectations... -KERN_OBJDIR= ${OBJTOP}/sys/compile/${KERNCONF} +KERN_OBJDIR= ${OBJTOP}/sys/${KERNCONF} KERN_CONFDIR= ${SRCTOP}/sys/${TARGET}/conf CONFIG= ${STAGE_HOST_OBJTOP}/usr/sbin/config From owner-svn-src-head@freebsd.org Thu May 26 23:20:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B45C7B4810F; Thu, 26 May 2016 23:20:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDDC012C1; Thu, 26 May 2016 23:20:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNK7Nt069973; Thu, 26 May 2016 23:20:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNK7c2069972; Thu, 26 May 2016 23:20:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNK7c2069972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300797 - head/usr.sbin/extattr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:09 -0000 Author: bdrewery Date: Thu May 26 23:20:07 2016 New Revision: 300797 URL: https://svnweb.freebsd.org/changeset/base/300797 Log: DIRDEPS_BUILD: Update dependencies. Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/extattr/Makefile.depend Modified: head/usr.sbin/extattr/Makefile.depend ============================================================================== --- head/usr.sbin/extattr/Makefile.depend Thu May 26 23:20:04 2016 (r300796) +++ head/usr.sbin/extattr/Makefile.depend Thu May 26 23:20:07 2016 (r300797) @@ -9,6 +9,7 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/libsbuf \ lib/libutil \ From owner-svn-src-head@freebsd.org Thu May 26 23:20:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20E41B48162; Thu, 26 May 2016 23:20:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7E0F14E0; Thu, 26 May 2016 23:20:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNKEiD070068; Thu, 26 May 2016 23:20:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNKEBR070065; Thu, 26 May 2016 23:20:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNKEBR070065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300799 - in head/sys: conf modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:16 -0000 Author: bdrewery Date: Thu May 26 23:20:14 2016 New Revision: 300799 URL: https://svnweb.freebsd.org/changeset/base/300799 Log: Add some missing .PHONY. These are relevant for WITH_META_MODE to ensure they are always reran and don't generate a .meta file. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kern.post.mk head/sys/conf/kmod.mk head/sys/modules/Makefile Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Thu May 26 23:20:10 2016 (r300798) +++ head/sys/conf/kern.post.mk Thu May 26 23:20:14 2016 (r300799) @@ -295,7 +295,7 @@ kernel-tags: @[ -f .depend ] || { echo "you must make depend first"; exit 1; } sh $S/conf/systags.sh -kernel-install: +kernel-install: .PHONY @if [ ! -f ${KERNEL_KO} ] ; then \ echo "You must build a kernel first." ; \ exit 1 ; \ Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu May 26 23:20:10 2016 (r300798) +++ head/sys/conf/kmod.mk Thu May 26 23:20:14 2016 (r300799) @@ -306,7 +306,7 @@ _INSTALLFLAGS:= ${_INSTALLFLAGS${ie}} KERN_DEBUGDIR?= ${DEBUGDIR} realinstall: _kmodinstall .ORDER: beforeinstall _kmodinstall -_kmodinstall: +_kmodinstall: .PHONY ${INSTALL} -T release -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}/ .if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no" @@ -320,7 +320,7 @@ _kmodinstall: afterinstall: _kldxref .ORDER: realinstall _kldxref .ORDER: _installlinks _kldxref -_kldxref: +_kldxref: .PHONY @if type kldxref >/dev/null 2>&1; then \ ${ECHO} kldxref ${DESTDIR}${KMODDIR}; \ kldxref ${DESTDIR}${KMODDIR}; \ @@ -331,17 +331,17 @@ _kldxref: .endif # !target(install) .if !target(load) -load: ${PROG} +load: ${PROG} .PHONY ${KMODLOAD} -v ${.OBJDIR}/${PROG} .endif .if !target(unload) -unload: +unload: .PHONY if ${KMODISLOADED} ${PROG} ; then ${KMODUNLOAD} -v ${PROG} ; fi .endif .if !target(reload) -reload: unload load +reload: unload load .PHONY .endif .if defined(KERNBUILDDIR) Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu May 26 23:20:10 2016 (r300798) +++ head/sys/modules/Makefile Thu May 26 23:20:14 2016 (r300799) @@ -773,7 +773,7 @@ SUBDIR:= ${SUBDIR:N${reject}} # Calling kldxref(8) for each module is expensive. .if !defined(NO_XREF) .MAKEFLAGS+= -DNO_XREF -afterinstall: +afterinstall: .PHONY @if type kldxref >/dev/null 2>&1; then \ ${ECHO} kldxref ${DESTDIR}${KMODDIR}; \ kldxref ${DESTDIR}${KMODDIR}; \ From owner-svn-src-head@freebsd.org Thu May 26 23:20:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D5BAB4825C; Thu, 26 May 2016 23:20:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61BBF1A17; Thu, 26 May 2016 23:20:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNKXOg070347; Thu, 26 May 2016 23:20:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNKXRS070346; Thu, 26 May 2016 23:20:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNKXRS070346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300805 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:35 -0000 Author: bdrewery Date: Thu May 26 23:20:33 2016 New Revision: 300805 URL: https://svnweb.freebsd.org/changeset/base/300805 Log: Don't strip paths away from META_XTRAS. This would otherwise disallow using meta files from a foreign build that spread them around in directories outside our own .OBJDIR. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/meta.autodep.mk Modified: head/share/mk/meta.autodep.mk ============================================================================== --- head/share/mk/meta.autodep.mk Thu May 26 23:20:30 2016 (r300804) +++ head/share/mk/meta.autodep.mk Thu May 26 23:20:33 2016 (r300805) @@ -267,7 +267,7 @@ ${_DEPENDFILE}: ${_depend} ${.PARSEDIR}/ DPADD='${FORCE_DPADD:O:u}' ${_gendirdeps_mutex} \ MAKESYSPATH=${_makesyspath} \ ${.MAKE} -f gendirdeps.mk RELDIR=${RELDIR} _DEPENDFILE=${_DEPENDFILE} \ - META_FILES='${META_XTRAS:T:O:u} ${META_FILES:T:O:u:${META_FILE_FILTER:ts:}}') + META_FILES='${META_XTRAS:O:u} ${META_FILES:T:O:u:${META_FILE_FILTER:ts:}}') @test -s $@ && touch $@; : .endif From owner-svn-src-head@freebsd.org Thu May 26 23:20:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1738B48217; Thu, 26 May 2016 23:20:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5548618BB; Thu, 26 May 2016 23:20:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNKRoK070255; Thu, 26 May 2016 23:20:27 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNKRoJ070254; Thu, 26 May 2016 23:20:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNKRoJ070254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300803 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:28 -0000 Author: bdrewery Date: Thu May 26 23:20:27 2016 New Revision: 300803 URL: https://svnweb.freebsd.org/changeset/base/300803 Log: Pass CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS to the main crunch exec build. This fixes --sysroot and other CFLAGS/LDFLAGS not being respected in the crunchgen build since it is not including bsd.sys.mk and other files. For example, this fixes building rescue itself without --sysroot and other CFLAGS. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:24 2016 (r300802) +++ head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:27 2016 (r300803) @@ -114,7 +114,10 @@ ${OUTPUTS}: ${CONF} # These 2 targets cannot use .MAKE since they depend on the generated # ${OUTMK} above. ${PROG}: ${OUTPUTS} objs - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f ${OUTMK} exe + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ + CC="${CC} ${CFLAGS} ${LDFLAGS}" \ + CXX="${CXX} ${CXXFLAGS} ${LDFLAGS}" \ + ${MAKE} -f ${OUTMK} exe objs: ${OUTMK} ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f ${OUTMK} objs From owner-svn-src-head@freebsd.org Thu May 26 23:20:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B9A1B482B2; Thu, 26 May 2016 23:20:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 436921BC5; Thu, 26 May 2016 23:20:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNKfrw070445; Thu, 26 May 2016 23:20:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNKfGD070442; Thu, 26 May 2016 23:20:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNKfGD070442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300807 - in head: rescue/rescue share/mk targets/pseudo/userland/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:43 -0000 Author: bdrewery Date: Thu May 26 23:20:40 2016 New Revision: 300807 URL: https://svnweb.freebsd.org/changeset/base/300807 Log: DIRDEPS_BUILD: Fix and hookup rescue/rescue to the build. Sponsored by: EMC / Isilon Storage Division Added: head/rescue/rescue/Makefile.depend (contents, props changed) Modified: head/share/mk/bsd.crunchgen.mk head/targets/pseudo/userland/misc/Makefile.depend Added: head/rescue/rescue/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/rescue/rescue/Makefile.depend Thu May 26 23:20:40 2016 (r300807) @@ -0,0 +1,61 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + cddl/lib/libavl \ + cddl/lib/libnvpair \ + cddl/lib/libumem \ + cddl/lib/libuutil \ + cddl/lib/libzfs \ + cddl/lib/libzfs_core \ + cddl/lib/libzpool \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/arpa \ + include/protocols \ + include/rpc \ + include/rpcsvc \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/lib80211 \ + lib/libalias/libalias \ + lib/libarchive \ + lib/libbz2 \ + lib/libc \ + lib/libcam \ + lib/libcompiler_rt \ + lib/libcrypt \ + lib/libdevstat \ + lib/libedit \ + lib/libelf \ + lib/libexpat \ + lib/libgeom \ + lib/libipsec \ + lib/libjail \ + lib/libkiconv \ + lib/libkvm \ + lib/liblzma \ + lib/libmd \ + lib/libmt \ + lib/libnetgraph \ + lib/libsbuf \ + lib/libthr \ + lib/libufs \ + lib/libutil \ + lib/libxo \ + lib/libz \ + lib/msun \ + lib/ncurses/ncursesw \ + rescue/librescue \ + secure/lib/libcrypto \ + usr.bin/lex/lib \ + usr.bin/yacc.host \ + usr.sbin/crunch/crunchgen.host \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:36 2016 (r300806) +++ head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:40 2016 (r300807) @@ -108,6 +108,7 @@ ${CONF}: Makefile CRUNCHGEN?= crunchgen CRUNCHENV+= MK_TESTS=no \ + UPDATE_DEPENDFILE=no \ _RECURSING_CRUNCH=1 .ORDER: ${OUTPUTS} objs ${OUTPUTS:[1]}: .META @@ -121,13 +122,13 @@ ${OUTPUTS}: ${CONF} # These 2 targets cannot use .MAKE since they depend on the generated # ${OUTMK} above. -${PROG}: ${OUTPUTS} objs +${PROG}: ${OUTPUTS} objs .META ${CRUNCHENV} \ CC="${CC} ${CFLAGS} ${LDFLAGS}" \ CXX="${CXX} ${CXXFLAGS} ${LDFLAGS}" \ - ${MAKE} -f ${OUTMK} exe + ${MAKE} .MAKE.MODE=normal -f ${OUTMK} exe -objs: ${OUTMK} +objs: ${OUTMK} .META ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ ${MAKE} -f ${OUTMK} objs @@ -163,3 +164,5 @@ clean: ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} \ -f ${OUTMK} clean; \ fi + +META_XTRAS+= ${find ${CRUNCHOBJS}${SRCTOP} -name '*.meta' 2>/dev/null || true:L:sh} Modified: head/targets/pseudo/userland/misc/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/misc/Makefile.depend Thu May 26 23:20:36 2016 (r300806) +++ head/targets/pseudo/userland/misc/Makefile.depend Thu May 26 23:20:40 2016 (r300807) @@ -19,6 +19,7 @@ DIRDEPS = \ etc/newsyslog.conf.d \ etc/sendmail \ rescue/librescue \ + rescue/rescue \ .if ${MK_BOOT} != "no" DIRDEPS+= sys/boot/common From owner-svn-src-head@freebsd.org Thu May 26 23:20:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07141B481B9; Thu, 26 May 2016 23:20:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37716175A; Thu, 26 May 2016 23:20:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNKLLO070162; Thu, 26 May 2016 23:20:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNKLjc070159; Thu, 26 May 2016 23:20:21 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNKLjc070159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300801 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:23 -0000 Author: bdrewery Date: Thu May 26 23:20:20 2016 New Revision: 300801 URL: https://svnweb.freebsd.org/changeset/base/300801 Log: DIRDEPS_BUILD: Don't show finished stats, which confuses crunchgen(1). It would show 'make error:' lines for each auto object directory created. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.crunchgen.mk head/share/mk/local.meta.sys.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:17 2016 (r300800) +++ head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:20 2016 (r300801) @@ -103,11 +103,12 @@ ${CONF}: Makefile .endfor CRUNCHGEN?= crunchgen -CRUNCHENV?= MK_TESTS=no +CRUNCHENV?= MK_TESTS=no \ + _RECURSING_CRUNCH=1 .ORDER: ${OUTPUTS} objs ${OUTPUTS}: ${CONF} .META - MAKE=${MAKE} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${CRUNCHGEN} -fq \ - -m ${OUTMK} -c ${OUTC} ${CONF} + MAKE=${MAKE} ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ + ${CRUNCHGEN} -fq -m ${OUTMK} -c ${OUTC} ${CONF} # These 2 targets cannot use .MAKE since they depend on the generated # ${OUTMK} above. Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Thu May 26 23:20:17 2016 (r300800) +++ head/share/mk/local.meta.sys.mk Thu May 26 23:20:20 2016 (r300801) @@ -214,7 +214,7 @@ CSU_DIR := ${CSU_DIR.${MACHINE_ARCH}} .if !empty(TIME_STAMP) TRACER= ${TIME_STAMP} ${:U} .endif -.if !defined(_RECURSING_PROGS) +.if !defined(_RECURSING_PROGS) && !defined(_RECURSING_CRUNCH) WITH_META_STATS= t .endif From owner-svn-src-head@freebsd.org Thu May 26 23:20:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A6D3B481E8; Thu, 26 May 2016 23:20:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26F111807; Thu, 26 May 2016 23:20:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNKOdL070207; Thu, 26 May 2016 23:20:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNKOJt070206; Thu, 26 May 2016 23:20:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNKOJt070206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300802 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:26 -0000 Author: bdrewery Date: Thu May 26 23:20:24 2016 New Revision: 300802 URL: https://svnweb.freebsd.org/changeset/base/300802 Log: WITH_META_MODE: Only expect a .meta file for the main target. Since multiple files are generated from one build command, only the first to run will actually generate a .meta file. This fix prevents 'required but missing' rebuilds on each target. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:20 2016 (r300801) +++ head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:24 2016 (r300802) @@ -106,7 +106,8 @@ CRUNCHGEN?= crunchgen CRUNCHENV?= MK_TESTS=no \ _RECURSING_CRUNCH=1 .ORDER: ${OUTPUTS} objs -${OUTPUTS}: ${CONF} .META +${OUTPUTS:[1]}: .META +${OUTPUTS}: ${CONF} MAKE=${MAKE} ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ ${CRUNCHGEN} -fq -m ${OUTMK} -c ${OUTC} ${CONF} From owner-svn-src-head@freebsd.org Thu May 26 23:20:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B03DB482DD; Thu, 26 May 2016 23:20:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A524B1C6E; Thu, 26 May 2016 23:20:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNKiYb070491; Thu, 26 May 2016 23:20:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNKiM9070490; Thu, 26 May 2016 23:20:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNKiM9070490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300808 - head/tools/bsdbox X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:46 -0000 Author: bdrewery Date: Thu May 26 23:20:44 2016 New Revision: 300808 URL: https://svnweb.freebsd.org/changeset/base/300808 Log: DIRDEPS_BUILD: Add a Makefile.depend Sponsored by: EMC / Isilon Storage Division Added: head/tools/bsdbox/Makefile.depend (contents, props changed) Added: head/tools/bsdbox/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bsdbox/Makefile.depend Thu May 26 23:20:44 2016 (r300808) @@ -0,0 +1,56 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/arpa \ + include/rpc \ + include/rpcsvc \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/lib80211 \ + lib/libalias/libalias \ + lib/libarchive \ + lib/libbsm \ + lib/libbz2 \ + lib/libc \ + lib/libcam \ + lib/libcompiler_rt \ + lib/libcrypt \ + lib/libdevstat \ + lib/libedit \ + lib/libelf \ + lib/libexpat \ + lib/libgeom \ + lib/libgpio \ + lib/libipsec \ + lib/libjail \ + lib/libkiconv \ + lib/libkvm \ + lib/liblzma \ + lib/libmd \ + lib/libmemstat \ + lib/libnetgraph \ + lib/libpam/libpam \ + lib/libpcap \ + lib/libsbuf \ + lib/libufs \ + lib/libutil \ + lib/libwrap \ + lib/libxo \ + lib/libz \ + lib/msun \ + lib/ncurses/ncurses \ + lib/ncurses/ncursesw \ + secure/lib/libcrypto \ + secure/lib/libssl \ + usr.bin/lex/lib \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif From owner-svn-src-head@freebsd.org Thu May 26 23:20:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA5F9B48241; Thu, 26 May 2016 23:20:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73E8719A3; Thu, 26 May 2016 23:20:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNKU9n070302; Thu, 26 May 2016 23:20:30 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNKUXV070301; Thu, 26 May 2016 23:20:30 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNKUXV070301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300804 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:32 -0000 Author: bdrewery Date: Thu May 26 23:20:30 2016 New Revision: 300804 URL: https://svnweb.freebsd.org/changeset/base/300804 Log: Avoid redundant 'make objs' tree-walk when building the main prog. The main prog has a dependency on the submake targets to ensure they are built. From bsd.crunchgen.mk though we already have our own dependency on 'make objs' so there is no need for another one. Crunchgen(1) is doing the right thing here so it is not modified. This also prevents the CC fix tainting the submake environment with META_MODE and causing rebuilds. The CC passed is is only intended for the main prog itself. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:27 2016 (r300803) +++ head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:30 2016 (r300804) @@ -110,6 +110,9 @@ ${OUTPUTS:[1]}: .META ${OUTPUTS}: ${CONF} MAKE=${MAKE} ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ ${CRUNCHGEN} -fq -m ${OUTMK} -c ${OUTC} ${CONF} + # Avoid redundantly calling 'make objs' which we've done by our + # own dependencies. + sed -i '' -e "s/^\(${PROG}:.*\) \$$(SUBMAKE_TARGETS)/\1/" ${OUTMK} # These 2 targets cannot use .MAKE since they depend on the generated # ${OUTMK} above. From owner-svn-src-head@freebsd.org Thu May 26 23:20:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D347EB48294; Thu, 26 May 2016 23:20:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01BE21AEB; Thu, 26 May 2016 23:20:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNKbLB070398; Thu, 26 May 2016 23:20:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNKbIS070393; Thu, 26 May 2016 23:20:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262320.u4QNKbIS070393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300806 - in head: . share/mk sys/sys usr.sbin/crunch/crunchgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:20:40 -0000 Author: bdrewery Date: Thu May 26 23:20:36 2016 New Revision: 300806 URL: https://svnweb.freebsd.org/changeset/base/300806 Log: WITH_AUTO_OBJ: Fix crunchgen builds. Passing MAKEOBJDIRPREFIX to the main prog build (rescue) would confuse WITH_AUTO_OBJ and cause it to create a recursed object directory that then broke the actual prog build. This is normally not a problem since we do not call 'make -f prog.mk obj' before building anything in it. Crunchgen(1) also assumes that if -o is not passed then if an object directory does not already exist then it should build in the source directories. The normal buildworld process will have already ran 'make obj' in each of the component directories so this is not a problem. With WITH_AUTO_OBJ though this is not the case. So we must tell crunchgen(1) that MK_AUTO_OBJ=yes will create the directory and to not require it be present before generating its Makefile. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/share/mk/bsd.crunchgen.mk head/sys/sys/param.h head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 26 23:20:33 2016 (r300805) +++ head/Makefile.inc1 Thu May 26 23:20:36 2016 (r300806) @@ -1570,9 +1570,15 @@ _dd= bin/dd # r277259 crunchide: Correct 64-bit section header offset # r281674 crunchide: always include both 32- and 64-bit ELF support -# r285986 crunchen: use STRIPBIN rather than STRIP .if ${BOOTSTRAPPING} < 1100078 -_crunch= usr.sbin/crunch +_crunchide= usr.sbin/crunch/crunchide +.endif + +# r285986 crunchen: use STRIPBIN rather than STRIP +# 1100113: Support MK_AUTO_OBJ +.if ${BOOTSTRAPPING} < 1100078 || \ + (${MK_AUTO_OBJ} == "yes" && ${BOOTSTRAPPING} < 1100114) +_crunchgen= usr.sbin/crunch/crunchgen .endif .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 @@ -1661,7 +1667,8 @@ bootstrap-tools: .PHONY usr.bin/xinstall \ ${_gensnmptree} \ usr.sbin/config \ - ${_crunch} \ + ${_crunchide} \ + ${_crunchgen} \ ${_nmtree} \ ${_vtfontcvt} \ usr.bin/localedef Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:33 2016 (r300805) +++ head/share/mk/bsd.crunchgen.mk Thu May 26 23:20:36 2016 (r300806) @@ -39,6 +39,10 @@ OUTC= ${PROG}.c OUTPUTS=${OUTMK} ${OUTC} ${PROG}.cache CRUNCHOBJS= ${.OBJDIR} CRUNCH_GENERATE_LINKS?= yes +# Don't let the prog.mk use MK_AUTO_OBJ, but do let the component builds use +# it. +CRUNCHENV+= MK_AUTO_OBJ=no +CRUNCH_BUILDOPTS+= MK_AUTO_OBJ=${MK_AUTO_OBJ} CLEANFILES+= ${CONF} *.o *.lo *.c *.mk *.cache *.a *.h @@ -103,12 +107,13 @@ ${CONF}: Makefile .endfor CRUNCHGEN?= crunchgen -CRUNCHENV?= MK_TESTS=no \ +CRUNCHENV+= MK_TESTS=no \ _RECURSING_CRUNCH=1 .ORDER: ${OUTPUTS} objs ${OUTPUTS:[1]}: .META ${OUTPUTS}: ${CONF} - MAKE=${MAKE} ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ + MAKE=${MAKE} ${CRUNCHENV:NMK_AUTO_OBJ=*} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ + MK_AUTO_OBJ=${MK_AUTO_OBJ} \ ${CRUNCHGEN} -fq -m ${OUTMK} -c ${OUTC} ${CONF} # Avoid redundantly calling 'make objs' which we've done by our # own dependencies. @@ -117,13 +122,14 @@ ${OUTPUTS}: ${CONF} # These 2 targets cannot use .MAKE since they depend on the generated # ${OUTMK} above. ${PROG}: ${OUTPUTS} objs - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ + ${CRUNCHENV} \ CC="${CC} ${CFLAGS} ${LDFLAGS}" \ CXX="${CXX} ${CXXFLAGS} ${LDFLAGS}" \ ${MAKE} -f ${OUTMK} exe objs: ${OUTMK} - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f ${OUTMK} objs + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ + ${MAKE} -f ${OUTMK} objs # Someone should replace the bin/csh and bin/sh build-tools with # shell scripts so we can remove this nonsense. Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu May 26 23:20:33 2016 (r300805) +++ head/sys/sys/param.h Thu May 26 23:20:36 2016 (r300806) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100113 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100114 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Thu May 26 23:20:33 2016 (r300805) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Thu May 26 23:20:36 2016 (r300806) @@ -670,8 +670,13 @@ fillin_program(prog_t *p) * an object directory already exists. */ if (!makeobj && !p->objdir && p->srcdir) { + char *auto_obj; + + auto_obj = NULL; snprintf(line, sizeof line, "%s/%s", objprefix, p->realsrcdir); - if (is_dir(line)) { + if (is_dir(line) || + ((auto_obj = getenv("MK_AUTO_OBJ")) != NULL && + strcmp(auto_obj, "yes") == 0)) { if ((p->objdir = strdup(line)) == NULL) out_of_memory(); } else From owner-svn-src-head@freebsd.org Thu May 26 23:27:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B41A4B487D8; Thu, 26 May 2016 23:27:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8508A2B85; Thu, 26 May 2016 23:27:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNR8Ac073920; Thu, 26 May 2016 23:27:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNR84u073919; Thu, 26 May 2016 23:27:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605262327.u4QNR84u073919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 26 May 2016 23:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300809 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:27:09 -0000 Author: bdrewery Date: Thu May 26 23:27:08 2016 New Revision: 300809 URL: https://svnweb.freebsd.org/changeset/base/300809 Log: filemon exec: Use imgp->execpath rather than vn_fullpath(9). This will be more accurate as the actual name is provided if ran from an absolute path in do_execve(). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Thu May 26 23:20:44 2016 (r300808) +++ head/sys/dev/filemon/filemon_wrapper.c Thu May 26 23:27:08 2016 (r300809) @@ -102,24 +102,17 @@ filemon_event_process_exec(void *arg __u struct image_params *imgp) { struct filemon *filemon; - char *fullpath, *freepath; size_t len; if ((filemon = filemon_proc_get(p)) != NULL) { - fullpath = ""; - freepath = NULL; - - vn_fullpath(curthread, imgp->vp, &fullpath, &freepath); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "E %d %s\n", - p->p_pid, fullpath); + p->p_pid, + imgp->execpath != NULL ? imgp->execpath : ""); filemon_output(filemon, filemon->msgbufr, len); filemon_drop(filemon); - - free(freepath, M_TEMP); } } From owner-svn-src-head@freebsd.org Thu May 26 23:32:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E825BB48952; Thu, 26 May 2016 23:32:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCED92EF2; Thu, 26 May 2016 23:32:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNWSH9077319; Thu, 26 May 2016 23:32:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNWSKn077316; Thu, 26 May 2016 23:32:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605262332.u4QNWSKn077316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 26 May 2016 23:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300810 - in head/sys/boot/efi: libefi 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:32:30 -0000 Author: jhb Date: Thu May 26 23:32:28 2016 New Revision: 300810 URL: https://svnweb.freebsd.org/changeset/base/300810 Log: Fix unit number of EFI net interfaces and ignore psuedo network interfaces. In r277943, the efinet_match() routine was changed to use an off by one when matching network interfaces. The effect was that using "net1" actually used the device attached to "net0". Digging into the hardware that needed this workaround more, I found that UEFI was creating two simple network protocol devices for each physical NIC. The first device was a "raw" Ethernet device and the second device was a "IP" device that used the IP protocol on top of the underlying "raw" device. The PXE code in the firmware used the "IP" device to pull across the loader.efi, so currdev was set to "net1" when booting from the physical interface "net0". (The loaded image's device handle referenced the "IP" device that "net1" claimed.) However, the IP device isn't suitable for doing raw packet I/O (and the current code to open devices exclusively actually turns the "IP" devices off on these systems). To fix, change the efinet driver to only attach to "raw" devices. This is determined by fetching the DEVICE_PATH for each handle which supports the simple network protocol and examining the last node in the path. If the last node in the path is a MAC address, the device is assumed to be a "raw" device and is added as a 'netX' device. If the last node is not a MAC address, the device is ignored. However, this causes a new problem as the device handle associated with the loaded image no longer matches any of the handles enumerated by efinet for systems that load the image via the "IP" device. To handle this case, expand the logic that resolves currdev from the loaded image in main(). First, the existing logic of looking for a handle that matches the loaded image's handle is tried. If that fails, the device path of the handle that loaded the loaded image is fetched via efi_lookup_image_devpath(). This device path is then walked from the end up to the beginning using efi_handle_lookup() to fetch the handle associated with a path. If the handle is found and is a known handle, then that is used as currdev. The effect for machines that load the image via the "IP" device is that the first lookup fails (the handle for the "IP" device isn't claimed by efinet), but walking up the image's device path finds the handle of the raw MAC device which is used as currdev. With these fixes in place, the hack to subtract 1 from the unit can now be removed, so that setting currdev to 'net0' actually uses 'net0'. PR: 202097 Tested by: ambrisko Sponsored by: Cisco Systems Modified: head/sys/boot/efi/libefi/efinet.c head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/libefi/efinet.c ============================================================================== --- head/sys/boot/efi/libefi/efinet.c Thu May 26 23:27:08 2016 (r300809) +++ head/sys/boot/efi/libefi/efinet.c Thu May 26 23:32:28 2016 (r300810) @@ -101,7 +101,7 @@ efinet_match(struct netif *nif, void *ma { struct devdesc *dev = machdep_hint; - if (dev->d_unit - 1 == nif->nif_unit) + if (dev->d_unit == nif->nif_unit) return (1); return(0); } @@ -271,7 +271,9 @@ efinet_dev_init() { struct netif_dif *dif; struct netif_stats *stats; - EFI_HANDLE *handles; + EFI_DEVICE_PATH *devpath, *node; + EFI_SIMPLE_NETWORK *net; + EFI_HANDLE *handles, *handles2; EFI_STATUS status; UINTN sz; int err, i, nifs; @@ -288,43 +290,58 @@ efinet_dev_init() } if (EFI_ERROR(status)) return (efi_status_to_errno(status)); - nifs = sz / sizeof(EFI_HANDLE); - err = efi_register_handles(&efinet_dev, handles, NULL, nifs); - free(handles); - if (err != 0) - return (err); - - efinetif.netif_nifs = nifs; - efinetif.netif_ifs = calloc(nifs, sizeof(struct netif_dif)); - - stats = calloc(nifs, sizeof(struct netif_stats)); - - for (i = 0; i < nifs; i++) { - EFI_SIMPLE_NETWORK *net; - EFI_HANDLE h; - - dif = &efinetif.netif_ifs[i]; - dif->dif_unit = -1; - - h = efi_find_handle(&efinet_dev, i); + handles2 = (EFI_HANDLE *)malloc(sz); + nifs = 0; + for (i = 0; i < sz / sizeof(EFI_HANDLE); i++) { + devpath = efi_lookup_devpath(handles[i]); + if (devpath == NULL) + continue; + node = efi_devpath_last_node(devpath); + if (DevicePathType(node) != MESSAGING_DEVICE_PATH || + DevicePathSubType(node) != MSG_MAC_ADDR_DP) + continue; /* * Open the network device in exclusive mode. Without this * we will be racing with the UEFI network stack. It will * pull packets off the network leading to lost packets. */ - status = BS->OpenProtocol(h, &sn_guid, (void **)&net, + status = BS->OpenProtocol(handles[i], &sn_guid, (void **)&net, IH, 0, EFI_OPEN_PROTOCOL_EXCLUSIVE); if (status != EFI_SUCCESS) { printf("Unable to open network interface %d for " - "exclusive access\n", i); + "exclusive access: %d\n", i, EFI_ERROR(status)); } + handles2[nifs] = handles[i]; + nifs++; + } + free(handles); + if (nifs == 0) { + free(handles2); + return (ENOENT); + } + + err = efi_register_handles(&efinet_dev, handles2, NULL, nifs); + if (err != 0) { + free(handles2); + return (err); + } + + efinetif.netif_nifs = nifs; + efinetif.netif_ifs = calloc(nifs, sizeof(struct netif_dif)); + + stats = calloc(nifs, sizeof(struct netif_stats)); + + for (i = 0; i < nifs; i++) { + + dif = &efinetif.netif_ifs[i]; dif->dif_unit = i; dif->dif_nsel = 1; dif->dif_stats = &stats[i]; - dif->dif_private = h; + dif->dif_private = handles2[i]; } + free(handles2); return (0); } Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Thu May 26 23:27:08 2016 (r300809) +++ head/sys/boot/efi/loader/main.c Thu May 26 23:32:28 2016 (r300810) @@ -183,6 +183,47 @@ out: return retval; } +static int +find_currdev(EFI_LOADED_IMAGE *img, struct devsw **dev, int *unit, + uint64_t *extra) +{ + EFI_DEVICE_PATH *devpath, *copy; + EFI_HANDLE h; + + /* + * Try the device handle from our loaded image first. If that + * fails, use the device path from the loaded image and see if + * any of the nodes in that path match one of the enumerated + * handles. + */ + if (efi_handle_lookup(img->DeviceHandle, dev, unit, extra) == 0) + return (0); + + copy = NULL; + devpath = efi_lookup_image_devpath(IH); + while (devpath != NULL) { + h = efi_devpath_handle(devpath); + if (h == NULL) + break; + + if (efi_handle_lookup(h, dev, unit, extra) == 0) { + if (copy != NULL) + free(copy); + return (0); + } + + if (copy != NULL) + free(copy); + devpath = efi_lookup_devpath(h); + if (devpath != NULL) { + copy = efi_devpath_trim(devpath); + devpath = copy; + } + } + + return (ENOENT); +} + EFI_STATUS main(int argc, CHAR16 *argv[]) { @@ -358,7 +399,7 @@ main(int argc, CHAR16 *argv[]) */ BS->SetWatchdogTimer(0, 0, 0, NULL); - if (efi_handle_lookup(img->DeviceHandle, &dev, &unit, &pool_guid) != 0) + if (find_currdev(img, &dev, &unit, &pool_guid) != 0) return (EFI_NOT_FOUND); switch (dev->dv_type) { From owner-svn-src-head@freebsd.org Thu May 26 23:56:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0708DB48F49; Thu, 26 May 2016 23:56:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C79271A7C; Thu, 26 May 2016 23:56:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNuCg3084766; Thu, 26 May 2016 23:56:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNuCe8084760; Thu, 26 May 2016 23:56:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605262356.u4QNuCe8084760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 May 2016 23:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300811 - in head/sys: conf dev/gpio gnu/dts/arm modules modules/gpio modules/gpio/gpiopps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:56:14 -0000 Author: ian Date: Thu May 26 23:56:12 2016 New Revision: 300811 URL: https://svnweb.freebsd.org/changeset/base/300811 Log: Add a PPS driver that takes the timing pulse from a gpio pin. Currently supports only ofw/fdt systems. Some day, hinted attachment for non-fdt systems should be possible too. Added: head/sys/dev/gpio/gpiopps.c (contents, props changed) head/sys/modules/gpio/gpiopps/ head/sys/modules/gpio/gpiopps/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi head/sys/modules/Makefile head/sys/modules/gpio/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 26 23:32:28 2016 (r300810) +++ head/sys/conf/files Thu May 26 23:56:12 2016 (r300811) @@ -1534,6 +1534,7 @@ dev/gpio/gpioled.c optional gpioled dev/gpio/gpiospi.c optional gpiospi dev/gpio/gpio_if.m optional gpio dev/gpio/gpiobus_if.m optional gpio +dev/gpio/gpiopps.c optional gpiopps dev/gpio/ofw_gpiobus.c optional fdt gpio dev/hatm/if_hatm.c optional hatm pci dev/hatm/if_hatm_intr.c optional hatm pci Added: head/sys/dev/gpio/gpiopps.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gpio/gpiopps.c Thu May 26 23:56:12 2016 (r300811) @@ -0,0 +1,294 @@ +/*- + * Copyright (c) 2016 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "opt_platform.h" + +#ifdef FDT +#include + +static struct ofw_compat_data compat_data[] = { + {"pps-gpio", 1}, + {NULL, 0} +}; +#endif /* FDT */ + +static devclass_t pps_devclass; + +struct pps_softc { + device_t dev; + gpio_pin_t gpin; + void *ihandler; + struct resource *ires; + int irid; + struct cdev *pps_cdev; + struct pps_state pps_state; + struct mtx pps_mtx; + bool falling_edge; +}; + +#define PPS_CDEV_NAME "gpiopps" + +static int +gpiopps_open(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + struct pps_softc *sc = dev->si_drv1; + + /* We can't be unloaded while open, so mark ourselves BUSY. */ + mtx_lock(&sc->pps_mtx); + if (device_get_state(sc->dev) < DS_BUSY) { + device_busy(sc->dev); + } + mtx_unlock(&sc->pps_mtx); + + return 0; +} + +static int +gpiopps_close(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + struct pps_softc *sc = dev->si_drv1; + + /* + * Un-busy on last close. We rely on the vfs counting stuff to only call + * this routine on last-close, so we don't need any open-count logic. + */ + mtx_lock(&sc->pps_mtx); + device_unbusy(sc->dev); + mtx_unlock(&sc->pps_mtx); + + return 0; +} + +static int +gpiopps_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td) +{ + struct pps_softc *sc = dev->si_drv1; + int err; + + /* Let the kernel do the heavy lifting for ioctl. */ + mtx_lock(&sc->pps_mtx); + err = pps_ioctl(cmd, data, &sc->pps_state); + mtx_unlock(&sc->pps_mtx); + + return err; +} + +static struct cdevsw pps_cdevsw = { + .d_version = D_VERSION, + .d_open = gpiopps_open, + .d_close = gpiopps_close, + .d_ioctl = gpiopps_ioctl, + .d_name = PPS_CDEV_NAME, +}; + +static int +gpiopps_ifltr(void *arg) +{ + struct pps_softc *sc = arg; + + /* + * There is no locking here by design... The kernel cleverly captures + * the current time into an area of the pps_state structure which is + * written only by the pps_capture() routine and read only by the + * pps_event() routine. We don't need lock-based management of access + * to the capture area because we have time-based access management: we + * can't be reading and writing concurently because we can't be running + * both the threaded and filter handlers concurrently (because a new + * hardware interrupt can't happen until the threaded handler for the + * current interrupt exits, after which the system does the EOI that + * enables a new hardware interrupt). + */ + pps_capture(&sc->pps_state); + return (FILTER_SCHEDULE_THREAD); +} + +static void +gpiopps_ithrd(void *arg) +{ + struct pps_softc *sc = arg; + + /* + * Go create a pps event from the data captured in the filter handler. + * + * Note that we DO need locking here, unlike the case with the filter + * handler. The pps_event() routine updates the non-capture part of the + * pps_state structure, and the ioctl() code could be accessing that + * data right now in a non-interrupt context, so we need an interlock. + */ + mtx_lock(&sc->pps_mtx); + pps_event(&sc->pps_state, PPS_CAPTUREASSERT); + mtx_unlock(&sc->pps_mtx); +} + +static int +gpiopps_detach(device_t dev) +{ + struct pps_softc *sc = device_get_softc(dev); + + if (sc->pps_cdev != NULL) + destroy_dev(sc->pps_cdev); + if (sc->ihandler != NULL) + bus_teardown_intr(dev, sc->ires, sc->ihandler); + if (sc->ires != NULL) + bus_release_resource(dev, SYS_RES_IRQ, sc->irid, sc->ires); + if (sc->gpin != NULL) + gpiobus_release_pin(GPIO_GET_BUS(sc->gpin->dev), sc->gpin->pin); + return (0); +} + +#ifdef FDT +static int +gpiopps_fdt_attach(device_t dev) +{ + struct pps_softc *sc; + struct make_dev_args devargs; + phandle_t node; + uint32_t edge, pincaps; + int err; + + sc = device_get_softc(dev); + sc->dev = dev; + + mtx_init(&sc->pps_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + /* Initialize the pps_state struct. */ + sc->pps_state.ppscap = PPS_CAPTUREASSERT | PPS_CAPTURECLEAR; + sc->pps_state.driver_abi = PPS_ABI_VERSION; + sc->pps_state.driver_mtx = &sc->pps_mtx; + pps_init_abi(&sc->pps_state); + + /* Check which edge we're configured to capture (default is rising). */ + if (ofw_bus_has_prop(dev, "assert-falling-edge")) + edge = GPIO_INTR_EDGE_FALLING; + else + edge = GPIO_INTR_EDGE_RISING; + + /* + * Look up the configured gpio pin and ensure it can be configured for + * the interrupt mode we need. + */ + node = ofw_bus_get_node(dev); + if ((err = gpio_pin_get_by_ofw_idx(dev, node, 0, &sc->gpin)) != 0) { + device_printf(dev, "Cannot obtain gpio pin\n"); + return (err); + } + device_printf(dev, "PPS input on %s pin %u\n", + device_get_nameunit(sc->gpin->dev), sc->gpin->pin); + + if ((err = gpio_pin_getcaps(sc->gpin, &pincaps)) != 0) { + device_printf(dev, "Cannot query capabilities of gpio pin\n"); + gpiopps_detach(dev); + return (err); + } + if ((pincaps & edge) == 0) { + device_printf(dev, "Pin cannot be configured for the requested signal edge\n"); + gpiopps_detach(dev); + return (ENOTSUP); + } + + /* + * Transform our 'gpios' property into an interrupt resource and set up + * the interrupt. + */ + if ((sc->ires = gpio_alloc_intr_resource(dev, &sc->irid, RF_ACTIVE, + sc->gpin, edge)) == NULL) { + device_printf(dev, "Cannot allocate an IRQ for the GPIO\n"); + gpiopps_detach(dev); + return (err); + } + + err = bus_setup_intr(dev, sc->ires, INTR_TYPE_CLK | INTR_MPSAFE, + gpiopps_ifltr, gpiopps_ithrd, sc, &sc->ihandler); + if (err != 0) { + device_printf(dev, "Unable to setup pps irq handler\n"); + gpiopps_detach(dev); + return (err); + } + + /* Create the RFC 2783 pps-api cdev. */ + make_dev_args_init(&devargs); + devargs.mda_devsw = &pps_cdevsw; + devargs.mda_uid = UID_ROOT; + devargs.mda_gid = GID_WHEEL; + devargs.mda_mode = 0660; + devargs.mda_si_drv1 = sc; + err = make_dev_s(&devargs, &sc->pps_cdev, PPS_CDEV_NAME "%d", + device_get_unit(dev)); + if (err != 0) { + device_printf(dev, "Unable to create pps cdev\n"); + gpiopps_detach(dev); + return (err); + } + + return (0); +} + +static int +gpiopps_fdt_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "GPIO PPS"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static device_method_t pps_fdt_methods[] = { + DEVMETHOD(device_probe, gpiopps_fdt_probe), + DEVMETHOD(device_attach, gpiopps_fdt_attach), + DEVMETHOD(device_detach, gpiopps_detach), + + DEVMETHOD_END +}; + +static driver_t pps_fdt_driver = { + "gpiopps", + pps_fdt_methods, + sizeof(struct pps_softc), +}; + +DRIVER_MODULE(gpiopps, simplebus, pps_fdt_driver, pps_devclass, 0, 0); + +#endif /* FDT */ Modified: head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi ============================================================================== --- head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi Thu May 26 23:32:28 2016 (r300810) +++ head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi Thu May 26 23:56:12 2016 (r300811) @@ -262,3 +262,12 @@ cd-gpios = <&gpio3 9 GPIO_ACTIVE_LOW>; status = "okay"; }; + +/ { + pps@0 { + compatible = "pps-gpio"; + gpios = <&gpio3 27 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; +}; + Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu May 26 23:32:28 2016 (r300810) +++ head/sys/modules/Makefile Thu May 26 23:56:12 2016 (r300811) @@ -125,6 +125,7 @@ SUBDIR= \ geom \ ${_glxiic} \ ${_glxsb} \ + gpio \ hatm \ hifn \ hme \ Modified: head/sys/modules/gpio/Makefile ============================================================================== --- head/sys/modules/gpio/Makefile Thu May 26 23:32:28 2016 (r300810) +++ head/sys/modules/gpio/Makefile Thu May 26 23:56:12 2016 (r300811) @@ -25,6 +25,6 @@ # SUCH DAMAGE. # -SUBDIR = gpiobus gpioiic gpioled +SUBDIR = gpiobus gpioiic gpioled gpiopps .include Added: head/sys/modules/gpio/gpiopps/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/gpio/gpiopps/Makefile Thu May 26 23:56:12 2016 (r300811) @@ -0,0 +1,40 @@ +# +# Copyright (c) 2016 Ian Lepore +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer, +# 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$ +# + +.PATH: ${.CURDIR}/../../../dev/gpio/ + +KMOD= gpiopps +SRCS= gpiopps.c +SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h + +CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ + +.include From owner-svn-src-head@freebsd.org Thu May 26 23:59:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F6D2B4B1CD; Thu, 26 May 2016 23:59:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02C721C28; Thu, 26 May 2016 23:59:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4QNxhu2084907; Thu, 26 May 2016 23:59:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QNxh6G084906; Thu, 26 May 2016 23:59:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605262359.u4QNxh6G084906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 May 2016 23:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300812 - head/sys/gnu/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 23:59:44 -0000 Author: ian Date: Thu May 26 23:59:42 2016 New Revision: 300812 URL: https://svnweb.freebsd.org/changeset/base/300812 Log: Revert changes for local testing, inadvertantly commited in r300811. Modified: head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi Modified: head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi ============================================================================== --- head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi Thu May 26 23:56:12 2016 (r300811) +++ head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi Thu May 26 23:59:42 2016 (r300812) @@ -262,12 +262,3 @@ cd-gpios = <&gpio3 9 GPIO_ACTIVE_LOW>; status = "okay"; }; - -/ { - pps@0 { - compatible = "pps-gpio"; - gpios = <&gpio3 27 GPIO_ACTIVE_HIGH>; - status = "okay"; - }; -}; - From owner-svn-src-head@freebsd.org Fri May 27 00:01:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB7ACB4B397; Fri, 27 May 2016 00:01:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D1771F1D; Fri, 27 May 2016 00:01:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R01mXB087679; Fri, 27 May 2016 00:01:48 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R01mKT087678; Fri, 27 May 2016 00:01:48 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605270001.u4R01mKT087678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 27 May 2016 00:01:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300813 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 00:01:49 -0000 Author: gjb Date: Fri May 27 00:01:48 2016 New Revision: 300813 URL: https://svnweb.freebsd.org/changeset/base/300813 Log: Update head from 11.0-CURRENT to 11.0-ALPHA1, marking the official start of the code slush. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu May 26 23:59:42 2016 (r300812) +++ head/sys/conf/newvers.sh Fri May 27 00:01:48 2016 (r300813) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="11.0" -BRANCH="CURRENT" +BRANCH="ALPHA1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-head@freebsd.org Fri May 27 00:15:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E298B4B696; Fri, 27 May 2016 00:15:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 4346319A1; Fri, 27 May 2016 00:15:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 2C62425D3860; Fri, 27 May 2016 00:14:51 +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 59FD2D1F839; Fri, 27 May 2016 00:14: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 mk7FF2xesWwT; Fri, 27 May 2016 00:14:49 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f1d5:9a80:7147:4985] (unknown [IPv6:fde9:577b:c1a9:4410:f1d5:9a80:7147:4985]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id AF8F1D1F83C; Fri, 27 May 2016 00:14:48 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300764 - head/sys/netinet From: "Bjoern A. Zeeb" In-Reply-To: <201605261835.u4QIZblp066704@repo.freebsd.org> Date: Fri, 27 May 2016 00:14:28 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201605261835.u4QIZblp066704@repo.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 00:15:02 -0000 > On 26 May 2016, at 18:35 , John Baldwin wrote: >=20 > Author: jhb > Date: Thu May 26 18:35:37 2016 > New Revision: 300764 > URL: https://svnweb.freebsd.org/changeset/base/300764 >=20 > Log: > Don't reuse the source mbuf in tcp_respond() if it is not writable. >=20 > Not all mbufs passed up from device drivers are M_WRITABLE(). In > particular, the Chelsio T4/T5 driver uses a feature called "buffer = packing" > to receive multiple frames in a single receive buffer. The mbufs for > these frames all share the same external storage so are treated as > read-only by the rest of the stack when multiple frames are in = flight. > Previously tcp_respond() would blindly overwrite read-only mbufs when > INVARIANTS was disabled or panic with an assertion failure if = INVARIANTS > was enabled. Note that the new case is a bit of a mix of the two = other > cases in tcp_respond(). The TCP and IP headers must be copied = explicitly > into the new mbuf instead of being inherited (similar to the m =3D=3D = NULL > case), but the addresses and ports must be swapped in the reply = (similar > to the m !=3D NULL case). Is the same true for ICMP(v6) replies? /bz From owner-svn-src-head@freebsd.org Fri May 27 01:07:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACE6EB4A230; Fri, 27 May 2016 01:07:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E3BC1DEE; Fri, 27 May 2016 01:07:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R17mIC010060; Fri, 27 May 2016 01:07:48 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R17mq2010059; Fri, 27 May 2016 01:07:48 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605270107.u4R17mq2010059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 27 May 2016 01:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300814 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 01:07:49 -0000 Author: gjb Date: Fri May 27 01:07:48 2016 New Revision: 300814 URL: https://svnweb.freebsd.org/changeset/base/300814 Log: Make Makefile.mirrors -ALPHA${N}-aware. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.mirrors Modified: head/release/Makefile.mirrors ============================================================================== --- head/release/Makefile.mirrors Fri May 27 00:01:48 2016 (r300813) +++ head/release/Makefile.mirrors Fri May 27 01:07:48 2016 (r300814) @@ -27,7 +27,7 @@ EMBEDDED= 1 .endif # snapshot -.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" +.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" || ${BRANCH:MALPHA*} != "" SNAPSHOT= 1 TLD?= ${FTPDIR}/snapshots . if !defined(SVNREVISION) || empty(SVNREVISION) @@ -63,7 +63,7 @@ BOARDNAME:= ${KERNCONF} . else OLDNAME:= ${KERNCONF} . endif -. if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" +. if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" || ${BRANCH:MALPHA*} != "" SNAPSHOT= 1 . endif IMAGES:= img From owner-svn-src-head@freebsd.org Fri May 27 01:14:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE76FB4A549; Fri, 27 May 2016 01:14:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B75801279; Fri, 27 May 2016 01:14:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R1EZKx013522; Fri, 27 May 2016 01:14:35 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R1EZdu013521; Fri, 27 May 2016 01:14:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605270114.u4R1EZdu013521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 27 May 2016 01:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300815 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 01:14:37 -0000 Author: ian Date: Fri May 27 01:14:35 2016 New Revision: 300815 URL: https://svnweb.freebsd.org/changeset/base/300815 Log: Only build gpio modules on armv6, until it's known that they can be built succesfully on other arches. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 27 01:07:48 2016 (r300814) +++ head/sys/modules/Makefile Fri May 27 01:14:35 2016 (r300815) @@ -125,7 +125,7 @@ SUBDIR= \ geom \ ${_glxiic} \ ${_glxsb} \ - gpio \ + ${_gpio} \ hatm \ hifn \ hme \ @@ -733,6 +733,10 @@ _cfi= cfi _cpsw= cpsw .endif +.if ${MACHINE_ARCH} == "armv6" +_gpio= gpio +.endif + .if ${MACHINE_CPUARCH} == "powerpc" _agp= agp _an= an From owner-svn-src-head@freebsd.org Fri May 27 01:36:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26431B4A866; Fri, 27 May 2016 01:36:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D741E1B86; Fri, 27 May 2016 01:36:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R1aTvB021075; Fri, 27 May 2016 01:36:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R1aTgd021074; Fri, 27 May 2016 01:36:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605270136.u4R1aTgd021074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 27 May 2016 01:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300816 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 01:36:31 -0000 Author: adrian Date: Fri May 27 01:36:29 2016 New Revision: 300816 URL: https://svnweb.freebsd.org/changeset/base/300816 Log: [gpiospi] add debug option. This was missing from the previous commit that introduced gpiospi. It's required for it to build. Pointy-hat-to: me Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri May 27 01:14:35 2016 (r300815) +++ head/sys/conf/options Fri May 27 01:36:29 2016 (r300816) @@ -982,3 +982,6 @@ EM_MULTIQUEUE opt_em.h # BHND(4) driver BHND_LOGLEVEL opt_global.h + +# GPIO and child devices +GPIO_SPI_DEBUG opt_gpio.h From owner-svn-src-head@freebsd.org Fri May 27 01:40:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E2E2B4A930; Fri, 27 May 2016 01:40:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C856A1D5E; Fri, 27 May 2016 01:40:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R1eXZH021274; Fri, 27 May 2016 01:40:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R1eXtU021273; Fri, 27 May 2016 01:40:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605270140.u4R1eXtU021273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 27 May 2016 01:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300817 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 01:40:35 -0000 Author: adrian Date: Fri May 27 01:40:33 2016 New Revision: 300817 URL: https://svnweb.freebsd.org/changeset/base/300817 Log: [spigen] add the userland ioctl API for spigen. Added: head/sys/sys/spigenio.h (contents, props changed) Added: head/sys/sys/spigenio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/spigenio.h Fri May 27 01:40:33 2016 (r300817) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2000 Doug Rabson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_SPIGENIO_H_ +#define _SYS_SPIGENIO_H_ + +#include + +struct spigen_transfer { + struct iovec st_command; /* master to slave */ + struct iovec st_data; /* slave to master and/or master to slave */ +}; + +struct spigen_transfer_mmapped { + size_t stm_command_length; /* at offset 0 in mmap(2) area */ + size_t stm_data_length; /* at offset stm_command_length */ +}; + +#define SPIGENIOC_BASE 'S' +#define SPIGENIOC_TRANSFER _IOW(SPIGENIOC_BASE, 0, \ + struct spigen_transfer) +#define SPIGENIOC_TRANSFER_MMAPPED _IOW(SPIGENIOC_BASE, 1, \ + struct spigen_transfer_mmapped) +#define SPIGENIOC_GET_CLOCK_SPEED _IOR(SPIGENIOC_BASE, 2, uint32_t) +#define SPIGENIOC_SET_CLOCK_SPEED _IOW(SPIGENIOC_BASE, 3, uint32_t) + +#endif /* !_SYS_SPIGENIO_H_ */ From owner-svn-src-head@freebsd.org Fri May 27 01:42:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8AF7B4AA8F; Fri, 27 May 2016 01:42:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 964D510FC; Fri, 27 May 2016 01:42:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R1gtIM024681; Fri, 27 May 2016 01:42:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R1gtU0024680; Fri, 27 May 2016 01:42:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605270142.u4R1gtU0024680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 27 May 2016 01:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300818 - head/sys/modules/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 01:42:56 -0000 Author: adrian Date: Fri May 27 01:42:55 2016 New Revision: 300818 URL: https://svnweb.freebsd.org/changeset/base/300818 Log: [gpio] add gpiospi to the gpio module. Modified: head/sys/modules/gpio/Makefile Modified: head/sys/modules/gpio/Makefile ============================================================================== --- head/sys/modules/gpio/Makefile Fri May 27 01:40:33 2016 (r300817) +++ head/sys/modules/gpio/Makefile Fri May 27 01:42:55 2016 (r300818) @@ -25,6 +25,6 @@ # SUCH DAMAGE. # -SUBDIR = gpiobus gpioiic gpioled gpiopps +SUBDIR = gpiobus gpioiic gpioled gpiopps gpiospi .include From owner-svn-src-head@freebsd.org Fri May 27 02:35:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 973ADB4B6C8; Fri, 27 May 2016 02:35:36 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 6AE7A17DD; Fri, 27 May 2016 02:35:36 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 0D7F8D81E; Fri, 27 May 2016 02:35:35 +0000 (UTC) Subject: Re: svn commit: r300773 - in head/sys: crypto crypto/aesni crypto/sha2 crypto/siphash kern sys To: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605261929.u4QJTTV5085421@repo.freebsd.org> Cc: "gjb >> Glen Barber" From: Allan Jude Message-ID: <0f2c3d10-d2dd-3f76-982f-91fbeeb5f3db@freebsd.org> Date: Thu, 26 May 2016 22:35:34 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605261929.u4QJTTV5085421@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 02:35:36 -0000 On 2016-05-26 15:29, Conrad E. Meyer wrote: > Author: cem > Date: Thu May 26 19:29:29 2016 > New Revision: 300773 > URL: https://svnweb.freebsd.org/changeset/base/300773 > > Log: > crypto routines: Hint minimum buffer sizes to the compiler > > Use the C99 'static' keyword to hint to the compiler IVs and output digest > sizes. The keyword informs the compiler of the minimum valid size for a given > array. Obviously not every pointer can be validated (i.e., the compiler can > produce false negative but not false positive reports). > > No functional change. No ABI change. > > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/crypto/aesni/aesni.h > head/sys/crypto/aesni/aesni_wrap.c > head/sys/crypto/sha1.c > head/sys/crypto/sha1.h > head/sys/crypto/sha2/sha256.h > head/sys/crypto/sha2/sha256c.c > head/sys/crypto/sha2/sha384.h > head/sys/crypto/sha2/sha512.h > head/sys/crypto/sha2/sha512c.c > head/sys/crypto/siphash/siphash.c > head/sys/crypto/siphash/siphash.h > head/sys/kern/md4c.c > head/sys/kern/md5c.c > head/sys/sys/md4.h > head/sys/sys/md5.h > > Modified: head/sys/sys/md5.h > ============================================================================== > --- head/sys/sys/md5.h Thu May 26 19:17:51 2016 (r300772) > +++ head/sys/sys/md5.h Thu May 26 19:29:29 2016 (r300773) > @@ -44,10 +44,6 @@ typedef struct MD5Context { > __BEGIN_DECLS > void MD5Init (MD5_CTX *); > void MD5Update (MD5_CTX *, const void *, unsigned int); > -void MD5Final (unsigned char [16], MD5_CTX *); > -char * MD5End(MD5_CTX *, char *); > -char * MD5File(const char *, char *); > -char * MD5FileChunk(const char *, char *, off_t, off_t); > -char * MD5Data(const void *, unsigned int, char *); > +void MD5Final (unsigned char[static MD5_DIGEST_LENGTH], MD5_CTX *); > __END_DECLS > #endif /* _SYS_MD5_H_ */ > This seems to have broken on sparc64, and other gcc based arches: ===> lib/libc (obj,all,install) In file included from /usr/src/lib/libc/../libmd/md5.h:40, from /usr/src/lib/libc/../libmd/md5c.c:42: /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/sys/md5.h:47: error: static or type qualifiers in abstract declarator --- md5c.o --- *** [md5c.o] Error code 1 -- Allan Jude From owner-svn-src-head@freebsd.org Fri May 27 03:04:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61611B4BBE1; Fri, 27 May 2016 03:04:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com [IPv6:2607:f8b0:400d:c04::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 041F4189B; Fri, 27 May 2016 03:04:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qg0-x232.google.com with SMTP id q32so45736134qgq.3; Thu, 26 May 2016 20:04:56 -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; bh=UVSYh5lK8m1cFCAinMNL2Worsg0tH1K9ZJUhuUq6kPI=; b=VQ4dbKl+ReQF2m67/PFzF4+ElIdCBNFlYOXzsdc/qPZv6LG2Fun5XDcmdfLTugVXjF Qq9zRkTWE324FPcXksoKqWRa6AkWZUZ7OIOrPmo+qXrt5hUhTLgB2yYZgnquvqlQKzVn KH7hxGkzLstX7Ho4VgLlQm4kFSuozbVqQmPzu+lWApt9N3CyrNxflGG6vDb49WShdXG1 ASya77wzxgL9NfhXJXhOTgX+USHqXWSN8p/7Fk+liBcCEtveno90rRarfeRL2RtXGTKv gtjKYQYgdvY4dHUe4f1O3kSVbJFevjWgpIMYnK4FmH0LGWX3dl69EV6ldR8xOtyN3vxT a33Q== 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; bh=UVSYh5lK8m1cFCAinMNL2Worsg0tH1K9ZJUhuUq6kPI=; b=KulrzEoZcbntP5P+CKRQymKfXnu/vow06E591hP52eo2ZOPIjGFVbHVB5YLhIZPzHx iep3VkrtfL8gHF8YWCwmPYVEOGAp24OjegUP6cORjTqHscOr93DaIXeUtLXj3fQlDzF+ pMe9yAX9bVXXnpW0JLnzR3OOMiY11wBG6s1ZN1OzYxSS5T1gheTlWqFB5TkE2LwmB54B Cf7Lj0srjslwNdiv0IXGBkkULCcaQZixg7NQkZzIVaNaVyioFJurZ0XW446HmSKPWJin RGc37DZUvXtHjEkniAxeBuvEUQ0zcsAIkDAPLscQJsZeUebWqy9s3PKULShJ5IA71IAi NDYw== X-Gm-Message-State: ALyK8tL5Bfg+SXKmQ0t9ZPBQGfKpcZT48vogCMEXrLt+AmAitMrOtOJLrSeeeJ3QxFskel64/ek92yACpGhk+g== MIME-Version: 1.0 X-Received: by 10.140.153.135 with SMTP id 129mr11940389qhz.71.1464318296210; Thu, 26 May 2016 20:04:56 -0700 (PDT) Received: by 10.55.170.146 with HTTP; Thu, 26 May 2016 20:04:56 -0700 (PDT) In-Reply-To: <0f2c3d10-d2dd-3f76-982f-91fbeeb5f3db@freebsd.org> References: <201605261929.u4QJTTV5085421@repo.freebsd.org> <0f2c3d10-d2dd-3f76-982f-91fbeeb5f3db@freebsd.org> Date: Thu, 26 May 2016 20:04:56 -0700 Message-ID: Subject: Re: svn commit: r300773 - in head/sys: crypto crypto/aesni crypto/sha2 crypto/siphash kern sys From: Ngie Cooper To: Allan Jude Cc: "Conrad E. Meyer" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "gjb >> Glen Barber" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 03:04:57 -0000 On Thu, May 26, 2016 at 7:35 PM, Allan Jude wrote: > On 2016-05-26 15:29, Conrad E. Meyer wrote: >> Author: cem >> Date: Thu May 26 19:29:29 2016 >> New Revision: 300773 >> URL: https://svnweb.freebsd.org/changeset/base/300773 >> >> Log: >> crypto routines: Hint minimum buffer sizes to the compiler >> >> Use the C99 'static' keyword to hint to the compiler IVs and output digest >> sizes. The keyword informs the compiler of the minimum valid size for a given >> array. Obviously not every pointer can be validated (i.e., the compiler can >> produce false negative but not false positive reports). >> >> No functional change. No ABI change. >> >> Sponsored by: EMC / Isilon Storage Division ... > This seems to have broken on sparc64, and other gcc based arches: > > ===> lib/libc (obj,all,install) > In file included from /usr/src/lib/libc/../libmd/md5.h:40, > from /usr/src/lib/libc/../libmd/md5c.c:42: > /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/sys/md5.h:47: > error: static or type qualifiers in abstract declarator > --- md5c.o --- > *** [md5c.o] Error code 1 I was wondering about that in the original commit. It might be a good idea to revert both commits and reintroduce them with another keyword (i.e. __static, or something in sys/cdefs.h ) Thanks, -Ngie From owner-svn-src-head@freebsd.org Fri May 27 03:07:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55640B4BC53; Fri, 27 May 2016 03:07:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 369061A98; Fri, 27 May 2016 03:07:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id C6BDD1BAC; Fri, 27 May 2016 03:07:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Fri, 27 May 2016 03:07:11 +0000 From: Glen Barber To: Ngie Cooper Cc: Allan Jude , "Conrad E. Meyer" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r300773 - in head/sys: crypto crypto/aesni crypto/sha2 crypto/siphash kern sys Message-ID: <20160527030711.GZ3335@FreeBSD.org> References: <201605261929.u4QJTTV5085421@repo.freebsd.org> <0f2c3d10-d2dd-3f76-982f-91fbeeb5f3db@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qJ1PC0yZrEAstpRC" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 03:07:13 -0000 --qJ1PC0yZrEAstpRC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 26, 2016 at 08:04:56PM -0700, Ngie Cooper wrote: > On Thu, May 26, 2016 at 7:35 PM, Allan Jude wrote: > > On 2016-05-26 15:29, Conrad E. Meyer wrote: > >> Author: cem > >> Date: Thu May 26 19:29:29 2016 > >> New Revision: 300773 > >> URL: https://svnweb.freebsd.org/changeset/base/300773 > >> > >> Log: > >> crypto routines: Hint minimum buffer sizes to the compiler > >> > >> Use the C99 'static' keyword to hint to the compiler IVs and output = digest > >> sizes. The keyword informs the compiler of the minimum valid size f= or a given > >> array. Obviously not every pointer can be validated (i.e., the comp= iler can > >> produce false negative but not false positive reports). > >> > >> No functional change. No ABI change. > >> > >> Sponsored by: EMC / Isilon Storage Division >=20 > ... >=20 > > This seems to have broken on sparc64, and other gcc based arches: > > > > =3D=3D=3D> lib/libc (obj,all,install) > > In file included from /usr/src/lib/libc/../libmd/md5.h:40, > > from /usr/src/lib/libc/../libmd/md5c.c:42: > > /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/sys/md5.h:47: > > error: static or type qualifiers in abstract declarator > > --- md5c.o --- > > *** [md5c.o] Error code 1 >=20 > I was wondering about that in the original commit. It might be a good > idea to revert both commits and reintroduce them with another keyword > (i.e. __static, or something in sys/cdefs.h ) > Thanks, >=20 Conrad is working on a fix for gcc at the moment. I'll be patiently impatient long enough to see how quickly this can be properly fixed. FWIW. Glen --qJ1PC0yZrEAstpRC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXR7nfAAoJEAMUWKVHj+KTxLgP/0bn7Ek153TAdQCJ0LH4r6fu xjII2BGx/qYRLNbt5ESWDLxFyzjGjk9X76H+v/oKBmI12rOnqFxFhHflur4c4jpD X9VTHnQ7r9cGK5SY5Gh3Pvra8zoCDfSWREVVbrrOyEb2nvdnUeKbJt5qSMvECfSu kmanLtBWOTt79HQNlujIpX4TIESrcHH4eJB7YFI5N+5zfarKyWE/YZ76fGigbYez qLCUqdcF8KjMpindUQ5ujdtTU8mS5n1LuCySssDmJmoSplB/taO7OPzMZvorh5Io uTkACG/CTZYXwCt9ThdwatYtYJjnMUi1VXhfdn5GkB5yjqEVOz5/wk8Qh+m8aejs gqIarJBMTtiGztqGg/Wcf20SkCaogBmxSpPv8lStsnBgFfKbMIKOg8IkaBn0jAs8 FJjEMgWH5UXZsSTN7seR9d7W8HCoGj+RiZvyGSCILCxi6Np8SArAgdIjF82SUtn4 lej9tso3h8pLA5YT+6RTlYhPCTwRr7PGq/4ShSNSSkaZwyVrqV1pFZMWvA9h4uS4 yS+8helX3GnRtJHcCRX8S8+F5vPPUT3Jy6XF6y0XVl/GWMJhflqu9aYonIhkdmLm kTwehkicvB7XMJM+qd2os8KZIT8VlKHzaxqVU1rAxWhr9oZrec7iNUvToCnAwAtL vz6B+gA+iqpsVtQhP68H =0tn1 -----END PGP SIGNATURE----- --qJ1PC0yZrEAstpRC-- From owner-svn-src-head@freebsd.org Fri May 27 03:30:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B81D5B4C2D8; Fri, 27 May 2016 03:30:43 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 759E81A84; Fri, 27 May 2016 03:30:43 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R3UgJm061938; Fri, 27 May 2016 03:30:42 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R3UgFb061936; Fri, 27 May 2016 03:30:42 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201605270330.u4R3UgFb061936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 27 May 2016 03:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300821 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 03:30:43 -0000 Author: kevlo Date: Fri May 27 03:30:42 2016 New Revision: 300821 URL: https://svnweb.freebsd.org/changeset/base/300821 Log: Add rtwn(4) and rtwnfw(4). Modified: head/sys/conf/NOTES head/sys/conf/files Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 27 02:43:46 2016 (r300820) +++ head/sys/conf/NOTES Fri May 27 03:30:42 2016 (r300821) @@ -2013,6 +2013,8 @@ device xmphy # XaQti XMAC II # the MPX 5030/5038, which is either a RealTek in disguise or a # RealTek workalike. Note that the D-Link DFE-530TX+ uses the RealTek # chipset and is supported by this driver, not the 'vr' driver. +# rtwn: RealTek wireless adapters. +# rtwnfw: RealTek wireless firmware. # sf: Support for Adaptec Duralink PCI fast ethernet adapters based on the # Adaptec AIC-6915 "starfire" controller. # This includes dual and quad port cards, as well as one 100baseFX card. @@ -2184,6 +2186,8 @@ device malo # Marvell Libertas wireles device mwl # Marvell 88W8363 802.11n wireless NICs. device mwlfw device ral # Ralink Technology RT2500 wireless NICs. +device rtwn # Realtek wireless NICs +device rtwnfw # Use sf_buf(9) interface for jumbo buffers on ti(4) controllers. #options TI_SF_BUF_JUMBO Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 27 02:43:46 2016 (r300820) +++ head/sys/conf/files Fri May 27 03:30:42 2016 (r300821) @@ -2432,6 +2432,35 @@ dev/rndtest/rndtest.c optional rndtest dev/rp/rp.c optional rp dev/rp/rp_isa.c optional rp isa dev/rp/rp_pci.c optional rp pci +dev/rtwn/if_rtwn.c optional rtwn +rtwn-rtl8192cfwU.c optional rtwn-rtl8192cfwU | rtwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8192cfwU.fw:rtwn-rtl8192cfwU:111 -mrtwn-rtl8192cfwU -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "rtwn-rtl8192cfwU.c" +rtwn-rtl8192cfwU.fwo optional rtwn-rtl8192cfwU | rtwnfw \ + dependency "rtwn-rtl8192cfwU.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "rtwn-rtl8192cfwU.fwo" +rtwn-rtl8192cfwU.fw optional rtwn-rtl8192cfwU | rtwnfw \ + dependency "$S/contrib/dev/rtwn/rtwn-rtl8192cfwU.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "rtwn-rtl8192cfwU.fw" +rtwn-rtl8192cfwU_B.c optional rtwn-rtl8192cfwU_B | rtwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8192cfwU_B.fw:rtwn-rtl8192cfwU_B:111 -mrtwn-rtl8192cfwU_B -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "rtwn-rtl8192cfwU_B.c" +rtwn-rtl8192cfwU_B.fwo optional rtwn-rtl8192cfwU_B | rtwnfw \ + dependency "rtwn-rtl8192cfwU_B.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "rtwn-rtl8192cfwU_B.fwo" +rtwn-rtl8192cfwU_B.fw optional rtwn-rtl8192cfwU_B | rtwnfw \ + dependency "$S/contrib/dev/rtwn/rtwn-rtl8192cfwU_B.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "rtwn-rtl8192cfwU_B.fw" dev/safe/safe.c optional safe dev/scc/scc_if.m optional scc dev/scc/scc_bfe_ebus.c optional scc ebus From owner-svn-src-head@freebsd.org Fri May 27 03:40:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0607B4C542; Fri, 27 May 2016 03:40:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 851CF108B; Fri, 27 May 2016 03:40:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R3eqkt067839; Fri, 27 May 2016 03:40:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R3eqE5067837; Fri, 27 May 2016 03:40:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605270340.u4R3eqE5067837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 27 May 2016 03:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300822 - in head: contrib/gcc gnu/usr.bin/cc/cc_tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 03:40:53 -0000 Author: cem Date: Fri May 27 03:40:52 2016 New Revision: 300822 URL: https://svnweb.freebsd.org/changeset/base/300822 Log: gcc42: Fix minor C99 parse bug DR #289[0] came down and gcc4.2.1 was on the wrong side of history. Partially revert GCC r42574 (just remove the error) to rectify the parse bug to match Clang and other compliant C99 compilers. An example declaration gcc tripped on before this fix: void foobar(int [static 1]); An example declaration gcc did not trip on before this fix: void foobar(int name[static 1]); Bump __FreeBSD_cc_version. [0]: http://www.open-std.org/JTC1/SC22/WG14/www/docs/dr_289.htm Reported by: allanjude Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/gcc/c-decl.c head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Modified: head/contrib/gcc/c-decl.c ============================================================================== --- head/contrib/gcc/c-decl.c Fri May 27 03:30:42 2016 (r300821) +++ head/contrib/gcc/c-decl.c Fri May 27 03:40:52 2016 (r300822) @@ -3150,20 +3150,14 @@ build_array_declarator (tree expr, struc /* Set the contained declarator of an array declarator. DECL is the declarator, as constructed by build_array_declarator; INNER is what - appears on the left of the []. ABSTRACT_P is true if it is an - abstract declarator, false otherwise; this is used to reject static - and type qualifiers in abstract declarators, where they are not in - the C99 grammar (subject to possible change in DR#289). */ + appears on the left of the []. */ struct c_declarator * set_array_declarator_inner (struct c_declarator *decl, - struct c_declarator *inner, bool abstract_p) + struct c_declarator *inner, + bool abstract_p __attribute__ ((__unused__))) { decl->declarator = inner; - if (abstract_p && (decl->u.array.quals != TYPE_UNQUALIFIED - || decl->u.array.attrs != NULL_TREE - || decl->u.array.static_p)) - error ("static or type qualifiers in abstract declarator"); return decl; } Modified: head/gnu/usr.bin/cc/cc_tools/freebsd-native.h ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Fri May 27 03:30:42 2016 (r300821) +++ head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Fri May 27 03:40:52 2016 (r300822) @@ -8,7 +8,7 @@ /* Fake out gcc/config/freebsd.h. */ #define FBSD_MAJOR 11 -#define FBSD_CC_VER 1100001 /* form like __FreeBSD_version */ +#define FBSD_CC_VER 1100002 /* form like __FreeBSD_version */ #undef SYSTEM_INCLUDE_DIR /* We don't need one for now. */ #undef TOOL_INCLUDE_DIR /* We don't need one for now. */ From owner-svn-src-head@freebsd.org Fri May 27 04:05:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB8FCB4C9E7; Fri, 27 May 2016 04:05:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B6B651D64; Fri, 27 May 2016 04:05:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id AB1381B40; Fri, 27 May 2016 04:05:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 5A25B1CA64; Fri, 27 May 2016 04:05:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id wL241aI38-jB; Fri, 27 May 2016 04:05:28 +0000 (UTC) Subject: Re: svn commit: r300822 - in head: contrib/gcc gnu/usr.bin/cc/cc_tools DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 621631CA5C To: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605270340.u4R3eqE5067837@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <3ba73e53-c70c-7edf-0239-519825a4fc1d@FreeBSD.org> Date: Thu, 26 May 2016 21:05:26 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605270340.u4R3eqE5067837@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="l3RThOkIPmTPrgMig0qw3UQMDXNRNn5uj" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 04:05:33 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --l3RThOkIPmTPrgMig0qw3UQMDXNRNn5uj Content-Type: multipart/mixed; boundary="7VWlGn23bm5xLUGSfFLVXn5tuA43BDQ9Q" From: Bryan Drewery To: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <3ba73e53-c70c-7edf-0239-519825a4fc1d@FreeBSD.org> Subject: Re: svn commit: r300822 - in head: contrib/gcc gnu/usr.bin/cc/cc_tools References: <201605270340.u4R3eqE5067837@repo.freebsd.org> In-Reply-To: <201605270340.u4R3eqE5067837@repo.freebsd.org> --7VWlGn23bm5xLUGSfFLVXn5tuA43BDQ9Q Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/26/2016 8:40 PM, Conrad E. Meyer wrote: > Bump __FreeBSD_cc_version. Thanks! --=20 Regards, Bryan Drewery --7VWlGn23bm5xLUGSfFLVXn5tuA43BDQ9Q-- --l3RThOkIPmTPrgMig0qw3UQMDXNRNn5uj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXR8eLAAoJEDXXcbtuRpfPtAgH/RVpkR7Df6gs1KcYZaPLvsay xplWEfRGeKPnbxXoxmnEFU9UEUUDCe1Pm7osS0nUr8x02+kHoOsGh4POmPd2LSML YMdLzW3CWPFDd5zjn4VVQDezY7KMZsvhLNaq2N7qtmw1MdaeBmobH+3cvYRdt1S0 fMEl6K7dfYTIln6U2u5EYwlvoUnIe1/+Ji743pTgwJ/l4QfryXV1+MUDl0uVrtkM J1qsOGOcDPl1tzVqxHtanrTzn+tSRIPd/5LfvJdeyScgBnC9qS6G7Y5gy/xCs40E /rSnU++gfMjRFPzpbjCX4Cq7kcMIvEXJtuiRJTlWi2ZSj2V+AKmVbym4/mVykbE= =SyfO -----END PGP SIGNATURE----- --l3RThOkIPmTPrgMig0qw3UQMDXNRNn5uj-- From owner-svn-src-head@freebsd.org Fri May 27 04:34:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F849B461A6; Fri, 27 May 2016 04:34:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1EC61CBC; Fri, 27 May 2016 04:34:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R4Yhl7087172; Fri, 27 May 2016 04:34:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R4Yg7Z087165; Fri, 27 May 2016 04:34:42 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605270434.u4R4Yg7Z087165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 27 May 2016 04:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300823 - in head/sys/modules/gpio: gpiobus gpioiic gpioled gpiopps gpiospi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 04:34:44 -0000 Author: ian Date: Fri May 27 04:34:42 2016 New Revision: 300823 URL: https://svnweb.freebsd.org/changeset/base/300823 Log: Fix parallel builds by specifying *all* required headers in SRCS. Submitted by: manu Pointy hat: ian Modified: head/sys/modules/gpio/gpiobus/Makefile head/sys/modules/gpio/gpioiic/Makefile head/sys/modules/gpio/gpioled/Makefile head/sys/modules/gpio/gpiopps/Makefile head/sys/modules/gpio/gpiospi/Makefile Modified: head/sys/modules/gpio/gpiobus/Makefile ============================================================================== --- head/sys/modules/gpio/gpiobus/Makefile Fri May 27 03:40:52 2016 (r300822) +++ head/sys/modules/gpio/gpiobus/Makefile Fri May 27 04:34:42 2016 (r300823) @@ -33,7 +33,7 @@ KMOD= gpiobus SRCS= gpiobus.c gpioc.c -SRCS+= gpio_if.c gpio_if.h gpiobus_if.c gpiobus_if.h +SRCS+= gpio_if.c gpio_if.h gpiobus_if.c gpiobus_if.h ofw_bus_if.h SRCS+= device_if.h bus_if.h opt_platform.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ Modified: head/sys/modules/gpio/gpioiic/Makefile ============================================================================== --- head/sys/modules/gpio/gpioiic/Makefile Fri May 27 03:40:52 2016 (r300822) +++ head/sys/modules/gpio/gpioiic/Makefile Fri May 27 04:34:42 2016 (r300823) @@ -34,7 +34,7 @@ KMOD= gpioiic SRCS= gpioiic.c SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h iicbus_if.h iicbb_if.h -SRCS+= opt_platform.h +SRCS+= ofw_bus_if.h opt_platform.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ Modified: head/sys/modules/gpio/gpioled/Makefile ============================================================================== --- head/sys/modules/gpio/gpioled/Makefile Fri May 27 03:40:52 2016 (r300822) +++ head/sys/modules/gpio/gpioled/Makefile Fri May 27 04:34:42 2016 (r300823) @@ -33,7 +33,7 @@ KMOD= gpioled SRCS= gpioled.c -SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h +SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h ofw_bus_if.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ Modified: head/sys/modules/gpio/gpiopps/Makefile ============================================================================== --- head/sys/modules/gpio/gpiopps/Makefile Fri May 27 03:40:52 2016 (r300822) +++ head/sys/modules/gpio/gpiopps/Makefile Fri May 27 04:34:42 2016 (r300823) @@ -33,7 +33,7 @@ KMOD= gpiopps SRCS= gpiopps.c -SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h +SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h ofw_bus_if.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ Modified: head/sys/modules/gpio/gpiospi/Makefile ============================================================================== --- head/sys/modules/gpio/gpiospi/Makefile Fri May 27 03:40:52 2016 (r300822) +++ head/sys/modules/gpio/gpiospi/Makefile Fri May 27 04:34:42 2016 (r300823) @@ -34,7 +34,7 @@ KMOD= gpiospi SRCS= gpiospi.c SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h spibus_if.h -SRCS+= opt_gpio.h +SRCS+= ofw_bus_if.h opt_gpio.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ From owner-svn-src-head@freebsd.org Fri May 27 05:21:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA683B46BAD; Fri, 27 May 2016 05:21:09 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 763401FC0; Fri, 27 May 2016 05:21:09 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io0-x230.google.com with SMTP id p64so25111288ioi.2; Thu, 26 May 2016 22:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=6XRqYZUUKdHS1o2DRVbkko8lm9iLuw76UiyvR9Z4FR8=; b=G4gGh+QjwU80wpzkiFcZuvrUHHFPp3Z9J5OL6/kAVwP24WarqG7+qNaS8jYA6LOgEe 3EzoWv+MbToCBB9WOcs7FdJAYj+whgNLaSpl8rrhqBmf/dPNGVEwggW5NdCff8mlr4Wi CGwK6jPC7NRW2CGyPdFBePzjhV34utOJE97k5f4iJirDCOPe3VWLKGbeZ7JkITfmXifN Ke4TIL4wJwe+J2Es5tanThfxT4X5f16HPGRp5uVzsWzqZCwZ8gQqJLiwhGL5ac/YsPyY eodgOFPzRQJcuWnR45eH72sU9FVV6XtymnUAOzzappco3u+uPqAf/jO7NHXxz6xkv8qE Lsmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=6XRqYZUUKdHS1o2DRVbkko8lm9iLuw76UiyvR9Z4FR8=; b=i0zlnzk324JG3Sy4s13+nroYvjQzD9FdhPJgJ8C99YFSDpTDXhe63SpipfIKKnqAkN k5/JMWQ5lbSQNWrNq6RDLEnJHJ+wtv75tqA/pHkF4RGIVeHH9ctsVZC91duNRnI8+FyS JlkS2eaN7sXm5ZjG3NM5nSG1+E4awJTAuq0JE0idq3HeUhfp4JRDl9DriIwQUzQJ7krO s29mir9OjBT5Jj/CNg6X/iPm0b5/YesWUCGzXWQ28J7OgL9W+I/YKzHPz8vqddpXUYhz LRx0OUlwoAWOBWqW1acRv5foWZmnm9M/IU/FcQyBHDLuEST01PTPivrDKrxA/aFjIEtU ypGg== X-Gm-Message-State: ALyK8tIXsruJ6kYWyUVlgxyyRoFIhvMZZuNDFxJWD4KI3o2n/q/3XrtixKc1iZZDzsPgqdFhm1DfUgZsGl58vA== MIME-Version: 1.0 X-Received: by 10.107.8.142 with SMTP id h14mr12070913ioi.95.1464326468775; Thu, 26 May 2016 22:21:08 -0700 (PDT) Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.179.6 with HTTP; Thu, 26 May 2016 22:21:08 -0700 (PDT) In-Reply-To: <201605261929.u4QJTTV5085421@repo.freebsd.org> References: <201605261929.u4QJTTV5085421@repo.freebsd.org> Date: Fri, 27 May 2016 07:21:08 +0200 X-Google-Sender-Auth: qSlJg5VwiDCCN29J6NYfpi_YnQM Message-ID: Subject: Re: svn commit: r300773 - in head/sys: crypto crypto/aesni crypto/sha2 crypto/siphash kern sys From: Antoine Brodin To: "Conrad E. Meyer" Cc: 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 05:21:09 -0000 On Thu, May 26, 2016 at 9:29 PM, Conrad E. Meyer wrote: > Author: cem > Date: Thu May 26 19:29:29 2016 > New Revision: 300773 > URL: https://svnweb.freebsd.org/changeset/base/300773 > > Log: > crypto routines: Hint minimum buffer sizes to the compiler > > Use the C99 'static' keyword to hint to the compiler IVs and output digest > sizes. The keyword informs the compiler of the minimum valid size for a given > array. Obviously not every pointer can be validated (i.e., the compiler can > produce false negative but not false positive reports). > > No functional change. No ABI change. > > Sponsored by: EMC / Isilon Storage Division This breaks some ports: http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p415919_s300812/logs/errors/x265-1.9.log Cheers, Antoine From owner-svn-src-head@freebsd.org Fri May 27 05:31:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FC41B46DB3; Fri, 27 May 2016 05:31:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26CA0139A; Fri, 27 May 2016 05:31:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R5VEB1006891; Fri, 27 May 2016 05:31:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R5VE6R006890; Fri, 27 May 2016 05:31:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605270531.u4R5VE6R006890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 27 May 2016 05:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300824 - head/lib/libmd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 05:31:15 -0000 Author: cem Date: Fri May 27 05:31:14 2016 New Revision: 300824 URL: https://svnweb.freebsd.org/changeset/base/300824 Log: libmd: Work around C++'s inability to understand C Reported by: antoine@ (x265) Modified: head/lib/libmd/md5.h Modified: head/lib/libmd/md5.h ============================================================================== --- head/lib/libmd/md5.h Fri May 27 04:34:42 2016 (r300823) +++ head/lib/libmd/md5.h Fri May 27 05:31:14 2016 (r300824) @@ -37,5 +37,13 @@ #endif +#ifdef __cplusplus +#define static +#endif + #include + +#ifdef __cplusplus +#undef static +#endif #endif /* _MD5_H_ */ From owner-svn-src-head@freebsd.org Fri May 27 05:58:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18697B4C3DA; Fri, 27 May 2016 05:58:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3FFC1292; Fri, 27 May 2016 05:58:54 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R5wsDs016548; Fri, 27 May 2016 05:58:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R5wrAU016545; Fri, 27 May 2016 05:58:53 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605270558.u4R5wrAU016545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 27 May 2016 05:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300825 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 05:58:55 -0000 Author: sephe Date: Fri May 27 05:58:53 2016 New Revision: 300825 URL: https://svnweb.freebsd.org/changeset/base/300825 Log: hyperv: Move CPUID related bits to hyperv_reg.h and give them clean name MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6565 Modified: head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/hyperv_reg.h Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Fri May 27 05:31:14 2016 (r300824) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Fri May 27 05:58:53 2016 (r300825) @@ -50,8 +50,6 @@ __FBSDID("$FreeBSD$"); #define HV_NANOSECONDS_PER_SEC 1000000000L -#define HYPERV_INTERFACE 0x31237648 /* HV#1 */ - #define HYPERV_FREEBSD_BUILD 0ULL #define HYPERV_FREEBSD_VERSION ((uint64_t)__FreeBSD_version) #define HYPERV_FREEBSD_OSID 0ULL @@ -204,26 +202,22 @@ static bool hyperv_identify(void) { u_int regs[4]; - unsigned int maxLeaf; - unsigned int op; + unsigned int maxleaf; if (vm_guest != VM_GUEST_HV) return (false); - op = HV_CPU_ID_FUNCTION_HV_VENDOR_AND_MAX_FUNCTION; - do_cpuid(op, regs); - maxLeaf = regs[0]; - if (maxLeaf < HV_CPU_ID_FUNCTION_MS_HV_IMPLEMENTATION_LIMITS) + do_cpuid(CPUID_LEAF_HV_MAXLEAF, regs); + maxleaf = regs[0]; + if (maxleaf < CPUID_LEAF_HV_LIMITS) return (false); - op = HV_CPU_ID_FUNCTION_HV_INTERFACE; - do_cpuid(op, regs); - if (regs[0] != HYPERV_INTERFACE) + do_cpuid(CPUID_LEAF_HV_INTERFACE, regs); + if (regs[0] != CPUID_HV_IFACE_HYPERV) return (false); - op = HV_CPU_ID_FUNCTION_MS_HV_FEATURES; - do_cpuid(op, regs); - if ((regs[0] & HV_FEATURE_MSR_HYPERCALL) == 0) { + do_cpuid(CPUID_LEAF_HV_FEATURES, regs); + if ((regs[0] & CPUID_HV_MSR_HYPERCALL) == 0) { /* * Hyper-V w/o Hypercall is impossible; someone * is faking Hyper-V. @@ -234,31 +228,30 @@ hyperv_identify(void) hyperv_pm_features = regs[2]; hyperv_features3 = regs[3]; - op = HV_CPU_ID_FUNCTION_MS_HV_VERSION; - do_cpuid(op, regs); + do_cpuid(CPUID_LEAF_HV_IDENTITY, regs); printf("Hyper-V Version: %d.%d.%d [SP%d]\n", regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); printf(" Features=0x%b\n", hyperv_features, "\020" - "\001VPRUNTIME" /* MSR_VP_RUNTIME */ - "\002TMREFCNT" /* MSR_TIME_REF_COUNT */ + "\001VPRUNTIME" /* MSR_HV_VP_RUNTIME */ + "\002TMREFCNT" /* MSR_HV_TIME_REF_COUNT */ "\003SYNIC" /* MSRs for SynIC */ "\004SYNTM" /* MSRs for SynTimer */ - "\005APIC" /* MSR_{EOI,ICR,TPR} */ - "\006HYPERCALL" /* MSR_{GUEST_OS_ID,HYPERCALL} */ - "\007VPINDEX" /* MSR_VP_INDEX */ - "\010RESET" /* MSR_RESET */ - "\011STATS" /* MSR_STATS_ */ - "\012REFTSC" /* MSR_REFERENCE_TSC */ - "\013IDLE" /* MSR_GUEST_IDLE */ - "\014TMFREQ" /* MSR_{TSC,APIC}_FREQUENCY */ - "\015DEBUG"); /* MSR_SYNTH_DEBUG_ */ - printf(" PM Features=max C%u, 0x%b\n", - HV_PM_FEATURE_CSTATE(hyperv_pm_features), - (hyperv_pm_features & ~HV_PM_FEATURE_CSTATE_MASK), + "\005APIC" /* MSR_HV_{EOI,ICR,TPR} */ + "\006HYPERCALL" /* MSR_HV_{GUEST_OS_ID,HYPERCALL} */ + "\007VPINDEX" /* MSR_HV_VP_INDEX */ + "\010RESET" /* MSR_HV_RESET */ + "\011STATS" /* MSR_HV_STATS_ */ + "\012REFTSC" /* MSR_HV_REFERENCE_TSC */ + "\013IDLE" /* MSR_HV_GUEST_IDLE */ + "\014TMFREQ" /* MSR_HV_{TSC,APIC}_FREQUENCY */ + "\015DEBUG"); /* MSR_HV_SYNTH_DEBUG_ */ + printf(" PM Features=0x%b [C%u]\n", + (hyperv_pm_features & ~CPUPM_HV_CSTATE_MASK), "\020" - "\005C3HPET"); /* HPET is required for C3 state */ + "\005C3HPET", /* HPET is required for C3 state */ + CPUPM_HV_CSTATE(hyperv_pm_features)); printf(" Features3=0x%b\n", hyperv_features3, "\020" "\001MWAIT" /* MWAIT */ @@ -276,24 +269,21 @@ hyperv_identify(void) "\015NPIEP" /* NPIEP */ "\016HVDIS"); /* disabling hypervisor */ - op = HV_CPU_ID_FUNCTION_MS_HV_ENLIGHTENMENT_INFORMATION; - do_cpuid(op, regs); + do_cpuid(CPUID_LEAF_HV_RECOMMENDS, regs); hyperv_recommends = regs[0]; if (bootverbose) printf(" Recommends: %08x %08x\n", regs[0], regs[1]); - op = HV_CPU_ID_FUNCTION_MS_HV_IMPLEMENTATION_LIMITS; - do_cpuid(op, regs); + do_cpuid(CPUID_LEAF_HV_LIMITS, regs); if (bootverbose) { printf(" Limits: Vcpu:%d Lcpu:%d Int:%d\n", regs[0], regs[1], regs[2]); } - if (maxLeaf >= HV_CPU_ID_FUNCTION_MS_HV_HARDWARE_FEATURE) { - op = HV_CPU_ID_FUNCTION_MS_HV_HARDWARE_FEATURE; - do_cpuid(op, regs); + if (maxleaf >= CPUID_LEAF_HV_HWFEATURES) { + do_cpuid(CPUID_LEAF_HV_HWFEATURES, regs); if (bootverbose) { - printf(" HW Features: %08x AMD: %08x\n", + printf(" HW Features: %08x, AMD: %08x\n", regs[0], regs[3]); } } @@ -314,7 +304,7 @@ hyperv_init(void *dummy __unused) /* Set guest id */ wrmsr(MSR_HV_GUEST_OS_ID, MSR_HV_GUESTID_FREEBSD); - if (hyperv_features & HV_FEATURE_MSR_TIME_REFCNT) { + if (hyperv_features & CPUID_HV_MSR_TIME_REFCNT) { /* Register virtual timecount */ tc_init(&hv_timecounter); } Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Fri May 27 05:31:14 2016 (r300824) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Fri May 27 05:58:53 2016 (r300825) @@ -443,43 +443,6 @@ typedef struct { } hv_vmbus_monitor_page; /* - * The below CPUID leaves are present if VersionAndFeatures.HypervisorPresent - * is set by CPUID(HV_CPU_ID_FUNCTION_VERSION_AND_FEATURES). - */ -typedef enum { - HV_CPU_ID_FUNCTION_VERSION_AND_FEATURES = 0x00000001, - HV_CPU_ID_FUNCTION_HV_VENDOR_AND_MAX_FUNCTION = 0x40000000, - HV_CPU_ID_FUNCTION_HV_INTERFACE = 0x40000001, - /* - * The remaining functions depend on the value - * of hv_cpu_id_function_interface - */ - HV_CPU_ID_FUNCTION_MS_HV_VERSION = 0x40000002, - HV_CPU_ID_FUNCTION_MS_HV_FEATURES = 0x40000003, - HV_CPU_ID_FUNCTION_MS_HV_ENLIGHTENMENT_INFORMATION = 0x40000004, - HV_CPU_ID_FUNCTION_MS_HV_IMPLEMENTATION_LIMITS = 0x40000005, - HV_CPU_ID_FUNCTION_MS_HV_HARDWARE_FEATURE = 0x40000006 -} hv_vmbus_cpuid_function; - -#define HV_FEATURE_MSR_TIME_REFCNT 0x0002 /* MSR_TIME_REF_COUNT */ -#define HV_FEATURE_MSR_SYNIC 0x0004 /* MSRs for SynIC */ -#define HV_FEATURE_MSR_SYNTIMER 0x0008 /* MSRs for SynTimer */ -#define HV_FEATURE_MSR_APIC 0x0010 /* MSR_{EOI,ICR,TPR} */ -#define HV_FEATURE_MSR_HYPERCALL 0x0020 /* MSR_{GUEST_OS_ID,HYPERCALL} */ -#define HV_FEATURE_MSR_GUEST_IDLE 0x0400 /* MSR_GUEST_IDLE */ - -#define HV_PM_FEATURE_CSTATE_MASK 0x000f -#define HV_PM_FEATURE_C3_HPET 0x0010 /* C3 requires HPET */ -#define HV_PM_FEATURE_CSTATE(f) ((f) & HV_PM_FEATURE_CSTATE_MASK) - -#define HV_FEATURE3_MWAIT 0x0001 /* MWAIT */ -#define HV_FEATURE3_XMM_HYPERCALL 0x0010 /* hypercall input through XMM regs */ -#define HV_FEATURE3_GUEST_IDLE 0x0020 /* guest idle support */ -#define HV_FEATURE3_NUMA 0x0080 /* NUMA distance query support */ -#define HV_FEATURE3_TIME_FREQ 0x0100 /* timer frequency query (TSC, LAPIC) */ -#define HV_FEATURE3_MSR_CRASH 0x0400 /* MSRs for guest crash */ - -/* * Define the format of the SIMP register */ typedef union { Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv_reg.h Fri May 27 05:31:14 2016 (r300824) +++ head/sys/dev/hyperv/vmbus/hyperv_reg.h Fri May 27 05:58:53 2016 (r300825) @@ -29,6 +29,10 @@ #ifndef _HYPERV_REG_H_ #define _HYPERV_REG_H_ +/* + * Hyper-V Synthetic MSRs + */ + #define MSR_HV_GUEST_OS_ID 0x40000000 #define MSR_HV_GUESTID_BUILD_MASK 0xffffULL #define MSR_HV_GUESTID_VERSION_MASK 0x0000ffffffff0000ULL @@ -73,4 +77,42 @@ #define MSR_HV_SINT_RSVD_MASK (MSR_HV_SINT_RSVD1_MASK | \ MSR_HV_SINT_RSVD2_MASK) +/* + * CPUID leaves + */ + +#define CPUID_LEAF_HV_MAXLEAF 0x40000000 + +#define CPUID_LEAF_HV_INTERFACE 0x40000001 +#define CPUID_HV_IFACE_HYPERV 0x31237648 /* HV#1 */ + +#define CPUID_LEAF_HV_IDENTITY 0x40000002 + +#define CPUID_LEAF_HV_FEATURES 0x40000003 +/* EAX: features */ +#define CPUID_HV_MSR_TIME_REFCNT 0x0002 /* MSR_HV_TIME_REF_COUNT */ +#define CPUID_HV_MSR_SYNIC 0x0004 /* MSRs for SynIC */ +#define CPUID_HV_MSR_SYNTIMER 0x0008 /* MSRs for SynTimer */ +#define CPUID_HV_MSR_APIC 0x0010 /* MSR_HV_{EOI,ICR,TPR} */ +#define CPUID_HV_MSR_HYPERCALL 0x0020 /* MSR_HV_GUEST_OS_ID + * MSR_HV_HYPERCALL */ +#define CPUID_HV_MSR_GUEST_IDLE 0x0400 /* MSR_VH_GUEST_IDLE */ +/* ECX: power management features */ +#define CPUPM_HV_CSTATE_MASK 0x000f /* deepest C-state */ +#define CPUPM_HV_C3_HPET 0x0010 /* C3 requires HPET */ +#define CPUPM_HV_CSTATE(f) ((f) & CPUPM_HV_CSTATE_MASK) +/* EDX: features3 */ +#define CPUID3_HV_MWAIT 0x0001 /* MWAIT */ +#define CPUID3_HV_XMM_HYPERCALL 0x0010 /* Hypercall input through + * XMM regs */ +#define CPUID3_HV_GUEST_IDLE 0x0020 /* guest idle */ +#define CPUID3_HV_NUMA 0x0080 /* NUMA distance query */ +#define CPUID3_HV_TIME_FREQ 0x0100 /* timer frequency query + * (TSC, LAPIC) */ +#define CPUID3_HV_MSR_CRASH 0x0400 /* MSRs for guest crash */ + +#define CPUID_LEAF_HV_RECOMMENDS 0x40000004 +#define CPUID_LEAF_HV_LIMITS 0x40000005 +#define CPUID_LEAF_HV_HWFEATURES 0x40000006 + #endif /* !_HYPERV_REG_H_ */ From owner-svn-src-head@freebsd.org Fri May 27 06:05:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25A48B4C602; Fri, 27 May 2016 06:05:14 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD5C5194D; Fri, 27 May 2016 06:05:13 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R65CLu020003; Fri, 27 May 2016 06:05:12 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R65CNf020002; Fri, 27 May 2016 06:05:12 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201605270605.u4R65CNf020002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 27 May 2016 06:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300826 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 06:05:14 -0000 Author: alc Date: Fri May 27 06:05:12 2016 New Revision: 300826 URL: https://svnweb.freebsd.org/changeset/base/300826 Log: Use vm_page_replace_checked() instead of vm_page_rename() for implementing optimized copy-on-write faults. This has two advantages: (1) one less radix tree operation is performed and (2) vm_page_replace_checked() cannot fail, making the code simpler. Submitted by: Ryan Libby Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D4478 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri May 27 05:58:53 2016 (r300825) +++ head/sys/vm/vm_fault.c Fri May 27 06:05:12 2016 (r300826) @@ -799,26 +799,15 @@ vnode_locked: * We don't chase down the shadow chain */ fs.object == fs.first_object->backing_object) { - /* - * get rid of the unnecessary page - */ - vm_page_lock(fs.first_m); - vm_page_remove(fs.first_m); - vm_page_unlock(fs.first_m); - /* - * grab the page and put it into the - * process'es object. The page is - * automatically made dirty. - */ - if (vm_page_rename(fs.m, fs.first_object, - fs.first_pindex)) { - VM_OBJECT_WUNLOCK(fs.first_object); - unlock_and_deallocate(&fs); - goto RetryFault; - } + vm_page_lock(fs.m); + vm_page_remove(fs.m); + vm_page_unlock(fs.m); vm_page_lock(fs.first_m); + vm_page_replace_checked(fs.m, fs.first_object, + fs.first_pindex, fs.first_m); vm_page_free(fs.first_m); vm_page_unlock(fs.first_m); + vm_page_dirty(fs.m); #if VM_NRESERVLEVEL > 0 /* * Rename the reservation. @@ -827,6 +816,10 @@ vnode_locked: fs.object, OFF_TO_IDX( fs.first_object->backing_object_offset)); #endif + /* + * Removing the page from the backing object + * unbusied it. + */ vm_page_xbusy(fs.m); fs.first_m = fs.m; fs.m = NULL; From owner-svn-src-head@freebsd.org Fri May 27 06:12:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC623B4C897; Fri, 27 May 2016 06:12:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97E881E96; Fri, 27 May 2016 06:12:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R6ChHp023846; Fri, 27 May 2016 06:12:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R6Chxh023842; Fri, 27 May 2016 06:12:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605270612.u4R6Chxh023842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 27 May 2016 06:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300827 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 06:12:44 -0000 Author: sephe Date: Fri May 27 06:12:43 2016 New Revision: 300827 URL: https://svnweb.freebsd.org/changeset/base/300827 Log: hyperv: Move timer related MSRs into hyperv_reg.h And avoid bit fields for event timer. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6566 Modified: head/sys/dev/hyperv/vmbus/hv_et.c head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hyperv_reg.h Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Fri May 27 06:05:12 2016 (r300826) +++ head/sys/dev/hyperv/vmbus/hv_et.c Fri May 27 06:12:43 2016 (r300827) @@ -37,12 +37,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include "hv_vmbus_priv.h" +#include +#include #define HV_TIMER_FREQUENCY (10 * 1000 * 1000LL) /* 100ns period */ #define HV_MAX_DELTA_TICKS 0xffffffffLL #define HV_MIN_DELTA_TICKS 1LL +#define MSR_HV_STIMER0_CFG_SINT \ + ((((uint64_t)HV_VMBUS_TIMER_SINT) << MSR_HV_STIMER_CFG_SINT_SHIFT) & \ + MSR_HV_STIMER_CFG_SINT_MASK) + static struct eventtimer *et; static inline uint64_t @@ -57,18 +62,15 @@ sbintime2tick(sbintime_t time) static int hv_et_start(struct eventtimer *et, sbintime_t firsttime, sbintime_t periodtime) { - union hv_timer_config timer_cfg; - uint64_t current; + uint64_t current, config; - timer_cfg.as_uint64 = 0; - timer_cfg.auto_enable = 1; - timer_cfg.sintx = HV_VMBUS_TIMER_SINT; + config = MSR_HV_STIMER_CFG_AUTOEN | MSR_HV_STIMER0_CFG_SINT; - current = rdmsr(HV_X64_MSR_TIME_REF_COUNT); + current = rdmsr(MSR_HV_TIME_REF_COUNT); current += sbintime2tick(firsttime); - wrmsr(HV_X64_MSR_STIMER0_CONFIG, timer_cfg.as_uint64); - wrmsr(HV_X64_MSR_STIMER0_COUNT, current); + wrmsr(MSR_HV_STIMER0_CONFIG, config); + wrmsr(MSR_HV_STIMER0_COUNT, current); return (0); } @@ -76,8 +78,8 @@ hv_et_start(struct eventtimer *et, sbint static int hv_et_stop(struct eventtimer *et) { - wrmsr(HV_X64_MSR_STIMER0_CONFIG, 0); - wrmsr(HV_X64_MSR_STIMER0_COUNT, 0); + wrmsr(MSR_HV_STIMER0_CONFIG, 0); + wrmsr(MSR_HV_STIMER0_COUNT, 0); return (0); } Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Fri May 27 06:05:12 2016 (r300826) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Fri May 27 06:12:43 2016 (r300827) @@ -91,8 +91,7 @@ static struct timecounter hv_timecounter static u_int hv_get_timecount(struct timecounter *tc) { - u_int now = rdmsr(HV_X64_MSR_TIME_REF_COUNT); - return (now); + return rdmsr(MSR_HV_TIME_REF_COUNT); } /** Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv_reg.h Fri May 27 06:05:12 2016 (r300826) +++ head/sys/dev/hyperv/vmbus/hyperv_reg.h Fri May 27 06:12:43 2016 (r300827) @@ -54,6 +54,8 @@ #define MSR_HV_VP_INDEX 0x40000002 +#define MSR_HV_TIME_REF_COUNT 0x40000020 + #define MSR_HV_SCONTROL 0x40000080 #define MSR_HV_SCTRL_ENABLE 0x0001ULL #define MSR_HV_SCTRL_RSVD_MASK 0xfffffffffffffffeULL @@ -77,6 +79,16 @@ #define MSR_HV_SINT_RSVD_MASK (MSR_HV_SINT_RSVD1_MASK | \ MSR_HV_SINT_RSVD2_MASK) +#define MSR_HV_STIMER0_CONFIG 0x400000b0 +#define MSR_HV_STIMER_CFG_ENABLE 0x0001ULL +#define MSR_HV_STIMER_CFG_PERIODIC 0x0002ULL +#define MSR_HV_STIMER_CFG_LAZY 0x0004ULL +#define MSR_HV_STIMER_CFG_AUTOEN 0x0008ULL +#define MSR_HV_STIMER_CFG_SINT_MASK 0x000f0000ULL +#define MSR_HV_STIMER_CFG_SINT_SHIFT 16 + +#define MSR_HV_STIMER0_COUNT 0x400000b1 + /* * CPUID leaves */ From owner-svn-src-head@freebsd.org Fri May 27 06:35:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6096B4CCE0 for ; Fri, 27 May 2016 06:35:16 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x230.google.com (mail-yw0-x230.google.com [IPv6:2607:f8b0:4002:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 781801C36 for ; Fri, 27 May 2016 06:35:16 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x230.google.com with SMTP id x189so97764161ywe.3 for ; Thu, 26 May 2016 23:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=3s97E49Ct5adPxV70H1r8X2bpeBXuDxbnDHLmGT1oOI=; b=LPxoo3dNDO52Oc75Xid6JrmhHE25FQlQqLri4v7djYnxBHesT1Wurs/LBtEgWX1IlL 0LmsqNxeYaYkmFSsLl1RR9/gK2fghVKYQP+siBcjzCbTtAFccRp1Fkv5o+bfZyrIrCIj v89WfvdRZqp9ISq+5+abPv3ru2+ag9CHrXmk5hzwwspzct9RRpaA9T9vK7sxulPt4hSX Q8OmFnVXn1gP8BBRH9KlAARMM1CEWc9IsUElMyC/BFK1ggC2Zwa/UgEWczVxXd27y9fp aiR6xfyt42ox0zx4M/HgeVR7h96nuzj/6uKvHrpNbRwfWEsf7uz5Au1uyO9T5ZDRgXy7 0uuA== 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; bh=3s97E49Ct5adPxV70H1r8X2bpeBXuDxbnDHLmGT1oOI=; b=CemjWwWpL1mzXNmII7/PNjuST3W8+bk5AmQ935FgGA2OcvziCnBLIOVdlGNKfMaZVD 7FF06b8NzgQQ/fOzHAZOxFRgbARdUs892igvhys+cVNnL6XraVWgun/ljeE5jPUC84JV 1VP7DW6UiYDQP7+nAEL8zYIA8IivlAtXK0XVQ6H84+p0VNPWqqcjEX/eZGqTlUZ+nV4e fuJORTWzVVxZyQC9UIOO2NFDcZneOM8FhlJs6VeGZtPfvsLncvBze8FaVvsQ3nnb61TB O6WVNcQKRF3tdUrMvP3OyZLlcC3OtPYTJHDo5+dG7dTim10FKUOBcD3uh9SnkBsig9mW Kk6Q== X-Gm-Message-State: ALyK8tJn5hcms1KAU0WBXXtLzDSO4h92nWrbYPEM7heI+bfB5dMvSUreWgOKzYZjFez4QKBB+BkssZmpTTzmqQ== MIME-Version: 1.0 X-Received: by 10.13.202.207 with SMTP id m198mr8322878ywd.140.1464330915507; Thu, 26 May 2016 23:35:15 -0700 (PDT) Received: by 10.13.201.199 with HTTP; Thu, 26 May 2016 23:35:15 -0700 (PDT) In-Reply-To: <201605270531.u4R5VE6R006890@repo.freebsd.org> References: <201605270531.u4R5VE6R006890@repo.freebsd.org> Date: Fri, 27 May 2016 08:35:15 +0200 Message-ID: Subject: Re: svn commit: r300824 - head/lib/libmd From: Ed Schouten To: "Conrad E. Meyer" Cc: src-committers , 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 06:35:16 -0000 Hi Conrad, 2016-05-27 7:31 GMT+02:00 Conrad E. Meyer : > libmd: Work around C++'s inability to understand C So C++ doesn't support using 'static' within array types, right? What I personally dislike about this specific change: - Including directly still doesn't work. - If is ever going to include a 'static inline' function, the static keyword would also be stripped off. Would it make sense to come up with a macro in to deal with this? #if defined(__cplusplus) || defined(ancient compiler) #define __minimum_size(n) n #else #define __minimum_size(n) static (n) #endif That way we can annotate this everwhere we'd want, without needing to care about compiler versions, languages, etc. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Fri May 27 06:36:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53BB0B4CD8E; Fri, 27 May 2016 06:36:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 204E01E67; Fri, 27 May 2016 06:36:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x233.google.com with SMTP id p64so25866927ioi.2; Thu, 26 May 2016 23:36:31 -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; bh=ASn1/vQ+KpQuX8eWRnH7KQZk0PWzkecg7lX5EXGFh30=; b=Lt1LsJLLVeTDavelXAugNfCmET5DGgvXGS6jPPv3SfWhu9/XN9JWvZ8eNEuC9b1QwY yYO8rBL15fe6LZP5OJdxtTY7t4l2P2MUa/+tqsck68F5nJ2KlPsnkQhznOIhm1z1cjRP 2lULX3T5TZNWMQzSLfkkvUBD3KvZkRMcjoCQWQSkBInwibsqHV8OctlYTCx38NAyRxkn Q/sqRIeExMtQBZLRYKL8Cza0B6Iw/jNCknlbxyzC9n7S2iiDFbCMMf0SYQ6fARGdTjSd jhjqduVj/GhrshUfyBlEHI1fo6P3fsBJG2MF5mj7Lc03/yNR8euEGtMFxNvgFAVIkKPZ DdOw== 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; bh=ASn1/vQ+KpQuX8eWRnH7KQZk0PWzkecg7lX5EXGFh30=; b=Nb0EfkBgWvsEwU3sWShZ2TPevaUYet/QnLP1S1Cce+wVkU5EMyPBu7S3Xr97q7dfeX h+TxmHpCuPqwoXHvnaLmr6k2OUPwKuXyAXWCXpTD5UbpB2PhSGmXVoItkK9vS1e7nujy vPsYNV5iGU+CiTqnZ1Arq6q2tzzbG+t8m2d7/siuh4AgW1xRoqFoEQoZnpDr8hFH3cwv x0LC/jhEZZ+Rei+140IRlx025MRVpT2BwdhXrOq96bdF6VKlJ0SrlEyfr6FNZYrWeS0f L97cVrIiDWO1/39tXpxARapb9stliJuBrDveeHOn+g3ZnSvmi9A3S/AEHoGvCqAJBKso ayIQ== X-Gm-Message-State: ALyK8tI2syIaMNxhlNep7KnWeCynDwtzuzyLlXc09PBREocZ7/0sQ436CjXek5a5SMsiMVTIkDhNDbfUIhpfgw== MIME-Version: 1.0 X-Received: by 10.107.15.234 with SMTP id 103mr12094181iop.75.1464330990333; Thu, 26 May 2016 23:36:30 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Thu, 26 May 2016 23:36:30 -0700 (PDT) In-Reply-To: <201605270114.u4R1EZdu013521@repo.freebsd.org> References: <201605270114.u4R1EZdu013521@repo.freebsd.org> Date: Thu, 26 May 2016 23:36:30 -0700 Message-ID: Subject: Re: svn commit: r300815 - head/sys/modules From: Adrian Chadd To: Ian Lepore Cc: "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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 06:36:31 -0000 It used to build on mips (that's what I used for the platform in the first place); what happened? -a On 26 May 2016 at 18:14, Ian Lepore wrote: > Author: ian > Date: Fri May 27 01:14:35 2016 > New Revision: 300815 > URL: https://svnweb.freebsd.org/changeset/base/300815 > > Log: > Only build gpio modules on armv6, until it's known that they can be built > succesfully on other arches. > > Modified: > head/sys/modules/Makefile > > Modified: head/sys/modules/Makefile > ============================================================================== > --- head/sys/modules/Makefile Fri May 27 01:07:48 2016 (r300814) > +++ head/sys/modules/Makefile Fri May 27 01:14:35 2016 (r300815) > @@ -125,7 +125,7 @@ SUBDIR= \ > geom \ > ${_glxiic} \ > ${_glxsb} \ > - gpio \ > + ${_gpio} \ > hatm \ > hifn \ > hme \ > @@ -733,6 +733,10 @@ _cfi= cfi > _cpsw= cpsw > .endif > > +.if ${MACHINE_ARCH} == "armv6" > +_gpio= gpio > +.endif > + > .if ${MACHINE_CPUARCH} == "powerpc" > _agp= agp > _an= an > From owner-svn-src-head@freebsd.org Fri May 27 06:47:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 073D9B4CFED; Fri, 27 May 2016 06:47:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC8C9139C; Fri, 27 May 2016 06:47:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R6l5DG034985; Fri, 27 May 2016 06:47:05 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R6l4aX034983; Fri, 27 May 2016 06:47:04 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605270647.u4R6l4aX034983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 27 May 2016 06:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300830 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 06:47:06 -0000 Author: sephe Date: Fri May 27 06:47:04 2016 New Revision: 300830 URL: https://svnweb.freebsd.org/changeset/base/300830 Log: hyperv/vmbus: Move MSR EOM to hyperv_reg.h MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6567 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hyperv_reg.h Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Fri May 27 06:30:35 2016 (r300829) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Fri May 27 06:47:04 2016 (r300830) @@ -118,7 +118,7 @@ handled: * This will cause message queue rescan to possibly * deliver another msg from the hypervisor */ - wrmsr(HV_X64_MSR_EOM, 0); + wrmsr(MSR_HV_EOM, 0); } } } @@ -170,7 +170,7 @@ hv_vmbus_isr(struct vmbus_softc *sc, str * This will cause message queue rescan to possibly * deliver another msg from the hypervisor */ - wrmsr(HV_X64_MSR_EOM, 0); + wrmsr(MSR_HV_EOM, 0); } } Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv_reg.h Fri May 27 06:30:35 2016 (r300829) +++ head/sys/dev/hyperv/vmbus/hyperv_reg.h Fri May 27 06:47:04 2016 (r300830) @@ -70,6 +70,8 @@ #define MSR_HV_SIMP_RSVD_MASK 0x0ffeULL #define MSR_HV_SIMP_PGSHIFT 12 +#define MSR_HV_EOM 0x40000084 + #define MSR_HV_SINT0 0x40000090 #define MSR_HV_SINT_VECTOR_MASK 0x00ffULL #define MSR_HV_SINT_RSVD1_MASK 0xff00ULL From owner-svn-src-head@freebsd.org Fri May 27 06:55:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BE94B4B233; Fri, 27 May 2016 06:55:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EF421983; Fri, 27 May 2016 06:55:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R6t5G8038495; Fri, 27 May 2016 06:55:05 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R6t5h1038494; Fri, 27 May 2016 06:55:05 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605270655.u4R6t5h1038494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 27 May 2016 06:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300831 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 06:55:06 -0000 Author: sephe Date: Fri May 27 06:55:05 2016 New Revision: 300831 URL: https://svnweb.freebsd.org/changeset/base/300831 Log: hyperv: GC unneeded bits MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6568 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Fri May 27 06:47:04 2016 (r300830) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Fri May 27 06:55:05 2016 (r300831) @@ -356,32 +356,6 @@ typedef struct { } hv_vmbus_connection; typedef union { - uint64_t as_uint64_t; - struct { - uint64_t build_number : 16; - uint64_t service_version : 8; /* Service Pack, etc. */ - uint64_t minor_version : 8; - uint64_t major_version : 8; - /* - * HV_GUEST_OS_MICROSOFT_IDS (If Vendor=MS) - * HV_GUEST_OS_VENDOR - */ - uint64_t os_id : 8; - uint64_t vendor_id : 16; - } u; -} hv_vmbus_x64_msr_guest_os_id_contents; - - -typedef union { - uint64_t as_uint64_t; - struct { - uint64_t enable :1; - uint64_t reserved :11; - uint64_t guest_physical_address :52; - } u; -} hv_vmbus_x64_msr_hypercall_contents; - -typedef union { uint32_t as_uint32_t; struct { uint32_t group_enable :4; @@ -443,71 +417,6 @@ typedef struct { } hv_vmbus_monitor_page; /* - * Define the format of the SIMP register - */ -typedef union { - uint64_t as_uint64_t; - struct { - uint64_t simp_enabled : 1; - uint64_t preserved : 11; - uint64_t base_simp_gpa : 52; - } u; -} hv_vmbus_synic_simp; - -/* - * Define the format of the SIEFP register - */ -typedef union { - uint64_t as_uint64_t; - struct { - uint64_t siefp_enabled : 1; - uint64_t preserved : 11; - uint64_t base_siefp_gpa : 52; - } u; -} hv_vmbus_synic_siefp; - -/* - * Define synthetic interrupt source - */ -typedef union { - uint64_t as_uint64_t; - struct { - uint64_t vector : 8; - uint64_t reserved1 : 8; - uint64_t masked : 1; - uint64_t auto_eoi : 1; - uint64_t reserved2 : 46; - } u; -} hv_vmbus_synic_sint; - -/* - * Timer configuration register. - */ -union hv_timer_config { - uint64_t as_uint64; - struct { - uint64_t enable:1; - uint64_t periodic:1; - uint64_t lazy:1; - uint64_t auto_enable:1; - uint64_t reserved_z0:12; - uint64_t sintx:4; - uint64_t reserved_z1:44; - }; -}; - -/* - * Define syn_ic control register - */ -typedef union _hv_vmbus_synic_scontrol { - uint64_t as_uint64_t; - struct { - uint64_t enable : 1; - uint64_t reserved : 63; - } u; -} hv_vmbus_synic_scontrol; - -/* * Define the hv_vmbus_post_message hypercall input structure */ typedef struct { @@ -528,60 +437,6 @@ typedef union vmbus_event_flags { } hv_vmbus_synic_event_flags; CTASSERT(sizeof(hv_vmbus_synic_event_flags) == HV_EVENT_FLAGS_BYTE_COUNT); -#define HV_X64_CPUID_MIN (0x40000005) -#define HV_X64_CPUID_MAX (0x4000ffff) - -/* - * Declare the MSR used to identify the guest OS - */ -#define HV_X64_MSR_GUEST_OS_ID (0x40000000) -/* - * Declare the MSR used to setup pages used to communicate with the hypervisor - */ -#define HV_X64_MSR_HYPERCALL (0x40000001) -/* MSR used to provide vcpu index */ -#define HV_X64_MSR_VP_INDEX (0x40000002) - -#define HV_X64_MSR_TIME_REF_COUNT (0x40000020) - -/* - * Define synthetic interrupt controller model specific registers - */ -#define HV_X64_MSR_SCONTROL (0x40000080) -#define HV_X64_MSR_SVERSION (0x40000081) -#define HV_X64_MSR_SIEFP (0x40000082) -#define HV_X64_MSR_SIMP (0x40000083) -#define HV_X64_MSR_EOM (0x40000084) - -#define HV_X64_MSR_SINT0 (0x40000090) -#define HV_X64_MSR_SINT1 (0x40000091) -#define HV_X64_MSR_SINT2 (0x40000092) -#define HV_X64_MSR_SINT3 (0x40000093) -#define HV_X64_MSR_SINT4 (0x40000094) -#define HV_X64_MSR_SINT5 (0x40000095) -#define HV_X64_MSR_SINT6 (0x40000096) -#define HV_X64_MSR_SINT7 (0x40000097) -#define HV_X64_MSR_SINT8 (0x40000098) -#define HV_X64_MSR_SINT9 (0x40000099) -#define HV_X64_MSR_SINT10 (0x4000009A) -#define HV_X64_MSR_SINT11 (0x4000009B) -#define HV_X64_MSR_SINT12 (0x4000009C) -#define HV_X64_MSR_SINT13 (0x4000009D) -#define HV_X64_MSR_SINT14 (0x4000009E) -#define HV_X64_MSR_SINT15 (0x4000009F) - -/* - * Synthetic Timer MSRs. Four timers per vcpu. - */ -#define HV_X64_MSR_STIMER0_CONFIG 0x400000B0 -#define HV_X64_MSR_STIMER0_COUNT 0x400000B1 -#define HV_X64_MSR_STIMER1_CONFIG 0x400000B2 -#define HV_X64_MSR_STIMER1_COUNT 0x400000B3 -#define HV_X64_MSR_STIMER2_CONFIG 0x400000B4 -#define HV_X64_MSR_STIMER2_COUNT 0x400000B5 -#define HV_X64_MSR_STIMER3_CONFIG 0x400000B6 -#define HV_X64_MSR_STIMER3_COUNT 0x400000B7 - /* * Declare the various hypercall operations */ From owner-svn-src-head@freebsd.org Fri May 27 07:00:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 014EDB4B384 for ; Fri, 27 May 2016 07:00:37 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22f.google.com (mail-yw0-x22f.google.com [IPv6:2607:f8b0:4002:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B57C71B45 for ; Fri, 27 May 2016 07:00:36 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22f.google.com with SMTP id x189so98174373ywe.3 for ; Fri, 27 May 2016 00:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-transfer-encoding; bh=zOmzHdelzm3P6EGnTFBLUi43+JMhJDPo7GQPnBzBsOo=; b=F4D0zPhThAtkUQZsEa5g7oq66d5jXuCTwYbHhTgNiAEAGkGsWgZCcSdOP18s82n1e9 X/wPGvOS5dEMK16IsPRtwWBjfisb3Rx1HDzhZ6CHm+NGC3JBBWoy+l72MFAaivgZcIRu +u4QxoVPKiHwilC3K/o3KEQ9D5knNYYGYABxGpEsoWsJYg79iqyJ8fvsBPlP0m0HIiHn 9OPXqWXwRFJsEMrRPYWTOj4rstF+6CY/ZtXWgGi7ycyEdT9yuGh6S0utRNmNdHOhIh0b bKxaG7AJwl3vykiWDbJOCsCUiVEVtERCweI7EPutarDu1t7DgUQhEV9svr/5GjpNSlmA T/Jg== 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-transfer-encoding; bh=zOmzHdelzm3P6EGnTFBLUi43+JMhJDPo7GQPnBzBsOo=; b=RnG0iE+85hcygQ0O3KUBQYfojzCzUrnSuCa9dkw5ftxkG3Tj2OvtXb5yH2lUJteGvN zjGhcyxH04ojBHvz+1KW4bwH6WFqVFDRl0gp+pU7VwKbvlYHejAI9wpzjgRNAoldNdpO w6FOOBQBJ36OW0dpxDKFRoqncB7gl1FO5t4tJcHw3zseicD9qaJA/6+etpLPj7NRSGUl gbRDvmA5bK71gU13LRrbstLajVKwW8410qiRGzvkYM5yDaZA++UGaIoYwgt+TC4hmcmR xsbPDA/ZHjMGLGj+eXV0SAO4JqUO3Ot5x5ffGZKitikSRxndruH6Ti00rQCjrk3OPLVL NHqw== X-Gm-Message-State: ALyK8tIxAICZlnWRzPFErMiY8SdAXeJsmadZFy2M+6bAVmhCgezp3WQ/cCtSPOFcfzc/Bmnix1fCT7d43R/lOA== MIME-Version: 1.0 X-Received: by 10.13.218.131 with SMTP id c125mr7889019ywe.310.1464332435947; Fri, 27 May 2016 00:00:35 -0700 (PDT) Received: by 10.13.201.199 with HTTP; Fri, 27 May 2016 00:00:35 -0700 (PDT) In-Reply-To: References: <201605270531.u4R5VE6R006890@repo.freebsd.org> Date: Fri, 27 May 2016 09:00:35 +0200 Message-ID: Subject: Re: svn commit: r300824 - head/lib/libmd From: Ed Schouten To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 07:00:37 -0000 2016-05-27 8:50 GMT+02:00 Conrad Meyer : > There's nothing to support =E2=80=94 literally ignoring the keyword is an > acceptable implementation. So it's disappointing C++ chooses to > reject C keywords. Keep in mind that C++ does not reject "static" altogether; only in this specific context. The reason for it is that in C++, there are other ways of enforcing similar properties. For example by using std::array, which has the size as part of its type. > If sys/md5.h includes a static inline function, there are bigger > problems with potentially trying to interpret C code as C++. We have quite a lot of public header files that contain static inline functions that also work well in C++ mode. is a good example. > Your proposed macro seems ok, although it is pretty long for where it > would be used. Maybe __min_size()? Sure! --=20 Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Fri May 27 07:05:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 573DAB4B600; Fri, 27 May 2016 07:05:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CEAB11CF; Fri, 27 May 2016 07:05:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R75U8p042226; Fri, 27 May 2016 07:05:30 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R75UVi042225; Fri, 27 May 2016 07:05:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605270705.u4R75UVi042225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 27 May 2016 07:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300832 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 07:05:31 -0000 Author: sephe Date: Fri May 27 07:05:30 2016 New Revision: 300832 URL: https://svnweb.freebsd.org/changeset/base/300832 Log: hyperv: Clean up Hyper-V timecounter a bit. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6569 Modified: head/sys/dev/hyperv/vmbus/hv_hv.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Fri May 27 06:55:05 2016 (r300831) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Fri May 27 07:05:30 2016 (r300832) @@ -74,22 +74,29 @@ struct hypercall_ctx { struct hyperv_dma hc_dma; }; -static struct hypercall_ctx hypercall_context; - -static u_int hv_get_timecount(struct timecounter *tc); +static u_int hyperv_get_timecount(struct timecounter *tc); -u_int hyperv_features; -u_int hyperv_recommends; +u_int hyperv_features; +u_int hyperv_recommends; static u_int hyperv_pm_features; static u_int hyperv_features3; -static struct timecounter hv_timecounter = { - hv_get_timecount, 0, ~0u, HV_NANOSECONDS_PER_SEC/100, "Hyper-V", HV_NANOSECONDS_PER_SEC/100 +static struct timecounter hyperv_timecounter = { + .tc_get_timecount = hyperv_get_timecount, + .tc_poll_pps = NULL, + .tc_counter_mask = 0xffffffff, + .tc_frequency = HV_NANOSECONDS_PER_SEC/100, + .tc_name = "Hyper-V", + .tc_quality = 2000, + .tc_flags = 0, + .tc_priv = NULL }; +static struct hypercall_ctx hypercall_context; + static u_int -hv_get_timecount(struct timecounter *tc) +hyperv_get_timecount(struct timecounter *tc __unused) { return rdmsr(MSR_HV_TIME_REF_COUNT); } @@ -304,8 +311,8 @@ hyperv_init(void *dummy __unused) wrmsr(MSR_HV_GUEST_OS_ID, MSR_HV_GUESTID_FREEBSD); if (hyperv_features & CPUID_HV_MSR_TIME_REFCNT) { - /* Register virtual timecount */ - tc_init(&hv_timecounter); + /* Register Hyper-V timecounter */ + tc_init(&hyperv_timecounter); } } SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, From owner-svn-src-head@freebsd.org Fri May 27 07:10:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33DA5B4B7D5; Fri, 27 May 2016 07:10:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF83E1687; Fri, 27 May 2016 07:10:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R7ACA8042446; Fri, 27 May 2016 07:10:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R7ABJX042444; Fri, 27 May 2016 07:10:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605270710.u4R7ABJX042444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 27 May 2016 07:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300833 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 07:10:13 -0000 Author: adrian Date: Fri May 27 07:10:11 2016 New Revision: 300833 URL: https://svnweb.freebsd.org/changeset/base/300833 Log: [iwm] remove dead code. if_iwm - GC some dead code, left by a partially applied OpenBSD change. Taken-From: OpenBSD (if_iwm.c r1.69) Submitted by: Imre Vadasz Obtained from: DragonflyBSD git 07dfed32ea39b980b0b80d27ff938e7c3ca4c0b5 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Fri May 27 07:05:30 2016 (r300832) +++ head/sys/dev/iwm/if_iwm.c Fri May 27 07:10:11 2016 (r300833) @@ -3829,7 +3829,6 @@ iwm_stop(struct iwm_softc *sc) sc->sc_flags |= IWM_FLAG_STOPPED; sc->sc_generation++; sc->sc_scanband = 0; - sc->sc_auth_prot = 0; sc->sc_tx_timer = 0; iwm_stop_device(sc); } @@ -4246,20 +4245,9 @@ iwm_notif_intr(struct iwm_softc *sc) struct iwm_time_event_notif *notif; SYNC_RESP_STRUCT(notif, pkt); - if (notif->status) { - if (le32toh(notif->action) & - IWM_TE_V2_NOTIF_HOST_EVENT_START) - sc->sc_auth_prot = 2; - else - sc->sc_auth_prot = 0; - } else { - sc->sc_auth_prot = -1; - } IWM_DPRINTF(sc, IWM_DEBUG_INTR, - "%s: time event notification auth_prot=%d\n", - __func__, sc->sc_auth_prot); - - wakeup(&sc->sc_auth_prot); + "TE notif status = 0x%x action = 0x%x\n", + notif->status, notif->action); break; } case IWM_MCAST_FILTER_CMD: Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Fri May 27 07:05:30 2016 (r300832) +++ head/sys/dev/iwm/if_iwmvar.h Fri May 27 07:10:11 2016 (r300833) @@ -485,8 +485,6 @@ struct iwm_softc { int sc_scan_last_antenna; int sc_scanband; - int sc_auth_prot; - int sc_fixed_ridx; int sc_staid; From owner-svn-src-head@freebsd.org Fri May 27 07:29:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CA75B4BCEB; Fri, 27 May 2016 07:29:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC32B1EC8; Fri, 27 May 2016 07:29:32 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R7TWXd049684; Fri, 27 May 2016 07:29:32 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R7TVRe049678; Fri, 27 May 2016 07:29:31 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605270729.u4R7TVRe049678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 27 May 2016 07:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300834 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 07:29:33 -0000 Author: sephe Date: Fri May 27 07:29:31 2016 New Revision: 300834 URL: https://svnweb.freebsd.org/changeset/base/300834 Log: hyperv: Test features before enabling optional functionalities MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6571 Added: head/sys/dev/hyperv/vmbus/hyperv_var.h (contents, props changed) Modified: head/sys/dev/hyperv/vmbus/hv_et.c head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/hyperv_reg.h Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Fri May 27 07:10:11 2016 (r300833) +++ head/sys/dev/hyperv/vmbus/hv_et.c Fri May 27 07:29:31 2016 (r300834) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #define HV_TIMER_FREQUENCY (10 * 1000 * 1000LL) /* 100ns period */ #define HV_MAX_DELTA_TICKS 0xffffffffLL @@ -48,6 +49,16 @@ __FBSDID("$FreeBSD$"); ((((uint64_t)HV_VMBUS_TIMER_SINT) << MSR_HV_STIMER_CFG_SINT_SHIFT) & \ MSR_HV_STIMER_CFG_SINT_MASK) +/* + * Two additionally required features: + * - SynIC is needed for interrupt generation. + * - Time reference counter is needed to set ABS reference count to + * STIMER0_COUNT. + */ +#define CPUID_HV_ET_MASK (CPUID_HV_MSR_TIME_REFCNT | \ + CPUID_HV_MSR_SYNIC | \ + CPUID_HV_MSR_SYNTIMER) + static struct eventtimer *et; static inline uint64_t @@ -104,7 +115,8 @@ hv_et_intr(struct trapframe *frame) static void hv_et_identify(driver_t *driver, device_t parent) { - if (device_find_child(parent, "hv_et", -1) != NULL) + if (device_find_child(parent, "hv_et", -1) != NULL || + (hyperv_features & CPUID_HV_ET_MASK) != CPUID_HV_ET_MASK) return; device_add_child(parent, "hv_et", -1); Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Fri May 27 07:10:11 2016 (r300833) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Fri May 27 07:29:31 2016 (r300834) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define HV_NANOSECONDS_PER_SEC 1000000000L Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Fri May 27 07:10:11 2016 (r300833) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Fri May 27 07:29:31 2016 (r300834) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -215,10 +216,21 @@ vmbus_synic_setup(void *xsc) uint64_t val, orig; uint32_t sint; - /* - * Save virtual processor id. - */ - VMBUS_PCPU_GET(sc, vcpuid, cpu) = rdmsr(MSR_HV_VP_INDEX); + if (hyperv_features & CPUID_HV_MSR_VP_INDEX) { + /* + * Save virtual processor id. + */ + VMBUS_PCPU_GET(sc, vcpuid, cpu) = rdmsr(MSR_HV_VP_INDEX); + } else { + /* + * XXX + * Virtual processoor id is only used by a pretty broken + * channel selection code from storvsc. It's nothing + * critical even if CPUID_HV_MSR_VP_INDEX is not set; keep + * moving on. + */ + VMBUS_PCPU_GET(sc, vcpuid, cpu) = cpu; + } /* * Setup the SynIC message. @@ -557,7 +569,8 @@ static int vmbus_probe(device_t dev) { if (ACPI_ID_PROBE(device_get_parent(dev), dev, vmbus_ids) == NULL || - device_get_unit(dev) != 0 || vm_guest != VM_GUEST_HV) + device_get_unit(dev) != 0 || vm_guest != VM_GUEST_HV || + (hyperv_features & CPUID_HV_MSR_SYNIC) == 0) return (ENXIO); device_set_desc(dev, "Hyper-V Vmbus"); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Fri May 27 07:10:11 2016 (r300833) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Fri May 27 07:29:31 2016 (r300834) @@ -451,9 +451,6 @@ typedef enum { extern hv_vmbus_connection hv_vmbus_g_connection; -extern u_int hyperv_features; -extern u_int hyperv_recommends; - typedef void (*vmbus_msg_handler)(hv_vmbus_channel_msg_header *msg); typedef struct hv_vmbus_channel_msg_table_entry { Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv_reg.h Fri May 27 07:10:11 2016 (r300833) +++ head/sys/dev/hyperv/vmbus/hyperv_reg.h Fri May 27 07:29:31 2016 (r300834) @@ -110,7 +110,8 @@ #define CPUID_HV_MSR_APIC 0x0010 /* MSR_HV_{EOI,ICR,TPR} */ #define CPUID_HV_MSR_HYPERCALL 0x0020 /* MSR_HV_GUEST_OS_ID * MSR_HV_HYPERCALL */ -#define CPUID_HV_MSR_GUEST_IDLE 0x0400 /* MSR_VH_GUEST_IDLE */ +#define CPUID_HV_MSR_VP_INDEX 0x0040 /* MSR_HV_VP_INDEX */ +#define CPUID_HV_MSR_GUEST_IDLE 0x0400 /* MSR_HV_GUEST_IDLE */ /* ECX: power management features */ #define CPUPM_HV_CSTATE_MASK 0x000f /* deepest C-state */ #define CPUPM_HV_C3_HPET 0x0010 /* C3 requires HPET */ Added: head/sys/dev/hyperv/vmbus/hyperv_var.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/hyperv_var.h Fri May 27 07:29:31 2016 (r300834) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _HYPERV_VAR_H_ +#define _HYPERV_VAR_H_ + +extern u_int hyperv_features; +extern u_int hyperv_recommends; + +#endif /* !_HYPERV_VAR_H_ */ From owner-svn-src-head@freebsd.org Fri May 27 07:33:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9309B4BFA2; Fri, 27 May 2016 07:33:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F862148A; Fri, 27 May 2016 07:33:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R7XnOe053265; Fri, 27 May 2016 07:33:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R7XnGM053263; Fri, 27 May 2016 07:33:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605270733.u4R7XnGM053263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 27 May 2016 07:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300835 - in head/sys/compat/linuxkpi/common: include/linux 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 07:33:51 -0000 Author: hselasky Date: Fri May 27 07:33:49 2016 New Revision: 300835 URL: https://svnweb.freebsd.org/changeset/base/300835 Log: The SCHEDULER_STOPPED() macro already contains a predict false statement. Remove superfluous unlikely() wrapper. Suggested by: glebius MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/wait.h Fri May 27 07:29:31 2016 (r300834) +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Fri May 27 07:33:49 2016 (r300835) @@ -82,7 +82,7 @@ do { \ void *c = &(q).wchan; \ if (!(cond)) { \ for (;;) { \ - if (unlikely(SCHEDULER_STOPPED())) \ + if (SCHEDULER_STOPPED()) \ break; \ sleepq_lock(c); \ if (cond) { \ @@ -103,7 +103,7 @@ do { \ _error = 0; \ if (!(cond)) { \ for (; _error == 0;) { \ - if (unlikely(SCHEDULER_STOPPED())) \ + if (SCHEDULER_STOPPED()) \ break; \ sleepq_lock(c); \ if (cond) { \ @@ -128,7 +128,7 @@ do { \ \ if (!(cond)) { \ for (; __rc == 0;) { \ - if (unlikely(SCHEDULER_STOPPED())) \ + if (SCHEDULER_STOPPED()) \ break; \ sleepq_lock(c); \ if (cond) { \ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Fri May 27 07:29:31 2016 (r300834) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri May 27 07:33:49 2016 (r300835) @@ -1096,7 +1096,7 @@ linux_complete_common(struct completion long linux_wait_for_common(struct completion *c, int flags) { - if (unlikely(SCHEDULER_STOPPED())) + if (SCHEDULER_STOPPED()) return (0); if (flags != 0) @@ -1128,7 +1128,7 @@ linux_wait_for_timeout_common(struct com { long end = jiffies + timeout; - if (unlikely(SCHEDULER_STOPPED())) + if (SCHEDULER_STOPPED()) return (0); if (flags != 0) From owner-svn-src-head@freebsd.org Fri May 27 07:34:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C27FB4C00D; Fri, 27 May 2016 07:34:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EA5B171F; Fri, 27 May 2016 07:34:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E7E331FE024; Fri, 27 May 2016 09:34:27 +0200 (CEST) Subject: Re: svn commit: r300671 - in head/sys/compat/linuxkpi/common: include/linux src To: Gleb Smirnoff References: <201605250904.u4P946CY055112@repo.freebsd.org> <20160526212541.GI58287@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <86bc5db9-11bf-6a10-9204-fa8dac257e97@selasky.org> Date: Fri, 27 May 2016 09:37:47 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160526212541.GI58287@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 07:34:37 -0000 On 05/26/16 23:25, Gleb Smirnoff wrote: > Hi! > > The SCHEDULER_STOPPED() already has __predict_false() in it, so > unlikely() is superfluous. > You're right. Fixed in r300835 . --HPS From owner-svn-src-head@freebsd.org Fri May 27 07:39:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9CD8B4C190; Fri, 27 May 2016 07:39:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C1CA1B4C; Fri, 27 May 2016 07:39:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id F255B1FE024; Fri, 27 May 2016 09:39:04 +0200 (CEST) Subject: Re: svn commit: r300718 - in head/sys: kern sys To: Gleb Smirnoff References: <201605260841.u4Q8ft9r045564@repo.freebsd.org> <20160526213716.GK58287@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Fri, 27 May 2016 09:42:24 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160526213716.GK58287@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 07:39:07 -0000 On 05/26/16 23:37, Gleb Smirnoff wrote: > Hans, > > On Thu, May 26, 2016 at 08:41:55AM +0000, Hans Petter Selasky wrote: > H> Author: hselasky > H> Date: Thu May 26 08:41:55 2016 > H> New Revision: 300718 > H> URL: https://svnweb.freebsd.org/changeset/base/300718 > H> > H> Log: > H> Add support for boolean sysctl's. > H> > H> Because the size of bool can be implementation defined, make a bool > H> sysctl handler which handle bools. Userspace sees the bools like > H> unsigned 8-bit integers. Values are filtered to either 1 or 0 upon > H> read and write, similar to what a compiler would do. > H> > H> Requested by: kmacy @ > H> Sponsored by: Mellanox Technologies > > Would be nice if sysctl(8) would explicitly display them as "true" or "false" > instead of 0 and 1. Now the userland can't differ them from uint8_t oids. > Hi, We cannot use the "bool" type in userspace at least, because sizeof(bool) depends on the compiler. So the interface must use an integer type at least, possibly uint8_t like now. Your suggestion makes sense. I'll look at some existing patches extending sysctl and test and make one for bool. --HPS From owner-svn-src-head@freebsd.org Fri May 27 07:42:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60C36B4C3B1; Fri, 27 May 2016 07:42:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AF2C1F41; Fri, 27 May 2016 07:42:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 725F51FE024; Fri, 27 May 2016 09:42:02 +0200 (CEST) Subject: Re: svn commit: r300718 - in head/sys: kern sys To: Ian Lepore , Gleb Smirnoff References: <201605260841.u4Q8ft9r045564@repo.freebsd.org> <20160526213716.GK58287@FreeBSD.org> <1464303288.1204.65.camel@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <57bc9380-3183-a0c6-1a44-7e1abb8bede7@selasky.org> Date: Fri, 27 May 2016 09:45:21 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <1464303288.1204.65.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 07:42:05 -0000 On 05/27/16 00:54, Ian Lepore wrote: > On Thu, 2016-05-26 at 14:37 -0700, Gleb Smirnoff wrote: >> Hans, >> >> On Thu, May 26, 2016 at 08:41:55AM +0000, Hans Petter Selasky wrote: >> H> Author: hselasky >> H> Date: Thu May 26 08:41:55 2016 >> H> New Revision: 300718 >> H> URL: https://svnweb.freebsd.org/changeset/base/300718 >> H> >> H> Log: >> H> Add support for boolean sysctl's. >> H> >> H> Because the size of bool can be implementation defined, make a >> bool >> H> sysctl handler which handle bools. Userspace sees the bools like >> H> unsigned 8-bit integers. Values are filtered to either 1 or 0 >> upon >> H> read and write, similar to what a compiler would do. >> H> >> H> Requested by: kmacy @ >> H> Sponsored by: Mellanox Technologies >> >> Would be nice if sysctl(8) would explicitly display them as "true" or >> "false" >> instead of 0 and 1. Now the userland can't differ them from uint8_t >> oids. > > If it displayed them that way, then users would want to set them using > the true/false strings too. If you start down that path you eventually > end up adding support for 0/1/true/false/yes/no/on/off, and if you > don't do that in exactly once place you end up with some oids accepting > all the values and others accepting only some of them, and the user > experience is confusing at best. > Hi, My initial thought was that bool support should be in the kernel only, because sizeof(bool) varies. So it is not directly compatible to userspace. Even though we might not support true/false/on/off strings, do you think bool is worth it's own CTL type, which falls back to CTLTYPE_U8 ? --HPS From owner-svn-src-head@freebsd.org Fri May 27 07:53:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38E13B4C6C1; Fri, 27 May 2016 07:53:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ig0-f176.google.com (mail-ig0-f176.google.com [209.85.213.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D9571764; Fri, 27 May 2016 07:53:34 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ig0-f176.google.com with SMTP id ct2so16102452igb.0; Fri, 27 May 2016 00:53:34 -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:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-transfer-encoding; bh=THfewhxTt/QuNlsgv4i80CWRWgm6TA9lZILtRYJCSTM=; b=in2qpeEoEegLtt2/Z4r0HF/TlJhDPhjwaDoTFiNHt7nhVAknbX9OSKEsWTk9P3QQ3Z jJkghXITqyYEY+Bn02RmZ2KOAOudvZSqDCRfkLsnKPzfe4REv3WMVZzcUUj6JUCugmNa blBs+h0ymXNqeVQt2XP2wZLUKS4or8XY9auFaCXc5g/LQ3og4y2v7WcbgMbvoH6h7ahb yil8edKRkNfeBtbExtfD117l8UxIvkJuk+EwYgQjTVI+2F41yFvtq/J6KQBqT4jFEPoj qLSm7A8XIlTraROhG+e1kHonCeUNzMeBOroEbI9k2ugf6jBAe7tWp1hSEBbfNpe5oevx xC7w== X-Gm-Message-State: ALyK8tINxrbqoWkxBDeCOmME38tfojYl71nOGIpqcouYZf0oPuCuuzfrfduMoya4Niawmg== X-Received: by 10.50.129.36 with SMTP id nt4mr6621943igb.23.1464331826270; Thu, 26 May 2016 23:50:26 -0700 (PDT) Received: from mail-ig0-f177.google.com (mail-ig0-f177.google.com. [209.85.213.177]) by smtp.gmail.com with ESMTPSA id o206sm2264274itg.9.2016.05.26.23.50.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 May 2016 23:50:26 -0700 (PDT) Received: by mail-ig0-f177.google.com with SMTP id ct2so15462074igb.0; Thu, 26 May 2016 23:50:25 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.50.183.195 with SMTP id eo3mr6978763igc.8.1464331825466; Thu, 26 May 2016 23:50:25 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Thu, 26 May 2016 23:50:25 -0700 (PDT) In-Reply-To: References: <201605270531.u4R5VE6R006890@repo.freebsd.org> Date: Thu, 26 May 2016 23:50:25 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300824 - head/lib/libmd From: Conrad Meyer To: Ed Schouten Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 07:53:35 -0000 There's nothing to support =E2=80=94 literally ignoring the keyword is an acceptable implementation. So it's disappointing C++ chooses to reject C keywords. My take is that C++ programs shouldn't be including sys/md5.h directly at all. That's the kernel's header. If they want to use md5, they go through libmd like everyone else. So it doesn't matter too much to me whether the wrapping happens in libmd md5.h or sys/md5.h. If sys/md5.h includes a static inline function, there are bigger problems with potentially trying to interpret C code as C++. Frankly, C++ is not a C dialect anymore. They happen to share a bare bones assemblerish ABI but other than that they are diverging. Your proposed macro seems ok, although it is pretty long for where it would be used. Maybe __min_size()? Best, Conrad On Thu, May 26, 2016 at 11:35 PM, Ed Schouten wrote: > Hi Conrad, > > 2016-05-27 7:31 GMT+02:00 Conrad E. Meyer : >> libmd: Work around C++'s inability to understand C > > So C++ doesn't support using 'static' within array types, right? What > I personally dislike about this specific change: > > - Including directly still doesn't work. > - If is ever going to include a 'static inline' function, > the static keyword would also be stripped off. > > Would it make sense to come up with a macro in to deal with= this? > > #if defined(__cplusplus) || defined(ancient compiler) > #define __minimum_size(n) n > #else > #define __minimum_size(n) static (n) > #endif > > That way we can annotate this everwhere we'd want, without needing to > care about compiler versions, languages, etc. > > -- > Ed Schouten > Nuxi, 's-Hertogenbosch, the Netherlands > KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Fri May 27 08:11:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0EFDB4CC7C; Fri, 27 May 2016 08:11:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 8A6FA1F21; Fri, 27 May 2016 08:11:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u4R8BKht001305 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 27 May 2016 11:11:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u4R8BKht001305 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u4R8BKZJ001304; Fri, 27 May 2016 11:11:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 May 2016 11:11:20 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300718 - in head/sys: kern sys Message-ID: <20160527081120.GJ38613@kib.kiev.ua> References: <201605260841.u4Q8ft9r045564@repo.freebsd.org> <20160526213716.GK58287@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) 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.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 08:11:31 -0000 On Fri, May 27, 2016 at 09:42:24AM +0200, Hans Petter Selasky wrote: > We cannot use the "bool" type in userspace at least, because > sizeof(bool) depends on the compiler. So the interface must use an > integer type at least, possibly uint8_t like now. What do you mean ? There are ABIs, and we expect all used compilers to follow common arch ABI. Old psABIs date back to time where _Bool did not existed yet, but now it is ubiquitious. E.g. both i386 and amd64 require _Bool have a representation by single byte, with the byte alignment. Can you give exact examples of the inconsistencies, on any platform, regardless of our tier ? From owner-svn-src-head@freebsd.org Fri May 27 08:19:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F253BB4CF03; Fri, 27 May 2016 08:19:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4C9D133B; Fri, 27 May 2016 08:19:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E4A9A1FE024; Fri, 27 May 2016 10:19:35 +0200 (CEST) Subject: Re: svn commit: r300718 - in head/sys: kern sys To: Konstantin Belousov References: <201605260841.u4Q8ft9r045564@repo.freebsd.org> <20160526213716.GK58287@FreeBSD.org> <20160527081120.GJ38613@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Fri, 27 May 2016 10:22:55 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160527081120.GJ38613@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 08:19:39 -0000 On 05/27/16 10:11, Konstantin Belousov wrote: > On Fri, May 27, 2016 at 09:42:24AM +0200, Hans Petter Selasky wrote: >> We cannot use the "bool" type in userspace at least, because >> sizeof(bool) depends on the compiler. So the interface must use an >> integer type at least, possibly uint8_t like now. > > What do you mean ? There are ABIs, and we expect all used compilers to > follow common arch ABI. Old psABIs date back to time where _Bool > did not existed yet, but now it is ubiquitious. E.g. both i386 and > amd64 require _Bool have a representation by single byte, with the > byte alignment. > > Can you give exact examples of the inconsistencies, on any platform, > regardless of our tier ? > Hi, I was reading this article: http://stackoverflow.com/questions/4897844/is-sizeofbool-defined And is says: sizeof(bool) is not required to be 1. --HPS From owner-svn-src-head@freebsd.org Fri May 27 08:37:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9265B49696; Fri, 27 May 2016 08:37:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 293491EB7; Fri, 27 May 2016 08:37:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u4R8bZTH007259 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 27 May 2016 11:37:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u4R8bZTH007259 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u4R8bZnv007258; Fri, 27 May 2016 11:37:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 May 2016 11:37:35 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300718 - in head/sys: kern sys Message-ID: <20160527083735.GK38613@kib.kiev.ua> References: <201605260841.u4Q8ft9r045564@repo.freebsd.org> <20160526213716.GK58287@FreeBSD.org> <20160527081120.GJ38613@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) 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.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 08:37:40 -0000 On Fri, May 27, 2016 at 10:22:55AM +0200, Hans Petter Selasky wrote: > On 05/27/16 10:11, Konstantin Belousov wrote: > > On Fri, May 27, 2016 at 09:42:24AM +0200, Hans Petter Selasky wrote: > >> We cannot use the "bool" type in userspace at least, because > >> sizeof(bool) depends on the compiler. So the interface must use an > >> integer type at least, possibly uint8_t like now. > > > > What do you mean ? There are ABIs, and we expect all used compilers to > > follow common arch ABI. Old psABIs date back to time where _Bool > > did not existed yet, but now it is ubiquitious. E.g. both i386 and > > amd64 require _Bool have a representation by single byte, with the > > byte alignment. > > > > Can you give exact examples of the inconsistencies, on any platform, > > regardless of our tier ? > > > > Hi, > > I was reading this article: > http://stackoverflow.com/questions/4897844/is-sizeofbool-defined > > And is says: > sizeof(bool) is not required to be 1. It is clear that the answers you referenced talk about requirements of the C standard. From owner-svn-src-head@freebsd.org Fri May 27 08:48:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB761B49AE6; Fri, 27 May 2016 08:48:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2EEE16E7; Fri, 27 May 2016 08:48:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4R8mXs2078904; Fri, 27 May 2016 08:48:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R8mXH7078903; Fri, 27 May 2016 08:48:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605270848.u4R8mXH7078903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 27 May 2016 08:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300836 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 08:48:35 -0000 Author: ngie Date: Fri May 27 08:48:33 2016 New Revision: 300836 URL: https://svnweb.freebsd.org/changeset/base/300836 Log: Quell false positives in svc_vc_create and svc_vc_create_conn with cd and xprt Both cd and xprt will be non-NULL after their respective malloc(9) wrappers are called (mem_alloc and svc_xprt_alloc, which calls mem_alloc) as mem_alloc always gets called with M_WAITOK|M_ZERO today. Thus, testing for them being non-NULL is incorrect -- it misleads Coverity and it misleads the reader. Remove some unnecessary NULL initializations as a follow up to help solidify the fact that these pointers will be initialized properly in sys/rpc/.. with the interfaces the way they are currently. Differential Revision: https://reviews.freebsd.org/D6572 MFC after: 2 weeks Reported by: Coverity CID: 1007338, 1007339, 1007340 Reviewed by: markj, truckman Sponsored by: EMC / Isilon Storage Division Modified: head/sys/rpc/svc_vc.c Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Fri May 27 07:33:49 2016 (r300835) +++ head/sys/rpc/svc_vc.c Fri May 27 08:48:33 2016 (r300836) @@ -143,7 +143,7 @@ SVCXPRT * svc_vc_create(SVCPOOL *pool, struct socket *so, size_t sendsize, size_t recvsize) { - SVCXPRT *xprt = NULL; + SVCXPRT *xprt; struct sockaddr* sa; int error; @@ -189,11 +189,11 @@ svc_vc_create(SVCPOOL *pool, struct sock SOCKBUF_UNLOCK(&so->so_rcv); return (xprt); + cleanup_svc_vc_create: - if (xprt) { - sx_destroy(&xprt->xp_lock); - svc_xprt_free(xprt); - } + sx_destroy(&xprt->xp_lock); + svc_xprt_free(xprt); + return (NULL); } @@ -203,8 +203,8 @@ cleanup_svc_vc_create: SVCXPRT * svc_vc_create_conn(SVCPOOL *pool, struct socket *so, struct sockaddr *raddr) { - SVCXPRT *xprt = NULL; - struct cf_conn *cd = NULL; + SVCXPRT *xprt; + struct cf_conn *cd; struct sockaddr* sa = NULL; struct sockopt opt; int one = 1; @@ -279,12 +279,10 @@ svc_vc_create_conn(SVCPOOL *pool, struct return (xprt); cleanup_svc_vc_create: - if (xprt) { - sx_destroy(&xprt->xp_lock); - svc_xprt_free(xprt); - } - if (cd) - mem_free(cd, sizeof(*cd)); + sx_destroy(&xprt->xp_lock); + svc_xprt_free(xprt); + mem_free(cd, sizeof(*cd)); + return (NULL); } From owner-svn-src-head@freebsd.org Fri May 27 09:13:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBF00B4A487; Fri, 27 May 2016 09:13:24 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B685B145D; Fri, 27 May 2016 09:13:24 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.100] (p508F1C85.dip0.t-ipconnect.de [80.143.28.133]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 5FA65721E281E; Fri, 27 May 2016 11:13:11 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300679 - head/sys/netinet From: Michael Tuexen In-Reply-To: <20160526213308.GJ58287@FreeBSD.org> Date: Fri, 27 May 2016 11:13:07 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <170591C9-DA72-4780-93C6-41B81131F9DB@freebsd.org> References: <201605251348.u4PDmQdA040104@repo.freebsd.org> <20160526213308.GJ58287@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3124) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 09:13:25 -0000 > On 26 May 2016, at 23:33, Gleb Smirnoff wrote: >=20 > Michael, >=20 > On Wed, May 25, 2016 at 01:48:26PM +0000, Michael Tuexen wrote: > M> Author: tuexen > M> Date: Wed May 25 13:48:26 2016 > M> New Revision: 300679 > M> URL: https://svnweb.freebsd.org/changeset/base/300679 > M>=20 > M> Log: > M> Count packets as not being delivered only if they are neither > M> processed by a kernel handler nor by a raw socket. > M> =20 > M> MFC after: 1 week > M>=20 > M> Modified: > M> head/sys/netinet/raw_ip.c > M>=20 > M> Modified: head/sys/netinet/raw_ip.c > M> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > M> --- head/sys/netinet/raw_ip.c Wed May 25 13:09:06 2016 = (r300678) > M> +++ head/sys/netinet/raw_ip.c Wed May 25 13:48:26 2016 = (r300679) > M> @@ -132,6 +132,8 @@ int (*ip_rsvp_vif)(struct socket *, stru > M> void (*ip_rsvp_force_done)(struct socket *); > M> #endif /* INET */ > M> =20 > M> +extern struct protosw inetsw[]; > M> + > M> u_long rip_sendspace =3D 9216; > M> SYSCTL_ULONG(_net_inet_raw, OID_AUTO, maxdgram, CTLFLAG_RW, > M> &rip_sendspace, 0, "Maximum outgoing raw IP datagram size"); > M> @@ -411,9 +413,11 @@ rip_input(struct mbuf **mp, int *offp, i > M> IPSTAT_INC(ips_delivered); > M> INP_RUNLOCK(last); > M> } else { > M> + if (inetsw[ip_protox[ip->ip_p]].pr_input =3D=3D = rip_input) { > M> + IPSTAT_INC(ips_noproto); > M> + IPSTAT_DEC(ips_delivered); > M> + } > M> m_freem(m); > M> - IPSTAT_INC(ips_noproto); > M> - IPSTAT_DEC(ips_delivered); > M> } > M> return (IPPROTO_DONE); > M> } >=20 > How could it happen at this place that = inetsw[ip_protox[ip->ip_p]].pr_input !=3D rip_input? Hi Gleb, rip_input() does not only get called when there is no protocol handler = in the kernel for the protocol, but also, for example, for ICMP. See = http://svnweb.freebsd.org/base/head/sys/netinet/ip_icmp.c?revision=3D30069= 9&view=3Dmarkup#l684 I think we should only increment the ips_noproto counter when we neither = have a handler for it in the kernel nor any raw socket. That is why I added the condition. = Did I miss anything? >=20 > Another question. Can we get rid of ugly IPSTAT_DEC()? Since pr_input = is an integer, > we could return error up to ip_input() that would indicate = non-delivery. I think the return code indicates whether the packet processing is done = or not, not to return an error. Best regards Michael >=20 > --=20 > Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri May 27 09:22:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C4DFB4A67F; Fri, 27 May 2016 09:22:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9E42A1A83; Fri, 27 May 2016 09:22:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 6B62C3C3F10; Fri, 27 May 2016 19:22:31 +1000 (AEST) Date: Fri, 27 May 2016 19:22:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker cc: John Baldwin , Alan Somers , Peter Wemm , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r300557 - head/usr.sbin/apmd In-Reply-To: <20160526175420.GA31199@stack.nl> Message-ID: <20160527181051.Y2719@besplex.bde.org> References: <201605240315.u4O3FkMt001717@repo.freebsd.org> <2084098.Ir36lcS1Gf@ralph.baldwin.cx> <20160526175420.GA31199@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=BbAJd8o89xd2n4L0m28A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 09:22:37 -0000 On Thu, 26 May 2016, Jilles Tjoelker wrote: > On Tue, May 24, 2016 at 08:52:32AM -0700, John Baldwin wrote: >> On Monday, May 23, 2016 09:24:41 PM Alan Somers wrote: >>> On Mon, May 23, 2016 at 9:15 PM, Peter Wemm wrote: > >>>> Author: peter >>>> Date: Tue May 24 03:15:46 2016 >>>> New Revision: 300557 >>>> URL: https://svnweb.freebsd.org/changeset/base/300557 > >>>> Log: >>>> It seems is a new prerequisite for after >>>> r300539. Attempt to fix the build for i386. > >>>> Modified: >>>> head/usr.sbin/apmd/apmd.c >>>> head/usr.sbin/apmd/apmdlex.l >>>> head/usr.sbin/apmd/apmdparse.y > >>> Are you sure this is necessary, even after 300544? > >> Actually, we try to avoid nested includes when possible for userland, >> so I'd be inclined to drop the nested include and just >> add to the places that need it. Userland code in the >> base system is supposed to have or as the >> first #include anyway (which apmd was not following), so any fixes to >> userland are probably style fixes anyway. > > This is traditional BSD convention, but headers specified by POSIX work > differently. POSIX headers can be included alone, so files that only > include POSIX headers rarely need #include . This often > causes some ugliness in the header file to use hidden names for things > to reduce namespace pollution. > > Since is not specified by POSIX, it is not required to > work without prerequisites. However, its man page always documented that it has no prequisites. Except, its man page has a cryptic reference to malloc(3). This used to mean "bit_alloc() allocates storage using calloc(), but we're not telling you this detail, or that you must include to get calloc() declared iff you use bit_alloc(). It now means "bit_alloc(), allocates storage using calloc(), but we're not telling you this detail, or that we now include as undocumented namespace pollution since this is the quickest fix for namespace problems caused by changing the implementation of bit_alloc() from a macro to an inline function". sys/bitstring.h has the following old namespace problems: - use of calloc(), and intentionally keeping itself "clean" by not declaring this. This was a smaller problem when bit_alloc() was a macro. and the following new namespace problems: - use of ffsl(), and intentionally keeping itself "clean" by not declaring this. Just declaring this should work. If ffsl() is not translated by the compiler to __builtin_ffsl(), too bad. - use of __bitcountl(), and intentionally keeping itself "clean" by not declaring this. The builtin is spelled __builtin_popcountl() but we wrap this to our spelling. The underscores might prevent translation to the builtin (probably only with strict compiler flags) and the spelling change certainly prevent it. This is technically better than polluting the application namespace like using ffsl() does, and the spelling change gives us more control (which we use to provide 50 lines of compatibility cruft), but it means that just declaring the function won't work. It is only defined in . Thus gives as a new prerequisite and thus mostly defeats the otherwise mostly careful-to-a-fault anti-pollution measures in :-(. sys/bitstring.h uses unsigned long instead of a possibly-better type like __uregister_t or __uintmax_t partly to avoid pollution. - undocumented include of as a quick fix for the previous problem. Plain bitstring.h has the following new namespace pollutions: - undocumented include of as a quick fix for the calloc() problem - undocumented include of as a quick fix for the ffsl() problem These headers are too careful about pollution to include , so they don't accidentally define __bitcountl(). Bruce From owner-svn-src-head@freebsd.org Fri May 27 10:37:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF095B4BD52; Fri, 27 May 2016 10:37:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 4BF471FC2; Fri, 27 May 2016 10:37:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id C3F0AD63DD1; Fri, 27 May 2016 20:06:54 +1000 (AEST) Date: Fri, 27 May 2016 20:06:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Gleb Smirnoff , Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300718 - in head/sys: kern sys In-Reply-To: <1464303288.1204.65.camel@freebsd.org> Message-ID: <20160527192816.N2935@besplex.bde.org> References: <201605260841.u4Q8ft9r045564@repo.freebsd.org> <20160526213716.GK58287@FreeBSD.org> <1464303288.1204.65.camel@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=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=P0YNdPaFfFjUPGrzGLAA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 10:37:53 -0000 On Thu, 26 May 2016, Ian Lepore wrote: > On Thu, 2016-05-26 at 14:37 -0700, Gleb Smirnoff wrote: >> Hans, >> >> On Thu, May 26, 2016 at 08:41:55AM +0000, Hans Petter Selasky wrote: >> H> Author: hselasky >> H> Date: Thu May 26 08:41:55 2016 >> H> New Revision: 300718 >> H> URL: https://svnweb.freebsd.org/changeset/base/300718 >> H> >> H> Log: >> H> Add support for boolean sysctl's. >> H> >> H> Because the size of bool can be implementation defined, make a >> bool >> H> sysctl handler which handle bools. Userspace sees the bools like >> H> unsigned 8-bit integers. Values are filtered to either 1 or 0 >> upon >> H> read and write, similar to what a compiler would do. >> H> >> H> Requested by: kmacy @ >> H> Sponsored by: Mellanox Technologies >> >> Would be nice if sysctl(8) would explicitly display them as "true" or >> >> "false" >> instead of 0 and 1. Now the userland can't differ them from uint8_t >> oids. > > If it displayed them that way, then users would want to set them using > the true/false strings too. If you start down that path you eventually > end up adding support for 0/1/true/false/yes/no/on/off, and if you > don't do that in exactly once place you end up with some oids accepting > all the values and others accepting only some of them, and the user > experience is confusing at best. Don't forget to support mixed case and internationalized spellings, and add this support to all utilities that might be used to on sysctl output. Even hex output is more than some other utilities can handle, so there has to be an option to produce a common format which can only be decimal integer with no internationalizations like thousand separators. sysctl -a now produces a disgusting amount amount of xml and other output that it can't possibly parse as input. I tried its -h flag but it didn't fix the xml by removing it :-). Bruce From owner-svn-src-head@freebsd.org Fri May 27 11:37:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CF4AB4C105; Fri, 27 May 2016 11:37:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E07411B2; Fri, 27 May 2016 11:37:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBb2eG041165; Fri, 27 May 2016 11:37:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBb2aX041164; Fri, 27 May 2016 11:37:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605271137.u4RBb2aX041164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 27 May 2016 11:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300837 - head/sys/dev/iser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:37:03 -0000 Author: trasz Date: Fri May 27 11:37:02 2016 New Revision: 300837 URL: https://svnweb.freebsd.org/changeset/base/300837 Log: Fix build on i386. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iser/iser_verbs.c Modified: head/sys/dev/iser/iser_verbs.c ============================================================================== --- head/sys/dev/iser/iser_verbs.c Fri May 27 08:48:33 2016 (r300836) +++ head/sys/dev/iser/iser_verbs.c Fri May 27 11:37:02 2016 (r300837) @@ -136,10 +136,12 @@ static void iser_handle_wc(struct ib_wc struct iser_conn *iser_conn = container_of(ib_conn, struct iser_conn, ib_conn); if (wc->status != IB_WC_WR_FLUSH_ERR) { - ISER_ERR("conn %p wr id %lx status %d vend_err %x", - iser_conn, wc->wr_id, wc->status, wc->vendor_err); + ISER_ERR("conn %p wr id %llx status %d vend_err %x", + iser_conn, (unsigned long long)wc->wr_id, + wc->status, wc->vendor_err); } else { - ISER_DBG("flush error: conn %p wr id %lx", iser_conn, wc->wr_id); + ISER_DBG("flush error: conn %p wr id %llx", + iser_conn, (unsigned long long)wc->wr_id); } if (wc->wr_id == ISER_BEACON_WRID) { From owner-svn-src-head@freebsd.org Fri May 27 11:37:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9084BB4C1B0; Fri, 27 May 2016 11:37:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D3561334; Fri, 27 May 2016 11:37:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBbutU041233; Fri, 27 May 2016 11:37:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBbu69041232; Fri, 27 May 2016 11:37:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605271137.u4RBbu69041232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 27 May 2016 11:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300838 - head/sys/modules/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:37:57 -0000 Author: trasz Date: Fri May 27 11:37:56 2016 New Revision: 300838 URL: https://svnweb.freebsd.org/changeset/base/300838 Log: Build iscsi(4) with ICL_KERNEL_PROXY when building with WITH_OFED. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/modules/iscsi/Makefile Modified: head/sys/modules/iscsi/Makefile ============================================================================== --- head/sys/modules/iscsi/Makefile Fri May 27 11:37:02 2016 (r300837) +++ head/sys/modules/iscsi/Makefile Fri May 27 11:37:56 2016 (r300838) @@ -1,5 +1,8 @@ # $FreeBSD$ +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" + .PATH: ${.CURDIR}/../../dev/iscsi/ KMOD= iscsi @@ -13,7 +16,9 @@ SRCS+= device_if.h SRCS+= icl_conn_if.c SRCS+= icl_conn_if.h -#CFLAGS+=-DICL_KERNEL_PROXY +.if ${MK_OFED} != "no" || defined(ALL_MODULES) +CFLAGS+=-DICL_KERNEL_PROXY +.endif MFILES= kern/bus_if.m kern/device_if.m dev/iscsi/icl_conn_if.m From owner-svn-src-head@freebsd.org Fri May 27 11:39:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0DA3B4C23F; Fri, 27 May 2016 11:39:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 814671670; Fri, 27 May 2016 11:39:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBd8UL041331; Fri, 27 May 2016 11:39:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBd87f041330; Fri, 27 May 2016 11:39:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605271139.u4RBd87f041330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 27 May 2016 11:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300839 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:39:09 -0000 Author: trasz Date: Fri May 27 11:39:08 2016 New Revision: 300839 URL: https://svnweb.freebsd.org/changeset/base/300839 Log: Attach iser(4) to the build. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 27 11:37:56 2016 (r300838) +++ head/sys/modules/Makefile Fri May 27 11:39:08 2016 (r300839) @@ -174,6 +174,7 @@ SUBDIR= \ ${_ipw} \ ${_ipwfw} \ ${_isci} \ + ${_iser} \ isp \ ${_ispfw} \ ${_iwi} \ @@ -556,6 +557,7 @@ _igb= igb _io= io .if ${MK_OFED} != "no" || defined(ALL_MODULES) _ipoib= ipoib +_iser= iser .endif _ix= ix _ixv= ixv From owner-svn-src-head@freebsd.org Fri May 27 11:44:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AF51B4C431; Fri, 27 May 2016 11:44:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F12661B52; Fri, 27 May 2016 11:44:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBifVN044991; Fri, 27 May 2016 11:44:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBiepv044983; Fri, 27 May 2016 11:44:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605271144.u4RBiepv044983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 27 May 2016 11:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300840 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:44:42 -0000 Author: arybchik Date: Fri May 27 11:44:40 2016 New Revision: 300840 URL: https://svnweb.freebsd.org/changeset/base/300840 Log: sfxge(4): note unused variables to make lint happier Found by lint on illumos. Submitted by: Garrett D'Amore Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/hunt_phy.c head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri May 27 11:39:08 2016 (r300839) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri May 27 11:44:40 2016 (r300840) @@ -903,6 +903,8 @@ ef10_nvram_buffer_find_end( efx_rc_t rc; uint32_t *segment_used; + _NOTE(ARGUNUSED(offset)) + if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)bufferp, buffer_size)) != 0) { rc = EFAULT; @@ -1078,6 +1080,8 @@ ef10_nvram_buffer_delete_item( efx_rc_t rc; tlv_cursor_t cursor; + _NOTE(ARGUNUSED(length, end)) + if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp, buffer_size, offset)) != 0) { goto fail1; Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri May 27 11:39:08 2016 (r300839) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri May 27 11:44:40 2016 (r300840) @@ -601,6 +601,8 @@ ef10_rx_prefix_pktlen( __in uint8_t *buffer, __out uint16_t *lengthp) { + _NOTE(ARGUNUSED(enp)) + /* * The RX pseudo-header contains the packet length, excluding the * pseudo-header. If the hardware receive datapath was operating in @@ -619,6 +621,8 @@ ef10_rx_prefix_hash( __in efx_rx_hash_alg_t func, __in uint8_t *buffer) { + _NOTE(ARGUNUSED(enp)) + switch (func) { case EFX_RX_HASHALG_TOEPLITZ: return (buffer[0] | @@ -745,7 +749,7 @@ ef10_rx_qcreate( efx_rc_t rc; boolean_t disable_scatter; - _NOTE(ARGUNUSED(erp)) + _NOTE(ARGUNUSED(id, erp)) EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << ESF_DZ_RX_QLABEL_WIDTH)); EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS); Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri May 27 11:39:08 2016 (r300839) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri May 27 11:44:40 2016 (r300840) @@ -195,6 +195,7 @@ ef10_tx_qcreate( efx_qword_t desc; efx_rc_t rc; + _NOTE(ARGUNUSED(id)) if ((rc = efx_mcdi_init_txq(enp, n, eep->ee_index, label, index, flags, esmp)) != 0) Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Fri May 27 11:39:08 2016 (r300839) +++ head/sys/dev/sfxge/common/efx_ev.c Fri May 27 11:44:40 2016 (r300840) @@ -1264,6 +1264,8 @@ siena_ev_qcreate( efx_oword_t oword; efx_rc_t rc; + _NOTE(ARGUNUSED(esmp)) + EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MAXNEVS)); EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MINNEVS)); Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri May 27 11:39:08 2016 (r300839) +++ head/sys/dev/sfxge/common/efx_rx.c Fri May 27 11:44:40 2016 (r300840) @@ -965,6 +965,8 @@ siena_rx_prefix_hash( __in efx_rx_hash_alg_t func, __in uint8_t *buffer) { + _NOTE(ARGUNUSED(enp)) + switch (func) { case EFX_RX_HASHALG_TOEPLITZ: return ((buffer[12] << 24) | @@ -988,6 +990,8 @@ siena_rx_prefix_pktlen( __in uint8_t *buffer, __out uint16_t *lengthp) { + _NOTE(ARGUNUSED(enp, buffer, lengthp)) + /* Not supported by Falcon/Siena hardware */ EFSYS_ASSERT(0); return (ENOTSUP); @@ -1120,6 +1124,8 @@ siena_rx_qcreate( boolean_t jumbo; efx_rc_t rc; + _NOTE(ARGUNUSED(esmp)) + EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH)); EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS); Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Fri May 27 11:39:08 2016 (r300839) +++ head/sys/dev/sfxge/common/efx_tx.c Fri May 27 11:44:40 2016 (r300840) @@ -901,6 +901,8 @@ siena_tx_qcreate( uint32_t size; efx_rc_t rc; + _NOTE(ARGUNUSED(esmp)) + EFX_STATIC_ASSERT(EFX_EV_TX_NLABELS == (1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH)); EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS); Modified: head/sys/dev/sfxge/common/hunt_phy.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_phy.c Fri May 27 11:39:08 2016 (r300839) +++ head/sys/dev/sfxge/common/hunt_phy.c Fri May 27 11:44:40 2016 (r300840) @@ -92,6 +92,8 @@ hunt_bist_poll( uint32_t result; efx_rc_t rc; + _NOTE(ARGUNUSED(type)) + (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_POLL_BIST; req.emr_in_buf = payload; Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Fri May 27 11:39:08 2016 (r300839) +++ head/sys/dev/sfxge/common/siena_mcdi.c Fri May 27 11:44:40 2016 (r300840) @@ -174,6 +174,8 @@ siena_mcdi_init( unsigned int portnum; efx_rc_t rc; + _NOTE(ARGUNUSED(mtp)) + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); /* Determine the port number to use for MCDI */ @@ -212,6 +214,7 @@ fail1: siena_mcdi_fini( __in efx_nic_t *enp) { + _NOTE(ARGUNUSED(enp)) } __checkReturn efx_rc_t From owner-svn-src-head@freebsd.org Fri May 27 11:45:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EABEBB4C492; Fri, 27 May 2016 11:45:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC2141CD9; Fri, 27 May 2016 11:45:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBjgBv045075; Fri, 27 May 2016 11:45:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBjg31045072; Fri, 27 May 2016 11:45:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605271145.u4RBjg31045072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 27 May 2016 11:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300841 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:45:44 -0000 Author: arybchik Date: Fri May 27 11:45:42 2016 New Revision: 300841 URL: https://svnweb.freebsd.org/changeset/base/300841 Log: sfxge(4): add constant condition note to make lint happier Found by lint on illumos. Submitted by: Garrett D'Amore Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_mcdi.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_tx.c Modified: head/sys/dev/sfxge/common/ef10_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mcdi.c Fri May 27 11:44:40 2016 (r300840) +++ head/sys/dev/sfxge/common/ef10_mcdi.c Fri May 27 11:45:42 2016 (r300841) @@ -213,6 +213,7 @@ ef10_mcdi_poll_reboot( * this can be handled by common code drivers (and reworked to * support Siena too). */ + _NOTE(CONSTANTCONDITION) if (B_FALSE) { rc = EIO; goto fail1; Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri May 27 11:44:40 2016 (r300840) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri May 27 11:45:42 2016 (r300841) @@ -1677,6 +1677,7 @@ ef10_nic_register_test( /* FIXME */ _NOTE(ARGUNUSED(enp)) + _NOTE(CONSTANTCONDITION) if (B_FALSE) { rc = ENOTSUP; goto fail1; Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri May 27 11:44:40 2016 (r300840) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri May 27 11:45:42 2016 (r300841) @@ -649,6 +649,7 @@ ef10_tx_qpace( /* FIXME */ _NOTE(ARGUNUSED(etp, ns)) + _NOTE(CONSTANTCONDITION) if (B_FALSE) { rc = ENOTSUP; goto fail1; From owner-svn-src-head@freebsd.org Fri May 27 11:46:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46B22B4C515; Fri, 27 May 2016 11:46:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13C6B1E44; Fri, 27 May 2016 11:46:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBkaA8045157; Fri, 27 May 2016 11:46:36 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBkaGX045155; Fri, 27 May 2016 11:46:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605271146.u4RBkaGX045155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 27 May 2016 11:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300842 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:46:37 -0000 Author: arybchik Date: Fri May 27 11:46:35 2016 New Revision: 300842 URL: https://svnweb.freebsd.org/changeset/base/300842 Log: sfxge(4): remove unreachable break after goto Found by lint on illumos. Submitted by: Garrett D'Amore Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_mcdi.c head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/ef10_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mcdi.c Fri May 27 11:45:42 2016 (r300841) +++ head/sys/dev/sfxge/common/ef10_mcdi.c Fri May 27 11:46:35 2016 (r300842) @@ -288,7 +288,6 @@ ef10_mcdi_feature_supported( default: rc = ENOTSUP; goto fail1; - break; } return (0); Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Fri May 27 11:45:42 2016 (r300841) +++ head/sys/dev/sfxge/common/siena_mcdi.c Fri May 27 11:46:35 2016 (r300842) @@ -237,7 +237,6 @@ siena_mcdi_feature_supported( default: rc = ENOTSUP; goto fail1; - break; } return (0); From owner-svn-src-head@freebsd.org Fri May 27 11:46:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A0C2B4C566; Fri, 27 May 2016 11:46:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B2AE1FB7; Fri, 27 May 2016 11:46:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBksMK045213; Fri, 27 May 2016 11:46:54 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBkspo045212; Fri, 27 May 2016 11:46:54 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605271146.u4RBkspo045212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 27 May 2016 11:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300843 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:46:55 -0000 Author: bapt Date: Fri May 27 11:46:54 2016 New Revision: 300843 URL: https://svnweb.freebsd.org/changeset/base/300843 Log: Improve error message when failing to open a backing file When bhyve cannot open a backing file, it now says explicitly which file could not be opened Note that the change has only be maed in block_if.c and not in pci_virtio_block.c as the error will always be catched by the first PR: 202321 (different patch) Reviewed by: grehan MFC after: 3 day Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D6576 Modified: head/usr.sbin/bhyve/block_if.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Fri May 27 11:46:35 2016 (r300842) +++ head/usr.sbin/bhyve/block_if.c Fri May 27 11:46:54 2016 (r300843) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -447,12 +448,12 @@ blockif_open(const char *optstr, const c } if (fd < 0) { - perror("Could not open backing file"); + warn("Could not open backing file: %s", nopt); goto err; } if (fstat(fd, &sbuf) < 0) { - perror("Could not stat backing file"); + warn("Could not stat backing file %s", nopt); goto err; } From owner-svn-src-head@freebsd.org Fri May 27 11:47:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6850B4C5A7; Fri, 27 May 2016 11:47:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6DF11147; Fri, 27 May 2016 11:47:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBlBLm045286; Fri, 27 May 2016 11:47:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBlBSY045285; Fri, 27 May 2016 11:47:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605271147.u4RBlBSY045285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 27 May 2016 11:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300844 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:47:13 -0000 Author: arybchik Date: Fri May 27 11:47:11 2016 New Revision: 300844 URL: https://svnweb.freebsd.org/changeset/base/300844 Log: sfxge(4): remove set but not used variable Found by lint on illumos. Submitted by: Garrett D'Amore Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri May 27 11:46:54 2016 (r300843) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri May 27 11:47:11 2016 (r300844) @@ -795,7 +795,6 @@ ef10_nic_alloc_piobufs( { efx_piobuf_handle_t *handlep; unsigned int i; - efx_rc_t rc; EFSYS_ASSERT3U(max_piobuf_count, <=, EFX_ARRAY_SIZE(enp->en_arch.ef10.ena_piobuf_handle)); @@ -805,7 +804,7 @@ ef10_nic_alloc_piobufs( for (i = 0; i < max_piobuf_count; i++) { handlep = &enp->en_arch.ef10.ena_piobuf_handle[i]; - if ((rc = efx_mcdi_alloc_piobuf(enp, handlep)) != 0) + if (efx_mcdi_alloc_piobuf(enp, handlep) != 0) goto fail1; enp->en_arch.ef10.ena_pio_alloc_map[i] = 0; From owner-svn-src-head@freebsd.org Fri May 27 11:47:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 409EAB4C62C; Fri, 27 May 2016 11:47:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1206B12DD; Fri, 27 May 2016 11:47:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBluve045350; Fri, 27 May 2016 11:47:56 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBlufF045349; Fri, 27 May 2016 11:47:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605271147.u4RBlufF045349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 27 May 2016 11:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300845 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:47:57 -0000 Author: arybchik Date: Fri May 27 11:47:56 2016 New Revision: 300845 URL: https://svnweb.freebsd.org/changeset/base/300845 Log: sfxge(4): cope with lint for EFX_SET_OWORD_BIT() with const bit arg Found by lint on illumos. Submitted by: Garrett D'Amore Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/siena_mac.c Modified: head/sys/dev/sfxge/common/siena_mac.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mac.c Fri May 27 11:47:11 2016 (r300844) +++ head/sys/dev/sfxge/common/siena_mac.c Fri May 27 11:47:56 2016 (r300845) @@ -158,8 +158,17 @@ siena_mac_reconfigure( * so we always add bit 0xff to the mask (bit 0x7f in the * second octword). */ - if (epp->ep_brdcst) + if (epp->ep_brdcst) { + /* + * NOTE: due to constant folding, some of this evaluates + * to null expressions, giving E_EXPR_NULL_EFFECT during + * lint on Illumos. No good way to fix this without + * explicit coding the individual word/bit setting. + * So just suppress lint for this one line. + */ + /* LINTED */ EFX_SET_OWORD_BIT(multicast_hash[1], 0x7f); + } (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_SET_MCAST_HASH; From owner-svn-src-head@freebsd.org Fri May 27 11:48:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C75FB4C67F; Fri, 27 May 2016 11:48:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E8E1162A; Fri, 27 May 2016 11:48:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBmP2s045413; Fri, 27 May 2016 11:48:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBmP3a045412; Fri, 27 May 2016 11:48:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605271148.u4RBmP3a045412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 27 May 2016 11:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300846 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:48:26 -0000 Author: arybchik Date: Fri May 27 11:48:25 2016 New Revision: 300846 URL: https://svnweb.freebsd.org/changeset/base/300846 Log: sfxge(4): unsigned 1 should be shifted to produce bitmask Found by lint on illumos. Submitted by: Garrett D'Amore Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Fri May 27 11:47:56 2016 (r300845) +++ head/sys/dev/sfxge/common/mcdi_mon.c Fri May 27 11:48:25 2016 (r300846) @@ -367,7 +367,7 @@ efx_mcdi_sensor_info_npages( goto fail1; } } while (MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK) & - (1 << MC_CMD_SENSOR_PAGE0_NEXT)); + (1U << MC_CMD_SENSOR_PAGE0_NEXT)); *npagesp = page; From owner-svn-src-head@freebsd.org Fri May 27 11:49:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94D2CB4C736; Fri, 27 May 2016 11:49:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6633017D1; Fri, 27 May 2016 11:49:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBn5dQ045483; Fri, 27 May 2016 11:49:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBn50X045482; Fri, 27 May 2016 11:49:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605271149.u4RBn50X045482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 27 May 2016 11:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300847 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:49:06 -0000 Author: arybchik Date: Fri May 27 11:49:05 2016 New Revision: 300847 URL: https://svnweb.freebsd.org/changeset/base/300847 Log: sfxge(4): cope with always true unsigned comparison with 0 to make lint happier Found by lint on illumos. Submitted by: Garrett D'Amore Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri May 27 11:48:25 2016 (r300846) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri May 27 11:49:05 2016 (r300847) @@ -50,14 +50,15 @@ efx_mcdi_init_rxq( { efx_mcdi_req_t req; uint8_t payload[ - MAX(MC_CMD_INIT_RXQ_IN_LEN(EFX_RXQ_NBUFS(EFX_RXQ_MAXNDESCS)), - MC_CMD_INIT_RXQ_OUT_LEN)]; + MC_CMD_INIT_RXQ_IN_LEN(EFX_RXQ_NBUFS(EFX_RXQ_MAXNDESCS))]; int npages = EFX_RXQ_NBUFS(size); int i; efx_qword_t *dma_addr; uint64_t addr; efx_rc_t rc; + /* If this changes, then the payload size might need to change. */ + EFSYS_ASSERT3U(MC_CMD_INIT_RXQ_OUT_LEN, ==, 0); EFSYS_ASSERT3U(size, <=, EFX_RXQ_MAXNDESCS); (void) memset(payload, 0, sizeof (payload)); From owner-svn-src-head@freebsd.org Fri May 27 11:49:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35F59B4C787; Fri, 27 May 2016 11:49:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0825A19A7; Fri, 27 May 2016 11:49:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBnkn9045548; Fri, 27 May 2016 11:49:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBnkIB045547; Fri, 27 May 2016 11:49:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605271149.u4RBnkIB045547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 27 May 2016 11:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300848 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:49:47 -0000 Author: arybchik Date: Fri May 27 11:49:46 2016 New Revision: 300848 URL: https://svnweb.freebsd.org/changeset/base/300848 Log: sfxge(4): avoid necessity to add one more constant condition note Use for forever loop instead of while. Found by lint on illumos. Submitted by: Garrett D'Amore Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_nvram.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri May 27 11:49:05 2016 (r300847) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri May 27 11:49:46 2016 (r300848) @@ -362,7 +362,7 @@ tlv_last_segment_end( * is no end tag then the previous segment was the last valid one, * so return the pointer to its end tag. */ - while (1) { + for (;;) { if (tlv_init_cursor(&segment_cursor, segment_start, cursor->limit, segment_start) != 0) break; From owner-svn-src-head@freebsd.org Fri May 27 11:50:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C766BB4C7ED; Fri, 27 May 2016 11:50:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 988CE1B24; Fri, 27 May 2016 11:50:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBoQgl045637; Fri, 27 May 2016 11:50:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBoQsi045636; Fri, 27 May 2016 11:50:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605271150.u4RBoQsi045636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 27 May 2016 11:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300849 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:50:27 -0000 Author: arybchik Date: Fri May 27 11:50:26 2016 New Revision: 300849 URL: https://svnweb.freebsd.org/changeset/base/300849 Log: sfxge(4): fix typo in monitor types strings in common code Submitted by: Garrett D'Amore Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_mon.c Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Fri May 27 11:49:46 2016 (r300848) +++ head/sys/dev/sfxge/common/efx_mon.c Fri May 27 11:50:26 2016 (r300849) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); static const char *__efx_mon_name[] = { "", "sfx90x0", - "sfx91x0" + "sfx91x0", "sfx92x0" }; From owner-svn-src-head@freebsd.org Fri May 27 12:02:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DA8CB4A483; Fri, 27 May 2016 12:02:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AC221859; Fri, 27 May 2016 12:02:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RC2C6B052766; Fri, 27 May 2016 12:02:12 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RC2CAZ052765; Fri, 27 May 2016 12:02:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605271202.u4RC2CAZ052765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 27 May 2016 12:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300850 - head/sys/cddl/dev/dtrace/aarch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 12:02:13 -0000 Author: andrew Date: Fri May 27 12:02:12 2016 New Revision: 300850 URL: https://svnweb.freebsd.org/changeset/base/300850 Log: Fix dtrace_interrupt_disable and dtrace_interrupt_enable by having the former return the current status for the latter to use. Without this we could enable interrupts when they shouldn't be. It's still not quite right as it should only update the bits we care about, bit should be good enough until the correct fix can be tested. PR: 204270 Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S Fri May 27 11:50:26 2016 (r300849) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S Fri May 27 12:02:12 2016 (r300850) @@ -55,6 +55,7 @@ END(dtrace_membar_consumer) dtrace_icookie_t dtrace_interrupt_disable(void) */ ENTRY(dtrace_interrupt_disable) + mrs x0, daif msr daifset, #2 RET END(dtrace_interrupt_disable) @@ -63,7 +64,7 @@ END(dtrace_interrupt_disable) void dtrace_interrupt_enable(dtrace_icookie_t cookie) */ ENTRY(dtrace_interrupt_enable) - msr daifclr, #2 + msr daif, x0 RET END(dtrace_interrupt_enable) /* From owner-svn-src-head@freebsd.org Fri May 27 12:44:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3220B4AEEF; Fri, 27 May 2016 12:44:01 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA4D71AE9; Fri, 27 May 2016 12:44:01 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1b6H7J-000E2w-3U; Fri, 27 May 2016 15:43:53 +0300 Date: Fri, 27 May 2016 15:43:53 +0300 From: Slawa Olhovchenkov To: Ian Lepore Cc: Gleb Smirnoff , Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r300718 - in head/sys: kern sys Message-ID: <20160527124353.GD39874@zxy.spb.ru> References: <201605260841.u4Q8ft9r045564@repo.freebsd.org> <20160526213716.GK58287@FreeBSD.org> <1464303288.1204.65.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464303288.1204.65.camel@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 12:44:02 -0000 On Thu, May 26, 2016 at 04:54:48PM -0600, Ian Lepore wrote: > On Thu, 2016-05-26 at 14:37 -0700, Gleb Smirnoff wrote: > > Hans, > > > > On Thu, May 26, 2016 at 08:41:55AM +0000, Hans Petter Selasky wrote: > > H> Author: hselasky > > H> Date: Thu May 26 08:41:55 2016 > > H> New Revision: 300718 > > H> URL: https://svnweb.freebsd.org/changeset/base/300718 > > H> > > H> Log: > > H> Add support for boolean sysctl's. > > H> > > H> Because the size of bool can be implementation defined, make a > > bool > > H> sysctl handler which handle bools. Userspace sees the bools like > > H> unsigned 8-bit integers. Values are filtered to either 1 or 0 > > upon > > H> read and write, similar to what a compiler would do. > > H> > > H> Requested by: kmacy @ > > H> Sponsored by: Mellanox Technologies > > > > Would be nice if sysctl(8) would explicitly display them as "true" or > > "false" > > instead of 0 and 1. Now the userland can't differ them from uint8_t > > oids. > > If it displayed them that way, then users would want to set them using > the true/false strings too. If you start down that path you eventually MUST, not want. This is required by /etc/rc.d/sysctl (displayed value must be match seted) > end up adding support for 0/1/true/false/yes/no/on/off, and if you > don't do that in exactly once place you end up with some oids accepting > all the values and others accepting only some of them, and the user > experience is confusing at best. > > -- Ian > > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Fri May 27 14:43:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C436B4B82D; Fri, 27 May 2016 14:43:52 +0000 (UTC) (envelope-from jhb@freebsd.org) 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 6D9621704; Fri, 27 May 2016 14:43:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 56DD9B958; Fri, 27 May 2016 10:43:51 -0400 (EDT) From: John Baldwin To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300764 - head/sys/netinet Date: Fri, 27 May 2016 07:32:53 -0700 Message-ID: <2386120.9zOMGESfe3@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201605261835.u4QIZblp066704@repo.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); Fri, 27 May 2016 10:43:51 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 14:43:52 -0000 On Friday, May 27, 2016 12:14:28 AM Bjoern A. Zeeb wrote: > > > On 26 May 2016, at 18:35 , John Baldwin wrote: > > > > Author: jhb > > Date: Thu May 26 18:35:37 2016 > > New Revision: 300764 > > URL: https://svnweb.freebsd.org/changeset/base/300764 > > > > Log: > > Don't reuse the source mbuf in tcp_respond() if it is not writable. > > > > Not all mbufs passed up from device drivers are M_WRITABLE(). In > > particular, the Chelsio T4/T5 driver uses a feature called "buffer packing" > > to receive multiple frames in a single receive buffer. The mbufs for > > these frames all share the same external storage so are treated as > > read-only by the rest of the stack when multiple frames are in flight. > > Previously tcp_respond() would blindly overwrite read-only mbufs when > > INVARIANTS was disabled or panic with an assertion failure if INVARIANTS > > was enabled. Note that the new case is a bit of a mix of the two other > > cases in tcp_respond(). The TCP and IP headers must be copied explicitly > > into the new mbuf instead of being inherited (similar to the m == NULL > > case), but the addresses and ports must be swapped in the reply (similar > > to the m != NULL case). > > Is the same true for ICMP(v6) replies? Hmm, icmp_error() always allocates a new packet, but icmp_respond() does not. There's no assertion to trip in that case. :-/ However, even if this change really isn't quite "perfect". Specifically, with "buffer packing" the multiple mbufs sharing a single backing buffer via m_ext are all using non-overlapping regions of that buffer, and each mbuf does have exclusive access to its portion of the buffer. You just can't grow it. So, if a reuse does not extend the buffer for these particular mbufs then it is actually ok. (So icmp_respond() is actually ok, and tcp_respond() is also probably ok in practice.) However, we don't have any way to distinguish this use case from multiple mbufs sharing possibly-overlapping regions of a buffer. Fixing icmp_respond() is probably simpler as you can just m_dup() if the source is not writable and then m_freem() the original and reuse the clone as 'm' for the rest of the function. -- John Baldwin From owner-svn-src-head@freebsd.org Fri May 27 14:43:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D78FB4B852; Fri, 27 May 2016 14:43:54 +0000 (UTC) (envelope-from jhb@freebsd.org) 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 1C8D4172F; Fri, 27 May 2016 14:43:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 38FD4B96E; Fri, 27 May 2016 10:43:53 -0400 (EDT) From: John Baldwin To: Ian Lepore Cc: Gleb Smirnoff , Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300718 - in head/sys: kern sys Date: Thu, 26 May 2016 16:59:06 -0700 Message-ID: <2813462.S6nu4flFOa@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <1464303288.1204.65.camel@freebsd.org> References: <201605260841.u4Q8ft9r045564@repo.freebsd.org> <20160526213716.GK58287@FreeBSD.org> <1464303288.1204.65.camel@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); Fri, 27 May 2016 10:43:53 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 14:43:54 -0000 On Thursday, May 26, 2016 04:54:48 PM Ian Lepore wrote: > On Thu, 2016-05-26 at 14:37 -0700, Gleb Smirnoff wrote: > > Hans, > > > > On Thu, May 26, 2016 at 08:41:55AM +0000, Hans Petter Selasky wrote: > > H> Author: hselasky > > H> Date: Thu May 26 08:41:55 2016 > > H> New Revision: 300718 > > H> URL: https://svnweb.freebsd.org/changeset/base/300718 > > H> > > H> Log: > > H> Add support for boolean sysctl's. > > H> > > H> Because the size of bool can be implementation defined, make a > > bool > > H> sysctl handler which handle bools. Userspace sees the bools like > > H> unsigned 8-bit integers. Values are filtered to either 1 or 0 > > upon > > H> read and write, similar to what a compiler would do. > > H> > > H> Requested by: kmacy @ > > H> Sponsored by: Mellanox Technologies > > > > Would be nice if sysctl(8) would explicitly display them as "true" or > > "false" > > instead of 0 and 1. Now the userland can't differ them from uint8_t > > oids. > > If it displayed them that way, then users would want to set them using > the true/false strings too. If you start down that path you eventually > end up adding support for 0/1/true/false/yes/no/on/off, and if you > don't do that in exactly once place you end up with some oids accepting > all the values and others accepting only some of them, and the user > experience is confusing at best. You would just do that parsing in sysctl(8) itself, not in the handlers, so I think it would just be done in one place. -- John Baldwin From owner-svn-src-head@freebsd.org Fri May 27 14:49:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11C14B4BA06; Fri, 27 May 2016 14:49:04 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x22d.google.com (mail-oi0-x22d.google.com [IPv6:2607:f8b0:4003:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBECB1CB7; Fri, 27 May 2016 14:49:03 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x22d.google.com with SMTP id j1so177083247oih.3; Fri, 27 May 2016 07:49:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=Bix2UhKdyV0avk4AiyvpHbOmb42cX8YQuWZESVn8NXY=; b=LqgIL66D7SV4N2GtFhWkYM4g7Fh4VV3Z8N0Q8LHxBqTC9ZzlwpgIDbbn60m5cnfFT6 8kmu7hy6zU3SQsEyxj9I9H7eIrBIq5IFZ/8bsEdIcrDThE0ObeuwKJwxQWMB+7dYr9Gy 9EnTexD/tCb8e/YRPhTQNynbp4R2l22XUPoGTMj2Xdfae9k40uTU6btmVtD3KWO90Ao3 G+LbFNIq/NhvyzKlbSrahkscqy4oxuo5CVzB4BxWbIBEno6ylIbOeoD12RyGiRJCMily 2Au6fDIpDsl3lNNzaeUP148YHdQem8uzYPl8wtbYcW+pAPjWwezbn0wT7/frnOSnPYWx WZqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Bix2UhKdyV0avk4AiyvpHbOmb42cX8YQuWZESVn8NXY=; b=I3IBour+0K2M4OkVvhvMcY6aYr+goJiKMA3/im58sfWVo/ZVYjH5zquJmvjyD5W0L7 W/2weLl9deQkD5zyAvSLUF4Omaq/246M8VKfcJpYzXG+22JeetVKtUP2EHHAG/wP70y9 /GlvR4jFyzYUO4DTydJthnnWUsV2yCjKwenDNzHgoWO/18eofxolLY1KJiM5aeOg3lhF bRomu5Kpe5SPbye+nGrjOrlDqtpSZeB6sbSEwNWAO0QUT6pzloD/51Pct6NSt2a57g6B TL2896ZJVZKFIVk/o2kuNyGcIrtWpidxN3GBGHEr8LaPTApeUgXISuxmqakF6T2XwkiM z3Lw== X-Gm-Message-State: ALyK8tLPBiPCZFjfofPOMqVfKGrAKRwLaJdrBIIc8M2nSjhCN30wsMnACabZgP9HXrPLBZegdgRe3+yyigb85g== MIME-Version: 1.0 X-Received: by 10.157.43.3 with SMTP id o3mr9439952otb.10.1464360542982; Fri, 27 May 2016 07:49:02 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.4.200 with HTTP; Fri, 27 May 2016 07:49:02 -0700 (PDT) In-Reply-To: <201605261852.u4QIqn5w073953@repo.freebsd.org> References: <201605261852.u4QIqn5w073953@repo.freebsd.org> Date: Fri, 27 May 2016 08:49:02 -0600 X-Google-Sender-Auth: Dm99vKtX09htrENV7_Itp9yqvdk Message-ID: Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... From: Alan Somers To: Dimitry Andric Cc: "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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 14:49:04 -0000 I think this change is breaking the build of C++ applications. Below is a snippet of my amd64 buildworld, with the changes in D6564. it built fine a few days ago. ===> lib/libdevdctl (all) In file included from /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc:50: In file included from /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/list:173: In file included from /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/memory:599: In file included from /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/type_traits:363: /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/cstddef:43:15: fatal error: 'stddef.h' file not found #include_next ^ 1 error generated. --- consumer.o --- *** [consumer.o] Error code 1 On Thu, May 26, 2016 at 12:52 PM, Dimitry Andric wrote: > Author: dim > Date: Thu May 26 18:52:49 2016 > New Revision: 300770 > URL: https://svnweb.freebsd.org/changeset/base/300770 > > Log: > Update libc++ to 3.8.0. Excerpted list of fixes (with upstream revision > numbers): > > r242679 Implement the plugin-based version of std::search. There are no > searchers yet; those are coming soon. > r242682 Implement the default searcher for std::experimental::search. > r243728 Add v2. > r245330 implement more of N4258 - Cleaning up noexcept in the standard > library. Specifically add new noexcept stuff to vector and > string's move-assignment operations > r245334 Fix PR22606 - Leak pthread_key with static storage duration to > ensure all of thread-local destructors are called. > r245335 Fix PR23589: std::function doesn't recognize null pointer to > varargs function. > r247036 Implementation of Boyer-Moore and Boyer-Moore-Horspool > searchers for the LFTS. > r249325 Implement LWG#2063, and update the issues links to point to the > github generated pages > r249738 Split out of . > r249739 Split out of . > r249740 Split out of . > r249741 Split out of . > r249742 Split out of . > r249743 Split out of . > r249761 Split out of . > r249798 Split out of . > r249800 Split out of . > r249889 Split out of . > r249890 Split out of . > r249929 Split out of . > r250254 ABI versioning macros for libc++. > r251246 Fix LWG#2244: basic_istream::seekg > r251247 Fix LWG#2127: Move-construction with raw_storage_iterator. > r251253 Fix LWG#2476: scoped_allocator_adaptor is not assignable > r251257 Fix LWG#2489: mem_fn() should be noexcept > r251618 Implement P0004R1 'Remove Deprecated iostreams aliases' > r251766 Implement the first part of P0006R0: Adopt Type Traits Variable > Templates for C++17. > r252195 Implement P0092R1 for C++1z > r252350 Allow deque to handle incomplete types. > r252406 More of P0006R0: type traits variable aliases for C++17. > r252407 Implement LWG#2353: std::next is over-constrained > r252905 Implement P0074: Making owner_less more flexible > r253215 Implement P0013R1: Logical Operator Type Traits. > r253274 Implement P0007: Constant View: A proposal for a std::as_const > helper function template. > r254119 Add static_assert to set/multiset/map/multimap/forward_list/deque > that the allocator's value_type match the container's value_type. > r254283 Implement more of P0006; Type Traits Variable Templates. > r255941 LWG2485: get() should be overloaded for const tuple&&. > r256325 Fix LWG Issue #2367 - Fixing std::tuple and std::pair's default > constructors. > r256652 Fix for ALL undefined behavior in . > r256859 First half of LWG#2354: 'Unnecessary copying when inserting > into maps with braced-init syntax' > > Exp-run: antoine > Relnotes: yes From owner-svn-src-head@freebsd.org Fri May 27 15:03:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A010EB4BD60; Fri, 27 May 2016 15:03:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 769B5149E; Fri, 27 May 2016 15:03:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RF3cLB018134; Fri, 27 May 2016 15:03:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RF3cZb018133; Fri, 27 May 2016 15:03:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201605271503.u4RF3cZb018133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 27 May 2016 15:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300851 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 15:03:39 -0000 Author: mjg Date: Fri May 27 15:03:38 2016 New Revision: 300851 URL: https://svnweb.freebsd.org/changeset/base/300851 Log: exec: get rid of one vnode lock/unlock pair in do_execve The lock was temporarily dropped for vrele calls, but they can be postponed to a point where the lock is not held in the first place. While here shuffle other code not needing the lock. Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri May 27 12:02:12 2016 (r300850) +++ head/sys/kern/kern_exec.c Fri May 27 15:03:38 2016 (r300851) @@ -364,7 +364,7 @@ do_execve(td, args, mac_p) struct vattr attr; int (*img_first)(struct image_params *); struct pargs *oldargs = NULL, *newargs = NULL; - struct sigacts *oldsigacts, *newsigacts; + struct sigacts *oldsigacts = NULL, *newsigacts = NULL; #ifdef KTRACE struct vnode *tracevp = NULL; struct ucred *tracecred = NULL; @@ -714,8 +714,6 @@ interpret: bcopy(imgp->args->begin_argv, newargs->ar_args, i); } - vn_lock(imgp->vp, LK_SHARED | LK_RETRY); - /* * For security and other reasons, signal handlers cannot * be shared after an exec. The new process gets a copy of the old @@ -726,11 +724,10 @@ interpret: oldsigacts = p->p_sigacts; newsigacts = sigacts_alloc(); sigacts_copy(newsigacts, oldsigacts); - } else { - oldsigacts = NULL; - newsigacts = NULL; /* satisfy gcc */ } + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); + PROC_LOCK(p); if (oldsigacts) p->p_sigacts = newsigacts; @@ -791,9 +788,9 @@ interpret: VOP_UNLOCK(imgp->vp, 0); fdsetugidsafety(td); error = fdcheckstd(td); - if (error != 0) - goto done1; vn_lock(imgp->vp, LK_SHARED | LK_RETRY); + if (error != 0) + goto exec_fail_dealloc; PROC_LOCK(p); #ifdef MAC if (will_transition) { @@ -881,32 +878,7 @@ interpret: SDT_PROBE1(proc, , , exec__success, args->fname); - VOP_UNLOCK(imgp->vp, 0); -done1: - /* - * Handle deferred decrement of ref counts. - */ - if (oldtextvp != NULL) - vrele(oldtextvp); -#ifdef KTRACE - if (tracevp != NULL) - vrele(tracevp); - if (tracecred != NULL) - crfree(tracecred); -#endif - vn_lock(imgp->vp, LK_SHARED | LK_RETRY); - pargs_drop(oldargs); - pargs_drop(newargs); - if (oldsigacts != NULL) - sigacts_free(oldsigacts); - exec_fail_dealloc: - /* - * free various allocated resources - */ - if (euip != NULL) - uifree(euip); - if (imgp->firstpage != NULL) exec_unmap_first_page(imgp); @@ -936,18 +908,16 @@ exec_fail_dealloc: * the S_EXEC bit set. */ STOPEVENT(p, S_EXEC, 0); - goto done2; - } - + } else { exec_fail: - /* we're done here, clear P_INEXEC */ - PROC_LOCK(p); - p->p_flag &= ~P_INEXEC; - PROC_UNLOCK(p); + /* we're done here, clear P_INEXEC */ + PROC_LOCK(p); + p->p_flag &= ~P_INEXEC; + PROC_UNLOCK(p); - SDT_PROBE1(proc, , , exec__failure, error); + SDT_PROBE1(proc, , , exec__failure, error); + } -done2: if (imgp->newcred != NULL) crfree(oldcred); #ifdef MAC @@ -956,6 +926,24 @@ done2: #endif exec_free_args(args); + /* + * Handle deferred decrement of ref counts. + */ + if (oldtextvp != NULL) + vrele(oldtextvp); +#ifdef KTRACE + if (tracevp != NULL) + vrele(tracevp); + if (tracecred != NULL) + crfree(tracecred); +#endif + pargs_drop(oldargs); + pargs_drop(newargs); + if (oldsigacts != NULL) + sigacts_free(oldsigacts); + if (euip != NULL) + uifree(euip); + if (error && imgp->vmspace_destroyed) { /* sorry, no more process anymore. exit gracefully */ exit1(td, 0, SIGABRT); From owner-svn-src-head@freebsd.org Fri May 27 15:22:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32833B4C23B; Fri, 27 May 2016 15:22:50 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAEDC106C; Fri, 27 May 2016 15:22:49 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22f.google.com with SMTP id ww4so109405282igb.1; Fri, 27 May 2016 08:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=mD4rymZHXmcABsby1MAqBYkATxUqGuxc3/eHLStP/Ls=; b=MbbKTBmgGGQRJWB1kyGE9oTkOZqMrHtGLlwqStnZzMPndHw4Kev4Gv0ftYL+M0U7L+ SmrhZKSu7Zk4j91TAfuNmL6JieNxzLE4iVTS9ajWiMxmq3J1rZbs2PKhA7PpQU5GGCF0 1/3OnEnNc5w57+ldXj3ZLWAcrPyEAL9Xo5NZt2CSumso87tOO6LF88KR9GUM1WMAywX5 Vs/ZrHkHLwSVWHx5p5DPXBAYttgRGV6EGdMaQ/dKkohzPIMM2pr+yKJ762L0Pbr0/55k gOl7Pa4BEKyEl98OyUf67Oo3DwACcN1weL4Kf15rkNk3UIcy7aNoWTBThS75Azo85PjU sHXA== 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; bh=mD4rymZHXmcABsby1MAqBYkATxUqGuxc3/eHLStP/Ls=; b=ZHdNtBEc1v+lVaqwe7H1FpYutwUV16GWrzH1tQDRpvspSNJ1+RvEWmDlumhvPI06ML 7PiNjz79RQ2cfwdoFBJ3dY3fnhCKxEzcMvGT3gs7abepTogwKzyHt4hS00JOmGRGLk2n Op4PdxtPgl8GtKe/RV1lXLk7+KnbjYDu8uyUpfzU5UiX/E3/QAre5m0+jmLVl62qTlQm APZezLqEfahXKk/5N89RBX1k1gl9z02vGuqy2nuRfiSp/W/39DsyO/zcC1X94O/Q7ny0 02Nlzn7YABw3T1SzJO01tFbs3uMhb+wvrYzXq6FvNOAeaHBP3opB7KCrojpmkO4chPtP izvw== X-Gm-Message-State: ALyK8tLjd06kmsBUBK1k7fDEBRSIs8DVm3sh/LhyXATUolb3coepr2jg8R5NwA1Z0TFdHO83hefQqRKDBcMwHw== MIME-Version: 1.0 X-Received: by 10.50.40.234 with SMTP id a10mr8873795igl.37.1464362569219; Fri, 27 May 2016 08:22:49 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Fri, 27 May 2016 08:22:49 -0700 (PDT) In-Reply-To: <201605262239.u4QMdaa4012206@gw.catspoiler.org> References: <201605262140.u4QLeDsn032206@repo.freebsd.org> <201605262239.u4QMdaa4012206@gw.catspoiler.org> Date: Fri, 27 May 2016 08:22:49 -0700 Message-ID: Subject: Re: svn commit: r300779 - in head: sbin/ipfw sys/modules/dummynet sys/netinet sys/netpfil/ipfw From: Adrian Chadd To: Don Lewis Cc: "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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 15:22:50 -0000 Hi, Did this introduce floating point into the kernel? -adrian On 26 May 2016 at 15:39, Don Lewis wrote: > On 26 May, To: src-committers@freebsd.org wrote: >> Author: truckman >> Date: Thu May 26 21:40:13 2016 >> New Revision: 300779 >> URL: https://svnweb.freebsd.org/changeset/base/300779 >> >> Log: >> Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). >> >> Centre for Advanced Internet Architectures >> >> Implementing AQM in FreeBSD >> >> * Overview >> >> * Articles, Papers and Presentations >> >> >> * Patches and Tools >> >> Overview >> >> Recent years have seen a resurgence of interest in better managing >> the depth of bottleneck queues in routers, switches and other places >> that get congested. Solutions include transport protocol enhancements >> at the end-hosts (such as delay-based or hybrid congestion control >> schemes) and active queue management (AQM) schemes applied within >> bottleneck queues. >> >> The notion of AQM has been around since at least the late 1990s >> (e.g. RFC 2309). In recent years the proliferation of oversized >> buffers in all sorts of network devices (aka bufferbloat) has >> stimulated keen community interest in four new AQM schemes -- CoDel, >> FQ-CoDel, PIE and FQ-PIE. >> >> The IETF AQM working group is looking to document these schemes, >> and independent implementations are a corner-stone of the IETF's >> process for confirming the clarity of publicly available protocol >> descriptions. While significant development work on all three schemes >> has occured in the Linux kernel, there is very little in FreeBSD. >> >> Project Goals >> >> This project began in late 2015, and aims to design and implement >> functionally-correct versions of CoDel, FQ-CoDel, PIE and FQ_PIE >> in FreeBSD (with code BSD-licensed as much as practical). We have >> chosen to do this as extensions to FreeBSD's ipfw/dummynet firewall >> and traffic shaper. Implementation of these AQM schemes in FreeBSD >> will: >> * Demonstrate whether the publicly available documentation is >> sufficient to enable independent, functionally equivalent implementations >> >> * Provide a broader suite of AQM options for sections the networking >> community that rely on FreeBSD platforms >> >> Program Members: >> >> * Rasool Al Saadi (developer) >> >> * Grenville Armitage (project lead) >> >> Acknowledgements: >> >> This project has been made possible in part by a gift from the >> Comcast Innovation Fund. >> >> Submitted by: Rasool Al-Saadi >> X-No objection: core >> MFC after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D6388 > > Sigh ... should also be: > > Relnotes: yes > > From owner-svn-src-head@freebsd.org Fri May 27 15:29:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77256B4C2D3; Fri, 27 May 2016 15:29:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 389451293; Fri, 27 May 2016 15:29:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::89b4:6d81:b8c1:5a81] (unknown [IPv6:2001:7b8:3a7:0:89b4:6d81:b8c1:5a81]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3602017329; Fri, 27 May 2016 17:29:03 +0200 (CEST) Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_B879FD71-B2E5-4A48-BECE-22E4E59DBDFD"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: Date: Fri, 27 May 2016 17:28:56 +0200 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: References: <201605261852.u4QIqn5w073953@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 15:29:12 -0000 --Apple-Mail=_B879FD71-B2E5-4A48-BECE-22E4E59DBDFD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 27 May 2016, at 16:49, Alan Somers wrote: >=20 > I think this change is breaking the build of C++ applications. Below > is a snippet of my amd64 buildworld, with the changes in D6564. it > built fine a few days ago. >=20 > =3D=3D=3D> lib/libdevdctl (all) > In file included from = /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc:50: > In file included from > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1/list:173: > In file included from > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1/memory:599: > In file included from > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1/type_traits:363: > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1/cstddef:43:15: > fatal error: 'stddef.h' file not found > #include_next > ^ > 1 error generated. > --- consumer.o --- > *** [consumer.o] Error code 1 It shouldn't, it passed a full make universe. Do you have any special settings in either make.conf or src.conf? Or something other about your build environment that is non-standard? -Dimitry --Apple-Mail=_B879FD71-B2E5-4A48-BECE-22E4E59DBDFD 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.30 iEYEARECAAYFAldIZ74ACgkQsF6jCi4glqN3tQCg9ah14ninlfvSUPxcOV2gWSwK TgkAnjLIT8iXokpyRhPeuRnJAsMFsO1K =zzYW -----END PGP SIGNATURE----- --Apple-Mail=_B879FD71-B2E5-4A48-BECE-22E4E59DBDFD-- From owner-svn-src-head@freebsd.org Fri May 27 15:32:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 284E1B4C4D6; Fri, 27 May 2016 15:32:55 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x22a.google.com (mail-oi0-x22a.google.com [IPv6:2607:f8b0:4003:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB48C184C; Fri, 27 May 2016 15:32:54 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x22a.google.com with SMTP id w184so172439042oiw.2; Fri, 27 May 2016 08:32:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=cfZDdzmc0g00lDnrdy6Yrh2Sl6v1R+e+7xQUC0cy5fg=; b=fICKt2SKX7CIxVmPPLR1doGNDz2NQ1vBsuZDnQGYjZGiH3tT4xJ0Oer2A+aMBrNDHP 1Zpdxdhvk3cR0YzEUXf5Js/yahRl2PqKSX0NKEGW/gw2dC/WIaLpmGZsBGE+KVnLqkSJ 4acXyocOdyeXtXbneAU/abTQchgJvKO21Qx2Xlfr298+/IwCBfqZ1/9RQ/hwV5Yh1V6Q axlattrIoz9gFuFopBkXWu6C44vAgA0gx+FVUNW/RkHiJYkUxKCTsKGCrD8E+m/XXm2Z EnfpfNRYZa0x3q7RyPbzqsCXB5czZ22kUwXlgCZ7FJ+zXRIwqYjl4N1s5VlULHZNto9u otVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=cfZDdzmc0g00lDnrdy6Yrh2Sl6v1R+e+7xQUC0cy5fg=; b=cEk1R8vxTa0TdLbLhhMg3z2T76njVb1qAu6uGNxpI7QIC/YgZkEXeiRD/6+dfSQKYV ++Unz2gDksTTG405D1tzpQFkjyEUO6+fgleVW/T0hn+oiRiUniXV1I1rHvcDwSkT957L vk2oeuFgZVwhzIIV0P7y9IOEJfjwEc4f8YDjIPyhgDFQeYPXwYpK1VlF5aHJMAAuLkM8 PEsSL1fQHRq4gUeLQ8E/DxHrIvn5hbqmfrwajHnu9N9KhbQeZBlxeC0LwZodCLM1fjpf mqPFn4hMyyTAEKEHvwaMRNqnDrTUDXH5sBZKvEzQ3pprhsv+tglyp/PWZ2AcWbZK1KFM m0XA== X-Gm-Message-State: ALyK8tJtF/vhYr1iD9HLr7UPveLt5FPYgQ4txPnKEVKC0WnSLjGZT0ikaHnwyAIU+m6GGGjwPotMOmpdJEq45Q== MIME-Version: 1.0 X-Received: by 10.157.45.12 with SMTP id v12mr10279852ota.106.1464363174093; Fri, 27 May 2016 08:32:54 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.4.200 with HTTP; Fri, 27 May 2016 08:32:53 -0700 (PDT) In-Reply-To: References: <201605261852.u4QIqn5w073953@repo.freebsd.org> Date: Fri, 27 May 2016 09:32:53 -0600 X-Google-Sender-Auth: y5TE65uf4FdHlTVKUUciD02-g18 Message-ID: Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... From: Alan Somers To: Dimitry Andric Cc: "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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 15:32:55 -0000 On Fri, May 27, 2016 at 9:28 AM, Dimitry Andric wrote: > On 27 May 2016, at 16:49, Alan Somers wrote: >> >> I think this change is breaking the build of C++ applications. Below >> is a snippet of my amd64 buildworld, with the changes in D6564. it >> built fine a few days ago. >> >> ===> lib/libdevdctl (all) >> In file included from /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc:50: >> In file included from >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/list:173: >> In file included from >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/memory:599: >> In file included from >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/type_traits:363: >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/cstddef:43:15: >> fatal error: 'stddef.h' file not found >> #include_next >> ^ >> 1 error generated. >> --- consumer.o --- >> *** [consumer.o] Error code 1 > > It shouldn't, it passed a full make universe. Do you have any special > settings in either make.conf or src.conf? Or something other about your > build environment that is non-standard? > > -Dimitry Ahh, but when you ran "make universe" there were not yet any C++ things in lib/. My patch adds a C++ library, and it fails when building the 32-bit version. Here's the actual command that failed. I don't know why it failed, because /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/stddef.h _does_ exist. c++ -m32 -DCOMPAT_32BIT -march=i686 -mmmx -msse -msse2 -L/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 --sysroot=/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 -B/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include -O2 -pipe -MD -MF.depend.consumer.o -MTconsumer.o -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Qunused-arguments -Wno-c++11-extensions -c /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc -o consumer.o ... --- all_subdir_lib/libdevdctl --- In file included from /home/asomers/freebsd/head/lib/libdevdctl/event.cc:55: In file included from /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/iostream:38: In file included from /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/ios:216: In file included from /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/__locale:15: In file included from /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/string:439: In file included from /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/algorithm:624: In file included from /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/initializer_list:47: /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/cstddef:43:15: fatal error: 'stddef.h' file not found #include_next ^ -Alan From owner-svn-src-head@freebsd.org Fri May 27 15:42:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66E16B4C752; Fri, 27 May 2016 15:42:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1C151E9A; Fri, 27 May 2016 15:42:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::89b4:6d81:b8c1:5a81] (unknown [IPv6:2001:7b8:3a7:0:89b4:6d81:b8c1:5a81]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 681821735E; Fri, 27 May 2016 17:42:17 +0200 (CEST) Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_33C48EBD-05D3-423B-B947-FDCF7F7C2C02"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: Date: Fri, 27 May 2016 17:42:06 +0200 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: References: <201605261852.u4QIqn5w073953@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 15:42:21 -0000 --Apple-Mail=_33C48EBD-05D3-423B-B947-FDCF7F7C2C02 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 27 May 2016, at 17:32, Alan Somers wrote: >=20 > On Fri, May 27, 2016 at 9:28 AM, Dimitry Andric = wrote: >> On 27 May 2016, at 16:49, Alan Somers wrote: >>>=20 >>> I think this change is breaking the build of C++ applications. = Below >>> is a snippet of my amd64 buildworld, with the changes in D6564. it >>> built fine a few days ago. ... >> It shouldn't, it passed a full make universe. Do you have any = special >> settings in either make.conf or src.conf? Or something other about = your >> build environment that is non-standard? ... >=20 > Ahh, but when you ran "make universe" there were not yet any C++ > things in lib/. My patch adds a C++ library, and it fails when > building the 32-bit version. Here's the actual command that failed. > I don't know why it failed, because > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/stdde= f.h > _does_ exist. >=20 > c++ -m32 -DCOMPAT_32BIT -march=3Di686 -mmmx -msse -msse2 > -L/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 > --sysroot=3D/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 > -B/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 > -isystem = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include > -O2 -pipe -MD -MF.depend.consumer.o -MTconsumer.o > -fstack-protector-strong -Wsystem-headers -Werror -Wall > -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith > -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int > -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value > -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion > -Wno-unused-local-typedef -Qunused-arguments -Wno-c++11-extensions > -c /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc -o consumer.o > ... > --- all_subdir_lib/libdevdctl --- > In file included from = /home/asomers/freebsd/head/lib/libdevdctl/event.cc:55: > In file included from > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1/iostream:38: > In file included from > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1/ios:216: > In file included from > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1/__locale:15: > In file included from > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1/string:439: > In file included from > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1/algorithm:624: > In file included from > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1/initializer_list:47: > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1/cstddef:43:15: > fatal error: 'stddef.h' file not found > #include_next > ^ I think what happens is the same what happened with some ports. For various reasons, the include path needs to be modified, and this causes the header lookup to fail, when using #include_next<>. Can you run the above command manually, but adding -v so it will print out the full include paths it searches, and the order? My guess is that either ${MAKEOBJDIRPREFIX}/usr/include/c++/v1 needs to be added to the C++ include path, or some other path in the list is missing, at least for C++ compilation. -Dimitry --Apple-Mail=_33C48EBD-05D3-423B-B947-FDCF7F7C2C02 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.30 iEYEARECAAYFAldIatgACgkQsF6jCi4glqO2kQCgymKcp436p6W6daNk2J5ksRjS XsIAnjRKZmM6e2DfsQMUvioH80wPdSbQ =SU6e -----END PGP SIGNATURE----- --Apple-Mail=_33C48EBD-05D3-423B-B947-FDCF7F7C2C02-- From owner-svn-src-head@freebsd.org Fri May 27 16:01:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64074B4CC2A; Fri, 27 May 2016 16:01:15 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x22e.google.com (mail-oi0-x22e.google.com [IPv6:2607:f8b0:4003:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 270E4196D; Fri, 27 May 2016 16:01:15 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x22e.google.com with SMTP id j1so180401322oih.3; Fri, 27 May 2016 09:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=CDqGLfKY2sE6EkevnDdxEFrWGLFc/1BP3twHpnOkAbU=; b=XJv6xfeW8CDO3BQkt35MjWSCsTMcRwCMTuFNT1mrW7HHiHR26gsEHk1LbeARcMa2WT wp1c5MHddTB6eX51G1hfyccBNOyvX6ehpPj78dAtgOHdHQbSDvkDgmD52OoBqu1li3G/ P3dnUhvK7umfWwJjhBZDfG2UcXrb8ruQ4yQYshbIdc40q2M4BV4bUlae1fFKv4AMM6R0 loKFhz2IDZtu3KZ16Bz4x6VaV9uzaEdmzWgV2pC5W3MaKmHMNpuodu8zpG13zMlULSEu 8p1Lc2f9D/xFWBI7suUxYGm70vkVHTuGm+ml83nOZ25RQHPBLhT6EiK2kdNASbkrFcnF Eq1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=CDqGLfKY2sE6EkevnDdxEFrWGLFc/1BP3twHpnOkAbU=; b=Tqaw41VqOhx0K4141NmdPEfnaXK+QbSuWDMpceBw6+7TGyot/mrPItSFRjUYNyCpS8 mGdk7hlcPC/f0Mq3X8kdsLS70YR3jehmqqdLr8PSkRBBG1wJ5j1HU6i7+F4ULTHDlAjy EylC8fs07ev099b/0vOKIhJdHXj82r+d2zSX2JpGdVziOnEFywSPwLVHsOrWZEBGlYny VsqtT0C7HPlHLIvUJ5Ds9ofSMGbgwMpvEPNM6Yv6y8EX8JECd2Gk8u4VNYRAIo+p4cDD +gtMCye6YbgEzQld1n3eVabMqAXzVCTwVI23ye1CL6UnMty9WBJNN5qNbiL5vzXk1I6N Polg== X-Gm-Message-State: ALyK8tJq0tN+bpmsKAtaRc+x/c9v6WFx1JOUVzxLMyo2GZtF/0MhDQ5yDvFoUG6b1/7wjXUVIcUZGYxZ7rOINw== MIME-Version: 1.0 X-Received: by 10.157.27.173 with SMTP id z42mr10221117otd.192.1464364874292; Fri, 27 May 2016 09:01:14 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.4.200 with HTTP; Fri, 27 May 2016 09:01:14 -0700 (PDT) In-Reply-To: References: <201605261852.u4QIqn5w073953@repo.freebsd.org> Date: Fri, 27 May 2016 10:01:14 -0600 X-Google-Sender-Auth: 7OSJTAMgCsU7zsBD66mh1y6JsHo Message-ID: Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... From: Alan Somers To: Dimitry Andric Cc: "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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 16:01:15 -0000 On Fri, May 27, 2016 at 9:42 AM, Dimitry Andric wrote: > On 27 May 2016, at 17:32, Alan Somers wrote: >> >> On Fri, May 27, 2016 at 9:28 AM, Dimitry Andric wrote: >>> On 27 May 2016, at 16:49, Alan Somers wrote: >>>> >>>> I think this change is breaking the build of C++ applications. Below >>>> is a snippet of my amd64 buildworld, with the changes in D6564. it >>>> built fine a few days ago. > ... >>> It shouldn't, it passed a full make universe. Do you have any special >>> settings in either make.conf or src.conf? Or something other about your >>> build environment that is non-standard? > ... >> >> Ahh, but when you ran "make universe" there were not yet any C++ >> things in lib/. My patch adds a C++ library, and it fails when >> building the 32-bit version. Here's the actual command that failed. >> I don't know why it failed, because >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/stddef.h >> _does_ exist. >> >> c++ -m32 -DCOMPAT_32BIT -march=i686 -mmmx -msse -msse2 >> -L/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 >> --sysroot=/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 >> -B/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 >> -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include >> -O2 -pipe -MD -MF.depend.consumer.o -MTconsumer.o >> -fstack-protector-strong -Wsystem-headers -Werror -Wall >> -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith >> -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int >> -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value >> -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion >> -Wno-unused-local-typedef -Qunused-arguments -Wno-c++11-extensions >> -c /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc -o consumer.o >> ... >> --- all_subdir_lib/libdevdctl --- >> In file included from /home/asomers/freebsd/head/lib/libdevdctl/event.cc:55: >> In file included from >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/iostream:38: >> In file included from >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/ios:216: >> In file included from >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/__locale:15: >> In file included from >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/string:439: >> In file included from >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/algorithm:624: >> In file included from >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/initializer_list:47: >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/cstddef:43:15: >> fatal error: 'stddef.h' file not found >> #include_next >> ^ > > I think what happens is the same what happened with some ports. For > various reasons, the include path needs to be modified, and this causes > the header lookup to fail, when using #include_next<>. > > Can you run the above command manually, but adding -v so it will print > out the full include paths it searches, and the order? > > My guess is that either ${MAKEOBJDIRPREFIX}/usr/include/c++/v1 needs to > be added to the C++ include path, or some other path in the list is > missing, at least for C++ compilation. > > -Dimitry Here it is. It looks right to me; $MAKEOBJDIRPREFIX/home/asomers/freebsd/head/lib32/usr/include/c++/v1 is in the path, and stddef.h exists in that directory. $ c++ -v -m32 -DCOMPAT_32BIT -march=i686 -mmmx -msse -msse2 -L/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 --sysroot=/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 -B/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include -O2 -pipe -MD -MF.depend.consumer.o -MTconsumer.o -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Qunused-arguments -Wno-c++11-extensions -c /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc -o consumer.o FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0) Target: i386-unknown-freebsd11.0 Thread model: posix InstalledDir: /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/c++" -cc1 -triple i386-unknown-freebsd11.0 -emit-obj -disable-free -main-file-name consumer.cc -mrelocation-model static -mthread-model posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu i686 -target-feature +mmx -target-feature +sse -target-feature +sse2 -v -dwarf-column-info -debugger-tuning=gdb -coverage-file /scratch/tmp/asomers/obj/home/asomers/freebsd/head/world32/home/asomers/freebsd/head/lib/libdevdctl/consumer.o -resource-dir /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/../lib/clang/3.8.0 -dependency-file .depend.consumer.o -sys-header-deps -MT consumer.o -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include -D COMPAT_32BIT -isysroot /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 -internal-isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1 -O2 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-c++11-extensions -fdeprecated-macro -fdebug-compilation-dir /scratch/tmp/asomers/obj/home/asomers/freebsd/head/world32/home/asomers/freebsd/head/lib/libdevdctl -ferror-limit 19 -fmessage-length 80 -stack-protector 2 -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o consumer.o -x c++ /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target x86_64-unknown-freebsd11.0 ignoring duplicate directory "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include" #include "..." search starts here: #include <...> search starts here: /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1 /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/../lib/clang/3.8.0/include End of search list. In file included from /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc:50: In file included from /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/list:173: In file included from /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/memory:599: In file included from /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/type_traits:363: /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1/cstddef:43:15: fatal error: 'stddef.h' file not found #include_next ^ 1 error generated. -Alan From owner-svn-src-head@freebsd.org Fri May 27 16:19:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DF27B4B0B8; Fri, 27 May 2016 16:19:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EFA416D2; Fri, 27 May 2016 16:19:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::89b4:6d81:b8c1:5a81] (unknown [IPv6:2001:7b8:3a7:0:89b4:6d81:b8c1:5a81]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E20DA173E3; Fri, 27 May 2016 18:19:53 +0200 (CEST) Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_91EE3D21-D070-4DE2-B0EA-21E83357C3B9"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: Date: Fri, 27 May 2016 18:19:48 +0200 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: References: <201605261852.u4QIqn5w073953@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 16:19:57 -0000 --Apple-Mail=_91EE3D21-D070-4DE2-B0EA-21E83357C3B9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 27 May 2016, at 18:01, Alan Somers wrote: >=20 > On Fri, May 27, 2016 at 9:42 AM, Dimitry Andric = wrote: ... >> My guess is that either ${MAKEOBJDIRPREFIX}/usr/include/c++/v1 needs = to >> be added to the C++ include path, or some other path in the list is >> missing, at least for C++ compilation. >>=20 >> -Dimitry >=20 > Here it is. It looks right to me; > $MAKEOBJDIRPREFIX/home/asomers/freebsd/head/lib32/usr/include/c++/v1 > is in the path, and stddef.h exists in that directory. >=20 > $ c++ -v -m32 -DCOMPAT_32BIT -march=3Di686 -mmmx -msse -msse2 > -L/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 > --sysroot=3D/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 > -B/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 > -isystem = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include > -O2 -pipe -MD -MF.depend.consumer.o -MTconsumer.o > -fstack-protector-strong -Wsystem-headers -Werror -Wall > -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith > -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int > -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value > -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion > -Wno-unused-local-typedef -Qunused-arguments -Wno-c++11-extensions > -c /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc -o consumer.o > FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on > LLVM 3.8.0) > Target: i386-unknown-freebsd11.0 > Thread model: posix > InstalledDir: = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin > "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/c++" > -cc1 -triple i386-unknown-freebsd11.0 -emit-obj -disable-free > -main-file-name consumer.cc -mrelocation-model static -mthread-model > posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases > -target-cpu i686 -target-feature +mmx -target-feature +sse > -target-feature +sse2 -v -dwarf-column-info -debugger-tuning=3Dgdb > -coverage-file = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/world32/home/asomers/fr= eebsd/head/lib/libdevdctl/consumer.o > -resource-dir = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/../lib/clan= g/3.8.0 > -dependency-file .depend.consumer.o -sys-header-deps -MT consumer.o > -isystem = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include > -D COMPAT_32BIT -isysroot > /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 > -internal-isystem > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1 > -O2 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W > -Wno-unused-parameter -Wpointer-arith -Wno-uninitialized > -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable > -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality > -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef > -Wno-c++11-extensions -fdeprecated-macro -fdebug-compilation-dir > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/world32/home/asomers/fr= eebsd/head/lib/libdevdctl > -ferror-limit 19 -fmessage-length 80 -stack-protector 2 > -fobjc-runtime=3Dgnustep -fcxx-exceptions -fexceptions > -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops > -vectorize-slp -o consumer.o -x c++ > /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc > clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target > x86_64-unknown-freebsd11.0 > ignoring duplicate directory > "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include" > #include "..." search starts here: > #include <...> search starts here: > /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v= 1 > = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/../lib/clan= g/3.8.0/include > End of search list. The problem appears to be that the .../usr/include/c++/v1 directory should come *before* the .../usr/include directory, otherwise the #include_next<> logic will not work as expected. This is most likely caused by the option: -isystem = /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include because that forces this path to become before any auto-detected system include directory. Note that this option is not needed, since the other option: --sysroot=3D/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 is already taking care of adding the right include directories. It even warns about the duplicate directory: ignoring duplicate directory "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include" So what happens if you delete the -isystem option and its argument? -Dimitry --Apple-Mail=_91EE3D21-D070-4DE2-B0EA-21E83357C3B9 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.30 iEYEARECAAYFAldIc6kACgkQsF6jCi4glqMloACgzn41J+VYNH1mQmGdIFCyrZ4c kcAAoO/CguO2a467IOnIw1qP5ireBRJs =yAU+ -----END PGP SIGNATURE----- --Apple-Mail=_91EE3D21-D070-4DE2-B0EA-21E83357C3B9-- From owner-svn-src-head@freebsd.org Fri May 27 16:51:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9B23B4BAF2; Fri, 27 May 2016 16:51:14 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 74E8A1ADE; Fri, 27 May 2016 16:51:14 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4RGp3Yw016125; Fri, 27 May 2016 09:51:07 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605271651.u4RGp3Yw016125@gw.catspoiler.org> Date: Fri, 27 May 2016 09:51:03 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r300779 - in head: sbin/ipfw sys/modules/dummynet sys/netinet sys/netpfil/ipfw To: adrian.chadd@gmail.com cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 16:51:14 -0000 On 27 May, Adrian Chadd wrote: > Hi, > > Did this introduce floating point into the kernel? Cr*p, it did. It looks fixable, but I'll disconnect PIE from the build for now. From owner-svn-src-head@freebsd.org Fri May 27 17:00:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3A34B4BC8E; Fri, 27 May 2016 17:00:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E6C91E18; Fri, 27 May 2016 17:00:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RH0FLY059504; Fri, 27 May 2016 17:00:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RH0FEL059503; Fri, 27 May 2016 17:00:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201605271700.u4RH0FEL059503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 27 May 2016 17:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300852 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 17:00:16 -0000 Author: mjg Date: Fri May 27 17:00:15 2016 New Revision: 300852 URL: https://svnweb.freebsd.org/changeset/base/300852 Log: fd: provide a common exit point for unlock in kern_dup While here assert dropped filedesc lock on return from closefp. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri May 27 15:03:38 2016 (r300851) +++ head/sys/kern/kern_descrip.c Fri May 27 17:00:15 2016 (r300852) @@ -833,17 +833,16 @@ kern_dup(struct thread *td, u_int mode, if (new >= maxfd) return (mode == FDDUP_FCNTL ? EINVAL : EBADF); + error = EBADF; FILEDESC_XLOCK(fdp); - if (fget_locked(fdp, old) == NULL) { - FILEDESC_XUNLOCK(fdp); - return (EBADF); - } + if (fget_locked(fdp, old) == NULL) + goto unlock; if ((mode == FDDUP_FIXED || mode == FDDUP_MUSTREPLACE) && old == new) { td->td_retval[0] = new; if (flags & FDDUP_FLAG_CLOEXEC) fdp->fd_ofiles[new].fde_flags |= UF_EXCLOSE; - FILEDESC_XUNLOCK(fdp); - return (0); + error = 0; + goto unlock; } /* @@ -854,17 +853,13 @@ kern_dup(struct thread *td, u_int mode, switch (mode) { case FDDUP_NORMAL: case FDDUP_FCNTL: - if ((error = fdalloc(td, new, &new)) != 0) { - FILEDESC_XUNLOCK(fdp); - return (error); - } + if ((error = fdalloc(td, new, &new)) != 0) + goto unlock; break; case FDDUP_MUSTREPLACE: /* Target file descriptor must exist. */ - if (fget_locked(fdp, new) == NULL) { - FILEDESC_XUNLOCK(fdp); - return (EBADF); - } + if (fget_locked(fdp, new) == NULL) + goto unlock; break; case FDDUP_FIXED: if (new >= fdp->fd_nfiles) { @@ -882,8 +877,8 @@ kern_dup(struct thread *td, u_int mode, error = racct_set(p, RACCT_NOFILE, new + 1); PROC_UNLOCK(p); if (error != 0) { - FILEDESC_XUNLOCK(fdp); - return (EMFILE); + error = EMFILE; + goto unlock; } } #endif @@ -921,14 +916,17 @@ kern_dup(struct thread *td, u_int mode, #endif td->td_retval[0] = new; + error = 0; + if (delfp != NULL) { (void) closefp(fdp, new, delfp, td, 1); - /* closefp() drops the FILEDESC lock for us. */ + FILEDESC_UNLOCK_ASSERT(fdp); } else { +unlock: FILEDESC_XUNLOCK(fdp); } - return (0); + return (error); } /* From owner-svn-src-head@freebsd.org Fri May 27 17:07:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD26BB4BE73; Fri, 27 May 2016 17:07:08 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD6C813A1; Fri, 27 May 2016 17:07:08 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RH77Sb063264; Fri, 27 May 2016 17:07:07 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RH77be063262; Fri, 27 May 2016 17:07:07 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605271707.u4RH77be063262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 27 May 2016 17:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300853 - in head/sys: conf modules/dummynet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 17:07:09 -0000 Author: truckman Date: Fri May 27 17:07:07 2016 New Revision: 300853 URL: https://svnweb.freebsd.org/changeset/base/300853 Log: Disconnect PIE from the build until it is free of floating point math. Reported by: lidl, adrian Modified: head/sys/conf/files head/sys/modules/dummynet/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 27 17:00:15 2016 (r300852) +++ head/sys/conf/files Fri May 27 17:07:07 2016 (r300853) @@ -3824,11 +3824,9 @@ netnatm/natm.c optional natm netnatm/natm_pcb.c optional natm netnatm/natm_proto.c optional natm netpfil/ipfw/dn_aqm_codel.c optional inet dummynet -netpfil/ipfw/dn_aqm_pie.c optional inet dummynet netpfil/ipfw/dn_heap.c optional inet dummynet netpfil/ipfw/dn_sched_fifo.c optional inet dummynet netpfil/ipfw/dn_sched_fq_codel.c optional inet dummynet -netpfil/ipfw/dn_sched_fq_pie.c optional inet dummynet netpfil/ipfw/dn_sched_prio.c optional inet dummynet netpfil/ipfw/dn_sched_qfq.c optional inet dummynet netpfil/ipfw/dn_sched_rr.c optional inet dummynet Modified: head/sys/modules/dummynet/Makefile ============================================================================== --- head/sys/modules/dummynet/Makefile Fri May 27 17:00:15 2016 (r300852) +++ head/sys/modules/dummynet/Makefile Fri May 27 17:07:07 2016 (r300853) @@ -4,9 +4,9 @@ KMOD= dummynet SRCS= ip_dummynet.c SRCS+= ip_dn_glue.c ip_dn_io.c -SRCS+= dn_aqm_codel.c dn_aqm_pie.c +SRCS+= dn_aqm_codel.c SRCS+= dn_heap.c dn_sched_fifo.c dn_sched_qfq.c dn_sched_rr.c dn_sched_wf2q.c -SRCS+= dn_sched_prio.c dn_sched_fq_codel.c dn_sched_fq_pie.c +SRCS+= dn_sched_prio.c dn_sched_fq_codel.c SRCS+= opt_inet6.h .include From owner-svn-src-head@freebsd.org Fri May 27 17:31:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EB95B4C39B; Fri, 27 May 2016 17:31:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F2F810F4; Fri, 27 May 2016 17:31:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RHV2Ub071583; Fri, 27 May 2016 17:31:02 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RHV2oW071581; Fri, 27 May 2016 17:31:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605271731.u4RHV2oW071581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 27 May 2016 17:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300854 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 17:31:03 -0000 Author: glebius Date: Fri May 27 17:31:02 2016 New Revision: 300854 URL: https://svnweb.freebsd.org/changeset/base/300854 Log: Plug route reference underleak that happens with FLOWTABLE after r297225. Submitted by: Mike Karels 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 Fri May 27 17:07:07 2016 (r300853) +++ head/sys/netinet/ip_output.c Fri May 27 17:31:02 2016 (r300854) @@ -701,7 +701,11 @@ sendit: IPSTAT_INC(ips_fragmented); done: - if (ro == &iproute) + /* + * Release the route if using our private route, or if + * (with flowtable) we don't have our own reference. + */ + if (ro == &iproute || ro->ro_flags & RT_NORTREF) RO_RTFREE(ro); else if (rte == NULL) /* Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri May 27 17:07:07 2016 (r300853) +++ head/sys/netinet6/ip6_output.c Fri May 27 17:31:02 2016 (r300854) @@ -1053,7 +1053,11 @@ sendorfree: IP6STAT_INC(ip6s_fragmented); done: - if (ro == &ip6route) + /* + * Release the route if using our private route, or if + * (with flowtable) we don't have our own reference. + */ + if (ro == &ip6route || ro->ro_flags & RT_NORTREF) RO_RTFREE(ro); return (error); From owner-svn-src-head@freebsd.org Fri May 27 17:40:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E019CB4C659; Fri, 27 May 2016 17:40:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B29BF18EA; Fri, 27 May 2016 17:40:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RHeTd3074939; Fri, 27 May 2016 17:40:29 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RHeTBk074937; Fri, 27 May 2016 17:40:29 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605271740.u4RHeTBk074937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 27 May 2016 17:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300855 - in head/sys: conf modules/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 17:40:31 -0000 Author: ian Date: Fri May 27 17:40:29 2016 New Revision: 300855 URL: https://svnweb.freebsd.org/changeset/base/300855 Log: When building modules, define make variable OPT_FDT if the kernel config includes the FDT option. Use OPT_FDT to conditionally compile modules that require FDT support. In the past we've gotten away with using the arch name as a proxy for FDT support in makefile conditional logic, but now mips has some platforms with fdt support and some without and we need a more direct test. Modified: head/sys/conf/kern.opts.mk head/sys/modules/gpio/Makefile Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Fri May 27 17:31:02 2016 (r300854) +++ head/sys/conf/kern.opts.mk Fri May 27 17:40:29 2016 (r300855) @@ -150,3 +150,11 @@ MK_${var}_SUPPORT:= yes .endif .endif .endfor + +# Some modules only compile successfully if option FDT is set, due to #ifdef FDT +# wrapped around declarations. Module makefiles can optionally compile such +# things using .if !empty(OPT_FDT) +.if !defined(OPT_FDT) && defined(KERNBUILDDIR) +OPT_FDT!= sed -n '/FDT/p' ${KERNBUILDDIR}/opt_platform.h +.export OPT_FDT +.endif Modified: head/sys/modules/gpio/Makefile ============================================================================== --- head/sys/modules/gpio/Makefile Fri May 27 17:31:02 2016 (r300854) +++ head/sys/modules/gpio/Makefile Fri May 27 17:40:29 2016 (r300855) @@ -25,6 +25,10 @@ # SUCH DAMAGE. # -SUBDIR = gpiobus gpioiic gpioled gpiopps gpiospi +SUBDIR = gpiobus gpioiic gpioled gpiospi + +.if !empty(OPT_FDT) +SUBDIR += gpiopps +.endif .include From owner-svn-src-head@freebsd.org Fri May 27 17:43:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA376B4C7E3; Fri, 27 May 2016 17:43:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C45E1CD5; Fri, 27 May 2016 17:43:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RHgxtB078332; Fri, 27 May 2016 17:42:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RHgxZ1078331; Fri, 27 May 2016 17:42:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605271742.u4RHgxZ1078331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 27 May 2016 17:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300856 - head/tools/tools/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 17:43:00 -0000 Author: ngie Date: Fri May 27 17:42:59 2016 New Revision: 300856 URL: https://svnweb.freebsd.org/changeset/base/300856 Log: Initialize `t` with memset(.., 0, ..) This will help ensure that we're not using random garbage on the stack by accident with respect to the variable MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/tools/ioat/ioatcontrol.c Modified: head/tools/tools/ioat/ioatcontrol.c ============================================================================== --- head/tools/tools/ioat/ioatcontrol.c Fri May 27 17:40:29 2016 (r300855) +++ head/tools/tools/ioat/ioatcontrol.c Fri May 27 17:42:59 2016 (r300856) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -104,6 +105,8 @@ main(int argc, char **argv) bool fflag, rflag, Eflag, mflag; unsigned modeflags; + memset(&t, 0, sizeof(t)); + fflag = rflag = Eflag = mflag = false; modeflags = 0; From owner-svn-src-head@freebsd.org Fri May 27 17:44:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D33DB4C860; Fri, 27 May 2016 17:44:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0EB51E67; Fri, 27 May 2016 17:44:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RHiVU7078441; Fri, 27 May 2016 17:44:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RHiVFd078440; Fri, 27 May 2016 17:44:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605271744.u4RHiVFd078440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 27 May 2016 17:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300857 - head/tools/tools/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 17:44:32 -0000 Author: ngie Date: Fri May 27 17:44:30 2016 New Revision: 300857 URL: https://svnweb.freebsd.org/changeset/base/300857 Log: Document the default behavior for -c (0) Bump .Dd for the change MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/tools/ioat/ioatcontrol.8 Modified: head/tools/tools/ioat/ioatcontrol.8 ============================================================================== --- head/tools/tools/ioat/ioatcontrol.8 Fri May 27 17:42:59 2016 (r300856) +++ head/tools/tools/ioat/ioatcontrol.8 Fri May 27 17:44:30 2016 (r300857) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2015 +.Dd May 27, 2016 .Dt IOATCONTROL 8 .Os .Sh NAME @@ -62,7 +62,8 @@ driver on a specific hardware channel. The arguments are as follows: .Bl -tag -width Ds .It Fl c Ar period -Configure the channel's interrupt coalescing period, in microseconds. +Configure the channel's interrupt coalescing period, in microseconds +(defaults to 0). .It Fl E Test non-contiguous 8k copy. .It Fl f From owner-svn-src-head@freebsd.org Fri May 27 17:57:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 878F1B4CC61; Fri, 27 May 2016 17:57:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54F7A1659; Fri, 27 May 2016 17:57:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RHvUeN082146; Fri, 27 May 2016 17:57:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RHvUvO082145; Fri, 27 May 2016 17:57:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605271757.u4RHvUvO082145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 27 May 2016 17:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300858 - head/tools/tools/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 17:57:31 -0000 Author: ngie Date: Fri May 27 17:57:30 2016 New Revision: 300858 URL: https://svnweb.freebsd.org/changeset/base/300858 Log: Fix description for -V in the -r case t.verify_test = true is always set when -V is specified, regardless of whether or not the tool is being run in raw mode MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/tools/ioat/ioatcontrol.8 Modified: head/tools/tools/ioat/ioatcontrol.8 ============================================================================== --- head/tools/tools/ioat/ioatcontrol.8 Fri May 27 17:44:30 2016 (r300857) +++ head/tools/tools/ioat/ioatcontrol.8 Fri May 27 17:57:30 2016 (r300858) @@ -93,7 +93,7 @@ is a kernel virtual address (by default, .Ar address is assumed to be a physical address) .It Fl V -Dump the resulting hex to syslog +Verify copies/fills for accuracy .It Fl w Write to the specified .Ar address From owner-svn-src-head@freebsd.org Fri May 27 17:58:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 886C9B4CCCA; Fri, 27 May 2016 17:58:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5913417D0; Fri, 27 May 2016 17:58:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RHwAd3082214; Fri, 27 May 2016 17:58:10 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RHwAmm082213; Fri, 27 May 2016 17:58:10 GMT (envelope-from br@FreeBSD.org) Message-Id: <201605271758.u4RHwAmm082213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 27 May 2016 17:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300859 - head/sys/cddl/dev/dtrace/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 17:58:11 -0000 Author: br Date: Fri May 27 17:58:10 2016 New Revision: 300859 URL: https://svnweb.freebsd.org/changeset/base/300859 Log: Correct the implementation of dtrace_interrupt_disable/enable. Pointed out by: andrew Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/cddl/dev/dtrace/riscv/dtrace_asm.S Modified: head/sys/cddl/dev/dtrace/riscv/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/riscv/dtrace_asm.S Fri May 27 17:57:30 2016 (r300858) +++ head/sys/cddl/dev/dtrace/riscv/dtrace_asm.S Fri May 27 17:58:10 2016 (r300859) @@ -57,7 +57,8 @@ END(dtrace_membar_consumer) dtrace_icookie_t dtrace_interrupt_disable(void) */ ENTRY(dtrace_interrupt_disable) - csrci sstatus, 1 + csrrci a0, sstatus, SSTATUS_IE + andi a0, a0, SSTATUS_IE RET END(dtrace_interrupt_disable) @@ -65,7 +66,7 @@ END(dtrace_interrupt_disable) void dtrace_interrupt_enable(dtrace_icookie_t cookie) */ ENTRY(dtrace_interrupt_enable) - csrsi sstatus, 1 + csrs sstatus, a0 RET END(dtrace_interrupt_enable) /* From owner-svn-src-head@freebsd.org Fri May 27 18:20:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0239BB4C133; Fri, 27 May 2016 18:20:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCC241249; Fri, 27 May 2016 18:20:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RIK75B089808; Fri, 27 May 2016 18:20:07 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RIK7L6089807; Fri, 27 May 2016 18:20:07 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605271820.u4RIK7L6089807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 27 May 2016 18:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300860 - head/release/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 18:20:09 -0000 Author: gjb Date: Fri May 27 18:20:07 2016 New Revision: 300860 URL: https://svnweb.freebsd.org/changeset/base/300860 Log: Replace linux-f10 packages with updated linux-c6. PR: 208280 Submitted by: Johannes Meixner Sponsored by: The FreeBSD Foundation Modified: head/release/scripts/pkg-stage.sh Modified: head/release/scripts/pkg-stage.sh ============================================================================== --- head/release/scripts/pkg-stage.sh Fri May 27 17:58:10 2016 (r300859) +++ head/release/scripts/pkg-stage.sh Fri May 27 18:20:07 2016 (r300860) @@ -14,7 +14,7 @@ export PKGCMD="/usr/sbin/pkg -d" _DVD_PACKAGES="archivers/unzip devel/subversion devel/subversion-static -emulators/linux_base-f10 +emulators/linux_base-c6 misc/freebsd-doc-all net/mpd5 net/rsync From owner-svn-src-head@freebsd.org Fri May 27 18:39:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0A1BB4C543; Fri, 27 May 2016 18:39:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 924911ECA; Fri, 27 May 2016 18:39:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RIdlZ4097761; Fri, 27 May 2016 18:39:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RIdlO8097760; Fri, 27 May 2016 18:39:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605271839.u4RIdlO8097760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 27 May 2016 18:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300861 - head/tools/tools/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 18:39:48 -0000 Author: ngie Date: Fri May 27 18:39:47 2016 New Revision: 300861 URL: https://svnweb.freebsd.org/changeset/base/300861 Log: - Sort make variables - Use SRCTOP instead of ad hoc definition for it MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/tools/ioat/Makefile Modified: head/tools/tools/ioat/Makefile ============================================================================== --- head/tools/tools/ioat/Makefile Fri May 27 18:20:07 2016 (r300860) +++ head/tools/tools/ioat/Makefile Fri May 27 18:39:47 2016 (r300861) @@ -2,8 +2,11 @@ PROG= ioatcontrol MAN= ioatcontrol.8 -CFLAGS+= -I${.CURDIR:H:H:H}/sys/dev/ioat -WARNS?= 6 + +CFLAGS+= -I${SRCTOP}/sys/dev/ioat + LIBADD= util +WARNS?= 6 + .include From owner-svn-src-head@freebsd.org Fri May 27 18:40:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7550B4C677; Fri, 27 May 2016 18:40:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 950711087; Fri, 27 May 2016 18:40:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RIec5L097853; Fri, 27 May 2016 18:40:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RIecdE097852; Fri, 27 May 2016 18:40:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605271840.u4RIecdE097852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 27 May 2016 18:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300862 - head/tools/tools/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 18:40:39 -0000 Author: ngie Date: Fri May 27 18:40:38 2016 New Revision: 300862 URL: https://svnweb.freebsd.org/changeset/base/300862 Log: Install ioatcontrol to /usr/bin by default instead of / MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/tools/ioat/Makefile Modified: head/tools/tools/ioat/Makefile ============================================================================== --- head/tools/tools/ioat/Makefile Fri May 27 18:39:47 2016 (r300861) +++ head/tools/tools/ioat/Makefile Fri May 27 18:40:38 2016 (r300862) @@ -2,6 +2,7 @@ PROG= ioatcontrol MAN= ioatcontrol.8 +BINDIR?= /usr/bin CFLAGS+= -I${SRCTOP}/sys/dev/ioat From owner-svn-src-head@freebsd.org Fri May 27 18:45:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88D5EB4C74B; Fri, 27 May 2016 18:45:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A21416BC; Fri, 27 May 2016 18:45:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RIjBIk001764; Fri, 27 May 2016 18:45:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RIjB8a001762; Fri, 27 May 2016 18:45:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605271845.u4RIjB8a001762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 27 May 2016 18:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300863 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 18:45:12 -0000 Author: kib Date: Fri May 27 18:45:11 2016 New Revision: 300863 URL: https://svnweb.freebsd.org/changeset/base/300863 Log: In pmap_advise(), avoid leaking DI start for EPT pmaps which needs A/D emulation. Assert that syscalls do not leak DI. Reported by: gjb Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri May 27 18:40:38 2016 (r300862) +++ head/sys/amd64/amd64/pmap.c Fri May 27 18:45:11 2016 (r300863) @@ -6060,7 +6060,6 @@ pmap_advise(pmap_t pmap, vm_offset_t sva if (advice != MADV_DONTNEED && advice != MADV_FREE) return; - pmap_delayed_invl_started(); /* * A/D bit emulation requires an alternate code path when clearing @@ -6077,6 +6076,7 @@ pmap_advise(pmap_t pmap, vm_offset_t sva PG_V = pmap_valid_bit(pmap); PG_RW = pmap_rw_bit(pmap); anychanged = FALSE; + pmap_delayed_invl_started(); PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { pml4e = pmap_pml4e(pmap, sva); Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri May 27 18:40:38 2016 (r300862) +++ head/sys/amd64/amd64/trap.c Fri May 27 18:45:11 2016 (r300863) @@ -959,6 +959,10 @@ amd64_syscall(struct thread *td, int tra KASSERT(td->td_pcb->pcb_save == get_pcb_user_save_td(td), ("System call %s returning with mangled pcb_save", syscallname(td->td_proc, sa.code))); + KASSERT(td->td_md.md_invl_gen.gen == 0, + ("System call %s returning with leaked invl_gen %lu", + syscallname(td->td_proc, sa.code), td->td_md.md_invl_gen.gen)); + syscallret(td, error, &sa); From owner-svn-src-head@freebsd.org Fri May 27 18:52:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 939BFB4C9C2; Fri, 27 May 2016 18:52:59 +0000 (UTC) (envelope-from dru@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 645CB1C55; Fri, 27 May 2016 18:52:59 +0000 (UTC) (envelope-from dru@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RIqwxi005226; Fri, 27 May 2016 18:52:58 GMT (envelope-from dru@FreeBSD.org) Received: (from dru@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RIqwgR005225; Fri, 27 May 2016 18:52:58 GMT (envelope-from dru@FreeBSD.org) Message-Id: <201605271852.u4RIqwgR005225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dru set sender to dru@FreeBSD.org using -f From: Dru Lavigne Date: Fri, 27 May 2016 18:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300864 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 18:52:59 -0000 Author: dru (doc committer) Date: Fri May 27 18:52:58 2016 New Revision: 300864 URL: https://svnweb.freebsd.org/changeset/base/300864 Log: Remove duplicate sentence from pfsync.8. PR: 209539 Submitted by: olivier@ Reviewed by: timmoore88@gmail.com Sponsored by: iXsystems Modified: head/share/man/man4/pfsync.4 Modified: head/share/man/man4/pfsync.4 ============================================================================== --- head/share/man/man4/pfsync.4 Fri May 27 18:45:11 2016 (r300863) +++ head/share/man/man4/pfsync.4 Fri May 27 18:52:58 2016 (r300864) @@ -189,7 +189,6 @@ vhids should be set to something higher the primary's. For example, if firewall B is the backup, its carp1 configuration would look like this: -would look like this: .Bd -literal -offset indent ifconfig_sis1_alias0="inet 192.168.0.1/24 vhid 2 pass bar advskew 100" .Ed From owner-svn-src-head@freebsd.org Fri May 27 19:09:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3AD7B4C100; Fri, 27 May 2016 19:09:47 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com [IPv6:2607:f8b0:4003:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B668181E; Fri, 27 May 2016 19:09:47 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x232.google.com with SMTP id w184so181368500oiw.2; Fri, 27 May 2016 12:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=7rgKm48xadSRbTGon4g85ZOgGzW/a6w1+vnVec7KAss=; b=eROuDKNG5l+KI8QqLDX2QgSBlKlu2AG9SjCBAhQgYWdrIyw75TstZtLLWSniPXSW6j jEkeRHNBecfjUfdP6tni82yy2qFpk9/2UIT7flv94QYvVUnFkd+/nbUjEqtr9Xh+el55 MG1KgSrxJNfv+BVWr3eb5ioCZmrep5Zg1vTUR9vIQn1hO2wsFlEiewDjoBYmRhvrfcer lobGtqAtto4A7yJh2pZZ8L1N5vTRFI3zR1NZ45hWLXUUzrdz8m3p7N6LSGJtdeuHCOUQ qevnXTVElV5tZHMuWFhbO7Z5HHwMdKoHmMTVdzisGiOBTajBTuwwP47ZmXr7QtjNyLSP N7og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=7rgKm48xadSRbTGon4g85ZOgGzW/a6w1+vnVec7KAss=; b=WBrf4kv8GkZBqbK1mLnfjMUmfnuk8DWcsXDYuIkF61Xa1pQxQr/UVW9HREAOPhSN/b vxDxsOoTxcgB8NLjdbKUg+eGWZJq/mi2FGEdnMZN7DEjD7cUq//G7gH7Lgu9fGkO+vfw wzFQd6//wxGP82mL7ZwK3KKhv4qcdbxvJ13EBBxCCfoYSk71fY6YfcGMaaIvmtZkB6wj gPOMUoZWlke6prgij70yK4a1VNyPmP7zGlX7bLMUwY6tGcjmBFKRvZIhB9rclFvbTbxk ltHYFfxkNLNr/DM1zTxz5gxyYiMPNyGJjLL8gFq0qZR2QY7/pGr5CiE/hKq++Sl3RMKt bXYw== X-Gm-Message-State: ALyK8tKGKf9KsTh++21EXvZQdWMG4Hfu+ExdbaJ3/fB5EciOazN8jguBBni/qWTUr1gsUQdQ3rYSxioUL57b2w== MIME-Version: 1.0 X-Received: by 10.202.224.85 with SMTP id x82mr6663590oig.176.1464376186729; Fri, 27 May 2016 12:09:46 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.4.200 with HTTP; Fri, 27 May 2016 12:09:46 -0700 (PDT) In-Reply-To: References: <201605261852.u4QIqn5w073953@repo.freebsd.org> Date: Fri, 27 May 2016 13:09:46 -0600 X-Google-Sender-Auth: Zw-Qx4eUfXpNB5aC0tmd8dje5WA Message-ID: Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... From: Alan Somers To: Dimitry Andric Cc: "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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 19:09:47 -0000 On Fri, May 27, 2016 at 10:19 AM, Dimitry Andric wrote: > On 27 May 2016, at 18:01, Alan Somers wrote: >> >> On Fri, May 27, 2016 at 9:42 AM, Dimitry Andric wrote: > ... >>> My guess is that either ${MAKEOBJDIRPREFIX}/usr/include/c++/v1 needs to >>> be added to the C++ include path, or some other path in the list is >>> missing, at least for C++ compilation. >>> >>> -Dimitry >> >> Here it is. It looks right to me; >> $MAKEOBJDIRPREFIX/home/asomers/freebsd/head/lib32/usr/include/c++/v1 >> is in the path, and stddef.h exists in that directory. >> >> $ c++ -v -m32 -DCOMPAT_32BIT -march=i686 -mmmx -msse -msse2 >> -L/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 >> --sysroot=/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 >> -B/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 >> -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include >> -O2 -pipe -MD -MF.depend.consumer.o -MTconsumer.o >> -fstack-protector-strong -Wsystem-headers -Werror -Wall >> -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith >> -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int >> -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value >> -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion >> -Wno-unused-local-typedef -Qunused-arguments -Wno-c++11-extensions >> -c /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc -o consumer.o >> FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on >> LLVM 3.8.0) >> Target: i386-unknown-freebsd11.0 >> Thread model: posix >> InstalledDir: /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin >> "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/c++" >> -cc1 -triple i386-unknown-freebsd11.0 -emit-obj -disable-free >> -main-file-name consumer.cc -mrelocation-model static -mthread-model >> posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases >> -target-cpu i686 -target-feature +mmx -target-feature +sse >> -target-feature +sse2 -v -dwarf-column-info -debugger-tuning=gdb >> -coverage-file /scratch/tmp/asomers/obj/home/asomers/freebsd/head/world32/home/asomers/freebsd/head/lib/libdevdctl/consumer.o >> -resource-dir /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/../lib/clang/3.8.0 >> -dependency-file .depend.consumer.o -sys-header-deps -MT consumer.o >> -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include >> -D COMPAT_32BIT -isysroot >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 >> -internal-isystem >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1 >> -O2 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W >> -Wno-unused-parameter -Wpointer-arith -Wno-uninitialized >> -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable >> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality >> -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef >> -Wno-c++11-extensions -fdeprecated-macro -fdebug-compilation-dir >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/world32/home/asomers/freebsd/head/lib/libdevdctl >> -ferror-limit 19 -fmessage-length 80 -stack-protector 2 >> -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions >> -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops >> -vectorize-slp -o consumer.o -x c++ >> /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc >> clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target >> x86_64-unknown-freebsd11.0 >> ignoring duplicate directory >> "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include" >> #include "..." search starts here: >> #include <...> search starts here: >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/c++/v1 >> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/../lib/clang/3.8.0/include >> End of search list. > > The problem appears to be that the .../usr/include/c++/v1 directory > should come *before* the .../usr/include directory, otherwise the > #include_next<> logic will not work as expected. > > This is most likely caused by the option: > > -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include > > because that forces this path to become before any auto-detected system > include directory. Note that this option is not needed, since the other > option: > > --sysroot=/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 > > is already taking care of adding the right include directories. It even > warns about the duplicate directory: > > ignoring duplicate directory > "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include" > > So what happens if you delete the -isystem option and its argument? > > -Dimitry > If I take out -isystem, it compiles successfully. From owner-svn-src-head@freebsd.org Fri May 27 19:15:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92B46B4C2AD; Fri, 27 May 2016 19:15:47 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 540761C61; Fri, 27 May 2016 19:15:47 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RJFkiv013143; Fri, 27 May 2016 19:15:46 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RJFkEl013139; Fri, 27 May 2016 19:15:46 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201605271915.u4RJFkEl013139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 27 May 2016 19:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300865 - in head/sys: sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 19:15:47 -0000 Author: alc Date: Fri May 27 19:15:45 2016 New Revision: 300865 URL: https://svnweb.freebsd.org/changeset/base/300865 Log: The flag "vm_pages_needed" has long served two distinct purposes: (1) to indicate that threads are waiting for free pages to become available and (2) to indicate whether a wakeup call has been sent to the page daemon. The trouble is that a single flag cannot really serve both purposes, because we have two distinct targets for when to wakeup threads waiting for free pages versus when the page daemon has completed its work. In particular, the flag will be cleared by vm_page_free() before the page daemon has met its target, and this can lead to the OOM killer being invoked prematurely. To address this problem, a new flag "vm_pageout_wanted" is introduced. Discussed with: jeff Reviewed by: kib, markj Tested by: markj Sponsored by: EMC / Isilon Storage Division Modified: head/sys/sys/vmmeter.h head/sys/vm/vm_page.c head/sys/vm/vm_pageout.c head/sys/vm/vm_pageout.h Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Fri May 27 18:52:58 2016 (r300864) +++ head/sys/sys/vmmeter.h Fri May 27 19:15:45 2016 (r300865) @@ -76,7 +76,7 @@ struct vmmeter { u_int v_vnodepgsout; /* (p) vnode pager pages paged out */ u_int v_intrans; /* (p) intransit blocking page faults */ u_int v_reactivated; /* (f) pages reactivated from free list */ - u_int v_pdwakeups; /* (f) times daemon has awaken from sleep */ + u_int v_pdwakeups; /* (p) times daemon has awaken from sleep */ u_int v_pdpages; /* (p) pages analyzed by daemon */ u_int v_tcached; /* (p) total pages cached */ Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri May 27 18:52:58 2016 (r300864) +++ head/sys/vm/vm_page.c Fri May 27 19:15:45 2016 (r300865) @@ -2700,10 +2700,11 @@ vm_wait(void) msleep(&vm_pageout_pages_needed, &vm_page_queue_free_mtx, PDROP | PSWP, "VMWait", 0); } else { - if (!vm_pages_needed) { - vm_pages_needed = 1; - wakeup(&vm_pages_needed); + if (!vm_pageout_wanted) { + vm_pageout_wanted = true; + wakeup(&vm_pageout_wanted); } + vm_pages_needed = true; msleep(&vm_cnt.v_free_count, &vm_page_queue_free_mtx, PDROP | PVM, "vmwait", 0); } @@ -2724,10 +2725,11 @@ vm_waitpfault(void) { mtx_lock(&vm_page_queue_free_mtx); - if (!vm_pages_needed) { - vm_pages_needed = 1; - wakeup(&vm_pages_needed); + if (!vm_pageout_wanted) { + vm_pageout_wanted = true; + wakeup(&vm_pageout_wanted); } + vm_pages_needed = true; msleep(&vm_cnt.v_free_count, &vm_page_queue_free_mtx, PDROP | PUSER, "pfault", 0); } @@ -2908,7 +2910,7 @@ vm_page_free_wakeup(void) * lots of memory. this process will swapin processes. */ if (vm_pages_needed && !vm_page_count_min()) { - vm_pages_needed = 0; + vm_pages_needed = false; wakeup(&vm_cnt.v_free_count); } } Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri May 27 18:52:58 2016 (r300864) +++ head/sys/vm/vm_pageout.c Fri May 27 19:15:45 2016 (r300865) @@ -156,10 +156,11 @@ SYSINIT(vmdaemon, SI_SUB_KTHREAD_VM, SI_ #endif -int vm_pages_needed; /* Event on which pageout daemon sleeps */ int vm_pageout_deficit; /* Estimated number of pages deficit */ int vm_pageout_wakeup_thresh; static int vm_pageout_oom_seq = 12; +bool vm_pageout_wanted; /* Event on which pageout daemon sleeps */ +bool vm_pages_needed; /* Are threads waiting for free pages? */ #if !defined(NO_SWAPPING) static int vm_pageout_req_swapout; /* XXX */ @@ -1550,48 +1551,65 @@ vm_pageout_worker(void *arg) * The pageout daemon worker is never done, so loop forever. */ while (TRUE) { + mtx_lock(&vm_page_queue_free_mtx); + /* - * If we have enough free memory, wakeup waiters. Do - * not clear vm_pages_needed until we reach our target, - * otherwise we may be woken up over and over again and - * waste a lot of cpu. + * Generally, after a level >= 1 scan, if there are enough + * free pages to wakeup the waiters, then they are already + * awake. A call to vm_page_free() during the scan awakened + * them. However, in the following case, this wakeup serves + * to bound the amount of time that a thread might wait. + * Suppose a thread's call to vm_page_alloc() fails, but + * before that thread calls VM_WAIT, enough pages are freed by + * other threads to alleviate the free page shortage. The + * thread will, nonetheless, wait until another page is freed + * or this wakeup is performed. */ - mtx_lock(&vm_page_queue_free_mtx); if (vm_pages_needed && !vm_page_count_min()) { - if (!vm_paging_needed()) - vm_pages_needed = 0; + vm_pages_needed = false; wakeup(&vm_cnt.v_free_count); } - if (vm_pages_needed) { + + /* + * Do not clear vm_pageout_wanted until we reach our target. + * Otherwise, we may be awakened over and over again, wasting + * CPU time. + */ + if (vm_pageout_wanted && !vm_paging_needed()) + vm_pageout_wanted = false; + + /* + * Might the page daemon receive a wakeup call? + */ + if (vm_pageout_wanted) { /* - * We're still not done. Either vm_pages_needed was - * set by another thread during the previous scan - * (typically, this happens during a level 0 scan) or - * vm_pages_needed was already set and the scan failed - * to free enough pages. If we haven't yet performed - * a level >= 2 scan (unlimited dirty cleaning), then - * upgrade the level and scan again now. Otherwise, - * sleep a bit and try again later. While sleeping, - * vm_pages_needed can be cleared. + * No. Either vm_pageout_wanted was set by another + * thread during the previous scan, which must have + * been a level 0 scan, or vm_pageout_wanted was + * already set and the scan failed to free enough + * pages. If we haven't yet performed a level >= 2 + * scan (unlimited dirty cleaning), then upgrade the + * level and scan again now. Otherwise, sleep a bit + * and try again later. */ + mtx_unlock(&vm_page_queue_free_mtx); if (domain->vmd_pass > 1) - msleep(&vm_pages_needed, - &vm_page_queue_free_mtx, PVM, "psleep", - hz / 2); + pause("psleep", hz / 2); + domain->vmd_pass++; } else { /* - * Good enough, sleep until required to refresh - * stats. + * Yes. Sleep until pages need to be reclaimed or + * have their reference stats updated. */ - msleep(&vm_pages_needed, &vm_page_queue_free_mtx, - PVM, "psleep", hz); + if (mtx_sleep(&vm_pageout_wanted, + &vm_page_queue_free_mtx, PDROP | PVM, "psleep", + hz) == 0) { + PCPU_INC(cnt.v_pdwakeups); + domain->vmd_pass = 1; + } else + domain->vmd_pass = 0; } - if (vm_pages_needed) { - vm_cnt.v_pdwakeups++; - domain->vmd_pass++; - } else - domain->vmd_pass = 0; - mtx_unlock(&vm_page_queue_free_mtx); + vm_pageout_scan(domain, domain->vmd_pass); } } @@ -1688,9 +1706,9 @@ void pagedaemon_wakeup(void) { - if (!vm_pages_needed && curthread->td_proc != pageproc) { - vm_pages_needed = 1; - wakeup(&vm_pages_needed); + if (!vm_pageout_wanted && curthread->td_proc != pageproc) { + vm_pageout_wanted = true; + wakeup(&vm_pageout_wanted); } } Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Fri May 27 18:52:58 2016 (r300864) +++ head/sys/vm/vm_pageout.h Fri May 27 19:15:45 2016 (r300865) @@ -72,9 +72,10 @@ */ extern int vm_page_max_wired; -extern int vm_pages_needed; /* should be some "event" structure */ extern int vm_pageout_deficit; extern int vm_pageout_page_count; +extern bool vm_pageout_wanted; +extern bool vm_pages_needed; /* * Swap out requests From owner-svn-src-head@freebsd.org Fri May 27 19:18:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2B5FB4C46C; Fri, 27 May 2016 19:18:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 8F5D71F32; Fri, 27 May 2016 19:18:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 7FE301FBA; Fri, 27 May 2016 19:18:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 340651C20B; Fri, 27 May 2016 19:18:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 2ReuRyzQMRfw; Fri, 27 May 2016 19:18:26 +0000 (UTC) Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 9ADA71C203 To: Alan Somers , Dimitry Andric References: <201605261852.u4QIqn5w073953@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <403f6f39-85e2-aa5f-0ca1-beba256a88e8@FreeBSD.org> Date: Fri, 27 May 2016 12:18:30 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3mVMCCb9lbu01cVpiBg451OC68vi0BwQO" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 19:18:37 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3mVMCCb9lbu01cVpiBg451OC68vi0BwQO Content-Type: multipart/mixed; boundary="JnWKjxf0kxTUfLnLM8LpBFOge8weDAE4H" From: Bryan Drewery To: Alan Somers , Dimitry Andric Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <403f6f39-85e2-aa5f-0ca1-beba256a88e8@FreeBSD.org> Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... References: <201605261852.u4QIqn5w073953@repo.freebsd.org> In-Reply-To: --JnWKjxf0kxTUfLnLM8LpBFOge8weDAE4H Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/27/2016 12:09 PM, Alan Somers wrote: > On Fri, May 27, 2016 at 10:19 AM, Dimitry Andric wrot= e: >> On 27 May 2016, at 18:01, Alan Somers wrote: >>> >>> On Fri, May 27, 2016 at 9:42 AM, Dimitry Andric wro= te: >> ... >>>> My guess is that either ${MAKEOBJDIRPREFIX}/usr/include/c++/v1 needs= to >>>> be added to the C++ include path, or some other path in the list is >>>> missing, at least for C++ compilation. >>>> >>>> -Dimitry >>> >>> Here it is. It looks right to me; >>> $MAKEOBJDIRPREFIX/home/asomers/freebsd/head/lib32/usr/include/c++/v1 >>> is in the path, and stddef.h exists in that directory. >>> >>> $ c++ -v -m32 -DCOMPAT_32BIT -march=3Di686 -mmmx -msse -msse2 >>> -L/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 >>> --sysroot=3D/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 >>> -B/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32 >>> -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr= /include >>> -O2 -pipe -MD -MF.depend.consumer.o -MTconsumer.o >>> -fstack-protector-strong -Wsystem-headers -Werror -Wall >>> -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith >>> -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int >>> -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-valu= e >>> -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion >>> -Wno-unused-local-typedef -Qunused-arguments -Wno-c++11-extensions >>> -c /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc -o consumer.= o >>> FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on= >>> LLVM 3.8.0) >>> Target: i386-unknown-freebsd11.0 >>> Thread model: posix >>> InstalledDir: /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/= usr/bin >>> "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/c++" >>> -cc1 -triple i386-unknown-freebsd11.0 -emit-obj -disable-free >>> -main-file-name consumer.cc -mrelocation-model static -mthread-model >>> posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases >>> -target-cpu i686 -target-feature +mmx -target-feature +sse >>> -target-feature +sse2 -v -dwarf-column-info -debugger-tuning=3Dgdb >>> -coverage-file /scratch/tmp/asomers/obj/home/asomers/freebsd/head/wor= ld32/home/asomers/freebsd/head/lib/libdevdctl/consumer.o >>> -resource-dir /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/= usr/bin/../lib/clang/3.8.0 >>> -dependency-file .depend.consumer.o -sys-header-deps -MT consumer.o >>> -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr= /include >>> -D COMPAT_32BIT -isysroot >>> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 >>> -internal-isystem >>> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/= c++/v1 >>> -O2 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W >>> -Wno-unused-parameter -Wpointer-arith -Wno-uninitialized >>> -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable >>> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality= >>> -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef >>> -Wno-c++11-extensions -fdeprecated-macro -fdebug-compilation-dir >>> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/world32/home/asome= rs/freebsd/head/lib/libdevdctl >>> -ferror-limit 19 -fmessage-length 80 -stack-protector 2 >>> -fobjc-runtime=3Dgnustep -fcxx-exceptions -fexceptions >>> -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops >>> -vectorize-slp -o consumer.o -x c++ >>> /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc >>> clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target >>> x86_64-unknown-freebsd11.0 >>> ignoring duplicate directory >>> "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include= " >>> #include "..." search starts here: >>> #include <...> search starts here: >>> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include >>> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include/= c++/v1 >>> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/../lib= /clang/3.8.0/include >>> End of search list. >> >> The problem appears to be that the .../usr/include/c++/v1 directory >> should come *before* the .../usr/include directory, otherwise the >> #include_next<> logic will not work as expected. >> >> This is most likely caused by the option: >> >> -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/us= r/include >> >> because that forces this path to become before any auto-detected syste= m >> include directory. Note that this option is not needed, since the oth= er >> option: >> >> --sysroot=3D/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32= >> >> is already taking care of adding the right include directories. It ev= en >> warns about the duplicate directory: >> >> ignoring duplicate directory >> "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/includ= e" >> >> So what happens if you delete the -isystem option and its argument? >> >> -Dimitry >> >=20 > If I take out -isystem, it compiles successfully. >=20 I'm looking at this more now. I added that -isystem in, but it should have only been there for external GCC usage from first glance. --=20 Regards, Bryan Drewery --JnWKjxf0kxTUfLnLM8LpBFOge8weDAE4H-- --3mVMCCb9lbu01cVpiBg451OC68vi0BwQO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXSJ2HAAoJEDXXcbtuRpfPYZ4IALU8MnDpyenD8057yCEuxyDx HJMhQZT/8apRRPBvtb0Ith+0zXIQ0VASlAvm4yf5E+aK1qY80pAoCEOt0dBIxEXC zzMYf0VXHuwCZcFNmodkl6oc6TnF/CjQJJWb0v/KjmFuot0oC7DTYXlGhAj+2axy t8sssPyhlhFfKbof6IKRe7cgVtP/cYgJedOVf9m744rMOGRmkTo7+D/z/ZFL/2KQ 4lspY5jWAChzo07AfJKgdFkLDpoT2rbx4LS7WK2y4zHKKJP2QhS0yP8igUIiK+aN fmzdJESEMgCO0+jjNFpAEj7/WzXeN0HFF/F71AUrizfGJ0guJDu/hOGPtvWP91c= =EVoU -----END PGP SIGNATURE----- --3mVMCCb9lbu01cVpiBg451OC68vi0BwQO-- From owner-svn-src-head@freebsd.org Fri May 27 19:23:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CE61B4C627; Fri, 27 May 2016 19:23:17 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD9441341; Fri, 27 May 2016 19:23:16 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RJNF81016636; Fri, 27 May 2016 19:23:15 GMT (envelope-from ambrisko@FreeBSD.org) Received: (from ambrisko@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RJNF0d016635; Fri, 27 May 2016 19:23:15 GMT (envelope-from ambrisko@FreeBSD.org) Message-Id: <201605271923.u4RJNF0d016635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ambrisko set sender to ambrisko@FreeBSD.org using -f From: Doug Ambrisko Date: Fri, 27 May 2016 19:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300866 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 19:23:17 -0000 Author: ambrisko Date: Fri May 27 19:23:15 2016 New Revision: 300866 URL: https://svnweb.freebsd.org/changeset/base/300866 Log: If the I/O offset and length is multiple of the media size then directly pass the request otherwise use a buffer that is a multiple of the media size. This speeds up I/O quite a bit when using large transfer sizes on 4Kn disks etc. MFC after: 1 week Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Fri May 27 19:15:45 2016 (r300865) +++ head/sys/boot/efi/libefi/efipart.c Fri May 27 19:23:15 2016 (r300866) @@ -325,11 +325,14 @@ efipart_realstrategy(void *devdata, int if (rsize != NULL) *rsize = size; - if (blkio->Media->BlockSize == 512) - return (efipart_readwrite(blkio, rw, blk, size / 512, buf)); + if ((size % blkio->Media->BlockSize == 0) && + ((blk * 512) % blkio->Media->BlockSize == 0)) + return (efipart_readwrite(blkio, rw, + blk * 512 / blkio->Media->BlockSize, + size / blkio->Media->BlockSize, buf)); /* - * The block size of the media is not 512B per sector. + * The block size of the media is not a multiple of I/O. */ blkbuf = malloc(blkio->Media->BlockSize); if (blkbuf == NULL) From owner-svn-src-head@freebsd.org Fri May 27 19:30:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF7BCB4C77C; Fri, 27 May 2016 19:30:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8062F1735; Fri, 27 May 2016 19:30:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RJUDlB016931; Fri, 27 May 2016 19:30:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RJUDtA016930; Fri, 27 May 2016 19:30:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605271930.u4RJUDtA016930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 27 May 2016 19:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300867 - head/usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 19:30:14 -0000 Author: ngie Date: Fri May 27 19:30:13 2016 New Revision: 300867 URL: https://svnweb.freebsd.org/changeset/base/300867 Log: Only expose `hint_uaddr` in the ND_DEBUG case This fixes a -Wunused-but-set-variable warning with gcc MFC after: 1 week Reported by: gcc 5 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c ============================================================================== --- head/usr.sbin/rpcbind/util.c Fri May 27 19:23:15 2016 (r300866) +++ head/usr.sbin/rpcbind/util.c Fri May 27 19:30:13 2016 (r300867) @@ -119,7 +119,9 @@ addrmerge(struct netbuf *caller, const c struct sockaddr_storage ss; struct netconfig *nconf; char *caller_uaddr = NULL; +#ifdef ND_DEBUG const char *hint_uaddr = NULL; +#endif char *ret = NULL; int bestif_goodness; @@ -140,13 +142,17 @@ addrmerge(struct netbuf *caller, const c */ hint_sa = NULL; if (clnt_uaddr != NULL) { +#ifdef ND_DEBUG hint_uaddr = clnt_uaddr; +#endif if ((hint_nbp = uaddr2taddr(nconf, clnt_uaddr)) == NULL) goto freeit; hint_sa = hint_nbp->buf; } if (hint_sa == NULL || hint_sa->sa_family != caller_sa->sa_family) { +#ifdef ND_DEBUG hint_uaddr = caller_uaddr; +#endif hint_sa = caller->buf; } From owner-svn-src-head@freebsd.org Fri May 27 19:36:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8F4FB4CACF; Fri, 27 May 2016 19:36:12 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id DB4101DF8; Fri, 27 May 2016 19:36:12 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id AB52F170EB; Fri, 27 May 2016 12:36:06 -0700 (PDT) Date: Fri, 27 May 2016 12:36:06 -0700 From: hiren panchasara To: Alan Cox Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300865 - in head/sys: sys vm Message-ID: <20160527193606.GC48160@strugglingcoder.info> References: <201605271915.u4RJFkEl013139@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="96YOpH+ONegL0A3E" Content-Disposition: inline In-Reply-To: <201605271915.u4RJFkEl013139@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 19:36:13 -0000 --96YOpH+ONegL0A3E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 05/27/16 at 07:15P, Alan Cox wrote: > Author: alc > Date: Fri May 27 19:15:45 2016 > New Revision: 300865 > URL: https://svnweb.freebsd.org/changeset/base/300865 >=20 > Log: > The flag "vm_pages_needed" has long served two distinct purposes: (1) to > indicate that threads are waiting for free pages to become available and > (2) to indicate whether a wakeup call has been sent to the page daemon. > The trouble is that a single flag cannot really serve both purposes, be= cause > we have two distinct targets for when to wakeup threads waiting for free > pages versus when the page daemon has completed its work. In particula= r, > the flag will be cleared by vm_page_free() before the page daemon has m= et > its target, and this can lead to the OOM killer being invoked premature= ly. > To address this problem, a new flag "vm_pageout_wanted" is introduced. > =20 > Discussed with: jeff > Reviewed by: kib, markj > Tested by: markj > Sponsored by: EMC / Isilon Storage Division I'd assume the problem exists in 10 too. Can this be MFCed there? Cheers, Hiren --96YOpH+ONegL0A3E Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXSKGjXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lO5MIAIJ1LtU7soJapeiFhJ+aQke2 Q5VgiJtGb7T4VkGK5PRsqsg3dW8pDzzephdIH/6fpeS3h9RzYo82I5K2IMiZSy7H r8KHJqGSXVymxG9KTOn3sMGBl9OXjq2V8LZ++Dyr7sCLEOxkpqVwUUbnAtqn/MLD r9UhOB1tieVsLChpGrRLh5GmzuQcU92iZH6BDVCj9pgV6y40g30TV0GYzrzWqW7N PglS11D8WcoFPQgU5a+/BalG9jsmCVjLMzxF4bCyMn6jHWCxKOihQErEZiTY+Qgk jo7yOCA7ar5APF4Fk7JalErXVdp26Z1GIfwzc+/j4xhzrzyeoM3N3GJK5O+wVQI= =n7Zh -----END PGP SIGNATURE----- --96YOpH+ONegL0A3E-- From owner-svn-src-head@freebsd.org Fri May 27 20:04:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A39AB4C524; Fri, 27 May 2016 20:04:50 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 710D5143E; Fri, 27 May 2016 20:04:50 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) id <0O7U00I00QCBQH00@mr11p00im-asmtp004.me.com>; Fri, 27 May 2016 20:04:44 +0000 (GMT) Received: from [172.17.133.77] (dip-cali.panasas.com [64.80.217.3]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O7U003DNQFUX920@mr11p00im-asmtp004.me.com>; Fri, 27 May 2016 20:04:43 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-05-27_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1605270227 User-Agent: Microsoft-MacOutlook/f.16.0.160506 Date: Fri, 27 May 2016 13:05:06 -0700 Subject: Re: svn commit: r300866 - head/sys/boot/efi/libefi From: Ravi Pokala Sender: "Pokala, Ravi" To: Doug Ambrisko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <3EF68240-690E-44F9-957A-51BEDA0F35C8@panasas.com> Thread-topic: svn commit: r300866 - head/sys/boot/efi/libefi References: <201605271923.u4RJNF0d016635@repo.freebsd.org> In-reply-to: <201605271923.u4RJNF0d016635@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1464379484; bh=uPH34hvtme0FsCiiXqrLCqUU8G+Ega0QMNE6eSSSgPE=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=jAoaz85NdE2SsHRJxOd7RDKoTHhjVWUh11Fr+7davvKLYJbgAzDn/KJ44E6lIPzQz QNbb2HWRvQw75wT8sS59xhsmWBvsacrCl3h9eE/vdJyyDoMUSznQ3YhdDcYP4A8Hva hsJpwffaLHyy1Zf0QbaxOJnixgQVOP+FtsHTsp8QUb80KpvMcK0puh3GmCpaEPs11t 8h95suJYer1CAvVnGI05bvK8PIrzGPGtODLE/vWh9g2s1WRm57eDzff9E27UA0lyog H5s3Jz2LnRqT/6sXXvPe7Twrk8K6LSgZu5ey3Rhytq5yJJXgHCEVL8QwN85pWhtOge ki8nF8cHLFoXw== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:04:50 -0000 -----Original Message----- From: on behalf of Doug Ambrisko Date: 2016-05-27, Friday at 12:23 To: , , Subject: svn commit: r300866 - head/sys/boot/efi/libefi >Author: ambrisko >Date: Fri May 27 19:23:15 2016 >New Revision: 300866 >URL: https://svnweb.freebsd.org/changeset/base/300866 > >Log: > If the I/O offset and length is multiple of the media size then > directly pass the request otherwise use a buffer that is a > multiple of the media size. This speeds up I/O quite a bit > when using large transfer sizes on 4Kn disks etc. > > MFC after: 1 week I/O offset and length are *divisors* of the media size, not *multiples* of it. -Ravi (rpokala@) From owner-svn-src-head@freebsd.org Fri May 27 20:08:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71944B4C61A; Fri, 27 May 2016 20:08:02 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv25.fwdcdn.com (frv25.fwdcdn.com [212.42.77.25]) by mx1.freebsd.org (Postfix) with ESMTP id 3796A1A67; Fri, 27 May 2016 20:08:01 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from [10.10.14.26] (helo=frv157.fwdcdn.com) by frv25.fwdcdn.com QID:1b6Nmq-000ESP-BD/RC:4; Fri, 27 May 2016 22:51:12 +0300 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=m4tUu8mJfHWhFYXigc3zOx2+bKe+9LzcfbKlrrsc0jQ=; b=rIruOn1qO69hl2higHhRIcbM8F1FErb4iEB8QdykNhJf+Ilu0Hmml4HRUowT/645vEAEYn75Zjkc6yGdmNTdhntLXVXm7Ku+GKOfExfdK75UxbEI1jMVi0MjZ+3ZiJaMXocqeF00NFwbVkaRRr3slDJ2p6wEJEEa6VpycJYrEEU=; Received: from [37.229.193.176] (helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1b6Nmi-000F1z-H9 ; Fri, 27 May 2016 22:51:04 +0300 Date: Fri, 27 May 2016 22:51:03 +0300 From: Ivan Klymenko To: Alan Cox Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300865 - in head/sys: sys vm Message-ID: <20160527225103.67ae3547@nonamehost.local> In-Reply-To: <201605271915.u4RJFkEl013139@repo.freebsd.org> References: <201605271915.u4RJFkEl013139@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=37.229.193.176; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-Ukrnet-Yellow: 0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:08:02 -0000 On Fri, 27 May 2016 19:15:46 +0000 (UTC) Alan Cox wrote: > Author: alc > Date: Fri May 27 19:15:45 2016 > New Revision: 300865 > URL: https://svnweb.freebsd.org/changeset/base/300865 > > Log: > The flag "vm_pages_needed" has long served two distinct purposes: > (1) to indicate that threads are waiting for free pages to become > available and (2) to indicate whether a wakeup call has been sent to > the page daemon. The trouble is that a single flag cannot really > serve both purposes, because we have two distinct targets for when to > wakeup threads waiting for free pages versus when the page daemon has > completed its work. In particular, the flag will be cleared by > vm_page_free() before the page daemon has met its target, and this > can lead to the OOM killer being invoked prematurely. To address this > problem, a new flag "vm_pageout_wanted" is introduced. > Discussed with: jeff > Reviewed by: kib, markj > Tested by: markj > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/sys/vmmeter.h > head/sys/vm/vm_page.c > head/sys/vm/vm_pageout.c > head/sys/vm/vm_pageout.h > > Modified: head/sys/vm/vm_pageout.h > ============================================================================== > --- head/sys/vm/vm_pageout.h Fri May 27 18:52:58 2016 > (r300864) +++ head/sys/vm/vm_pageout.h Fri May 27 19:15:45 > 2016 (r300865) @@ -72,9 +72,10 @@ > */ > > extern int vm_page_max_wired; > -extern int vm_pages_needed; /* should be some "event" > structure */ extern int vm_pageout_deficit; > extern int vm_pageout_page_count; > +extern bool vm_pageout_wanted; > +extern bool vm_pages_needed; > > /* > * Swap out requests > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" ... ===> lib/libalias/modules/smedia (obj) --- cddl/lib__L --- In file included from /usr/src/cddl/lib/libzpool/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:143: /media/da0s1/obj/usr/src/tmp/usr/include/vm/vm_pageout.h:77:8: error: unknown type name 'bool' extern bool vm_pageout_wanted; ^ /media/da0s1/obj/usr/src/tmp/usr/include/vm/vm_pageout.h:78:8: error: unknown type name 'bool' extern bool vm_pages_needed; ^ 2 errors generated. *** [arc.So] Error code 1 make[5]: stopped in /usr/src/cddl/lib/libzpool 1 error make[5]: stopped in /usr/src/cddl/lib/libzpool --- secure/lib__L --- --- all_subdir_secure/lib/libcrypto/engines/libsureware --- A failure has been detected in another branch of the parallel make make[7]: stopped in /usr/src/secure/lib/libcrypto/engines/libsureware --- kerberos5/lib__L --- A failure has been detected in another branch of the parallel make make[5]: stopped in /usr/src/kerberos5/lib/libkrb5 --- cddl/lib__L --- *** [all_subdir_cddl/lib/libzpool] Error code 2 make[4]: stopped in /usr/src/cddl/lib 1 error make[4]: stopped in /usr/src/cddl/lib --- secure/lib__L --- *** [all_subdir_secure/lib/libcrypto/engines/libsureware] Error code 2 make[6]: stopped in /usr/src/secure/lib/libcrypto/engines --- cddl/lib__L --- *** [cddl/lib__L] Error code 2 make[3]: stopped in /usr/src --- kerberos5/lib__L --- *** [all] Error code 2 make[4]: stopped in /usr/src/kerberos5/lib 1 error make[4]: stopped in /usr/src/kerberos5/lib *** [kerberos5/lib__L] Error code 2 make[3]: stopped in /usr/src --- secure/lib__L --- --- all_subdir_secure/lib/libcrypto/engines/libubsec --- A failure has been detected in another branch of the parallel make make[7]: stopped in /usr/src/secure/lib/libcrypto/engines/libubsec *** [all_subdir_secure/lib/libcrypto/engines/libubsec] Error code 2 make[6]: stopped in /usr/src/secure/lib/libcrypto/engines 2 errors make[6]: stopped in /usr/src/secure/lib/libcrypto/engines *** [all] Error code 2 make[5]: stopped in /usr/src/secure/lib/libcrypto 1 error make[5]: stopped in /usr/src/secure/lib/libcrypto *** [all] Error code 2 make[4]: stopped in /usr/src/secure/lib 1 error make[4]: stopped in /usr/src/secure/lib --- lib__L --- A failure has been detected in another branch of the parallel make make[7]: stopped in /usr/src/lib/libalias/modules/smedia --- secure/lib__L --- *** [secure/lib__L] Error code 2 make[3]: stopped in /usr/src --- lib__L --- *** [obj_subdir_lib/libalias/modules/smedia] Error code 2 make[6]: stopped in /usr/src/lib/libalias/modules 1 error make[6]: stopped in /usr/src/lib/libalias/modules *** [obj_subdir_lib/libalias/modules] Error code 2 make[5]: stopped in /usr/src/lib/libalias 1 error make[5]: stopped in /usr/src/lib/libalias *** [obj_subdir_lib/libalias] Error code 2 make[4]: stopped in /usr/src/lib 1 error make[4]: stopped in /usr/src/lib *** [lib__L] Error code 2 make[3]: stopped in /usr/src 4 errors make[3]: stopped in /usr/src *** [libraries] Error code 2 make[2]: stopped in /usr/src 1 error make[2]: stopped in /usr/src *** [_libraries] Error code 2 make[1]: stopped in /usr/src 1 error make[1]: stopped in /usr/src *** [buildworld] Error code 2 make: stopped in /usr/src 1 error make: stopped in /usr/src From owner-svn-src-head@freebsd.org Fri May 27 20:12:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9658B4C9C7; Fri, 27 May 2016 20:12:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA4FA104A; Fri, 27 May 2016 20:12:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RKCWS3035709; Fri, 27 May 2016 20:12:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RKCWCI035708; Fri, 27 May 2016 20:12:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605272012.u4RKCWCI035708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 27 May 2016 20:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300868 - head/tools/tools/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:12:34 -0000 Author: ngie Date: Fri May 27 20:12:32 2016 New Revision: 300868 URL: https://svnweb.freebsd.org/changeset/base/300868 Log: Remove note about bogus chain-len maximum There's no current limit on chain-len with Broadwell DE chips; it isn't enforced in software, and there doesn't appear to be a hardware limitation either on the Intel Xeon D-1527 (Broadwell-DE) chip. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/tools/ioat/ioatcontrol.8 Modified: head/tools/tools/ioat/ioatcontrol.8 ============================================================================== --- head/tools/tools/ioat/ioatcontrol.8 Fri May 27 19:30:13 2016 (r300867) +++ head/tools/tools/ioat/ioatcontrol.8 Fri May 27 20:12:32 2016 (r300868) @@ -133,7 +133,7 @@ The .Ar chain-len argument determines the number of copies to chain together in a single DMA transaction. -The default is 1, and the maximum is currently 4. +The default is 1. .Pp The .Ar duration From owner-svn-src-head@freebsd.org Fri May 27 20:13:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B741FB4CA37; Fri, 27 May 2016 20:13:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 9BB8011C6; Fri, 27 May 2016 20:13:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 9580318C7; Fri, 27 May 2016 20:13:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 35A851C3D1; Fri, 27 May 2016 20:13:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 0T4grF_OtgTE; Fri, 27 May 2016 20:13:25 +0000 (UTC) Subject: Re: svn commit: r300868 - head/tools/tools/ioat DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 424F11C3CC To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605272012.u4RKCWCI035708@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <99944f07-b7fd-e5d3-2112-f0de97e6db79@FreeBSD.org> Date: Fri, 27 May 2016 13:13:30 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605272012.u4RKCWCI035708@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="N0SUT84PjrFIaMd8ajSR2FcoSQmXBkJTN" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:13:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --N0SUT84PjrFIaMd8ajSR2FcoSQmXBkJTN Content-Type: multipart/mixed; boundary="IxcqEClVNcVxtTguHkx9b1s2wvHI736B1" From: Bryan Drewery To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <99944f07-b7fd-e5d3-2112-f0de97e6db79@FreeBSD.org> Subject: Re: svn commit: r300868 - head/tools/tools/ioat References: <201605272012.u4RKCWCI035708@repo.freebsd.org> In-Reply-To: <201605272012.u4RKCWCI035708@repo.freebsd.org> --IxcqEClVNcVxtTguHkx9b1s2wvHI736B1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/27/2016 1:12 PM, Garrett Cooper wrote: > Author: ngie > Date: Fri May 27 20:12:32 2016 > New Revision: 300868 > URL: https://svnweb.freebsd.org/changeset/base/300868 >=20 > Log: > Remove note about bogus chain-len maximum > =20 > There's no current limit on chain-len with Broadwell DE chips; it isn= 't > enforced in software, and there doesn't appear to be a hardware limit= ation > either on the Intel Xeon D-1527 (Broadwell-DE) chip. > =20 > MFC after: 1 week > Sponsored by: EMC / Isilon Storage Division >=20 > Modified: > head/tools/tools/ioat/ioatcontrol.8 >=20 > Modified: head/tools/tools/ioat/ioatcontrol.8 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/tools/tools/ioat/ioatcontrol.8 Fri May 27 19:30:13 2016 (r3008= 67) > +++ head/tools/tools/ioat/ioatcontrol.8 Fri May 27 20:12:32 2016 (r3008= 68) > @@ -133,7 +133,7 @@ The > .Ar chain-len > argument determines the number of copies to chain together in a single= DMA > transaction. > -The default is 1, and the maximum is currently 4. > +The default is 1. > .Pp > The > .Ar duration >=20 Missed .Dd --=20 Regards, Bryan Drewery --IxcqEClVNcVxtTguHkx9b1s2wvHI736B1-- --N0SUT84PjrFIaMd8ajSR2FcoSQmXBkJTN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXSKpqAAoJEDXXcbtuRpfPhCIH/1Raz1HwGampDFnGQXfkFASu tzClE65ZGOCizKJ+zFcxlPYqYYhu99E2BiMPG13Yf971Vu4yJ2C6X2/rPJJgSy8W KIkejYNGKbF/Y9wFLsA1J4AkmnZu2DZAu0DBDc+7uXyxvOQ2kZU+jEvRcafGuGcJ bOtgfiv1U3lgwtzpze4n9GI4H+KY3ZYMWVJq4j2kZy+7meorY5ZbhWmzUmJJVfYj Txw3hKJ0YDXSdT5gHbZwOWhgBlRZvwrfSMBMUQWw7Fdiwuv9i9tdkdMPclLeWUWQ WtTzQCoyyWGWIO4pvjB481hs4EYebavpOPkpke8On3VANszmw5DCE5sYWcZB41c= =NkkP -----END PGP SIGNATURE----- --N0SUT84PjrFIaMd8ajSR2FcoSQmXBkJTN-- From owner-svn-src-head@freebsd.org Fri May 27 20:14:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 563C8B4CA8E; Fri, 27 May 2016 20:14:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22e.google.com (mail-pa0-x22e.google.com [IPv6:2607:f8b0:400e:c03::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24D32132D; Fri, 27 May 2016 20:14:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x22e.google.com with SMTP id bz2so13317890pad.1; Fri, 27 May 2016 13:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=7DcWXmZLNmWuqtGECDI2stHkx+PoOCbEzYpnU8q4JS4=; b=dl2mePDk0SB/OFsoRB/bEqAfqTQ82Jcmy2cUE1DqKkKzhuSWe1pBJ+x4P2vr1WcPYL w/foUdONEQqe/qJGzFiKPQAJlWODqrqAIzaeqEETXYEt4J4ygvOK/irt2JO6a2W6z+5n vNwMblLZ4GduHCXWjegr5xj6kTQldfCY5zuijszI7xEpyuC0Sm36QY6Ygwb0Ws6ukgEi Cr3xMaa8oHa1lMcT93kEg0QXaj1LwnJcGNW2iAmWGMBHpe8Rq4XY6Yqf4QNmx2VMKrGI nzQCUBAj6yqgLITkd3V3NTIZowkIJfSsRBrgLtfV+yDvs6ngG7adxBuuP6MDU0+oyWrJ oFrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=7DcWXmZLNmWuqtGECDI2stHkx+PoOCbEzYpnU8q4JS4=; b=hKs4wTCHi+3cZSMWGqGqKyfSJaZsPl3UWj66Q4Hlxem+/A58RYaqG/4ggIUkXTsN8K D/HJ4aAaN473P58ZD1lIuShESNYyqwCNR3Oq0Fp/2U7PPshkcJyUsQFFqCw3kGf9wWww Q971ut79z8udjDt2AjgRoHhe6gkKU2u9NZbKNhj+XrG9gowmrM1WZicmxUBT1UprZN2R SalVBPkgbOgDIkUx6cM4YIqMLYAiK6HOmQ4Xxx9hVmujqB4hDHwZ++XX3hzpqWbaQgly sqX0u9qIKVEAcgizjhU0IaQUWP2MiA6jZ4chqawCtufR5uP1/xCAoNAI9R83SaAN2o6i FA8g== X-Gm-Message-State: ALyK8tLV7bNMtjm2Ll5lHh1FAi923ddAcS28YNoa0x9/PSZmYK25p92LvOnoTCg2o8gXbA== X-Received: by 10.66.220.168 with SMTP id px8mr19951522pac.83.1464380043540; Fri, 27 May 2016 13:14:03 -0700 (PDT) Received: from pinklady.local (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id p13sm15660456pfj.58.2016.05.27.13.14.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 May 2016 13:14:02 -0700 (PDT) Subject: Re: svn commit: r300868 - head/tools/tools/ioat Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_45F8435C-8BCC-4154-BC9F-9C4D2AE2D300"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <99944f07-b7fd-e5d3-2112-f0de97e6db79@FreeBSD.org> Date: Fri, 27 May 2016 13:14:00 -0700 Cc: Garrett Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201605272012.u4RKCWCI035708@repo.freebsd.org> <99944f07-b7fd-e5d3-2112-f0de97e6db79@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:14:04 -0000 --Apple-Mail=_45F8435C-8BCC-4154-BC9F-9C4D2AE2D300 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On May 27, 2016, at 13:13, Bryan Drewery wrote: >=20 > On 5/27/2016 1:12 PM, Garrett Cooper wrote: >> Author: ngie >> Date: Fri May 27 20:12:32 2016 >> New Revision: 300868 >> URL: https://svnweb.freebsd.org/changeset/base/300868 >>=20 >> Log: >> Remove note about bogus chain-len maximum >>=20 >> There's no current limit on chain-len with Broadwell DE chips; it = isn't >> enforced in software, and there doesn't appear to be a hardware = limitation >> either on the Intel Xeon D-1527 (Broadwell-DE) chip. >>=20 >> MFC after: 1 week >> Sponsored by: EMC / Isilon Storage Division >>=20 >> Modified: >> head/tools/tools/ioat/ioatcontrol.8 >>=20 >> Modified: head/tools/tools/ioat/ioatcontrol.8 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/tools/tools/ioat/ioatcontrol.8 Fri May 27 19:30:13 2016 = (r300867) >> +++ head/tools/tools/ioat/ioatcontrol.8 Fri May 27 20:12:32 2016 = (r300868) >> @@ -133,7 +133,7 @@ The >> .Ar chain-len >> argument determines the number of copies to chain together in a = single DMA >> transaction. >> -The default is 1, and the maximum is currently 4. >> +The default is 1. >> .Pp >> The >> .Ar duration >>=20 >=20 > Missed .Dd I already bumped it for the day ;). Thanks! -Ngie --Apple-Mail=_45F8435C-8BCC-4154-BC9F-9C4D2AE2D300 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 iQIcBAEBCgAGBQJXSKqJAAoJEPWDqSZpMIYVCy8P/3pIUj9tRFTLLCN4w3z/vcaM aRljVyM4MnKMJ87KSdOYarmCT4B1dBIkUfLSRLcKniqbO/OJOAOnyf2W7Cb1f693 3GlaIBwRJqzPEY/BKpqrVTkd9hYnyg9Y5jOoFHJN8CNOLBGxhI3dqTe9HtNUrgMJ Dnn4W4o+saPrjuOM89e5XfkKyD1sZSrAJQS2akYhkopcrsZSBuov4yWXPoL153vF kKecNDhU3v0XhBoE5fWzPnUL2M3B3zt9cXpSw77G+/6+pCISKoo2kzonSAXGU5cV HHBVOdWLDW7UsIpjBfjrcyLAnQ+NeEWCuLkA7NW9S5ME/WHMnvfdoJ5+qsA+t3OQ 6iWO0tGOS3sYDa5j/sEoGfLzMqDNBqTdMTTrN6bDeQlm2ItBsAaEHrkGoxwRseDQ RSt59RmREL/c/Z5mbFRUYwohyzHbtqDrVTeqZAezFO9L/0wB/ohTI0gv/Bk+MvO2 Xxb5USXcF2Fx3W7Nf5Lo/m2YaUgL1vJwSmHXgnwbUgXSKbDJYkVqQRTIp9H/RG2A ztKR0ZiUFuOk1ZzXU/+OBCFKwAl40TWVLCbS1SbosADSI6muUXYOnqmP9TDuAobU qrZ62okikAtav1Eicz3yvd5AHYRz9WxpPhD6DQdGd7K6X3pSZHSeOt2kio8mIP1n 1mwBDtPbwAM4d9nIDqvl =q/WH -----END PGP SIGNATURE----- --Apple-Mail=_45F8435C-8BCC-4154-BC9F-9C4D2AE2D300-- From owner-svn-src-head@freebsd.org Fri May 27 20:29:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 101E4B4D020; Fri, 27 May 2016 20:29:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com [209.85.214.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D94051D99; Fri, 27 May 2016 20:29:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f42.google.com with SMTP id z123so2910204itg.0; Fri, 27 May 2016 13:29:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=UPy36WVmdHtkWIuRFMeeTu5tkGl8Zz3sJT56oSddPTk=; b=j+/JJpj9EQP1xJExt0RaQTDgm85CZNDExewd8+e0wZqvRZ1qcrYUq7CS8ckWrjgfNT fs/M+jSMiD5hZf3Y9fVqcK/VF+T319uibGdO4URAwcm5P8jDyzIsk3+Cqp6LhxDJ8ET6 kTephQqA4pzJ4+oo72GgrgfMrs0WVffWZv/AqtB+4uPwYqnJSuVFmMdbi3qHCAgJGWlG 8caco6hW05oV8sxmaBvFhJjasdPHwFuDDx2NR+zPu1rc5Y32o09vv3REziIrEkDoewU4 SI4BRzigAovqUusG1yo1vWQiKkr+pZlSsT9vxGHzF/APg/gQEBy7fYazqIwxRDoo70DK bXUA== X-Gm-Message-State: ALyK8tJeKBFJD/hGv8BVP2WA97nVFX5tgxEKWaFGJ5xIxwEI6fARjlTzEFvVxFobnXAMqQ== X-Received: by 10.36.28.193 with SMTP id c184mr445217itc.90.1464380957737; Fri, 27 May 2016 13:29:17 -0700 (PDT) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com. [209.85.214.53]) by smtp.gmail.com with ESMTPSA id ft7sm3143718igc.10.2016.05.27.13.29.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 May 2016 13:29:17 -0700 (PDT) Received: by mail-it0-f53.google.com with SMTP id e62so3348806ita.1; Fri, 27 May 2016 13:29:17 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.36.158.69 with SMTP id p66mr376941itd.97.1464380957007; Fri, 27 May 2016 13:29:17 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Fri, 27 May 2016 13:29:16 -0700 (PDT) In-Reply-To: <3EF68240-690E-44F9-957A-51BEDA0F35C8@panasas.com> References: <201605271923.u4RJNF0d016635@repo.freebsd.org> <3EF68240-690E-44F9-957A-51BEDA0F35C8@panasas.com> Date: Fri, 27 May 2016 13:29:16 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300866 - head/sys/boot/efi/libefi From: Conrad Meyer To: Ravi Pokala Cc: Doug Ambrisko , src-committers , 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:29:24 -0000 It seems he meant 'media native IO size', not 'media size'. I.e., on 4Kn media, 4k-multiple and -aligned IOs can be processed directly (but EFI's unit block size is still 512). Does that make sense? Best, Conrad On Fri, May 27, 2016 at 1:05 PM, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Doug Ambrisko > Date: 2016-05-27, Friday at 12:23 > To: , , > Subject: svn commit: r300866 - head/sys/boot/efi/libefi > >>Author: ambrisko >>Date: Fri May 27 19:23:15 2016 >>New Revision: 300866 >>URL: https://svnweb.freebsd.org/changeset/base/300866 >> >>Log: >> If the I/O offset and length is multiple of the media size then >> directly pass the request otherwise use a buffer that is a >> multiple of the media size. This speeds up I/O quite a bit >> when using large transfer sizes on 4Kn disks etc. >> >> MFC after: 1 week > > I/O offset and length are *divisors* of the media size, not *multiples* of it. > > -Ravi (rpokala@) > > > > From owner-svn-src-head@freebsd.org Fri May 27 20:33:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 816C7B4D16F; Fri, 27 May 2016 20:33:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4491211A5; Fri, 27 May 2016 20:33:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RKXEBo043323; Fri, 27 May 2016 20:33:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RKXEro043322; Fri, 27 May 2016 20:33:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605272033.u4RKXEro043322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 27 May 2016 20:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300869 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:33:15 -0000 Author: gjb Date: Fri May 27 20:33:14 2016 New Revision: 300869 URL: https://svnweb.freebsd.org/changeset/base/300869 Log: Make PKG_VERSION aware of '-ALPHA*'. Submitted by: Ben Woods Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri May 27 20:12:32 2016 (r300868) +++ head/Makefile.inc1 Fri May 27 20:33:14 2016 (r300869) @@ -300,7 +300,7 @@ VERSION= FreeBSD ${_REVISION}-${_BRANCH: .endif .if !defined(PKG_VERSION) -.if ${_BRANCH:MSTABLE*} || ${_BRANCH:MCURRENT*} +.if ${_BRANCH:MSTABLE*} || ${_BRANCH:MCURRENT*} || ${_BRANCH:MALPHA*} TIMENOW= %Y%m%d%H%M%S EXTRA_REVISION= .s${TIMENOW:gmtime} .endif From owner-svn-src-head@freebsd.org Fri May 27 20:33:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3826B4D1B7; Fri, 27 May 2016 20:33:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84BC91310; Fri, 27 May 2016 20:33:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RKXcdH043386; Fri, 27 May 2016 20:33:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RKXcWx043385; Fri, 27 May 2016 20:33:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605272033.u4RKXcWx043385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 27 May 2016 20:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300870 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:33:39 -0000 Author: ngie Date: Fri May 27 20:33:38 2016 New Revision: 300870 URL: https://svnweb.freebsd.org/changeset/base/300870 Log: Unbreak the zfs(4) build vm/vm_pageout.h grew a dependency on the bool typedef in r300865 arc.c didn't include sys/types.h, which included the definition for the typedef Other items (ofed, drm2) might need to be chased for this commit. X-MFC with: r300865 MFC after: 1 week Pointyhat to: alc Sponsored by: EMC / Isilon Storage Division 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 Fri May 27 20:33:14 2016 (r300869) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri May 27 20:33:38 2016 (r300870) @@ -120,6 +120,7 @@ * - ARC header release, as it removes from L2ARC buflists */ +#include #include #include #include From owner-svn-src-head@freebsd.org Fri May 27 20:34:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E0C2B4D205; Fri, 27 May 2016 20:34:05 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23B111510; Fri, 27 May 2016 20:34:05 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) id <0O7U00D00REABR00@mr11p00im-asmtp004.me.com>; Fri, 27 May 2016 20:34:04 +0000 (GMT) Received: from [172.17.133.77] (dip-cali.panasas.com [64.80.217.3]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O7U0072CRSQWG00@mr11p00im-asmtp004.me.com>; Fri, 27 May 2016 20:34:04 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-05-27_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1605270233 User-Agent: Microsoft-MacOutlook/f.16.0.160506 Date: Fri, 27 May 2016 13:34:27 -0700 Subject: Re: svn commit: r300866 - head/sys/boot/efi/libefi From: Ravi Pokala Sender: "Pokala, Ravi" To: cem@FreeBSD.org Cc: Doug Ambrisko , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r300866 - head/sys/boot/efi/libefi References: <201605271923.u4RJNF0d016635@repo.freebsd.org> <3EF68240-690E-44F9-957A-51BEDA0F35C8@panasas.com> In-reply-to: MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1464381244; bh=k3yIZWQlW+GqUCdPCyH5jawQCEC92Nrz5Rkf6wdvQ0I=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=lKO6xb/ka2991KlIw2W785CN/hbJouqaH0rBSzsAeIfkrAjT/xGxbpXYaIaJ31nNa eNLGkI/B+5C7uXsQq1NCDN8FDaBvF5JmYQ9XUa9fD+Ygn0+QVIQ5wjVxCDmVCtZopk Crt902LdvhhGNSnM4uFNogS0wb3k2amn7hfNn+4Ay0v8JAcKUFWE9aBCZmjvwYJ36x 8uJ8WKL5nKzF+OHvMySRyLDnO37fkcQL36C1AtwbYZArwG9N3vHKnK6Orrra2pZfra i5pDz6leSv+CHgBYUarRgwbdbfUPS/m1fyxQ9UaUoZbvccrKM5w3l1zRJ6Hvp/M50m h0YZhniUVYncw== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:34:05 -0000 -----Original Message----- From: on behalf of Conrad Meyer Reply-To: Date: 2016-05-27, Friday at 13:29 To: Ravi Pokala Cc: Doug Ambrisko , src-committers , , Subject: Re: svn commit: r300866 - head/sys/boot/efi/libefi >It seems he meant 'media native IO size', not 'media size'. I.e., on >4Kn media, 4k-multiple and -aligned IOs can be processed directly (but >EFI's unit block size is still 512). Does that make sense? Yes, that's exactly what I meant. Thanks, Ravi (rpokala@) >Best, >Conrad > >On Fri, May 27, 2016 at 1:05 PM, Ravi Pokala wrote: >> -----Original Message----- >> From: on behalf of Doug Ambrisko >> Date: 2016-05-27, Friday at 12:23 >> To: , , >> Subject: svn commit: r300866 - head/sys/boot/efi/libefi >> >>>Author: ambrisko >>>Date: Fri May 27 19:23:15 2016 >>>New Revision: 300866 >>>URL: https://svnweb.freebsd.org/changeset/base/300866 >>> >>>Log: >>> If the I/O offset and length is multiple of the media size then >>> directly pass the request otherwise use a buffer that is a >>> multiple of the media size. This speeds up I/O quite a bit >>> when using large transfer sizes on 4Kn disks etc. >>> >>> MFC after: 1 week >> >> I/O offset and length are *divisors* of the media size, not *multiples* of it. >> >> -Ravi (rpokala@) >> >> >> >> > From owner-svn-src-head@freebsd.org Fri May 27 20:34:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D9D6B4D273; Fri, 27 May 2016 20:34:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CCF31892; Fri, 27 May 2016 20:34:39 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f176.google.com with SMTP id 190so78980799iow.1; Fri, 27 May 2016 13:34:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-transfer-encoding; bh=/fzDeDTlctSGxxLrL6NiACKqTT39WSV1eu5YkpDuhv0=; b=Rep536JFdXv+ZXwH58y2LbmCUDbT4lXli0cm8Qba8srS6AcP8CEpJ15HRCFPDKqEzy CrX1P4Z+9vGtAcx4G36vtDR60y/suvjrM+bMCPQhVOoq1X3H0PJrGlxqg2SuklQTz3aD l4SPcc5ZIVf97Nz1cY+AwYNXA6ootAM6SUURs0iVhzTHzjoVgsLLlv3I+VJ3AlseQnLM Y0kv/h/LjqgOTWpXs96UbSti0WgZkj4h6MsFysheUX8Kvw2t7suZUSqkpq40/GiPmEXI T715/TzzoPqLXl9GdgAi6tlyKg/03x00/qPuZ2InN3VElsri+E+4yhmJbm1ubonTfJL5 Y3Nw== X-Gm-Message-State: ALyK8tKNFMYxiZm89QSrrboJG2zSP4BIXnBybR1eSrDo59VP5Ec0oTDirZZaJsarwkciuA== X-Received: by 10.107.41.84 with SMTP id p81mr16732203iop.106.1464381273072; Fri, 27 May 2016 13:34:33 -0700 (PDT) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com. [209.85.214.48]) by smtp.gmail.com with ESMTPSA id e66sm6579600iof.18.2016.05.27.13.34.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 May 2016 13:34:32 -0700 (PDT) Received: by mail-it0-f48.google.com with SMTP id z189so3036910itg.0; Fri, 27 May 2016 13:34:32 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.36.158.69 with SMTP id p66mr396366itd.97.1464381272387; Fri, 27 May 2016 13:34:32 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Fri, 27 May 2016 13:34:32 -0700 (PDT) In-Reply-To: <201605272012.u4RKCWCI035708@repo.freebsd.org> References: <201605272012.u4RKCWCI035708@repo.freebsd.org> Date: Fri, 27 May 2016 13:34:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300868 - head/tools/tools/ioat From: Conrad Meyer To: Garrett Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:34:40 -0000 On Fri, May 27, 2016 at 1:12 PM, Garrett Cooper wrote: > Author: ngie > Date: Fri May 27 20:12:32 2016 > New Revision: 300868 > URL: https://svnweb.freebsd.org/changeset/base/300868 > > Log: > Remove note about bogus chain-len maximum > > There's no current limit on chain-len with Broadwell DE chips; it isn't > enforced in software, and there doesn't appear to be a hardware limitat= ion > either on the Intel Xeon D-1527 (Broadwell-DE) chip. Hi Ngie, The note isn't bogus, it's just not what you think it is=E2=80=94the limit = is in the ioat_test code, not a limit of the hardware. Before this commit which documented it (r289733), the limit *was* 4. However, in the same commit I bumped the limit up to 128 (IOAT_MAX_BUFS / 2). (I suspect I wrote the documentation first, before deciding to raise the limit.) So the current limit is 128, and should be documented. Thanks, Conrad From owner-svn-src-head@freebsd.org Fri May 27 20:41:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 015E3B4D367; Fri, 27 May 2016 20:41:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7F251BE4; Fri, 27 May 2016 20:41:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RKfQ0S045665; Fri, 27 May 2016 20:41:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RKfPoe045663; Fri, 27 May 2016 20:41:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605272041.u4RKfPoe045663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 27 May 2016 20:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300871 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:41:27 -0000 Author: ian Date: Fri May 27 20:41:25 2016 New Revision: 300871 URL: https://svnweb.freebsd.org/changeset/base/300871 Log: Don't wrap the declaration of gpio_alloc_intr_resource() in #ifdef INTRNG, wrap the implementation so that it returns an error if INTRNG support is not available. It should be possible to write a non-INTRNG implementation of this function some day. In the meantime, there is code that contains calls to this function (so the decl is needed), but have runtime checks to avoid calling it in the non-INTRNG case. Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Fri May 27 20:33:38 2016 (r300870) +++ head/sys/dev/gpio/gpiobus.c Fri May 27 20:41:25 2016 (r300871) @@ -96,6 +96,14 @@ gpio_alloc_intr_resource(device_t consum return (bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, irqnum, irqnum, 1, alloc_flags)); } +#else +struct resource * +gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags, + gpio_pin_t pin, uint32_t intr_mode) +{ + + return (NULL); +} #endif int Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Fri May 27 20:33:38 2016 (r300870) +++ head/sys/dev/gpio/gpiobusvar.h Fri May 27 20:41:25 2016 (r300871) @@ -128,10 +128,8 @@ int gpio_pin_is_active(gpio_pin_t pin, b int gpio_pin_set_active(gpio_pin_t pin, bool active); int gpio_pin_setflags(gpio_pin_t pin, uint32_t flags); #endif -#ifdef INTRNG struct resource *gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags, gpio_pin_t pin, uint32_t intr_mode); -#endif int gpio_check_flags(uint32_t, uint32_t); device_t gpiobus_attach_bus(device_t); int gpiobus_detach_bus(device_t); From owner-svn-src-head@freebsd.org Fri May 27 20:43:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5A3DB4D496; Fri, 27 May 2016 20:43:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7841A1F37; Fri, 27 May 2016 20:43:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RKhkpa047003; Fri, 27 May 2016 20:43:46 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RKhkYv047002; Fri, 27 May 2016 20:43:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605272043.u4RKhkYv047002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 27 May 2016 20:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300872 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:43:47 -0000 Author: ian Date: Fri May 27 20:43:46 2016 New Revision: 300872 URL: https://svnweb.freebsd.org/changeset/base/300872 Log: Go back to unconditionally compiling modules/gpio now that the parts of it dependent on FDT support are conditionally compiled only on FDT platforms. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 27 20:41:25 2016 (r300871) +++ head/sys/modules/Makefile Fri May 27 20:43:46 2016 (r300872) @@ -125,7 +125,7 @@ SUBDIR= \ geom \ ${_glxiic} \ ${_glxsb} \ - ${_gpio} \ + gpio \ hatm \ hifn \ hme \ @@ -735,10 +735,6 @@ _cfi= cfi _cpsw= cpsw .endif -.if ${MACHINE_ARCH} == "armv6" -_gpio= gpio -.endif - .if ${MACHINE_CPUARCH} == "powerpc" _agp= agp _an= an From owner-svn-src-head@freebsd.org Fri May 27 20:45:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFEB5B4D506; Fri, 27 May 2016 20:45:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F2791107; Fri, 27 May 2016 20:45:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RKjWSX047131; Fri, 27 May 2016 20:45:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RKjWQX047129; Fri, 27 May 2016 20:45:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201605272045.u4RKjWQX047129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 27 May 2016 20:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300873 - in head/lib: libc++ libcxxrt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:45:33 -0000 Author: dim Date: Fri May 27 20:45:32 2016 New Revision: 300873 URL: https://svnweb.freebsd.org/changeset/base/300873 Log: After r300770, for libc++ and libcxxrt, use -isystem instead of -I. This should fix builds with external gcc toolchains from ports, which also use -isystem to work around problems with gcc's --sysroot implementation. Thanks to Bryan Drewery for this workaround. Modified: head/lib/libc++/Makefile head/lib/libcxxrt/Makefile Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Fri May 27 20:43:46 2016 (r300872) +++ head/lib/libc++/Makefile Fri May 27 20:45:32 2016 (r300873) @@ -63,7 +63,7 @@ cxxrt_${_S}: ${_LIBCXXRTDIR}/${_S} .NOME .endfor WARNS= 0 -CFLAGS+= -I${HDRDIR} -I${_LIBCXXRTDIR} -nostdinc++ -nostdlib -DLIBCXXRT +CFLAGS+= -isystem ${HDRDIR} -isystem ${_LIBCXXRTDIR} -nostdinc++ -nostdlib -DLIBCXXRT .if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=c++11 .endif Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Fri May 27 20:43:46 2016 (r300872) +++ head/lib/libcxxrt/Makefile Fri May 27 20:45:32 2016 (r300873) @@ -21,7 +21,7 @@ SRCS+= libelftc_dem_gnu3.c\ guard.cc WARNS= 0 -CFLAGS+= -I${SRCDIR} -nostdinc++ +CFLAGS+= -isystem ${SRCDIR} -nostdinc++ .if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=c++11 .endif From owner-svn-src-head@freebsd.org Fri May 27 20:51:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1E7FB4D6A7; Fri, 27 May 2016 20:51:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com [IPv6:2607:f8b0:400e:c03::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B7B91652; Fri, 27 May 2016 20:51:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x229.google.com with SMTP id bz2so13528832pad.1; Fri, 27 May 2016 13:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=UIx33RtubPcrKmEMmFjj+H/jrtQ4CsBPzJTO2sywp8M=; b=vTB7Jhh93+meVHEQ8WN1t7j1leS6hLFOXQtOnJnbamOJ3BroTHgVJi7w77y4mk6Nyq 1UxWHq/EzRD55LdjFQDIP+w5tnP8eOzn7c08GcdPV21swTL/DwVHrSyh2oRiJAxveoeA P8XqEpyV+ZAFk402nam1o0iF8YqvsKPXd5k3DZzlfmJkWoL2V//AG+zAhohdMYUGcFl1 ZFFbAIbGF5ldY0o6/Qg9dP3Pp+DK11PItSEn0a+/+lbD1vT3GpK/45+izd1Cf+fYXYm/ vdCUa5q+oFqlEAEqErfmvT++N6BBEgKOZit+z+EsdginEcfUdwY9CYVRMo3I058afDkE Au5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=UIx33RtubPcrKmEMmFjj+H/jrtQ4CsBPzJTO2sywp8M=; b=gBsunqnq4TRuSLpsrMAkMqAUVEmUTdiK2cdcJutPj2JJLBRDuKLQ63ofKs4Xhkz1Dt 9kp6993/H7dZ/zG+iz0OX4DLdiFuvesjutIK5ZZJic1BIZK7uWTYLw5FvRfgyrYi9vjH 0YyR3ktQ36hEomPnKXRQGdapbhtv2JFF/807UXLWwKK1esafD5mizbUsaXZ5N0Rv5l6D WeSr7Gqi5/biJbl4tqo5HBubc9HBdMqowUUkXP5fd4qDG0gQYJUAKqzEVenyDIK/Xv0L 8snSUROVrS+I6Qzh1tMiiO9HWuwWi/+CaZN5USg7EZUHIGSRTb/QH2do6VLlHuc12vfY w7jw== X-Gm-Message-State: ALyK8tJoU1suLdMKvvQLIr1gIeA64jmTqvaR9KIM9zc6fllk9VIlop2FNcMG3p4jCE1UFw== X-Received: by 10.66.150.70 with SMTP id ug6mr25386196pab.132.1464382278146; Fri, 27 May 2016 13:51:18 -0700 (PDT) Received: from pinklady.local (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id o7sm15743675pfb.76.2016.05.27.13.51.17 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 May 2016 13:51:17 -0700 (PDT) Subject: Re: svn commit: r300868 - head/tools/tools/ioat Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_6BA84278-B514-4E5B-9E9E-5774B6B528B6"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Fri, 27 May 2016 13:51:15 -0700 Cc: Garrett Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <2F93033E-D202-4A0A-8555-76ED789D4080@gmail.com> References: <201605272012.u4RKCWCI035708@repo.freebsd.org> To: cem@FreeBSD.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:51:18 -0000 --Apple-Mail=_6BA84278-B514-4E5B-9E9E-5774B6B528B6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 27, 2016, at 13:34, Conrad Meyer wrote: >=20 > On Fri, May 27, 2016 at 1:12 PM, Garrett Cooper = wrote: >> Author: ngie >> Date: Fri May 27 20:12:32 2016 >> New Revision: 300868 >> URL: https://svnweb.freebsd.org/changeset/base/300868 >>=20 >> Log: >> Remove note about bogus chain-len maximum >>=20 >> There's no current limit on chain-len with Broadwell DE chips; it = isn't >> enforced in software, and there doesn't appear to be a hardware = limitation >> either on the Intel Xeon D-1527 (Broadwell-DE) chip. >=20 > Hi Ngie, >=20 > The note isn't bogus, it's just not what you think it is=E2=80=94the = limit is > in the ioat_test code, not a limit of the hardware. >=20 > Before this commit which documented it (r289733), the limit *was* 4. > However, in the same commit I bumped the limit up to 128 > (IOAT_MAX_BUFS / 2). (I suspect I wrote the documentation first, > before deciding to raise the limit.) >=20 > So the current limit is 128, and should be documented. Ah=E2=80=A6 that makes sense. Would it be a better idea to make this = limit into a readonly sysctl in ioat_test(4), along with the other = limits? If so, I=E2=80=99ll put that out for CR. Thanks, -Ngie --Apple-Mail=_6BA84278-B514-4E5B-9E9E-5774B6B528B6 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 iQIcBAEBCgAGBQJXSLNDAAoJEPWDqSZpMIYVubYP/RddAOw+DSkQGM5nZqFMK9nK fss62CtKxndy0YWJ/LMTSuFovDMqFDZ+QRr74DDrFXAAW1aS7+yDaWJK6lGXTJs5 I9Q9bXHMm4NmJpBEWxmA7PMwy1nKac+CDBXqOKWAv1Nr/FgaPXoxYHuRUYpW15pc YO2hKByGU3aP39+LeLcgtXSPzw3k96b0dpQQTEgciqq76UxTok01OsKANucYQ8Uw bt/9lRu2U26deXjj1wXmvr6CtM0+hrhi0HZ2Kz4kRRVSijBFm7CLmjAqvXePA/cI JyhDYy4CSjZrC4f1dn40KoRY2mwLDqk6RTSwnXRGAb3r7qEsbBkQ6JwHPqSUAw1t MHWO+H+dIjXTSxXSz2+3vDR9Jjvt/y5V0QLxRU8P+tb0s/HwgX2YHWPT4NFHzoVY TojtrwVs5z7Jo7Boh6l2xjPKCUClFpD3i/ODT/AYpg53bXbGyVQK4RgCuuYF6rZd HHHzIpxgBEToR70LIWKjRrGa04bhavGV9KGXtX8WUAkR44A9nFDFulbuQJeiPZan DOg76eStxfFi5QZ6oXKwzpxXd1LD9I5KN3ie5XfeqVV1/s+97kQALuWyuZ+hZJkF SwV/BtEj40aePOYfBcJK6xh1POVQCZ1Is9Cm+eBqw3w64LrD63eIGexU5aZUmlV1 Lh9CYFtyi8VWgyE0V50h =O5xs -----END PGP SIGNATURE----- --Apple-Mail=_6BA84278-B514-4E5B-9E9E-5774B6B528B6-- From owner-svn-src-head@freebsd.org Fri May 27 20:52:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B45F2B4D7C2; Fri, 27 May 2016 20:52:53 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A1C519A0; Fri, 27 May 2016 20:52:53 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1b6OkU-0000DL-Ph; Fri, 27 May 2016 23:52:50 +0300 Date: Fri, 27 May 2016 23:52:50 +0300 From: Slawa Olhovchenkov To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300869 - head Message-ID: <20160527205250.GE39874@zxy.spb.ru> References: <201605272033.u4RKXEro043322@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605272033.u4RKXEro043322@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:52:53 -0000 On Fri, May 27, 2016 at 08:33:14PM +0000, Glen Barber wrote: > Author: gjb > Date: Fri May 27 20:33:14 2016 > New Revision: 300869 > URL: https://svnweb.freebsd.org/changeset/base/300869 > > Log: > Make PKG_VERSION aware of '-ALPHA*'. What about all other tags? BETA, RC, PRERELEASE... > Submitted by: Ben Woods > Sponsored by: The FreeBSD Foundation > > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Fri May 27 20:12:32 2016 (r300868) > +++ head/Makefile.inc1 Fri May 27 20:33:14 2016 (r300869) > @@ -300,7 +300,7 @@ VERSION= FreeBSD ${_REVISION}-${_BRANCH: > .endif > > .if !defined(PKG_VERSION) > -.if ${_BRANCH:MSTABLE*} || ${_BRANCH:MCURRENT*} > +.if ${_BRANCH:MSTABLE*} || ${_BRANCH:MCURRENT*} || ${_BRANCH:MALPHA*} > TIMENOW= %Y%m%d%H%M%S > EXTRA_REVISION= .s${TIMENOW:gmtime} > .endif > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Fri May 27 20:56:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA348B4D83F; Fri, 27 May 2016 20:56:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id ABAA21B82; Fri, 27 May 2016 20:56:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 5C3E31F91; Fri, 27 May 2016 20:56:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Fri, 27 May 2016 20:56:14 +0000 From: Glen Barber To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300869 - head Message-ID: <20160527205614.GH4025@FreeBSD.org> References: <201605272033.u4RKXEro043322@repo.freebsd.org> <20160527205250.GE39874@zxy.spb.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GBDnBH7+ZvLx8QD4" Content-Disposition: inline In-Reply-To: <20160527205250.GE39874@zxy.spb.ru> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:56:17 -0000 --GBDnBH7+ZvLx8QD4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 27, 2016 at 11:52:50PM +0300, Slawa Olhovchenkov wrote: > On Fri, May 27, 2016 at 08:33:14PM +0000, Glen Barber wrote: >=20 > > Author: gjb > > Date: Fri May 27 20:33:14 2016 > > New Revision: 300869 > > URL: https://svnweb.freebsd.org/changeset/base/300869 > >=20 > > Log: > > Make PKG_VERSION aware of '-ALPHA*'. >=20 > What about all other tags? BETA, RC, PRERELEASE... >=20 They will reflect the branch in the package name. (11.0-RELEASE, for example.) I'm looking at the logic now to fix this. Glen --GBDnBH7+ZvLx8QD4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXSLRuAAoJEAMUWKVHj+KThTgP/3V9Z0TWa01/az1dYK6upIkL 0OuAFkpXu66eUlNkO7NoZHcV7FXE3T95aPuLtPzeXX4hFS1aV47ZPbTw4Csc3k+e bs7a03C6JOirDwPGCOa5YDS/A1e7TdGzm4K4KvZftI9XT4GhtogbZZ3hAwgQC9lM bLb1GMhsOzmNoUel2MMshWhN6USXz50a0ppsYawslvWNGhNYLC3KR9maCFyVp6UN 36DN3KNf1bJ4cxk3LQ1GEPnDUM7bXkSUPOm+FHEFP/jj4kVxeEBYmc/BRqfQYHHa 5QoH+m0hUZfQIwaEwBxRkd6nXsIa1mKxqx5h8BmjpIoF0Ttdb2wet7Juf5KOKSJ3 W1gBfFXUWFfwtIo6Yij4iquolAg9xyufOcbkQSczsbX8ycnow7fpf9cTqwd8FxlQ k0mRVKNeWtziYWY1or44hUJhSdWZORYEc2aNwC4L/rcB+sPQttl/WerKWdFvMp/a ICpYuUBU05FsW9urfDuU++TYbqdnxlMmCgPbo80eMZfgaSwpsd6M2v7rDJadIqrT Y1MRPd8O+xXe+UPkIJJxYt1QWgm0FzMAf6R67EgVZ1N+BvKO6aEi3RtpTx/FBVlC fDWrX8COZk2Y1RCd20A+nVvfQfGdj8OOBogZhygJ55N22+VRpnH33doFbxseL2fb +psAQmJ2E3j8y8Q3mtLN =mKuU -----END PGP SIGNATURE----- --GBDnBH7+ZvLx8QD4-- From owner-svn-src-head@freebsd.org Fri May 27 20:58:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52E14B4D8B3; Fri, 27 May 2016 20:58:33 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2290A1D0A; Fri, 27 May 2016 20:58:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f43.google.com with SMTP id w184so185186903oiw.2; Fri, 27 May 2016 13:58:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-transfer-encoding; bh=uslhMFR6WLgjwqWj6MlpyxMxmKsUV0YCcGcrcgfpEKU=; b=aP4+KMsXlSdKgREjrfURYPlVNWo67Ot+ndpoYIfkpNt8SN/rW9MdKK06W+9XOetjSl lrge/vap4B2UFkX78WQ0rohD3p+UtP/AppdSyc1a9DnETkQRFIkxpc9zGrZoaFXJCO+J ZrqLjckrzA8aaGS0MeZleEqTXiOKH0XUB2Nmu/rXlZQCAfrOfB9h92otqj6qQFCsAHyz hIC4RE8shehR9FKROYvju5wxzt1AJ6G477B4wtK2t5WHSprMc+Ix4h5OPlI2G2fTuS5E G08SEcMSRydfMBom80oAXGFrZRE4UzyX1Bv8KtPZUyS0tgvYCT3/ldlDPkUe3QyJ9g3F UEPA== X-Gm-Message-State: ALyK8tICDJN9GPWiDBZr3khaYz6n3qru+882Cz18NjiLQyuaJYq43SiYVIrdfMTS6ROeMA== X-Received: by 10.202.82.195 with SMTP id g186mr11437276oib.70.1464382711838; Fri, 27 May 2016 13:58:31 -0700 (PDT) Received: from mail-io0-f177.google.com (mail-io0-f177.google.com. [209.85.223.177]) by smtp.gmail.com with ESMTPSA id m7sm9887842otm.41.2016.05.27.13.58.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 May 2016 13:58:31 -0700 (PDT) Received: by mail-io0-f177.google.com with SMTP id p64so38294724ioi.2; Fri, 27 May 2016 13:58:31 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.107.38.79 with SMTP id m76mr17363949iom.7.1464382711121; Fri, 27 May 2016 13:58:31 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.36.205.70 with HTTP; Fri, 27 May 2016 13:58:31 -0700 (PDT) In-Reply-To: <2F93033E-D202-4A0A-8555-76ED789D4080@gmail.com> References: <201605272012.u4RKCWCI035708@repo.freebsd.org> <2F93033E-D202-4A0A-8555-76ED789D4080@gmail.com> Date: Fri, 27 May 2016 13:58:31 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r300868 - head/tools/tools/ioat From: Conrad Meyer To: "Ngie Cooper (yaneurabeya)" Cc: Garrett Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:58:33 -0000 I don't think such infrastructure is needed for simple test code like this. 128 is more than enough. On Fri, May 27, 2016 at 1:51 PM, Ngie Cooper (yaneurabeya) wrote: > >> On May 27, 2016, at 13:34, Conrad Meyer wrote: >> >> On Fri, May 27, 2016 at 1:12 PM, Garrett Cooper wrote= : >>> Author: ngie >>> Date: Fri May 27 20:12:32 2016 >>> New Revision: 300868 >>> URL: https://svnweb.freebsd.org/changeset/base/300868 >>> >>> Log: >>> Remove note about bogus chain-len maximum >>> >>> There's no current limit on chain-len with Broadwell DE chips; it isn'= t >>> enforced in software, and there doesn't appear to be a hardware limita= tion >>> either on the Intel Xeon D-1527 (Broadwell-DE) chip. >> >> Hi Ngie, >> >> The note isn't bogus, it's just not what you think it is=E2=80=94the lim= it is >> in the ioat_test code, not a limit of the hardware. >> >> Before this commit which documented it (r289733), the limit *was* 4. >> However, in the same commit I bumped the limit up to 128 >> (IOAT_MAX_BUFS / 2). (I suspect I wrote the documentation first, >> before deciding to raise the limit.) >> >> So the current limit is 128, and should be documented. > > Ah=E2=80=A6 that makes sense. Would it be a better idea to make this limi= t into a readonly sysctl in ioat_test(4), along with the other limits? If s= o, I=E2=80=99ll put that out for CR. > Thanks, > -Ngie From owner-svn-src-head@freebsd.org Fri May 27 21:01:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8421EB4DA31; Fri, 27 May 2016 21:01:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 154DF10F7; Fri, 27 May 2016 21:01:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u4RL1mCk096663 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 28 May 2016 00:01:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u4RL1mCk096663 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u4RL1mEI096662; Sat, 28 May 2016 00:01:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 May 2016 00:01:48 +0300 From: Konstantin Belousov To: Ivan Klymenko Cc: Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300865 - in head/sys: sys vm Message-ID: <20160527210148.GR38613@kib.kiev.ua> References: <201605271915.u4RJFkEl013139@repo.freebsd.org> <20160527225103.67ae3547@nonamehost.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160527225103.67ae3547@nonamehost.local> User-Agent: Mutt/1.6.1 (2016-04-27) 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.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 21:01:55 -0000 On Fri, May 27, 2016 at 10:51:03PM +0300, Ivan Klymenko wrote: > On Fri, 27 May 2016 19:15:46 +0000 (UTC) > Alan Cox wrote: > > > Author: alc > > Date: Fri May 27 19:15:45 2016 > > New Revision: 300865 > > URL: https://svnweb.freebsd.org/changeset/base/300865 > > > > Log: > > The flag "vm_pages_needed" has long served two distinct purposes: > > (1) to indicate that threads are waiting for free pages to become > > available and (2) to indicate whether a wakeup call has been sent to > > the page daemon. The trouble is that a single flag cannot really > > serve both purposes, because we have two distinct targets for when to > > wakeup threads waiting for free pages versus when the page daemon has > > completed its work. In particular, the flag will be cleared by > > vm_page_free() before the page daemon has met its target, and this > > can lead to the OOM killer being invoked prematurely. To address this > > problem, a new flag "vm_pageout_wanted" is introduced. > > Discussed with: jeff > > Reviewed by: kib, markj > > Tested by: markj > > Sponsored by: EMC / Isilon Storage Division > > > > Modified: > > head/sys/sys/vmmeter.h > > head/sys/vm/vm_page.c > > head/sys/vm/vm_pageout.c > > head/sys/vm/vm_pageout.h > > > > Modified: head/sys/vm/vm_pageout.h > > ============================================================================== > > --- head/sys/vm/vm_pageout.h Fri May 27 18:52:58 2016 > > (r300864) +++ head/sys/vm/vm_pageout.h Fri May 27 19:15:45 > > 2016 (r300865) @@ -72,9 +72,10 @@ > > */ > > > > extern int vm_page_max_wired; > > -extern int vm_pages_needed; /* should be some "event" > > structure */ extern int vm_pageout_deficit; > > extern int vm_pageout_page_count; > > +extern bool vm_pageout_wanted; > > +extern bool vm_pages_needed; > > > > /* > > * Swap out requests > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > ... > ===> lib/libalias/modules/smedia (obj) > --- cddl/lib__L --- > In file included > from /usr/src/cddl/lib/libzpool/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:143: /media/da0s1/obj/usr/src/tmp/usr/include/vm/vm_pageout.h:77:8: > error: unknown type name 'bool' extern bool vm_pageout_wanted; > ^ > /media/da0s1/obj/usr/src/tmp/usr/include/vm/vm_pageout.h:78:8: error: > unknown type name 'bool' extern bool vm_pages_needed; > ^ > 2 errors generated. > *** [arc.So] Error code 1 Does it compile if you just remove the #include line from arc.c and possibly zfs_vnops.c ? If not, try bracing the line with #ifdef _KERNEL, like this: diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c index c1a254a..74193d1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -140,7 +140,9 @@ #include #include +#ifdef _KERNEL #include +#endif #include #ifdef illumos diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index 6b25d39..c39e6a0 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -75,7 +75,9 @@ #include #include #include +#ifdef _KERNEL #include +#endif /* * Programming rules. From owner-svn-src-head@freebsd.org Fri May 27 21:03:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BC4BB4DA8F; Fri, 27 May 2016 21:03:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x244.google.com (mail-pa0-x244.google.com [IPv6:2607:f8b0:400e:c03::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE3EB12E2; Fri, 27 May 2016 21:03:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x244.google.com with SMTP id fg1so13687716pad.3; Fri, 27 May 2016 14:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=a96Tmgletgbvm1GrOiyKCmXni+SUaoO74GIb8oLbd4I=; b=b9PPc/7tHgQGzm8o/DZBGA1e4UrTtKbFGRvTo6zLRnPxrEGmXh49lVpfRmG0aG/I44 9RVka2Xqpdb4tktWQVVuoOuKddjM6votXeuNZ91WKXfF2TL8dfTziQIiihGQFZ3NXfMD BG3aqLHr32EzldAnp+Fhx6EmMMeYdUCJz39Vlyz7ZIOFNNxpqa5wZNkRRQstR1EQ55FZ eD/fcB1GbqD6RiO5dFMHx3/yxPfoyIZlaBg/7mlfw96J3Ov3gIx5bBUkNl0eb5FtMhQZ NAEVTcgUFQVlack0cC4u0TQV/twO2XPj3bu9vX2IEUTgNiEz5PjGdycL3lFXHOyu2VZ6 VymA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=a96Tmgletgbvm1GrOiyKCmXni+SUaoO74GIb8oLbd4I=; b=hh1P+07x1m9xpurUnEGoKQdhx0ehC92vcOB8AI/Opd69gzNG4wtSaQNj3bK2NRSicF fUaZ271KYrHF9rfTNWK0zaA5cJa9bPcxd17NTxMONYuNdnN+ocb0eBXSyBftayptD/Za LMoj4A3ZSMM5OyvWXcdYsIqbKZO/IlkRzT+nll6bAcFko7x0WP/+xms12l+tpVEFnUaY 02CkP0ElV/kW24OJVweKGw2Dr1RukDtySTk2evJPEhznwFnQcU5r2OB18qbDnUDnqNDE Kf6MMTkHNXiLD9Ak5Ln/zUM2r9NSIT+ZKGusjX7oAmxcRz0U2AOq3nkLkJDyj55T0oAh qeFQ== X-Gm-Message-State: ALyK8tLaN/+NB0KmWTS36c/16hCDq835NWWWCTn2DPxvgCJN66KX2uPNo6K2TFxZnQHttQ== X-Received: by 10.66.171.231 with SMTP id ax7mr25236041pac.104.1464383038469; Fri, 27 May 2016 14:03:58 -0700 (PDT) Received: from pinklady.local (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id m64sm15824152pfc.19.2016.05.27.14.03.57 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 May 2016 14:03:57 -0700 (PDT) Subject: Re: svn commit: r300865 - in head/sys: sys vm Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_C027044C-210E-43F8-95EC-18716830D6E9"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20160527210148.GR38613@kib.kiev.ua> Date: Fri, 27 May 2016 14:03:55 -0700 Cc: Ivan Klymenko , Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <016BEE0D-05B6-4042-8CD4-471D4D1C9162@gmail.com> References: <201605271915.u4RJFkEl013139@repo.freebsd.org> <20160527225103.67ae3547@nonamehost.local> <20160527210148.GR38613@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 21:03:59 -0000 --Apple-Mail=_C027044C-210E-43F8-95EC-18716830D6E9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 27, 2016, at 14:01, Konstantin Belousov = wrote: >=20 > On Fri, May 27, 2016 at 10:51:03PM +0300, Ivan Klymenko wrote: >> On Fri, 27 May 2016 19:15:46 +0000 (UTC) >> Alan Cox wrote: >>=20 >>> Author: alc >>> Date: Fri May 27 19:15:45 2016 >>> New Revision: 300865 >>> URL: https://svnweb.freebsd.org/changeset/base/300865 >>>=20 >>> Log: >>> The flag "vm_pages_needed" has long served two distinct purposes: >>> (1) to indicate that threads are waiting for free pages to become >>> available and (2) to indicate whether a wakeup call has been sent to >>> the page daemon. The trouble is that a single flag cannot really >>> serve both purposes, because we have two distinct targets for when = to >>> wakeup threads waiting for free pages versus when the page daemon = has >>> completed its work. In particular, the flag will be cleared by >>> vm_page_free() before the page daemon has met its target, and this >>> can lead to the OOM killer being invoked prematurely. To address = this >>> problem, a new flag "vm_pageout_wanted" is introduced. >>> Discussed with: jeff >>> Reviewed by: kib, markj >>> Tested by: markj >>> Sponsored by: EMC / Isilon Storage Division >>>=20 >>> Modified: >>> head/sys/sys/vmmeter.h >>> head/sys/vm/vm_page.c >>> head/sys/vm/vm_pageout.c >>> head/sys/vm/vm_pageout.h >>>=20 >>> Modified: head/sys/vm/vm_pageout.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/vm/vm_pageout.h Fri May 27 18:52:58 2016 >>> (r300864) +++ head/sys/vm/vm_pageout.h Fri May 27 19:15:45 >>> 2016 (r300865) @@ -72,9 +72,10 @@ >>> */ >>>=20 >>> extern int vm_page_max_wired; >>> -extern int vm_pages_needed; /* should be some "event" >>> structure */ extern int vm_pageout_deficit; >>> extern int vm_pageout_page_count; >>> +extern bool vm_pageout_wanted; >>> +extern bool vm_pages_needed; >>>=20 >>> /* >>> * Swap out requests >>> _______________________________________________ >>> svn-src-all@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/svn-src-all >>> To unsubscribe, send any mail to = "svn-src-all-unsubscribe@freebsd.org" >>=20 >> ... >> =3D=3D=3D> lib/libalias/modules/smedia (obj) >> --- cddl/lib__L --- >> In file included >> from = /usr/src/cddl/lib/libzpool/../../../sys/cddl/contrib/opensolaris/uts/commo= n/fs/zfs/arc.c:143: = /media/da0s1/obj/usr/src/tmp/usr/include/vm/vm_pageout.h:77:8: >> error: unknown type name 'bool' extern bool vm_pageout_wanted; >> ^ >> /media/da0s1/obj/usr/src/tmp/usr/include/vm/vm_pageout.h:78:8: error: >> unknown type name 'bool' extern bool vm_pages_needed; >> ^ >> 2 errors generated. >> *** [arc.So] Error code 1 >=20 > Does it compile if you just remove the > #include > line from arc.c and possibly zfs_vnops.c ? >=20 > If not, try bracing the line with #ifdef _KERNEL, like this: I added #include to zfs/arc.c in r300870 =E2=80=94 = it was missing from the file. Looking into drm2 and ofed. Thanks! -Ngie --Apple-Mail=_C027044C-210E-43F8-95EC-18716830D6E9 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 iQIcBAEBCgAGBQJXSLY8AAoJEPWDqSZpMIYVLC4P/2BJ9KFF+KHth97N1B3vX0Xg npqG2XTWAHvruQuvafuI/o5uo70i1p9ztV+gmN69JfMOwjraMdCWhQqGsGIiUdmG CHtxOKnsLWjDvw23y7wQU7nVBXAou3fcg1nmpaZ30bjXlZyoi7/6/LfPWGST2/VY pSxmpNSvOJaDnvDGjyHPUKTYqqHNruKQV5cjhytUqn/JWrAlwJ9KmZmj7blBE2aM /TTH/lAtHkTP6rnTVjAGS36DOoZ1eg/wanLuR6PnLggBYoThOvhxpGZ+aIGlJLzX zsSKK2FQRRFIwmR8LEiC7Z7tFgx6wAoZXMrePAeuuczH/vgmMjq1i3yYHFAbur1Z rCw8oKpS1YepBNjqK+bvD/ZiroSq4t6SQK3x2MS4dz0RzaMTYnGUS3h8uZk0Vk7I WqAX+A156uuB7ZGJyPtco5xFuYxIQZX70NPVzP9IduY169t4jyQjLRYcw7gf16V5 aRWH9MB5jF+zCB4dsyyuXYsNNKUreSWTZyX3DrDYmfN4WSrGUObibMcC9kxbuy0b MZ+8QvM6TnPhwBabCUhS5+Du18Q8C2VkEF5CWKYz4ERWrTsfqTrPEAPbvWkVhrd5 FKELfFuGaJoK6P+ug4q6tyTtNFnFAi3cX6GxBXsfy0BuekFYkmg3f3b1MvHzaFli Eb9kcpf6jMGW8x/6Uzi8 =15f2 -----END PGP SIGNATURE----- --Apple-Mail=_C027044C-210E-43F8-95EC-18716830D6E9-- From owner-svn-src-head@freebsd.org Fri May 27 21:10:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF833B4DB6E; Fri, 27 May 2016 21:10:09 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD1221724; Fri, 27 May 2016 21:10:09 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.15.0.59/8.15.0.59) with SMTP id u4RL4bL3021941; Fri, 27 May 2016 16:10:06 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp1.rice.edu with ESMTP id 236txx0478-1; Fri, 27 May 2016 16:10:06 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 1ACB04013D; Fri, 27 May 2016 16:10:06 -0500 (CDT) Subject: Re: svn commit: r300865 - in head/sys: sys vm To: Konstantin Belousov , Ivan Klymenko References: <201605271915.u4RJFkEl013139@repo.freebsd.org> <20160527225103.67ae3547@nonamehost.local> <20160527210148.GR38613@kib.kiev.ua> Cc: Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Alan Cox Message-ID: <333b4ffe-cfc5-a67a-051d-9fb98f3418e7@rice.edu> Date: Fri, 27 May 2016 16:10:05 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160527210148.GR38613@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=40 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1605270240 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 21:10:10 -0000 On 05/27/2016 16:01, Konstantin Belousov wrote: > On Fri, May 27, 2016 at 10:51:03PM +0300, Ivan Klymenko wrote: >> On Fri, 27 May 2016 19:15:46 +0000 (UTC) >> Alan Cox wrote: >> >>> Author: alc >>> Date: Fri May 27 19:15:45 2016 >>> New Revision: 300865 >>> URL: https://svnweb.freebsd.org/changeset/base/300865 >>> >>> Log: >>> The flag "vm_pages_needed" has long served two distinct purposes: >>> (1) to indicate that threads are waiting for free pages to become >>> available and (2) to indicate whether a wakeup call has been sent to >>> the page daemon. The trouble is that a single flag cannot really >>> serve both purposes, because we have two distinct targets for when to= >>> wakeup threads waiting for free pages versus when the page daemon has= >>> completed its work. In particular, the flag will be cleared by >>> vm_page_free() before the page daemon has met its target, and this >>> can lead to the OOM killer being invoked prematurely. To address this= >>> problem, a new flag "vm_pageout_wanted" is introduced.=20 >>> Discussed with: jeff >>> Reviewed by: kib, markj >>> Tested by: markj >>> Sponsored by: EMC / Isilon Storage Division >>> >>> Modified: >>> head/sys/sys/vmmeter.h >>> head/sys/vm/vm_page.c >>> head/sys/vm/vm_pageout.c >>> head/sys/vm/vm_pageout.h >>> >>> Modified: head/sys/vm/vm_pageout.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/vm/vm_pageout.h Fri May 27 18:52:58 2016 >>> (r300864) +++ head/sys/vm/vm_pageout.h Fri May 27 19:15:45 >>> 2016 (r300865) @@ -72,9 +72,10 @@ >>> */ >>> =20 >>> extern int vm_page_max_wired; >>> -extern int vm_pages_needed; /* should be some "event" >>> structure */ extern int vm_pageout_deficit; >>> extern int vm_pageout_page_count; >>> +extern bool vm_pageout_wanted; >>> +extern bool vm_pages_needed; >>> =20 >>> /* >>> * Swap out requests >>> _______________________________________________ >>> svn-src-all@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/svn-src-all >>> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org= " >> ... >> =3D=3D=3D> lib/libalias/modules/smedia (obj) >> --- cddl/lib__L --- >> In file included >> from /usr/src/cddl/lib/libzpool/../../../sys/cddl/contrib/opensolaris/= uts/common/fs/zfs/arc.c:143: /media/da0s1/obj/usr/src/tmp/usr/include/vm/= vm_pageout.h:77:8: >> error: unknown type name 'bool' extern bool vm_pageout_wanted; >> ^ >> /media/da0s1/obj/usr/src/tmp/usr/include/vm/vm_pageout.h:78:8: error: >> unknown type name 'bool' extern bool vm_pages_needed; >> ^ >> 2 errors generated. >> *** [arc.So] Error code 1 > Does it compile if you just remove the > #include > line from arc.c and possibly zfs_vnops.c ? arc.c doesn't appear to use anything defined by vm_pageout.h. What I'm more surprised by is that "bool" is defined when compiling the kernel module but not when compiling the user-space library.=20 > If not, try bracing the line with #ifdef _KERNEL, like this: > > diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys= /cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > index c1a254a..74193d1 100644 > --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > @@ -140,7 +140,9 @@ > #include > #include > =20 > +#ifdef _KERNEL > #include > +#endif > #include > =20 > #ifdef illumos > diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c= b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > index 6b25d39..c39e6a0 100644 > --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > @@ -75,7 +75,9 @@ > #include > #include > #include > +#ifdef _KERNEL > #include > +#endif > =20 > /* > * Programming rules. > From owner-svn-src-head@freebsd.org Fri May 27 21:12:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B752B4DC86; Fri, 27 May 2016 21:12:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 136C31B04; Fri, 27 May 2016 21:12:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RLCP4F058045; Fri, 27 May 2016 21:12:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RLCPQ8058044; Fri, 27 May 2016 21:12:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605272112.u4RLCPQ8058044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 27 May 2016 21:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300874 - head/tools/tools/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 21:12:26 -0000 Author: ngie Date: Fri May 27 21:12:25 2016 New Revision: 300874 URL: https://svnweb.freebsd.org/changeset/base/300874 Log: Update usage(..) - Document missing options - Sync options with ioatcontrol(8). - Make it clear that the first 2 parameters are always required. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/tools/ioat/ioatcontrol.c Modified: head/tools/tools/ioat/ioatcontrol.c ============================================================================== --- head/tools/tools/ioat/ioatcontrol.c Fri May 27 20:45:32 2016 (r300873) +++ head/tools/tools/ioat/ioatcontrol.c Fri May 27 21:12:25 2016 (r300874) @@ -49,14 +49,19 @@ static void usage(void) { - printf("Usage: %s [-E|-f|-m] OPTIONS [ " + printf("Usage: %s [-c period] [-EfmVz] channel-number num-txns [ " "[ [duration]]]\n", getprogname()); - printf(" %s -r [-v] OPTIONS []\n\n", + printf(" %s -r [-c period] [-vVwz] channel-number address []\n\n", getprogname()); - printf(" OPTIONS:\n"); - printf(" -c - Enable interrupt coalescing (us)\n"); - printf(" -V - Enable verification\n"); - printf(" -z - Zero device stats before test\n"); + printf(" -c period - Enable interrupt coalescing (us) (default: 0)\n"); + printf(" -E - Test non-contiguous 8k copy.\n"); + printf(" -f - Test block fill (default: DMA copy).\n"); + printf(" -m - Test memcpy instead of DMA.\n"); + printf(" -r - Issue DMA to or from a specific address.\n"); + printf(" -V - Enable verification\n"); + printf(" -v -
is a kernel virtual address\n"); + printf(" -w - Write to the specified address\n"); + printf(" -z - Zero device stats before test\n"); exit(EX_USAGE); } From owner-svn-src-head@freebsd.org Fri May 27 21:21:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6F43B4C07F; Fri, 27 May 2016 21:21:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x242.google.com (mail-pa0-x242.google.com [IPv6:2607:f8b0:400e:c03::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A382B1FB0; Fri, 27 May 2016 21:21:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x242.google.com with SMTP id gp3so6971625pac.2; Fri, 27 May 2016 14:21:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=1/dX7Qq6smp8LWlXPUPYyStSAXbMnG7xp12eXBJD8Ak=; b=jutiEGamwynnKcxJTQzs7rYFyr3Zx9KZntr2OW8mxL3+X1hFpV1LCNbY9VPFGZQpzO jPc0SAcNiEbHKDl57Z8laZmluTw8T+Nnjk2UcqXaUloHXra4LMQoxinZti0lQxpjR7SP 2dnUrLEt0OS8Tcu9gdnZS1xab8i98tEVtPSxg58TzldGkAEg8gJVrbLCLuBIOGz+X3v0 2a/Q1W0CS4exxuJLOlS9VxRXarwaZ7RHtDBRl3kM4cTRJX9KhDXn8GF2OQv2Oiysw9Jl QjaFvL5zMa7+XKUqEixx7SGe760zEtU0DP0LrpSaqFvtAOz4PVAtCj2kpw6OtkyMo6Cl pNfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=1/dX7Qq6smp8LWlXPUPYyStSAXbMnG7xp12eXBJD8Ak=; b=ihBPlS3gFoumoujiw3NYgn6kuVgcaBhvs47GOf++0nwUEKiRmC/bGYWSj83O2f7rjU wybp8GXlGbr0U8egbGBaxvReXHx0Elnus2VuUGbuCobruSS5ygvjNnvG8IuX9rFAiW9h T+ZrxD7gOXN5aGWscn8PqvK/qX6uf/Xb2Psr6B9itVA7tsL5kTbSW4xLWIm5z8UPfE2R /7mdVB+ZkJj7VtskAyow5VpN3s4ssrYwzimCJy/D4uVZ+S2Mb6wZvaA/bfEEwMHvVOiC F35RENrnoNeVvd1V5Ib7u2J5Ow/7EF+2ExMfw7WE8vhv1yA+jJ5EGQnBUcJ6830vzRn3 Jm/A== X-Gm-Message-State: ALyK8tKXmubF8fdCsuwI80ynNddxrD3dKDwtmnmZP9e7Zxeb5d/WdIW1+BrdVWa9GqYJvQ== X-Received: by 10.66.150.232 with SMTP id ul8mr25167185pab.85.1464384103241; Fri, 27 May 2016 14:21:43 -0700 (PDT) Received: from pinklady.local (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id w125sm15845690pfb.53.2016.05.27.14.21.42 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 May 2016 14:21:42 -0700 (PDT) Subject: Re: svn commit: r300865 - in head/sys: sys vm Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_C562183A-A796-44D5-B1DF-4BB4903668BA"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <016BEE0D-05B6-4042-8CD4-471D4D1C9162@gmail.com> Date: Fri, 27 May 2016 14:21:40 -0700 Cc: Ivan Klymenko , Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <3018B8E4-5E33-49EF-8154-D7D5ECEE8403@gmail.com> References: <201605271915.u4RJFkEl013139@repo.freebsd.org> <20160527225103.67ae3547@nonamehost.local> <20160527210148.GR38613@kib.kiev.ua> <016BEE0D-05B6-4042-8CD4-471D4D1C9162@gmail.com> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 21:21:43 -0000 --Apple-Mail=_C562183A-A796-44D5-B1DF-4BB4903668BA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 27, 2016, at 14:03, Ngie Cooper (yaneurabeya) = wrote: >=20 >>=20 >> On May 27, 2016, at 14:01, Konstantin Belousov = wrote: >>=20 >> On Fri, May 27, 2016 at 10:51:03PM +0300, Ivan Klymenko wrote: >>> On Fri, 27 May 2016 19:15:46 +0000 (UTC) >>> Alan Cox wrote: >>>=20 >>>> Author: alc >>>> Date: Fri May 27 19:15:45 2016 >>>> New Revision: 300865 >>>> URL: https://svnweb.freebsd.org/changeset/base/300865 >>>>=20 >>>> Log: >>>> The flag "vm_pages_needed" has long served two distinct purposes: >>>> (1) to indicate that threads are waiting for free pages to become >>>> available and (2) to indicate whether a wakeup call has been sent = to >>>> the page daemon. The trouble is that a single flag cannot really >>>> serve both purposes, because we have two distinct targets for when = to >>>> wakeup threads waiting for free pages versus when the page daemon = has >>>> completed its work. In particular, the flag will be cleared by >>>> vm_page_free() before the page daemon has met its target, and this >>>> can lead to the OOM killer being invoked prematurely. To address = this >>>> problem, a new flag "vm_pageout_wanted" is introduced. >>>> Discussed with: jeff >>>> Reviewed by: kib, markj >>>> Tested by: markj >>>> Sponsored by: EMC / Isilon Storage Division >>>>=20 >>>> Modified: >>>> head/sys/sys/vmmeter.h >>>> head/sys/vm/vm_page.c >>>> head/sys/vm/vm_pageout.c >>>> head/sys/vm/vm_pageout.h >>>>=20 >>>> Modified: head/sys/vm/vm_pageout.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/vm/vm_pageout.h Fri May 27 18:52:58 2016 >>>> (r300864) +++ head/sys/vm/vm_pageout.h Fri May 27 19:15:45 >>>> 2016 (r300865) @@ -72,9 +72,10 @@ >>>> */ >>>>=20 >>>> extern int vm_page_max_wired; >>>> -extern int vm_pages_needed; /* should be some "event" >>>> structure */ extern int vm_pageout_deficit; >>>> extern int vm_pageout_page_count; >>>> +extern bool vm_pageout_wanted; >>>> +extern bool vm_pages_needed; >>>>=20 >>>> /* >>>> * Swap out requests >>>> _______________________________________________ >>>> svn-src-all@freebsd.org mailing list >>>> https://lists.freebsd.org/mailman/listinfo/svn-src-all >>>> To unsubscribe, send any mail to = "svn-src-all-unsubscribe@freebsd.org" >>>=20 >>> ... >>> =3D=3D=3D> lib/libalias/modules/smedia (obj) >>> --- cddl/lib__L --- >>> In file included >>> from = /usr/src/cddl/lib/libzpool/../../../sys/cddl/contrib/opensolaris/uts/commo= n/fs/zfs/arc.c:143: = /media/da0s1/obj/usr/src/tmp/usr/include/vm/vm_pageout.h:77:8: >>> error: unknown type name 'bool' extern bool vm_pageout_wanted; >>> ^ >>> /media/da0s1/obj/usr/src/tmp/usr/include/vm/vm_pageout.h:78:8: = error: >>> unknown type name 'bool' extern bool vm_pages_needed; >>> ^ >>> 2 errors generated. >>> *** [arc.So] Error code 1 >>=20 >> Does it compile if you just remove the >> #include >> line from arc.c and possibly zfs_vnops.c ? >>=20 >> If not, try bracing the line with #ifdef _KERNEL, like this: >=20 > I added #include to zfs/arc.c in r300870 =E2=80=94 = it was missing from the file. Looking into drm2 and fed. Oy. Bad test before I did the fix. The issue was libzpool -_- (just saw = alc=E2=80=99s comment)=E2=80=A6 I=E2=80=99ll fix my commit.. --Apple-Mail=_C562183A-A796-44D5-B1DF-4BB4903668BA 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 iQIcBAEBCgAGBQJXSLplAAoJEPWDqSZpMIYVVJkQAJODVaCh7Xygrmlw9SoG7Pr4 KNCxGdCkaHSJc6xbW1oERJpaWvvQkAdp3S6odCG04TQrAk3hLntIRsOnRqoJBlDs zCao0FyQi0BmlQyF81KVefEYg0Es2K04fok8ja3tbn7RmjvcLLfVyd795AZ1H+Ly Aw8/QnrHLB8bAhQuAKiwva0xzpC5dI5FXXNhNNn4iDvrQ8++rXwg4pq8+4cpPwJn IVL/dH2Dyhw6OJVyvVLX2pB/ZAsiq6NabnVAO9vlrjL4IiUerhPREdjl8mBb6z0N rHG7/bueJGQjUXILFBOluJCslC7OvmJqnwK+7zl9vqF9V/n78BTYt6gCckJvRKqy HoFbCNhUBqAixscW3m7QfwDRnycLo0xkZOM2Yq2jEyfkxeSnre45/R0KWjaqAHPh NegwyIrWdg9TCJfZ7S6ICLPRcCtLof9etf4t+hD204Q5Y8yFwUGiSHUIDYFinaOQ RdT8ncY4y4a5hiwAGSIrg1RqINptq6dYhrqtUbbBtk/BnC2+q5oyh9LpZuoMh4/A 5pIwAqS0cYCuvQqVmeTQpfgeDXMX0NyhzMibSucG4Wgea4zcCFhaOJx29btxxpf7 ZuiJugDmh9mSGo10S5KDxd+HLSeulNYpn+AcpvJ7r47I80I5NW9S52JM5xfu5nku 0ShFMVnEbT+8IF3H2qSO =UciR -----END PGP SIGNATURE----- --Apple-Mail=_C562183A-A796-44D5-B1DF-4BB4903668BA-- From owner-svn-src-head@freebsd.org Fri May 27 21:22:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D822AB4C221; Fri, 27 May 2016 21:22:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22d.google.com (mail-pf0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5A0D12D1; Fri, 27 May 2016 21:22:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id g64so45338949pfb.2; Fri, 27 May 2016 14:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=o8sKW4SIePVadMe5gezWhzSkVzf+5Dn8Z8Hf7kNx0yM=; b=j2tRk3e0MvYToZbcEP1kILLRBStlqU/DLp8Qk+916jOQlHhITSKptE/pO7qDG27IYB KnxbOpWKDwU8hwQNKpjLZNTFSDfYl5IBylmILvZlf6ROzUpk0gvotcfrh3vfXONA2xtZ q/ybIqMG5xBU8B82nyeD53rls7R6MESPAu4WcFjzmcEyLrL5aZB1WwehJ+2G7l1Y8+Jz 02FpD5e4Iy2I/0hBd4QR6lkuhtBmSceo/iAGBWBFzU0ee9GrIyDTlCnqqoUiApXPAqXY FXnY32KMJIjP2e/bfzIwIK2T4IZICnmfaJ4HGamyfSYaQjPBsTldEdN1raKwLCkhchBv sqGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=o8sKW4SIePVadMe5gezWhzSkVzf+5Dn8Z8Hf7kNx0yM=; b=R5Uk+XwtIgGi+g6RCDgiRPBEYq8bpXe05d7LPj3ISEDpB/ZRqHikA6Ff2chgL3BHPb Ii2zh3yufcq3JVI7BBPvQdmbHPT6LxB5J1kUZRuis2/nQTb29ZNCWHhJdTCSUZhlq9NC 4uvaowBaMux6ZOO6Q15AksIVsLIIt/1DIvP46l3dird3iIeW8GVkvTHvRC8z/vCdpNF/ KeNoeWBCCYzulZjxMo4AjXYaW3ARN1ae/wJgct3wOXW0P0dpdwCUiT3lkcoIykXd/qbv 6tCH7X7yWNhOUusxe6xHc/e1KN3HB3egYLDoar5ZZoT2OlolJicJTm79y7fsgbfKrJqT FZYQ== X-Gm-Message-State: ALyK8tICZosLfj0LD/kh9p86CoZwWmnlgLUpTJx/+A7N5UIIsTuhM6kIQ4YaKj+Q20aIsw== X-Received: by 10.98.12.143 with SMTP id 15mr25734749pfm.12.1464384156969; Fri, 27 May 2016 14:22:36 -0700 (PDT) Received: from pinklady.local (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id w125sm15845690pfb.53.2016.05.27.14.22.36 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 May 2016 14:22:36 -0700 (PDT) Subject: Re: svn commit: r300865 - in head/sys: sys vm Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_066C2BD4-848F-4B10-9A68-320002825083"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <3018B8E4-5E33-49EF-8154-D7D5ECEE8403@gmail.com> Date: Fri, 27 May 2016 14:22:35 -0700 Cc: Ivan Klymenko , Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <5CAD8DF0-0D56-4EBD-AB93-645B21E3792D@gmail.com> References: <201605271915.u4RJFkEl013139@repo.freebsd.org> <20160527225103.67ae3547@nonamehost.local> <20160527210148.GR38613@kib.kiev.ua> <016BEE0D-05B6-4042-8CD4-471D4D1C9162@gmail.com> <3018B8E4-5E33-49EF-8154-D7D5ECEE8403@gmail.com> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 21:22:37 -0000 --Apple-Mail=_066C2BD4-848F-4B10-9A68-320002825083 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 27, 2016, at 14:21, Ngie Cooper (yaneurabeya) = wrote: >>=20 >> I added #include to zfs/arc.c in r300870 =E2=80=94 = it was missing from the file. Looking into drm2 and fed. >=20 > Oy. Bad test before I did the fix. The issue was libzpool -_- (just = saw alc=E2=80=99s comment)=E2=80=A6 I=E2=80=99ll fix my commit.. Actually, I=E2=80=99ll just revert my commit and report back about = whether or not your patch worked kib. --Apple-Mail=_066C2BD4-848F-4B10-9A68-320002825083 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 iQIcBAEBCgAGBQJXSLqbAAoJEPWDqSZpMIYVvwUP/1dHMd8OXPtD/BGrHTdCPYdO 9lowxa+ZlK51AcnuJ/nWcmBXC3TVRmlkX9hToSskG6QqkMEkZ/K6MdErcmhvnIbG WUm9Pe3cn95ID03SZfXrb1gJMA7ARPvjQAmVXSrZ6xSJDsNy1SDsPS8JCihjYV4m A+e+oDm/G3BUGRyWHA86i/2xWcv5FvIJrMhqg93NlEGmwvHaiJalNBk9iiWpPHSu MHzg7t3mTSySvPeBSJmJBljWNUokLE7RXf5SKDhmsuRofPCYUyEwBKaMOjETAKxT kVg/q0G2NVjBnNTzky6hlq3zRx5jeEYf1Efy2kf4wFRptXawIYxu9kf0jGFk6P1h ouhGpLch06ZAUcgH03lfmyI4nr0XQiE8EbPQIClYiP2wLEEGgQ9pJoLmQ5RXERU1 4FT3sGp1DiX4oagd2Z352f2Z0Zl5eLowjvQrBrlbd2IOAQGMlL0zquebziizS7+7 fyJH3oBdmEI7oygIWOlqKM861161EN9F1M92/EhFRwJX5tSLVdUUPmZOtX2BFoZD 0dcAycbR7RDVzTnt73V5wzdjV/9oFq99ps2/Te/+mjtmVsbrMwXoknRPf6vAaGYU kFEE9/NUZG4ko+1KBikRqm9cief5YWpBJNcTk+0ztScwN/uplf3OZsGZPgZTQLx5 aE5KsHmyv/DzhywrwdQq =t6KF -----END PGP SIGNATURE----- --Apple-Mail=_066C2BD4-848F-4B10-9A68-320002825083-- From owner-svn-src-head@freebsd.org Fri May 27 21:26:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC492B4C2B0; Fri, 27 May 2016 21:26:27 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0A9514FF; Fri, 27 May 2016 21:26:27 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RLQQEI061785; Fri, 27 May 2016 21:26:26 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RLQQTu061783; Fri, 27 May 2016 21:26:26 GMT (envelope-from np@FreeBSD.org) Message-Id: <201605272126.u4RLQQTu061783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 27 May 2016 21:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300875 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 21:26:27 -0000 Author: np Date: Fri May 27 21:26:26 2016 New Revision: 300875 URL: https://svnweb.freebsd.org/changeset/base/300875 Log: iw_cxgbe: Use vmem(9) to manage PBL and RQT allocations. Submitted by: Krishnamraju Eraparaju at Chelsio Reviewed by: Steve Wise Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h head/sys/dev/cxgbe/iw_cxgbe/resource.c Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri May 27 21:12:25 2016 (r300874) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri May 27 21:26:26 2016 (r300875) @@ -45,6 +45,7 @@ #include #include #include +#include #include @@ -144,8 +145,8 @@ struct c4iw_rdev { unsigned long cqshift; u32 cqmask; struct c4iw_dev_ucontext uctx; - struct gen_pool *pbl_pool; - struct gen_pool *rqt_pool; + vmem_t *rqt_arena; + vmem_t *pbl_arena; u32 flags; struct c4iw_stats stats; }; @@ -929,75 +930,6 @@ extern struct cxgb4_client t4c_client; extern c4iw_handler_func c4iw_handlers[NUM_CPL_CMDS]; extern int c4iw_max_read_depth; -#include -struct gen_pool { - blist_t gen_list; - daddr_t gen_base; - int gen_chunk_shift; - struct mutex gen_lock; -}; - -static __inline struct gen_pool * -gen_pool_create(daddr_t base, u_int chunk_shift, u_int len) -{ - struct gen_pool *gp; - - gp = malloc(sizeof(struct gen_pool), M_DEVBUF, M_NOWAIT); - if (gp == NULL) - return (NULL); - - memset(gp, 0, sizeof(struct gen_pool)); - gp->gen_list = blist_create(len >> chunk_shift, M_NOWAIT); - if (gp->gen_list == NULL) { - free(gp, M_DEVBUF); - return (NULL); - } - blist_free(gp->gen_list, 0, len >> chunk_shift); - gp->gen_base = base; - gp->gen_chunk_shift = chunk_shift; - //mutex_init(&gp->gen_lock, "genpool", NULL, MTX_DUPOK|MTX_DEF); - mutex_init(&gp->gen_lock); - - return (gp); -} - -static __inline unsigned long -gen_pool_alloc(struct gen_pool *gp, int size) -{ - int chunks; - daddr_t blkno; - - chunks = (size + (1<gen_chunk_shift) - 1) >> gp->gen_chunk_shift; - mutex_lock(&gp->gen_lock); - blkno = blist_alloc(gp->gen_list, chunks); - mutex_unlock(&gp->gen_lock); - - if (blkno == SWAPBLK_NONE) - return (0); - - return (gp->gen_base + ((1 << gp->gen_chunk_shift) * blkno)); -} - -static __inline void -gen_pool_free(struct gen_pool *gp, daddr_t address, int size) -{ - int chunks; - daddr_t blkno; - - chunks = (size + (1<gen_chunk_shift) - 1) >> gp->gen_chunk_shift; - blkno = (address - gp->gen_base) / (1 << gp->gen_chunk_shift); - mutex_lock(&gp->gen_lock); - blist_free(gp->gen_list, blkno, chunks); - mutex_unlock(&gp->gen_lock); -} - -static __inline void -gen_pool_destroy(struct gen_pool *gp) -{ - blist_destroy(gp->gen_list); - free(gp, M_DEVBUF); -} - #if defined(__i386__) || defined(__amd64__) #define L1_CACHE_BYTES 128 #else Modified: head/sys/dev/cxgbe/iw_cxgbe/resource.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/resource.c Fri May 27 21:12:25 2016 (r300874) +++ head/sys/dev/cxgbe/iw_cxgbe/resource.c Fri May 27 21:26:26 2016 (r300875) @@ -248,13 +248,17 @@ void c4iw_destroy_resource(struct c4iw_r c4iw_id_table_free(&rscp->pdid_table); } -/* PBL Memory Manager. Uses Linux generic allocator. */ +/* PBL Memory Manager. */ -#define MIN_PBL_SHIFT 8 /* 256B == min PBL size (32 entries) */ +#define MIN_PBL_SHIFT 5 /* 32B == min PBL size (4 entries) */ u32 c4iw_pblpool_alloc(struct c4iw_rdev *rdev, int size) { - unsigned long addr = gen_pool_alloc(rdev->pbl_pool, size); + unsigned long addr; + + vmem_xalloc(rdev->pbl_arena, roundup(size, (1 << MIN_PBL_SHIFT)), + 4, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX, + M_FIRSTFIT|M_NOWAIT, &addr); CTR3(KTR_IW_CXGBE, "%s addr 0x%x size %d", __func__, (u32)addr, size); mutex_lock(&rdev->stats.lock); if (addr) { @@ -273,15 +277,16 @@ void c4iw_pblpool_free(struct c4iw_rdev mutex_lock(&rdev->stats.lock); rdev->stats.pbl.cur -= roundup(size, 1 << MIN_PBL_SHIFT); mutex_unlock(&rdev->stats.lock); - gen_pool_free(rdev->pbl_pool, (unsigned long)addr, size); + vmem_xfree(rdev->pbl_arena, addr, roundup(size,(1 << MIN_PBL_SHIFT))); } int c4iw_pblpool_create(struct c4iw_rdev *rdev) { - rdev->pbl_pool = gen_pool_create(rdev->adap->vres.pbl.start, - MIN_PBL_SHIFT, - rdev->adap->vres.pbl.size); - if (!rdev->pbl_pool) + rdev->pbl_arena = vmem_create("PBL_MEM_POOL", + rdev->adap->vres.pbl.start, + rdev->adap->vres.pbl.size, + 1, 0, M_FIRSTFIT| M_NOWAIT); + if (!rdev->pbl_arena) return -ENOMEM; return 0; @@ -289,16 +294,21 @@ int c4iw_pblpool_create(struct c4iw_rdev void c4iw_pblpool_destroy(struct c4iw_rdev *rdev) { - gen_pool_destroy(rdev->pbl_pool); + vmem_destroy(rdev->pbl_arena); } -/* RQT Memory Manager. Uses Linux generic allocator. */ +/* RQT Memory Manager. */ #define MIN_RQT_SHIFT 10 /* 1KB == min RQT size (16 entries) */ u32 c4iw_rqtpool_alloc(struct c4iw_rdev *rdev, int size) { - unsigned long addr = gen_pool_alloc(rdev->rqt_pool, size << 6); + unsigned long addr; + + vmem_xalloc(rdev->rqt_arena, + roundup((size << 6),(1 << MIN_RQT_SHIFT)), + 4, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX, + M_FIRSTFIT|M_NOWAIT, &addr); CTR3(KTR_IW_CXGBE, "%s addr 0x%x size %d", __func__, (u32)addr, size << 6); if (!addr) @@ -321,15 +331,17 @@ void c4iw_rqtpool_free(struct c4iw_rdev mutex_lock(&rdev->stats.lock); rdev->stats.rqt.cur -= roundup(size << 6, 1 << MIN_RQT_SHIFT); mutex_unlock(&rdev->stats.lock); - gen_pool_free(rdev->rqt_pool, (unsigned long)addr, size << 6); + vmem_xfree(rdev->rqt_arena, addr, + roundup((size << 6),(1 << MIN_RQT_SHIFT))); } int c4iw_rqtpool_create(struct c4iw_rdev *rdev) { - rdev->rqt_pool = gen_pool_create(rdev->adap->vres.rq.start, - MIN_RQT_SHIFT, - rdev->adap->vres.rq.size); - if (!rdev->rqt_pool) + rdev->rqt_arena = vmem_create("RQT_MEM_POOL", + rdev->adap->vres.rq.start, + rdev->adap->vres.rq.size, + 1, 0, M_FIRSTFIT| M_NOWAIT); + if (!rdev->rqt_arena) return -ENOMEM; return 0; @@ -337,6 +349,6 @@ int c4iw_rqtpool_create(struct c4iw_rdev void c4iw_rqtpool_destroy(struct c4iw_rdev *rdev) { - gen_pool_destroy(rdev->rqt_pool); + vmem_destroy(rdev->rqt_arena); } #endif From owner-svn-src-head@freebsd.org Fri May 27 21:26:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74796B4C30F; Fri, 27 May 2016 21:26:49 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 320631774; Fri, 27 May 2016 21:26:48 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.15.0.59/8.15.0.59) with SMTP id u4RLNe7g005903; Fri, 27 May 2016 16:26:46 -0500 Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by pp1.rice.edu with ESMTP id 236txx04ds-1; Fri, 27 May 2016 16:26:46 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id ED96B4C01A1; Fri, 27 May 2016 16:26:45 -0500 (CDT) Subject: Re: svn commit: r300865 - in head/sys: sys vm To: "Ngie Cooper (yaneurabeya)" , Konstantin Belousov References: <201605271915.u4RJFkEl013139@repo.freebsd.org> <20160527225103.67ae3547@nonamehost.local> <20160527210148.GR38613@kib.kiev.ua> <016BEE0D-05B6-4042-8CD4-471D4D1C9162@gmail.com> <3018B8E4-5E33-49EF-8154-D7D5ECEE8403@gmail.com> <5CAD8DF0-0D56-4EBD-AB93-645B21E3792D@gmail.com> Cc: Ivan Klymenko , Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Alan Cox Message-ID: <4318dffc-fef5-2128-74c2-0e97767b36c8@rice.edu> Date: Fri, 27 May 2016 16:26:45 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <5CAD8DF0-0D56-4EBD-AB93-645B21E3792D@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1605270242 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 21:26:49 -0000 On 05/27/2016 16:22, Ngie Cooper (yaneurabeya) wrote: >> On May 27, 2016, at 14:21, Ngie Cooper (yaneurabeya) wrote: >>> I added #include to zfs/arc.c in r300870 — it was missing from the file. Looking into drm2 and fed. >> Oy. Bad test before I did the fix. The issue was libzpool -_- (just saw alc’s comment)… I’ll fix my commit.. > Actually, I’ll just revert my commit and report back about whether or not your patch worked kib. Revert and remove the vm_pageout.h #include from arc.c. From owner-svn-src-head@freebsd.org Fri May 27 21:27:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7494CB4C379; Fri, 27 May 2016 21:27:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4042F1936; Fri, 27 May 2016 21:27:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x236.google.com with SMTP id f8so79390052ioe.3; Fri, 27 May 2016 14:27:07 -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; bh=xpfHJTBL1qDI/SQ4Ho8TL3Wfn1zRTw4M4vPSlHhxGjo=; b=fEZdJsiMnmdVECFI92Y9JtLpvecUO912/7QKfggNIqW7/WZLnHirAz/QmHMmHKoUyB IrIjPZh1eyI+vBsPcPOBo/9NqXFVRpizoDutXnEPu2AIcs4R2g1I+gX6GBND8eHV0kFi t8cijWAV1aLu/E0ecWOlW7MFIPXLFuSvwkN0EKoqsJerjSFKX/dL+4ELDT8OBFVim07y uOwa87RskVH6IJdLqeHFmdWVLLUxwPdVY9CR0njFkpnD06zZJd9g96Tvau5spqTB3BYS qlTNJ63Z9UdYBICYOZOVrNsqkeu9rN7VOZWCyp6O7rrBDpyTFA5w2VWxPfsM4Jgg/FjI 6+LQ== 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; bh=xpfHJTBL1qDI/SQ4Ho8TL3Wfn1zRTw4M4vPSlHhxGjo=; b=a001db4PnQGBCUTcxtBjrWZohdJCejeVPWjtCInnErCSxqab/KLQZjo0dHVF5ivZKv FRfWqW/YHEu1J4qH8hoJ4Y3+ex5lfnoYrMVA5zGx/eO3HlJnc4Y6pIf0BPDhiJMPHS8r Ogam2VaxrPk+BXzFubDU+1tisl8gk452v4FsRyhEjK1NCeNwDq9jsWtc5jwL1GvyPzax lY86PMFlgFZTK4RFzeNHacm/YU27NylbHH0oADS+Lskouo3QBlQxNbyTsHeRSAQ/5gVY 9SD7aChJmUJOssMzkdiX1sjbMoUXYOuG/6zkbuYDti59yoRMcjJLG8pPwzEiGaVUmjMA 4LbA== X-Gm-Message-State: ALyK8tL96h1U9wOCvu+hRwEGKEkYRpG/2MkOcq3LrNDy+bSxeyIzJZxYa6wE1RdlQ6XlM9Xbd5SiypogmjTGmA== MIME-Version: 1.0 X-Received: by 10.107.144.67 with SMTP id s64mr12175070iod.165.1464384426669; Fri, 27 May 2016 14:27:06 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Fri, 27 May 2016 14:27:06 -0700 (PDT) In-Reply-To: <201605271651.u4RGp3Yw016125@gw.catspoiler.org> References: <201605271651.u4RGp3Yw016125@gw.catspoiler.org> Date: Fri, 27 May 2016 14:27:06 -0700 Message-ID: Subject: Re: svn commit: r300779 - in head: sbin/ipfw sys/modules/dummynet sys/netinet sys/netpfil/ipfw From: Adrian Chadd To: Don Lewis Cc: "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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 21:27:07 -0000 On 27 May 2016 at 09:51, Don Lewis wrote: > On 27 May, Adrian Chadd wrote: >> Hi, >> >> Did this introduce floating point into the kernel? > > Cr*p, it did. It looks fixable, but I'll disconnect PIE from the build > for now. Cool, thanks! -a From owner-svn-src-head@freebsd.org Fri May 27 21:27:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49E03B4C402; Fri, 27 May 2016 21:27:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1642F1AAE; Fri, 27 May 2016 21:27:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x235.google.com with SMTP id g126so2216558ite.1; Fri, 27 May 2016 14:27:46 -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; bh=rum6X+WBZ2UxI94bKAqUZTOfILB8xJzBS7lWZ9kfaF0=; b=RPdcPa+11taMC9z7Llr+uEDxjCMQwJ7uqHb7D4SmAJt3BOgLvcyWLMQBu06N5rKaJv zPvC6Q0gm56aODnxKr/EmLQtBrk8VuGz/dKxEoC6nl3zTzbbrfnODvO/U8Io5NKofBrM Y6y53IoZFl0H1XyfZdxgQit1EZYFPcIv0rKGwBJITw2XVJFfe8sSENunUcgHShlHut7Q UXldpwSsVdWpay6j5dTLNROW15k9zCoRk9+DSnmkWOtAfzRawujsQcIY0V/Hy27AbBBA UnxVYTAnaWxlO7YU0BzNOF8U3Ghb2PHK1SiyIstjknYs6iWo/c+lulNR2k0LC3UH/yyh WbPQ== 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; bh=rum6X+WBZ2UxI94bKAqUZTOfILB8xJzBS7lWZ9kfaF0=; b=VAqAikhxkR2vNs74yuQZ7LwAOVzGjxHvNkXR7305nKER7g469SSUDnabD/8EgzWyPR DX99XPE2cB1KATkjfKZeytiHtkN/hc8U68rPSdLELzpqN/mSMp+JqXRZJtZcrTdf2ml7 hzGWUM5g0eSZzv+c1iK44rTEJUYm0f5Re80ps28OoywKVIGtQANXgxJ5rwgwCxjW+CkN o6QSnLXozIOwFaBryYs5ashLpZAvVc7+nB6o/ObWD1HGz36flarK/TJPdXyXshuCdGTr DKRpPRY/p9zoIKvhlVZOfEZZhJj6g3Hu9/zwjHtwHrXMkrnGnVpqT8uP4oCSV2x5U8RK 69MQ== X-Gm-Message-State: ALyK8tJ+4LlQKaVhHprOmvv3xtmAuSV73Xq5bZtcBZghp/mxEJyU1kXcWNwJmAXxbwPMdQiUhUWmykbv90p2aA== MIME-Version: 1.0 X-Received: by 10.36.51.15 with SMTP id k15mr603794itk.80.1464384465550; Fri, 27 May 2016 14:27:45 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Fri, 27 May 2016 14:27:45 -0700 (PDT) In-Reply-To: <201605271731.u4RHV2oW071581@repo.freebsd.org> References: <201605271731.u4RHV2oW071581@repo.freebsd.org> Date: Fri, 27 May 2016 14:27:45 -0700 Message-ID: Subject: Re: svn commit: r300854 - in head/sys: netinet netinet6 From: Adrian Chadd To: Gleb Smirnoff Cc: "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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 21:27:46 -0000 Hm, doesnt this make sense to do as part of RO_RTFREE? -a From owner-svn-src-head@freebsd.org Fri May 27 22:14:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1961B4D0A7; Fri, 27 May 2016 22:14:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B41791513; Fri, 27 May 2016 22:14:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RMEdwq080122; Fri, 27 May 2016 22:14:39 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RMEdE6080121; Fri, 27 May 2016 22:14:39 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605272214.u4RMEdE6080121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 27 May 2016 22:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300878 - head/sys/dev/ffec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:14:41 -0000 Author: ian Date: Fri May 27 22:14:39 2016 New Revision: 300878 URL: https://svnweb.freebsd.org/changeset/base/300878 Log: Fix erronious mixed use of tx/rx variables/constants in the same expression. Pointed out by jmcneill; other instances found by grep -iE 'rx.*tx|tx.*rx' Modified: head/sys/dev/ffec/if_ffec.c Modified: head/sys/dev/ffec/if_ffec.c ============================================================================== --- head/sys/dev/ffec/if_ffec.c Fri May 27 21:41:52 2016 (r300877) +++ head/sys/dev/ffec/if_ffec.c Fri May 27 22:14:39 2016 (r300878) @@ -173,7 +173,7 @@ struct ffec_softc { struct ffec_hwdesc *txdesc_ring; bus_addr_t txdesc_ring_paddr; bus_dma_tag_t txbuf_tag; - struct ffec_bufmap txbuf_map[RX_DESC_COUNT]; + struct ffec_bufmap txbuf_map[TX_DESC_COUNT]; uint32_t tx_idx_head; uint32_t tx_idx_tail; int txcount; @@ -896,9 +896,9 @@ ffec_rxfinish_locked(struct ffec_softc * } if (produced_empty_buffer) { - bus_dmamap_sync(sc->rxdesc_tag, sc->txdesc_map, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(sc->rxdesc_tag, sc->rxdesc_map, BUS_DMASYNC_PREWRITE); WR4(sc, FEC_RDAR_REG, FEC_RDAR_RDAR); - bus_dmamap_sync(sc->rxdesc_tag, sc->txdesc_map, BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(sc->rxdesc_tag, sc->rxdesc_map, BUS_DMASYNC_POSTWRITE); } } From owner-svn-src-head@freebsd.org Fri May 27 22:16:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FA03B4D11B; Fri, 27 May 2016 22:16:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEFE517C2; Fri, 27 May 2016 22:16:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RMGm04080257; Fri, 27 May 2016 22:16:48 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RMGkMa080244; Fri, 27 May 2016 22:16:46 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605272216.u4RMGkMa080244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 27 May 2016 22:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300879 - in head/sys/contrib/dev/acpica: . compiler components/debugger components/disassembler components/dispatcher components/executer components/hardware components/namespace 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:16:49 -0000 Author: jkim Date: Fri May 27 22:16:46 2016 New Revision: 300879 URL: https://svnweb.freebsd.org/changeset/base/300879 Log: Merge ACPICA 20160527. Relnotes: yes Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/components/debugger/dbobject.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c head/sys/contrib/dev/acpica/components/executer/exfldio.c head/sys/contrib/dev/acpica/components/hardware/hwregs.c head/sys/contrib/dev/acpica/components/namespace/nsdump.c head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acutils.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/changes.txt Fri May 27 22:16:46 2016 (r300879) @@ -1,4 +1,37 @@ ---------------------------------------- +27 May 2016. Summary of changes for version 20160527: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Temporarily reverted the new arbitrary bit length/alignment support in +AcpiHwRead/AcpiHwWrite for the Generic Address Structure. There have been +a number of regressions with the new code that need to be fully resolved +and tested before this support can be finally integrated into ACPICA. +Apologies for any inconveniences these issues may have caused. + +The ACPI message macros are not configurable (ACPI_MSG_ERROR, +ACPI_MSG_EXCEPTION, ACPI_MSG_WARNING, ACPI_MSG_INFO, ACPI_MSG_BIOS_ERROR, +and ACPI_MSG_BIOS_WARNING). Lv Zheng. + +Fixed a couple of GCC warnings associated with the use of the -Wcast-qual +option. Adds a new return macro, return_STR. Junk-uk Kim. + +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: 136.8K Code, 51.6K Data, 188.4K Total + Debug Version: 201.5K Code, 82.2K Data, 283.7K Total + Previous Release: + Non-Debug Version: 137.4K Code, 52.6K Data, 190.0K Total + Debug Version: 200.9K Code, 82.2K Data, 283.1K Total + +---------------------------------------- 22 April 2016. Summary of changes for version 20160422: 1) ACPICA kernel-resident subsystem: Modified: head/sys/contrib/dev/acpica/compiler/asloptions.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloptions.c Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/compiler/asloptions.c Fri May 27 22:16:46 2016 (r300879) @@ -541,9 +541,13 @@ AslDoOptions ( case 'e': - /* Disable External opcode generation */ + /* iASL: Disable External opcode generation */ Gbl_DoExternals = FALSE; + + /* Disassembler: Emit embedded external operators */ + + AcpiGbl_DmEmitExternalOpcodes = TRUE; break; case 'f': Modified: head/sys/contrib/dev/acpica/components/debugger/dbobject.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbobject.c Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/components/debugger/dbobject.c Fri May 27 22:16:46 2016 (r300879) @@ -161,10 +161,10 @@ AcpiDbDecodeInternalObject ( case ACPI_TYPE_STRING: - AcpiOsPrintf ("(%u) \"%.24s", + AcpiOsPrintf ("(%u) \"%.60s", ObjDesc->String.Length, ObjDesc->String.Pointer); - if (ObjDesc->String.Length > 24) + if (ObjDesc->String.Length > 60) { AcpiOsPrintf ("..."); } Modified: head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c ============================================================================== --- head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c Fri May 27 22:16:46 2016 (r300879) @@ -971,7 +971,16 @@ AcpiDmDisassembleOneOp ( case AML_EXTERNAL_OP: - break; + if (AcpiGbl_DmEmitExternalOpcodes) + { + AcpiOsPrintf ("/* Opcode 0x15 */ "); + + /* Fallthrough */ + } + else + { + break; + } default: Modified: head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c Fri May 27 22:16:46 2016 (r300879) @@ -462,21 +462,26 @@ AcpiDmDescendingOp ( { NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; - /* - * A Zero predicate indicates the possibility of one or more - * External() opcodes within the If() block. - */ - if (NextOp->Common.AmlOpcode == AML_ZERO_OP) - { - NextOp2 = NextOp->Common.Next; + /* Don't emit the actual embedded externals unless asked */ - if (NextOp2 && - (NextOp2->Common.AmlOpcode == AML_EXTERNAL_OP)) + if (!AcpiGbl_DmEmitExternalOpcodes) + { + /* + * A Zero predicate indicates the possibility of one or more + * External() opcodes within the If() block. + */ + if (NextOp->Common.AmlOpcode == AML_ZERO_OP) { - /* Ignore the If 0 block and all children */ + NextOp2 = NextOp->Common.Next; + + if (NextOp2 && + (NextOp2->Common.AmlOpcode == AML_EXTERNAL_OP)) + { + /* Ignore the If 0 block and all children */ - Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; - return (AE_CTRL_DEPTH); + Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + return (AE_CTRL_DEPTH); + } } } } Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c Fri May 27 22:16:46 2016 (r300879) @@ -603,12 +603,14 @@ AcpiDsCreateOperand ( } else if (ParentOp->Common.AmlOpcode == AML_EXTERNAL_OP) { - /* TBD: May only be temporary */ - - ObjDesc = AcpiUtCreateStringObject ((ACPI_SIZE) NameLength); - - strncpy (ObjDesc->String.Pointer, NameString, NameLength); - Status = AE_OK; + /* + * This opcode should never appear here. It is used only + * by AML disassemblers and is surrounded by an If(0) + * by the ASL compiler. + * + * Therefore, if we see it here, it is a serious error. + */ + Status = AE_AML_BAD_OPCODE; } else { Modified: head/sys/contrib/dev/acpica/components/executer/exfldio.c ============================================================================== --- head/sys/contrib/dev/acpica/components/executer/exfldio.c Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/components/executer/exfldio.c Fri May 27 22:16:46 2016 (r300879) @@ -946,9 +946,20 @@ AcpiExInsertIntoField ( AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth); - /* Create the bitmasks used for bit insertion */ + /* + * Create the bitmasks used for bit insertion. + * Note: This if/else is used to bypass compiler differences with the + * shift operator + */ + if (AccessBitWidth == ACPI_INTEGER_BIT_SIZE) + { + WidthMask = ACPI_UINT64_MAX; + } + else + { + WidthMask = ACPI_MASK_BITS_ABOVE (AccessBitWidth); + } - WidthMask = ACPI_MASK_BITS_ABOVE_64 (AccessBitWidth); Mask = WidthMask & ACPI_MASK_BITS_BELOW (ObjDesc->CommonField.StartFieldBitOffset); Modified: head/sys/contrib/dev/acpica/components/hardware/hwregs.c ============================================================================== --- head/sys/contrib/dev/acpica/components/hardware/hwregs.c Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/components/hardware/hwregs.c Fri May 27 22:16:46 2016 (r300879) @@ -91,10 +91,6 @@ AcpiHwValidateRegister ( UINT8 MaxBitWidth, UINT64 *Address) { - UINT8 BitWidth; - UINT8 BitEnd; - UINT8 AccessWidth; - /* Must have a valid pointer to a GAS structure */ @@ -124,28 +120,24 @@ AcpiHwValidateRegister ( return (AE_SUPPORT); } - /* Validate the AccessWidth */ + /* Validate the BitWidth */ - if (Reg->AccessWidth > 4) + if ((Reg->BitWidth != 8) && + (Reg->BitWidth != 16) && + (Reg->BitWidth != 32) && + (Reg->BitWidth != MaxBitWidth)) { ACPI_ERROR ((AE_INFO, - "Unsupported register access width: 0x%X", Reg->AccessWidth)); + "Unsupported register bit width: 0x%X", Reg->BitWidth)); return (AE_SUPPORT); } - /* Validate the BitWidth, convert AccessWidth into number of bits */ + /* Validate the BitOffset. Just a warning for now. */ - BitEnd = Reg->BitOffset + Reg->BitWidth; - AccessWidth = Reg->AccessWidth ? Reg->AccessWidth : 1; - AccessWidth = 1 << (AccessWidth + 2); - BitWidth = ACPI_ROUND_UP (BitEnd, AccessWidth) - - ACPI_ROUND_DOWN (Reg->BitOffset, AccessWidth); - if (MaxBitWidth < BitWidth) + if (Reg->BitOffset != 0) { ACPI_WARNING ((AE_INFO, - "Requested bit width 0x%X is smaller than register bit width 0x%X", - MaxBitWidth, BitWidth)); - return (AE_SUPPORT); + "Unsupported register bit offset: 0x%X", Reg->BitOffset)); } return (AE_OK); Modified: head/sys/contrib/dev/acpica/components/namespace/nsdump.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsdump.c Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/components/namespace/nsdump.c Fri May 27 22:16:46 2016 (r300879) @@ -381,7 +381,7 @@ AcpiNsDumpOneObject ( case ACPI_TYPE_STRING: AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length); - AcpiUtPrintString (ObjDesc->String.Pointer, 32); + AcpiUtPrintString (ObjDesc->String.Pointer, 80); AcpiOsPrintf ("\n"); break; Modified: head/sys/contrib/dev/acpica/include/acglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acglobal.h Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/include/acglobal.h Fri May 27 22:16:46 2016 (r300879) @@ -321,6 +321,7 @@ ACPI_INIT_GLOBAL (BOOLEAN, ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, TRUE); +ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmEmitExternalOpcodes, FALSE); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Disasm); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Listing); Modified: head/sys/contrib/dev/acpica/include/acmacros.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acmacros.h Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/include/acmacros.h Fri May 27 22:16:46 2016 (r300879) @@ -264,30 +264,14 @@ #define ACPI_IS_MISALIGNED(value) (((ACPI_SIZE) value) & (sizeof(ACPI_SIZE)-1)) -/* Generic (power-of-two) rounding */ - -#define ACPI_IS_POWER_OF_TWO(a) (((a) & ((a) - 1)) == 0) - /* * Bitmask creation * Bit positions start at zero. * MASK_BITS_ABOVE creates a mask starting AT the position and above * MASK_BITS_BELOW creates a mask starting one bit BELOW the position - * MASK_BITS_ABOVE/BELOW accpets a bit offset to create a mask - * MASK_BITS_ABOVE/BELOW_32/64 accpets a bit width to create a mask - * Note: The ACPI_INTEGER_BIT_SIZE check is used to bypass compiler - * differences with the shift operator */ #define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_UINT64_MAX) << ((UINT32) (position)))) #define ACPI_MASK_BITS_BELOW(position) ((ACPI_UINT64_MAX) << ((UINT32) (position))) -#define ACPI_MASK_BITS_ABOVE_32(width) ((UINT32) ACPI_MASK_BITS_ABOVE(width)) -#define ACPI_MASK_BITS_BELOW_32(width) ((UINT32) ACPI_MASK_BITS_BELOW(width)) -#define ACPI_MASK_BITS_ABOVE_64(width) ((width) == ACPI_INTEGER_BIT_SIZE ? \ - ACPI_UINT64_MAX : \ - ACPI_MASK_BITS_ABOVE(width)) -#define ACPI_MASK_BITS_BELOW_64(width) ((width) == ACPI_INTEGER_BIT_SIZE ? \ - (UINT64) 0 : \ - ACPI_MASK_BITS_BELOW(width)) /* Bitfields within ACPI registers */ Modified: head/sys/contrib/dev/acpica/include/acpixf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpixf.h Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/include/acpixf.h Fri May 27 22:16:46 2016 (r300879) @@ -46,7 +46,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20160422 +#define ACPI_CA_VERSION 0x20160527 #include #include Modified: head/sys/contrib/dev/acpica/include/acutils.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acutils.h Fri May 27 22:14:39 2016 (r300878) +++ head/sys/contrib/dev/acpica/include/acutils.h Fri May 27 22:16:46 2016 (r300879) @@ -115,13 +115,25 @@ extern const char /* * Common error message prefixes */ +#ifndef ACPI_MSG_ERROR #define ACPI_MSG_ERROR "ACPI Error: " +#endif +#ifndef ACPI_MSG_EXCEPTION #define ACPI_MSG_EXCEPTION "ACPI Exception: " +#endif +#ifndef ACPI_MSG_WARNING #define ACPI_MSG_WARNING "ACPI Warning: " +#endif +#ifndef ACPI_MSG_INFO #define ACPI_MSG_INFO "ACPI: " +#endif +#ifndef ACPI_MSG_BIOS_ERROR #define ACPI_MSG_BIOS_ERROR "ACPI BIOS Error (bug): " +#endif +#ifndef ACPI_MSG_BIOS_WARNING #define ACPI_MSG_BIOS_WARNING "ACPI BIOS Warning (bug): " +#endif /* * Common message suffix From owner-svn-src-head@freebsd.org Fri May 27 22:26:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28E09B4D35B; Fri, 27 May 2016 22:26:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E70991D98; Fri, 27 May 2016 22:26:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RMQifK084035; Fri, 27 May 2016 22:26:44 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RMQhRV084033; Fri, 27 May 2016 22:26:43 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605272226.u4RMQhRV084033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 27 May 2016 22:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300880 - in 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:26:45 -0000 Author: asomers Date: Fri May 27 22:26:43 2016 New Revision: 300880 URL: https://svnweb.freebsd.org/changeset/base/300880 Log: Strip leading spaces off of a SCSI disk's serial number sys/cam/scsi/scsi_xpt.c Strip leading spaces off of a SCSI disk's reported serial number when populating the CAM serial number. This affects the output of "diskinfo -v" and the names of /dev/diskid/DISK-* device nodes, among other things. SPC5r05 says that the Product Serial Number field from the Unit Serial Number VPD page is right-aligned. So any leading spaces are not part of the actual serial number. Most devices don't left-pad their serial numbers, but some do. In particular, the SN VPD page that an LSI HBA emulates for a SATA drive contains enough left-padding to fill a 20-byte field. UPDATING Add a note to UPDATING, because some users may have to update /etc/fstab or geom labels. Reviewed by: ken, mav MFC after: Never Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6516 Modified: head/UPDATING head/sys/cam/scsi/scsi_xpt.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri May 27 22:16:46 2016 (r300879) +++ head/UPDATING Fri May 27 22:26:43 2016 (r300880) @@ -31,6 +31,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160527: + CAM will now strip leading spaces from SCSI disks' serial numbers. + This will effect users who create UFS filesystems on SCSI disks using + those disk's diskid device nodes. For example, if /etc/fstab + previously contained a line like + "/dev/diskid/DISK-%20%20%20%20%20%20%20ABCDEFG0123456", you should + change it to "/dev/diskid/DISK-ABCDEFG0123456". Users of geom + transfers like gmirror may also be affected. ZFS users should + generally be fine. + 20160523: The bitstring(3) API has been updated with new functionality and improved performance. But it is binary-incompatible with the old API. Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Fri May 27 22:16:46 2016 (r300879) +++ head/sys/cam/scsi/scsi_xpt.c Fri May 27 22:26:43 2016 (r300880) @@ -1559,13 +1559,22 @@ probe_device_check: (u_int8_t *)malloc((serial_buf->length + 1), M_CAMXPT, M_NOWAIT); if (path->device->serial_num != NULL) { + int start, slen; + + start = strspn(serial_buf->serial_num, " "); + slen = serial_buf->length - start; + if (slen <= 0) { + /* + * SPC5r05 says that an all-space serial + * number means no product serial number + * is available + */ + slen = 0; + } memcpy(path->device->serial_num, - serial_buf->serial_num, - serial_buf->length); - path->device->serial_num_len = - serial_buf->length; - path->device->serial_num[serial_buf->length] - = '\0'; + &serial_buf->serial_num[start], slen); + path->device->serial_num_len = slen; + path->device->serial_num[slen] = '\0'; } } else if (cam_periph_error(done_ccb, 0, SF_RETRY_UA|SF_NO_PRINT, From owner-svn-src-head@freebsd.org Fri May 27 22:31:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEDDAB4D3E2; Fri, 27 May 2016 22:31:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 713651FA7; Fri, 27 May 2016 22:31:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r300879 - in head/sys/contrib/dev/acpica: . compiler components/debugger components/disassembler components/dispatcher components/executer components/hardware components/namespace include To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605272216.u4RMGkMa080244@repo.freebsd.org> From: Jung-uk Kim Message-ID: <8d0b0f51-7192-e3cd-8d0b-de1a76b4b307@FreeBSD.org> Date: Fri, 27 May 2016 18:30:58 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201605272216.u4RMGkMa080244@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IGoQoPMUQai4NEVkS0baaaUe6RLLA0f8A" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:31:03 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IGoQoPMUQai4NEVkS0baaaUe6RLLA0f8A Content-Type: multipart/mixed; boundary="nXSLs6omUSr76oJSbDePwuUo1qpRJD0E9" From: Jung-uk Kim To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <8d0b0f51-7192-e3cd-8d0b-de1a76b4b307@FreeBSD.org> Subject: Re: svn commit: r300879 - in head/sys/contrib/dev/acpica: . compiler components/debugger components/disassembler components/dispatcher components/executer components/hardware components/namespace include References: <201605272216.u4RMGkMa080244@repo.freebsd.org> In-Reply-To: <201605272216.u4RMGkMa080244@repo.freebsd.org> --nXSLs6omUSr76oJSbDePwuUo1qpRJD0E9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/27/16 06:16 PM, Jung-uk Kim wrote: > Author: jkim > Date: Fri May 27 22:16:46 2016 > New Revision: 300879 > URL: https://svnweb.freebsd.org/changeset/base/300879 >=20 > Log: > Merge ACPICA 20160527. =2E.. Note this release was meant to fix regressions introduced in 20160422. However, we already fixed it locally (r298838). Jung-uk Kim --nXSLs6omUSr76oJSbDePwuUo1qpRJD0E9-- --IGoQoPMUQai4NEVkS0baaaUe6RLLA0f8A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXSMqnAAoJEHyflib82/FGkLoH/1R+NcWkhML1mXYVL0Wnm6M3 NMDur8FsOG8tcv7L/0Gm2G4bzD3LyInMmUFxqNF9YKJUFastnkXmlDJKVQUzlogo e4DmneYWtTcsHs+L0An5FixhA3LwRaUwDjyiUFXO85g84D+/xh6BerqB/wVhsN4G on6Vf43x73Lx9ZLBAGnSFPidjesRDUe//qOGji+OBrZ1sxX53j1O6pM0W9kBcNbX 2wbVTueUfpIvjj+36eADkoEoyHCoqoG5iavwKD+XWCuS5t1fGKW++U1EevexyGXe Q8OVk/w2ulLHwFAdKGhbD8JAtAiEN2h+MM3ZwvmcTOw9AkcGyMycD9B4JCZVwYw= =YiC4 -----END PGP SIGNATURE----- --IGoQoPMUQai4NEVkS0baaaUe6RLLA0f8A-- From owner-svn-src-head@freebsd.org Fri May 27 22:32:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 221E1B4D632; Fri, 27 May 2016 22:32:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F109A14D3; Fri, 27 May 2016 22:32:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RMWjpP087650; Fri, 27 May 2016 22:32:45 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RMWjku087648; Fri, 27 May 2016 22:32:45 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605272232.u4RMWjku087648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 27 May 2016 22:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300881 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:32:46 -0000 Author: asomers Date: Fri May 27 22:32:44 2016 New Revision: 300881 URL: https://svnweb.freebsd.org/changeset/base/300881 Log: Avoid issuing spa config updates for physical path when not necessary ZFS's configuration needs to be updated whenever the physical path for a device changes, but not when a new device is introduced. This is because new devices necessarily cause config updates, but only if they are actually accepted into the pool. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Split vdev_geom_set_physpath out of vdev_geom_attrchanged. When setting the vdev's physical path, only request a config update if the physical path has changed. Don't request it when opening a device for the first time, because the config sync will happen anyway upstack. sys/geom/geom_dev.c Split g_dev_set_physpath and g_dev_set_media out of g_dev_attrchanged Submitted by: will, asomers MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6428 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c head/sys/geom/geom_dev.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri May 27 22:26:43 2016 (r300880) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri May 27 22:32:44 2016 (r300881) @@ -85,32 +85,17 @@ vdev_geom_set_rotation_rate(vdev_t *vd, } static void -vdev_geom_attrchanged(struct g_consumer *cp, const char *attr) +vdev_geom_set_physpath(struct g_consumer *cp, boolean_t do_null_update) { + boolean_t needs_update; vdev_t *vd; - spa_t *spa; char *physpath; int error, physpath_len; - vd = cp->private; - if (vd == NULL) - return; - - if (strcmp(attr, "GEOM::rotation_rate") == 0) { - vdev_geom_set_rotation_rate(vd, cp); - return; - } - - if (strcmp(attr, "GEOM::physpath") != 0) - return; - if (g_access(cp, 1, 0, 0) != 0) return; - /* - * Record/Update physical path information for this device. - */ - spa = vd->vdev_spa; + vd = cp->private; physpath_len = MAXPATHLEN; physpath = g_malloc(physpath_len, M_WAITOK|M_ZERO); error = g_io_getattr("GEOM::physpath", cp, &physpath_len, physpath); @@ -122,12 +107,46 @@ vdev_geom_attrchanged(struct g_consumer g_topology_assert(); old_physpath = vd->vdev_physpath; vd->vdev_physpath = spa_strdup(physpath); - spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE); - if (old_physpath != NULL) + if (old_physpath != NULL) { + needs_update = (strcmp(old_physpath, + vd->vdev_physpath) != 0); spa_strfree(old_physpath); + } else + needs_update = do_null_update; } g_free(physpath); + + /* + * If the physical path changed, update the config. + * Only request an update for previously unset physpaths if + * requested by the caller. + */ + if (needs_update) + spa_async_request(vd->vdev_spa, SPA_ASYNC_CONFIG_UPDATE); + +} + +static void +vdev_geom_attrchanged(struct g_consumer *cp, const char *attr) +{ + vdev_t *vd; + char *old_physpath; + int error; + + vd = cp->private; + if (vd == NULL) + return; + + if (strcmp(attr, "GEOM::rotation_rate") == 0) { + vdev_geom_set_rotation_rate(vd, cp); + return; + } + + if (strcmp(attr, "GEOM::physpath") == 0) { + vdev_geom_set_physpath(cp, /*do_null_update*/B_TRUE); + return; + } } static void @@ -257,8 +276,10 @@ vdev_geom_attach(struct g_provider *pp, * 2) Set it to a linked list of vdevs, not just a single vdev */ cp->private = vd; - if (vd != NULL) + if (vd != NULL) { vd->vdev_tsd = cp; + vdev_geom_set_physpath(cp, /*do_null_update*/B_FALSE); + } cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; return (cp); Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Fri May 27 22:26:43 2016 (r300880) +++ head/sys/geom/geom_dev.c Fri May 27 22:32:44 2016 (r300881) @@ -222,55 +222,68 @@ g_dev_print(void) } static void -g_dev_attrchanged(struct g_consumer *cp, const char *attr) +g_dev_set_physpath(struct g_consumer *cp) +{ + struct g_dev_softc *sc; + char *physpath; + int error, physpath_len; + + if (g_access(cp, 1, 0, 0) != 0) + return; + + sc = cp->private; + physpath_len = MAXPATHLEN; + physpath = g_malloc(physpath_len, M_WAITOK|M_ZERO); + error = g_io_getattr("GEOM::physpath", cp, &physpath_len, physpath); + g_access(cp, -1, 0, 0); + if (error == 0 && strlen(physpath) != 0) { + struct cdev *dev, *old_alias_dev; + struct cdev **alias_devp; + + dev = sc->sc_dev; + old_alias_dev = sc->sc_alias; + alias_devp = (struct cdev **)&sc->sc_alias; + make_dev_physpath_alias(MAKEDEV_WAITOK, alias_devp, dev, + old_alias_dev, physpath); + } else if (sc->sc_alias) { + destroy_dev((struct cdev *)sc->sc_alias); + sc->sc_alias = NULL; + } + g_free(physpath); +} + +static void +g_dev_set_media(struct g_consumer *cp) { struct g_dev_softc *sc; struct cdev *dev; char buf[SPECNAMELEN + 6]; sc = cp->private; - if (strcmp(attr, "GEOM::media") == 0) { - dev = sc->sc_dev; + dev = sc->sc_dev; + snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); + devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, M_WAITOK); + devctl_notify_f("GEOM", "DEV", "MEDIACHANGE", buf, M_WAITOK); + dev = sc->sc_alias; + if (dev != NULL) { snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, M_WAITOK); devctl_notify_f("GEOM", "DEV", "MEDIACHANGE", buf, M_WAITOK); - dev = sc->sc_alias; - if (dev != NULL) { - snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); - devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, - M_WAITOK); - devctl_notify_f("GEOM", "DEV", "MEDIACHANGE", buf, - M_WAITOK); - } - return; } +} - if (strcmp(attr, "GEOM::physpath") != 0) +static void +g_dev_attrchanged(struct g_consumer *cp, const char *attr) +{ + + if (strcmp(attr, "GEOM::media") == 0) { + g_dev_set_media(cp); return; + } - if (g_access(cp, 1, 0, 0) == 0) { - char *physpath; - int error, physpath_len; - - physpath_len = MAXPATHLEN; - physpath = g_malloc(physpath_len, M_WAITOK|M_ZERO); - error = - g_io_getattr("GEOM::physpath", cp, &physpath_len, physpath); - g_access(cp, -1, 0, 0); - if (error == 0 && strlen(physpath) != 0) { - struct cdev *old_alias_dev; - struct cdev **alias_devp; - - dev = sc->sc_dev; - old_alias_dev = sc->sc_alias; - alias_devp = (struct cdev **)&sc->sc_alias; - make_dev_physpath_alias(MAKEDEV_WAITOK, alias_devp, - dev, old_alias_dev, physpath); - } else if (sc->sc_alias) { - destroy_dev((struct cdev *)sc->sc_alias); - sc->sc_alias = NULL; - } - g_free(physpath); + if (strcmp(attr, "GEOM::physpath") == 0) { + g_dev_set_physpath(cp); + return; } } From owner-svn-src-head@freebsd.org Fri May 27 22:32:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED9A3B4D66C; Fri, 27 May 2016 22:32:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27D501504; Fri, 27 May 2016 22:32:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x230.google.com with SMTP id 62so1289184pfd.1; Fri, 27 May 2016 15:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=WWbIrmOllrmIRZKrM4G7ykf1RtJBdQ6Rcr0PF1mGP4Y=; b=Nhdle88LM2A2WD/qbdoqh+HjJP8atZCDqGgcxcg5QObDdCkXFl1uN2s2riv2FqMaBw wE1JniMhhE00yb06xIta+eZp9/lWlGbq24lpeoYHDzfCASAgCp+wE6obSi7q5ZafGNq7 NxDCj0ihB6C1/lgUN0+8M1csoCR3EEYOXSRmICVBROcDal2Od1A7XId5BRtM5Wy1f6A1 x9WuDLtdijXUtAadcnXf0wxNZL2RkFgamsq6AyqkXqBU+JXxfFIlnWUTBY9HxyKjLLdZ NQCaIj3aUY4HekRCRnrBfTomsKIx7ZuoJ8BTEbJm+RlsC0tTKvuQrDbMUwrfsOCxzxar pZ5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=WWbIrmOllrmIRZKrM4G7ykf1RtJBdQ6Rcr0PF1mGP4Y=; b=kH3wYSGUw312frq0fygskFlezh9rZJ5J1sbqCqD1PZopkOc5wSTc3EtPm990gOw6nt 8ewvX6OiBmfY9Hz8i+kBjkp4nPOy/CNFp+ZhaeIfXvG+Zs1dX8s49dwxbuktAi82+sSL au1EnvLhd1NQrmtJFwaArqFXS1ivQcHp4BrdDSq+8psl4O8D1QayVExMRRCAFQxtXx+n 9fgCxk3bC4EIt3XOewH8Xxu7fWux/h0xf2c27eGR0pvGnGweS/P204L67WT36Fl8a3ZB PtAuoFAkUXnPNkGn1qdosqfdolCUum6sB5IAOeWNQ8nXPO/OlyujwdF4mM7aB60zgNyF NOdA== X-Gm-Message-State: ALyK8tLnP0/NhAZuijw4e9Zm7eARoxM5a0ML7YdMDbM1YHpqaxdlWLlwQ695T94AkYoItg== X-Received: by 10.98.67.138 with SMTP id l10mr25914710pfi.59.1464388371462; Fri, 27 May 2016 15:32:51 -0700 (PDT) Received: from pinklady.local (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id q129sm16036605pfb.16.2016.05.27.15.32.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 May 2016 15:32:50 -0700 (PDT) Subject: Re: svn commit: r300865 - in head/sys: sys vm Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_7F990D64-C13B-47EF-968E-4B1A60C2018A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <4318dffc-fef5-2128-74c2-0e97767b36c8@rice.edu> Date: Fri, 27 May 2016 15:32:48 -0700 Cc: Konstantin Belousov , Ivan Klymenko , Alan Cox , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <05E6AFC6-E7B4-45E9-8E5B-C2CDA439D33B@gmail.com> References: <201605271915.u4RJFkEl013139@repo.freebsd.org> <20160527225103.67ae3547@nonamehost.local> <20160527210148.GR38613@kib.kiev.ua> <016BEE0D-05B6-4042-8CD4-471D4D1C9162@gmail.com> <3018B8E4-5E33-49EF-8154-D7D5ECEE8403@gmail.com> <5CAD8DF0-0D56-4EBD-AB93-645B21E3792D@gmail.com> <4318dffc-fef5-2128-74c2-0e97767b36c8@rice.edu> To: Alan Cox X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:32:53 -0000 --Apple-Mail=_7F990D64-C13B-47EF-968E-4B1A60C2018A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 27, 2016, at 14:26, Alan Cox wrote: >=20 > On 05/27/2016 16:22, Ngie Cooper (yaneurabeya) wrote: >>> On May 27, 2016, at 14:21, Ngie Cooper (yaneurabeya) = wrote: >>>> I added #include to zfs/arc.c in r300870 =E2=80=94 = it was missing from the file. Looking into drm2 and fed. >>> Oy. Bad test before I did the fix. The issue was libzpool -_- (just = saw alc=E2=80=99s comment)=E2=80=A6 I=E2=80=99ll fix my commit.. >> Actually, I=E2=80=99ll just revert my commit and report back about = whether or not your patch worked kib. >=20 >=20 > Revert and remove the vm_pageout.h #include from arc.c. Confirmed. Reverting r300870 and applying kib=E2=80=99s diff passes = buildworld. Please commit the patch. Thanks! -Ngie --Apple-Mail=_7F990D64-C13B-47EF-968E-4B1A60C2018A 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 iQIcBAEBCgAGBQJXSMsRAAoJEPWDqSZpMIYV+y8QAJhhALE2ATc9e92VxQCH3yMR mlfDNMHuFK2k+xxioqcT/PneheKx7Vgc6UMnXOXY3f9aeh2p1ZocFKKU08FdZLkj WpZocyC5WG8SZKK3hxrC/JcDxWnapy7o/bXGRG0Ea8GbQDHACSqmua5FndDRiptC r6mpnBX+hxfSs3t2RpLwrqDYQfo0F9hAtKkvTdZhk8o3kILmobDKDqcN8pbn0QRd Wmhx6BwCJ1VqTbEMij7lZYKfbqKI0WCQdIIgNhe4gX45noMJ0fokFqL3yvAjoAiz Xb2aHFd4bOihUJYmHJz2WcVVR0x23gu9ZktvJ+1nTqinmSO2AMQtJUt6w/2E4vYa SmobvDtzGYjcvfoeXNJxeByhEoMWd30fr/G4YGsdqTfoZT6TIrveZNl4c8i9SjrW k5gKfdRDb/PPSVLhUHET+ES7BJBVZjuzezLZBJnCc+jU2KTKCYtUBwJ13DE5hvrT u0D3GCBlHqExlz/k9Tj0GxArUqeXT3dzDgJNMS1siNSNuB44CURomkkSpxRqV+VF gXf44WdReCFN2iBxc2x+zq9FWEc39GTM63gE67r9h+QTJmTgUsdbkfGUunviIPjA NyUJHNqX5UZZH3EzK3OObo+Cs5TEfzf1ULrrF7wxFcp4QePupbUw71z/UWdnYLR3 RjRyZePc66+jLr/mhb86 =I8zG -----END PGP SIGNATURE----- --Apple-Mail=_7F990D64-C13B-47EF-968E-4B1A60C2018A-- From owner-svn-src-head@freebsd.org Fri May 27 22:39:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1DD5B4D799; Fri, 27 May 2016 22:39:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 1FC6A1ADB; Fri, 27 May 2016 22:39:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u4RMdgo3018851 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 28 May 2016 01:39:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u4RMdgo3018851 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u4RMdgqb018850; Sat, 28 May 2016 01:39:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 May 2016 01:39:42 +0300 From: Konstantin Belousov To: "Ngie Cooper (yaneurabeya)" Cc: Alan Cox , Ivan Klymenko , Alan Cox , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300865 - in head/sys: sys vm Message-ID: <20160527223942.GS38613@kib.kiev.ua> References: <201605271915.u4RJFkEl013139@repo.freebsd.org> <20160527225103.67ae3547@nonamehost.local> <20160527210148.GR38613@kib.kiev.ua> <016BEE0D-05B6-4042-8CD4-471D4D1C9162@gmail.com> <3018B8E4-5E33-49EF-8154-D7D5ECEE8403@gmail.com> <5CAD8DF0-0D56-4EBD-AB93-645B21E3792D@gmail.com> <4318dffc-fef5-2128-74c2-0e97767b36c8@rice.edu> <05E6AFC6-E7B4-45E9-8E5B-C2CDA439D33B@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <05E6AFC6-E7B4-45E9-8E5B-C2CDA439D33B@gmail.com> User-Agent: Mutt/1.6.1 (2016-04-27) 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.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:39:47 -0000 On Fri, May 27, 2016 at 03:32:48PM -0700, Ngie Cooper (yaneurabeya) wrote: > > > On May 27, 2016, at 14:26, Alan Cox wrote: > > > > On 05/27/2016 16:22, Ngie Cooper (yaneurabeya) wrote: > >>> On May 27, 2016, at 14:21, Ngie Cooper (yaneurabeya) wrote: > >>>> I added #include to zfs/arc.c in r300870 ??? it was missing from the file. Looking into drm2 and fed. > >>> Oy. Bad test before I did the fix. The issue was libzpool -_- (just saw alc???s comment)??? I???ll fix my commit.. > >> Actually, I???ll just revert my commit and report back about whether or not your patch worked kib. > > > > > > Revert and remove the vm_pageout.h #include from arc.c. > > Confirmed. Reverting r300870 and applying kib???s diff passes buildworld. Please commit the patch. There was Alan' suggestion to remove vm_pageout.h at all. Either way, commit my patch, or preferrably Alan' suggested changes yourself. From owner-svn-src-head@freebsd.org Fri May 27 22:40:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB6A4B4D7FE; Fri, 27 May 2016 22:40:41 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B85421C93; Fri, 27 May 2016 22:40:41 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RMeekf088687; Fri, 27 May 2016 22:40:40 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RMeeaA088685; Fri, 27 May 2016 22:40:40 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605272240.u4RMeeaA088685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 27 May 2016 22:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300882 - in head: etc/rc.d tests/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:40:42 -0000 Author: asomers Date: Fri May 27 22:40:40 2016 New Revision: 300882 URL: https://svnweb.freebsd.org/changeset/base/300882 Log: Always create loopback routes on every fib Always create loopback routes on every fib, for both IPv4 and IPv6 etc/rc.d/routing Create loopback IPv4 and IPv6 routes on every fib at boot. Revert 278302; now that all FIBs have IPv6 loopback routes, the "route add -reject" commands won't fail. tests/etc/rc.d/routing_test.sh Greatly simplify static_ipv6_loopback_route_for_each_fib. It was written under the assumption that loopback routes would be added to a given fib by the kernel as soon as an interface is configured on that fib. However, the logic can be much simpler now that we simply add loopback routes to all fibs at boot. This also removes the need to run the test as root, removes the restriction that net.add_addr_allfibs=0, and removes the need to configure fibs in kyua.conf. Also, add a test case for IPv4 loopback routes Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6582 Modified: head/etc/rc.d/routing head/tests/etc/rc.d/routing_test.sh Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Fri May 27 22:32:44 2016 (r300881) +++ head/etc/rc.d/routing Fri May 27 22:40:40 2016 (r300882) @@ -126,12 +126,31 @@ routing_stop_atm() return 0 } +get_fibmod() +{ + local _fibs + + _fibs=$((`${SYSCTL_N} net.fibs` - 1)) + if [ ${_fibs} -gt 0 ]; then + echo "-fib 0-${_fibs}" + else + echo + fi +} + static_inet() { - local _action _if _skip + local _action _if _skip _fibmod _action=$1 _if=$2 + _fibmod=`get_fibmod` + + # Provide loopback route in all routing tables. This has to come + # first so that any following routes can be added. + static_routes="_loopback ${static_routes}" + route__loopback="-inet 127.0.0.1 -iface lo0 ${_fibmod}" + # Add default route. case ${defaultrouter} in [Nn][Oo] | '') @@ -166,27 +185,24 @@ static_inet() static_inet6() { - local _action _if _skip fibmod fibs allfibs + local _action _if _skip fibmod allfibs _action=$1 _if=$2 - # get the number of FIBs supported. - fibs=$((`${SYSCTL_N} net.fibs` - 1)) - allfibs=`${SYSCTL_N} net.add_addr_allfibs` - if [ "$fibs" -gt 0 ] && [ "$allfibs" -ne 0 ]; then - fibmod="-fib 0-$fibs" - else - fibmod= - fi + fibmod=`get_fibmod` # Add pre-defined static routes first. ipv6_static_routes="_v4mapped _v4compat ${ipv6_static_routes}" ipv6_static_routes="_lla _llma ${ipv6_static_routes}" + ipv6_static_routes="_loopback ${ipv6_static_routes}" # disallow "internal" addresses to appear on the wire ipv6_route__v4mapped="::ffff:0.0.0.0 -prefixlen 96 ::1 -reject ${fibmod}" ipv6_route__v4compat="::0.0.0.0 -prefixlen 96 ::1 -reject ${fibmod}" + # Create a loopback route in every fib + ipv6_route__loopback="::1 -prefixlen 128 -iface lo0 ${fibmod}" + # Disallow link-local unicast packets without outgoing scope # identifiers. However, if you set "ipv6_default_interface", # for the host case, you will allow to omit the identifiers. Modified: head/tests/etc/rc.d/routing_test.sh ============================================================================== --- head/tests/etc/rc.d/routing_test.sh Fri May 27 22:32:44 2016 (r300881) +++ head/tests/etc/rc.d/routing_test.sh Fri May 27 22:40:40 2016 (r300882) @@ -31,108 +31,43 @@ # # $FreeBSD$ -atf_test_case static_ipv6_loopback_route_for_each_fib cleanup -static_ipv6_loopback_route_for_each_fib_head() +atf_test_case static_ipv4_loopback_route_for_each_fib cleanup +static_ipv4_loopback_route_for_each_fib_head() { - atf_set "descr" "Every FIB should have a static IPv6 loopback route" - atf_set "require.user" "root" - atf_set "require.config" "fibs" - atf_set "require.progs" "sysrc" + atf_set "descr" "Every FIB should have a static IPv4 loopback route" } -static_ipv6_loopback_route_for_each_fib_body() +static_ipv4_loopback_route_for_each_fib_body() { - # Configure the TAP interface to use an RFC5737 nonrouteable address - # and a non-default fib - ADDR="192.0.2.2" - SUBNET="192.0.2.0" - MASK="24" - - # Check system configuration - if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then - atf_skip "This test requires net.add_addr_allfibs=0" - fi - - get_fibs 1 - get_tap - - # Configure a TAP interface in /etc/rc.conf. Register the sysrc - # variable for cleanup. - echo "ifconfig_${TAP}" >> "sysrc_vars_to_cleanup" - sysrc ifconfig_${TAP}="${ADDR}/${MASK} fib ${FIB0}" + local nfibs fib + nfibs=`sysctl -n net.fibs` - # Start the interface - service netif start ${TAP} - # Check for an IPv6 loopback route - setfib ${FIB0} netstat -rn -f inet6 | grep -q "^::1.*lo0$" - if [ 0 -eq $? ]; then - atf_pass - else - setfib ${FIB0} netstat -rn -f inet6 - atf_fail "Did not find an IPv6 loopback route" - fi -} -static_ipv6_loopback_route_for_each_fib_cleanup() -{ - cleanup_sysrc - cleanup_tap + # Check for an IPv4 loopback route + for fib in `seq 0 $((${nfibs} - 1))`; do + atf_check -o match:"interface: lo0" -s exit:0 \ + setfib -F ${fib} route -4 get 127.0.0.1 + done } -atf_init_test_cases() +atf_test_case static_ipv6_loopback_route_for_each_fib cleanup +static_ipv6_loopback_route_for_each_fib_head() { - atf_add_test_case static_ipv6_loopback_route_for_each_fib + atf_set "descr" "Every FIB should have a static IPv6 loopback route" } - -# Looks up one or more fibs from the configuration data and validates them. -# Returns the results in the env varilables FIB0, FIB1, etc. -# parameter numfibs The number of fibs to lookup -get_fibs() +static_ipv6_loopback_route_for_each_fib_body() { - NUMFIBS=$1 - net_fibs=`sysctl -n net.fibs` - i=0 - while [ $i -lt "$NUMFIBS" ]; do - fib=`atf_config_get "fibs" | \ - awk -v i=$(( i + 1 )) '{print $i}'` - echo "fib is ${fib}" - eval FIB${i}=${fib} - if [ "$fib" -ge "$net_fibs" ]; then - msg="The ${i}th configured fib is ${fub}, which is " - msg="$msg not less than net.fibs (${net_fibs})" - atf_skip "$msg" - fi - i=$(( $i + 1 )) - done -} + local nfibs fib + nfibs=`sysctl -n net.fibs` - -# Creates a new tap(4) interface, registers it for cleanup, and returns the -# name via the environment variable TAP -get_tap() -{ - local TAPN=0 - while ! ifconfig tap${TAPN} create > /dev/null 2>&1; do - if [ "$TAPN" -ge 8 ]; then - atf_skip "Could not create a tap(4) interface" - else - TAPN=$(($TAPN + 1)) - fi + # Check for an IPv6 loopback route + for fib in `seq 0 $((${nfibs} - 1))`; do + atf_check -o match:"interface: lo0" -s exit:0 \ + setfib -F ${fib} route -6 get ::1 done - local TAPD=tap${TAPN} - # Record the TAP device so we can clean it up later - echo ${TAPD} >> "tap_devices_to_cleanup" - TAP=${TAPD} } -cleanup_sysrc() +atf_init_test_cases() { - for var in `cat "sysrc_vars_to_cleanup"`; do - sysrc -x $var - done + atf_add_test_case static_ipv4_loopback_route_for_each_fib + atf_add_test_case static_ipv6_loopback_route_for_each_fib } -cleanup_tap() -{ - for TAPD in `cat "tap_devices_to_cleanup"`; do - ifconfig ${TAPD} destroy - done -} From owner-svn-src-head@freebsd.org Fri May 27 22:42:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1812B4D91A; Fri, 27 May 2016 22:42:26 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3DD61FED; Fri, 27 May 2016 22:42:26 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) id <0O7U00H00XF6FX00@mr11p00im-asmtp004.me.com>; Fri, 27 May 2016 22:42:26 +0000 (GMT) Received: from [172.17.133.77] (dip-cali.panasas.com [64.80.217.3]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O7U001HEXQORN30@mr11p00im-asmtp004.me.com>; Fri, 27 May 2016 22:42:25 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-05-27_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1605270256 User-Agent: Microsoft-MacOutlook/f.16.0.160506 Date: Fri, 27 May 2016 15:42:48 -0700 Subject: Re: svn commit: r300880 - in head: . sys/cam/scsi From: Ravi Pokala Sender: "Pokala, Ravi" To: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <10C4BDB3-3BBD-4354-8CE7-70F7305DFAE4@panasas.com> Thread-topic: svn commit: r300880 - in head: . sys/cam/scsi References: <201605272226.u4RMQhRV084033@repo.freebsd.org> In-reply-to: <201605272226.u4RMQhRV084033@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1464388946; bh=b/NNb5NaNrfzdzWnN6LOZ9fKLMch1zSDuWzqXR8FspQ=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=VNogwPKm8bq35onUJ6F8jTnh3ajgEbPZd36A+2TJXYYAoryO9TolHwTHiWUeR1HqD Hwyswav52Moa8e9qfqeQqKZ+udHcYQbHCteC8OjXNqKSmeIklnhgPzWeJeSYPA1kk1 aM0l5jzoDpDdOI8p1T7jazDClMdYWeq4ZIHRvgRWfEzPE10948woCItiuW5Ejzl5mH QxV0QIb1kMk3q+k5zLQDHAeQ+KmhOf2aCtqBruS4Ao6Zz+P2Br6l0BHeQjTMqM39OI DnbpVEAti6Bter/fNbnANHjMupdF80IQAvML2P3CHBSlCCL0SQ1oGZqiXQQpUbH0uo yEsqNBw5ElYnw== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:42:26 -0000 -----Original Message----- From: on behalf of Alan Somers Date: 2016-05-27, Friday at 15:26 To: , , Subject: svn commit: r300880 - in head: . sys/cam/scsi >Author: asomers >Date: Fri May 27 22:26:43 2016 >New Revision: 300880 >URL: https://svnweb.freebsd.org/changeset/base/300880 > >Log: > Strip leading spaces off of a SCSI disk's serial number > >Modified: head/UPDATING >============================================================================== >--- head/UPDATING Fri May 27 22:16:46 2016 (r300879) >+++ head/UPDATING Fri May 27 22:26:43 2016 (r300880) >@@ -31,6 +31,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > >+20160527: >+ CAM will now strip leading spaces from SCSI disks' serial numbers. >+ This will effect users who create UFS filesystems on SCSI disks using >+ those disk's diskid device nodes. For example, if /etc/fstab >+ previously contained a line like >+ "/dev/diskid/DISK-%20%20%20%20%20%20%20ABCDEFG0123456", you should >+ change it to "/dev/diskid/DISK-ABCDEFG0123456". Users of geom >+ transfers like gmirror may also be affected. ZFS users should >+ generally be fine. "geom transforms" -Ravi (rpokala@) From owner-svn-src-head@freebsd.org Fri May 27 22:44:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7151FB4D97C; Fri, 27 May 2016 22:44:34 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 412AA119C; Fri, 27 May 2016 22:44:34 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RMiXIc091585; Fri, 27 May 2016 22:44:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RMiXN8091584; Fri, 27 May 2016 22:44:33 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605272244.u4RMiXN8091584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 27 May 2016 22:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300883 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:44:34 -0000 Author: asomers Date: Fri May 27 22:44:33 2016 New Revision: 300883 URL: https://svnweb.freebsd.org/changeset/base/300883 Log: Fix typo from r300880 Reported by: rpokala MFC after: Never Sponsored by: Spectra Logic Corp Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri May 27 22:40:40 2016 (r300882) +++ head/UPDATING Fri May 27 22:44:33 2016 (r300883) @@ -38,7 +38,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 previously contained a line like "/dev/diskid/DISK-%20%20%20%20%20%20%20ABCDEFG0123456", you should change it to "/dev/diskid/DISK-ABCDEFG0123456". Users of geom - transfers like gmirror may also be affected. ZFS users should + transforms like gmirror may also be affected. ZFS users should generally be fine. 20160523: From owner-svn-src-head@freebsd.org Fri May 27 22:48:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CDC2B4D9EF; Fri, 27 May 2016 22:48:37 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 6766F132F; Fri, 27 May 2016 22:48:36 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [192.168.1.10] (unknown [192.168.1.10]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id E5F14DD15; Fri, 27 May 2016 22:48:35 +0000 (UTC) Subject: Re: svn commit: r300880 - in head: . sys/cam/scsi To: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605272226.u4RMQhRV084033@repo.freebsd.org> <10C4BDB3-3BBD-4354-8CE7-70F7305DFAE4@panasas.com> From: Allan Jude Message-ID: <66498221-ada7-0d78-c62c-b22d04fced2f@freebsd.org> Date: Fri, 27 May 2016 18:48:31 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <10C4BDB3-3BBD-4354-8CE7-70F7305DFAE4@panasas.com> 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:48:37 -0000 On 2016-05-27 18:42, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Alan Somers > Date: 2016-05-27, Friday at 15:26 > To: , , > Subject: svn commit: r300880 - in head: . sys/cam/scsi > >> Author: asomers >> Date: Fri May 27 22:26:43 2016 >> New Revision: 300880 >> URL: https://svnweb.freebsd.org/changeset/base/300880 >> >> Log: >> Strip leading spaces off of a SCSI disk's serial number >> >> Modified: head/UPDATING >> ============================================================================== >> --- head/UPDATING Fri May 27 22:16:46 2016 (r300879) >> +++ head/UPDATING Fri May 27 22:26:43 2016 (r300880) >> @@ -31,6 +31,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 >> disable the most expensive debugging functionality run >> "ln -s 'abort:false,junk:false' /etc/malloc.conf".) >> >> +20160527: >> + CAM will now strip leading spaces from SCSI disks' serial numbers. >> + This will effect users who create UFS filesystems on SCSI disks using >> + those disk's diskid device nodes. For example, if /etc/fstab >> + previously contained a line like >> + "/dev/diskid/DISK-%20%20%20%20%20%20%20ABCDEFG0123456", you should >> + change it to "/dev/diskid/DISK-ABCDEFG0123456". Users of geom >> + transfers like gmirror may also be affected. ZFS users should >> + generally be fine. Thank you. That was driving me NUTS. It made the diskid tables look horrible. -- Allan Jude From owner-svn-src-head@freebsd.org Fri May 27 22:55:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95E2DB4DB7B; Fri, 27 May 2016 22:55:11 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C1AD18D6; Fri, 27 May 2016 22:55:11 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x231.google.com with SMTP id b65so195531119oia.1; Fri, 27 May 2016 15:55:11 -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; bh=0kw4u9OUsyTJcUXsWJXcifkXEjVq22Ve8VyR6rbPeoE=; b=SxgDSXUpD/DeXWDs4CMmpSLrTh+JKjMJG8MDT13ix4gvbwE2trnZaIrG1Qj+1XMAcX dgJCikfpS1Q+fTzuskeNVgyIDBVBxPWF6pzFvmEwXAHBrNUyA8l2qy0ynat9l5CY2sAS Hy8+Atka8QbQiuGoyCuRwya9+KqMbautCJJEtIXE9OMZEIaKZdpCz2HlANTR6Gyg7qNm TbKZ6h0fOgsoWL60IGce2nUhuefeT+cx3oc9gfHHbZlNTKP1ln2lGoEPvTiJTQiJHC7Y svQYJaXvI5O5s5ZoF7rYXkVEJF0R3KALO3Hv4XQ4UimzfxfZJPSgSE14Qlvrc06SPTEK iIew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=0kw4u9OUsyTJcUXsWJXcifkXEjVq22Ve8VyR6rbPeoE=; b=FSjBpasVaJ0jaAiGh4ulomgOFzIsDrTNi+4hjhohEm3OVOdSdIC+vRID7aqYdpApNL uB8i2SZua45Bio6jEbQh6dcrdCokoda0vzexoEBY87G6OxDlSgV5F/Aets+94BecAzUT PCy8bjNvoAQcWBR/2RQu9aOh+vCciWSFPdhpmVQIDTjib8mVtDO0BIVxO7pflPOhdRYa dNZYoxxWKuRGezITzk3EKMFDfBvbeiA7pXIMjFpJwac5YLTe4E0FYc6feoTxcykk6jAN PLuiaLfgso8VTEQXWl7ZXs5Vd9h65ArZZWi8UOk/yGTdyNWzuuoAz2n30ZTUBbhu5ZuU rAzw== X-Gm-Message-State: ALyK8tLvZNlOewz1ksKk9Aw4ynu88qKbuI5DytPaPk7wl1JqIgY8yE45rq2n+ufW5xK2lV7zAFCQyjx8LzdVIQ== MIME-Version: 1.0 X-Received: by 10.202.58.134 with SMTP id h128mr11348895oia.174.1464389710822; Fri, 27 May 2016 15:55:10 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.4.200 with HTTP; Fri, 27 May 2016 15:55:10 -0700 (PDT) In-Reply-To: <66498221-ada7-0d78-c62c-b22d04fced2f@freebsd.org> References: <201605272226.u4RMQhRV084033@repo.freebsd.org> <10C4BDB3-3BBD-4354-8CE7-70F7305DFAE4@panasas.com> <66498221-ada7-0d78-c62c-b22d04fced2f@freebsd.org> Date: Fri, 27 May 2016 16:55:10 -0600 X-Google-Sender-Auth: oXLV3N5xuULxH6nmRyamINjQ8N8 Message-ID: Subject: Re: svn commit: r300880 - in head: . sys/cam/scsi From: Alan Somers To: Allan Jude Cc: "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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:55:11 -0000 On Fri, May 27, 2016 at 4:48 PM, Allan Jude wrote: > On 2016-05-27 18:42, Ravi Pokala wrote: >> >> -----Original Message----- >> From: on behalf of Alan Somers >> >> Date: 2016-05-27, Friday at 15:26 >> To: , , >> >> Subject: svn commit: r300880 - in head: . sys/cam/scsi >> >>> Author: asomers >>> Date: Fri May 27 22:26:43 2016 >>> New Revision: 300880 >>> URL: https://svnweb.freebsd.org/changeset/base/300880 >>> >>> Log: >>> Strip leading spaces off of a SCSI disk's serial number >>> >>> Modified: head/UPDATING >>> >>> ============================================================================== >>> --- head/UPDATING Fri May 27 22:16:46 2016 (r300879) >>> +++ head/UPDATING Fri May 27 22:26:43 2016 (r300880) >>> @@ -31,6 +31,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 >>> disable the most expensive debugging functionality run >>> "ln -s 'abort:false,junk:false' /etc/malloc.conf".) >>> >>> +20160527: >>> + CAM will now strip leading spaces from SCSI disks' serial >>> numbers. >>> + This will effect users who create UFS filesystems on SCSI disks >>> using >>> + those disk's diskid device nodes. For example, if /etc/fstab >>> + previously contained a line like >>> + "/dev/diskid/DISK-%20%20%20%20%20%20%20ABCDEFG0123456", you >>> should >>> + change it to "/dev/diskid/DISK-ABCDEFG0123456". Users of geom >>> + transfers like gmirror may also be affected. ZFS users should >>> + generally be fine. > > > Thank you. That was driving me NUTS. It made the diskid tables look > horrible. > > -- > Allan Jude You're very welcome. And please let me know if it causes any problems. From owner-svn-src-head@freebsd.org Fri May 27 22:56:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C031B4DBDF; Fri, 27 May 2016 22:56:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B90D1A81; Fri, 27 May 2016 22:56:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RMu05U095194; Fri, 27 May 2016 22:56:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RMu0hB095192; Fri, 27 May 2016 22:56:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605272256.u4RMu0hB095192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 27 May 2016 22:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300884 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:56:01 -0000 Author: ngie Date: Fri May 27 22:56:00 2016 New Revision: 300884 URL: https://svnweb.freebsd.org/changeset/base/300884 Log: Fix up r300870 The sys/types.h fix I proposed was only tested with zfs(4), not with libzpool, which is where the build failure actually existed Remove vm/vm_pageout.h from arc.c and zfs_vnops.c because they're both unneeded MFC after: 1 week X-MFC with: r300865, r300870 In collaboration with: kib Submitted by: alc Sponsored by: EMC / Isilon Storage Division Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri May 27 22:44:33 2016 (r300883) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri May 27 22:56:00 2016 (r300884) @@ -120,7 +120,6 @@ * - ARC header release, as it removes from L2ARC buflists */ -#include #include #include #include @@ -141,7 +140,6 @@ #include #include -#include #include #ifdef illumos 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 May 27 22:44:33 2016 (r300883) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri May 27 22:56:00 2016 (r300884) @@ -75,7 +75,6 @@ #include #include #include -#include /* * Programming rules. From owner-svn-src-head@freebsd.org Fri May 27 22:57:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE625B4DC3F; Fri, 27 May 2016 22:57:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99E4C1C43; Fri, 27 May 2016 22:57:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id 62so1426063pfd.1; Fri, 27 May 2016 15:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=YccqY1IEqQsuIdUzYn2uG2H0xH/tQe7c478rXXgpUo8=; b=PiEaR3fRSyLXBDupunuxsQTrPPdMfPdLfXMEO8xj4JXQKV1N9Q+QR3xvcVqAYbiRoA FgrTUuK0UfB5SJ8RXRi+EXDI7UWm2o/97NipeSgAs1gszJRWfAA2X29C2fpTbGQx0QKG hotO41FhAiNHMVcusQw92vJMFMQ7A5oXtbZqBiuQmJ2buHFrzr/4cqIgxKtCkEqHxH1e Tn/BfzxfwxhZhsux8hbsQDRMEGr49TAo/DkBW07BlpaXA+z08BN+/cnO4kJznUHSSeCO iu5yNzKH/I5wb1gnIAi3UiZBYNNuMp2WOPL25s/W7rJrQgnOOMCLT4eSAFRqyeKz0nJM LbOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=YccqY1IEqQsuIdUzYn2uG2H0xH/tQe7c478rXXgpUo8=; b=nFt2Yrw3QOmuhg2q4O/Xgd6iuKRq4QgwJqJm0eOCbLywFibyda1//TBnF4lqA1E3Uc UmT4LNS7f9kVNIdmLmp/oDujAyV+GGDI1SAEoYBiEXbrmB5TyYUMe4ZrxS7pfq5I4tN4 5fK+njoS+nxr1XFaMu6Rkfp8lHEpmLuBbvHBPRplqofIdHIKTtv+swgDsGm46XeZZoOy vOQtlnA/OMxpUDMUgBwFMk4x8fItBSTvH2Ru+7HxRKV/VINnL4j13D4XBLnoL1g7h1A6 oY7/63w6zet8JDY40y4cnsNLn4PPgnlGAGCWtona6Njgh81Ht2LI47gS+CoSNEINySel 1gJw== X-Gm-Message-State: ALyK8tJWQ71ObHlS8wsPJwALZcU7yqAAPU2Sx+/Ur5L1OWD6UakS/MxqpOC3jrKFL+UjiA== X-Received: by 10.98.92.71 with SMTP id q68mr26356273pfb.138.1464389823178; Fri, 27 May 2016 15:57:03 -0700 (PDT) Received: from pinklady.local (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id s8sm30535886pav.39.2016.05.27.15.57.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 May 2016 15:57:02 -0700 (PDT) Subject: Re: svn commit: r300865 - in head/sys: sys vm Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_5782A031-C2BB-4825-9930-E99BEE25BAE5"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20160527223942.GS38613@kib.kiev.ua> Date: Fri, 27 May 2016 15:57:00 -0700 Cc: Alan Cox , Ivan Klymenko , Alan Cox , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <0A87E70A-AEDE-47F8-AC92-6A93DD1D02FA@gmail.com> References: <201605271915.u4RJFkEl013139@repo.freebsd.org> <20160527225103.67ae3547@nonamehost.local> <20160527210148.GR38613@kib.kiev.ua> <016BEE0D-05B6-4042-8CD4-471D4D1C9162@gmail.com> <3018B8E4-5E33-49EF-8154-D7D5ECEE8403@gmail.com> <5CAD8DF0-0D56-4EBD-AB93-645B21E3792D@gmail.com> <4318dffc-fef5-2128-74c2-0e97767b36c8@rice.edu> <05E6AFC6-E7B4-45E9-8E5B-C2CDA439D33B@gmail.com> <20160527223942.GS38613@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 22:57:03 -0000 --Apple-Mail=_5782A031-C2BB-4825-9930-E99BEE25BAE5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 27, 2016, at 15:39, Konstantin Belousov = wrote: >=20 > On Fri, May 27, 2016 at 03:32:48PM -0700, Ngie Cooper (yaneurabeya) = wrote: >>=20 >>> On May 27, 2016, at 14:26, Alan Cox wrote: >>>=20 >>> On 05/27/2016 16:22, Ngie Cooper (yaneurabeya) wrote: >>>>> On May 27, 2016, at 14:21, Ngie Cooper (yaneurabeya) = wrote: >>>>>> I added #include to zfs/arc.c in r300870 ??? it = was missing from the file. Looking into drm2 and fed. >>>>> Oy. Bad test before I did the fix. The issue was libzpool -_- = (just saw alc???s comment)??? I???ll fix my commit.. >>>> Actually, I???ll just revert my commit and report back about = whether or not your patch worked kib. >>>=20 >>>=20 >>> Revert and remove the vm_pageout.h #include from arc.c. >>=20 >> Confirmed. Reverting r300870 and applying kib???s diff passes = buildworld. Please commit the patch. >=20 > There was Alan' suggestion to remove vm_pageout.h at all. >=20 > Either way, commit my patch, or preferrably Alan' suggested changes = yourself. I double-checked alc=E2=80=99s suggestion and it passed = buildworld/buildkernel with ZFS on. I committed his proposed change in = r300884. Thank you very much for the help, -Ngie --Apple-Mail=_5782A031-C2BB-4825-9930-E99BEE25BAE5 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 iQIcBAEBCgAGBQJXSNC8AAoJEPWDqSZpMIYVcnIQAIwK+ivpkenxOz0yCT+/RfjC 86uZ0dNT6funS00n1cNFnmeR55D6BFoR9Xeku1m9XR5U3Z6hn8Pyrxy7a9Vd5kDf 6oMlhg8PCNonrhXZ08SfxmDRRugCf8u7z0g4cSpSVmAlIIE8AQjmYi15JaacSQmH CV+m1Xknd5Zi3/EZJ+nJhHGysHerN31jXFJTqhpXcYeSmyUf9VvdXTRhbnF+/zGw fubMO58yGn+EEBDX6EeuHndOmeSS89zXJlF7xGSqPAbODNhRRTXi/gbCrNjv8Du9 KNIHmXe5MOnWPg8AL3ZQdWo6gfrEcaRV2A47rU8q9UTOa/jQ0HsTGMm6/fMcTRpg a5UyMz/0udUNawvckWaOyBUAjInrlZ50n9AzfNS9VWsb3qr3LRaG2xBMeKqxKh0+ SuNfZqYMaS4q/wAHwq1OhQuw26Hb7B9ObQKwWlNzdCh9YZw42FJELlDt7lTNL1bQ fxuNHvuVm1IwEX8XHczeGtvmdzRyjKfr4NKNiN+8C2EeCDlH0s6TZ+bS1k+Hi2Vb YSPPCxM9NYWN3SiqhVN91CNUzfqXi0zjOENiUtD/l2yCjoi2glmd8CKRxsgwiVIk pUR2dXAWaBFfxsM97hfcSVOBybsawQ6ZbFKerJFa2nkONx6N9B3OxsQqaboVsLZY IZL9GhzozCfLQaLaKRmC =p4PG -----END PGP SIGNATURE----- --Apple-Mail=_5782A031-C2BB-4825-9930-E99BEE25BAE5-- From owner-svn-src-head@freebsd.org Fri May 27 23:03:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 217C9B4DDA7; Fri, 27 May 2016 23:03:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF3781104; Fri, 27 May 2016 23:03:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RN3TZN099058; Fri, 27 May 2016 23:03:29 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RN3Tx6099057; Fri, 27 May 2016 23:03:29 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605272303.u4RN3Tx6099057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 27 May 2016 23:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300885 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 23:03:30 -0000 Author: bdrewery Date: Fri May 27 23:03:28 2016 New Revision: 300885 URL: https://svnweb.freebsd.org/changeset/base/300885 Log: Libcompat: Only pass -isystem =/usr/include for external GCC. This is the same as the main build logic. GCC with a cross-compiler requires using -isystem to =/usr/include to get the search order correct. Reported by: dim, asomers Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Fri May 27 22:56:00 2016 (r300884) +++ head/Makefile.libcompat Fri May 27 23:03:28 2016 (r300885) @@ -72,10 +72,9 @@ LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \ # -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for # Clang/GCC. LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} +.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc # GCC requires -isystem when using a cross-compiler. LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include - -.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc # Force using libc++ for external GCC. LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++ From owner-svn-src-head@freebsd.org Fri May 27 23:03:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C6A1B4DDE0; Fri, 27 May 2016 23:03:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E277E125E; Fri, 27 May 2016 23:03:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RN3jcV099115; Fri, 27 May 2016 23:03:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RN3iOR099110; Fri, 27 May 2016 23:03:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605272303.u4RN3iOR099110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 27 May 2016 23:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300886 - in head: . lib/libc++ lib/libcxxrt 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 23:03:46 -0000 Author: bdrewery Date: Fri May 27 23:03:44 2016 New Revision: 300886 URL: https://svnweb.freebsd.org/changeset/base/300886 Log: Move external GCC compiler hacks to bsd.sys.mk. This allows respecting -nostdinc, -nostdinc++ and -nostdlib before making the decision to add in -isystem, etc. The -isystem flags are problematic for building lib/libc++ and lib/libcxxrt which wants to only use its own headers. More information the need of these flags can be found at https://gcc.gnu.org/ml/gcc/2016-03/msg00219.html This also reverts r300873. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/Makefile.libcompat head/lib/libc++/Makefile head/lib/libcxxrt/Makefile head/share/mk/bsd.sys.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri May 27 23:03:28 2016 (r300885) +++ head/Makefile.inc1 Fri May 27 23:03:44 2016 (r300886) @@ -527,19 +527,12 @@ TARGET_ABI= gnueabihf TARGET_ABI= gnueabi .endif .endif -.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc -# GCC requires -isystem and -L when using a cross-compiler. -XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib -# Force using libc++ for external GCC. -XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ - -nostdinc++ -L${WORLDTMP}/../lib/libc++ -.else +.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == "clang" TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XCFLAGS+= -target ${TARGET_TRIPLE} .endif XCFLAGS+= --sysroot=${WORLDTMP} -.else .endif # ${MK_CROSS_COMPILER} == "no" .if !empty(BFLAGS) Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Fri May 27 23:03:28 2016 (r300885) +++ head/Makefile.libcompat Fri May 27 23:03:44 2016 (r300886) @@ -72,13 +72,6 @@ LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \ # -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for # Clang/GCC. LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} -.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc -# GCC requires -isystem when using a cross-compiler. -LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include -# Force using libc++ for external GCC. -LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ - -nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++ -.endif # Yes, the flags are redundant. LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${LIBCOMPAT_OBJTREE} \ Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Fri May 27 23:03:28 2016 (r300885) +++ head/lib/libc++/Makefile Fri May 27 23:03:44 2016 (r300886) @@ -63,7 +63,7 @@ cxxrt_${_S}: ${_LIBCXXRTDIR}/${_S} .NOME .endfor WARNS= 0 -CFLAGS+= -isystem ${HDRDIR} -isystem ${_LIBCXXRTDIR} -nostdinc++ -nostdlib -DLIBCXXRT +CFLAGS+= -I${HDRDIR} -I${_LIBCXXRTDIR} -nostdinc++ -nostdlib -DLIBCXXRT .if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=c++11 .endif Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Fri May 27 23:03:28 2016 (r300885) +++ head/lib/libcxxrt/Makefile Fri May 27 23:03:44 2016 (r300886) @@ -21,7 +21,7 @@ SRCS+= libelftc_dem_gnu3.c\ guard.cc WARNS= 0 -CFLAGS+= -isystem ${SRCDIR} -nostdinc++ +CFLAGS+= -I${SRCDIR} -nostdinc++ .if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=c++11 .endif Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri May 27 23:03:28 2016 (r300885) +++ head/share/mk/bsd.sys.mk Fri May 27 23:03:44 2016 (r300886) @@ -178,6 +178,32 @@ ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} CFLAGS+= ${CFLAGS.${.IMPSRC:T}} CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} +# Special handling for external GCC. +.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == "gcc" +# GCC's --sysroot support for a cross-compiler without a default +# TARGET_SYSTEM_ROOT does not add sysroot/usr/include in or the C++ +# include path of sysroot/usr/include/c++/v1. They need to be added in +# when not using -nostdinc/-nostdinc++. This is not a problem with a +# non-cross-compiler external GCC or the in-tree cross-compiler GCC which +# has a default TARGET_SYSTEM_ROOT. +.if ${CC:M--sysroot=*} || ${CFLAGS:M--sysroot=*} +.if ${CFLAGS:M-nostdinc} == "" +CFLAGS+= -isystem =/usr/include +.endif +# Add in sysroot/usr/lib to ensure that it comes before /usr/local/lib +# from ports compilers. +LDFLAGS+= -L=/usr/lib +# We want to force building the system with our in-tree libc++. Note that +# this also requires a symlink in OBJDIR/lib/libc++/libstdc++.so to +# sysroot/usr/lib/libc++.so. +.if ${CXXFLAGS:M-nostdinc++} == "" && ${CXXFLAGS:M-nostdlib} == "" +CXXFLAGS+= -std=c++11 \ + -nostdinc++ -isystem =/usr/include/c++/v1 +LDFLAGS+= -L${OBJTOP}/lib/libc++ +.endif +.endif # --sysroot +.endif # X_COMPILER_TYPE == gcc + .if defined(SRCTOP) # Prevent rebuilding during install to support read-only objdirs. .if !make(all) && make(install) && empty(.MAKE.MODE:Mmeta) From owner-svn-src-head@freebsd.org Fri May 27 23:04:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7E36B4DE29; Fri, 27 May 2016 23:04:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A3D6F143B; Fri, 27 May 2016 23:04:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 92395150D; Fri, 27 May 2016 23:04:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 4372C1C75E; Fri, 27 May 2016 23:04:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id WNoLc-9psR8D; Fri, 27 May 2016 23:03:57 +0000 (UTC) Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com EAFBC1C755 To: Alan Somers , Dimitry Andric References: <201605261852.u4QIqn5w073953@repo.freebsd.org> <403f6f39-85e2-aa5f-0ca1-beba256a88e8@FreeBSD.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Fri, 27 May 2016 16:04:00 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <403f6f39-85e2-aa5f-0ca1-beba256a88e8@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OBWVEbi9TJX1QP2oH4r00ahIiULwEM4xt" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 23:04:04 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OBWVEbi9TJX1QP2oH4r00ahIiULwEM4xt Content-Type: multipart/mixed; boundary="gpt0xPkiXTuESU1pRCPOi5R6pBGcfpgpC" From: Bryan Drewery To: Alan Somers , Dimitry Andric Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... References: <201605261852.u4QIqn5w073953@repo.freebsd.org> <403f6f39-85e2-aa5f-0ca1-beba256a88e8@FreeBSD.org> In-Reply-To: <403f6f39-85e2-aa5f-0ca1-beba256a88e8@FreeBSD.org> --gpt0xPkiXTuESU1pRCPOi5R6pBGcfpgpC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/27/2016 12:18 PM, Bryan Drewery wrote: > On 5/27/2016 12:09 PM, Alan Somers wrote: >> On Fri, May 27, 2016 at 10:19 AM, Dimitry Andric wro= te: >>> On 27 May 2016, at 18:01, Alan Somers wrote: >>>> >>>> On Fri, May 27, 2016 at 9:42 AM, Dimitry Andric wr= ote: >>> ... >>>>> My guess is that either ${MAKEOBJDIRPREFIX}/usr/include/c++/v1 need= s to >>>>> be added to the C++ include path, or some other path in the list is= >>>>> missing, at least for C++ compilation. >>>>> >>>>> -Dimitry >>>> >>>> Here it is. It looks right to me; >>>> $MAKEOBJDIRPREFIX/home/asomers/freebsd/head/lib32/usr/include/c++/v1= >>>> is in the path, and stddef.h exists in that directory. >>>> >>>> $ c++ -v -m32 -DCOMPAT_32BIT -march=3Di686 -mmmx -msse -msse2 >>>> -L/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32= >>>> --sysroot=3D/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32= >>>> -B/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/lib32= >>>> -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/us= r/include >>>> -O2 -pipe -MD -MF.depend.consumer.o -MTconsumer.o >>>> -fstack-protector-strong -Wsystem-headers -Werror -Wall >>>> -Wno-format-y2k -W -Wno-unused-parameter -Wpointer-arith >>>> -Wno-uninitialized -Wno-empty-body -Wno-string-plus-int >>>> -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-val= ue >>>> -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion >>>> -Wno-unused-local-typedef -Qunused-arguments -Wno-c++11-extensions >>>> -c /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc -o consumer= =2Eo >>>> FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based o= n >>>> LLVM 3.8.0) >>>> Target: i386-unknown-freebsd11.0 >>>> Thread model: posix >>>> InstalledDir: /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp= /usr/bin >>>> "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/c++"= >>>> -cc1 -triple i386-unknown-freebsd11.0 -emit-obj -disable-free >>>> -main-file-name consumer.cc -mrelocation-model static -mthread-model= >>>> posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases >>>> -target-cpu i686 -target-feature +mmx -target-feature +sse >>>> -target-feature +sse2 -v -dwarf-column-info -debugger-tuning=3Dgdb >>>> -coverage-file /scratch/tmp/asomers/obj/home/asomers/freebsd/head/wo= rld32/home/asomers/freebsd/head/lib/libdevdctl/consumer.o >>>> -resource-dir /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp= /usr/bin/../lib/clang/3.8.0 >>>> -dependency-file .depend.consumer.o -sys-header-deps -MT consumer.o >>>> -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/us= r/include >>>> -D COMPAT_32BIT -isysroot >>>> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 >>>> -internal-isystem >>>> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include= /c++/v1 >>>> -O2 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W >>>> -Wno-unused-parameter -Wpointer-arith -Wno-uninitialized >>>> -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable >>>> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equalit= y >>>> -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef >>>> -Wno-c++11-extensions -fdeprecated-macro -fdebug-compilation-dir >>>> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/world32/home/asom= ers/freebsd/head/lib/libdevdctl >>>> -ferror-limit 19 -fmessage-length 80 -stack-protector 2 >>>> -fobjc-runtime=3Dgnustep -fcxx-exceptions -fexceptions >>>> -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops >>>> -vectorize-slp -o consumer.o -x c++ >>>> /home/asomers/freebsd/head/lib/libdevdctl/consumer.cc >>>> clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target >>>> x86_64-unknown-freebsd11.0 >>>> ignoring duplicate directory >>>> "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/includ= e" >>>> #include "..." search starts here: >>>> #include <...> search starts here: >>>> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include= >>>> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include= /c++/v1 >>>> /scratch/tmp/asomers/obj/home/asomers/freebsd/head/tmp/usr/bin/../li= b/clang/3.8.0/include >>>> End of search list. >>> >>> The problem appears to be that the .../usr/include/c++/v1 directory >>> should come *before* the .../usr/include directory, otherwise the >>> #include_next<> logic will not work as expected. >>> >>> This is most likely caused by the option: >>> >>> -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/u= sr/include >>> >>> because that forces this path to become before any auto-detected syst= em >>> include directory. Note that this option is not needed, since the ot= her >>> option: >>> >>> --sysroot=3D/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib3= 2 >>> >>> is already taking care of adding the right include directories. It e= ven >>> warns about the duplicate directory: >>> >>> ignoring duplicate directory >>> "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/inclu= de" >>> >>> So what happens if you delete the -isystem option and its argument? >>> >>> -Dimitry >>> >> >> If I take out -isystem, it compiles successfully. >> >=20 > I'm looking at this more now. I added that -isystem in, but it should > have only been there for external GCC usage from first glance. >=20 It should all be fixed now after r300886. --=20 Regards, Bryan Drewery --gpt0xPkiXTuESU1pRCPOi5R6pBGcfpgpC-- --OBWVEbi9TJX1QP2oH4r00ahIiULwEM4xt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXSNJgAAoJEDXXcbtuRpfPTJQIAMDz7v/rUf4SuxAyEBlsLqj0 RJEpnJdNB+GfIUNaZJvBUvrruG33J9Ddj0rV8/fmdC8lrLOh61R8jfAWmYYtZVcv Sih+8z3ckBJecVpmoALr0JVVtm4nc5OrMgmXW8mtYyty558JJQ5AXI66ePuJEFHD Ps6Sp0hdBghvGIRsWofS/tlcyjjoZj39YHTdSZ/oPVex8su/s/xzGUjtwAUYGxGe Q9GP0GHMUcOeKymj+OY5jgxBqYv6TgOpXnYoKs9NEa6elgRVGyetfDMWm2YQliKL H11l6IspJovYMoFvbvxhweb5hhUzKE46TSzRX3YsrfdpD2oBOcWPyg2V1F5iVP4= =1XgX -----END PGP SIGNATURE----- --OBWVEbi9TJX1QP2oH4r00ahIiULwEM4xt-- From owner-svn-src-head@freebsd.org Fri May 27 23:44:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEE9EB4D7BF; Fri, 27 May 2016 23:44:34 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC58519FA; Fri, 27 May 2016 23:44:34 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RNiXeI013664; Fri, 27 May 2016 23:44:33 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RNiX5P013663; Fri, 27 May 2016 23:44:33 GMT (envelope-from np@FreeBSD.org) Message-Id: <201605272344.u4RNiX5P013663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 27 May 2016 23:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300888 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 23:44:35 -0000 Author: np Date: Fri May 27 23:44:33 2016 New Revision: 300888 URL: https://svnweb.freebsd.org/changeset/base/300888 Log: iw_cxgbe: Plug a lock leak in process_mpa_request(). If the parent is DEAD or connect_request_upcall() fails, the parent mutex is left locked. This leads to a hang when process_mpa_request() is called again for another child of the listening endpoint. Submitted by: Krishnamraju Eraparaju @ Chelsio Obtained from: upstream iw_cxgb4 Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Fri May 27 23:15:58 2016 (r300887) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Fri May 27 23:44:33 2016 (r300888) @@ -1861,14 +1861,16 @@ process_mpa_request(struct c4iw_ep *ep) /* drive upcall */ mutex_lock(&ep->parent_ep->com.mutex); if (ep->parent_ep->com.state != DEAD) { - if(connect_request_upcall(ep)) - goto err_out; - }else { - goto err_out; - } + if (connect_request_upcall(ep)) + goto err_unlock_parent; + } else + goto err_unlock_parent; mutex_unlock(&ep->parent_ep->com.mutex); return 0; +err_unlock_parent: + mutex_unlock(&ep->parent_ep->com.mutex); + goto err_out; err_stop_timer: STOP_EP_TIMER(ep); err_out: From owner-svn-src-head@freebsd.org Fri May 27 23:49:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7162BB4DCD6; Fri, 27 May 2016 23:49:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43C581F2F; Fri, 27 May 2016 23:49:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RNnG27013876; Fri, 27 May 2016 23:49:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RNnGtk013875; Fri, 27 May 2016 23:49:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605272349.u4RNnGtk013875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 27 May 2016 23:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300889 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 23:49:17 -0000 Author: jhb Date: Fri May 27 23:49:16 2016 New Revision: 300889 URL: https://svnweb.freebsd.org/changeset/base/300889 Log: Fix taskqueue groups to work with EARLY_AP_STARTUP. In the EARLY_AP_STARTUP case the APs are already running when a taskqgroup is created, so adjust the group at the same time it is created. Sponsored by: Netflix Modified: head/sys/sys/taskqueue.h Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Fri May 27 23:44:33 2016 (r300888) +++ head/sys/sys/taskqueue.h Fri May 27 23:49:16 2016 (r300889) @@ -236,6 +236,21 @@ int taskqgroup_adjust(struct taskqgroup #define TASKQGROUP_DECLARE(name) \ extern struct taskqgroup *qgroup_##name +#ifdef EARLY_AP_STARTUP +#define TASKQGROUP_DEFINE(name, cnt, stride) \ + \ +struct taskqgroup *qgroup_##name; \ + \ +static void \ +taskqgroup_define_##name(void *arg) \ +{ \ + qgroup_##name = taskqgroup_create(#name); \ + taskqgroup_adjust(qgroup_##name, (cnt), (stride)); \ +} \ + \ +SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \ + taskqgroup_define_##name, NULL) +#else #define TASKQGROUP_DEFINE(name, cnt, stride) \ \ struct taskqgroup *qgroup_##name; \ @@ -259,6 +274,7 @@ SYSINIT(taskqgroup_adj_##name, SI_SUB_SM taskqgroup_adjust_##name, NULL); \ \ struct __hack +#endif TASKQGROUP_DECLARE(net); From owner-svn-src-head@freebsd.org Fri May 27 23:57:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5983FB4A1C9; Fri, 27 May 2016 23:57:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34464145D; Fri, 27 May 2016 23:57:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RNvhQ6017645; Fri, 27 May 2016 23:57:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RNvhGe017643; Fri, 27 May 2016 23:57:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605272357.u4RNvhGe017643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 27 May 2016 23:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300890 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 23:57:44 -0000 Author: bdrewery Date: Fri May 27 23:57:43 2016 New Revision: 300890 URL: https://svnweb.freebsd.org/changeset/base/300890 Log: exec: Cease tracing if credentials will change with the new image. This also prevents tracing to a P_INEXEC process since it could race with other processes attaching to it in filemon_event_process_exec() due to the filemon_get_proc() race of incrementing ref and then locking the filemon. With the no-P_INEXEC invariant in place the p_filemon may only be the same or NULL when trying to drop it in filemon_event_process_exec(). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6545 Modified: head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Fri May 27 23:49:16 2016 (r300889) +++ head/sys/dev/filemon/filemon.c Fri May 27 23:57:43 2016 (r300890) @@ -89,6 +89,7 @@ MALLOC_DEFINE(M_FILEMON, "filemon", "Fil struct filemon { struct sx lock; /* Lock for this filemon. */ struct file *fp; /* Output file pointer. */ + struct ucred *cred; /* Credential of tracer. */ char fname1[MAXPATHLEN]; /* Temporary filename buffer. */ char fname2[MAXPATHLEN]; /* Temporary filename buffer. */ char msgbufr[1024]; /* Output message buffer. */ @@ -125,6 +126,8 @@ filemon_release(struct filemon *filemon) */ sx_assert(&filemon->lock, SA_UNLOCKED); + if (filemon->cred != NULL) + crfree(filemon->cred); sx_destroy(&filemon->lock); free(filemon, M_FILEMON); } @@ -308,6 +311,9 @@ filemon_attach_proc(struct filemon *file KASSERT((p->p_flag & P_WEXIT) == 0, ("%s: filemon %p attaching to exiting process %p", __func__, filemon, p)); + KASSERT((p->p_flag & P_INEXEC) == 0, + ("%s: filemon %p attaching to execing process %p", + __func__, filemon, p)); if (p->p_filemon == filemon) return (0); @@ -385,8 +391,8 @@ filemon_ioctl(struct cdev *dev, u_long c /* Invalidate any existing processes already set. */ filemon_untrack_processes(filemon); - error = pget(*((pid_t *)data), PGET_CANDEBUG | PGET_NOTWEXIT, - &p); + error = pget(*((pid_t *)data), + PGET_CANDEBUG | PGET_NOTWEXIT | PGET_NOTINEXEC, &p); if (error == 0) { KASSERT(p->p_filemon != filemon, ("%s: proc %p didn't untrack filemon %p", @@ -407,7 +413,7 @@ filemon_ioctl(struct cdev *dev, u_long c static int filemon_open(struct cdev *dev, int oflags __unused, int devtype __unused, - struct thread *td __unused) + struct thread *td) { int error; struct filemon *filemon; @@ -416,6 +422,7 @@ filemon_open(struct cdev *dev, int oflag M_WAITOK | M_ZERO); sx_init(&filemon->lock, "filemon"); refcount_init(&filemon->refcnt, 1); + filemon->cred = crhold(td->td_ucred); error = devfs_set_cdevpriv(filemon, filemon_dtr); if (error != 0) Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Fri May 27 23:49:16 2016 (r300889) +++ head/sys/dev/filemon/filemon_wrapper.c Fri May 27 23:57:43 2016 (r300890) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -112,6 +113,24 @@ filemon_event_process_exec(void *arg __u filemon_output(filemon, filemon->msgbufr, len); + /* If the credentials changed then cease tracing. */ + if (imgp->newcred != NULL && + imgp->credential_setid && + priv_check_cred(filemon->cred, + PRIV_DEBUG_DIFFCRED, 0) != 0) { + /* + * It may have changed to NULL already, but + * will not be re-attached by anything else. + */ + if (p->p_filemon != NULL) { + KASSERT(p->p_filemon == filemon, + ("%s: proc %p didn't have expected" + " filemon %p", __func__, p, filemon)); + filemon_proc_drop(p); + } + } + + filemon_drop(filemon); } } From owner-svn-src-head@freebsd.org Fri May 27 23:57:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12DFFB4A1F5; Fri, 27 May 2016 23:57:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D982916DC; Fri, 27 May 2016 23:57:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RNvsMT017694; Fri, 27 May 2016 23:57:54 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RNvs6O017693; Fri, 27 May 2016 23:57:54 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605272357.u4RNvs6O017693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 27 May 2016 23:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300891 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 23:57:55 -0000 Author: bdrewery Date: Fri May 27 23:57:53 2016 New Revision: 300891 URL: https://svnweb.freebsd.org/changeset/base/300891 Log: Write to the log using the tracer's credentials. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Fri May 27 23:57:43 2016 (r300890) +++ head/sys/dev/filemon/filemon_wrapper.c Fri May 27 23:57:53 2016 (r300891) @@ -65,7 +65,7 @@ filemon_output(struct filemon *filemon, if (filemon->fp->f_type == DTYPE_VNODE) bwillwrite(); - error = fo_write(filemon->fp, &auio, curthread->td_ucred, 0, curthread); + error = fo_write(filemon->fp, &auio, filemon->cred, 0, curthread); if (error != 0) filemon->error = error; } From owner-svn-src-head@freebsd.org Fri May 27 23:57:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55120B4A229; Fri, 27 May 2016 23:57:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 230DC16F8; Fri, 27 May 2016 23:57:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RNvvpc017741; Fri, 27 May 2016 23:57:57 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RNvvLj017740; Fri, 27 May 2016 23:57:57 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605272357.u4RNvvLj017740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 27 May 2016 23:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300892 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 23:57:58 -0000 Author: bdrewery Date: Fri May 27 23:57:57 2016 New Revision: 300892 URL: https://svnweb.freebsd.org/changeset/base/300892 Log: Rename function to be less generic. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Fri May 27 23:57:53 2016 (r300891) +++ head/sys/dev/filemon/filemon.c Fri May 27 23:57:57 2016 (r300892) @@ -191,7 +191,7 @@ filemon_drop(struct filemon *filemon) #include "filemon_wrapper.c" static void -filemon_comment(struct filemon *filemon) +filemon_write_header(struct filemon *filemon) { int len; struct timeval now; @@ -383,7 +383,7 @@ filemon_ioctl(struct cdev *dev, u_long c &filemon->fp); if (error == 0) /* Write the file header. */ - filemon_comment(filemon); + filemon_write_header(filemon); break; /* Set the monitored process ID. */ From owner-svn-src-head@freebsd.org Fri May 27 23:58:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6630B4A23E; Fri, 27 May 2016 23:58:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 712FB17C6; Fri, 27 May 2016 23:58:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RNw0lp017790; Fri, 27 May 2016 23:58:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RNw0kn017789; Fri, 27 May 2016 23:58:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605272358.u4RNw0kn017789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 27 May 2016 23:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300893 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 23:58:02 -0000 Author: bdrewery Date: Fri May 27 23:58:00 2016 New Revision: 300893 URL: https://svnweb.freebsd.org/changeset/base/300893 Log: Don't truncate existing error when writing the log. Suggested by: markj MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Fri May 27 23:57:57 2016 (r300892) +++ head/sys/dev/filemon/filemon_wrapper.c Fri May 27 23:58:00 2016 (r300893) @@ -66,7 +66,7 @@ filemon_output(struct filemon *filemon, bwillwrite(); error = fo_write(filemon->fp, &auio, filemon->cred, 0, curthread); - if (error != 0) + if (error != 0 && filemon->error == 0) filemon->error = error; } From owner-svn-src-head@freebsd.org Sat May 28 00:03:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB465B4A4AA; Sat, 28 May 2016 00:03:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 954531E2F; Sat, 28 May 2016 00:03:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u4S02xtc019385 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 27 May 2016 17:02:59 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u4S02xxX019384; Fri, 27 May 2016 17:02:59 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 27 May 2016 17:02:59 -0700 From: Gleb Smirnoff To: Adrian Chadd Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r300854 - in head/sys: netinet netinet6 Message-ID: <20160528000259.GY58287@FreeBSD.org> References: <201605271731.u4RHV2oW071581@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 00:03:00 -0000 On Fri, May 27, 2016 at 02:27:45PM -0700, Adrian Chadd wrote: A> Hm, doesnt this make sense to do as part of RO_RTFREE? I agree that it looks messy, but for now we just need to fix instapanic. I will either return to this, or may be melifaro's new routing will outperform FLOWTABLE and we can delete it. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Sat May 28 00:05:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E634B4A53D; Sat, 28 May 2016 00:05:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A4091FBC; Sat, 28 May 2016 00:05:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u4S05II6019419 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 27 May 2016 17:05:19 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u4S05Ip7019418; Fri, 27 May 2016 17:05:18 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 27 May 2016 17:05:18 -0700 From: Gleb Smirnoff To: Dru Lavigne Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300864 - head/share/man/man4 Message-ID: <20160528000518.GZ58287@FreeBSD.org> References: <201605271852.u4RIqwgR005225@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605271852.u4RIqwgR005225@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 00:05:20 -0000 Dru, On Fri, May 27, 2016 at 06:52:58PM +0000, Dru Lavigne wrote: D> Log: D> Remove duplicate sentence from pfsync.8. D> D> PR: 209539 D> Submitted by: olivier@ D> Reviewed by: timmoore88@gmail.com D> Sponsored by: iXsystems D> D> Modified: D> head/share/man/man4/pfsync.4 D> D> Modified: head/share/man/man4/pfsync.4 D> ============================================================================== D> --- head/share/man/man4/pfsync.4 Fri May 27 18:45:11 2016 (r300863) D> +++ head/share/man/man4/pfsync.4 Fri May 27 18:52:58 2016 (r300864) D> @@ -189,7 +189,6 @@ vhids should be set to something higher D> the primary's. D> For example, if firewall B is the backup, its D> carp1 configuration would look like this: D> -would look like this: D> .Bd -literal -offset indent D> ifconfig_sis1_alias0="inet 192.168.0.1/24 vhid 2 pass bar advskew 100" D> .Ed This can be improved more. There is no carp1 in FreeBSD. It is remnant of OpenBSD text, where they have pseudo interfaces for carp(4). The command line is already fixed for sis1, but the text is not. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Sat May 28 00:22:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 614C7B4ACB9; Sat, 28 May 2016 00:22:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 323E71DBD; Sat, 28 May 2016 00:22:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4S0Mdoj028267; Sat, 28 May 2016 00:22:39 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4S0Mdlk028266; Sat, 28 May 2016 00:22:39 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605280022.u4S0Mdlk028266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 28 May 2016 00:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300894 - head/sys/modules/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 00:22:40 -0000 Author: gonzo Date: Sat May 28 00:22:39 2016 New Revision: 300894 URL: https://svnweb.freebsd.org/changeset/base/300894 Log: Add gpiokeys to the list of GPIO modules built only if FDT is enabled Modified: head/sys/modules/gpio/Makefile Modified: head/sys/modules/gpio/Makefile ============================================================================== --- head/sys/modules/gpio/Makefile Fri May 27 23:58:00 2016 (r300893) +++ head/sys/modules/gpio/Makefile Sat May 28 00:22:39 2016 (r300894) @@ -28,7 +28,7 @@ SUBDIR = gpiobus gpioiic gpioled gpiospi .if !empty(OPT_FDT) -SUBDIR += gpiopps +SUBDIR += gpiokeys gpiopps .endif .include From owner-svn-src-head@freebsd.org Sat May 28 00:38:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D13A4B4B01C; Sat, 28 May 2016 00:38:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A204013D9; Sat, 28 May 2016 00:38:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4S0cHDt032063; Sat, 28 May 2016 00:38:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4S0cHTS032062; Sat, 28 May 2016 00:38:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201605280038.u4S0cHTS032062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 28 May 2016 00:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300895 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 00:38:18 -0000 Author: np Date: Sat May 28 00:38:17 2016 New Revision: 300895 URL: https://svnweb.freebsd.org/changeset/base/300895 Log: cxgbe/t4_tom: Exempt RDMA connections from a TCP sanity test for now, to avoid panicking debug kernels. t4_tom does not keep track of a connection once it switches to ULP mode iWARP. If the connection falls out of ULP mode the driver/hardware seq# etc. are out of sync. A better fix would be to figure out what the current seq# are, update the driver's state, and perform all sanity checks as usual. Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat May 28 00:22:39 2016 (r300894) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat May 28 00:38:17 2016 (r300895) @@ -1417,7 +1417,11 @@ do_rx_data(struct sge_iq *iq, const stru ddp_placed = be32toh(cpl->seq) - tp->rcv_nxt; tp->rcv_nxt += len; - KASSERT(tp->rcv_wnd >= len, ("%s: negative window size", __func__)); + if (tp->rcv_wnd < len) { + KASSERT(toep->ulp_mode != ULP_MODE_RDMA, + ("%s: negative window size", __func__)); + } + tp->rcv_wnd -= len; tp->t_rcvtime = ticks; From owner-svn-src-head@freebsd.org Sat May 28 00:48:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46925B4B28A; Sat, 28 May 2016 00:48:09 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) 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 E975419CC; Sat, 28 May 2016 00:48:08 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) 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 DAC9C25D387C; Sat, 28 May 2016 00:47:59 +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 08AF6D1F7FA; Sat, 28 May 2016 00:47:59 +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 0C7EM0p-AtPi; Sat, 28 May 2016 00:47:57 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:b446:79a2:2acc:d6ee] (unknown [IPv6:fde9:577b:c1a9:4410:b446:79a2:2acc:d6ee]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 43E82D1F7F1; Sat, 28 May 2016 00:47:55 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300854 - in head/sys: netinet netinet6 From: "Bjoern A. Zeeb" In-Reply-To: <20160528000259.GY58287@FreeBSD.org> Date: Sat, 28 May 2016 00:47:51 +0000 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <1EF6F385-D12B-4956-B501-8CB8BD414E7E@lists.zabbadoz.net> References: <201605271731.u4RHV2oW071581@repo.freebsd.org> <20160528000259.GY58287@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 00:48:09 -0000 > On 28 May 2016, at 00:02 , Gleb Smirnoff wrote: >=20 > On Fri, May 27, 2016 at 02:27:45PM -0700, Adrian Chadd wrote: > A> Hm, doesnt this make sense to do as part of RO_RTFREE? >=20 > I agree that it looks messy, but for now we just need to fix = instapanic. >=20 > I will either return to this, or may be melifaro's new routing will > outperform FLOWTABLE and we can delete it. This statement makes no sense to me at this point anymore. For local connections you have cached routes; no lookup will be faster. For forwarding flowtable should not be used anyway. What you mean is that with L2 caching in the inPCB, flowtable will = become obsolete? /bz= From owner-svn-src-head@freebsd.org Sat May 28 02:14:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C554B4D471; Sat, 28 May 2016 02:14:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A8F117C3; Sat, 28 May 2016 02:14:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4S2EOCP069676; Sat, 28 May 2016 02:14:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4S2EOil069675; Sat, 28 May 2016 02:14:24 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605280214.u4S2EOil069675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 28 May 2016 02:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300896 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 02:14:25 -0000 Author: adrian Date: Sat May 28 02:14:24 2016 New Revision: 300896 URL: https://svnweb.freebsd.org/changeset/base/300896 Log: [ath] add WB335 btcoex for initial testing. This is like the WB222 coexistence (ie, "MCI", a message bus inside the chip), and it's currently a cut/paste so I can start using it to flesh out the differences with WB222. It doesn't completely /do/ bluetooth coexistence, because it turns out I need to add some contigmalloc'ed buffers to the btcoex path for this type of hardware. I'm putting this work in the "people would like to see functioning-ish btcoex before FreeBSD-11" bucket because I see this as "broken". Tested: * QCA9535 (WB335) NIC, BT + 2GHz STA Modified: head/sys/dev/ath/if_ath_btcoex.c Modified: head/sys/dev/ath/if_ath_btcoex.c ============================================================================== --- head/sys/dev/ath/if_ath_btcoex.c Sat May 28 00:38:17 2016 (r300895) +++ head/sys/dev/ath/if_ath_btcoex.c Sat May 28 02:14:24 2016 (r300896) @@ -252,7 +252,69 @@ ath_btcoex_cfg_wb222(struct ath_softc *s return (0); } +/* + * Initial QCA9565 / (WB335B) bluetooth coexistence settings, + * just for experimentation. + * + * Return 0 for OK; errno for error. + */ +static int +ath_btcoex_cfg_wb335b(struct ath_softc *sc) +{ + HAL_BT_COEX_INFO btinfo; + HAL_BT_COEX_CONFIG btconfig; + struct ath_hal *ah = sc->sc_ah; + + if (! ath_hal_btcoex_supported(ah)) + return (EINVAL); + + bzero(&btinfo, sizeof(btinfo)); + bzero(&btconfig, sizeof(btconfig)); + + device_printf(sc->sc_dev, "Enabling WB335B BTCOEX\n"); + btinfo.bt_module = HAL_BT_MODULE_JANUS; /* XXX not used? */ + btinfo.bt_coex_config = HAL_BT_COEX_CFG_MCI; + + /* + * MCI uses a completely different interface to speak + * to the bluetooth module - it's a command based + * thing over a serial line, rather than + * state pins to/from the bluetooth module. + * + * So, the GPIO configuration, polarity, etc + * doesn't matter on MCI devices; it's just + * completely ignored by the HAL. + */ + btinfo.bt_gpio_bt_active = 4; + btinfo.bt_gpio_bt_priority = 8; + btinfo.bt_gpio_wlan_active = 5; + + btinfo.bt_active_polarity = 1; /* XXX not used */ + btinfo.bt_single_ant = 0; /* 2 antenna on WB335 */ + btinfo.bt_isolation = 0; /* in dB, not used */ + + ath_hal_btcoex_set_info(ah, &btinfo); + + btconfig.bt_time_extend = 0; + btconfig.bt_txstate_extend = 1; /* true */ + btconfig.bt_txframe_extend = 1; /* true */ + btconfig.bt_mode = HAL_BT_COEX_MODE_SLOTTED; + btconfig.bt_quiet_collision = 1; /* true */ + btconfig.bt_rxclear_polarity = 1; /* true */ + btconfig.bt_priority_time = 2; + btconfig.bt_first_slot_time = 5; + btconfig.bt_hold_rxclear = 1; /* true */ + + ath_hal_btcoex_set_config(ah, &btconfig); + + /* + * Enable antenna diversity. + */ + ath_hal_btcoex_set_parameter(ah, HAL_BT_COEX_ANTENNA_DIVERSITY, 1); + + return (0); +} #if 0 @@ -313,6 +375,8 @@ ath_btcoex_attach(struct ath_softc *sc) ret = ath_btcoex_cfg_wb222(sc); } else if (strncmp(profname, "wb225", 5) == 0) { ret = ath_btcoex_cfg_wb225(sc); + } else if (strncmp(profname, "wb335", 5) == 0) { + ret = ath_btcoex_cfg_wb335b(sc); } else { return (0); } From owner-svn-src-head@freebsd.org Sat May 28 05:17:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 073FCB4D080; Sat, 28 May 2016 05:17:27 +0000 (UTC) (envelope-from pieter@degoeje.nl) Received: from degoeje.nl (degoeje.nl [81.169.238.128]) by mx1.freebsd.org (Postfix) with ESMTP id BE3C71F11; Sat, 28 May 2016 05:17:26 +0000 (UTC) (envelope-from pieter@degoeje.nl) Received: from [130.89.165.91] (nox.student.utwente.nl [130.89.165.91]) by degoeje.nl (Postfix) with ESMTPSA id 11C3415C0035; Sat, 28 May 2016 07:09:54 +0200 (CEST) Subject: Re: svn commit: r300731 - head/sys/netinet To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605261110.u4QBAW7W099643@repo.freebsd.org> From: Pieter de Goeje Message-ID: <57492820.7080605@degoeje.nl> Date: Sat, 28 May 2016 07:09:52 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <201605261110.u4QBAW7W099643@repo.freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.0 required=3.5 tests=ALL_TRUSTED autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on degoeje.nl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 05:17:27 -0000 Hi, Replacing the bubble sort with insertion sort gives an 80% reduction in runtime on average (with randomized keys) for small partitions. If the keys are pre-sorted, insertion sort runs in linear time, and even if the keys are reversed, insertion sort is faster than bubble sort, although not by much. See below for measurements. Insertion sort tested: for (x = 1; x < size; x++) { temp = parray[x]; for( y = x; y > 0 && temp.seq < parray[y - 1].seq; y--) { parray[y] = parray[y - 1]; } parray[y] = temp; } Like bubble sort, insertion sort is O(N^2) in the worst case (reversed keys), but it is much faster on average because it is an adaptive sort unlike bubble sort. The tests were run outside of the kernel, with a proxied struct lro_mbuf_sort which consisted of a struct with seq as its only member. The benchmarks were run in isolation on the bubble/insertion sort only. I didn't have time to test this with the full radix sort, but I expect that the cutoff value of 12 could be raised slightly after replacing the bubble sort. I did verify that the improvements in runtime still hold for very small number of keys (12), but I didn't include these results below. Assuming I've done my work correctly, you should be able to just drop in the code above. :-) Regards, Pieter de Goeje 10000 random keys ================= x bubble + insert +------------------------------------------------------------+ |+ | |+ x | |+ x | |+ x | |+ x x| |A |A| | +------------------------------------------------------------+ N Min Max Median Avg Stddev x 5 0.13718 0.14187 0.13724 0.138166 0.0020715164 + 5 0.02508 0.02525 0.02508 0.025114 7.6026311e-05 Difference at 95.0% confidence -0.113052 +/- 0.00213774 -81.8233% +/- 1.54723% (Student's t, pooled s = 0.00146577) 10000 pre-ordered keys ====================== x bubble + insert +------------------------------------------------------------+ |+ x| |+ x| |+ x| |+ x| |+ x| |A A| +------------------------------------------------------------+ N Min Max Median Avg Stddev x 5 0.05845 0.0585 0.05848 0.058478 1.9235384e-05 + 5 2e-05 2e-05 2e-05 2e-05 3.2155494e-13 Difference at 95.0% confidence -0.058458 +/- 1.9837e-05 -99.9658% +/- 0.0339221% (Student's t, pooled s = 1.36015e-05) 10000 reverse-ordered keys ========================== x bubble + insert +------------------------------------------------------------+ |+ | |+ | |+ x | |+ xx| |+ xx| |A MA| +------------------------------------------------------------+ N Min Max Median Avg Stddev x 5 0.06456 0.0647 0.06457 0.064598 5.8051701e-05 + 5 0.05009 0.05012 0.05009 0.0501 1.4142136e-05 Difference at 95.0% confidence -0.014498 +/- 6.16181e-05 -22.4434% +/- 0.095387% (Student's t, pooled s = 4.22493e-05) From owner-svn-src-head@freebsd.org Sat May 28 08:32:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94D3EB4D8E6; Sat, 28 May 2016 08:32:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 626541AD3; Sat, 28 May 2016 08:32:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4S8WFSO010107; Sat, 28 May 2016 08:32:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4S8WF87010106; Sat, 28 May 2016 08:32:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605280832.u4S8WF87010106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 28 May 2016 08:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300901 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 08:32:16 -0000 Author: bz Date: Sat May 28 08:32:15 2016 New Revision: 300901 URL: https://svnweb.freebsd.org/changeset/base/300901 Log: In if_attachdomain1() there does not seem to be any reason to use TRYLOCK rather than just acquire the lock, so just do that. Reviewed by: markj Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6578 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat May 28 06:24:48 2016 (r300900) +++ head/sys/net/if.c Sat May 28 08:32:15 2016 (r300901) @@ -821,8 +821,7 @@ if_attachdomain1(struct ifnet *ifp) * Since dp->dom_ifattach calls malloc() with M_WAITOK, we * cannot lock ifp->if_afdata initialization, entirely. */ - if (IF_AFDATA_TRYLOCK(ifp) == 0) - return; + IF_AFDATA_LOCK(ifp); if (ifp->if_afdata_initialized >= domain_init_status) { IF_AFDATA_UNLOCK(ifp); log(LOG_WARNING, "%s called more than once on %s\n", From owner-svn-src-head@freebsd.org Sat May 28 09:21:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72D65B4C561; Sat, 28 May 2016 09:21:42 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E7281DA6; Sat, 28 May 2016 09:21:42 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mail-io0-x229.google.com with SMTP id 190so85218316iow.1; Sat, 28 May 2016 02:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=57qUpEjowu4Kw6EsFU2qEWL0uq4+jPlC8p5aoAV7q60=; b=XwAC6IvPbgKBZtjLJUhni2M5q3fF6Qr6M/4OjMCYIgX6Yg2pMTsFtfyuptRHfCn8s1 JIAoBY7g4xBS45dPu94DU86KD+zubh992ctT4evpn9KaRH3KOS57OGi2Gj7jAmJmoepz e6nGFd1PcRk4Z5OcEOhZm5SpCjs7waZIC2sKhqs6D+YbDokIUWBANLxDDltZIq0n3TDE YAjhp3+ZjPfMyjxnOUq3kenSSVF4SpUmLHv0pwPFjW/o7Agz2z9RwUK8P9mSD001wt8Y c5rmE37DsBtON0fn/9in0PK+tLDBmGufaKAP+PVqdv5xCxEkWiOADXO+rMrLpFK1EQCU +w/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=57qUpEjowu4Kw6EsFU2qEWL0uq4+jPlC8p5aoAV7q60=; b=STJx2bN2mpJbsgWP+b/1npGK8rPwJB5TUvWBLf+7ecaDrFXaBHpkH9kFWAORlIQLDu lvIviGg+ROX2nt+1U6OOJHRse0XbbL2tfBE8p+Ufb08Dav7GVyi5nLQXw4FbOYuiA5uH dMwLfBwy3VvYCkIT7NKtNc/2TlOkG1hzZ9XRGUd5ge7aEcuNlQ7+Uka4JaybdjlMTJyM NMIPVcvmO67mRNMjhOyU01GyOQ7W4mU3bOHzZx7op5rBMB+0koMoVtuDc8uxZRuRYDQf uf2kt2QMMvhl9fGCyah/v5g0lfDbV1W/PvjjzdrE3zCx3ZwZTRtfzzERsS+lIVTJxNbe A6Og== X-Gm-Message-State: ALyK8tKgQ7HTH0LPJdsCSEgtJXB762QIFOzd2JqDMoTMnDz5aV4B3JhOy/Zh7k5ZclXdBiWJRpzOrFg7wwHjEg== MIME-Version: 1.0 X-Received: by 10.107.37.16 with SMTP id l16mr15683356iol.138.1464427301577; Sat, 28 May 2016 02:21:41 -0700 (PDT) Sender: kmacybsd@gmail.com Received: by 10.107.132.212 with HTTP; Sat, 28 May 2016 02:21:41 -0700 (PDT) In-Reply-To: <1EF6F385-D12B-4956-B501-8CB8BD414E7E@lists.zabbadoz.net> References: <201605271731.u4RHV2oW071581@repo.freebsd.org> <20160528000259.GY58287@FreeBSD.org> <1EF6F385-D12B-4956-B501-8CB8BD414E7E@lists.zabbadoz.net> Date: Sat, 28 May 2016 02:21:41 -0700 X-Google-Sender-Auth: 1D5W8coOyWHyJjjLUjjXn-xELmA Message-ID: Subject: Re: svn commit: r300854 - in head/sys: netinet netinet6 From: "K. Macy" To: "Bjoern A. Zeeb" Cc: Gleb Smirnoff , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 09:21:42 -0000 On Friday, May 27, 2016, Bjoern A. Zeeb wrote: > > > On 28 May 2016, at 00:02 , Gleb Smirnoff wrote: > > > > On Fri, May 27, 2016 at 02:27:45PM -0700, Adrian Chadd wrote: > > A> Hm, doesnt this make sense to do as part of RO_RTFREE? > > > > I agree that it looks messy, but for now we just need to fix instapanic. > > > > I will either return to this, or may be melifaro's new routing will > > outperform FLOWTABLE and we can delete it. > > This statement makes no sense to me at this point anymore. > For local connections you have cached routes; no lookup will be faster. > > For forwarding flowtable should not be used anyway. > > Flowtable does, or at least did (I don't know how much the code has been handicapped in the meantime), stateful handling of flows. Neither inpcb caching nor melifaro's routing improvements apply. Perhaps obsolete as the band aid it was being used for. What you mean is that with L2 caching in the inPCB, flowtable will become > obsolete? > > /bz > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org > " > From owner-svn-src-head@freebsd.org Sat May 28 12:38:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFD4CB4D26A for ; Sat, 28 May 2016 12:38:05 +0000 (UTC) (envelope-from dru.lavigne@att.net) Received: from nm27-vm8.bullet.mail.gq1.yahoo.com (nm27-vm8.bullet.mail.gq1.yahoo.com [98.136.216.151]) (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 B8538117D for ; Sat, 28 May 2016 12:38:05 +0000 (UTC) (envelope-from dru.lavigne@att.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=att.net; s=s1024; t=1464439084; bh=RJdJrPo8O0DTQowvn+dJYR+v9c070zX3cOZBHOVr3Bg=; h=Date:From:Reply-To:To:Cc:Subject:References:From:Subject; b=BXlZC3FjB/2knDUMbLDhSMRnLHPkTuDRHNww23XnTbnJpkZ8kQVjMHRiL7H7kkbwX5g5uhbauf/Tv9a/4leFu9Fe/hI4Hx16mbhVRbD9dMyTS3YBgVRkR7R/IYgnnBDn58RgPrTfBOn5TLQ4BXS/3L+/rr3d/EiwK5F9GScp0QI= Received: from [216.39.60.180] by nm27.bullet.mail.gq1.yahoo.com with NNFMP; 28 May 2016 12:38:04 -0000 Received: from [98.137.12.196] by tm16.bullet.mail.gq1.yahoo.com with NNFMP; 28 May 2016 12:38:04 -0000 Received: from [127.0.0.1] by omp1004.mail.gq1.yahoo.com with NNFMP; 28 May 2016 12:38:04 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 667847.90834.bm@omp1004.mail.gq1.yahoo.com X-YMail-OSG: L.Wq4McVM1kgNGRtIT7jahEUtHz4xUpmqzpf9brd1m24pSa9KsamGISxV4qQGib QvLoVPv4bPl0RqpBxtXiIa3e_6hlkBWdHcjKDVcX81C6crNDz_AB1LtwrExtp8LpwhfTkzFP2NjV SOcVMP5UT6A1P1yXUiUkL6x7HjvLMvpnbe66gKWwisVgyWglS30m5STUwVcjffr_AzSa_5qGZLie yFOcGZPN1hyDvtZkR.wSPY2h9l4zKsOAWgaKVgs8x7uGiXdH8GThBqPuIO5PgUPz7QGVYCy3Cdma IQkiZOGvLV36pFYLaUaFIyhp9xkAyvgZBnw1052XaG4Vy0rtR0YhQwmvPHJKzAkmmF1cU0FKgxcN NpYGHwwJjiwVFWJiXoAykNyUe0c6EqgTwcck._RM_jo_ZlbbWTmMx7C20WYSQJ.bvvp695kTBTXB VwUI1vLPy5JwZ6PsNWpeaTMYZ6gLAWdj0LVHmCU9eg32mN1P_3b6DabYUXBTHxs8LSrsibi61TRJ KlHSjjQE2TNS4jKJZqzqB Received: from jws10757.mail.gq1.yahoo.com by sendmailws149.mail.gq1.yahoo.com; Sat, 28 May 2016 12:38:04 +0000; 1464439084.188 Date: Sat, 28 May 2016 12:38:03 +0000 (UTC) From: Dru Lavigne Reply-To: Dru Lavigne To: Gleb Smirnoff Cc: Message-ID: <163488482.896488.1464439083817.JavaMail.yahoo@mail.yahoo.com> Subject: Re: svn commit: r300864 - head/share/man/man4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable References: <163488482.896488.1464439083817.JavaMail.yahoo.ref@mail.yahoo.com> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 12:38:06 -0000 -------------------------------------------- On Fri, 5/27/16, Gleb Smirnoff wrote: Subject: Re: svn commit: r300864 - head/share/man/man4 To: "Dru Lavigne" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@free= bsd.org Date: Friday, May 27, 2016, 8:05 PM =20 =C2=A0 Dru, =20 On Fri, May 27, 2016 at 06:52:58PM +0000, Dru Lavigne wrote: D> Log: D>=C2=A0=C2=A0=C2=A0Remove duplicate sentence from pfsync.8. D>=C2=A0=C2=A0=C2=A0 D>=C2=A0=C2=A0=C2=A0PR: 209539 D>=C2=A0=C2=A0=C2=A0Submitted by: olivier@ D>=C2=A0=C2=A0=C2=A0Reviewed by: timmoore88@gmail.com D>=C2=A0=C2=A0=C2=A0Sponsored by: iXsystems D>=20 D> Modified: D>=C2=A0=C2=A0=C2=A0head/share/man/man4/pfsync.4 D>=20 D> Modified: head/share/man/man4/pfsync.4 D> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D D> --- head/share/man/man4/pfsync.4=C2=A0=C2=A0=C2=A0 Fri May 27 18:45:11 2016=C2=A0=C2=A0=C2=A0 (r300863) D> +++ head/share/man/man4/pfsync.4=C2=A0=C2=A0=C2=A0 Fri May 27 18:52:58 2016=C2=A0=C2=A0=C2=A0 (r300864) D> @@ -189,7 +189,6 @@ vhids should be set to something higher=20 D>=C2=A0 the primary's. D>=C2=A0 For example, if firewall B is the backup, its D>=C2=A0 carp1 configuration would look like this: D> -would look like this: D>=C2=A0 .Bd -literal -offset indent D>=C2=A0 ifconfig_sis1_alias0=3D"inet 192.168.0.1/24 vhid 2 pass bar advskew 100" D>=C2=A0 .Ed =20 > This can be improved more. There is no carp1 in FreeBSD. It is remnant of= OpenBSD > text, where they have pseudo interfaces for carp(4). The > command line is already fixed for sis1, but the text is not. =20 Thanks, Gleb. I'll add that to https://reviews.freebsd.org/D6613, which is = the review Tim setup for his next edits to this man page. Cheers, Dru From owner-svn-src-head@freebsd.org Sat May 28 13:05:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26293B4DE25; Sat, 28 May 2016 13:05:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2E5913C3; Sat, 28 May 2016 13:05:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SD5eP9009323; Sat, 28 May 2016 13:05:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SD5ew7009322; Sat, 28 May 2016 13:05:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605281305.u4SD5ew7009322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 28 May 2016 13:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300902 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 13:05:41 -0000 Author: andrew Date: Sat May 28 13:05:39 2016 New Revision: 300902 URL: https://svnweb.freebsd.org/changeset/base/300902 Log: Don't panic in hwpmc when stopping sampling. When hwpmc stops sampling it will set the pm_state to something other than PMC_STATE_RUNNING. This means the following sequence can happen: CPU 0: Enter the interrupt handler CPU 0: Set the thread TDP_CALLCHAIN pflag CPU 1: Stop sampling CPU 0: Call pmc_process_samples, sampling is stopped so clears ps_nsamples CPU 0: Finishes interrupt processing with the TDP_CALLCHAIN flag set CPU 0: Call pmc_capture_user_callchain to capture the user call chain CPU 0: Find all the pmc sample are free so no call chains need to be captured CPU 0: KASSERT because of this This fixes the issue by checking if any of the samples have been stopped and including this in te KASSERT. PR: 204273 Reviewed by: bz, gnn Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6581 Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sat May 28 08:32:15 2016 (r300901) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat May 28 13:05:39 2016 (r300902) @@ -4199,6 +4199,7 @@ pmc_capture_user_callchain(int cpu, int struct pmc_samplebuffer *psb; #ifdef INVARIANTS int ncallchains; + int nfree; #endif psb = pmc_pcpu[cpu]->pc_sb[ring]; @@ -4210,6 +4211,7 @@ pmc_capture_user_callchain(int cpu, int #ifdef INVARIANTS ncallchains = 0; + nfree = 0; #endif /* @@ -4221,6 +4223,10 @@ pmc_capture_user_callchain(int cpu, int ps = psb->ps_read; ps_end = psb->ps_write; do { +#ifdef INVARIANTS + if (ps->ps_pmc->pm_state != PMC_STATE_RUNNING) + nfree++; +#endif if (ps->ps_nsamples != PMC_SAMPLE_INUSE) goto next; if (ps->ps_td != td) @@ -4256,7 +4262,7 @@ next: ps = psb->ps_samples; } while (ps != ps_end); - KASSERT(ncallchains > 0, + KASSERT(ncallchains > 0 || nfree > 0, ("[pmc,%d] cpu %d didn't find a sample to collect", __LINE__, cpu)); From owner-svn-src-head@freebsd.org Sat May 28 16:06:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D319AB4EFEE; Sat, 28 May 2016 16:06:09 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A046A18D5; Sat, 28 May 2016 16:06:09 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SG68ii077454; Sat, 28 May 2016 16:06:08 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SG68sS077445; Sat, 28 May 2016 16:06:08 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605281606.u4SG68sS077445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 28 May 2016 16:06:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300903 - in head: lib/libcrypt lib/libmd sbin/md5 sys/crypto/sha2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 16:06:09 -0000 Author: allanjude Date: Sat May 28 16:06:07 2016 New Revision: 300903 URL: https://svnweb.freebsd.org/changeset/base/300903 Log: Implement SHA-512 truncated (224 and 256 bits) This implements SHA-512/256, which generates a 256 bit hash by calculating the SHA-512 then truncating the result. A different initial value is used, making the result different from the first 256 bits of the SHA-512 of the same input. SHA-512 is ~50% faster than SHA-256 on 64bit platforms, so the result is a faster 256 bit hash. The main goal of this implementation is to enable support for this faster hashing algorithm in ZFS. The feature was introduced into ZFS in r289422, but is disconnected because SHA-512/256 support was missing. A further commit will enable it in ZFS. This is the follow on to r292782 Reviewed by: cem Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D6061 Added: head/sys/crypto/sha2/sha512t.h (contents, props changed) Modified: head/lib/libcrypt/Makefile head/lib/libmd/Makefile head/lib/libmd/sha512.3 head/lib/libmd/shadriver.c head/sbin/md5/Makefile head/sbin/md5/md5.1 head/sbin/md5/md5.c head/sys/crypto/sha2/sha512c.c Modified: head/lib/libcrypt/Makefile ============================================================================== --- head/lib/libcrypt/Makefile Sat May 28 13:05:39 2016 (r300902) +++ head/lib/libcrypt/Makefile Sat May 28 16:06:07 2016 (r300903) @@ -31,6 +31,8 @@ CFLAGS+= -I${.CURDIR} -DHAS_DES -DHAS_BL .for sym in MD4Init MD4Final MD4Update MD4Pad \ MD5Init MD5Final MD5Update MD5Pad \ SHA256_Init SHA256_Final SHA256_Update \ + SHA512_224_Init SHA512_224_Final SHA512_224_Update \ + SHA512_256_Init SHA512_256_Final SHA512_256_Update \ SHA384_Init SHA384_Final SHA384_Update \ SHA512_Init SHA512_Final SHA512_Update CFLAGS+= -D${sym}=__${sym} Modified: head/lib/libmd/Makefile ============================================================================== --- head/lib/libmd/Makefile Sat May 28 13:05:39 2016 (r300902) +++ head/lib/libmd/Makefile Sat May 28 16:06:07 2016 (r300903) @@ -9,8 +9,8 @@ SRCS= md4c.c md5c.c md4hl.c md5hl.c \ sha0c.c sha0hl.c sha1c.c sha1hl.c \ sha256c.c sha256hl.c \ sha384hl.c \ - sha512c.c sha512hl.c -INCS= md4.h md5.h ripemd.h sha.h sha256.h sha384.h sha512.h + sha512c.c sha512hl.c sha512thl.c +INCS= md4.h md5.h ripemd.h sha.h sha256.h sha384.h sha512.h sha512t.h WARNS?= 0 @@ -43,11 +43,15 @@ MLINKS+=sha512.3 SHA512_Init.3 sha512.3 MLINKS+=sha512.3 SHA512_Final.3 sha512.3 SHA512_End.3 MLINKS+=sha512.3 SHA512_File.3 sha512.3 SHA512_FileChunk.3 MLINKS+=sha512.3 SHA512_Data.3 +MLINKS+=sha512.3 SHA512_256_Init.3 sha512.3 SHA512_256_Update.3 +MLINKS+=sha512.3 SHA512_256_Final.3 sha512.3 SHA512_256_End.3 +MLINKS+=sha512.3 SHA512_256_File.3 sha512.3 SHA512_256_FileChunk.3 +MLINKS+=sha512.3 SHA512_256_Data.3 CLEANFILES+= md[245]hl.c md[245].ref md[245].3 mddriver \ rmd160.ref rmd160hl.c rmddriver \ sha0.ref sha0hl.c sha1.ref sha1hl.c shadriver \ sha256.ref sha256hl.c sha384hl.c sha384.ref \ - sha512.ref sha512hl.c + sha512.ref sha512hl.c sha512t256.ref sha512thl.c # Define WEAK_REFS to provide weak aliases for libmd symbols # @@ -107,6 +111,13 @@ sha512hl.c: mdXhl.c -e 's/SHA512__/SHA512_/g' \ ${.ALLSRC}) > ${.TARGET} +sha512thl.c: mdXhl.c + (echo '#define LENGTH 32'; \ + sed -e 's/mdX/sha512t/g' -e 's/MDX/SHA512_256_/g' \ + -e 's/SHA512_256__/SHA512_256_/g' \ + -e 's/SHA512_256_CTX/SHA512_CTX/g' \ + ${.ALLSRC}) > ${.TARGET} + rmd160hl.c: mdXhl.c (echo '#define LENGTH 20'; \ sed -e 's/mdX/ripemd/g' -e 's/MDX/RIPEMD160_/g' \ @@ -211,6 +222,21 @@ sha512.ref: @echo 'SHA-512 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ '72ec1ef1124a45b047e8b7c75a932195135bb61de24ec0d1914042246e0aec3a2354e093d76f3048b456764346900cb130d2a4fd5dd16abb5e30bcb850dee843' >> ${.TARGET} +sha512t256.ref: + echo 'SHA-512256 test suite:' > ${.TARGET} + @echo 'SHA-512256 ("") =' \ + 'c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a' >> ${.TARGET} + @echo 'SHA-512256 ("abc") =' \ + '53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23' >> ${.TARGET} + @echo 'SHA-512256 ("message digest") =' \ + '0cf471fd17ed69d990daf3433c89b16d63dec1bb9cb42a6094604ee5d7b4e9fb' >> ${.TARGET} + @echo 'SHA-512256 ("abcdefghijklmnopqrstuvwxyz") =' \ + 'fc3189443f9c268f626aea08a756abe7b726b05f701cb08222312ccfd6710a26' >> ${.TARGET} + @echo 'SHA-512256 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =' \ + 'cdf1cc0effe26ecc0c13758f7b4a48e000615df241284185c39eb05d355bb9c8' >> ${.TARGET} + @echo 'SHA-512256 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \ + '2c9fdbc0c90bdd87612ee8455474f9044850241dc105b1e8b94b8ddf5fac9148' >> ${.TARGET} + rmd160.ref: echo 'RIPEMD160 test suite:' > ${.TARGET} @echo 'RIPEMD160 ("") = 9c1185a5c5e9fc54612808977ee8f548b2258d31' >> ${.TARGET} @@ -225,7 +251,7 @@ rmd160.ref: '9b752e45573d4b39f4dbd3323cab82bf63326bfb' >> ${.TARGET} test: md4.ref md5.ref sha0.ref rmd160.ref sha1.ref sha256.ref sha384.ref \ - sha512.ref + sha512.ref sha512t256.ref @${ECHO} if any of these test fail, the code produces wrong results @${ECHO} and should NOT be used. ${CC} ${CFLAGS} ${LDFLAGS} -DMD=4 -o mddriver ${.CURDIR}/mddriver.c libmd.a @@ -254,6 +280,9 @@ test: md4.ref md5.ref sha0.ref rmd160.re ${CC} ${CFLAGS} ${LDFLAGS} -DSHA=512 -o shadriver ${.CURDIR}/shadriver.c libmd.a ./shadriver | cmp sha512.ref - @${ECHO} SHA-512 passed test + ${CC} ${CFLAGS} ${LDFLAGS} -DSHA=512256 -o shadriver ${.CURDIR}/shadriver.c libmd.a + ./shadriver | cmp sha512t256.ref - + @${ECHO} SHA-512t256 passed test -rm -f shadriver .include Modified: head/lib/libmd/sha512.3 ============================================================================== --- head/lib/libmd/sha512.3 Sat May 28 13:05:39 2016 (r300902) +++ head/lib/libmd/sha512.3 Sat May 28 16:06:07 2016 (r300903) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd October 17, 2015 +.Dd April 22, 2016 .Dt SHA512 3 .Os .Sh NAME @@ -26,7 +26,14 @@ .Nm SHA384_End , .Nm SHA384_File , .Nm SHA384_FileChunk , -.Nm SHA384_Data +.Nm SHA384_Data, +.Nm SHA512_256_Init , +.Nm SHA512_256_Update , +.Nm SHA512_256_Final , +.Nm SHA512_256_End , +.Nm SHA512_256_File , +.Nm SHA512_256_FileChunk , +.Nm SHA512_256_Data .Nd calculate the FIPS 180-4 ``SHA-512'' family of message digests .Sh LIBRARY .Lb libmd @@ -47,6 +54,7 @@ .Fn SHA512_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" .Ft "char *" .Fn SHA512_Data "const unsigned char *data" "unsigned int len" "char *buf" +.In sha384.h .Ft void .Fn SHA384_Init "SHA384_CTX *context" .Ft void @@ -61,6 +69,21 @@ .Fn SHA384_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" .Ft "char *" .Fn SHA384_Data "const unsigned char *data" "unsigned int len" "char *buf" +.In sha512t.h +.Ft void +.Fn SHA512_256_Init "SHA512_CTX *context" +.Ft void +.Fn SHA512_256_Update "SHA512_CTX *context" "const unsigned char *data" "size_t len" +.Ft void +.Fn SHA512_256_Final "unsigned char digest[32]" "SHA512_CTX *context" +.Ft "char *" +.Fn SHA512_256_End "SHA512_CTX *context" "char *buf" +.Ft "char *" +.Fn SHA512_256_File "const char *filename" "char *buf" +.Ft "char *" +.Fn SHA512_256_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length" +.Ft "char *" +.Fn SHA512_256_Data "const unsigned char *data" "unsigned int len" "char *buf" .Sh DESCRIPTION The .Li SHA512_ @@ -92,7 +115,7 @@ and finally extract the result using .Fn SHA512_End is a wrapper for .Fn SHA512_Final -which converts the return value to a 65-character +which converts the return value to a 129-character (including the terminating '\e0') .Tn ASCII string which represents the 512 bits in hexadecimal. @@ -139,22 +162,32 @@ and subsequently must be explicitly deal after use. If the .Fa buf -argument is non-null it must point to at least 65 characters of buffer space. +argument is non-null it must point to at least 129 characters of buffer space. .Pp The .Li SHA384_ +and +.Li SHA512_256_ functions are identical to the .Li SHA512_ functions except they use a different initial hash value and the output is -truncated to 384 bits. +truncated to 384 bits and 256 bits respectively. .Pp .Fn SHA384_End is a wrapper for .Fn SHA384_Final -which converts the return value to a 49-character +which converts the return value to a 97-character (including the terminating '\e0') .Tn ASCII string which represents the 384 bits in hexadecimal. +.Pp +.Fn SHA512_256_End +is a wrapper for +.Fn SHA512_Final +which converts the return value to a 65-character +(including the terminating '\e0') +.Tn ASCII +string which represents the 256 bits in hexadecimal. .Sh SEE ALSO .Xr md4 3 , .Xr md5 3 , Modified: head/lib/libmd/shadriver.c ============================================================================== --- head/lib/libmd/shadriver.c Sat May 28 13:05:39 2016 (r300902) +++ head/lib/libmd/shadriver.c Sat May 28 16:06:07 2016 (r300903) @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD$"); #include "sha256.h" #include "sha384.h" #include "sha512.h" +#include "sha512t.h" /* The following makes SHA default to SHA-1 if it has not already been * defined with C compiler flags. */ @@ -43,6 +44,9 @@ __FBSDID("$FreeBSD$"); #elif SHA == 512 #undef SHA_Data #define SHA_Data SHA512_Data +#elif SHA == 512256 +#undef SHA_Data +#define SHA_Data SHA512_256_Data #endif /* Digests a string and prints the result. */ Modified: head/sbin/md5/Makefile ============================================================================== --- head/sbin/md5/Makefile Sat May 28 13:05:39 2016 (r300902) +++ head/sbin/md5/Makefile Sat May 28 16:06:07 2016 (r300903) @@ -8,13 +8,15 @@ LINKS= ${BINDIR}/md5 ${BINDIR}/rmd160 \ ${BINDIR}/md5 ${BINDIR}/sha1 \ ${BINDIR}/md5 ${BINDIR}/sha256 \ ${BINDIR}/md5 ${BINDIR}/sha384 \ - ${BINDIR}/md5 ${BINDIR}/sha512 + ${BINDIR}/md5 ${BINDIR}/sha512 \ + ${BINDIR}/md5 ${BINDIR}/sha512t256 MLINKS= md5.1 rmd160.1 \ md5.1 sha1.1 \ md5.1 sha256.1 \ md5.1 sha384.1 \ - md5.1 sha512.1 + md5.1 sha512.1 \ + md5.1 sha512t256.1 LIBADD= md Modified: head/sbin/md5/md5.1 ============================================================================== --- head/sbin/md5/md5.1 Sat May 28 13:05:39 2016 (r300902) +++ head/sbin/md5/md5.1 Sat May 28 16:06:07 2016 (r300903) @@ -1,9 +1,9 @@ .\" $FreeBSD$ -.Dd October 17, 2015 +.Dd April 22, 2016 .Dt MD5 1 .Os .Sh NAME -.Nm md5 , sha1 , sha256 , sha384 , sha512, rmd160 +.Nm md5 , sha1 , sha256 , sha384 , sha512, sha512t256, rmd160 .Nd calculate a message-digest fingerprint (checksum) for a file .Sh SYNOPSIS .Nm md5 @@ -31,6 +31,11 @@ .Op Fl c Ar string .Op Fl s Ar string .Op Ar +.Nm sha512t256 +.Op Fl pqrtx +.Op Fl c Ar string +.Op Fl s Ar string +.Op Ar .Nm rmd160 .Op Fl pqrtx .Op Fl c Ar string @@ -38,7 +43,7 @@ .Op Ar .Sh DESCRIPTION The -.Nm md5 , sha1 , sha256 , sha384 , sha512 +.Nm md5 , sha1 , sha256 , sha384 , sha512, sha512t256 and .Nm rmd160 utilities take as input a message of arbitrary length and produce as @@ -78,8 +83,17 @@ found which is faster than a brute-force .Tn SHA-1 in doubt. .Pp -It is recommended that all new applications use +.Tn SHA-512t256 +is a version of +.Tn SHA-512 +truncated to only 256 bits. +On 64-bit hardware, this algorithm is approximately 50% faster than .Tn SHA-256 +but with the same level of security. +The hashes are not interchangeable. +.Pp +It is recommended that all new applications use +.Tn SHA-512 instead of one of the other hash functions. .Pp The following options may be used in any combination and must @@ -114,7 +128,7 @@ Run a built-in test script. .El .Sh EXIT STATUS The -.Nm md5 , sha1 , sha256 , sha512 +.Nm md5 , sha1 , sha256 , sha512, sha512t256 and .Nm rmd160 utilities exit 0 on success, Modified: head/sbin/md5/md5.c ============================================================================== --- head/sbin/md5/md5.c Sat May 28 13:05:39 2016 (r300902) +++ head/sbin/md5/md5.c Sat May 28 16:06:07 2016 (r300903) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -58,6 +59,7 @@ extern const char *SHA1_TestOutput[MDTES extern const char *SHA256_TestOutput[MDTESTCOUNT]; extern const char *SHA384_TestOutput[MDTESTCOUNT]; extern const char *SHA512_TestOutput[MDTESTCOUNT]; +extern const char *SHA512t256_TestOutput[MDTESTCOUNT]; extern const char *RIPEMD160_TestOutput[MDTESTCOUNT]; typedef struct Algorithm_t { @@ -110,6 +112,9 @@ static const struct Algorithm_t Algorith { "sha512", "SHA512", &SHA512_TestOutput, (DIGEST_Init*)&SHA512_Init, (DIGEST_Update*)&SHA512_Update, (DIGEST_End*)&SHA512_End, &SHA512_Data, &SHA512_File }, + { "sha512t256", "SHA512t256", &SHA512t256_TestOutput, (DIGEST_Init*)&SHA512_256_Init, + (DIGEST_Update*)&SHA512_256_Update, (DIGEST_End*)&SHA512_256_End, + &SHA512_256_Data, &SHA512_256_File }, { "rmd160", "RMD160", &RIPEMD160_TestOutput, (DIGEST_Init*)&RIPEMD160_Init, (DIGEST_Update*)&RIPEMD160_Update, (DIGEST_End*)&RIPEMD160_End, &RIPEMD160_Data, &RIPEMD160_File } @@ -355,6 +360,17 @@ const char *SHA512_TestOutput[MDTESTCOUN "e8a835195e039708b13d9131e025f4441dbdc521ce625f245a436dcd762f54bf5cb298d96235e6c6a304e087ec8189b9512cbdf6427737ea82793460c367b9c3" }; +const char *SHA512t256_TestOutput[MDTESTCOUNT] = { + "c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a", + "455e518824bc0601f9fb858ff5c37d417d67c2f8e0df2babe4808858aea830f8", + "53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23", + "0cf471fd17ed69d990daf3433c89b16d63dec1bb9cb42a6094604ee5d7b4e9fb", + "fc3189443f9c268f626aea08a756abe7b726b05f701cb08222312ccfd6710a26", + "cdf1cc0effe26ecc0c13758f7b4a48e000615df241284185c39eb05d355bb9c8", + "2c9fdbc0c90bdd87612ee8455474f9044850241dc105b1e8b94b8ddf5fac9148", + "dd095fc859b336c30a52548b3dc59fcc0d1be8616ebcf3368fad23107db2d736" +}; + const char *RIPEMD160_TestOutput[MDTESTCOUNT] = { "9c1185a5c5e9fc54612808977ee8f548b2258d31", "0bdc9d2d256b3ee9daae347be6f4dc835a467ffe", Modified: head/sys/crypto/sha2/sha512c.c ============================================================================== --- head/sys/crypto/sha2/sha512c.c Sat May 28 13:05:39 2016 (r300902) +++ head/sys/crypto/sha2/sha512c.c Sat May 28 16:06:07 2016 (r300903) @@ -1,5 +1,6 @@ /*- * Copyright 2005 Colin Percival + * Copyright (c) 2015 Allan Jude * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$"); #endif #include "sha512.h" +#include "sha512t.h" #include "sha384.h" #if BYTE_ORDER == BIG_ENDIAN @@ -324,6 +326,88 @@ SHA512_Final(unsigned char digest[static memset(ctx, 0, sizeof(*ctx)); } +/*** SHA-512t: *********************************************************/ +/* + * the SHA512t transforms are identical to SHA512 so reuse the existing function + */ +void +SHA512_224_Init(SHA512_CTX * ctx) +{ + + /* Zero bits processed so far */ + ctx->count[0] = ctx->count[1] = 0; + + /* Magic initialization constants */ + ctx->state[0] = 0x8c3d37c819544da2ULL; + ctx->state[1] = 0x73e1996689dcd4d6ULL; + ctx->state[2] = 0x1dfab7ae32ff9c82ULL; + ctx->state[3] = 0x679dd514582f9fcfULL; + ctx->state[4] = 0x0f6d2b697bd44da8ULL; + ctx->state[5] = 0x77e36f7304c48942ULL; + ctx->state[6] = 0x3f9d85a86a1d36c8ULL; + ctx->state[7] = 0x1112e6ad91d692a1ULL; +} + +void +SHA512_224_Update(SHA512_CTX * ctx, const void *in, size_t len) +{ + + SHA512_Update(ctx, in, len); +} + +void +SHA512_224_Final(unsigned char digest[static SHA512_224_DIGEST_LENGTH], SHA512_CTX * ctx) +{ + + /* Add padding */ + SHA512_Pad(ctx); + + /* Write the hash */ + be64enc_vect(digest, ctx->state, SHA512_224_DIGEST_LENGTH); + + /* Clear the context state */ + memset(ctx, 0, sizeof(*ctx)); +} + +void +SHA512_256_Init(SHA512_CTX * ctx) +{ + + /* Zero bits processed so far */ + ctx->count[0] = ctx->count[1] = 0; + + /* Magic initialization constants */ + ctx->state[0] = 0x22312194fc2bf72cULL; + ctx->state[1] = 0x9f555fa3c84c64c2ULL; + ctx->state[2] = 0x2393b86b6f53b151ULL; + ctx->state[3] = 0x963877195940eabdULL; + ctx->state[4] = 0x96283ee2a88effe3ULL; + ctx->state[5] = 0xbe5e1e2553863992ULL; + ctx->state[6] = 0x2b0199fc2c85b8aaULL; + ctx->state[7] = 0x0eb72ddc81c52ca2ULL; +} + +void +SHA512_256_Update(SHA512_CTX * ctx, const void *in, size_t len) +{ + + SHA512_Update(ctx, in, len); +} + +void +SHA512_256_Final(unsigned char digest[static SHA512_256_DIGEST_LENGTH], SHA512_CTX * ctx) +{ + + /* Add padding */ + SHA512_Pad(ctx); + + /* Write the hash */ + be64enc_vect(digest, ctx->state, SHA512_256_DIGEST_LENGTH); + + /* Clear the context state */ + memset(ctx, 0, sizeof(*ctx)); +} + /*** SHA-384: *********************************************************/ /* * the SHA384 and SHA512 transforms are identical, so SHA384 is skipped @@ -388,6 +472,20 @@ __weak_reference(_libmd_SHA512_Final, SH #undef SHA512_Transform __weak_reference(_libmd_SHA512_Transform, SHA512_Transform); +#undef SHA512_224_Init +__weak_reference(_libmd_SHA512_224_Init, SHA512_224_Init); +#undef SHA512_224_Update +__weak_reference(_libmd_SHA512_224_Update, SHA512_224_Update); +#undef SHA512_224_Final +__weak_reference(_libmd_SHA512_224_Final, SHA512_224_Final); + +#undef SHA512_256_Init +__weak_reference(_libmd_SHA512_256_Init, SHA512_256_Init); +#undef SHA512_256_Update +__weak_reference(_libmd_SHA512_256_Update, SHA512_256_Update); +#undef SHA512_256_Final +__weak_reference(_libmd_SHA512_256_Final, SHA512_256_Final); + #undef SHA384_Init __weak_reference(_libmd_SHA384_Init, SHA384_Init); #undef SHA384_Update Added: head/sys/crypto/sha2/sha512t.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/sha2/sha512t.h Sat May 28 16:06:07 2016 (r300903) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2015 Allan Jude + * 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 _SHA512T_H_ +#define _SHA512T_H_ + +#include "sha512.h" + +#ifndef _KERNEL +#include +#endif + +#define SHA512_224_DIGEST_LENGTH 28 +#define SHA512_224_DIGEST_STRING_LENGTH (SHA512_224_DIGEST_LENGTH * 2 + 1) +#define SHA512_256_DIGEST_LENGTH 32 +#define SHA512_256_DIGEST_STRING_LENGTH (SHA512_256_DIGEST_LENGTH * 2 + 1) + +__BEGIN_DECLS + +/* Ensure libmd symbols do not clash with libcrypto */ +#ifndef SHA512_224_Init +#define SHA512_224_Init _libmd_SHA512_224_Init +#endif +#ifndef SHA512_224_Update +#define SHA512_224_Update _libmd_SHA512_224_Update +#endif +#ifndef SHA512_224_Final +#define SHA512_224_Final _libmd_SHA512_224_Final +#endif +#ifndef SHA512_224_End +#define SHA512_224_End _libmd_SHA512_224_End +#endif +#ifndef SHA512_224_File +#define SHA512_224_File _libmd_SHA512_224_File +#endif +#ifndef SHA512_224_FileChunk +#define SHA512_224_FileChunk _libmd_SHA512_224_FileChunk +#endif +#ifndef SHA512_224_Data +#define SHA512_224_Data _libmd_SHA512_224_Data +#endif + +#ifndef SHA512_224_Transform +#define SHA512_224_Transform _libmd_SHA512_224_Transform +#endif +#ifndef SHA512_224_version +#define SHA512_224_version _libmd_SHA512_224_version +#endif + +#ifndef SHA512_256_Init +#define SHA512_256_Init _libmd_SHA512_256_Init +#endif +#ifndef SHA512_256_Update +#define SHA512_256_Update _libmd_SHA512_256_Update +#endif +#ifndef SHA512_256_Final +#define SHA512_256_Final _libmd_SHA512_256_Final +#endif +#ifndef SHA512_256_End +#define SHA512_256_End _libmd_SHA512_256_End +#endif +#ifndef SHA512_256_File +#define SHA512_256_File _libmd_SHA512_256_File +#endif +#ifndef SHA512_256_FileChunk +#define SHA512_256_FileChunk _libmd_SHA512_256_FileChunk +#endif +#ifndef SHA512_256_Data +#define SHA512_256_Data _libmd_SHA512_256_Data +#endif + +#ifndef SHA512_256_Transform +#define SHA512_256_Transform _libmd_SHA512_256_Transform +#endif +#ifndef SHA512_256_version +#define SHA512_256_version _libmd_SHA512_256_version +#endif + +void SHA512_224_Init(SHA512_CTX *); +void SHA512_224_Update(SHA512_CTX *, const void *, size_t); +void SHA512_224_Final(unsigned char [static SHA512_224_DIGEST_LENGTH], SHA512_CTX *); +#ifndef _KERNEL +char *SHA512_224_End(SHA512_CTX *, char *); +char *SHA512_224_Data(const void *, unsigned int, char *); +char *SHA512_224_File(const char *, char *); +char *SHA512_224_FileChunk(const char *, char *, off_t, off_t); +#endif +void SHA512_256_Init(SHA512_CTX *); +void SHA512_256_Update(SHA512_CTX *, const void *, size_t); +void SHA512_256_Final(unsigned char [static SHA512_256_DIGEST_LENGTH], SHA512_CTX *); +#ifndef _KERNEL +char *SHA512_256_End(SHA512_CTX *, char *); +char *SHA512_256_Data(const void *, unsigned int, char *); +char *SHA512_256_File(const char *, char *); +char *SHA512_256_FileChunk(const char *, char *, off_t, off_t); +#endif + +__END_DECLS + +#endif /* !_SHA512T_H_ */ From owner-svn-src-head@freebsd.org Sat May 28 16:21:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6C80B4E20D; Sat, 28 May 2016 16:21:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5890D1DD0; Sat, 28 May 2016 16:21:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SGL5qZ081402; Sat, 28 May 2016 16:21:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SGL5Bd081401; Sat, 28 May 2016 16:21:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605281621.u4SGL5Bd081401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 28 May 2016 16:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300904 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 16:21:06 -0000 Author: bdrewery Date: Sat May 28 16:21:05 2016 New Revision: 300904 URL: https://svnweb.freebsd.org/changeset/base/300904 Log: Always export X_* vars. This fixes CROSS_TOOLCHAIN builds after r300886 since it relies on X_COMPILER_TYPE being set. The X_* vars will only represent the external compiler being used. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Sat May 28 16:06:07 2016 (r300903) +++ head/share/mk/bsd.compiler.mk Sat May 28 16:21:05 2016 (r300904) @@ -108,8 +108,10 @@ ccache-print-options: .PHONY # CC and COMPILER_* settings here. _exported_vars= ${X_}COMPILER_TYPE ${X_}COMPILER_VERSION \ ${X_}COMPILER_FREEBSD_VERSION -${X_}_cc_hash= ${${cc}}${MACHINE}${PATH} -${X_}_cc_hash:= ${${X_}_cc_hash:hash} +# Handle importing cached vars, but not for X_ vars. +.if ${X_} == "" +_cc_hash= ${${cc}}${MACHINE}${PATH} +_cc_hash:= ${_cc_hash:hash} # Only import if none of the vars are set somehow else. _can_export= yes .for var in ${_exported_vars} @@ -119,11 +121,12 @@ _can_export= no .endfor .if ${_can_export} == yes .for var in ${_exported_vars} -.if defined(${var}.${${X_}_cc_hash}) -${var}= ${${var}.${${X_}_cc_hash}} +.if defined(${var}.${_cc_hash}) +${var}= ${${var}.${_cc_hash}} .endif .endfor .endif +.endif # ${X_} == "" .if ${cc} == "CC" || (${cc} == "XCC" && ${XCC} != ${CC}) .if ${MACHINE} == "common" @@ -183,9 +186,14 @@ X_COMPILER_FEATURES= ${COMPILER_FEATURES # Export the values so sub-makes don't have to look them up again, using the # hash key computed above. .for var in ${_exported_vars} -${var}.${${X_}_cc_hash}:= ${${var}} -.export-env ${var}.${${X_}_cc_hash} -.undef ${var}.${${X_}_cc_hash} +.if ${X_} == "" +${var}.${_cc_hash}:= ${${var}} +.export-env ${var}.${_cc_hash} +.undef ${var}.${_cc_hash} +.else +# Always export X_ vars. +.export-env ${var} +.endif .endfor .endif # ${cc} == "CC" || !empty(XCC) From owner-svn-src-head@freebsd.org Sat May 28 16:38:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53707B4E3A5; Sat, 28 May 2016 16:38:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17ABB1444; Sat, 28 May 2016 16:38:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SGc9Zv088716; Sat, 28 May 2016 16:38:09 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SGc9YG088715; Sat, 28 May 2016 16:38:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605281638.u4SGc9YG088715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 28 May 2016 16:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300905 - head/lib/libc++ X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 16:38:10 -0000 Author: bdrewery Date: Sat May 28 16:38:09 2016 New Revision: 300905 URL: https://svnweb.freebsd.org/changeset/base/300905 Log: Use a relative symlink for proper --sysroot support. Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc++/Makefile Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Sat May 28 16:21:05 2016 (r300904) +++ head/lib/libc++/Makefile Sat May 28 16:38:09 2016 (r300905) @@ -187,7 +187,7 @@ RT_HEADERS= cxxabi.h\ .for hdr in ${STD_HEADERS} STD+= ${HDRDIR}/${hdr} -INCSLINKS+= ${CXXINCLUDEDIR}/${hdr} ${CXXINCLUDEDIR}/tr1/${hdr} +INCSLINKS+= ../${hdr} ${CXXINCLUDEDIR}/tr1/${hdr} .endfor .for hdr in ${RT_HEADERS} STD+= ${_LIBCXXRTDIR}/${hdr} From owner-svn-src-head@freebsd.org Sat May 28 17:43:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB523B4E067; Sat, 28 May 2016 17:43:42 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C5761B92; Sat, 28 May 2016 17:43:42 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SHhf9O019827; Sat, 28 May 2016 17:43:41 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SHhfNo019820; Sat, 28 May 2016 17:43:41 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605281743.u4SHhfNo019820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 28 May 2016 17:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300906 - in head: cddl/usr.sbin cddl/usr.sbin/zfsd cddl/usr.sbin/zfsd/tests etc/defaults etc/mtree etc/rc.d lib lib/libdevdctl lib/libdevdctl/tests share/mk sys/cddl/contrib/opensolari... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 17:43:42 -0000 Author: asomers Date: Sat May 28 17:43:40 2016 New Revision: 300906 URL: https://svnweb.freebsd.org/changeset/base/300906 Log: zfsd(8), the ZFS fault management daemon Add zfsd, which deals with hard drive faults in ZFS pools. It manages hotspares and replements in drive slots that publish physical paths. cddl/usr.sbin/zfsd Add zfsd(8) and its unit tests cddl/usr.sbin/Makefile Add zfsd to the build lib/libdevdctl A C++ library that helps devd clients process events lib/Makefile share/mk/bsd.libnames.mk share/mk/src.libnames.mk Add libdevdctl to the build. It's a private library, unusable by out-of-tree software. etc/defaults/rc.conf By default, set zfsd_enable to NO etc/mtree/BSD.include.dist Add a directory for libdevdctl's include files etc/mtree/BSD.tests.dist Add a directory for zfsd's unit tests etc/mtree/BSD.var.dist Add /var/db/zfsd/cases, where zfsd stores case files while it's shut down. etc/rc.d/Makefile etc/rc.d/zfsd Add zfsd's rc script sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fix the resource.fs.zfs.statechange message. It had a number of problems: It was only being emitted on a transition to the HEALTHY state. That made it impossible for zfsd to take actions based on drives getting sicker. It compared the new state to vdev_prevstate, which is the state that the vdev had the last time it was opened. That doesn't make sense, because a vdev can change state multiple times without being reopened. vdev_set_state contains logic that will change the device's new state based on various conditions. However, the statechange event was being posted _before_ that logic took effect. Now it's being posted after. Submitted by: gibbs, asomers, mav, allanjude Reviewed by: mav, delphij Relnotes: yes Sponsored by: Spectra Logic Corp, iX Systems Differential Revision: https://reviews.freebsd.org/D6564 Added: head/cddl/usr.sbin/zfsd/ head/cddl/usr.sbin/zfsd/Makefile (contents, props changed) head/cddl/usr.sbin/zfsd/Makefile.common (contents, props changed) head/cddl/usr.sbin/zfsd/callout.cc (contents, props changed) head/cddl/usr.sbin/zfsd/callout.h (contents, props changed) head/cddl/usr.sbin/zfsd/case_file.cc (contents, props changed) head/cddl/usr.sbin/zfsd/case_file.h (contents, props changed) head/cddl/usr.sbin/zfsd/tests/ head/cddl/usr.sbin/zfsd/tests/Makefile (contents, props changed) head/cddl/usr.sbin/zfsd/tests/libmocks.c (contents, props changed) head/cddl/usr.sbin/zfsd/tests/libmocks.h (contents, props changed) head/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc (contents, props changed) head/cddl/usr.sbin/zfsd/tests/zfsd_unittest.supp (contents, props changed) head/cddl/usr.sbin/zfsd/vdev.cc (contents, props changed) head/cddl/usr.sbin/zfsd/vdev.h (contents, props changed) head/cddl/usr.sbin/zfsd/vdev_iterator.cc (contents, props changed) head/cddl/usr.sbin/zfsd/vdev_iterator.h (contents, props changed) head/cddl/usr.sbin/zfsd/zfsd.8 (contents, props changed) head/cddl/usr.sbin/zfsd/zfsd.cc (contents, props changed) head/cddl/usr.sbin/zfsd/zfsd.h (contents, props changed) head/cddl/usr.sbin/zfsd/zfsd_event.cc (contents, props changed) head/cddl/usr.sbin/zfsd/zfsd_event.h (contents, props changed) head/cddl/usr.sbin/zfsd/zfsd_exception.cc (contents, props changed) head/cddl/usr.sbin/zfsd/zfsd_exception.h (contents, props changed) head/cddl/usr.sbin/zfsd/zfsd_main.cc (contents, props changed) head/cddl/usr.sbin/zfsd/zpool_list.cc (contents, props changed) head/cddl/usr.sbin/zfsd/zpool_list.h (contents, props changed) head/etc/rc.d/zfsd (contents, props changed) head/lib/libdevdctl/ head/lib/libdevdctl/Makefile (contents, props changed) head/lib/libdevdctl/consumer.cc (contents, props changed) head/lib/libdevdctl/consumer.h (contents, props changed) head/lib/libdevdctl/event.cc (contents, props changed) head/lib/libdevdctl/event.h (contents, props changed) head/lib/libdevdctl/event_factory.cc (contents, props changed) head/lib/libdevdctl/event_factory.h (contents, props changed) head/lib/libdevdctl/exception.cc (contents, props changed) head/lib/libdevdctl/exception.h (contents, props changed) head/lib/libdevdctl/guid.cc (contents, props changed) head/lib/libdevdctl/guid.h (contents, props changed) head/lib/libdevdctl/tests/ head/lib/libdevdctl/tests/Makefile (contents, props changed) head/lib/libdevdctl/tests/libdevdctl_unittest.cc (contents, props changed) Modified: head/cddl/usr.sbin/Makefile head/etc/defaults/rc.conf head/etc/mtree/BSD.include.dist head/etc/mtree/BSD.tests.dist head/etc/mtree/BSD.var.dist head/etc/rc.d/Makefile head/lib/Makefile head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Sat May 28 16:38:09 2016 (r300905) +++ head/cddl/usr.sbin/Makefile Sat May 28 17:43:40 2016 (r300906) @@ -7,6 +7,7 @@ SUBDIR= ${_dtrace} \ ${_plockstat} \ ${_tests} \ ${_zdb} \ + ${_zfsd} \ ${_zhack} .if ${MK_TESTS} != "no" @@ -18,6 +19,9 @@ _tests= tests _zdb= zdb _zhack= zhack .endif +. if ${MK_CXX} != "no" +_zfsd= zfsd +. endif .endif .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" Added: head/cddl/usr.sbin/zfsd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/zfsd/Makefile Sat May 28 17:43:40 2016 (r300906) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +SRCDIR=${.CURDIR}/../../.. +.include "Makefile.common" + +PROG_CXX= zfsd +MAN= zfsd.8 + +.include + +# The unittests require devel/googletest and devel/googlemock from ports. +# Don't automatically build them. +SUBDIR= Added: head/cddl/usr.sbin/zfsd/Makefile.common ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/zfsd/Makefile.common Sat May 28 17:43:40 2016 (r300906) @@ -0,0 +1,42 @@ +# $FreeBSD$ + +SRCS= callout.cc \ + case_file.cc \ + zfsd_event.cc \ + vdev.cc \ + vdev_iterator.cc \ + zfsd.cc \ + zfsd_exception.cc \ + zpool_list.cc \ + zfsd_main.cc + +WARNS?= 3 + +# Ignore warnings about Solaris specific pragmas. +IGNORE_PRAGMA= YES + +INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libzpool/common +INCFLAGS+= -I${SRCDIR}/cddl/compat/opensolaris/include +INCFLAGS+= -I${SRCDIR}/cddl/compat/opensolaris/lib/libumem +INCFLAGS+= -I${SRCDIR}/sys/cddl/compat/opensolaris +INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/head +INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libuutil/common +INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libumem/common +INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libzfs_core/common +INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libzfs/common +INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libnvpair +INCFLAGS+= -I${SRCDIR}/sys/cddl/contrib/opensolaris/common/zfs +INCFLAGS+= -I${SRCDIR}/sys/cddl/contrib/opensolaris/uts/common +INCFLAGS+= -I${SRCDIR}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +INCFLAGS+= -I${SRCDIR}/sys/cddl/contrib/opensolaris/uts/common/sys + +CFLAGS= -g -DNEED_SOLARIS_BOOLEAN ${INCFLAGS} + +DPADD= ${LIBDEVDCTL} ${LIBZFS} ${LIBZFS_CORE} ${LIBUTIL} ${LIBGEOM} \ + ${LIBBSDXML} ${LIBSBUF} ${LIBNVPAIR} ${LIBUUTIL} +LIBADD= devdctl zfs zfs_core util geom bsdxml sbuf nvpair uutil + +cscope: + find ${.CURDIR} -type f -a \( -name "*.[ch]" -o -name "*.cc" \) \ + > ${.CURDIR}/cscope.files + cd ${.CURDIR} && cscope -buq ${INCFLAGS} Added: head/cddl/usr.sbin/zfsd/callout.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/zfsd/callout.cc Sat May 28 17:43:40 2016 (r300906) @@ -0,0 +1,219 @@ +/*- + * Copyright (c) 2011, 2012, 2013 Spectra Logic Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * Authors: Justin T. Gibbs (Spectra Logic Corporation) + * + * $FreeBSD$ + */ + +/** + * \file callout.cc + * + * \brief Implementation of the Callout class - multi-client + * timer services built on top of the POSIX interval timer. + */ + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "callout.h" +#include "vdev_iterator.h" +#include "zfsd.h" +#include "zfsd_exception.h" + +std::list Callout::s_activeCallouts; +bool Callout::s_alarmFired(false); + +void +Callout::Init() +{ + signal(SIGALRM, Callout::AlarmSignalHandler); +} + +bool +Callout::Stop() +{ + if (!IsPending()) + return (false); + + for (std::list::iterator it(s_activeCallouts.begin()); + it != s_activeCallouts.end(); it++) { + if (*it != this) + continue; + + it = s_activeCallouts.erase(it); + if (it != s_activeCallouts.end()) { + + /* + * Maintain correct interval for the + * callouts that follow the just removed + * entry. + */ + timeradd(&(*it)->m_interval, &m_interval, + &(*it)->m_interval); + } + break; + } + m_pending = false; + return (true); +} + +bool +Callout::Reset(const timeval &interval, CalloutFunc_t *func, void *arg) +{ + bool cancelled(false); + + if (!timerisset(&interval)) + throw ZfsdException("Callout::Reset: interval of 0"); + + cancelled = Stop(); + + m_interval = interval; + m_func = func; + m_arg = arg; + m_pending = true; + + std::list::iterator it(s_activeCallouts.begin()); + for (; it != s_activeCallouts.end(); it++) { + + if (timercmp(&(*it)->m_interval, &m_interval, <=)) { + /* + * Decrease our interval by those that come + * before us. + */ + timersub(&m_interval, &(*it)->m_interval, &m_interval); + } else { + /* + * Account for the time between the newly + * inserted event and those that follow. + */ + timersub(&(*it)->m_interval, &m_interval, + &(*it)->m_interval); + break; + } + } + s_activeCallouts.insert(it, this); + + + if (s_activeCallouts.front() == this) { + itimerval timerval = { {0, 0}, m_interval }; + + setitimer(ITIMER_REAL, &timerval, NULL); + } + + return (cancelled); +} + +void +Callout::AlarmSignalHandler(int) +{ + s_alarmFired = true; + ZfsDaemon::WakeEventLoop(); +} + +void +Callout::ExpireCallouts() +{ + if (!s_alarmFired) + return; + + s_alarmFired = false; + if (s_activeCallouts.empty()) { + /* Callout removal/SIGALRM race was lost. */ + return; + } + + /* + * Expire the first callout (the one we used to set the + * interval timer) as well as any callouts following that + * expire at the same time (have a zero interval from + * the callout before it). + */ + do { + Callout *cur(s_activeCallouts.front()); + s_activeCallouts.pop_front(); + cur->m_pending = false; + cur->m_func(cur->m_arg); + } while (!s_activeCallouts.empty() + && timerisset(&s_activeCallouts.front()->m_interval) == 0); + + if (!s_activeCallouts.empty()) { + Callout *next(s_activeCallouts.front()); + itimerval timerval = { { 0, 0 }, next->m_interval }; + + setitimer(ITIMER_REAL, &timerval, NULL); + } +} + +timeval +Callout::TimeRemaining() const +{ + /* + * Outline: Add the m_interval for each callout in s_activeCallouts + * ahead of this, except for the first callout. Add to that the result + * of getitimer (That's because the first callout stores its original + * interval setting while the timer is ticking). + */ + itimerval timervalToAlarm; + timeval timeToExpiry; + std::list::iterator it; + + if (!IsPending()) { + timeToExpiry.tv_sec = INT_MAX; + timeToExpiry.tv_usec = 999999; /*maximum normalized value*/ + return (timeToExpiry); + } + + timerclear(&timeToExpiry); + getitimer(ITIMER_REAL, &timervalToAlarm); + timeval& timeToAlarm = timervalToAlarm.it_value; + timeradd(&timeToExpiry, &timeToAlarm, &timeToExpiry); + + it =s_activeCallouts.begin(); + it++; /*skip the first callout in the list*/ + for (; it != s_activeCallouts.end(); it++) { + timeradd(&timeToExpiry, &(*it)->m_interval, &timeToExpiry); + if ((*it) == this) + break; + } + return (timeToExpiry); +} Added: head/cddl/usr.sbin/zfsd/callout.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/zfsd/callout.h Sat May 28 17:43:40 2016 (r300906) @@ -0,0 +1,185 @@ +/*- + * Copyright (c) 2011, 2012, 2013 Spectra Logic Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * Authors: Justin T. Gibbs (Spectra Logic Corporation) + * + * $FreeBSD$ + */ + +/** + * \file callout.h + * + * \brief Interface for timer based callback services. + * + * Header requirements: + * + * #include + * + * #include + */ + +#ifndef _CALLOUT_H_ +#define _CALLOUT_H_ + +/** + * \brief Type of the function callback from a Callout. + */ +typedef void CalloutFunc_t(void *); + +/** + * \brief Interface to a schedulable one-shot timer with the granularity + * of the system clock (see setitimer(2)). + * + * Determination of callback expiration is triggered by the SIGALRM + * signal. Callout callbacks are always delivered from Zfsd's event + * processing loop. + * + * Periodic actions can be triggered via the Callout mechanisms by + * resetting the Callout from within its callback. + */ +class Callout +{ +public: + + /** + * Initialize the Callout subsystem. + */ + static void Init(); + + /** + * Function called (via SIGALRM) when our interval + * timer expires. + */ + static void AlarmSignalHandler(int); + + /** + * Execute callbacks for all callouts that have the same + * expiration time as the first callout in the list. + */ + static void ExpireCallouts(); + + /** Constructor. */ + Callout(); + + /** + * Returns true if callout has not been stopped, + * or deactivated since the last time the callout was + * reset. + */ + bool IsActive() const; + + /** + * Returns true if callout is still waiting to expire. + */ + bool IsPending() const; + + /** + * Disestablish a callout. + */ + bool Stop(); + + /** + * \brief Establish or change a timeout. + * + * \param interval Timeval indicating the time which must elapse + * before this callout fires. + * \param func Pointer to the callback funtion + * \param arg Argument pointer to pass to callback function + * + * \return Cancellation status. + * true: The previous callback was pending and therefore + * was cancelled. + * false: The callout was not pending at the time of this + * reset request. + * In all cases, a new callout is established. + */ + bool Reset(const timeval &interval, CalloutFunc_t *func, void *arg); + + /** + * \brief Calculate the remaining time until this Callout's timer + * expires. + * + * The return value will be slightly greater than the actual time to + * expiry. + * + * If the callout is not pending, returns INT_MAX. + */ + timeval TimeRemaining() const; + +private: + /** + * All active callouts sorted by expiration time. The callout + * with the nearest expiration time is at the head of the list. + */ + static std::list s_activeCallouts; + + /** + * The interval timer has expired. This variable is set from + * signal handler context and tested from Zfsd::EventLoop() + * context via ExpireCallouts(). + */ + static bool s_alarmFired; + + /** + * Time, relative to others in the active list, until + * this callout is fired. + */ + timeval m_interval; + + /** Callback function argument. */ + void *m_arg; + + /** + * The callback function associated with this timer + * entry. + */ + CalloutFunc_t *m_func; + + /** State of this callout. */ + bool m_pending; +}; + +//- Callout public const methods ---------------------------------------------- +inline bool +Callout::IsPending() const +{ + return (m_pending); +} + +//- Callout public methods ---------------------------------------------------- +inline +Callout::Callout() + : m_arg(0), + m_func(NULL), + m_pending(false) +{ + timerclear(&m_interval); +} + +#endif /* CALLOUT_H_ */ Added: head/cddl/usr.sbin/zfsd/case_file.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/zfsd/case_file.cc Sat May 28 17:43:40 2016 (r300906) @@ -0,0 +1,1104 @@ +/*- + * Copyright (c) 2011, 2012, 2013, 2014, 2016 Spectra Logic Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * Authors: Justin T. Gibbs (Spectra Logic Corporation) + */ + +/** + * \file case_file.cc + * + * We keep case files for any leaf vdev that is not in the optimal state. + * However, we only serialize to disk those events that need to be preserved + * across reboots. For now, this is just a log of soft errors which we + * accumulate in order to mark a device as degraded. + */ +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "callout.h" +#include "vdev_iterator.h" +#include "zfsd_event.h" +#include "case_file.h" +#include "vdev.h" +#include "zfsd.h" +#include "zfsd_exception.h" +#include "zpool_list.h" + +__FBSDID("$FreeBSD$"); + +/*============================ Namespace Control =============================*/ +using std::auto_ptr; +using std::hex; +using std::ifstream; +using std::stringstream; +using std::setfill; +using std::setw; + +using DevdCtl::Event; +using DevdCtl::EventBuffer; +using DevdCtl::EventFactory; +using DevdCtl::EventList; +using DevdCtl::Guid; +using DevdCtl::ParseException; + +/*--------------------------------- CaseFile ---------------------------------*/ +//- CaseFile Static Data ------------------------------------------------------- + +CaseFileList CaseFile::s_activeCases; +const string CaseFile::s_caseFilePath = "/var/db/zfsd/cases"; +const timeval CaseFile::s_removeGracePeriod = { 60 /*sec*/, 0 /*usec*/}; + +//- CaseFile Static Public Methods --------------------------------------------- +CaseFile * +CaseFile::Find(Guid poolGUID, Guid vdevGUID) +{ + for (CaseFileList::iterator curCase = s_activeCases.begin(); + curCase != s_activeCases.end(); curCase++) { + + if ((*curCase)->PoolGUID() != poolGUID + || (*curCase)->VdevGUID() != vdevGUID) + continue; + + /* + * We only carry one active case per-vdev. + */ + return (*curCase); + } + return (NULL); +} + +CaseFile * +CaseFile::Find(const string &physPath) +{ + CaseFile *result = NULL; + + for (CaseFileList::iterator curCase = s_activeCases.begin(); + curCase != s_activeCases.end(); curCase++) { + + if ((*curCase)->PhysicalPath() != physPath) + continue; + + if (result != NULL) { + syslog(LOG_WARNING, "Multiple casefiles found for " + "physical path %s. " + "This is most likely a bug in zfsd", + physPath.c_str()); + } + result = *curCase; + } + return (result); +} + + +void +CaseFile::ReEvaluateByGuid(Guid poolGUID, const ZfsEvent &event) +{ + CaseFileList::iterator casefile; + for (casefile = s_activeCases.begin(); casefile != s_activeCases.end();){ + CaseFileList::iterator next = casefile; + next++; + if (poolGUID == (*casefile)->PoolGUID()) + (*casefile)->ReEvaluate(event); + casefile = next; + } +} + +CaseFile & +CaseFile::Create(Vdev &vdev) +{ + CaseFile *activeCase; + + activeCase = Find(vdev.PoolGUID(), vdev.GUID()); + if (activeCase == NULL) + activeCase = new CaseFile(vdev); + + return (*activeCase); +} + +void +CaseFile::DeSerialize() +{ + struct dirent **caseFiles; + + int numCaseFiles(scandir(s_caseFilePath.c_str(), &caseFiles, + DeSerializeSelector, /*compar*/NULL)); + + if (numCaseFiles == -1) + return; + if (numCaseFiles == 0) { + free(caseFiles); + return; + } + + for (int i = 0; i < numCaseFiles; i++) { + + DeSerializeFile(caseFiles[i]->d_name); + free(caseFiles[i]); + } + free(caseFiles); +} + +void +CaseFile::LogAll() +{ + for (CaseFileList::iterator curCase = s_activeCases.begin(); + curCase != s_activeCases.end(); curCase++) + (*curCase)->Log(); +} + +void +CaseFile::PurgeAll() +{ + /* + * Serialize casefiles before deleting them so that they can be reread + * and revalidated during BuildCaseFiles. + * CaseFiles remove themselves from this list on destruction. + */ + while (s_activeCases.size() != 0) { + CaseFile *casefile = s_activeCases.front(); + casefile->Serialize(); + delete casefile; + } + +} + +//- CaseFile Public Methods ---------------------------------------------------- +bool +CaseFile::RefreshVdevState() +{ + ZpoolList zpl(ZpoolList::ZpoolByGUID, &m_poolGUID); + zpool_handle_t *casePool(zpl.empty() ? NULL : zpl.front()); + if (casePool == NULL) + return (false); + + Vdev vd(casePool, CaseVdev(casePool)); + if (vd.DoesNotExist()) + return (false); + + m_vdevState = vd.State(); + m_vdevPhysPath = vd.PhysicalPath(); + return (true); +} + +bool +CaseFile::ReEvaluate(const string &devPath, const string &physPath, Vdev *vdev) +{ + ZpoolList zpl(ZpoolList::ZpoolByGUID, &m_poolGUID); + zpool_handle_t *pool(zpl.empty() ? NULL : zpl.front()); + + if (pool == NULL || !RefreshVdevState()) { + /* + * The pool or vdev for this case file is no longer + * part of the configuration. This can happen + * if we process a device arrival notification + * before seeing the ZFS configuration change + * event. + */ + syslog(LOG_INFO, + "CaseFile::ReEvaluate(%s,%s) Pool/Vdev unconfigured. " + "Closing\n", + PoolGUIDString().c_str(), + VdevGUIDString().c_str()); + Close(); + + /* + * Since this event was not used to close this + * case, do not report it as consumed. + */ + return (/*consumed*/false); + } + + if (VdevState() > VDEV_STATE_CANT_OPEN) { + /* + * For now, newly discovered devices only help for + * devices that are missing. In the future, we might + * use a newly inserted spare to replace a degraded + * or faulted device. + */ + syslog(LOG_INFO, "CaseFile::ReEvaluate(%s,%s): Pool/Vdev ignored", + PoolGUIDString().c_str(), VdevGUIDString().c_str()); + return (/*consumed*/false); + } + + if (vdev != NULL + && vdev->PoolGUID() == m_poolGUID + && vdev->GUID() == m_vdevGUID) { + + zpool_vdev_online(pool, vdev->GUIDString().c_str(), + ZFS_ONLINE_CHECKREMOVE | ZFS_ONLINE_UNSPARE, + &m_vdevState); + syslog(LOG_INFO, "Onlined vdev(%s/%s:%s). State now %s.\n", + zpool_get_name(pool), vdev->GUIDString().c_str(), + devPath.c_str(), + zpool_state_to_name(VdevState(), VDEV_AUX_NONE)); + + /* + * Check the vdev state post the online action to see + * if we can retire this case. + */ + CloseIfSolved(); + + return (/*consumed*/true); + } + + /* + * If the auto-replace policy is enabled, and we have physical + * path information, try a physical path replacement. + */ + if (zpool_get_prop_int(pool, ZPOOL_PROP_AUTOREPLACE, NULL) == 0) { + syslog(LOG_INFO, + "CaseFile(%s:%s:%s): AutoReplace not set. " + "Ignoring device insertion.\n", + PoolGUIDString().c_str(), + VdevGUIDString().c_str(), + zpool_state_to_name(VdevState(), VDEV_AUX_NONE)); + return (/*consumed*/false); + } + + if (PhysicalPath().empty()) { + syslog(LOG_INFO, + "CaseFile(%s:%s:%s): No physical path information. " + "Ignoring device insertion.\n", + PoolGUIDString().c_str(), + VdevGUIDString().c_str(), + zpool_state_to_name(VdevState(), VDEV_AUX_NONE)); + return (/*consumed*/false); + } + + if (physPath != PhysicalPath()) { + syslog(LOG_INFO, + "CaseFile(%s:%s:%s): Physical path mismatch. " + "Ignoring device insertion.\n", + PoolGUIDString().c_str(), + VdevGUIDString().c_str(), + zpool_state_to_name(VdevState(), VDEV_AUX_NONE)); + return (/*consumed*/false); + } + + /* Write a label on the newly inserted disk. */ + if (zpool_label_disk(g_zfsHandle, pool, devPath.c_str()) != 0) { + syslog(LOG_ERR, + "Replace vdev(%s/%s) by physical path (label): %s: %s\n", + zpool_get_name(pool), VdevGUIDString().c_str(), + libzfs_error_action(g_zfsHandle), + libzfs_error_description(g_zfsHandle)); + return (/*consumed*/false); + } + + syslog(LOG_INFO, "CaseFile::ReEvaluate(%s/%s): Replacing with %s", + PoolGUIDString().c_str(), VdevGUIDString().c_str(), + devPath.c_str()); + return (Replace(VDEV_TYPE_DISK, devPath.c_str(), /*isspare*/false)); +} + +bool +CaseFile::ReEvaluate(const ZfsEvent &event) +{ + bool consumed(false); + + if (event.Value("type") == "misc.fs.zfs.vdev_remove") { + /* + * The Vdev we represent has been removed from the + * configuration. This case is no longer of value. + */ + Close(); + + return (/*consumed*/true); + } else if (event.Value("type") == "misc.fs.zfs.pool_destroy") { + /* This Pool has been destroyed. Discard the case */ + Close(); + + return (/*consumed*/true); + } else if (event.Value("type") == "misc.fs.zfs.config_sync") { + RefreshVdevState(); + if (VdevState() < VDEV_STATE_HEALTHY) + consumed = ActivateSpare(); + } + + + if (event.Value("class") == "resource.fs.zfs.removed") { + bool spare_activated; + + if (!RefreshVdevState()) { + /* + * The pool or vdev for this case file is no longer + * part of the configuration. This can happen + * if we process a device arrival notification + * before seeing the ZFS configuration change + * event. + */ + syslog(LOG_INFO, + "CaseFile::ReEvaluate(%s,%s) Pool/Vdev " + "unconfigured. Closing\n", + PoolGUIDString().c_str(), + VdevGUIDString().c_str()); + /* + * Close the case now so we won't waste cycles in the + * system rescan + */ + Close(); + + /* + * Since this event was not used to close this + * case, do not report it as consumed. + */ + return (/*consumed*/false); + } + + /* + * Discard any tentative I/O error events for + * this case. They were most likely caused by the + * hot-unplug of this device. + */ + PurgeTentativeEvents(); + + /* Try to activate spares if they are available */ + spare_activated = ActivateSpare(); + + /* + * Rescan the drives in the system to see if a recent + * drive arrival can be used to solve this case. + */ + ZfsDaemon::RequestSystemRescan(); + + /* + * Consume the event if we successfully activated a spare. + * Otherwise, leave it in the unconsumed events list so that the + * future addition of a spare to this pool might be able to + * close the case + */ + consumed = spare_activated; + } else if (event.Value("class") == "resource.fs.zfs.statechange") { + RefreshVdevState(); + /* + * If this vdev is DEGRADED, FAULTED, or UNAVAIL, try to + * activate a hotspare. Otherwise, ignore the event + */ + if (VdevState() == VDEV_STATE_FAULTED || + VdevState() == VDEV_STATE_DEGRADED || + VdevState() == VDEV_STATE_CANT_OPEN) + (void) ActivateSpare(); + consumed = true; + } + else if (event.Value("class") == "ereport.fs.zfs.io" || + event.Value("class") == "ereport.fs.zfs.checksum") { + + m_tentativeEvents.push_front(event.DeepCopy()); + RegisterCallout(event); + consumed = true; + } + + bool closed(CloseIfSolved()); + + return (consumed || closed); +} + + +bool +CaseFile::ActivateSpare() { + nvlist_t *config, *nvroot; + nvlist_t **spares; + char *devPath, *vdev_type; + const char *poolname; + u_int nspares, i; + int error; + + ZpoolList zpl(ZpoolList::ZpoolByGUID, &m_poolGUID); + zpool_handle_t *zhp(zpl.empty() ? NULL : zpl.front()); + if (zhp == NULL) { + syslog(LOG_ERR, "CaseFile::ActivateSpare: Could not find pool " + "for pool_guid %"PRIu64".", (uint64_t)m_poolGUID); + return (false); + } + poolname = zpool_get_name(zhp); + config = zpool_get_config(zhp, NULL); + if (config == NULL) { + syslog(LOG_ERR, "CaseFile::ActivateSpare: Could not find pool " + "config for pool %s", poolname); + return (false); + } + error = nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &nvroot); + if (error != 0){ + syslog(LOG_ERR, "CaseFile::ActivateSpare: Could not find vdev " + "tree for pool %s", poolname); + return (false); + } + nspares = 0; + nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES, &spares, + &nspares); + if (nspares == 0) { + /* The pool has no spares configured */ + syslog(LOG_INFO, "CaseFile::ActivateSpare: " + "No spares available for pool %s", poolname); + return (false); + } + for (i = 0; i < nspares; i++) { + uint64_t *nvlist_array; + vdev_stat_t *vs; + uint_t nstats; + + if (nvlist_lookup_uint64_array(spares[i], + ZPOOL_CONFIG_VDEV_STATS, &nvlist_array, &nstats) != 0) { + syslog(LOG_ERR, "CaseFile::ActivateSpare: Could not " + "find vdev stats for pool %s, spare %d", + poolname, i); + return (false); + } + vs = reinterpret_cast(nvlist_array); + + if ((vs->vs_aux != VDEV_AUX_SPARED) + && (vs->vs_state == VDEV_STATE_HEALTHY)) { + /* We found a usable spare */ + break; + } + } + + if (i == nspares) { + /* No available spares were found */ + return (false); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat May 28 18:49:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C7D1B4ED92; Sat, 28 May 2016 18:49:18 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43C9F1DA1; Sat, 28 May 2016 18:49:18 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SInHvu042430; Sat, 28 May 2016 18:49:17 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SInHqo042429; Sat, 28 May 2016 18:49:17 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605281849.u4SInHqo042429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 28 May 2016 18:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300910 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 18:49:18 -0000 Author: avos Date: Sat May 28 18:49:17 2016 New Revision: 300910 URL: https://svnweb.freebsd.org/changeset/base/300910 Log: net80211: fix use-after-free in frame defragmentation procedure. - Assign frame sequence/fragment number before frame concatenation; otherwise, frame header pointer (wh) will be invalid. - Move this code block upper and eliminate duplicate 'lwh = mtod()' assignment. Tested with wpi(4) (transmitter) (STA mode) and urtwn(4) (receiver) (HOSTAP mode). Modified: head/sys/net80211/ieee80211_input.c Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Sat May 28 18:47:25 2016 (r300909) +++ head/sys/net80211/ieee80211_input.c Sat May 28 18:49:17 2016 (r300910) @@ -227,9 +227,16 @@ ieee80211_defrag(struct ieee80211_node * lwh = mtod(mfrag, struct ieee80211_frame *); last_rxseq = le16toh(*(uint16_t *)lwh->i_seq); /* NB: check seq # and frag together */ - if (rxseq != last_rxseq+1 || - !IEEE80211_ADDR_EQ(wh->i_addr1, lwh->i_addr1) || - !IEEE80211_ADDR_EQ(wh->i_addr2, lwh->i_addr2)) { + if (rxseq == last_rxseq+1 && + IEEE80211_ADDR_EQ(wh->i_addr1, lwh->i_addr1) && + IEEE80211_ADDR_EQ(wh->i_addr2, lwh->i_addr2)) { + /* XXX clear MORE_FRAG bit? */ + /* track last seqnum and fragno */ + *(uint16_t *) lwh->i_seq = *(uint16_t *) wh->i_seq; + + m_adj(m, hdrspace); /* strip header */ + m_catpkt(mfrag, m); /* concatenate */ + } else { /* * Unrelated fragment or no space for it, * clear current fragments. @@ -247,12 +254,6 @@ ieee80211_defrag(struct ieee80211_node * return NULL; } mfrag = m; - } else { /* concatenate */ - m_adj(m, hdrspace); /* strip header */ - m_catpkt(mfrag, m); - /* track last seqnum and fragno */ - lwh = mtod(mfrag, struct ieee80211_frame *); - *(uint16_t *) lwh->i_seq = *(uint16_t *) wh->i_seq; } if (more_frag) { /* more to come, save */ ni->ni_rxfragstamp = ticks; From owner-svn-src-head@freebsd.org Sat May 28 19:13:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05D4DB4E52E; Sat, 28 May 2016 19:13:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7A3C1F1F; Sat, 28 May 2016 19:13:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SJDdLL053452; Sat, 28 May 2016 19:13:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SJDdtx053451; Sat, 28 May 2016 19:13:39 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605281913.u4SJDdtx053451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 28 May 2016 19:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300911 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 19:13:41 -0000 Author: avos Date: Sat May 28 19:13:39 2016 New Revision: 300911 URL: https://svnweb.freebsd.org/changeset/base/300911 Log: net80211: replace m_getcl/m_gethdr pair with m_get2 in ieee80211_fragment() - Switch to m_get2() for mbuf allocation instead of manual mbuf size determination. - Reuse MIN() macro for mbuf size selection. Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sat May 28 18:49:17 2016 (r300910) +++ head/sys/net80211/ieee80211_output.c Sat May 28 19:13:39 2016 (r300911) @@ -1679,16 +1679,8 @@ ieee80211_fragment(struct ieee80211vap * remainder = m0->m_pkthdr.len - off; prev = m0; do { - fragsize = totalhdrsize + remainder; - if (fragsize > mtu) - fragsize = mtu; - /* XXX fragsize can be >2048! */ - KASSERT(fragsize < MCLBYTES, - ("fragment size %u too big!", fragsize)); - if (fragsize > MHLEN) - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); - else - m = m_gethdr(M_NOWAIT, MT_DATA); + fragsize = MIN(totalhdrsize + remainder, mtu); + m = m_get2(fragsize, M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) goto bad; /* leave room to prepend any cipher header */ From owner-svn-src-head@freebsd.org Sat May 28 19:39:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8379B4EAAB; Sat, 28 May 2016 19:39:16 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 997D11A84; Sat, 28 May 2016 19:39:16 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SJdFv7060841; Sat, 28 May 2016 19:39:15 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SJdFX6060839; Sat, 28 May 2016 19:39:15 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201605281939.u4SJdFX6060839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Sat, 28 May 2016 19:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300912 - head/contrib/libxo/libxo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 19:39:17 -0000 Author: phil Date: Sat May 28 19:39:15 2016 New Revision: 300912 URL: https://svnweb.freebsd.org/changeset/base/300912 Log: Undo meaningless local changes to libxo so we're in sync with the github repo. Submitted by: phil Reviewed by: sjg (mentor) Approved by: sjg Modified: head/contrib/libxo/libxo/xo_format.5 head/contrib/libxo/libxo/xo_syslog.c Modified: head/contrib/libxo/libxo/xo_format.5 ============================================================================== --- head/contrib/libxo/libxo/xo_format.5 Sat May 28 19:13:39 2016 (r300911) +++ head/contrib/libxo/libxo/xo_format.5 Sat May 28 19:39:15 2016 (r300912) @@ -7,7 +7,7 @@ .\" # LICENSE. .\" # Phil Shafer, July 2014 .\" -.Dd November 6, 2015 +.Dd December 4, 2014 .Dt LIBXO 3 .Os .Sh NAME Modified: head/contrib/libxo/libxo/xo_syslog.c ============================================================================== --- head/contrib/libxo/libxo/xo_syslog.c Sat May 28 19:13:39 2016 (r300911) +++ head/contrib/libxo/libxo/xo_syslog.c Sat May 28 19:39:15 2016 (r300912) @@ -91,7 +91,7 @@ #elif defined(__macosx__) #define XO_DEFAULT_EID 63 #else -#define XO_DEFAULT_EID 32473 /* Bail; use "example" number */ +#define XO_DEFAULT_EID 32473 /* Fallback to the "example" number */ #endif #ifdef _SC_HOST_NAME_MAX From owner-svn-src-head@freebsd.org Sat May 28 20:47:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84B1FB4EBB6; Sat, 28 May 2016 20:47:25 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 522E9168D; Sat, 28 May 2016 20:47:25 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D48721FE024; Sat, 28 May 2016 22:47:21 +0200 (CEST) Subject: Re: svn commit: r300731 - head/sys/netinet To: Pieter de Goeje , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605261110.u4QBAW7W099643@repo.freebsd.org> <57492820.7080605@degoeje.nl> From: Hans Petter Selasky Message-ID: Date: Sat, 28 May 2016 22:50:43 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <57492820.7080605@degoeje.nl> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 20:47:25 -0000 On 05/28/16 07:09, Pieter de Goeje wrote: > Hi, > > Replacing the bubble sort with insertion sort gives an 80% reduction in > runtime on average (with randomized keys) for small partitions. > > If the keys are pre-sorted, insertion sort runs in linear time, and even > if the keys are reversed, insertion sort is faster than bubble sort, > although not by much. See below for measurements. > > Insertion sort tested: > > for (x = 1; x < size; x++) { > temp = parray[x]; > for( y = x; y > 0 && temp.seq < parray[y - 1].seq; y--) { > parray[y] = parray[y - 1]; > } > parray[y] = temp; > } > > Like bubble sort, insertion sort is O(N^2) in the worst case (reversed > keys), but it is much faster on average because it is an adaptive sort > unlike bubble sort. > > The tests were run outside of the kernel, with a proxied struct > lro_mbuf_sort which consisted of a struct with seq as its only member. > The benchmarks were run in isolation on the bubble/insertion sort only. > > I didn't have time to test this with the full radix sort, but I expect > that the cutoff value of 12 could be raised slightly after replacing the > bubble sort. > > I did verify that the improvements in runtime still hold for very small > number of keys (12), but I didn't include these results below. > > Assuming I've done my work correctly, you should be able to just drop in > the code above. :-) Hi, I've managed to reproduce your findings with random data sets and created the following review: https://reviews.freebsd.org/D6619 Thank you! --HPS From owner-svn-src-head@freebsd.org Sat May 28 21:25:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13AD4B4E336; Sat, 28 May 2016 21:25:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC08F1870; Sat, 28 May 2016 21:25:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SLPPEt001286; Sat, 28 May 2016 21:25:25 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SLPP3J001285; Sat, 28 May 2016 21:25:25 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605282125.u4SLPP3J001285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 28 May 2016 21:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300913 - head/tools/tools/locale/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 21:25:26 -0000 Author: bapt Date: Sat May 28 21:25:24 2016 New Revision: 300913 URL: https://svnweb.freebsd.org/changeset/base/300913 Log: Add a hack to readd the day of weeks in default date formats Modified: head/tools/tools/locale/tools/cldr2def.pl Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Sat May 28 19:39:15 2016 (r300912) +++ head/tools/tools/locale/tools/cldr2def.pl Sat May 28 21:25:24 2016 (r300913) @@ -196,19 +196,23 @@ if ($TYPE eq "timedef") { } sub callback_cformat { - my $s = shift; - $s =~ s/ %Z//; - $s =~ s/ %z//; - return $s; + my $s = shift; + $s =~ s/ %Z//; + $s =~ s/ %z//; + $s =~ s/^"(%B %e, )/"%a, $1/; + $s =~ s/^"(%e %B )/"%a $1/; + return $s; }; sub callback_dtformat { - my $s = shift; + my $s = shift; my $nl = $callback{data}{l} . "_" . $callback{data}{c}; if ($nl eq 'ja_JP') { - $s =~ s/(> )(%H)/$1%A $2/; + $s =~ s/(> )(%H)/$1%A $2/; } + $s =~ s/^"(%B %e, )/"%a, $1/; + $s =~ s/^"(%e %B )/"%a $1/; return $s; }; From owner-svn-src-head@freebsd.org Sat May 28 21:26:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 775C1B4E3A1; Sat, 28 May 2016 21:26:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 489471A28; Sat, 28 May 2016 21:26:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SLQsMK001415; Sat, 28 May 2016 21:26:54 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SLQo6j001372; Sat, 28 May 2016 21:26:50 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605282126.u4SLQo6j001372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 28 May 2016 21:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300914 - head/share/timedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 21:26:55 -0000 Author: bapt Date: Sat May 28 21:26:50 2016 New Revision: 300914 URL: https://svnweb.freebsd.org/changeset/base/300914 Log: Readd week day to default dates Requested by: many Modified: head/share/timedef/am_ET.UTF-8.src head/share/timedef/be_BY.CP1131.src head/share/timedef/be_BY.CP1251.src head/share/timedef/be_BY.ISO8859-5.src head/share/timedef/be_BY.UTF-8.src head/share/timedef/bg_BG.CP1251.src head/share/timedef/bg_BG.UTF-8.src head/share/timedef/ca_IT.ISO8859-15.src head/share/timedef/ca_IT.UTF-8.src head/share/timedef/el_GR.ISO8859-7.src head/share/timedef/el_GR.UTF-8.src head/share/timedef/en_CA.UTF-8.src head/share/timedef/en_GB.UTF-8.src head/share/timedef/en_HK.UTF-8.src head/share/timedef/en_IE.UTF-8.src head/share/timedef/en_PH.UTF-8.src head/share/timedef/en_SG.UTF-8.src head/share/timedef/en_US.UTF-8.src head/share/timedef/fr_BE.ISO8859-15.src head/share/timedef/fr_BE.UTF-8.src head/share/timedef/fr_CA.ISO8859-15.src head/share/timedef/fr_CA.UTF-8.src head/share/timedef/fr_CH.ISO8859-15.src head/share/timedef/fr_CH.UTF-8.src head/share/timedef/fr_FR.ISO8859-15.src head/share/timedef/fr_FR.UTF-8.src head/share/timedef/hi_IN.ISCII-DEV.src head/share/timedef/hi_IN.UTF-8.src head/share/timedef/it_CH.ISO8859-15.src head/share/timedef/it_CH.UTF-8.src head/share/timedef/it_IT.ISO8859-15.src head/share/timedef/it_IT.UTF-8.src head/share/timedef/kk_Cyrl_KZ.UTF-8.src head/share/timedef/nl_BE.UTF-8.src head/share/timedef/nl_NL.UTF-8.src head/share/timedef/pl_PL.ISO8859-2.src head/share/timedef/pl_PL.UTF-8.src head/share/timedef/ro_RO.ISO8859-2.src head/share/timedef/ro_RO.UTF-8.src head/share/timedef/ru_RU.CP1251.src head/share/timedef/ru_RU.CP866.src head/share/timedef/ru_RU.ISO8859-5.src head/share/timedef/ru_RU.KOI8-R.src head/share/timedef/ru_RU.UTF-8.src head/share/timedef/sv_FI.ISO8859-15.src head/share/timedef/sv_FI.UTF-8.src head/share/timedef/sv_SE.ISO8859-15.src head/share/timedef/sv_SE.UTF-8.src head/share/timedef/tr_TR.ISO8859-9.src head/share/timedef/tr_TR.UTF-8.src head/share/timedef/uk_UA.CP1251.src head/share/timedef/uk_UA.ISO8859-5.src head/share/timedef/uk_UA.KOI8-U.src head/share/timedef/uk_UA.UTF-8.src Modified: head/share/timedef/am_ET.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.CP1131.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.CP1251.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.ISO8859-5.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/bg_BG.CP1251.src ============================================================================== --- head/share/timedef/bg_BG.CP1251.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/bg_BG.CP1251.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ %e.%m.%y г. # # c_fmt -%e %B %Y ã., %H:%M:%S +%a %e %B %Y ã., %H:%M:%S # # AM/PM ïð.îá. ñë.îá. # # date_fmt -%e %B %Y ã., %H:%M:%S %Z +%a %e %B %Y ã., %H:%M:%S %Z # # Long month names (without case ending) ÿíóàðè Modified: head/share/timedef/bg_BG.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/ca_IT.ISO8859-15.src ============================================================================== --- head/share/timedef/ca_IT.ISO8859-15.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/ca_IT.ISO8859-15.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ dissabte %e/%m/%y # # c_fmt -%e %B de %Y, %H:%M:%S +%a %e %B de %Y, %H:%M:%S # # AM/PM a. m. p. m. # # date_fmt -%e %B de %Y, %H:%M:%S %Z +%a %e %B de %Y, %H:%M:%S %Z # # Long month names (without case ending) de gener Modified: head/share/timedef/ca_IT.UTF-8.src ============================================================================== --- head/share/timedef/ca_IT.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/ca_IT.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ dissabte %e/%m/%y # # c_fmt -%e %B de %Y, %H:%M:%S +%a %e %B de %Y, %H:%M:%S # # AM/PM a. m. p. m. # # date_fmt -%e %B de %Y, %H:%M:%S %Z +%a %e %B de %Y, %H:%M:%S %Z # # Long month names (without case ending) de gener Modified: head/share/timedef/el_GR.ISO8859-7.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/el_GR.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/en_CA.UTF-8.src ============================================================================== --- head/share/timedef/en_CA.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/en_CA.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ Saturday %Y-%m-%d # # c_fmt -%B %e, %Y at %I:%M:%S %p +%a, %B %e, %Y at %I:%M:%S %p # # AM/PM AM PM # # date_fmt -%B %e, %Y at %I:%M:%S %p %Z +%a, %B %e, %Y at %I:%M:%S %p %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_GB.UTF-8.src ============================================================================== --- head/share/timedef/en_GB.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/en_GB.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ Saturday %d/%m/%Y # # c_fmt -%e %B %Y at %H:%M:%S +%a %e %B %Y at %H:%M:%S # # AM/PM a.m. p.m. # # date_fmt -%e %B %Y at %H:%M:%S %Z +%a %e %B %Y at %H:%M:%S %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_HK.UTF-8.src ============================================================================== --- head/share/timedef/en_HK.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/en_HK.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ Saturday %e/%m/%Y # # c_fmt -%e %B %Y at %I:%M:%S %p +%a %e %B %Y at %I:%M:%S %p # # AM/PM AM PM # # date_fmt -%e %B %Y at %I:%M:%S %p %Z +%a %e %B %Y at %I:%M:%S %p %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_IE.UTF-8.src ============================================================================== --- head/share/timedef/en_IE.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/en_IE.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ Saturday %d/%m/%Y # # c_fmt -%e %B %Y at %I:%M:%S %p +%a %e %B %Y at %I:%M:%S %p # # AM/PM a.m. p.m. # # date_fmt -%e %B %Y at %I:%M:%S %p %Z +%a %e %B %Y at %I:%M:%S %p %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_PH.UTF-8.src ============================================================================== --- head/share/timedef/en_PH.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/en_PH.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ Saturday %d/%m/%Y # # c_fmt -%e %B %Y at %I:%M:%S %p +%a %e %B %Y at %I:%M:%S %p # # AM/PM AM PM # # date_fmt -%e %B %Y at %I:%M:%S %p %Z +%a %e %B %Y at %I:%M:%S %p %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_SG.UTF-8.src ============================================================================== --- head/share/timedef/en_SG.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/en_SG.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ Saturday %e/%m/%y # # c_fmt -%e %B %Y at %I:%M:%S %p +%a %e %B %Y at %I:%M:%S %p # # AM/PM AM PM # # date_fmt -%e %B %Y at %I:%M:%S %p %Z +%a %e %B %Y at %I:%M:%S %p %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_US.UTF-8.src ============================================================================== --- head/share/timedef/en_US.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/en_US.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ Saturday %m/%e/%y # # c_fmt -%B %e, %Y at %I:%M:%S %p +%a, %B %e, %Y at %I:%M:%S %p # # AM/PM AM PM # # date_fmt -%B %e, %Y at %I:%M:%S %p %Z +%a, %B %e, %Y at %I:%M:%S %p %Z # # Long month names (without case ending) January Modified: head/share/timedef/fr_BE.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_BE.ISO8859-15.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/fr_BE.ISO8859-15.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ samedi %e/%m/%y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_BE.UTF-8.src ============================================================================== --- head/share/timedef/fr_BE.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/fr_BE.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ samedi %e/%m/%y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_CA.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_CA.ISO8859-15.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/fr_CA.ISO8859-15.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ samedi %y-%m-%d # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_CA.UTF-8.src ============================================================================== --- head/share/timedef/fr_CA.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/fr_CA.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ samedi %y-%m-%d # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_CH.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_CH.ISO8859-15.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/fr_CH.ISO8859-15.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ samedi %d.%m.%y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_CH.UTF-8.src ============================================================================== --- head/share/timedef/fr_CH.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/fr_CH.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ samedi %d.%m.%y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_FR.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_FR.ISO8859-15.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/fr_FR.ISO8859-15.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ samedi %d/%m/%Y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/fr_FR.UTF-8.src ============================================================================== --- head/share/timedef/fr_FR.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/fr_FR.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ samedi %d/%m/%Y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) janvier Modified: head/share/timedef/hi_IN.ISCII-DEV.src ============================================================================== --- head/share/timedef/hi_IN.ISCII-DEV.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/hi_IN.ISCII-DEV.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ %e/%m/%y # # c_fmt -%e %B %Y ³å %I:%M:%S %p +%a %e %B %Y ³å %I:%M:%S %p # # AM/PM ÈÞÏèÔÚØèÆ ¤ÈÏÚØèÆ # # date_fmt -%e %B %Y ³å %I:%M:%S %p %Z +%a %e %B %Y ³å %I:%M:%S %p %Z # # Long month names (without case ending) ºÆÔÏÜ Modified: head/share/timedef/hi_IN.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/it_CH.ISO8859-15.src ============================================================================== --- head/share/timedef/it_CH.ISO8859-15.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/it_CH.ISO8859-15.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ sabato %d.%m.%y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) gennaio Modified: head/share/timedef/it_CH.UTF-8.src ============================================================================== --- head/share/timedef/it_CH.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/it_CH.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ sabato %d.%m.%y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) gennaio Modified: head/share/timedef/it_IT.ISO8859-15.src ============================================================================== --- head/share/timedef/it_IT.ISO8859-15.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/it_IT.ISO8859-15.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ sabato %d/%m/%y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) gennaio Modified: head/share/timedef/it_IT.UTF-8.src ============================================================================== --- head/share/timedef/it_IT.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/it_IT.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ sabato %d/%m/%y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) gennaio Modified: head/share/timedef/kk_Cyrl_KZ.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/nl_BE.UTF-8.src ============================================================================== --- head/share/timedef/nl_BE.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/nl_BE.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ zaterdag %e/%m/%y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM a.m. p.m. # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) januari Modified: head/share/timedef/nl_NL.UTF-8.src ============================================================================== --- head/share/timedef/nl_NL.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/nl_NL.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ zaterdag %d-%m-%y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM a.m. p.m. # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) januari Modified: head/share/timedef/pl_PL.ISO8859-2.src ============================================================================== --- head/share/timedef/pl_PL.ISO8859-2.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/pl_PL.ISO8859-2.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ sobota %d.%m.%Y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) styczeñ Modified: head/share/timedef/pl_PL.UTF-8.src ============================================================================== --- head/share/timedef/pl_PL.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/pl_PL.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ sobota %d.%m.%Y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) styczeÅ„ Modified: head/share/timedef/ro_RO.ISO8859-2.src ============================================================================== --- head/share/timedef/ro_RO.ISO8859-2.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/ro_RO.ISO8859-2.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ sâmbãtã %d.%m.%Y # # c_fmt -%e %B %Y, %H:%M:%S +%a %e %B %Y, %H:%M:%S # # AM/PM a.m. p.m. # # date_fmt -%e %B %Y, %H:%M:%S %Z +%a %e %B %Y, %H:%M:%S %Z # # Long month names (without case ending) ianuarie Modified: head/share/timedef/ro_RO.UTF-8.src ============================================================================== --- head/share/timedef/ro_RO.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/ro_RO.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ sâmbătă %d.%m.%Y # # c_fmt -%e %B %Y, %H:%M:%S +%a %e %B %Y, %H:%M:%S # # AM/PM a.m. p.m. # # date_fmt -%e %B %Y, %H:%M:%S %Z +%a %e %B %Y, %H:%M:%S %Z # # Long month names (without case ending) ianuarie Modified: head/share/timedef/ru_RU.CP1251.src ============================================================================== --- head/share/timedef/ru_RU.CP1251.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/ru_RU.CP1251.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%e %B %Y ã., %H:%M:%S +%a %e %B %Y ã., %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y ã., %H:%M:%S %Z +%a %e %B %Y ã., %H:%M:%S %Z # # Long month names (without case ending) ÿíâàðü Modified: head/share/timedef/ru_RU.CP866.src ============================================================================== --- head/share/timedef/ru_RU.CP866.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/ru_RU.CP866.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%e %B %Y £., %H:%M:%S +%a %e %B %Y £., %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y £., %H:%M:%S %Z +%a %e %B %Y £., %H:%M:%S %Z # # Long month names (without case ending) ï­¢ àì Modified: head/share/timedef/ru_RU.ISO8859-5.src ============================================================================== --- head/share/timedef/ru_RU.ISO8859-5.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/ru_RU.ISO8859-5.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%e %B %Y Ó., %H:%M:%S +%a %e %B %Y Ó., %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y Ó., %H:%M:%S %Z +%a %e %B %Y Ó., %H:%M:%S %Z # # Long month names (without case ending) ïÝÒÐàì Modified: head/share/timedef/ru_RU.KOI8-R.src ============================================================================== --- head/share/timedef/ru_RU.KOI8-R.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/ru_RU.KOI8-R.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%e %B %Y Ç., %H:%M:%S +%a %e %B %Y Ç., %H:%M:%S # # AM/PM AM PM # # date_fmt -%e %B %Y Ç., %H:%M:%S %Z +%a %e %B %Y Ç., %H:%M:%S %Z # # Long month names (without case ending) ÑÎ×ÁÒØ Modified: head/share/timedef/ru_RU.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/sv_FI.ISO8859-15.src ============================================================================== --- head/share/timedef/sv_FI.ISO8859-15.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/sv_FI.ISO8859-15.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ lördag %d-%m-%Y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM fm em # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) januari Modified: head/share/timedef/sv_FI.UTF-8.src ============================================================================== --- head/share/timedef/sv_FI.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/sv_FI.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ lördag %d-%m-%Y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM fm em # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) januari Modified: head/share/timedef/sv_SE.ISO8859-15.src ============================================================================== --- head/share/timedef/sv_SE.ISO8859-15.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/sv_SE.ISO8859-15.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ lördag %Y-%m-%d # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM fm em # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) januari Modified: head/share/timedef/sv_SE.UTF-8.src ============================================================================== --- head/share/timedef/sv_SE.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/sv_SE.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ lördag %Y-%m-%d # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM fm em # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) januari Modified: head/share/timedef/tr_TR.ISO8859-9.src ============================================================================== --- head/share/timedef/tr_TR.ISO8859-9.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/tr_TR.ISO8859-9.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ Cumartesi %e.%m.%Y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM ÖÖ ÖS # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) Ocak Modified: head/share/timedef/tr_TR.UTF-8.src ============================================================================== --- head/share/timedef/tr_TR.UTF-8.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/tr_TR.UTF-8.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ Cumartesi %e.%m.%Y # # c_fmt -%e %B %Y %H:%M:%S +%a %e %B %Y %H:%M:%S # # AM/PM ÖÖ ÖS # # date_fmt -%e %B %Y %H:%M:%S %Z +%a %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) Ocak Modified: head/share/timedef/uk_UA.CP1251.src ============================================================================== --- head/share/timedef/uk_UA.CP1251.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/uk_UA.CP1251.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%e %B %Y ð. %H:%M:%S +%a %e %B %Y ð. %H:%M:%S # # AM/PM äï ïï # # date_fmt -%e %B %Y ð. %H:%M:%S %Z +%a %e %B %Y ð. %H:%M:%S %Z # # Long month names (without case ending) ñ³÷åíü Modified: head/share/timedef/uk_UA.ISO8859-5.src ============================================================================== --- head/share/timedef/uk_UA.ISO8859-5.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/uk_UA.ISO8859-5.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%e %B %Y à. %H:%M:%S +%a %e %B %Y à. %H:%M:%S # # AM/PM Ôß ßß # # date_fmt -%e %B %Y à. %H:%M:%S %Z +%a %e %B %Y à. %H:%M:%S %Z # # Long month names (without case ending) áöçÕÝì Modified: head/share/timedef/uk_UA.KOI8-U.src ============================================================================== --- head/share/timedef/uk_UA.KOI8-U.src Sat May 28 21:25:24 2016 (r300913) +++ head/share/timedef/uk_UA.KOI8-U.src Sat May 28 21:26:50 2016 (r300914) @@ -56,14 +56,14 @@ %d.%m.%y # # c_fmt -%e %B %Y Ò. %H:%M:%S +%a %e %B %Y Ò. %H:%M:%S # # AM/PM ÄÐ ÐÐ # # date_fmt -%e %B %Y Ò. %H:%M:%S %Z +%a %e %B %Y Ò. %H:%M:%S %Z # # Long month names (without case ending) Ó¦ÞÅÎØ Modified: head/share/timedef/uk_UA.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. From owner-svn-src-head@freebsd.org Sat May 28 22:27:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46031B4E3D3; Sat, 28 May 2016 22:27:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13A021DA8; Sat, 28 May 2016 22:27:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SMRs5o023955; Sat, 28 May 2016 22:27:54 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SMRs1i023954; Sat, 28 May 2016 22:27:54 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605282227.u4SMRs1i023954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 28 May 2016 22:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300915 - head/lib/libdevdctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 22:27:55 -0000 Author: bdrewery Date: Sat May 28 22:27:54 2016 New Revision: 300915 URL: https://svnweb.freebsd.org/changeset/base/300915 Log: Avoid literal-suffix error due to missing space. Modified: head/lib/libdevdctl/event.cc Modified: head/lib/libdevdctl/event.cc ============================================================================== --- head/lib/libdevdctl/event.cc Sat May 28 21:26:50 2016 (r300914) +++ head/lib/libdevdctl/event.cc Sat May 28 22:27:54 2016 (r300915) @@ -435,7 +435,7 @@ Event::TimestampEventString(std::string size_t eventEnd(eventString.find_last_not_of('\n') + 1); if (gettimeofday(&now, NULL) != 0) err(1, "gettimeofday"); - snprintf(timebuf, bufsize, " timestamp=%"PRId64, + snprintf(timebuf, bufsize, " timestamp=%" PRId64, (int64_t) now.tv_sec); eventString.insert(eventEnd, timebuf); } From owner-svn-src-head@freebsd.org Sat May 28 23:10:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4B81B4ECAF; Sat, 28 May 2016 23:10:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B225C1F6E; Sat, 28 May 2016 23:10:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4SNA7Tw038938; Sat, 28 May 2016 23:10:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4SNA7Ux038937; Sat, 28 May 2016 23:10:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605282310.u4SNA7Ux038937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 28 May 2016 23:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300917 - 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.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 23:10:09 -0000 Author: bdrewery Date: Sat May 28 23:10:07 2016 New Revision: 300917 URL: https://svnweb.freebsd.org/changeset/base/300917 Log: GCC XCC -isystem hack: Ensure CXX search =/usr/include/c++1/v1 first. The C++ header files must be searched before /usr/include. The original code in Makefile.inc1 did this before the change in r297271 to use -isystem. The libc++ import in r300770 fixed the bug introduced in r297271 by swapping XCFLAGS and XCXXFLAGS ordering in CROSSENV. Moving the code from Makefile.inc1 to bsd.sys.mk in r300886 also made it more difficult to control the order of the flags. CXXFLAGS is based on CFLAGS, so any additions to it will come after CFLAGS. The CROSSENV code from Makefile.inc1 was such that it was ensured the CXXFLAGS came first by setting them directly in CXX. Using CXXFLAGS+=-I would work here, but instead continue to use -isystem by adding it to CXX so it comes before CFLAGS. Reported by: dim Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sat May 28 22:42:56 2016 (r300916) +++ head/share/mk/bsd.sys.mk Sat May 28 23:10:07 2016 (r300917) @@ -198,7 +198,11 @@ LDFLAGS+= -L=/usr/lib # sysroot/usr/lib/libc++.so. .if ${CXXFLAGS:M-nostdinc++} == "" && ${CXXFLAGS:M-nostdlib} == "" CXXFLAGS+= -std=c++11 \ - -nostdinc++ -isystem =/usr/include/c++/v1 + -nostdinc++ +# Need to ensure this path comes before the above -isystem =/usr/include. +# CXXFLAGS is CFLAGS with extra added in, so there's no way to fix the +# ordering otherwise. +CXX+= -isystem =/usr/include/c++/v1 LDFLAGS+= -L${OBJTOP}/lib/libc++ .endif .endif # --sysroot