From owner-svn-src-all@freebsd.org  Sun Dec 11 00:10:03 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3303C71E85
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Sun, 11 Dec 2016 00:10:03 +0000 (UTC)
 (envelope-from oliver.pinter@hardenedbsd.org)
Received: from mail-wj0-x22b.google.com (mail-wj0-x22b.google.com
 [IPv6:2a00:1450:400c:c01::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 8AF561F6C
 for <svn-src-all@freebsd.org>; Sun, 11 Dec 2016 00:10:03 +0000 (UTC)
 (envelope-from oliver.pinter@hardenedbsd.org)
Received: by mail-wj0-x22b.google.com with SMTP id xy5so43474380wjc.0
 for <svn-src-all@freebsd.org>; Sat, 10 Dec 2016 16:10:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=Rm06EQAlXAYAHeR/KOMwG3/D9uZ1loTKZEC9LRJydlE=;
 b=A/MJOf+D/eP1bpSIjWKLhLhB2+k85kvEdEHNc5uivr8bY85FXcCJLz+bFu0AkiNuTk
 Du/PjIEu984QJpDGyY3VhH4t5N4l0/vIEYt/Y+OndyBqqZKIOoGS5sEZ9PCYDV/QznX/
 D0WbDJamMAk++eWA2mKIihZa2GCyVd0GXJEDfuFbciHlevWvqhQs+/GMxIcPBCbU7JfA
 ywUUThuLcVk0TUFDV9mU1t4ZHWxyjThXSVvsj0nO8SZT/lTt3FiDCtWGEWZdOMlz5x7f
 iGbKRq2KymxvvI2wbqBjVDVyjPDPHkbArWQlJM8rD/gk+Jkd7Cl4DE/ydHSdZUI5tw3a
 vQig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=Rm06EQAlXAYAHeR/KOMwG3/D9uZ1loTKZEC9LRJydlE=;
 b=PywCYo2l4MWLh8GQQIqHfjLiX8cqUWGWssb6Fwm8mh29hUEpJy16HozZ9wEpwMGF9W
 cglvDupIGSgCp8J1uLlUgFW8fDFrfOfR8tY4HuwV+iJ7V/SpYGm/MFwjOUbkQwS9EVh5
 iqJaQ4zzCAgUcRQPQ3JQCylg2x1KMUmlV0rtWiYo+hxQFurrfSJngVUJmpcR+ZW08Nd5
 1LZbudQM3cOjkhOeeBNjcDnK1jROcde4Wa+GOgB+bW7DTMNjfqG000nZQKTJqvPcIh5f
 IpDw9WVIRp/n6/UfgwCz+1SKFdo/Itm+FnrfVWgNzCpSdZhNodgaXN7vCWapGrMNhHvb
 t47A==
X-Gm-Message-State: AKaTC01qSmPD3AFv6VF6gNQm7P3siUPiEXDBF2SLAbXQ/eaKdBwfX9X1AknvWpZDIzOAwtHbDPDx9IFt8UM9sIIE
X-Received: by 10.194.87.103 with SMTP id w7mr50171272wjz.164.1481415001986;
 Sat, 10 Dec 2016 16:10:01 -0800 (PST)
MIME-Version: 1.0
Received: by 10.194.253.65 with HTTP; Sat, 10 Dec 2016 16:10:01 -0800 (PST)
In-Reply-To: <201610221437.u9MEbDLR070111@repo.freebsd.org>
References: <201610221437.u9MEbDLR070111@repo.freebsd.org>
From: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Date: Sun, 11 Dec 2016 01:10:01 +0100
Message-ID: <CAPQ4ffsna0naq9QMRB9vKGoUpTB+Ph0dyAzS3uY-W5OYFFV65g@mail.gmail.com>
Subject: Re: svn commit: r307774 - head/lib/libusb
To: Edward Tomasz Napierala <trasz@freebsd.org>
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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 00:10:04 -0000

On 10/22/16, Edward Tomasz Napierala <trasz@freebsd.org> wrote:
> Author: trasz
> Date: Sat Oct 22 14:37:13 2016
> New Revision: 307774
> URL: https://svnweb.freebsd.org/changeset/base/307774
>
> Log:
>   Fix libusb20_dev_get_desc(3) to use the "vendor product" order, not
>   "product vendor". This is consistent with how it's generally done.
>   The ordering is visible eg in usbconfig(8) output.
>
>   Note to self: MFC this to 9 and 8.
>
>   Reviewed by:	hselasky@
>   MFC after:	1 month

Is this MFC still valid? I can't see them in 10-STABLE nor in 11-STABLE.

>   Differential Revision:	https://reviews.freebsd.org/D8258
>
> Modified:
>   head/lib/libusb/libusb20_ugen20.c
>
> Modified: head/lib/libusb/libusb20_ugen20.c
> ==============================================================================
> --- head/lib/libusb/libusb20_ugen20.c	Sat Oct 22 13:20:02 2016	(r307773)
> +++ head/lib/libusb/libusb20_ugen20.c	Sat Oct 22 14:37:13 2016	(r307774)
> @@ -214,8 +214,8 @@ ugen20_enumerate(struct libusb20_device
>
>  	snprintf(pdev->usb_desc, sizeof(pdev->usb_desc),
>  	    USB_GENERIC_NAME "%u.%u: <%s %s> at usbus%u", pdev->bus_number,
> -	    pdev->device_address, devinfo.udi_product,
> -	    devinfo.udi_vendor, pdev->bus_number);
> +	    pdev->device_address, devinfo.udi_vendor,
> +	    devinfo.udi_product, pdev->bus_number);
>
>  	error = 0;
>  done:
> _______________________________________________
> 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-all@freebsd.org  Sun Dec 11 00:10:54 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47675C71EDF
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Sun, 11 Dec 2016 00:10:54 +0000 (UTC)
 (envelope-from oliver.pinter@hardenedbsd.org)
Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com
 [IPv6:2a00:1450:400c:c09::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 D2963182
 for <svn-src-all@freebsd.org>; Sun, 11 Dec 2016 00:10:53 +0000 (UTC)
 (envelope-from oliver.pinter@hardenedbsd.org)
Received: by mail-wm0-x232.google.com with SMTP id t79so19662427wmt.0
 for <svn-src-all@freebsd.org>; Sat, 10 Dec 2016 16:10:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=7qjO5ZUGYBZiCGElrvZ/ypy8gM3HB9U3WpWRI239EXY=;
 b=EDwZB3a4bPJSzb62PpnJw6CroQ5xT/bfOquOudcSf9OeEiWkWeyiIVzPJ+Yg3QhQJZ
 Lz2SxpBFFrc869kC1csWkUAB9t06TdF53+IGd4ILvAdPEwhoq4T3ksK1s2i0btEGzcrc
 kdvCsuxvZdI/S7Wyz9P+txVRPZ/l4mee8pQ4nn3bG3lV6j++Ma4cnyh4n3yYqUB0ZHSf
 oz2PMYiOqN4oisbIjupGe38CaEyaHz3UbOtGglB8Dzp503LFW4XMOlj/F1yFK7xI379T
 6WBg9h1JClOSnufn55angDzGxT+ZmHsFDJjpxTPwaPWmYGgWmYC399Rdg4OLsoBNql5w
 0NuA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=7qjO5ZUGYBZiCGElrvZ/ypy8gM3HB9U3WpWRI239EXY=;
 b=e7a1etOBjJA6Ohn88m6aNDl2Btn8ynYnKrrmvZSMnKeTwtc+DXWWkI4m+GZUjVBr1j
 yX6bors7kBkiMzkU6S/gkxvSlppezJmnAh0a9eM58U2/ZDimzF7PG1XNFIPJytNd+PFQ
 rKOEFv//stzWwembyM4qCKT+mNEE3J3lXKAEQp7Mfs3Am3FPVfXQQmwwk3I4RvuTQdLv
 tnotCD5LlbHxR2Lbtipp+HANXmajgjR4Y+E2/QPEY/Lcg3X89IrZ/OYQWJdZqYqrRGoo
 LeUTsT93Gh+SxPzMCR2A81Wvkeg5228ik3E0ciLU02RubiNDv+Z+EN2LaMiHhL5nJr18
 v+Cg==
X-Gm-Message-State: AKaTC00HDyyogsROXxAJldOccZTk6IxEjTJbRd5nV2fIpDl8cTTMUETmm9wYrJQORylAGBTkoB/QdPN5XYsVWuRM
X-Received: by 10.28.18.194 with SMTP id 185mr3593953wms.124.1481415052252;
 Sat, 10 Dec 2016 16:10:52 -0800 (PST)
MIME-Version: 1.0
Received: by 10.194.253.65 with HTTP; Sat, 10 Dec 2016 16:10:51 -0800 (PST)
In-Reply-To: <CAPQ4ffsna0naq9QMRB9vKGoUpTB+Ph0dyAzS3uY-W5OYFFV65g@mail.gmail.com>
References: <201610221437.u9MEbDLR070111@repo.freebsd.org>
 <CAPQ4ffsna0naq9QMRB9vKGoUpTB+Ph0dyAzS3uY-W5OYFFV65g@mail.gmail.com>
From: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Date: Sun, 11 Dec 2016 01:10:51 +0100
Message-ID: <CAPQ4ffug116y6fLyNzU=m+g-w31WC1gX5Y2frJO-DUGotZMnfw@mail.gmail.com>
Subject: Re: svn commit: r307774 - head/lib/libusb
To: Edward Tomasz Napierala <trasz@freebsd.org>
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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 00:10:54 -0000

On 12/11/16, Oliver Pinter <oliver.pinter@hardenedbsd.org> wrote:
> On 10/22/16, Edward Tomasz Napierala <trasz@freebsd.org> wrote:
>> Author: trasz
>> Date: Sat Oct 22 14:37:13 2016
>> New Revision: 307774
>> URL: https://svnweb.freebsd.org/changeset/base/307774
>>
>> Log:
>>   Fix libusb20_dev_get_desc(3) to use the "vendor product" order, not
>>   "product vendor". This is consistent with how it's generally done.
>>   The ordering is visible eg in usbconfig(8) output.
>>
>>   Note to self: MFC this to 9 and 8.
>>
>>   Reviewed by:	hselasky@
>>   MFC after:	1 month
>
> Is this MFC still valid? I can't see them in 10-STABLE nor in 11-STABLE.
s/can't/not/

>
>>   Differential Revision:	https://reviews.freebsd.org/D8258
>>
>> Modified:
>>   head/lib/libusb/libusb20_ugen20.c
>>
>> Modified: head/lib/libusb/libusb20_ugen20.c
>> ==============================================================================
>> --- head/lib/libusb/libusb20_ugen20.c	Sat Oct 22 13:20:02 2016	(r307773)
>> +++ head/lib/libusb/libusb20_ugen20.c	Sat Oct 22 14:37:13 2016	(r307774)
>> @@ -214,8 +214,8 @@ ugen20_enumerate(struct libusb20_device
>>
>>  	snprintf(pdev->usb_desc, sizeof(pdev->usb_desc),
>>  	    USB_GENERIC_NAME "%u.%u: <%s %s> at usbus%u", pdev->bus_number,
>> -	    pdev->device_address, devinfo.udi_product,
>> -	    devinfo.udi_vendor, pdev->bus_number);
>> +	    pdev->device_address, devinfo.udi_vendor,
>> +	    devinfo.udi_product, pdev->bus_number);
>>
>>  	error = 0;
>>  done:
>> _______________________________________________
>> 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-all@freebsd.org  Sun Dec 11 00:19:44 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95D2CC650B4
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Sun, 11 Dec 2016 00:19:44 +0000 (UTC)
 (envelope-from oliver.pinter@hardenedbsd.org)
Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com
 [IPv6:2a00:1450:400c:c09::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 2E885849
 for <svn-src-all@freebsd.org>; Sun, 11 Dec 2016 00:19:44 +0000 (UTC)
 (envelope-from oliver.pinter@hardenedbsd.org)
Received: by mail-wm0-x22e.google.com with SMTP id a197so17589743wmd.0
 for <svn-src-all@freebsd.org>; Sat, 10 Dec 2016 16:19:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=og0gCAmRnVUPzRqlHUHUOz50fyunlLsLdXVK+0Elaog=;
 b=Wv0Vax+h2MRpMDQuA7aFSK/QgEM81vsbKa4Di/ZnBt/OpjWNOxKhE9t0JuuW0PKH43
 UufEoZ8YVVKOFXcvxUibgRCCPNZfW+eamjhlVCj8PYdqPCriuVuyMI4ruL43MooD6Stg
 muMNxURBknZCrDdMzXKmhLzy2tQg9nxtECl25pm328KBUuLdc/mNbZzRhtcy28p1tTU+
 N+2h2guZx/0lU94kMh7P73HWY3H/ExJ8KfdNf//cK7b5gNxZ61hgm5OEjNzrzm0P0psI
 odIlfNXWYrvHF/DvFVcvIPngwpQRMP89SopON9K8LSEjKBUJhRoSEaNlcfnhVtyE4cra
 GGcQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=og0gCAmRnVUPzRqlHUHUOz50fyunlLsLdXVK+0Elaog=;
 b=dxc8ylf+Zwsy/r5NZXwbeafamB8GPsTTUXqa0+HXbqfKu0CBzq9/PvbwJziYLcVmWe
 igYVs8xawcz5Ar+wSf6ZXFJ3Vy3GS03FOwv0CnSYpHWKJcPh1xZrj8UnVTEq5ctCrG7V
 6rRu2+VhqbqghU96Ri4qzRPK/Lacb44KXsslHZrfT5tI2FRIXlkiq5Y+vgiw3PTYBRrc
 THSSWRR1GrO4jc2bzWu+heivwYEsV7sms7wbD3M6trp0oSlwMmIEaIf98vkAZYqde4UC
 MBU+9z/5M38ZT7BCFd5IfVtKbSFgAUBycr9cNHdL4bzRNBumllyHLn+twAn+yM2SK4ED
 Ofiw==
X-Gm-Message-State: AKaTC00ln4Rm9wcxREhp2D7unJj7H/nwt07huW25GDyZTJw6Cl8GivNejlCsbLuocz4Rv4stX06w491imvr4K5v6
X-Received: by 10.28.39.199 with SMTP id n190mr11553216wmn.124.1481415582573; 
 Sat, 10 Dec 2016 16:19:42 -0800 (PST)
MIME-Version: 1.0
Received: by 10.194.253.65 with HTTP; Sat, 10 Dec 2016 16:19:42 -0800 (PST)
In-Reply-To: <201610242105.u9OL5NdK013428@repo.freebsd.org>
References: <201610242105.u9OL5NdK013428@repo.freebsd.org>
From: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Date: Sun, 11 Dec 2016 01:19:42 +0100
Message-ID: <CAPQ4fft3-=twkurMnMT8zH5uTrBpUE5pm7GS4bbbhgOv7j1v6Q@mail.gmail.com>
Subject: Re: svn commit: r307882 - head/contrib/bsnmp/lib
To: Shteryana Shopova <syrinx@freebsd.org>, ngie@freebsd.org
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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 00:19:44 -0000

On 10/24/16, Shteryana Shopova <syrinx@freebsd.org> wrote:
> Author: syrinx
> Date: Mon Oct 24 21:05:23 2016
> New Revision: 307882
> URL: https://svnweb.freebsd.org/changeset/base/307882
>
> Log:
>   Fix a regression introduced in SVN r256678 that breaks USM header parsing

The r256678 commit was already MFCd back to 10-STABLE by ngie@ but
this commit does not marked as MFC to 10-STABLE, and missing from
10-STABLE.

>
>   Reviewed by:	bz@
>
> Modified:
>   head/contrib/bsnmp/lib/snmp.c
>
> Modified: head/contrib/bsnmp/lib/snmp.c
> ==============================================================================
> --- head/contrib/bsnmp/lib/snmp.c	Mon Oct 24 20:53:44 2016	(r307881)
> +++ head/contrib/bsnmp/lib/snmp.c	Mon Oct 24 21:05:23 2016	(r307882)
> @@ -288,7 +288,7 @@ parse_secparams(struct asn_buf *b, struc
>  	memset(buf, 0, 256);
>  	tb.asn_ptr = buf;
>  	tb.asn_len = 256;
> -	u_int len;
> +	u_int len = 256;
>
>  	if (asn_get_octetstring(b, buf, &len) != ASN_ERR_OK) {
>  		snmp_error("cannot parse usm header");
> _______________________________________________
> 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-all@freebsd.org  Sun Dec 11 00:39:47 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D20DC658DB
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Sun, 11 Dec 2016 00:39:47 +0000 (UTC)
 (envelope-from oliver.pinter@hardenedbsd.org)
Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com
 [IPv6:2a00:1450:400c:c09::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 287F011AC
 for <svn-src-all@freebsd.org>; Sun, 11 Dec 2016 00:39:46 +0000 (UTC)
 (envelope-from oliver.pinter@hardenedbsd.org)
Received: by mail-wm0-x229.google.com with SMTP id f82so19939567wmf.1
 for <svn-src-all@freebsd.org>; Sat, 10 Dec 2016 16:39:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=/9LPNTLiryahzmBlogVqClB3y0rEPmqSnLE8v+Byjj0=;
 b=Tj8JTtBCsJCao+uj8kna+oPS+Myjc+ihxNF+Nx04WNkqG/uyZw9JheoKquFtjH4u+e
 dz3dmq0F5mpLbRmGeHJhrUAOGgzNPFf+jrfaZakq0oVxVLN3AdHrlzWzjC8CglJE5/XK
 BvhoYFn8o6MtIy07TFDgpC08xkufl8rg9okzPBwf0j6K2Fiup8csMhTX3asqw7M3ZZn6
 xRk0luVAXWXVGgAMWVYLcfUDvL3QNa5C5DvWZbqcWSFLZeOHQijyjigM4hd+Ka6ee8Jb
 ewFYiNPX2lJLWmpULyI9755v1e8yDKLgolq6NJG2HY4LPRPwOIKFJ2NywffFficBOzuY
 EzFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=/9LPNTLiryahzmBlogVqClB3y0rEPmqSnLE8v+Byjj0=;
 b=c8kkj8h6Eqs/WbVNX9OMAxgxuVKieApWgnomD6QyWAJEZ8N4Cuu3ddZxwv7VTBv26l
 5o50ss6MrX1nOHyKS2x5tivFJNDtYrvaXQ6dH3y9BgkGHEZMjcJtdce5IYyhjShIgtCH
 FwMVMLTintMM8o6UOldGvYPOo8hZHoz0bRiiV4Sd/m6zfGzlBXZ3DBtYBAnqFctScrkQ
 6U3XyHBtc3xbPA9Xc9tx+IVCWhhhY0HcjhPhMXuJ3A5jg8qyxqW1R+Cc0BBR12bZXfD5
 TZmNx9NKq7wIW2LqZGEWAS5N48P2iq5YWrp0boF9hDfw9HumH39PchPPlYRJT1X9i1Pn
 5Y3g==
X-Gm-Message-State: AKaTC02sFtSxt1bv81AhICc0d+t+y6a3zLN9fruuflov9JrdJwWGriK4bzBts64viDXwFXbRwzom6OSxyT2WQKrR
X-Received: by 10.28.18.129 with SMTP id 123mr11539976wms.2.1481416785304;
 Sat, 10 Dec 2016 16:39:45 -0800 (PST)
MIME-Version: 1.0
Received: by 10.194.253.65 with HTTP; Sat, 10 Dec 2016 16:39:44 -0800 (PST)
In-Reply-To: <201611052015.uA5KFxZM068332@repo.freebsd.org>
References: <201611052015.uA5KFxZM068332@repo.freebsd.org>
From: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Date: Sun, 11 Dec 2016 01:39:44 +0100
Message-ID: <CAPQ4ffuzTSm5z4TuLpCCDTJZRB5wO_5=ULaTZ675UK1=AEzSEw@mail.gmail.com>
Subject: Re: svn commit: r308350 - stable/11/sys/kern
To: Mark Johnston <markj@freebsd.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, 
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Content-Type: text/plain; charset=UTF-8
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 00:39:47 -0000

On 11/5/16, Mark Johnston <markj@freebsd.org> wrote:
> Author: markj
> Date: Sat Nov  5 20:15:58 2016
> New Revision: 308350
> URL: https://svnweb.freebsd.org/changeset/base/308350
>
> Log:
>   MFC r308097:
>   Fix WITNESS hints for pagequeue locks.

I think this commit required for 10-STABLE too:

op@opn hardenedBSD.git> git grep "vm pagequeue"
sys/vm/vm_page.c:               mtx_init(&pq->pq_mutex, pq->pq_name,
"vm pagequeue",
op@opn hardenedBSD.git> git grep "vm page queue"
sys/kern/subr_witness.c:        { "vm page queue", &lock_class_mtx_sleep },
sys/kern/subr_witness.c:        { "vm page queue", &lock_class_mtx_sleep },
op@opn hardenedBSD.git>

It would be nice to MFC them to 10-STABLE too.

>
> Modified:
>   stable/11/sys/kern/subr_witness.c
> Directory Properties:
>   stable/11/   (props changed)
>
> Modified: stable/11/sys/kern/subr_witness.c
> ==============================================================================
> --- stable/11/sys/kern/subr_witness.c	Sat Nov  5 20:14:23 2016	(r308349)
> +++ stable/11/sys/kern/subr_witness.c	Sat Nov  5 20:15:58 2016	(r308350)
> @@ -599,7 +599,7 @@ static struct witness_order_list_entry o
>  	 * CDEV
>  	 */
>  	{ "vm map (system)", &lock_class_mtx_sleep },
> -	{ "vm page queue", &lock_class_mtx_sleep },
> +	{ "vm pagequeue", &lock_class_mtx_sleep },
>  	{ "vnode interlock", &lock_class_mtx_sleep },
>  	{ "cdev", &lock_class_mtx_sleep },
>  	{ NULL, NULL },
> @@ -609,7 +609,7 @@ static struct witness_order_list_entry o
>  	{ "vm map (user)", &lock_class_sx },
>  	{ "vm object", &lock_class_rw },
>  	{ "vm page", &lock_class_mtx_sleep },
> -	{ "vm page queue", &lock_class_mtx_sleep },
> +	{ "vm pagequeue", &lock_class_mtx_sleep },
>  	{ "pmap pv global", &lock_class_rw },
>  	{ "pmap", &lock_class_mtx_sleep },
>  	{ "pmap pv list", &lock_class_rw },
> _______________________________________________
> svn-src-stable-11@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11
> To unsubscribe, send any mail to
> "svn-src-stable-11-unsubscribe@freebsd.org"
>

From owner-svn-src-all@freebsd.org  Sun Dec 11 00:59:01 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98372C65EA6
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Sun, 11 Dec 2016 00:59:01 +0000 (UTC)
 (envelope-from oliver.pinter@hardenedbsd.org)
Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com
 [IPv6:2a00:1450:400c:c09::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 23BEA1BA8
 for <svn-src-all@freebsd.org>; Sun, 11 Dec 2016 00:59:01 +0000 (UTC)
 (envelope-from oliver.pinter@hardenedbsd.org)
Received: by mail-wm0-x22e.google.com with SMTP id f82so20124017wmf.1
 for <svn-src-all@freebsd.org>; Sat, 10 Dec 2016 16:59:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=vFlNSqshlnXUZvZW3tOxjCvO/O5p45LWBlrUXVtU3Ww=;
 b=lmMwHo6tvNcvj5BbPhXCH2neMQG8U7GjTgXEY0ZmuUg7FhQYABsqLtBAKzUsUEAXU6
 EkE04pDc/0aQpoON5KGTU9oUFVW0eC6PGail83syAZ59UKJZQEGdUwk0QEVnUYfUzr2Q
 DdmAx82id384F8/1Kf8x7P+sMIjInrYlzEFivRqSHablb/4mvu4t3UpIG+4gm8X5X25V
 cEGXpkzKEgouTd/28SQ/0IX3J7bbr9FrmlxQiZq/hx4Ay1zmNDhWg3oJ8JsvdhmcVdNm
 ZM+mMTryy4m3bjRoz4gYMj3sr1JoRFHFO1/TfwTgAWoMV7EWCbAhr06s9YxhY28Bj+gz
 9kQw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=vFlNSqshlnXUZvZW3tOxjCvO/O5p45LWBlrUXVtU3Ww=;
 b=VOF3yHA+1/o29NRcEl5GnPzhgwgsbJt9xVWsYJpZkfy3uFH/qlkd82P/ppII3JGh5t
 2rfBydYgultP6f1fzz+YgWv3mgU5/yzfZLpAaD5vKysNXDDN0ZnaOCMoP5DOu4m5YkN0
 fEu4McObVO5YvKzCspaoYdPUOctgN6fvAYbNIE62s9pOxxVQG+CirZRPta+tgSP44TRl
 1Qcf9YOnBiD/Ku2zzGLXnxOF9UioH7/G1KHqpwa0qrM3WEV+ut4cbMkg7pllw1UZfE9T
 53C+ioF61Sl4RPVlbeRgIbdR+6yQo47anphMV3f/ro9zBkZu5CgdstADWyXBHNZHbvC2
 cTCQ==
X-Gm-Message-State: AKaTC029/TuOuKbR69ICQOwwroEx2SiZsyksToZ1nm0c0sGoBkTKEsxgOLxH6EkAuD2LLZBQBNbj0WKQYrDleIy6
X-Received: by 10.28.143.20 with SMTP id r20mr3637957wmd.2.1481417939484; Sat,
 10 Dec 2016 16:58:59 -0800 (PST)
MIME-Version: 1.0
Received: by 10.194.253.65 with HTTP; Sat, 10 Dec 2016 16:58:58 -0800 (PST)
In-Reply-To: <201611041656.uA4GuaZF028619@repo.freebsd.org>
References: <201611041656.uA4GuaZF028619@repo.freebsd.org>
From: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Date: Sun, 11 Dec 2016 01:58:58 +0100
Message-ID: <CAPQ4fftCWc3asYe2dm72=j4Je8087nZGAtj9RJ9D2ri3hBMGKQ@mail.gmail.com>
Subject: Re: svn commit: r308296 - head/sys/cam/scsi
To: Scott Long <scottl@freebsd.org>
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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 00:59:01 -0000

On 11/4/16, Scott Long <scottl@freebsd.org> wrote:
> Author: scottl
> Date: Fri Nov  4 16:56:36 2016
> New Revision: 308296
> URL: https://svnweb.freebsd.org/changeset/base/308296
>
> Log:
>   asc/ascq 44/0 is typically a non-transient, permanent error (at least
> until
>   the components are reset).  Therefore retries are pointless.  This is
> very
>   visible in SATL systems, for example an LSI SAS controller and a SATA
> HDD/SSD.
>
>   Reviewed by:	ken
>   Obtained from:	Netflix
>   MFC after:	3 days

Hi Scott!

What's the status of the MFCs to 10-STABLE and 11-STABLE?

>
> Modified:
>   head/sys/cam/scsi/scsi_all.c
>
> Modified: head/sys/cam/scsi/scsi_all.c
> ==============================================================================
> --- head/sys/cam/scsi/scsi_all.c	Fri Nov  4 16:24:38 2016	(r308295)
> +++ head/sys/cam/scsi/scsi_all.c	Fri Nov  4 16:56:36 2016	(r308296)
> @@ -2331,7 +2331,7 @@ static struct asc_table_entry asc_table[
>  	{ SST(0x43, 0x00, SS_RDEF,
>  	    "Message error") },
>  	/* DTLPWROMAEBKVF */
> -	{ SST(0x44, 0x00, SS_RDEF,
> +	{ SST(0x44, 0x00, SS_FATAL | EIO,
>  	    "Internal target failure") },
>  	/* DT P   MAEBKVF */
>  	{ SST(0x44, 0x01, SS_RDEF,	/* XXX TBD */
> _______________________________________________
> 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-all@freebsd.org  Sun Dec 11 01:28:44 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED613C656B8;
 Sun, 11 Dec 2016 01:28:44 +0000 (UTC) (envelope-from devin@shxd.cx)
Received: from shxd.cx (mail.shxd.cx [64.201.244.140])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D21ECD76;
 Sun, 11 Dec 2016 01:28:44 +0000 (UTC) (envelope-from devin@shxd.cx)
Received: from mobile-166-137-177-238.mycingular.net ([166.137.177.238]:25506
 helo=[10.149.1.141]) by shxd.cx with esmtps (TLSv1:AES256-SHA:256)
 (Exim 4.77 (FreeBSD)) (envelope-from <devin@shxd.cx>)
 id 1cFswP-0001pn-Un; Sun, 11 Dec 2016 01:28:38 +0000
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (1.0)
Subject: Re: svn commit: r307402 - head/usr.sbin/bsdconfig/share
From: Devin Teske <devin@shxd.cx>
X-Mailer: iPhone Mail (13G36)
In-Reply-To: <CAPQ4ffvne84QnxGQztEjO9g8Ft13SdwxkHaPG_awki66pH54LA@mail.gmail.com>
Date: Sat, 10 Dec 2016 17:28:37 -0800
Cc: Devin Teske <dteske@freebsd.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <46C04841-93F2-462E-BC1B-0E742CA48D69@shxd.cx>
References: <201610162059.u9GKxSr2065027@repo.freebsd.org>
 <CAPQ4ffvne84QnxGQztEjO9g8Ft13SdwxkHaPG_awki66pH54LA@mail.gmail.com>
To: Oliver Pinter <oliver.pinter@hardenedbsd.org>
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 01:28:45 -0000

I'm out of work and applying for jobs, so please be patient

--=20
Devin

>> On Dec 10, 2016, at 3:25 PM, Oliver Pinter <oliver.pinter@hardenedbsd.org=
> wrote:
>>=20
>> On 10/16/16, Devin Teske <dteske@freebsd.org> wrote:
>> Author: dteske
>> Date: Sun Oct 16 20:59:28 2016
>> New Revision: 307402
>> URL: https://svnweb.freebsd.org/changeset/base/307402
>>=20
>> Log:
>> Guard against bad service name argument(s) to load_rc_config()
>>=20
>> MFC after:    3 days
>> X-MFC-to:    stable/11 stable/10
>=20
> Is this MFC still needed? The 3 days already expired.
>=20
>>=20
>> Modified:
>> head/usr.sbin/bsdconfig/share/sysrc.subr
>>=20
>> Modified: head/usr.sbin/bsdconfig/share/sysrc.subr
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=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/bsdconfig/share/sysrc.subr    Sun Oct 16 19:50:10
>> 2016    (r307401)
>> +++ head/usr.sbin/bsdconfig/share/sysrc.subr    Sun Oct 16 20:59:28
>> 2016    (r307402)
>> @@ -256,7 +256,9 @@ f_sysrc_service_configs()
>>           last_name=3D
>>           print_name() {
>>               local name=3D"$1"
>> -                [ "$name" =3D "$last_name" ] && return
>> +                case "$name" in
>> +                ""|.|..|*/*|"$last_name") return ;;
>> +                esac
>>               echo "$name" >&9
>>               last_name=3D"$name"
>>           }
>> _______________________________________________
>> 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"
>=20


From owner-svn-src-all@freebsd.org  Sun Dec 11 02:01:58 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 854BEC65FFD;
 Sun, 11 Dec 2016 02:01:58 +0000 (UTC)
 (envelope-from rpokala@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4D9EC1B16;
 Sun, 11 Dec 2016 02:01:58 +0000 (UTC)
 (envelope-from rpokala@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBB21vA4068791;
 Sun, 11 Dec 2016 02:01:57 GMT (envelope-from rpokala@FreeBSD.org)
Received: (from rpokala@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBB21vvF068789;
 Sun, 11 Dec 2016 02:01:57 GMT (envelope-from rpokala@FreeBSD.org)
Message-Id: <201612110201.uBB21vvF068789@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rpokala set sender to
 rpokala@FreeBSD.org using -f
From: Ravi Pokala <rpokala@FreeBSD.org>
Date: Sun, 11 Dec 2016 02:01:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309841 - in stable/11/sys/modules: . bios
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 02:01:58 -0000

Author: rpokala
Date: Sun Dec 11 02:01:57 2016
New Revision: 309841
URL: https://svnweb.freebsd.org/changeset/base/309841

Log:
  MFC r309491: Build smbios.ko as a module for amd64 and i386
  
  For whatever reason, smapi, smbios, vpd are all under the "bios" directory.
  smapi is only for i386, so the entire "bios" directory is only built for
  i386. Break smapi out, and make only it i386-specific. Then, build the
  "bios" directory for both amd64 and i386.

Modified:
  stable/11/sys/modules/Makefile
  stable/11/sys/modules/bios/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/modules/Makefile
==============================================================================
--- stable/11/sys/modules/Makefile	Sat Dec 10 23:58:14 2016	(r309840)
+++ stable/11/sys/modules/Makefile	Sun Dec 11 02:01:57 2016	(r309841)
@@ -544,6 +544,7 @@ _igb=		igb
 _agp=		agp
 _an=		an
 _aout=		aout
+_bios=		bios
 _bktr=		bktr
 _bxe=		bxe
 _cardbus=	cardbus
@@ -726,7 +727,6 @@ _wds=		wds
 .if ${MK_EISA} != "no"
 _ahb=		ahb
 .endif
-_bios=		bios
 _cm=		cm
 .if ${MK_SOURCELESS_UCODE} != "no"
 _ctau=		ctau

Modified: stable/11/sys/modules/bios/Makefile
==============================================================================
--- stable/11/sys/modules/bios/Makefile	Sat Dec 10 23:58:14 2016	(r309840)
+++ stable/11/sys/modules/bios/Makefile	Sun Dec 11 02:01:57 2016	(r309841)
@@ -1,6 +1,10 @@
 # $FreeBSD$
 #
 
-SUBDIR=	smapi smbios vpd
+SUBDIR=	smbios vpd
+
+.if ${MACHINE_ARCH} == "i386"
+SUBDIR+=	smapi
+.endif
 
 .include <bsd.subdir.mk>

From owner-svn-src-all@freebsd.org  Sun Dec 11 02:02:01 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06581C6F01D;
 Sun, 11 Dec 2016 02:02:01 +0000 (UTC)
 (envelope-from rpokala@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C9BB11B22;
 Sun, 11 Dec 2016 02:02:00 +0000 (UTC)
 (envelope-from rpokala@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBB2207E068837;
 Sun, 11 Dec 2016 02:02:00 GMT (envelope-from rpokala@FreeBSD.org)
Received: (from rpokala@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBB21xFX068835;
 Sun, 11 Dec 2016 02:01:59 GMT (envelope-from rpokala@FreeBSD.org)
Message-Id: <201612110201.uBB21xFX068835@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rpokala set sender to
 rpokala@FreeBSD.org using -f
From: Ravi Pokala <rpokala@FreeBSD.org>
Date: Sun, 11 Dec 2016 02:01:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309842 - in stable/10/sys/modules: . bios
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 02:02:01 -0000

Author: rpokala
Date: Sun Dec 11 02:01:59 2016
New Revision: 309842
URL: https://svnweb.freebsd.org/changeset/base/309842

Log:
  MFC r309491: Build smbios.ko as a module for amd64 and i386
  
  For whatever reason, smapi, smbios, vpd are all under the "bios" directory.
  smapi is only for i386, so the entire "bios" directory is only built for
  i386. Break smapi out, and make only it i386-specific. Then, build the
  "bios" directory for both amd64 and i386.
  
  Because 'sys/modules/Makefile' was refactored after stable/10 was branched,
  the diff for that file is different from that of the original commit. They
  are functionally equivalent.

Modified:
  stable/10/sys/modules/Makefile
  stable/10/sys/modules/bios/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/modules/Makefile
==============================================================================
--- stable/10/sys/modules/Makefile	Sun Dec 11 02:01:57 2016	(r309841)
+++ stable/10/sys/modules/Makefile	Sun Dec 11 02:01:59 2016	(r309842)
@@ -683,6 +683,7 @@ _amdsbwd=	amdsbwd
 _amdtemp=	amdtemp
 _arcmsr=	arcmsr
 _asmc=		asmc
+_bios=		bios
 _bktr=		bktr
 _bxe=		bxe
 _cardbus=	cardbus

Modified: stable/10/sys/modules/bios/Makefile
==============================================================================
--- stable/10/sys/modules/bios/Makefile	Sun Dec 11 02:01:57 2016	(r309841)
+++ stable/10/sys/modules/bios/Makefile	Sun Dec 11 02:01:59 2016	(r309842)
@@ -1,6 +1,10 @@
 # $FreeBSD$
 #
 
-SUBDIR=	smapi smbios vpd
+SUBDIR=	smbios vpd
+
+.if ${MACHINE_ARCH} == "i386"
+SUBDIR+=	smapi
+.endif
 
 .include <bsd.subdir.mk>

From owner-svn-src-all@freebsd.org  Sun Dec 11 03:57:24 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 923D7C65E08;
 Sun, 11 Dec 2016 03:57:24 +0000 (UTC)
 (envelope-from marcel@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4E6D0ED4;
 Sun, 11 Dec 2016 03:57:24 +0000 (UTC)
 (envelope-from marcel@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBB3vNjH016607;
 Sun, 11 Dec 2016 03:57:23 GMT (envelope-from marcel@FreeBSD.org)
Received: (from marcel@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBB3vMZi016590;
 Sun, 11 Dec 2016 03:57:22 GMT (envelope-from marcel@FreeBSD.org)
Message-Id: <201612110357.uBB3vMZi016590@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: marcel set sender to
 marcel@FreeBSD.org using -f
From: Marcel Moolenaar <marcel@FreeBSD.org>
Date: Sun, 11 Dec 2016 03:57:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309843 - in stable/11: . contrib/ofed/usr.lib/libsdp
 gnu/lib/libgcc gnu/lib/libgcov lib/libc/stdlib lib/libedit lib/libprocstat
 lib/libthr/support share/mk sys/conf usr.sbin/bsnmpd/mod...
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 03:57:24 -0000

Author: marcel
Date: Sun Dec 11 03:57:21 2016
New Revision: 309843
URL: https://svnweb.freebsd.org/changeset/base/309843

Log:
  MFC r305855, r306297, r306300, r306312-r306313
  
  When MAKEOBJDIRPREFIX points to a case-insensitive file system, the
  build can break when different source files create the same object
  files (case-insensitivity speaking).  This is the case for object
  files compiled with -fpic and shared libraries. The former uses
  an extension of ".So", and the latter an extension ".so".  Rename
  shared object files from *.So to *.pico to match what NetBSD does.
  
  Also:
   o  Compile _Exit.c as C99_Exit.c, as it conflicts with _exit.s
   o  Add entry to UPDATING
   o  Document .pico extension

Modified:
  stable/11/UPDATING
  stable/11/contrib/ofed/usr.lib/libsdp/Makefile
  stable/11/gnu/lib/libgcc/Makefile
  stable/11/gnu/lib/libgcov/Makefile
  stable/11/lib/libc/stdlib/Makefile.inc
  stable/11/lib/libedit/Makefile
  stable/11/lib/libprocstat/Makefile
  stable/11/lib/libthr/support/Makefile.inc
  stable/11/share/mk/bsd.README
  stable/11/share/mk/bsd.dep.mk
  stable/11/share/mk/bsd.lib.mk
  stable/11/share/mk/meta.autodep.mk
  stable/11/sys/conf/kern.post.mk
  stable/11/sys/conf/kern.pre.mk
  stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/UPDATING
==============================================================================
--- stable/11/UPDATING	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/UPDATING	Sun Dec 11 03:57:21 2016	(r309843)
@@ -16,6 +16,12 @@ from older versions of FreeBSD, try WITH
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20161210:
+	Relocatable object files with the extension of .So have been renamed
+	to use an extension of .pico instead.  The purpose of this change is
+	to avoid a name clash with shared libraries on case-insensitive file
+	systems.  On those file systems, foo.So is the same file as foo.so.
+
 20160622:
 	The libc stub for the pipe(2) system call has been replaced with
 	a wrapper that calls the pipe2(2) system call and the pipe(2)

Modified: stable/11/contrib/ofed/usr.lib/libsdp/Makefile
==============================================================================
--- stable/11/contrib/ofed/usr.lib/libsdp/Makefile	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/contrib/ofed/usr.lib/libsdp/Makefile	Sun Dec 11 03:57:21 2016	(r309843)
@@ -22,4 +22,4 @@ CFLAGS+= -I${OFEDSYS}/include
 
 # Remove .[ly] since the checked-in version is preferred.
 .SUFFIXES:
-.SUFFIXES: .o .po .So .c .ln
+.SUFFIXES: .o .po .pico .c .ln

Modified: stable/11/gnu/lib/libgcc/Makefile
==============================================================================
--- stable/11/gnu/lib/libgcc/Makefile	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/gnu/lib/libgcc/Makefile	Sun Dec 11 03:57:21 2016	(r309843)
@@ -254,8 +254,8 @@ OBJ_GRPS +=	FPBIT DPBIT
 .for T in ${OBJ_GRPS}
 ${T}_OBJS_T =	${${T}_FUNCS:S/$/.o/}
 ${T}_OBJS_P =	${${T}_FUNCS:S/$/.po/}
-${T}_OBJS_S =	${${T}_FUNCS:S/$/.So/}
-SOBJS +=	${${T}_FUNCS:S/$/.So/}
+${T}_OBJS_S =	${${T}_FUNCS:S/$/.pico/}
+SOBJS +=	${${T}_FUNCS:S/$/.pico/}
 
 ${${T}_OBJS_T}: ${${T}_CFILE} ${COMMONHDRS}
 	${CC_T} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
@@ -270,7 +270,7 @@ ${${T}_OBJS_S}: ${${T}_CFILE} ${COMMONHD
 # Extra objects coming from separate files
 #
 .if !empty(LIB2ADD)
-SOBJS +=	${LIB2ADD:R:S/$/.So/}
+SOBJS +=	${LIB2ADD:R:S/$/.pico/}
 .endif
 
 #-----------------------------------------------------------------------
@@ -294,9 +294,9 @@ ${STAT_OBJS_P}:	${STD_CFILE} ${COMMONHDR
 .if defined(LIB1ASMSRC)
 ASM_T =		${LIB1ASMFUNCS:S/$/.o/}
 ASM_P =		${LIB1ASMFUNCS:S/$/.po/}
-ASM_S =		${LIB1ASMFUNCS:S/$/.So/}
+ASM_S =		${LIB1ASMFUNCS:S/$/.pico/}
 ASM_V =		${LIB1ASMFUNCS:S/$/.vis/}
-SOBJS +=	${LIB1ASMFUNCS:S/$/.So/}
+SOBJS +=	${LIB1ASMFUNCS:S/$/.pico/}
 
 ${ASM_T}: ${LIB1ASMSRC} ${.PREFIX}.vis
 	${CC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} \
@@ -323,7 +323,7 @@ CLEANFILES += ${ASM_V} ${ASM_V:R:S/$/.vo
 #
 EH_OBJS_T = ${LIB2ADDEHSTATIC:R:S/$/.o/}
 EH_OBJS_P = ${LIB2ADDEHSTATIC:R:S/$/.po/}
-EH_OBJS_S = ${LIB2ADDEHSHARED:R:S/$/.So/}
+EH_OBJS_S = ${LIB2ADDEHSHARED:R:S/$/.pico/}
 EH_CFLAGS = -fexceptions -D__GLIBC__=3 -DElfW=__ElfN
 .if ${TARGET_CPUARCH} != "riscv64"
 # RISCVTODO: unwinding support
@@ -337,7 +337,7 @@ ${_src:R:S/$/.po/}: ${_src} ${COMMONHDRS
 	${CC_P} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC}
 .endfor
 .for _src in ${LIB2ADDEHSHARED:M*.c}
-${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS}
+${_src:R:S/$/.pico/}: ${_src} ${COMMONHDRS}
 	${CC_S} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC}
 .endfor
 

Modified: stable/11/gnu/lib/libgcov/Makefile
==============================================================================
--- stable/11/gnu/lib/libgcov/Makefile	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/gnu/lib/libgcov/Makefile	Sun Dec 11 03:57:21 2016	(r309843)
@@ -35,7 +35,7 @@ SYMS = _gcov _gcov_merge_add _gcov_merge
 OBJS=		${SYMS:S/$/.o/}
 OBJS_T=		${SYMS:S/$/.o/}
 OBJS_P=		${SYMS:S/$/.po/}
-OBJS_S=		${SYMS:S/$/.So/}
+OBJS_S=		${SYMS:S/$/.pico/}
 
 #-----------------------------------------------------------------------
 #

Modified: stable/11/lib/libc/stdlib/Makefile.inc
==============================================================================
--- stable/11/lib/libc/stdlib/Makefile.inc	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/lib/libc/stdlib/Makefile.inc	Sun Dec 11 03:57:21 2016	(r309843)
@@ -4,7 +4,7 @@
 # machine-independent stdlib sources
 .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/stdlib ${LIBC_SRCTOP}/stdlib
 
-MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
+MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
 	bsearch.c cxa_thread_atexit.c div.c exit.c getenv.c getopt.c getopt_long.c \
 	getsubopt.c hcreate.c hcreate_r.c hdestroy_r.c heapsort.c heapsort_b.c \
 	hsearch_r.c imaxabs.c imaxdiv.c \
@@ -16,6 +16,13 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c ate
 	strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \
         strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c
 
+# Work around an issue on case-insensitive file systems.
+# libc has both _Exit.c and _exit.s and they both yield
+# _exit.o (case insensitively speaking).
+CLEANFILES+=C99_Exit.c
+C99_Exit.c: ${LIBC_SRCTOP}/stdlib/_Exit.c .NOMETA
+	ln -sf ${.ALLSRC} ${.TARGET}
+
 SYM_MAPS+= ${LIBC_SRCTOP}/stdlib/Symbol.map
 
 # machine-dependent stdlib sources

Modified: stable/11/lib/libedit/Makefile
==============================================================================
--- stable/11/lib/libedit/Makefile	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/lib/libedit/Makefile	Sun Dec 11 03:57:21 2016	(r309843)
@@ -76,7 +76,7 @@ historyn.c: makelist Makefile
 	sh ${.CURDIR}/makelist -n history.c > ${.TARGET}
 
 # minimal dependency to make "make depend" optional
-editline.o editline.po editline.So editline.ln:	\
+editline.o editline.po editline.pico editline.ln:	\
 	common.h emacs.h fcns.c fcns.h help.c help.h vi.h
 
 tc1.o: ${.CURDIR}/TEST/tc1.c

Modified: stable/11/lib/libprocstat/Makefile
==============================================================================
--- stable/11/lib/libprocstat/Makefile	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/lib/libprocstat/Makefile	Sun Dec 11 03:57:21 2016	(r309843)
@@ -58,13 +58,13 @@ MLINKS+=libprocstat.3 procstat_close.3 \
 .if ${MK_CDDL} != "no"
 CFLAGS+=	-DLIBPROCSTAT_ZFS
 OBJS+=	zfs/zfs.o
-SOBJS+=	zfs/zfs.So
+SOBJS+=	zfs/zfs.pico
 POBJS+=	zfs/zfs.po
 SUBDIR=	zfs
 zfs/zfs.o: .PHONY
 	@cd ${.CURDIR}/zfs && ${MAKE} zfs.o
-zfs/zfs.So: .PHONY
-	@cd ${.CURDIR}/zfs && ${MAKE} zfs.So
+zfs/zfs.pico: .PHONY
+	@cd ${.CURDIR}/zfs && ${MAKE} zfs.pico
 zfs/zfs.po: .PHONY
 	@cd ${.CURDIR}/zfs && ${MAKE} zfs.po
 .endif

Modified: stable/11/lib/libthr/support/Makefile.inc
==============================================================================
--- stable/11/lib/libthr/support/Makefile.inc	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/lib/libthr/support/Makefile.inc	Sun Dec 11 03:57:21 2016	(r309843)
@@ -15,15 +15,15 @@ CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_
 SYSCALLS= thr_new
 
 SYSCALL_SRC=   ${SYSCALLS:S/$/.S/}
-SYSCALL_OBJ=   ${SYSCALLS:S/$/.So/}
+SYSCALL_OBJ=   ${SYSCALLS:S/$/.pico/}
 
 ${SYSCALL_SRC}:
 	printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' > ${.TARGET}
 
 LIBC_OBJS=
 
-SOBJS+=	thr_libc.So
+SOBJS+=	thr_libc.pico
 CLEANFILES+= ${SYSCALL_SRC} ${SYSCALL_OBJ} ${LIBC_OBJS}
 
-thr_libc.So: ${SYSCALL_OBJ} ${LIBC_OBJS}
+thr_libc.pico: ${SYSCALL_OBJ} ${LIBC_OBJS}
 	${CC} -fPIC -nostdlib -o ${.TARGET} -r ${.ALLSRC}

Modified: stable/11/share/mk/bsd.README
==============================================================================
--- stable/11/share/mk/bsd.README	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/share/mk/bsd.README	Sun Dec 11 03:57:21 2016	(r309843)
@@ -114,7 +114,7 @@ the tree where the file gets installed.
 
 The profiled libraries are no longer built in a different directory than
 the regular libraries.  A new suffix, ".po", is used to denote a profiled
-object.
+object, and ".pico" denotes a position-independent relocatable object.
 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 

Modified: stable/11/share/mk/bsd.dep.mk
==============================================================================
--- stable/11/share/mk/bsd.dep.mk	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/share/mk/bsd.dep.mk	Sun Dec 11 03:57:21 2016	(r309843)
@@ -152,8 +152,8 @@ ${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//}
 	@rm -f ${.TARGET}
 	${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
 .if defined(LIB)
-CLEANFILES+= ${_D}.So ${_D}.po
-${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//}
+CLEANFILES+= ${_D}.pico ${_D}.po
+${_D}.pico: ${_DSRC} ${SOBJS:S/^${_D}.pico$//}
 	@rm -f ${.TARGET}
 	${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
 ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//}

Modified: stable/11/share/mk/bsd.lib.mk
==============================================================================
--- stable/11/share/mk/bsd.lib.mk	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/share/mk/bsd.lib.mk	Sun Dec 11 03:57:21 2016	(r309843)
@@ -77,9 +77,9 @@ CTFFLAGS+= -g
 .include <bsd.libnames.mk>
 
 # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
-# .So used for PIC object files
+# .pico used for PIC object files
 .SUFFIXES:
-.SUFFIXES: .out .o .po .So .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln
+.SUFFIXES: .out .o .po .pico .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln
 
 .if !defined(PICFLAG)
 .if ${MACHINE_CPUARCH} == "sparc64"
@@ -99,7 +99,7 @@ PO_FLAG=-pg
 	${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
 	${CTFCONVERT_CMD}
 
-.c.So:
+.c.pico:
 	${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
 	${CTFCONVERT_CMD}
 
@@ -109,18 +109,18 @@ PO_FLAG=-pg
 .cc.po .C.po .cpp.po .cxx.po:
 	${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
 
-.cc.So .C.So .cpp.So .cxx.So:
+.cc.pico .C.pico .cpp.pico .cxx.pico:
 	${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
 
 .f.po:
 	${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
 	${CTFCONVERT_CMD}
 
-.f.So:
+.f.pico:
 	${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
 	${CTFCONVERT_CMD}
 
-.s.po .s.So:
+.s.po .s.pico:
 	${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
 	${CTFCONVERT_CMD}
 
@@ -129,7 +129,7 @@ PO_FLAG=-pg
 	    ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
 	${CTFCONVERT_CMD}
 
-.asm.So:
+.asm.pico:
 	${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \
 	    ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
 	${CTFCONVERT_CMD}
@@ -139,7 +139,7 @@ PO_FLAG=-pg
 	    -o ${.TARGET}
 	${CTFCONVERT_CMD}
 
-.S.So:
+.S.pico:
 	${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \
 	    -c ${.IMPSRC} -o ${.TARGET}
 	${CTFCONVERT_CMD}
@@ -207,7 +207,7 @@ lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS}
 
 .if defined(SHLIB_NAME) || \
     defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
-SOBJS+=		${OBJS:.o=.So}
+SOBJS+=		${OBJS:.o=.pico}
 DEPENDOBJS+=	${SOBJS}
 CLEANFILES+=	${SOBJS}
 .endif
@@ -430,7 +430,7 @@ OBJS_DEPEND_GUESS.${_S:R}.po+=	${_S}
 .if defined(SHLIB_NAME) || \
     defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
 .for _S in ${SRCS:N*.[hly]}
-OBJS_DEPEND_GUESS.${_S:R}.So+=	${_S}
+OBJS_DEPEND_GUESS.${_S:R}.pico+=	${_S}
 .endfor
 .endif
 

Modified: stable/11/share/mk/meta.autodep.mk
==============================================================================
--- stable/11/share/mk/meta.autodep.mk	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/share/mk/meta.autodep.mk	Sun Dec 11 03:57:21 2016	(r309843)
@@ -23,7 +23,7 @@ __${_this}__: .NOTMAIN
 
 .if defined(SRCS)
 # it would be nice to be able to query .SUFFIXES
-OBJ_EXTENSIONS+= .o .po .lo .So
+OBJ_EXTENSIONS+= .o .po .lo .pico
 
 # explicit dependencies help short-circuit .SUFFIX searches
 SRCS_DEP_FILTER+= N*.[hly]
@@ -179,7 +179,7 @@ DEPEND_SUFFIXES += .c .h .cpp .hpp .cxx 
 	@case "${.MAKE.META.FILES:T:M*.po.*}" in \
 	*.po.*) mv $@.${.MAKE.PID} $@;; \
 	*) { cat $@.${.MAKE.PID}; \
-	sed 's,\.So:,.o:,;s,\.o:,.po:,' $@.${.MAKE.PID}; } | sort -u > $@; \
+	sed 's,\.pico:,.o:,;s,\.o:,.po:,' $@.${.MAKE.PID}; } | sort -u > $@; \
 	rm -f $@.${.MAKE.PID};; \
 	esac
 .else
@@ -244,7 +244,7 @@ META_FILES = *.meta
 .elif ${OPTIMIZE_OBJECT_META_FILES:Uno:tl} == "no"
 META_FILES = ${.MAKE.META.FILES:T:N.depend*:O:u}
 .else
-# if we have 1000's of .o.meta, .So.meta etc we need only look at one set
+# if we have 1000's of .o.meta, .pico.meta etc we need only look at one set
 # it is left as an exercise for the reader to work out what this does
 META_FILES = ${.MAKE.META.FILES:T:N.depend*:N*o.meta:O:u} \
 	${.MAKE.META.FILES:T:M*.${.MAKE.META.FILES:M*o.meta:R:E:O:u:[1]}.meta:O:u}

Modified: stable/11/sys/conf/kern.post.mk
==============================================================================
--- stable/11/sys/conf/kern.post.mk	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/sys/conf/kern.post.mk	Sun Dec 11 03:57:21 2016	(r309843)
@@ -165,7 +165,7 @@ ${mfile:T:S/.m$/.h/}: ${mfile}
 .endfor
 
 kernel-clean:
-	rm -f *.o *.so *.So *.ko *.s eddep errs \
+	rm -f *.o *.so *.pico *.ko *.s eddep errs \
 	    ${FULLKERNEL} ${KERNEL_KO} ${KERNEL_KO}.debug \
 	    linterrs tags vers.c \
 	    vnode_if.c vnode_if.h vnode_if_newproto.h vnode_if_typedef.h \
@@ -180,9 +180,9 @@ lint: ${LNFILES}
 # dynamic references.  We could probably do a '-Bforcedynamic' mode like
 # in the a.out ld.  For now, this works.
 HACK_EXTRA_FLAGS?= -shared
-hack.So: Makefile
+hack.pico: Makefile
 	:> hack.c
-	${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.So
+	${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.pico
 	rm -f hack.c
 
 assym.s: $S/kern/genassym.sh genassym.o

Modified: stable/11/sys/conf/kern.pre.mk
==============================================================================
--- stable/11/sys/conf/kern.pre.mk	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/sys/conf/kern.pre.mk	Sun Dec 11 03:57:21 2016	(r309843)
@@ -176,7 +176,7 @@ SYSTEM_CFILES= config.c env.c hints.c vn
 SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
 SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS}
 SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o}
-SYSTEM_OBJS+= hack.So
+SYSTEM_OBJS+= hack.pico
 
 MD_ROOT_SIZE_CONFIGURED!=	grep MD_ROOT_SIZE opt_md.h || true ; echo
 .if ${MFS_IMAGE:Uno} != "no"

Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile
==============================================================================
--- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile	Sun Dec 11 02:01:59 2016	(r309842)
+++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile	Sun Dec 11 03:57:21 2016	(r309843)
@@ -73,7 +73,7 @@ LIBADD=	kvm devinfo m geom memstat
 
 .include <bsd.snmpmod.mk>
 
-printcap.So: printcap.c
+printcap.pico: printcap.c
 	${CC} ${PICFLAG} -DPIC ${CFLAGS:C/^-W.*//} -c ${.IMPSRC} -o ${.TARGET}
 
 smilint:

From owner-svn-src-all@freebsd.org  Sun Dec 11 03:59:38 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C5EAC65EB5;
 Sun, 11 Dec 2016 03:59:38 +0000 (UTC)
 (envelope-from marcel@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 370281043;
 Sun, 11 Dec 2016 03:59:38 +0000 (UTC)
 (envelope-from marcel@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBB3xbEQ016729;
 Sun, 11 Dec 2016 03:59:37 GMT (envelope-from marcel@FreeBSD.org)
Received: (from marcel@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBB3xbc1016728;
 Sun, 11 Dec 2016 03:59:37 GMT (envelope-from marcel@FreeBSD.org)
Message-Id: <201612110359.uBB3xbc1016728@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: marcel set sender to
 marcel@FreeBSD.org using -f
From: Marcel Moolenaar <marcel@FreeBSD.org>
Date: Sun, 11 Dec 2016 03:59:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309844 - stable/11/usr.bin/mkimg
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 03:59:38 -0000

Author: marcel
Date: Sun Dec 11 03:59:37 2016
New Revision: 309844
URL: https://svnweb.freebsd.org/changeset/base/309844

Log:
  MFC r306299:
  
  Update local variable 'block' after calling capacity_resize(),
  otherwise format_resize(), which is called right after, isn't
  getting the current/actual image size. Rather than rounding up,
  format_resize() could end up truncating the size and we don't
  allow that by design.

Modified:
  stable/11/usr.bin/mkimg/mkimg.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/mkimg/mkimg.c
==============================================================================
--- stable/11/usr.bin/mkimg/mkimg.c	Sun Dec 11 03:57:21 2016	(r309843)
+++ stable/11/usr.bin/mkimg/mkimg.c	Sun Dec 11 03:59:37 2016	(r309844)
@@ -463,13 +463,16 @@ mkimg(void)
 
 	block = scheme_metadata(SCHEME_META_IMG_END, block);
 	error = image_set_size(block);
-	if (!error)
+	if (!error) {
 		error = capacity_resize(block);
-	if (!error)
+		block = image_get_size();
+	}
+	if (!error) {
 		error = format_resize(block);
+		block = image_get_size();
+	}
 	if (error)
 		errc(EX_IOERR, error, "image sizing");
-	block = image_get_size();
 	ncyls = block / (nsecs * nheads);
 	error = scheme_write(block);
 	if (error)

From owner-svn-src-all@freebsd.org  Sun Dec 11 04:02:40 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03462C70099;
 Sun, 11 Dec 2016 04:02:40 +0000 (UTC)
 (envelope-from marcel@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B457A14A6;
 Sun, 11 Dec 2016 04:02:39 +0000 (UTC)
 (envelope-from marcel@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBB42cnq020577;
 Sun, 11 Dec 2016 04:02:38 GMT (envelope-from marcel@FreeBSD.org)
Received: (from marcel@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBB42c1x020576;
 Sun, 11 Dec 2016 04:02:38 GMT (envelope-from marcel@FreeBSD.org)
Message-Id: <201612110402.uBB42c1x020576@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: marcel set sender to
 marcel@FreeBSD.org using -f
From: Marcel Moolenaar <marcel@FreeBSD.org>
Date: Sun, 11 Dec 2016 04:02:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309845 - stable/11/sys/netpfil/pf
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 04:02:40 -0000

Author: marcel
Date: Sun Dec 11 04:02:38 2016
New Revision: 309845
URL: https://svnweb.freebsd.org/changeset/base/309845

Log:
  MFC r309394, r309787
  
  Fix use-after-free bugs in pfsync(4)

Modified:
  stable/11/sys/netpfil/pf/if_pfsync.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netpfil/pf/if_pfsync.c
==============================================================================
--- stable/11/sys/netpfil/pf/if_pfsync.c	Sun Dec 11 03:59:37 2016	(r309844)
+++ stable/11/sys/netpfil/pf/if_pfsync.c	Sun Dec 11 04:02:38 2016	(r309845)
@@ -161,8 +161,8 @@ static struct pfsync_q pfsync_qs[] = {
 	{ pfsync_out_del,   sizeof(struct pfsync_del_c),   PFSYNC_ACT_DEL_C }
 };
 
-static void	pfsync_q_ins(struct pf_state *, int);
-static void	pfsync_q_del(struct pf_state *);
+static void	pfsync_q_ins(struct pf_state *, int, bool);
+static void	pfsync_q_del(struct pf_state *, bool);
 
 static void	pfsync_update_state(struct pf_state *);
 
@@ -542,7 +542,7 @@ pfsync_state_import(struct pfsync_state 
 	if (!(flags & PFSYNC_SI_IOCTL)) {
 		st->state_flags &= ~PFSTATE_NOSYNC;
 		if (st->state_flags & PFSTATE_ACK) {
-			pfsync_q_ins(st, PFSYNC_S_IACK);
+			pfsync_q_ins(st, PFSYNC_S_IACK, true);
 			pfsync_push(sc);
 		}
 	}
@@ -1509,7 +1509,7 @@ pfsync_sendout(int schedswi)
 	struct ip *ip;
 	struct pfsync_header *ph;
 	struct pfsync_subheader *subh;
-	struct pf_state *st;
+	struct pf_state *st, *st_next;
 	struct pfsync_upd_req_item *ur;
 	int offset;
 	int q, count = 0;
@@ -1559,7 +1559,7 @@ pfsync_sendout(int schedswi)
 		offset += sizeof(*subh);
 
 		count = 0;
-		TAILQ_FOREACH(st, &sc->sc_qs[q], sync_list) {
+		TAILQ_FOREACH_SAFE(st, &sc->sc_qs[q], sync_list, st_next) {
 			KASSERT(st->sync_state == q,
 				("%s: st->sync_state == q",
 					__func__));
@@ -1668,7 +1668,7 @@ pfsync_insert_state(struct pf_state *st)
 	if (sc->sc_len == PFSYNC_MINPKT)
 		callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif);
 
-	pfsync_q_ins(st, PFSYNC_S_INS);
+	pfsync_q_ins(st, PFSYNC_S_INS, true);
 	PFSYNC_UNLOCK(sc);
 
 	st->sync_updates = 0;
@@ -1789,7 +1789,7 @@ static void
 pfsync_update_state(struct pf_state *st)
 {
 	struct pfsync_softc *sc = V_pfsyncif;
-	int sync = 0;
+	bool sync = false, ref = true;
 
 	PF_STATE_LOCK_ASSERT(st);
 	PFSYNC_LOCK(sc);
@@ -1798,7 +1798,7 @@ pfsync_update_state(struct pf_state *st)
 		pfsync_undefer_state(st, 0);
 	if (st->state_flags & PFSTATE_NOSYNC) {
 		if (st->sync_state != PFSYNC_S_NONE)
-			pfsync_q_del(st);
+			pfsync_q_del(st, true);
 		PFSYNC_UNLOCK(sc);
 		return;
 	}
@@ -1815,14 +1815,17 @@ pfsync_update_state(struct pf_state *st)
 		if (st->key[PF_SK_WIRE]->proto == IPPROTO_TCP) {
 			st->sync_updates++;
 			if (st->sync_updates >= sc->sc_maxupdates)
-				sync = 1;
+				sync = true;
 		}
 		break;
 
 	case PFSYNC_S_IACK:
-		pfsync_q_del(st);
+		pfsync_q_del(st, false);
+		ref = false;
+		/* FALLTHROUGH */
+
 	case PFSYNC_S_NONE:
-		pfsync_q_ins(st, PFSYNC_S_UPD_C);
+		pfsync_q_ins(st, PFSYNC_S_UPD_C, ref);
 		st->sync_updates = 0;
 		break;
 
@@ -1880,13 +1883,14 @@ static void
 pfsync_update_state_req(struct pf_state *st)
 {
 	struct pfsync_softc *sc = V_pfsyncif;
+	bool ref = true;
 
 	PF_STATE_LOCK_ASSERT(st);
 	PFSYNC_LOCK(sc);
 
 	if (st->state_flags & PFSTATE_NOSYNC) {
 		if (st->sync_state != PFSYNC_S_NONE)
-			pfsync_q_del(st);
+			pfsync_q_del(st, true);
 		PFSYNC_UNLOCK(sc);
 		return;
 	}
@@ -1894,9 +1898,12 @@ pfsync_update_state_req(struct pf_state 
 	switch (st->sync_state) {
 	case PFSYNC_S_UPD_C:
 	case PFSYNC_S_IACK:
-		pfsync_q_del(st);
+		pfsync_q_del(st, false);
+		ref = false;
+		/* FALLTHROUGH */
+
 	case PFSYNC_S_NONE:
-		pfsync_q_ins(st, PFSYNC_S_UPD);
+		pfsync_q_ins(st, PFSYNC_S_UPD, ref);
 		pfsync_push(sc);
 		break;
 
@@ -1917,13 +1924,14 @@ static void
 pfsync_delete_state(struct pf_state *st)
 {
 	struct pfsync_softc *sc = V_pfsyncif;
+	bool ref = true;
 
 	PFSYNC_LOCK(sc);
 	if (st->state_flags & PFSTATE_ACK)
 		pfsync_undefer_state(st, 1);
 	if (st->state_flags & PFSTATE_NOSYNC) {
 		if (st->sync_state != PFSYNC_S_NONE)
-			pfsync_q_del(st);
+			pfsync_q_del(st, true);
 		PFSYNC_UNLOCK(sc);
 		return;
 	}
@@ -1934,22 +1942,24 @@ pfsync_delete_state(struct pf_state *st)
 	switch (st->sync_state) {
 	case PFSYNC_S_INS:
 		/* We never got to tell the world so just forget about it. */
-		pfsync_q_del(st);
+		pfsync_q_del(st, true);
 		break;
 
 	case PFSYNC_S_UPD_C:
 	case PFSYNC_S_UPD:
 	case PFSYNC_S_IACK:
-		pfsync_q_del(st);
-		/* FALLTHROUGH to putting it on the del list */
+		pfsync_q_del(st, false);
+		ref = false;
+		/* FALLTHROUGH */
 
 	case PFSYNC_S_NONE:
-		pfsync_q_ins(st, PFSYNC_S_DEL);
+		pfsync_q_ins(st, PFSYNC_S_DEL, ref);
 		break;
 
 	default:
 		panic("%s: unexpected sync state %d", __func__, st->sync_state);
 	}
+
 	PFSYNC_UNLOCK(sc);
 }
 
@@ -1977,7 +1987,7 @@ pfsync_clear_states(u_int32_t creatorid,
 }
 
 static void
-pfsync_q_ins(struct pf_state *st, int q)
+pfsync_q_ins(struct pf_state *st, int q, bool ref)
 {
 	struct pfsync_softc *sc = V_pfsyncif;
 	size_t nlen = pfsync_qs[q].len;
@@ -2001,11 +2011,12 @@ pfsync_q_ins(struct pf_state *st, int q)
 	sc->sc_len += nlen;
 	TAILQ_INSERT_TAIL(&sc->sc_qs[q], st, sync_list);
 	st->sync_state = q;
-	pf_ref_state(st);
+	if (ref)
+		pf_ref_state(st);
 }
 
 static void
-pfsync_q_del(struct pf_state *st)
+pfsync_q_del(struct pf_state *st, bool unref)
 {
 	struct pfsync_softc *sc = V_pfsyncif;
 	int q = st->sync_state;
@@ -2017,7 +2028,8 @@ pfsync_q_del(struct pf_state *st)
 	sc->sc_len -= pfsync_qs[q].len;
 	TAILQ_REMOVE(&sc->sc_qs[q], st, sync_list);
 	st->sync_state = PFSYNC_S_NONE;
-	pf_release_state(st);
+	if (unref)
+		pf_release_state(st);
 
 	if (TAILQ_EMPTY(&sc->sc_qs[q]))
 		sc->sc_len -= sizeof(struct pfsync_subheader);

From owner-svn-src-all@freebsd.org  Sun Dec 11 06:08:03 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83AC5C71941;
 Sun, 11 Dec 2016 06:08:03 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 51D169B6;
 Sun, 11 Dec 2016 06:08:03 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBB682fU069095;
 Sun, 11 Dec 2016 06:08:02 GMT (envelope-from delphij@FreeBSD.org)
Received: (from delphij@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBB682JB069091;
 Sun, 11 Dec 2016 06:08:02 GMT (envelope-from delphij@FreeBSD.org)
Message-Id: <201612110608.uBB682JB069091@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: delphij set sender to
 delphij@FreeBSD.org using -f
From: Xin LI <delphij@FreeBSD.org>
Date: Sun, 11 Dec 2016 06:08:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309846 - in stable/11: contrib/libdivsufsort
 usr.bin/bsdiff/bsdiff
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 06:08:03 -0000

Author: delphij
Date: Sun Dec 11 06:08:01 2016
New Revision: 309846
URL: https://svnweb.freebsd.org/changeset/base/309846

Log:
  MFC r303285:
  
  Change bsdiff to use divsufsort suffix sort library instead of qsufsort,
  which is more efficient.
  
  Note that for now we do not create a separate library for libdivsufsort
  because it's not used anywhere else.
  
  Obtained from:        Chromium

Added:
  stable/11/contrib/libdivsufsort/
     - copied from r303285, head/contrib/libdivsufsort/
  stable/11/usr.bin/bsdiff/bsdiff/config.h
     - copied unchanged from r303285, head/usr.bin/bsdiff/bsdiff/config.h
  stable/11/usr.bin/bsdiff/bsdiff/divsufsort64.h
     - copied unchanged from r303285, head/usr.bin/bsdiff/bsdiff/divsufsort64.h
Modified:
  stable/11/usr.bin/bsdiff/bsdiff/Makefile
  stable/11/usr.bin/bsdiff/bsdiff/bsdiff.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/bsdiff/bsdiff/Makefile
==============================================================================
--- stable/11/usr.bin/bsdiff/bsdiff/Makefile	Sun Dec 11 04:02:38 2016	(r309845)
+++ stable/11/usr.bin/bsdiff/bsdiff/Makefile	Sun Dec 11 06:08:01 2016	(r309846)
@@ -1,6 +1,17 @@
 # $FreeBSD$
 
-PROG=	bsdiff
+PROG=		bsdiff
+
+# libdivsufsort configured with:
+# cmake -DCMAKE_BUILD_TYPE="Release" -DBUILD_DIVSUFSORT64=ON
+.PATH:		${.CURDIR}/../../../contrib/libdivsufsort/lib
+CFLAGS+=	-DHAVE_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+CFLAGS+=	-D_LARGE_FILES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
+CFLAGS+=	-D__STDC_LIMIT_MACROS -DBUILD_DIVSUFSORT64
+CFLAGS+=	-I${.CURDIR}/../../../contrib/libdivsufsort/include -I${.CURDIR}
+SRCS=		divsufsort.c sssort.c trsort.c utils.c
+
+SRCS+=		bsdiff.c
 
 LIBADD=	bz2
 

Modified: stable/11/usr.bin/bsdiff/bsdiff/bsdiff.c
==============================================================================
--- stable/11/usr.bin/bsdiff/bsdiff/bsdiff.c	Sun Dec 11 04:02:38 2016	(r309845)
+++ stable/11/usr.bin/bsdiff/bsdiff/bsdiff.c	Sun Dec 11 06:08:01 2016	(r309846)
@@ -44,106 +44,11 @@ __FBSDID("$FreeBSD$");
 #define O_BINARY 0
 #endif
 
-#define MIN(x,y) (((x)<(y)) ? (x) : (y))
-
-static void split(off_t *I,off_t *V,off_t start,off_t len,off_t h)
-{
-	off_t i,j,k,x,tmp,jj,kk;
-
-	if(len<16) {
-		for(k=start;k<start+len;k+=j) {
-			j=1;x=V[I[k]+h];
-			for(i=1;k+i<start+len;i++) {
-				if(V[I[k+i]+h]<x) {
-					x=V[I[k+i]+h];
-					j=0;
-				}
-				if(V[I[k+i]+h]==x) {
-					tmp=I[k+j];I[k+j]=I[k+i];I[k+i]=tmp;
-					j++;
-				}
-			}
-			for(i=0;i<j;i++) V[I[k+i]]=k+j-1;
-			if(j==1) I[k]=-1;
-		}
-		return;
-	}
-
-	x=V[I[start+len/2]+h];
-	jj=0;kk=0;
-	for(i=start;i<start+len;i++) {
-		if(V[I[i]+h]<x) jj++;
-		if(V[I[i]+h]==x) kk++;
-	}
-	jj+=start;kk+=jj;
-
-	i=start;j=0;k=0;
-	while(i<jj) {
-		if(V[I[i]+h]<x) {
-			i++;
-		} else if(V[I[i]+h]==x) {
-			tmp=I[i];I[i]=I[jj+j];I[jj+j]=tmp;
-			j++;
-		} else {
-			tmp=I[i];I[i]=I[kk+k];I[kk+k]=tmp;
-			k++;
-		}
-	}
-
-	while(jj+j<kk) {
-		if(V[I[jj+j]+h]==x) {
-			j++;
-		} else {
-			tmp=I[jj+j];I[jj+j]=I[kk+k];I[kk+k]=tmp;
-			k++;
-		}
-	}
-
-	if(jj>start) split(I,V,start,jj-start,h);
-
-	for(i=0;i<kk-jj;i++) V[I[jj+i]]=kk-1;
-	if(jj==kk-1) I[jj]=-1;
-
-	if(start+len>kk) split(I,V,kk,start+len-kk,h);
-}
-
-static void qsufsort(off_t *I,off_t *V,u_char *old,off_t oldsize)
-{
-	off_t buckets[256];
-	off_t i,h,len;
-
-	for(i=0;i<256;i++) buckets[i]=0;
-	for(i=0;i<oldsize;i++) buckets[old[i]]++;
-	for(i=1;i<256;i++) buckets[i]+=buckets[i-1];
-	for(i=255;i>0;i--) buckets[i]=buckets[i-1];
-	buckets[0]=0;
-
-	for(i=0;i<oldsize;i++) I[++buckets[old[i]]]=i;
-	I[0]=oldsize;
-	for(i=0;i<oldsize;i++) V[i]=buckets[old[i]];
-	V[oldsize]=0;
-	for(i=1;i<256;i++) if(buckets[i]==buckets[i-1]+1) I[buckets[i]]=-1;
-	I[0]=-1;
-
-	for(h=1;I[0]!=-(oldsize+1);h+=h) {
-		len=0;
-		for(i=0;i<oldsize+1;) {
-			if(I[i]<0) {
-				len-=I[i];
-				i-=I[i];
-			} else {
-				if(len) I[i-len]=-len;
-				len=V[I[i]]+1-i;
-				split(I,V,i,len,h);
-				i+=len;
-				len=0;
-			}
-		}
-		if(len) I[i-len]=-len;
-	}
+#include "divsufsort64.h"
+#define saidx_t saidx64_t
+#define divsufsort divsufsort64
 
-	for(i=0;i<oldsize+1;i++) I[V[i]]=i;
-}
+#define MIN(x,y) (((x)<(y)) ? (x) : (y))
 
 static off_t matchlen(u_char *old,off_t oldsize,u_char *new,off_t newsize)
 {
@@ -212,7 +117,7 @@ int main(int argc,char *argv[])
 	int fd;
 	u_char *old,*new;
 	off_t oldsize,newsize;
-	off_t *I,*V;
+	saidx_t *I;
 	off_t scan,pos,len;
 	off_t lastscan,lastpos,lastoffset;
 	off_t oldscore,scsc;
@@ -248,12 +153,9 @@ int main(int argc,char *argv[])
 		(read(fd,old,oldsize)!=oldsize) ||
 		(close(fd)==-1)) err(1,"%s",argv[1]);
 
-	if(((I=malloc((oldsize+1)*sizeof(off_t)))==NULL) ||
-		((V=malloc((oldsize+1)*sizeof(off_t)))==NULL)) err(1,NULL);
-
-	qsufsort(I,V,old,oldsize);
+	if(((I=malloc((oldsize+1)*sizeof(saidx_t)))==NULL)) err(1,NULL);
 
-	free(V);
+	if(divsufsort(old, I, oldsize)) err(1, "divsufsort");
 
 	/* Allocate newsize+1 bytes instead of newsize bytes to ensure
 		that we never try to malloc(0) and get a NULL pointer */

Copied: stable/11/usr.bin/bsdiff/bsdiff/config.h (from r303285, head/usr.bin/bsdiff/bsdiff/config.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/11/usr.bin/bsdiff/bsdiff/config.h	Sun Dec 11 06:08:01 2016	(r309846, copy of r303285, head/usr.bin/bsdiff/bsdiff/config.h)
@@ -0,0 +1,83 @@
+/*
+ * config.h for libdivsufsort
+ * Copyright (c) 2003-2008 Yuta Mori All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _CONFIG_H
+#define _CONFIG_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/** Define to the version of this package. **/
+#define PROJECT_VERSION_FULL "2.0.1-14-g5f60d6f"
+
+/** Define to 1 if you have the header files. **/
+#define HAVE_INTTYPES_H 1
+#define HAVE_STDDEF_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_SYS_TYPES_H 1
+
+/** for WinIO **/
+/* #undef HAVE_IO_H */
+/* #undef HAVE_FCNTL_H */
+/* #undef HAVE__SETMODE */
+/* #undef HAVE_SETMODE */
+/* #undef HAVE__FILENO */
+/* #undef HAVE_FOPEN_S */
+/* #undef HAVE__O_BINARY */
+#ifndef HAVE__SETMODE
+# if HAVE_SETMODE
+#  define _setmode setmode
+#  define HAVE__SETMODE 1
+# endif
+# if HAVE__SETMODE && !HAVE__O_BINARY
+#  define _O_BINARY 0
+#  define HAVE__O_BINARY 1
+# endif
+#endif
+
+/** for inline **/
+#ifndef INLINE
+# define INLINE inline
+#endif
+
+/** for VC++ warning **/
+#ifdef _MSC_VER
+#pragma warning(disable: 4127)
+#endif
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* _CONFIG_H */

Copied: stable/11/usr.bin/bsdiff/bsdiff/divsufsort64.h (from r303285, head/usr.bin/bsdiff/bsdiff/divsufsort64.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/11/usr.bin/bsdiff/bsdiff/divsufsort64.h	Sun Dec 11 06:08:01 2016	(r309846, copy of r303285, head/usr.bin/bsdiff/bsdiff/divsufsort64.h)
@@ -0,0 +1,180 @@
+/*
+ * divsufsort64.h for libdivsufsort64
+ * Copyright (c) 2003-2008 Yuta Mori All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _DIVSUFSORT64_H
+#define _DIVSUFSORT64_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <inttypes.h>
+
+#ifndef DIVSUFSORT_API
+# ifdef DIVSUFSORT_BUILD_DLL
+#  define DIVSUFSORT_API 
+# else
+#  define DIVSUFSORT_API 
+# endif
+#endif
+
+/*- Datatypes -*/
+#ifndef SAUCHAR_T
+#define SAUCHAR_T
+typedef uint8_t sauchar_t;
+#endif /* SAUCHAR_T */
+#ifndef SAINT_T
+#define SAINT_T
+typedef int32_t saint_t;
+#endif /* SAINT_T */
+#ifndef SAIDX64_T
+#define SAIDX64_T
+typedef int64_t saidx64_t;
+#endif /* SAIDX64_T */
+#ifndef PRIdSAINT_T
+#define PRIdSAINT_T PRId32
+#endif /* PRIdSAINT_T */
+#ifndef PRIdSAIDX64_T
+#define PRIdSAIDX64_T PRId64
+#endif /* PRIdSAIDX64_T */
+
+
+/*- Prototypes -*/
+
+/**
+ * Constructs the suffix array of a given string.
+ * @param T[0..n-1] The input string.
+ * @param SA[0..n-1] The output array of suffixes.
+ * @param n The length of the given string.
+ * @return 0 if no error occurred, -1 or -2 otherwise.
+ */
+DIVSUFSORT_API
+saint_t
+divsufsort64(const sauchar_t *T, saidx64_t *SA, saidx64_t n);
+
+/**
+ * Constructs the burrows-wheeler transformed string of a given string.
+ * @param T[0..n-1] The input string.
+ * @param U[0..n-1] The output string. (can be T)
+ * @param A[0..n-1] The temporary array. (can be NULL)
+ * @param n The length of the given string.
+ * @return The primary index if no error occurred, -1 or -2 otherwise.
+ */
+DIVSUFSORT_API
+saidx64_t
+divbwt64(const sauchar_t *T, sauchar_t *U, saidx64_t *A, saidx64_t n);
+
+/**
+ * Returns the version of the divsufsort library.
+ * @return The version number string.
+ */
+DIVSUFSORT_API
+const char *
+divsufsort64_version(void);
+
+
+/**
+ * Constructs the burrows-wheeler transformed string of a given string and suffix array.
+ * @param T[0..n-1] The input string.
+ * @param U[0..n-1] The output string. (can be T)
+ * @param SA[0..n-1] The suffix array. (can be NULL)
+ * @param n The length of the given string.
+ * @param idx The output primary index.
+ * @return 0 if no error occurred, -1 or -2 otherwise.
+ */
+DIVSUFSORT_API
+saint_t
+bw_transform64(const sauchar_t *T, sauchar_t *U,
+             saidx64_t *SA /* can NULL */,
+             saidx64_t n, saidx64_t *idx);
+
+/**
+ * Inverse BW-transforms a given BWTed string.
+ * @param T[0..n-1] The input string.
+ * @param U[0..n-1] The output string. (can be T)
+ * @param A[0..n-1] The temporary array. (can be NULL)
+ * @param n The length of the given string.
+ * @param idx The primary index.
+ * @return 0 if no error occurred, -1 or -2 otherwise.
+ */
+DIVSUFSORT_API
+saint_t
+inverse_bw_transform64(const sauchar_t *T, sauchar_t *U,
+                     saidx64_t *A /* can NULL */,
+                     saidx64_t n, saidx64_t idx);
+
+/**
+ * Checks the correctness of a given suffix array.
+ * @param T[0..n-1] The input string.
+ * @param SA[0..n-1] The input suffix array.
+ * @param n The length of the given string.
+ * @param verbose The verbose mode.
+ * @return 0 if no error occurred.
+ */
+DIVSUFSORT_API
+saint_t
+sufcheck64(const sauchar_t *T, const saidx64_t *SA, saidx64_t n, saint_t verbose);
+
+/**
+ * Search for the pattern P in the string T.
+ * @param T[0..Tsize-1] The input string.
+ * @param Tsize The length of the given string.
+ * @param P[0..Psize-1] The input pattern string.
+ * @param Psize The length of the given pattern string.
+ * @param SA[0..SAsize-1] The input suffix array.
+ * @param SAsize The length of the given suffix array.
+ * @param idx The output index.
+ * @return The count of matches if no error occurred, -1 otherwise.
+ */
+DIVSUFSORT_API
+saidx64_t
+sa_search64(const sauchar_t *T, saidx64_t Tsize,
+          const sauchar_t *P, saidx64_t Psize,
+          const saidx64_t *SA, saidx64_t SAsize,
+          saidx64_t *left);
+
+/**
+ * Search for the character c in the string T.
+ * @param T[0..Tsize-1] The input string.
+ * @param Tsize The length of the given string.
+ * @param SA[0..SAsize-1] The input suffix array.
+ * @param SAsize The length of the given suffix array.
+ * @param c The input character.
+ * @param idx The output index.
+ * @return The count of matches if no error occurred, -1 otherwise.
+ */
+DIVSUFSORT_API
+saidx64_t
+sa_simplesearch64(const sauchar_t *T, saidx64_t Tsize,
+                const saidx64_t *SA, saidx64_t SAsize,
+                saint_t c, saidx64_t *left);
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* _DIVSUFSORT64_H */

From owner-svn-src-all@freebsd.org  Sun Dec 11 07:33:04 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52C7DC709AA;
 Sun, 11 Dec 2016 07:33:04 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 13321F5F;
 Sun, 11 Dec 2016 07:33:04 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBB7X3eR005814;
 Sun, 11 Dec 2016 07:33:03 GMT (envelope-from delphij@FreeBSD.org)
Received: (from delphij@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBB7X3o2005809;
 Sun, 11 Dec 2016 07:33:03 GMT (envelope-from delphij@FreeBSD.org)
Message-Id: <201612110733.uBB7X3o2005809@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: delphij set sender to
 delphij@FreeBSD.org using -f
From: Xin LI <delphij@FreeBSD.org>
Date: Sun, 11 Dec 2016 07:33:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309847 - in stable/11: contrib/file contrib/file/doc
 contrib/file/magic contrib/file/magic/Magdir contrib/file/python
 contrib/file/src lib/libmagic
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 07:33:04 -0000

Author: delphij
Date: Sun Dec 11 07:33:02 2016
New Revision: 309847
URL: https://svnweb.freebsd.org/changeset/base/309847

Log:
  MFC r308420: MFV r308392: file 5.29.

Added:
  stable/11/contrib/file/magic/Magdir/algol68
     - copied unchanged from r308420, head/contrib/file/magic/Magdir/algol68
  stable/11/contrib/file/magic/Magdir/application
     - copied unchanged from r308420, head/contrib/file/magic/Magdir/application
  stable/11/contrib/file/magic/Magdir/apt
     - copied unchanged from r308420, head/contrib/file/magic/Magdir/apt
  stable/11/contrib/file/magic/Magdir/psl
     - copied unchanged from r308420, head/contrib/file/magic/Magdir/psl
Modified:
  stable/11/contrib/file/ChangeLog
  stable/11/contrib/file/TODO
  stable/11/contrib/file/config.guess
  stable/11/contrib/file/config.sub
  stable/11/contrib/file/configure
  stable/11/contrib/file/configure.ac
  stable/11/contrib/file/doc/file.man
  stable/11/contrib/file/doc/magic.man
  stable/11/contrib/file/ltmain.sh
  stable/11/contrib/file/magic/Magdir/animation
  stable/11/contrib/file/magic/Magdir/apple
  stable/11/contrib/file/magic/Magdir/bioinformatics
  stable/11/contrib/file/magic/Magdir/c-lang
  stable/11/contrib/file/magic/Magdir/claris
  stable/11/contrib/file/magic/Magdir/commands
  stable/11/contrib/file/magic/Magdir/compress
  stable/11/contrib/file/magic/Magdir/cups
  stable/11/contrib/file/magic/Magdir/editors
  stable/11/contrib/file/magic/Magdir/filesystems
  stable/11/contrib/file/magic/Magdir/fonts
  stable/11/contrib/file/magic/Magdir/gcc
  stable/11/contrib/file/magic/Magdir/gnu
  stable/11/contrib/file/magic/Magdir/images
  stable/11/contrib/file/magic/Magdir/jpeg
  stable/11/contrib/file/magic/Magdir/msdos
  stable/11/contrib/file/magic/Magdir/pgp
  stable/11/contrib/file/magic/Magdir/python
  stable/11/contrib/file/magic/Magdir/ruby
  stable/11/contrib/file/magic/Magdir/sgml
  stable/11/contrib/file/magic/Magdir/sql
  stable/11/contrib/file/magic/Makefile.am
  stable/11/contrib/file/magic/Makefile.in
  stable/11/contrib/file/python/magic.py
  stable/11/contrib/file/src/apprentice.c
  stable/11/contrib/file/src/ascmagic.c
  stable/11/contrib/file/src/cdf.c
  stable/11/contrib/file/src/cdf.h
  stable/11/contrib/file/src/compress.c
  stable/11/contrib/file/src/der.c
  stable/11/contrib/file/src/file.c
  stable/11/contrib/file/src/file.h
  stable/11/contrib/file/src/funcs.c
  stable/11/contrib/file/src/magic.c
  stable/11/contrib/file/src/readcdf.c
  stable/11/contrib/file/src/readelf.c
  stable/11/contrib/file/src/softmagic.c
  stable/11/lib/libmagic/config.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/file/ChangeLog
==============================================================================
--- stable/11/contrib/file/ChangeLog	Sun Dec 11 06:08:01 2016	(r309846)
+++ stable/11/contrib/file/ChangeLog	Sun Dec 11 07:33:02 2016	(r309847)
@@ -1,3 +1,32 @@
+2016-10-25  10:40  Christos Zoulas <christos@zoulas.com>
+	
+	* release 5.28
+
+2016-10-24  11:20  Christos Zoulas <christos@zoulas.com>
+
+	* der getlength overflow (Jonas Wagner)
+	* multiple magic file load failure (Christoph Biedl)
+
+2016-10-17  11:26  Christos Zoulas <christos@zoulas.com>
+
+	* CDF parsing improvements (Guy Helmer)
+
+2016-07-20   7:26  Christos Zoulas <christos@zoulas.com>
+
+	* Add support for signed indirect offsets
+
+2016-07-18   7:41  Christos Zoulas <christos@zoulas.com>
+
+	* cat /dev/null | file - should print empty (Christoph Biedl)
+
+2016-07-05  15:20  Christos Zoulas <christos@zoulas.com>
+
+	* Bump string size from 64 to 96.
+
+2016-06-13  20:20  Christos Zoulas <christos@zoulas.com>
+
+	* PR/556: Fix separators on annotations.
+
 2016-06-13  19:40  Christos Zoulas <christos@zoulas.com>
 
 	* release 5.28

Modified: stable/11/contrib/file/TODO
==============================================================================
--- stable/11/contrib/file/TODO	Sun Dec 11 06:08:01 2016	(r309846)
+++ stable/11/contrib/file/TODO	Sun Dec 11 07:33:02 2016	(r309847)
@@ -6,7 +6,6 @@ file, not here. More speculative materia
 listed in the BUGS section of the man page had been fixed!)
 
 ---
-
 It would be nice to simplify file considerably. For example,
 reimplement the apprentice and non-pattern magic methods in Python,
 and compile the magic patterns to a giant regex (or something similar;
@@ -15,8 +14,23 @@ small amount of C is needed (because fas
 required for soft magic, not the more detailed information given by
 hard-wired routines). In this regard, note that hplip, which is
 BSD-licensed, has a magic reimplementation in Python.
-
+---
 Read the kerberos magic entry for more ideas.
-
+---
 Write a string merger to make magic entry sizes dynamic.
 Strings will be converted to offsets from the string table.
+---
+Programming language support, we can introduce the concept of a group
+of rules where n rules need to match before the rule is positive. This
+could require structural changes to the matching code :-(
+
+0	group	2	# require 2 matches
+# rule 1
+>0	....
+...
+# rule 2
+>0	....
+...
+
+christos
+

Modified: stable/11/contrib/file/config.guess
==============================================================================
--- stable/11/contrib/file/config.guess	Sun Dec 11 06:08:01 2016	(r309846)
+++ stable/11/contrib/file/config.guess	Sun Dec 11 07:33:02 2016	(r309847)
@@ -1,14 +1,12 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
+#   Copyright 1992-2015 Free Software Foundation, Inc.
 
-timestamp='2012-02-10'
+timestamp='2015-03-04'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -22,19 +20,17 @@ timestamp='2012-02-10'
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner.  Please send patches (context
-# diff format) to <config-patches@gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 #
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches to <config-patches@gnu.org>.
+
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -54,9 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2015 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` |
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+	# If the system lacks a compiler, then just pick glibc.
+	# We could probably try harder.
+	LIBC=gnu
+
+	eval $set_cc_for_build
+	cat <<-EOF > $dummy.c
+	#include <features.h>
+	#if defined(__UCLIBC__)
+	LIBC=uclibc
+	#elif defined(__dietlibc__)
+	LIBC=dietlibc
+	#else
+	LIBC=gnu
+	#endif
+	EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+	;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -153,20 +168,27 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	# Note: NetBSD doesn't particularly care about the vendor
 	# portion of the name.  We always set it to "unknown".
 	sysctl="sysctl -n hw.machine_arch"
-	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+	    /sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || \
+	    echo unknown)`
 	case "${UNAME_MACHINE_ARCH}" in
 	    armeb) machine=armeb-unknown ;;
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
 	    sh5el) machine=sh5le-unknown ;;
+	    earmv*)
+		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+		machine=${arch}${endian}-unknown
+		;;
 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
 	# to ELF recently, or will in the future.
 	case "${UNAME_MACHINE_ARCH}" in
-	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+	    arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
 		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep -q __ELF__
@@ -182,6 +204,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 		os=netbsd
 		;;
 	esac
+	# Determine ABI tags.
+	case "${UNAME_MACHINE_ARCH}" in
+	    earm*)
+		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+		;;
+	esac
 	# The OS release
 	# Debian GNU/NetBSD machines have a different userland, and
 	# thus, need a distinct triplet. However, they do not need
@@ -198,7 +227,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}"
+	echo "${machine}-${os}${release}${abi}"
+	exit ;;
+    *:Bitrig:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
 	exit ;;
     *:OpenBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
@@ -302,7 +335,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
 	exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
 	echo arm-unknown-riscos
 	exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -560,8 +593,9 @@ EOF
 	else
 		IBM_ARCH=powerpc
 	fi
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
+	if [ -x /usr/bin/lslpp ] ; then
+		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
 	else
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
@@ -801,10 +835,13 @@ EOF
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
 	exit ;;
+    *:MINGW64*:*)
+	echo ${UNAME_MACHINE}-pc-mingw64
+	exit ;;
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
-    i*:MSYS*:*)
+    *:MSYS*:*)
 	echo ${UNAME_MACHINE}-pc-msys
 	exit ;;
     i*:windows32*:*)
@@ -852,21 +889,21 @@ EOF
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
 	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
     aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -879,59 +916,57 @@ EOF
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
 	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     arm*:Linux:*:*)
 	eval $set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	else
 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 		| grep -q __ARM_PCS_VFP
 	    then
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
 	    else
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
 	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	exit ;;
+    e2k:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:Linux:*:*)
-	LIBC=gnu
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -950,54 +985,63 @@ EOF
 	#endif
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
-    or32:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+    openrisc*:Linux:*:*)
+	echo or1k-unknown-linux-${LIBC}
+	exit ;;
+    or32:Linux:*:* | or1k*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
+	echo sparc-unknown-linux-${LIBC}
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+	echo hppa64-unknown-linux-${LIBC}
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+	  *)    echo hppa-unknown-linux-${LIBC} ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+	echo powerpc64-unknown-linux-${LIBC}
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+	echo powerpc-unknown-linux-${LIBC}
+	exit ;;
+    ppc64le:Linux:*:*)
+	echo powerpc64le-unknown-linux-${LIBC}
+	exit ;;
+    ppcle:Linux:*:*)
+	echo powerpcle-unknown-linux-${LIBC}
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
+	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
+	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1201,6 +1245,9 @@ EOF
     BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
 	echo i586-pc-haiku
 	exit ;;
+    x86_64:Haiku:*:*)
+	echo x86_64-unknown-haiku
+	exit ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
 	exit ;;
@@ -1227,19 +1274,31 @@ EOF
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    i386)
-		eval $set_cc_for_build
-		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		      grep IS_64BIT_ARCH >/dev/null
-		  then
-		      UNAME_PROCESSOR="x86_64"
-		  fi
-		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
+	eval $set_cc_for_build
+	if test "$UNAME_PROCESSOR" = unknown ; then
+	    UNAME_PROCESSOR=powerpc
+	fi
+	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		    grep IS_64BIT_ARCH >/dev/null
+		then
+		    case $UNAME_PROCESSOR in
+			i386) UNAME_PROCESSOR=x86_64 ;;
+			powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		    esac
+		fi
+	    fi
+	elif test "$UNAME_PROCESSOR" = i386 ; then
+	    # Avoid executing cc on OS X 10.9, as it ships with a stub
+	    # that puts up a graphical alert prompting to install
+	    # developer tools.  Any system running Mac OS X 10.7 or
+	    # later (Darwin 11 and later) is required to have a 64-bit
+	    # processor. This is not true of the ARM version of Darwin
+	    # that Apple uses in portable devices.
+	    UNAME_PROCESSOR=x86_64
+	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1256,7 +1315,7 @@ EOF
     NEO-?:NONSTOP_KERNEL:*:*)
 	echo neo-tandem-nsk${UNAME_RELEASE}
 	exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
+    NSE-*:NONSTOP_KERNEL:*:*)
 	echo nse-tandem-nsk${UNAME_RELEASE}
 	exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
@@ -1330,157 +1389,6 @@ EOF
 	exit ;;
 esac
 
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-	"4"
-#else
-	""
-#endif
-	); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
 cat >&2 <<EOF
 $0: unable to guess system type
 

Modified: stable/11/contrib/file/config.sub
==============================================================================
--- stable/11/contrib/file/config.sub	Sun Dec 11 06:08:01 2016	(r309846)
+++ stable/11/contrib/file/config.sub	Sun Dec 11 07:33:02 2016	(r309847)
@@ -1,24 +1,18 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
-
-timestamp='2012-04-18'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+#   Copyright 1992-2015 Free Software Foundation, Inc.
+
+timestamp='2015-03-08'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
@@ -26,11 +20,12 @@ timestamp='2012-04-18'
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches to <config-patches@gnu.org>.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -73,9 +68,7 @@ Report bugs and patches to <config-patch
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2015 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,8 +116,8 @@ esac
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
@@ -156,7 +149,7 @@ case $os in
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze)
+	-apple | -axis | -knuth | -cray | -microblaze*)
 		os=
 		basic_machine=$1
 		;;
@@ -259,21 +252,24 @@ case $basic_machine in
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
-        | be32 | be64 \
+	| arc | arceb \
+	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+	| avr | avr32 \
+	| be32 | be64 \
 	| bfin \
-	| c4x | clipper \
+	| c4x | c8051 | clipper \
 	| d10v | d30v | dlx | dsp16xx \
-	| epiphany \
-	| fido | fr30 | frv \
+	| e2k | epiphany \
+	| fido | fr30 | frv | ft32 \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| k1om \
 	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore | mep | metag \
+	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
@@ -287,23 +283,26 @@ case $basic_machine in
 	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa32r6 | mipsisa32r6el \
 	| mipsisa64 | mipsisa64el \
 	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64r6 | mipsisa64r6el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipsr5900 | mipsr5900el \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
 	| moxie \
 	| mt \
 	| msp430 \
 	| nds32 | nds32le | nds32be \
-	| nios | nios2 \
+	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| open8 \
-	| or32 \
+	| open8 | or1k | or1knd | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
+	| riscv32 | riscv64 \
 	| rl78 | rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
@@ -314,6 +313,7 @@ case $basic_machine in
 	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
 	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+	| visium \
 	| we32k \
 	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
@@ -328,7 +328,10 @@ case $basic_machine in
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+	leon|leon[3-9])
+		basic_machine=sparc-$basic_machine
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -370,26 +373,28 @@ case $basic_machine in
 	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
 	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| clipper-* | craynv-* | cydra-* \
+	| c8051-* | clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
-	| elxsi-* \
+	| e2k-* | elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| k1om-* \
 	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+	| microblaze-* | microblazeel-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
@@ -403,18 +408,22 @@ case $basic_machine in
 	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa32r6-* | mipsisa32r6el-* \
 	| mipsisa64-* | mipsisa64el-* \
 	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64r6-* | mipsisa64r6el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipsr5900-* | mipsr5900el-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
 	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* \
+	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
+	| or1k*-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@@ -432,6 +441,7 @@ case $basic_machine in
 	| ubicom32-* \
 	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
 	| vax-* \
+	| visium-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
@@ -508,6 +518,9 @@ case $basic_machine in
 		basic_machine=i386-pc
 		os=-aros
 		;;
+        asmjs)
+		basic_machine=asmjs-unknown
+		;;
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -769,6 +782,9 @@ case $basic_machine in
 		basic_machine=m68k-isi
 		os=-sysv
 		;;
+	leon-*|leon[3-9]-*)
+		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+		;;
 	m68knommu)
 		basic_machine=m68k-unknown
 		os=-linux
@@ -788,11 +804,15 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
-	microblaze)
+	microblaze*)
 		basic_machine=microblaze-xilinx
 		;;
+	mingw64)
+		basic_machine=x86_64-pc
+		os=-mingw64
+		;;
 	mingw32)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-mingw32
 		;;
 	mingw32ce)
@@ -820,6 +840,10 @@ case $basic_machine in
 		basic_machine=powerpc-unknown
 		os=-morphos
 		;;
+	moxiebox)
+		basic_machine=moxie-unknown
+		os=-moxiebox
+		;;
 	msdos)
 		basic_machine=i386-pc
 		os=-msdos
@@ -828,7 +852,7 @@ case $basic_machine in
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
 	msys)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-msys
 		;;
 	mvs)
@@ -1019,7 +1043,11 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
-	rdos)
+	rdos | rdos64)
+		basic_machine=x86_64-pc
+		os=-rdos
+		;;
+	rdos32)
 		basic_machine=i386-pc
 		os=-rdos
 		;;
@@ -1346,29 +1374,29 @@ case $os in
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* \
+	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* \
+	      | -aos* | -aros* | -cloudabi* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -openbsd* | -solidbsd* \
+	      | -bitrig* | -openbsd* | -solidbsd* \
 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)

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

From owner-svn-src-all@freebsd.org  Sun Dec 11 07:37:21 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1313C70ACE;
 Sun, 11 Dec 2016 07:37:21 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A945510EA;
 Sun, 11 Dec 2016 07:37:21 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBB7bKxF006009;
 Sun, 11 Dec 2016 07:37:20 GMT (envelope-from delphij@FreeBSD.org)
Received: (from delphij@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBB7bKjP006004;
 Sun, 11 Dec 2016 07:37:20 GMT (envelope-from delphij@FreeBSD.org)
Message-Id: <201612110737.uBB7bKjP006004@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: delphij set sender to
 delphij@FreeBSD.org using -f
From: Xin LI <delphij@FreeBSD.org>
Date: Sun, 11 Dec 2016 07:37:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309848 - in stable/10: contrib/file contrib/file/doc
 contrib/file/magic contrib/file/magic/Magdir contrib/file/python
 contrib/file/src lib/libmagic
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 07:37:22 -0000

Author: delphij
Date: Sun Dec 11 07:37:20 2016
New Revision: 309848
URL: https://svnweb.freebsd.org/changeset/base/309848

Log:
  MFC r308420: MFV r308392: file 5.29.

Added:
  stable/10/contrib/file/magic/Magdir/algol68
     - copied unchanged from r308420, head/contrib/file/magic/Magdir/algol68
  stable/10/contrib/file/magic/Magdir/application
     - copied unchanged from r308420, head/contrib/file/magic/Magdir/application
  stable/10/contrib/file/magic/Magdir/apt
     - copied unchanged from r308420, head/contrib/file/magic/Magdir/apt
  stable/10/contrib/file/magic/Magdir/psl
     - copied unchanged from r308420, head/contrib/file/magic/Magdir/psl
Modified:
  stable/10/contrib/file/ChangeLog
  stable/10/contrib/file/TODO
  stable/10/contrib/file/config.guess
  stable/10/contrib/file/config.sub
  stable/10/contrib/file/configure
  stable/10/contrib/file/configure.ac
  stable/10/contrib/file/doc/file.man
  stable/10/contrib/file/doc/magic.man
  stable/10/contrib/file/ltmain.sh
  stable/10/contrib/file/magic/Magdir/animation
  stable/10/contrib/file/magic/Magdir/apple
  stable/10/contrib/file/magic/Magdir/bioinformatics
  stable/10/contrib/file/magic/Magdir/c-lang
  stable/10/contrib/file/magic/Magdir/claris
  stable/10/contrib/file/magic/Magdir/commands
  stable/10/contrib/file/magic/Magdir/compress
  stable/10/contrib/file/magic/Magdir/cups
  stable/10/contrib/file/magic/Magdir/editors
  stable/10/contrib/file/magic/Magdir/filesystems
  stable/10/contrib/file/magic/Magdir/fonts
  stable/10/contrib/file/magic/Magdir/gcc
  stable/10/contrib/file/magic/Magdir/gnu
  stable/10/contrib/file/magic/Magdir/images
  stable/10/contrib/file/magic/Magdir/jpeg
  stable/10/contrib/file/magic/Magdir/msdos
  stable/10/contrib/file/magic/Magdir/pgp
  stable/10/contrib/file/magic/Magdir/python
  stable/10/contrib/file/magic/Magdir/ruby
  stable/10/contrib/file/magic/Magdir/sgml
  stable/10/contrib/file/magic/Magdir/sql
  stable/10/contrib/file/magic/Makefile.am
  stable/10/contrib/file/magic/Makefile.in
  stable/10/contrib/file/python/magic.py
  stable/10/contrib/file/src/apprentice.c
  stable/10/contrib/file/src/ascmagic.c
  stable/10/contrib/file/src/cdf.c
  stable/10/contrib/file/src/cdf.h
  stable/10/contrib/file/src/compress.c
  stable/10/contrib/file/src/der.c
  stable/10/contrib/file/src/file.c
  stable/10/contrib/file/src/file.h
  stable/10/contrib/file/src/funcs.c
  stable/10/contrib/file/src/magic.c
  stable/10/contrib/file/src/readcdf.c
  stable/10/contrib/file/src/readelf.c
  stable/10/contrib/file/src/softmagic.c
  stable/10/lib/libmagic/config.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/file/ChangeLog
==============================================================================
--- stable/10/contrib/file/ChangeLog	Sun Dec 11 07:33:02 2016	(r309847)
+++ stable/10/contrib/file/ChangeLog	Sun Dec 11 07:37:20 2016	(r309848)
@@ -1,3 +1,32 @@
+2016-10-25  10:40  Christos Zoulas <christos@zoulas.com>
+	
+	* release 5.28
+
+2016-10-24  11:20  Christos Zoulas <christos@zoulas.com>
+
+	* der getlength overflow (Jonas Wagner)
+	* multiple magic file load failure (Christoph Biedl)
+
+2016-10-17  11:26  Christos Zoulas <christos@zoulas.com>
+
+	* CDF parsing improvements (Guy Helmer)
+
+2016-07-20   7:26  Christos Zoulas <christos@zoulas.com>
+
+	* Add support for signed indirect offsets
+
+2016-07-18   7:41  Christos Zoulas <christos@zoulas.com>
+
+	* cat /dev/null | file - should print empty (Christoph Biedl)
+
+2016-07-05  15:20  Christos Zoulas <christos@zoulas.com>
+
+	* Bump string size from 64 to 96.
+
+2016-06-13  20:20  Christos Zoulas <christos@zoulas.com>
+
+	* PR/556: Fix separators on annotations.
+
 2016-06-13  19:40  Christos Zoulas <christos@zoulas.com>
 
 	* release 5.28

Modified: stable/10/contrib/file/TODO
==============================================================================
--- stable/10/contrib/file/TODO	Sun Dec 11 07:33:02 2016	(r309847)
+++ stable/10/contrib/file/TODO	Sun Dec 11 07:37:20 2016	(r309848)
@@ -6,7 +6,6 @@ file, not here. More speculative materia
 listed in the BUGS section of the man page had been fixed!)
 
 ---
-
 It would be nice to simplify file considerably. For example,
 reimplement the apprentice and non-pattern magic methods in Python,
 and compile the magic patterns to a giant regex (or something similar;
@@ -15,8 +14,23 @@ small amount of C is needed (because fas
 required for soft magic, not the more detailed information given by
 hard-wired routines). In this regard, note that hplip, which is
 BSD-licensed, has a magic reimplementation in Python.
-
+---
 Read the kerberos magic entry for more ideas.
-
+---
 Write a string merger to make magic entry sizes dynamic.
 Strings will be converted to offsets from the string table.
+---
+Programming language support, we can introduce the concept of a group
+of rules where n rules need to match before the rule is positive. This
+could require structural changes to the matching code :-(
+
+0	group	2	# require 2 matches
+# rule 1
+>0	....
+...
+# rule 2
+>0	....
+...
+
+christos
+

Modified: stable/10/contrib/file/config.guess
==============================================================================
--- stable/10/contrib/file/config.guess	Sun Dec 11 07:33:02 2016	(r309847)
+++ stable/10/contrib/file/config.guess	Sun Dec 11 07:37:20 2016	(r309848)
@@ -1,14 +1,12 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
+#   Copyright 1992-2015 Free Software Foundation, Inc.
 
-timestamp='2012-02-10'
+timestamp='2015-03-04'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -22,19 +20,17 @@ timestamp='2012-02-10'
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner.  Please send patches (context
-# diff format) to <config-patches@gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 #
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches to <config-patches@gnu.org>.
+
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -54,9 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2015 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` |
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+	# If the system lacks a compiler, then just pick glibc.
+	# We could probably try harder.
+	LIBC=gnu
+
+	eval $set_cc_for_build
+	cat <<-EOF > $dummy.c
+	#include <features.h>
+	#if defined(__UCLIBC__)
+	LIBC=uclibc
+	#elif defined(__dietlibc__)
+	LIBC=dietlibc
+	#else
+	LIBC=gnu
+	#endif
+	EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+	;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -153,20 +168,27 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	# Note: NetBSD doesn't particularly care about the vendor
 	# portion of the name.  We always set it to "unknown".
 	sysctl="sysctl -n hw.machine_arch"
-	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+	    /sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || \
+	    echo unknown)`
 	case "${UNAME_MACHINE_ARCH}" in
 	    armeb) machine=armeb-unknown ;;
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
 	    sh5el) machine=sh5le-unknown ;;
+	    earmv*)
+		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+		machine=${arch}${endian}-unknown
+		;;
 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
 	# to ELF recently, or will in the future.
 	case "${UNAME_MACHINE_ARCH}" in
-	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+	    arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
 		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep -q __ELF__
@@ -182,6 +204,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 		os=netbsd
 		;;
 	esac
+	# Determine ABI tags.
+	case "${UNAME_MACHINE_ARCH}" in
+	    earm*)
+		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+		;;
+	esac
 	# The OS release
 	# Debian GNU/NetBSD machines have a different userland, and
 	# thus, need a distinct triplet. However, they do not need
@@ -198,7 +227,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}"
+	echo "${machine}-${os}${release}${abi}"
+	exit ;;
+    *:Bitrig:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
 	exit ;;
     *:OpenBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
@@ -302,7 +335,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
 	exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
 	echo arm-unknown-riscos
 	exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -560,8 +593,9 @@ EOF
 	else
 		IBM_ARCH=powerpc
 	fi
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
+	if [ -x /usr/bin/lslpp ] ; then
+		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
 	else
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
@@ -801,10 +835,13 @@ EOF
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
 	exit ;;
+    *:MINGW64*:*)
+	echo ${UNAME_MACHINE}-pc-mingw64
+	exit ;;
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
-    i*:MSYS*:*)
+    *:MSYS*:*)
 	echo ${UNAME_MACHINE}-pc-msys
 	exit ;;
     i*:windows32*:*)
@@ -852,21 +889,21 @@ EOF
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
 	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
     aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -879,59 +916,57 @@ EOF
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
 	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     arm*:Linux:*:*)
 	eval $set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	else
 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 		| grep -q __ARM_PCS_VFP
 	    then
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
 	    else
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
 	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	exit ;;
+    e2k:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:Linux:*:*)
-	LIBC=gnu
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -950,54 +985,63 @@ EOF
 	#endif
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
-    or32:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+    openrisc*:Linux:*:*)
+	echo or1k-unknown-linux-${LIBC}
+	exit ;;
+    or32:Linux:*:* | or1k*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
+	echo sparc-unknown-linux-${LIBC}
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+	echo hppa64-unknown-linux-${LIBC}
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+	  *)    echo hppa-unknown-linux-${LIBC} ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+	echo powerpc64-unknown-linux-${LIBC}
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+	echo powerpc-unknown-linux-${LIBC}
+	exit ;;
+    ppc64le:Linux:*:*)
+	echo powerpc64le-unknown-linux-${LIBC}
+	exit ;;
+    ppcle:Linux:*:*)
+	echo powerpcle-unknown-linux-${LIBC}
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
+	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
+	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1201,6 +1245,9 @@ EOF
     BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
 	echo i586-pc-haiku
 	exit ;;
+    x86_64:Haiku:*:*)
+	echo x86_64-unknown-haiku
+	exit ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
 	exit ;;
@@ -1227,19 +1274,31 @@ EOF
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    i386)
-		eval $set_cc_for_build
-		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		      grep IS_64BIT_ARCH >/dev/null
-		  then
-		      UNAME_PROCESSOR="x86_64"
-		  fi
-		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
+	eval $set_cc_for_build
+	if test "$UNAME_PROCESSOR" = unknown ; then
+	    UNAME_PROCESSOR=powerpc
+	fi
+	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		    grep IS_64BIT_ARCH >/dev/null
+		then
+		    case $UNAME_PROCESSOR in
+			i386) UNAME_PROCESSOR=x86_64 ;;
+			powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		    esac
+		fi
+	    fi
+	elif test "$UNAME_PROCESSOR" = i386 ; then
+	    # Avoid executing cc on OS X 10.9, as it ships with a stub
+	    # that puts up a graphical alert prompting to install
+	    # developer tools.  Any system running Mac OS X 10.7 or
+	    # later (Darwin 11 and later) is required to have a 64-bit
+	    # processor. This is not true of the ARM version of Darwin
+	    # that Apple uses in portable devices.
+	    UNAME_PROCESSOR=x86_64
+	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1256,7 +1315,7 @@ EOF
     NEO-?:NONSTOP_KERNEL:*:*)
 	echo neo-tandem-nsk${UNAME_RELEASE}
 	exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
+    NSE-*:NONSTOP_KERNEL:*:*)
 	echo nse-tandem-nsk${UNAME_RELEASE}
 	exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
@@ -1330,157 +1389,6 @@ EOF
 	exit ;;
 esac
 
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-	"4"
-#else
-	""
-#endif
-	); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
 cat >&2 <<EOF
 $0: unable to guess system type
 

Modified: stable/10/contrib/file/config.sub
==============================================================================
--- stable/10/contrib/file/config.sub	Sun Dec 11 07:33:02 2016	(r309847)
+++ stable/10/contrib/file/config.sub	Sun Dec 11 07:37:20 2016	(r309848)
@@ -1,24 +1,18 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
-
-timestamp='2012-04-18'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+#   Copyright 1992-2015 Free Software Foundation, Inc.
+
+timestamp='2015-03-08'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
@@ -26,11 +20,12 @@ timestamp='2012-04-18'
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches to <config-patches@gnu.org>.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -73,9 +68,7 @@ Report bugs and patches to <config-patch
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2015 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,8 +116,8 @@ esac
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
@@ -156,7 +149,7 @@ case $os in
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze)
+	-apple | -axis | -knuth | -cray | -microblaze*)
 		os=
 		basic_machine=$1
 		;;
@@ -259,21 +252,24 @@ case $basic_machine in
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
-        | be32 | be64 \
+	| arc | arceb \
+	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+	| avr | avr32 \
+	| be32 | be64 \
 	| bfin \
-	| c4x | clipper \
+	| c4x | c8051 | clipper \
 	| d10v | d30v | dlx | dsp16xx \
-	| epiphany \
-	| fido | fr30 | frv \
+	| e2k | epiphany \
+	| fido | fr30 | frv | ft32 \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| k1om \
 	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore | mep | metag \
+	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
@@ -287,23 +283,26 @@ case $basic_machine in
 	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa32r6 | mipsisa32r6el \
 	| mipsisa64 | mipsisa64el \
 	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64r6 | mipsisa64r6el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipsr5900 | mipsr5900el \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
 	| moxie \
 	| mt \
 	| msp430 \
 	| nds32 | nds32le | nds32be \
-	| nios | nios2 \
+	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| open8 \
-	| or32 \
+	| open8 | or1k | or1knd | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
+	| riscv32 | riscv64 \
 	| rl78 | rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
@@ -314,6 +313,7 @@ case $basic_machine in
 	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
 	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+	| visium \
 	| we32k \
 	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
@@ -328,7 +328,10 @@ case $basic_machine in
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+	leon|leon[3-9])
+		basic_machine=sparc-$basic_machine
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -370,26 +373,28 @@ case $basic_machine in
 	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
 	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| clipper-* | craynv-* | cydra-* \
+	| c8051-* | clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
-	| elxsi-* \
+	| e2k-* | elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| k1om-* \
 	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+	| microblaze-* | microblazeel-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
@@ -403,18 +408,22 @@ case $basic_machine in
 	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa32r6-* | mipsisa32r6el-* \
 	| mipsisa64-* | mipsisa64el-* \
 	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64r6-* | mipsisa64r6el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipsr5900-* | mipsr5900el-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
 	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* \
+	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
+	| or1k*-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@@ -432,6 +441,7 @@ case $basic_machine in
 	| ubicom32-* \
 	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
 	| vax-* \
+	| visium-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
@@ -508,6 +518,9 @@ case $basic_machine in
 		basic_machine=i386-pc
 		os=-aros
 		;;
+        asmjs)
+		basic_machine=asmjs-unknown
+		;;
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -769,6 +782,9 @@ case $basic_machine in
 		basic_machine=m68k-isi
 		os=-sysv
 		;;
+	leon-*|leon[3-9]-*)
+		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+		;;
 	m68knommu)
 		basic_machine=m68k-unknown
 		os=-linux
@@ -788,11 +804,15 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
-	microblaze)
+	microblaze*)
 		basic_machine=microblaze-xilinx
 		;;
+	mingw64)
+		basic_machine=x86_64-pc
+		os=-mingw64
+		;;
 	mingw32)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-mingw32
 		;;
 	mingw32ce)
@@ -820,6 +840,10 @@ case $basic_machine in
 		basic_machine=powerpc-unknown
 		os=-morphos
 		;;
+	moxiebox)
+		basic_machine=moxie-unknown
+		os=-moxiebox
+		;;
 	msdos)
 		basic_machine=i386-pc
 		os=-msdos
@@ -828,7 +852,7 @@ case $basic_machine in
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
 	msys)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-msys
 		;;
 	mvs)
@@ -1019,7 +1043,11 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
-	rdos)
+	rdos | rdos64)
+		basic_machine=x86_64-pc
+		os=-rdos
+		;;
+	rdos32)
 		basic_machine=i386-pc
 		os=-rdos
 		;;
@@ -1346,29 +1374,29 @@ case $os in
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* \
+	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* \
+	      | -aos* | -aros* | -cloudabi* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -openbsd* | -solidbsd* \
+	      | -bitrig* | -openbsd* | -solidbsd* \
 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)

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

From owner-svn-src-all@freebsd.org  Sun Dec 11 07:39:12 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EA5CC70B69;
 Sun, 11 Dec 2016 07:39:12 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 458BA12A3;
 Sun, 11 Dec 2016 07:39:12 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBB7dBBG006130;
 Sun, 11 Dec 2016 07:39:11 GMT (envelope-from delphij@FreeBSD.org)
Received: (from delphij@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBB7dBn2006125;
 Sun, 11 Dec 2016 07:39:11 GMT (envelope-from delphij@FreeBSD.org)
Message-Id: <201612110739.uBB7dBn2006125@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: delphij set sender to
 delphij@FreeBSD.org using -f
From: Xin LI <delphij@FreeBSD.org>
Date: Sun, 11 Dec 2016 07:39:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r309849 - in stable/9: contrib/file contrib/file/doc
 contrib/file/magic contrib/file/magic/Magdir contrib/file/python
 contrib/file/src lib/libmagic
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 07:39:12 -0000

Author: delphij
Date: Sun Dec 11 07:39:10 2016
New Revision: 309849
URL: https://svnweb.freebsd.org/changeset/base/309849

Log:
  MFC r308420: MFV r308392: file 5.29.

Added:
  stable/9/contrib/file/magic/Magdir/algol68
     - copied unchanged from r308420, head/contrib/file/magic/Magdir/algol68
  stable/9/contrib/file/magic/Magdir/application
     - copied unchanged from r308420, head/contrib/file/magic/Magdir/application
  stable/9/contrib/file/magic/Magdir/apt
     - copied unchanged from r308420, head/contrib/file/magic/Magdir/apt
  stable/9/contrib/file/magic/Magdir/psl
     - copied unchanged from r308420, head/contrib/file/magic/Magdir/psl
Modified:
  stable/9/contrib/file/ChangeLog
  stable/9/contrib/file/TODO
  stable/9/contrib/file/config.guess
  stable/9/contrib/file/config.sub
  stable/9/contrib/file/configure
  stable/9/contrib/file/configure.ac
  stable/9/contrib/file/doc/file.man
  stable/9/contrib/file/doc/magic.man
  stable/9/contrib/file/ltmain.sh
  stable/9/contrib/file/magic/Magdir/animation
  stable/9/contrib/file/magic/Magdir/apple
  stable/9/contrib/file/magic/Magdir/bioinformatics
  stable/9/contrib/file/magic/Magdir/c-lang
  stable/9/contrib/file/magic/Magdir/claris
  stable/9/contrib/file/magic/Magdir/commands
  stable/9/contrib/file/magic/Magdir/compress
  stable/9/contrib/file/magic/Magdir/cups
  stable/9/contrib/file/magic/Magdir/editors
  stable/9/contrib/file/magic/Magdir/filesystems
  stable/9/contrib/file/magic/Magdir/fonts
  stable/9/contrib/file/magic/Magdir/gcc
  stable/9/contrib/file/magic/Magdir/gnu
  stable/9/contrib/file/magic/Magdir/images
  stable/9/contrib/file/magic/Magdir/jpeg
  stable/9/contrib/file/magic/Magdir/msdos
  stable/9/contrib/file/magic/Magdir/pgp
  stable/9/contrib/file/magic/Magdir/python
  stable/9/contrib/file/magic/Magdir/ruby
  stable/9/contrib/file/magic/Magdir/sgml
  stable/9/contrib/file/magic/Magdir/sql
  stable/9/contrib/file/magic/Makefile.am
  stable/9/contrib/file/magic/Makefile.in
  stable/9/contrib/file/python/magic.py
  stable/9/contrib/file/src/apprentice.c
  stable/9/contrib/file/src/ascmagic.c
  stable/9/contrib/file/src/cdf.c
  stable/9/contrib/file/src/cdf.h
  stable/9/contrib/file/src/compress.c
  stable/9/contrib/file/src/der.c
  stable/9/contrib/file/src/file.c
  stable/9/contrib/file/src/file.h
  stable/9/contrib/file/src/funcs.c
  stable/9/contrib/file/src/magic.c
  stable/9/contrib/file/src/readcdf.c
  stable/9/contrib/file/src/readelf.c
  stable/9/contrib/file/src/softmagic.c
  stable/9/lib/libmagic/config.h
Directory Properties:
  stable/9/contrib/file/   (props changed)
  stable/9/lib/libmagic/   (props changed)

Modified: stable/9/contrib/file/ChangeLog
==============================================================================
--- stable/9/contrib/file/ChangeLog	Sun Dec 11 07:37:20 2016	(r309848)
+++ stable/9/contrib/file/ChangeLog	Sun Dec 11 07:39:10 2016	(r309849)
@@ -1,3 +1,32 @@
+2016-10-25  10:40  Christos Zoulas <christos@zoulas.com>
+	
+	* release 5.28
+
+2016-10-24  11:20  Christos Zoulas <christos@zoulas.com>
+
+	* der getlength overflow (Jonas Wagner)
+	* multiple magic file load failure (Christoph Biedl)
+
+2016-10-17  11:26  Christos Zoulas <christos@zoulas.com>
+
+	* CDF parsing improvements (Guy Helmer)
+
+2016-07-20   7:26  Christos Zoulas <christos@zoulas.com>
+
+	* Add support for signed indirect offsets
+
+2016-07-18   7:41  Christos Zoulas <christos@zoulas.com>
+
+	* cat /dev/null | file - should print empty (Christoph Biedl)
+
+2016-07-05  15:20  Christos Zoulas <christos@zoulas.com>
+
+	* Bump string size from 64 to 96.
+
+2016-06-13  20:20  Christos Zoulas <christos@zoulas.com>
+
+	* PR/556: Fix separators on annotations.
+
 2016-06-13  19:40  Christos Zoulas <christos@zoulas.com>
 
 	* release 5.28

Modified: stable/9/contrib/file/TODO
==============================================================================
--- stable/9/contrib/file/TODO	Sun Dec 11 07:37:20 2016	(r309848)
+++ stable/9/contrib/file/TODO	Sun Dec 11 07:39:10 2016	(r309849)
@@ -6,7 +6,6 @@ file, not here. More speculative materia
 listed in the BUGS section of the man page had been fixed!)
 
 ---
-
 It would be nice to simplify file considerably. For example,
 reimplement the apprentice and non-pattern magic methods in Python,
 and compile the magic patterns to a giant regex (or something similar;
@@ -15,8 +14,23 @@ small amount of C is needed (because fas
 required for soft magic, not the more detailed information given by
 hard-wired routines). In this regard, note that hplip, which is
 BSD-licensed, has a magic reimplementation in Python.
-
+---
 Read the kerberos magic entry for more ideas.
-
+---
 Write a string merger to make magic entry sizes dynamic.
 Strings will be converted to offsets from the string table.
+---
+Programming language support, we can introduce the concept of a group
+of rules where n rules need to match before the rule is positive. This
+could require structural changes to the matching code :-(
+
+0	group	2	# require 2 matches
+# rule 1
+>0	....
+...
+# rule 2
+>0	....
+...
+
+christos
+

Modified: stable/9/contrib/file/config.guess
==============================================================================
--- stable/9/contrib/file/config.guess	Sun Dec 11 07:37:20 2016	(r309848)
+++ stable/9/contrib/file/config.guess	Sun Dec 11 07:39:10 2016	(r309849)
@@ -1,14 +1,12 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
+#   Copyright 1992-2015 Free Software Foundation, Inc.
 
-timestamp='2012-02-10'
+timestamp='2015-03-04'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -22,19 +20,17 @@ timestamp='2012-02-10'
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner.  Please send patches (context
-# diff format) to <config-patches@gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 #
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches to <config-patches@gnu.org>.
+
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -54,9 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2015 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` |
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+	# If the system lacks a compiler, then just pick glibc.
+	# We could probably try harder.
+	LIBC=gnu
+
+	eval $set_cc_for_build
+	cat <<-EOF > $dummy.c
+	#include <features.h>
+	#if defined(__UCLIBC__)
+	LIBC=uclibc
+	#elif defined(__dietlibc__)
+	LIBC=dietlibc
+	#else
+	LIBC=gnu
+	#endif
+	EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+	;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -153,20 +168,27 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	# Note: NetBSD doesn't particularly care about the vendor
 	# portion of the name.  We always set it to "unknown".
 	sysctl="sysctl -n hw.machine_arch"
-	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+	    /sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || \
+	    echo unknown)`
 	case "${UNAME_MACHINE_ARCH}" in
 	    armeb) machine=armeb-unknown ;;
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
 	    sh5el) machine=sh5le-unknown ;;
+	    earmv*)
+		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+		machine=${arch}${endian}-unknown
+		;;
 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
 	# to ELF recently, or will in the future.
 	case "${UNAME_MACHINE_ARCH}" in
-	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+	    arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
 		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep -q __ELF__
@@ -182,6 +204,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 		os=netbsd
 		;;
 	esac
+	# Determine ABI tags.
+	case "${UNAME_MACHINE_ARCH}" in
+	    earm*)
+		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+		;;
+	esac
 	# The OS release
 	# Debian GNU/NetBSD machines have a different userland, and
 	# thus, need a distinct triplet. However, they do not need
@@ -198,7 +227,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}"
+	echo "${machine}-${os}${release}${abi}"
+	exit ;;
+    *:Bitrig:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
 	exit ;;
     *:OpenBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
@@ -302,7 +335,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
 	exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
 	echo arm-unknown-riscos
 	exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -560,8 +593,9 @@ EOF
 	else
 		IBM_ARCH=powerpc
 	fi
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
+	if [ -x /usr/bin/lslpp ] ; then
+		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
 	else
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
@@ -801,10 +835,13 @@ EOF
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
 	exit ;;
+    *:MINGW64*:*)
+	echo ${UNAME_MACHINE}-pc-mingw64
+	exit ;;
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
-    i*:MSYS*:*)
+    *:MSYS*:*)
 	echo ${UNAME_MACHINE}-pc-msys
 	exit ;;
     i*:windows32*:*)
@@ -852,21 +889,21 @@ EOF
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
 	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
     aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -879,59 +916,57 @@ EOF
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
 	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     arm*:Linux:*:*)
 	eval $set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	else
 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 		| grep -q __ARM_PCS_VFP
 	    then
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
 	    else
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
 	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	exit ;;
+    e2k:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:Linux:*:*)
-	LIBC=gnu
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -950,54 +985,63 @@ EOF
 	#endif
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
-    or32:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+    openrisc*:Linux:*:*)
+	echo or1k-unknown-linux-${LIBC}
+	exit ;;
+    or32:Linux:*:* | or1k*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
+	echo sparc-unknown-linux-${LIBC}
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+	echo hppa64-unknown-linux-${LIBC}
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+	  *)    echo hppa-unknown-linux-${LIBC} ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+	echo powerpc64-unknown-linux-${LIBC}
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+	echo powerpc-unknown-linux-${LIBC}
+	exit ;;
+    ppc64le:Linux:*:*)
+	echo powerpc64le-unknown-linux-${LIBC}
+	exit ;;
+    ppcle:Linux:*:*)
+	echo powerpcle-unknown-linux-${LIBC}
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
+	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
+	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1201,6 +1245,9 @@ EOF
     BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
 	echo i586-pc-haiku
 	exit ;;
+    x86_64:Haiku:*:*)
+	echo x86_64-unknown-haiku
+	exit ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
 	exit ;;
@@ -1227,19 +1274,31 @@ EOF
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    i386)
-		eval $set_cc_for_build
-		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		      grep IS_64BIT_ARCH >/dev/null
-		  then
-		      UNAME_PROCESSOR="x86_64"
-		  fi
-		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
+	eval $set_cc_for_build
+	if test "$UNAME_PROCESSOR" = unknown ; then
+	    UNAME_PROCESSOR=powerpc
+	fi
+	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		    grep IS_64BIT_ARCH >/dev/null
+		then
+		    case $UNAME_PROCESSOR in
+			i386) UNAME_PROCESSOR=x86_64 ;;
+			powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		    esac
+		fi
+	    fi
+	elif test "$UNAME_PROCESSOR" = i386 ; then
+	    # Avoid executing cc on OS X 10.9, as it ships with a stub
+	    # that puts up a graphical alert prompting to install
+	    # developer tools.  Any system running Mac OS X 10.7 or
+	    # later (Darwin 11 and later) is required to have a 64-bit
+	    # processor. This is not true of the ARM version of Darwin
+	    # that Apple uses in portable devices.
+	    UNAME_PROCESSOR=x86_64
+	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1256,7 +1315,7 @@ EOF
     NEO-?:NONSTOP_KERNEL:*:*)
 	echo neo-tandem-nsk${UNAME_RELEASE}
 	exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
+    NSE-*:NONSTOP_KERNEL:*:*)
 	echo nse-tandem-nsk${UNAME_RELEASE}
 	exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
@@ -1330,157 +1389,6 @@ EOF
 	exit ;;
 esac
 
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-	"4"
-#else
-	""
-#endif
-	); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
 cat >&2 <<EOF
 $0: unable to guess system type
 

Modified: stable/9/contrib/file/config.sub
==============================================================================
--- stable/9/contrib/file/config.sub	Sun Dec 11 07:37:20 2016	(r309848)
+++ stable/9/contrib/file/config.sub	Sun Dec 11 07:39:10 2016	(r309849)
@@ -1,24 +1,18 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
-
-timestamp='2012-04-18'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+#   Copyright 1992-2015 Free Software Foundation, Inc.
+
+timestamp='2015-03-08'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
@@ -26,11 +20,12 @@ timestamp='2012-04-18'
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches to <config-patches@gnu.org>.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -73,9 +68,7 @@ Report bugs and patches to <config-patch
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2015 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,8 +116,8 @@ esac
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
@@ -156,7 +149,7 @@ case $os in
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze)
+	-apple | -axis | -knuth | -cray | -microblaze*)
 		os=
 		basic_machine=$1
 		;;
@@ -259,21 +252,24 @@ case $basic_machine in
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
-        | be32 | be64 \
+	| arc | arceb \
+	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+	| avr | avr32 \
+	| be32 | be64 \
 	| bfin \
-	| c4x | clipper \
+	| c4x | c8051 | clipper \
 	| d10v | d30v | dlx | dsp16xx \
-	| epiphany \
-	| fido | fr30 | frv \
+	| e2k | epiphany \
+	| fido | fr30 | frv | ft32 \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| k1om \
 	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore | mep | metag \
+	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
@@ -287,23 +283,26 @@ case $basic_machine in
 	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa32r6 | mipsisa32r6el \
 	| mipsisa64 | mipsisa64el \
 	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64r6 | mipsisa64r6el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipsr5900 | mipsr5900el \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
 	| moxie \
 	| mt \
 	| msp430 \
 	| nds32 | nds32le | nds32be \
-	| nios | nios2 \
+	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| open8 \
-	| or32 \
+	| open8 | or1k | or1knd | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
+	| riscv32 | riscv64 \
 	| rl78 | rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
@@ -314,6 +313,7 @@ case $basic_machine in
 	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
 	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+	| visium \
 	| we32k \
 	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
@@ -328,7 +328,10 @@ case $basic_machine in
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+	leon|leon[3-9])
+		basic_machine=sparc-$basic_machine
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -370,26 +373,28 @@ case $basic_machine in
 	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
 	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| clipper-* | craynv-* | cydra-* \
+	| c8051-* | clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
-	| elxsi-* \
+	| e2k-* | elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| k1om-* \
 	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+	| microblaze-* | microblazeel-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
@@ -403,18 +408,22 @@ case $basic_machine in
 	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa32r6-* | mipsisa32r6el-* \
 	| mipsisa64-* | mipsisa64el-* \
 	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64r6-* | mipsisa64r6el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipsr5900-* | mipsr5900el-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
 	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* \
+	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
+	| or1k*-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@@ -432,6 +441,7 @@ case $basic_machine in
 	| ubicom32-* \
 	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
 	| vax-* \
+	| visium-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
@@ -508,6 +518,9 @@ case $basic_machine in
 		basic_machine=i386-pc
 		os=-aros
 		;;
+        asmjs)
+		basic_machine=asmjs-unknown
+		;;
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -769,6 +782,9 @@ case $basic_machine in
 		basic_machine=m68k-isi
 		os=-sysv
 		;;
+	leon-*|leon[3-9]-*)
+		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+		;;
 	m68knommu)
 		basic_machine=m68k-unknown
 		os=-linux
@@ -788,11 +804,15 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
-	microblaze)
+	microblaze*)
 		basic_machine=microblaze-xilinx
 		;;
+	mingw64)
+		basic_machine=x86_64-pc
+		os=-mingw64
+		;;
 	mingw32)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-mingw32
 		;;
 	mingw32ce)
@@ -820,6 +840,10 @@ case $basic_machine in
 		basic_machine=powerpc-unknown
 		os=-morphos
 		;;
+	moxiebox)
+		basic_machine=moxie-unknown
+		os=-moxiebox
+		;;
 	msdos)
 		basic_machine=i386-pc
 		os=-msdos
@@ -828,7 +852,7 @@ case $basic_machine in
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
 	msys)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-msys
 		;;
 	mvs)
@@ -1019,7 +1043,11 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
-	rdos)
+	rdos | rdos64)
+		basic_machine=x86_64-pc
+		os=-rdos
+		;;
+	rdos32)
 		basic_machine=i386-pc
 		os=-rdos
 		;;
@@ -1346,29 +1374,29 @@ case $os in
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* \
+	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* \
+	      | -aos* | -aros* | -cloudabi* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -openbsd* | -solidbsd* \
+	      | -bitrig* | -openbsd* | -solidbsd* \
 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)

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

From owner-svn-src-all@freebsd.org  Sun Dec 11 08:14:43 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2409C727C7;
 Sun, 11 Dec 2016 08:14:43 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 915DB15F4;
 Sun, 11 Dec 2016 08:14:43 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBB8Eg2e022483;
 Sun, 11 Dec 2016 08:14:42 GMT (envelope-from delphij@FreeBSD.org)
Received: (from delphij@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBB8EgSu022482;
 Sun, 11 Dec 2016 08:14:42 GMT (envelope-from delphij@FreeBSD.org)
Message-Id: <201612110814.uBB8EgSu022482@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: delphij set sender to
 delphij@FreeBSD.org using -f
From: Xin LI <delphij@FreeBSD.org>
Date: Sun, 11 Dec 2016 08:14:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309850 - stable/11/usr.bin/gzip
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 08:14:43 -0000

Author: delphij
Date: Sun Dec 11 08:14:42 2016
New Revision: 309850
URL: https://svnweb.freebsd.org/changeset/base/309850

Log:
  MFC r304875:
  
  Use printable ASCII instead of octal representation.

Modified:
  stable/11/usr.bin/gzip/gzip.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/gzip/gzip.c
==============================================================================
--- stable/11/usr.bin/gzip/gzip.c	Sun Dec 11 07:39:10 2016	(r309849)
+++ stable/11/usr.bin/gzip/gzip.c	Sun Dec 11 08:14:42 2016	(r309850)
@@ -88,7 +88,7 @@ enum filetype {
 #include <bzlib.h>
 
 #define BZ2_SUFFIX	".bz2"
-#define BZIP2_MAGIC	"\102\132\150"
+#define BZIP2_MAGIC	"BZh"
 #endif
 
 #ifndef NO_COMPRESS_SUPPORT

From owner-svn-src-all@freebsd.org  Sun Dec 11 13:26:36 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A933EC7129E;
 Sun, 11 Dec 2016 13:26:36 +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 6D90BCAC;
 Sun, 11 Dec 2016 13:26:36 +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 uBBDQZDS047049;
 Sun, 11 Dec 2016 13:26:35 GMT (envelope-from tuexen@FreeBSD.org)
Received: (from tuexen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBBDQZUX047047;
 Sun, 11 Dec 2016 13:26:35 GMT (envelope-from tuexen@FreeBSD.org)
Message-Id: <201612111326.uBBDQZUX047047@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: tuexen set sender to
 tuexen@FreeBSD.org using -f
From: Michael Tuexen <tuexen@FreeBSD.org>
Date: Sun, 11 Dec 2016 13:26:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309851 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 13:26:36 -0000

Author: tuexen
Date: Sun Dec 11 13:26:35 2016
New Revision: 309851
URL: https://svnweb.freebsd.org/changeset/base/309851

Log:
  Ensure that the reported ppid and tsn are taken from the first fragment.
  
  This fixes a bug where the wrong ppid was reported, if
  * I-DATA was used on the first fragement was not received first
  * DATA was used and different ppids where used.
  
  Thanks to Julian Cordes for making me aware of the issue.
  
  MFC after:	1 week

Modified:
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c	Sun Dec 11 08:14:42 2016	(r309850)
+++ head/sys/netinet/sctp_indata.c	Sun Dec 11 13:26:35 2016	(r309851)
@@ -333,10 +333,10 @@ sctp_place_control_in_stream(struct sctp
 {
 	struct sctp_queued_to_read *at;
 	struct sctp_readhead *q;
-	uint8_t bits, unordered;
+	uint8_t flags, unordered;
 
-	bits = (control->sinfo_flags >> 8);
-	unordered = bits & SCTP_DATA_UNORDERED;
+	flags = (control->sinfo_flags >> 8);
+	unordered = flags & SCTP_DATA_UNORDERED;
 	if (unordered) {
 		q = &strm->uno_inqueue;
 		if (asoc->idata_supported == 0) {
@@ -352,8 +352,10 @@ sctp_place_control_in_stream(struct sctp
 	} else {
 		q = &strm->inqueue;
 	}
-	if ((bits & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
-		control->end_added = control->last_frag_seen = control->first_frag_seen = 1;
+	if ((flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
+		control->end_added = 1;
+		control->first_frag_seen = 1;
+		control->last_frag_seen = 1;
 	}
 	if (TAILQ_EMPTY(q)) {
 		/* Empty queue */
@@ -394,8 +396,7 @@ sctp_place_control_in_stream(struct sctp
 						sctp_log_strm_del(control, at,
 						    SCTP_STR_LOG_FROM_INSERT_TL);
 					}
-					TAILQ_INSERT_AFTER(q,
-					    at, control, next_instrm);
+					TAILQ_INSERT_AFTER(q, at, control, next_instrm);
 					if (unordered) {
 						control->on_strm_q = SCTP_ON_UNORDERED;
 					} else {
@@ -972,7 +973,8 @@ sctp_inject_old_unordered_data(struct sc
 			goto place_chunk;
 		}
 		control->first_frag_seen = 1;
-		control->top_fsn = control->fsn_included = chk->rec.data.fsn;
+		control->fsn_included = chk->rec.data.fsn;
+		control->top_fsn = chk->rec.data.fsn;
 		control->sinfo_tsn = chk->rec.data.tsn;
 		control->sinfo_ppid = chk->rec.data.ppid;
 		control->data = chk->data;
@@ -1236,6 +1238,8 @@ sctp_add_chk_to_control(struct sctp_queu
 	chk->data = NULL;
 	if (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) {
 		control->first_frag_seen = 1;
+		control->sinfo_tsn = chk->rec.data.tsn;
+		control->sinfo_ppid = chk->rec.data.ppid;
 	}
 	if (chk->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG) {
 		/* Its complete */
@@ -1347,6 +1351,8 @@ sctp_queue_data_for_reasm(struct sctp_tc
 			return;
 		}
 		control->first_frag_seen = 1;
+		control->sinfo_ppid = chk->rec.data.ppid;
+		control->sinfo_tsn = chk->rec.data.tsn;
 		control->fsn_included = chk->rec.data.fsn;
 		control->data = chk->data;
 		sctp_mark_non_revokable(asoc, chk->rec.data.tsn);
@@ -1560,12 +1566,10 @@ static int
 sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc,
     struct mbuf **m, int offset, int chk_length,
     struct sctp_nets *net, uint32_t * high_tsn, int *abort_flag,
-    int *break_flag, int last_chunk, uint8_t chtype)
+    int *break_flag, int last_chunk, uint8_t chk_type)
 {
 	/* Process a data chunk */
 	/* struct sctp_tmit_chunk *chk; */
-	struct sctp_data_chunk *ch;
-	struct sctp_idata_chunk *nch, chunk_buf;
 	struct sctp_tmit_chunk *chk;
 	uint32_t tsn, fsn, gap, mid;
 	struct mbuf *dmbuf;
@@ -1576,58 +1580,64 @@ sctp_process_a_data_chunk(struct sctp_tc
 	char msg[SCTP_DIAG_INFO_LEN];
 	struct sctp_queued_to_read *control = NULL;
 	uint32_t ppid;
-	uint8_t chunk_flags;
+	uint8_t chk_flags;
 	struct sctp_stream_reset_list *liste;
 	struct sctp_stream_in *strm;
 	int ordered;
 	size_t clen;
 	int created_control = 0;
 
-	chk = NULL;
-	if (chtype == SCTP_IDATA) {
-		nch = (struct sctp_idata_chunk *)sctp_m_getptr(*m, offset,
+	if (chk_type == SCTP_IDATA) {
+		struct sctp_idata_chunk *chunk, chunk_buf;
+
+		chunk = (struct sctp_idata_chunk *)sctp_m_getptr(*m, offset,
 		    sizeof(struct sctp_idata_chunk), (uint8_t *) & chunk_buf);
-		ch = (struct sctp_data_chunk *)nch;
+		chk_flags = chunk->ch.chunk_flags;
 		clen = sizeof(struct sctp_idata_chunk);
-		tsn = ntohl(ch->dp.tsn);
-		mid = ntohl(nch->dp.mid);
-		ppid = nch->dp.ppid_fsn.ppid;
-		if (ch->ch.chunk_flags & SCTP_DATA_FIRST_FRAG)
+		tsn = ntohl(chunk->dp.tsn);
+		sid = ntohs(chunk->dp.sid);
+		mid = ntohl(chunk->dp.mid);
+		if (chk_flags & SCTP_DATA_FIRST_FRAG) {
 			fsn = 0;
-		else
-			fsn = ntohl(nch->dp.ppid_fsn.fsn);
+			ppid = chunk->dp.ppid_fsn.ppid;
+		} else {
+			fsn = ntohl(chunk->dp.ppid_fsn.fsn);
+			ppid = 0xffffffff;	/* Use as an invalid value. */
+		}
 	} else {
-		ch = (struct sctp_data_chunk *)sctp_m_getptr(*m, offset,
+		struct sctp_data_chunk *chunk, chunk_buf;
+
+		chunk = (struct sctp_data_chunk *)sctp_m_getptr(*m, offset,
 		    sizeof(struct sctp_data_chunk), (uint8_t *) & chunk_buf);
-		tsn = ntohl(ch->dp.tsn);
-		ppid = ch->dp.ppid;
+		chk_flags = chunk->ch.chunk_flags;
 		clen = sizeof(struct sctp_data_chunk);
+		tsn = ntohl(chunk->dp.tsn);
+		sid = ntohs(chunk->dp.sid);
+		mid = (uint32_t) (ntohs(chunk->dp.ssn));
 		fsn = tsn;
-		mid = (uint32_t) (ntohs(ch->dp.ssn));
-		nch = NULL;
+		ppid = chunk->dp.ppid;
 	}
-	chunk_flags = ch->ch.chunk_flags;
 	if ((size_t)chk_length == clen) {
 		/*
 		 * Need to send an abort since we had a empty data chunk.
 		 */
-		op_err = sctp_generate_no_user_data_cause(ch->dp.tsn);
+		op_err = sctp_generate_no_user_data_cause(tsn);
 		stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_14;
 		sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
 		*abort_flag = 1;
 		return (0);
 	}
-	if ((chunk_flags & SCTP_DATA_SACK_IMMEDIATELY) == SCTP_DATA_SACK_IMMEDIATELY) {
+	if ((chk_flags & SCTP_DATA_SACK_IMMEDIATELY) == SCTP_DATA_SACK_IMMEDIATELY) {
 		asoc->send_sack = 1;
 	}
-	ordered = ((chunk_flags & SCTP_DATA_UNORDERED) == 0);
+	ordered = ((chk_flags & SCTP_DATA_UNORDERED) == 0);
 	if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
 		sctp_log_map(tsn, asoc->cumulative_tsn, asoc->highest_tsn_inside_map, SCTP_MAP_TSN_ENTERS);
 	}
 	if (stcb == NULL) {
 		return (0);
 	}
-	SCTP_LTRACE_CHK(stcb->sctp_ep, stcb, ch->ch.chunk_type, tsn);
+	SCTP_LTRACE_CHK(stcb->sctp_ep, stcb, chk_type, tsn);
 	if (SCTP_TSN_GE(asoc->cumulative_tsn, tsn)) {
 		/* It is a duplicate */
 		SCTP_STAT_INCR(sctps_recvdupdata);
@@ -1690,8 +1700,6 @@ sctp_process_a_data_chunk(struct sctp_tc
 	 */
 
 	/* Is the stream valid? */
-	sid = ntohs(ch->dp.sid);
-
 	if (sid >= asoc->streamincnt) {
 		struct sctp_error_invalid_stream *cause;
 
@@ -1709,7 +1717,7 @@ sctp_process_a_data_chunk(struct sctp_tc
 			SCTP_BUF_LEN(op_err) = sizeof(struct sctp_error_invalid_stream);
 			cause->cause.code = htons(SCTP_CAUSE_INVALID_STREAM);
 			cause->cause.length = htons(sizeof(struct sctp_error_invalid_stream));
-			cause->stream_id = ch->dp.sid;
+			cause->stream_id = htons(sid);
 			cause->reserved = htons(0);
 			sctp_queue_op_err(stcb, op_err);
 		}
@@ -1730,8 +1738,8 @@ sctp_process_a_data_chunk(struct sctp_tc
 	 * If its a fragmented message, lets see if we can find the control
 	 * on the reassembly queues.
 	 */
-	if ((chtype == SCTP_IDATA) &&
-	    ((chunk_flags & SCTP_DATA_FIRST_FRAG) == 0) &&
+	if ((chk_type == SCTP_IDATA) &&
+	    ((chk_flags & SCTP_DATA_FIRST_FRAG) == 0) &&
 	    (fsn == 0)) {
 		/*
 		 * The first *must* be fsn 0, and other (middle/end) pieces
@@ -1739,13 +1747,13 @@ sctp_process_a_data_chunk(struct sctp_tc
 		 * wrap around. Ignore is for now.
 		 */
 		snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x",
-		    mid, chunk_flags);
+		    mid, chk_flags);
 		goto err_out;
 	}
 	control = sctp_find_reasm_entry(strm, mid, ordered, asoc->idata_supported);
 	SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for control on queues %p\n",
-	    chunk_flags, control);
-	if ((chunk_flags & SCTP_DATA_NOT_FRAG) != SCTP_DATA_NOT_FRAG) {
+	    chk_flags, control);
+	if ((chk_flags & SCTP_DATA_NOT_FRAG) != SCTP_DATA_NOT_FRAG) {
 		/* See if we can find the re-assembly entity */
 		if (control != NULL) {
 			/* We found something, does it belong? */
@@ -1782,7 +1790,7 @@ sctp_process_a_data_chunk(struct sctp_tc
 		if (control != NULL) {
 			if (ordered || asoc->idata_supported) {
 				SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on MID: %u\n",
-				    chunk_flags, mid);
+				    chk_flags, mid);
 				snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid);
 				goto err_out;
 			} else {
@@ -1828,7 +1836,7 @@ sctp_process_a_data_chunk(struct sctp_tc
 #endif
 		}
 		/* now is it in the mapping array of what we have accepted? */
-		if (nch == NULL) {
+		if (chk_type == SCTP_DATA) {
 			if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_map) &&
 			    SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) {
 				/* Nope not in the valid range dump it */
@@ -1876,9 +1884,9 @@ sctp_process_a_data_chunk(struct sctp_tc
 	 * way our stream sequence numbers could have wrapped. We of course
 	 * only validate the FIRST fragment so the bit must be set.
 	 */
-	if ((chunk_flags & SCTP_DATA_FIRST_FRAG) &&
+	if ((chk_flags & SCTP_DATA_FIRST_FRAG) &&
 	    (TAILQ_EMPTY(&asoc->resetHead)) &&
-	    (chunk_flags & SCTP_DATA_UNORDERED) == 0 &&
+	    (chk_flags & SCTP_DATA_UNORDERED) == 0 &&
 	    SCTP_MID_GE(asoc->idata_supported, asoc->strmin[sid].last_mid_delivered, mid)) {
 		/* The incoming sseq is behind where we last delivered? */
 		SCTPDBG(SCTP_DEBUG_INDATA1, "EVIL/Broken-Dup S-SEQ: %u delivered: %u from peer, Abort!\n",
@@ -1903,17 +1911,13 @@ sctp_process_a_data_chunk(struct sctp_tc
 		*abort_flag = 1;
 		return (0);
 	}
-	/************************************
-	 * From here down we may find ch-> invalid
-	 * so its a good idea NOT to use it.
-	 *************************************/
-	if (nch) {
+	if (chk_type == SCTP_IDATA) {
 		the_len = (chk_length - sizeof(struct sctp_idata_chunk));
 	} else {
 		the_len = (chk_length - sizeof(struct sctp_data_chunk));
 	}
 	if (last_chunk == 0) {
-		if (nch) {
+		if (chk_type == SCTP_IDATA) {
 			dmbuf = SCTP_M_COPYM(*m,
 			    (offset + sizeof(struct sctp_idata_chunk)),
 			    the_len, M_NOWAIT);
@@ -1933,7 +1937,7 @@ sctp_process_a_data_chunk(struct sctp_tc
 
 		dmbuf = *m;
 		/* lop off the top part */
-		if (nch) {
+		if (chk_type == SCTP_IDATA) {
 			m_adj(dmbuf, (offset + sizeof(struct sctp_idata_chunk)));
 		} else {
 			m_adj(dmbuf, (offset + sizeof(struct sctp_data_chunk)));
@@ -1962,7 +1966,7 @@ sctp_process_a_data_chunk(struct sctp_tc
 		return (0);
 	}
 	/*
-	 * Now no matter what we need a control, get one if we don't have
+	 * Now no matter what, we need a control, get one if we don't have
 	 * one (we may have gotten it above when we found the message was
 	 * fragmented
 	 */
@@ -1971,23 +1975,26 @@ sctp_process_a_data_chunk(struct sctp_tc
 		sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn,
 		    ppid,
 		    sid,
-		    chunk_flags,
+		    chk_flags,
 		    NULL, fsn, mid);
 		if (control == NULL) {
 			SCTP_STAT_INCR(sctps_nomem);
 			return (0);
 		}
-		if ((chunk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
+		if ((chk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
 			control->data = dmbuf;
 			control->tail_mbuf = NULL;
-			control->end_added = control->last_frag_seen = control->first_frag_seen = 1;
-			control->top_fsn = control->fsn_included = fsn;
+			control->end_added = 1;
+			control->last_frag_seen = 1;
+			control->first_frag_seen = 1;
+			control->fsn_included = fsn;
+			control->top_fsn = fsn;
 		}
 		created_control = 1;
 	}
 	SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x ordered: %d MID: %u control: %p\n",
-	    chunk_flags, ordered, mid, control);
-	if ((chunk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG &&
+	    chk_flags, ordered, mid, control);
+	if ((chk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG &&
 	    TAILQ_EMPTY(&asoc->resetHead) &&
 	    ((ordered == 0) ||
 	    (SCTP_MID_EQ(asoc->idata_supported, asoc->strmin[sid].last_mid_delivered + 1, mid) &&
@@ -2011,7 +2018,7 @@ sctp_process_a_data_chunk(struct sctp_tc
 		    control, &stcb->sctp_socket->so_rcv,
 		    1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED);
 
-		if ((chunk_flags & SCTP_DATA_UNORDERED) == 0) {
+		if ((chk_flags & SCTP_DATA_UNORDERED) == 0) {
 			/* for ordered, bump what we delivered */
 			strm->last_mid_delivered++;
 		}
@@ -2024,7 +2031,7 @@ sctp_process_a_data_chunk(struct sctp_tc
 		goto finish_express_del;
 	}
 	/* Now will we need a chunk too? */
-	if ((chunk_flags & SCTP_DATA_NOT_FRAG) != SCTP_DATA_NOT_FRAG) {
+	if ((chk_flags & SCTP_DATA_NOT_FRAG) != SCTP_DATA_NOT_FRAG) {
 		sctp_alloc_a_chunk(stcb, chk);
 		if (chk == NULL) {
 			/* No memory so we drop the chunk */
@@ -2043,7 +2050,7 @@ sctp_process_a_data_chunk(struct sctp_tc
 		chk->rec.data.ppid = ppid;
 		chk->rec.data.context = stcb->asoc.context;
 		chk->rec.data.doing_fast_retransmit = 0;
-		chk->rec.data.rcv_flags = chunk_flags;
+		chk->rec.data.rcv_flags = chk_flags;
 		chk->asoc = asoc;
 		chk->send_size = the_len;
 		chk->whoTo = net;
@@ -2066,7 +2073,7 @@ sctp_process_a_data_chunk(struct sctp_tc
 		}
 	}
 	/* Now is it complete (i.e. not fragmented)? */
-	if ((chunk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
+	if ((chk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
 		/*
 		 * Special check for when streams are resetting. We could be
 		 * more smart about this and check the actual stream to see
@@ -2110,7 +2117,7 @@ sctp_process_a_data_chunk(struct sctp_tc
 			}
 			goto finish_express_del;
 		}
-		if (chunk_flags & SCTP_DATA_UNORDERED) {
+		if (chk_flags & SCTP_DATA_UNORDERED) {
 			/* queue directly into socket buffer */
 			SCTPDBG(SCTP_DEBUG_XXX, "Unordered data to be read control: %p MID: %u\n",
 			    control, mid);

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c	Sun Dec 11 08:14:42 2016	(r309850)
+++ head/sys/netinet/sctputil.c	Sun Dec 11 13:26:35 2016	(r309851)
@@ -4639,7 +4639,7 @@ sctp_generate_no_user_data_cause(uint32_
 		no_user_data_cause = mtod(m, struct sctp_error_no_user_data *);
 		no_user_data_cause->cause.code = htons(SCTP_CAUSE_NO_USER_DATA);
 		no_user_data_cause->cause.length = htons(len);
-		no_user_data_cause->tsn = tsn;	/* tsn is passed in as NBO */
+		no_user_data_cause->tsn = htonl(tsn);
 	}
 	return (m);
 }

From owner-svn-src-all@freebsd.org  Sun Dec 11 17:01:53 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 818B8C72693;
 Sun, 11 Dec 2016 17:01:53 +0000 (UTC)
 (envelope-from chmeeedalf@gmail.com)
Received: from mail-io0-x241.google.com (mail-io0-x241.google.com
 [IPv6:2607:f8b0:4001:c06::241])
 (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 49C1078B;
 Sun, 11 Dec 2016 17:01:53 +0000 (UTC)
 (envelope-from chmeeedalf@gmail.com)
Received: by mail-io0-x241.google.com with SMTP id f73so16953062ioe.2;
 Sun, 11 Dec 2016 09:01:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=8/rXCfdIG1CRTOAxEr6IHl/GkbvvREoUZ4tqMhpwRsM=;
 b=x/VvSeux/RTT+ay5Pw790BXmIDCkss3ZqTIij+umb+cQM1kNCcTrwepNhjSW+shqHQ
 0cBF/fuVIQmNza0gSRTfrQ3SksrG9Ly/NyAU3KFxY5pudnYTgpK17b7Hs1kc9xEpghEJ
 aTC6duLG90FHNlUub4e1notGwBbAHAIgAsz9q1w3/c5CsT97d0ZDR9FNHWwZ24XGX3aV
 z1UXENWNghX14ngY6KwmjGnxT9W2uY0jc2XePvlwB55+rY7e5oq3eMB3MdZ4T6Zo+5nB
 BVqWmg9tmwQX2AHhosVvVZmCIkYoKpxOMrmDF56u/tc3/tBF6HA+2I0TaDE6KkGEB0on
 ynPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=8/rXCfdIG1CRTOAxEr6IHl/GkbvvREoUZ4tqMhpwRsM=;
 b=l8ARrFclse8mJ1vBINtge+uJ0Ciur2pF7SEXbqzC4Mept+M4W8cnvV0QS2Prlsb0Qx
 bhuUpZnDQ5OxC1TptZ2qJTio9pZVxcagfjeuHlxbhOdD/qcZYUi7yYyl9I9jeCKYrzCV
 1mfMhz0mkOfC1eptU/vQWoqxClggyvR9q70z6nFHz5ajgkgRW1TFdm+hiQZBJx/pCno/
 ZvslgoAiN0G0ZzWS7EF4sbii0VkUE+JRUbaaFjnjFeAZs/QqVBew3dCDXUk1i6goOqvl
 vYK+p0DmY1WHSaWtT0pbliU5AS7tGXZa4cazPvWe+9Ici74RYBxLkesOUdegyUm8uqTu
 d2hQ==
X-Gm-Message-State: AKaTC00ie9dPa33irQ7K6EeEFLJ0TSzOvljPeXackBUN7Pf28rCQ8KpbUPECCGhtlyL7aQ==
X-Received: by 10.36.101.5 with SMTP id u5mr14973406itb.45.1481475712355;
 Sun, 11 Dec 2016 09:01:52 -0800 (PST)
Received: from zhabar.knownspace (50-80-150-234.client.mchsi.com.
 [50.80.150.234])
 by smtp.gmail.com with ESMTPSA id k205sm5060003ita.15.2016.12.11.09.01.51
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Sun, 11 Dec 2016 09:01:52 -0800 (PST)
Date: Sun, 11 Dec 2016 11:01:47 -0600
From: Justin Hibbits <chmeeedalf@gmail.com>
To: Konrad Witaszczyk <def@FreeBSD.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r309818 - in head: etc/defaults etc/rc.d sbin
 sbin/decryptcore sbin/dumpon sbin/savecore share/man/man5 sys/amd64/amd64
 sys/arm/arm sys/arm64/arm64 sys/conf sys/ddb sys/dev/null sys/geo...
Message-ID: <20161211110147.796ab13c@zhabar.knownspace>
In-Reply-To: <56f24e51-140c-5e30-08df-9ffa0bdf73bb@FreeBSD.org>
References: <201612101620.uBAGKdUg033773@repo.freebsd.org>
 <043C7408-A0FA-4316-B24B-3A181146FE20@gmail.com>
 <56f24e51-140c-5e30-08df-9ffa0bdf73bb@FreeBSD.org>
X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; powerpc64-portbld-freebsd12.0)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 17:01:53 -0000

On Sat, 10 Dec 2016 21:53:43 +0100
Konrad Witaszczyk <def@FreeBSD.org> wrote:

> On 12/10/2016 20:20, Justin Hibbits wrote:
> > On Dec 10, 2016, at 10:20 AM, Konrad Witaszczyk wrote:  
> >> Author: def
> >> Date: Sat Dec 10 16:20:39 2016
> >> New Revision: 309818
> >> URL: https://svnweb.freebsd.org/changeset/base/309818
> >>
> >> Log:
> >>  Add support for encrypted kernel crash dumps.
> >>
> >>  Changes include modifications in kernel crash dump routines,
> >> dumpon(8) and savecore(8). A new tool called decryptcore(8) was
> >> added.
> >>
> >>  A new DIOCSKERNELDUMP I/O control was added to send a kernel
> >> crash dump configuration in the diocskerneldump_arg structure to
> >> the kernel. The old DIOCSKERNELDUMP I/O control was renamed to
> >> DIOCSKERNELDUMP_FREEBSD11 for
> >>  backward ABI compatibility.
> >>
> >>  dumpon(8) generates an one-time random symmetric key and encrypts
> >> it using an RSA public key in capability mode. Currently only
> >> AES-256-CBC is supported but EKCD was designed to implement
> >> support for other algorithms in the future. The public key is
> >> chosen using the -k flag. The dumpon rc(8) script can do this
> >> automatically during startup using the dumppubkey rc.conf(5)
> >> variable.  Once the keys are calculated dumpon sends them to the
> >> kernel via DIOCSKERNELDUMP I/O control.
> >>
> >>  When the kernel receives the DIOCSKERNELDUMP I/O control it
> >> generates a random IV and sets up the key schedule for the
> >> specified algorithm. Each time the kernel tries to write a crash
> >> dump to the dump device, the IV is replaced by a SHA-256 hash of
> >> the previous value. This is intended to make a possible
> >> differential cryptanalysis harder since it is possible to write
> >> multiple crash dumps without reboot by repeating the following
> >> commands: # sysctl debug.kdb.enter=1  
> >>  db> call doadump(0)
> >>  db> continue  
> >>  # savecore
> >>
> >>  A kernel dump key consists of an algorithm identifier, an IV and
> >> an encrypted symmetric key. The kernel dump key size is included
> >> in a kernel dump header. The size is an unsigned 32-bit integer
> >> and it is aligned to a block size. The header structure has 512
> >> bytes to match the block size so it was required to
> >>  make a panic string 4 bytes shorter to add a new field to the
> >> header structure. If the kernel dump key size in the header is
> >> nonzero it is assumed that the kernel dump key is placed after the
> >> first header on the dump device and the core
> >>  dump is encrypted.
> >>
> >>  Separate functions were implemented to write the kernel dump
> >> header and the kernel dump key as they need to be unencrypted. The
> >> dump_write function encrypts
> >>  data if the kernel was compiled with the EKCD option. Encrypted
> >> kernel textdumps
> >>  are not supported due to the way they are constructed which makes
> >> it impossible to use the CBC mode for encryption. It should be
> >> also noted that textdumps don't
> >>  contain sensitive data by design as a user decides what
> >> information should be dumped.
> >>
> >>  savecore(8) writes the kernel dump key to a key.# file if its
> >> size in the header
> >>  is nonzero. # is the number of the current core dump.
> >>
> >>  decryptcore(8) decrypts the core dump using a private RSA key and
> >> the kernel dump key. This is performed by a child process in
> >> capability mode. If the decryption was not successful the parent
> >> process removes a partially decrypted core dump.
> >>
> >>  Description on how to encrypt crash dumps was added to the
> >> decryptcore(8), dumpon(8), rc.conf(5) and savecore(8) manual pages.
> >>
> >>  EKCD was tested on amd64 using bhyve and i386, mipsel and sparc64
> >> using QEMU. The feature still has to be tested on arm and arm64 as
> >> it wasn't possible to run
> >>  FreeBSD due to the problems with QEMU emulation and lack of
> >> hardware.
> >>
> >>  Designed by:    def, pjd
> >>  Reviewed by:    cem, oshogbo, pjd
> >>  Partial review:    delphij, emaste, jhb, kib
> >>  Approved by:    pjd (mentor)
> >>  Differential Revision:    https://reviews.freebsd.org/D4712
> >>
> >> Added:
> >>  head/sbin/decryptcore/
> >>  head/sbin/decryptcore/Makefile   (contents, props changed)
> >>  head/sbin/decryptcore/decryptcore.8   (contents, props changed)
> >>  head/sbin/decryptcore/decryptcore.c   (contents, props changed)
> >> Modified:
> >>  head/etc/defaults/rc.conf
> >>  head/etc/rc.d/dumpon
> >>  head/sbin/Makefile
> >>  head/sbin/dumpon/Makefile
> >>  head/sbin/dumpon/dumpon.8
> >>  head/sbin/dumpon/dumpon.c
> >>  head/sbin/savecore/savecore.8
> >>  head/sbin/savecore/savecore.c
> >>  head/share/man/man5/rc.conf.5
> >>  head/sys/amd64/amd64/minidump_machdep.c
> >>  head/sys/arm/arm/minidump_machdep.c
> >>  head/sys/arm64/arm64/minidump_machdep.c
> >>  head/sys/conf/NOTES
> >>  head/sys/conf/files
> >>  head/sys/conf/options
> >>  head/sys/ddb/db_textdump.c
> >>  head/sys/dev/null/null.c
> >>  head/sys/geom/geom_dev.c
> >>  head/sys/i386/i386/minidump_machdep.c
> >>  head/sys/kern/kern_dump.c
> >>  head/sys/kern/kern_shutdown.c
> >>  head/sys/mips/mips/minidump_machdep.c
> >>  head/sys/sparc64/sparc64/dump_machdep.c
> >>  head/sys/sys/conf.h
> >>  head/sys/sys/disk.h
> >>  head/sys/sys/kerneldump.h  
> >
> > Nice!  Any reason you left out PowerPC from this list though?  
> 
> The architectures that I listed implement separate minidump functions
> in their MD code. I had to change them to implement EKCD. ppc and
> pc98 are not the case and we don't have minidumps in riscv yet. It
> means that EKCD should also work on ppc.
> Of course all architectures supported by FreeBSD should be verified.
> However it is mandatory to test all changes in MD code.
> 

Ah, thanks for the explanation.  I hadn't read through the diff, only
saw sys/powerpc wasn't on there, but from your explanation it's already
handled implicitly by the generic full dump change.

Thanks!

- Justin

From owner-svn-src-all@freebsd.org  Sun Dec 11 17:15:26 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8876CC72C61;
 Sun, 11 Dec 2016 17:15:26 +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 62FB411EE;
 Sun, 11 Dec 2016 17:15:26 +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 uBBHFP9G045140;
 Sun, 11 Dec 2016 17:15:25 GMT (envelope-from avos@FreeBSD.org)
Received: (from avos@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBBHFPYD045138;
 Sun, 11 Dec 2016 17:15:25 GMT (envelope-from avos@FreeBSD.org)
Message-Id: <201612111715.uBBHFPYD045138@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avos set sender to
 avos@FreeBSD.org using -f
From: Andriy Voskoboinyk <avos@FreeBSD.org>
Date: Sun, 11 Dec 2016 17:15:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309852 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 17:15:26 -0000

Author: avos
Date: Sun Dec 11 17:15:25 2016
New Revision: 309852
URL: https://svnweb.freebsd.org/changeset/base/309852

Log:
  rsu: fix and enable Rx TCP checksum offloading.
  
  Tested with Asus USB-N10, STA mode.

Modified:
  head/sys/dev/usb/wlan/if_rsu.c
  head/sys/dev/usb/wlan/if_rsureg.h

Modified: head/sys/dev/usb/wlan/if_rsu.c
==============================================================================
--- head/sys/dev/usb/wlan/if_rsu.c	Sun Dec 11 13:26:35 2016	(r309851)
+++ head/sys/dev/usb/wlan/if_rsu.c	Sun Dec 11 17:15:25 2016	(r309852)
@@ -255,6 +255,7 @@ static int	rsu_tx_start(struct rsu_softc
 static int	rsu_transmit(struct ieee80211com *, struct mbuf *);
 static void	rsu_start(struct rsu_softc *);
 static void	_rsu_start(struct rsu_softc *);
+static int	rsu_ioctl_net(struct ieee80211com *, u_long, void *);
 static void	rsu_parent(struct ieee80211com *);
 static void	rsu_stop(struct rsu_softc *);
 static void	rsu_ms_delay(struct rsu_softc *, int);
@@ -444,6 +445,7 @@ rsu_attach(device_t self)
 	device_set_usb_desc(self);
 	sc->sc_udev = uaa->device;
 	sc->sc_dev = self;
+	sc->sc_rx_checksum_enable = 1;
 	if (rsu_enable_11n)
 		sc->sc_ht = !! (USB_GET_DRIVER_INFO(uaa) & RSU_HT_SUPPORTED);
 
@@ -590,6 +592,7 @@ rsu_attach(device_t self)
 	ic->ic_vap_delete = rsu_vap_delete;
 	ic->ic_update_promisc = rsu_update_promisc;
 	ic->ic_update_mcast = rsu_update_mcast;
+	ic->ic_ioctl = rsu_ioctl_net;
 	ic->ic_parent = rsu_parent;
 	ic->ic_transmit = rsu_transmit;
 	ic->ic_send_mgmt = rsu_send_mgmt;
@@ -676,8 +679,10 @@ rsu_vap_create(struct ieee80211com *ic, 
     const uint8_t bssid[IEEE80211_ADDR_LEN],
     const uint8_t mac[IEEE80211_ADDR_LEN])
 {
+	struct rsu_softc *sc = ic->ic_softc;
 	struct rsu_vap *uvp;
 	struct ieee80211vap *vap;
+	struct ifnet *ifp;
 
 	if (!TAILQ_EMPTY(&ic->ic_vaps))         /* only one at a time */
 		return (NULL);
@@ -692,6 +697,13 @@ rsu_vap_create(struct ieee80211com *ic, 
 		return (NULL);
 	}
 
+	ifp = vap->iv_ifp;
+	ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6;
+	RSU_LOCK(sc);
+	if (sc->sc_rx_checksum_enable)
+		ifp->if_capenable |= IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6;
+	RSU_UNLOCK(sc);
+
 	/* override state transition machine */
 	uvp->newstate = vap->iv_newstate;
 	if (opmode == IEEE80211_M_MONITOR)
@@ -2396,9 +2408,37 @@ rsu_rx_frame(struct rsu_softc *sc, struc
 	};
 
 	/* Hardware does Rx TCP checksum offload. */
+	/*
+	 * This flag can be set for some other
+	 * (e.g., EAPOL) frame types, so don't rely on it.
+	 */
 	if (rxdw3 & R92S_RXDW3_TCPCHKVALID) {
-		if (__predict_true(rxdw3 & R92S_RXDW3_TCPCHKRPT))
+		RSU_DPRINTF(sc, RSU_DEBUG_RX,
+		    "%s: TCP/IP checksums: %schecked / %schecked\n",
+		    __func__,
+		    (rxdw3 & R92S_RXDW3_TCPCHKRPT) ? "" : "not ",
+		    (rxdw3 & R92S_RXDW3_IPCHKRPT) ? "" : "not ");
+
+		/*
+		 * 'IP header checksum valid' bit will not be set if
+		 * the frame was not checked / has incorrect checksum /
+		 * does not have checksum (IPv6).
+		 *
+		 * NB: if DF bit is not set then frame will not be checked.
+		 */
+		if (rxdw3 & R92S_RXDW3_IPCHKRPT) {
+			m->m_pkthdr.csum_flags = CSUM_IP_CHECKED;
+			m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
+		}
+
+		/*
+		 * This is independent of the above check.
+		 */
+		if (rxdw3 & R92S_RXDW3_TCPCHKRPT) {
 			m->m_pkthdr.csum_flags |= CSUM_DATA_VALID;
+			m->m_pkthdr.csum_flags |= CSUM_PSEUDO_HDR;
+			m->m_pkthdr.csum_data = 0xffff;
+		}
 	}
 
 	/* Drop descriptor. */
@@ -2915,6 +2955,59 @@ rsu_start(struct rsu_softc *sc)
 	taskqueue_enqueue(taskqueue_thread, &sc->tx_task);
 }
 
+static int
+rsu_ioctl_net(struct ieee80211com *ic, u_long cmd, void *data)
+{
+	struct rsu_softc *sc = ic->ic_softc;
+	struct ifreq *ifr = (struct ifreq *)data;
+	int error;
+
+	error = 0;
+	switch (cmd) {
+	case SIOCSIFCAP:
+	{
+		struct ieee80211vap *vap;
+		int rxmask;
+
+		rxmask = ifr->ifr_reqcap & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6);
+
+		RSU_LOCK(sc);
+		/* Both RXCSUM bits must be set (or unset). */
+		if (sc->sc_rx_checksum_enable &&
+		    rxmask != (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) {
+			rxmask = 0;
+			sc->sc_rx_checksum_enable = 0;
+			rsu_rxfilter_set(sc, R92S_RCR_TCP_OFFLD_EN, 0);
+		} else if (!sc->sc_rx_checksum_enable && rxmask != 0) {
+			rxmask = IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6;
+			sc->sc_rx_checksum_enable = 1;
+			rsu_rxfilter_set(sc, 0, R92S_RCR_TCP_OFFLD_EN);
+		} else {
+			/* Nothing to do. */
+			RSU_UNLOCK(sc);
+			break;
+		}
+		RSU_UNLOCK(sc);
+
+		IEEE80211_LOCK(ic);	/* XXX */
+		TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
+			struct ifnet *ifp = vap->iv_ifp;
+
+			ifp->if_capenable &=
+			    ~(IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6);
+			ifp->if_capenable |= rxmask;
+		}
+		IEEE80211_UNLOCK(ic);
+		break;
+	}
+	default:
+		error = ENOTTY;		/* for net80211 */
+		break;
+	}
+
+	return (error);
+}
+
 static void
 rsu_parent(struct ieee80211com *ic)
 {
@@ -3434,6 +3527,8 @@ rsu_rxfilter_init(struct rsu_softc *sc)
 	reg = rsu_read_4(sc, R92S_RCR);
 	reg &= ~R92S_RCR_AICV;
 	reg |= R92S_RCR_APP_PHYSTS;
+	if (sc->sc_rx_checksum_enable)
+		reg |= R92S_RCR_TCP_OFFLD_EN;
 	rsu_write_4(sc, R92S_RCR, reg);
 
 	/* Update dynamic Rx filter parts. */
@@ -3512,10 +3607,6 @@ rsu_init(struct rsu_softc *sc)
 	if (error != 0)
 		goto fail;
 
-	/* Enable Rx TCP checksum offload. */
-	rsu_write_4(sc, R92S_RCR,
-	    rsu_read_4(sc, R92S_RCR) | 0x04000000);
-
 	rsu_write_4(sc, R92S_CR,
 	    rsu_read_4(sc, R92S_CR) & ~0xff000000);
 

Modified: head/sys/dev/usb/wlan/if_rsureg.h
==============================================================================
--- head/sys/dev/usb/wlan/if_rsureg.h	Sun Dec 11 13:26:35 2016	(r309851)
+++ head/sys/dev/usb/wlan/if_rsureg.h	Sun Dec 11 17:15:25 2016	(r309852)
@@ -164,6 +164,7 @@
 #define R92S_RCR_APWRMGT	0x00400000
 #define R92S_RCR_CBSSID		0x00800000
 #define R92S_RCR_APP_PHYSTS	0x02000000
+#define R92S_RCR_TCP_OFFLD_EN	0x04000000
 #define R92S_RCR_ENMBID		0x08000000
 
 /* Bits for R92S_RXFLTMAP*. */
@@ -853,6 +854,7 @@ struct rsu_softc {
 
 	u_int				sc_running:1,
 					sc_vap_is_running:1,
+					sc_rx_checksum_enable:1,
 					sc_calibrating:1,
 					sc_active_scan:1,
 					sc_extra_scan:1;

From owner-svn-src-all@freebsd.org  Sun Dec 11 18:42:18 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A2CDC729F0;
 Sun, 11 Dec 2016 18:42:18 +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 4F2761301;
 Sun, 11 Dec 2016 18:42:18 +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 uBBIgHBh081811;
 Sun, 11 Dec 2016 18:42:17 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBBIgHw1081810;
 Sun, 11 Dec 2016 18:42:17 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612111842.uBBIgHw1081810@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Sun, 11 Dec 2016 18:42:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309853 - stable/11/sys/kern
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 18:42:18 -0000

Author: kib
Date: Sun Dec 11 18:42:17 2016
New Revision: 309853
URL: https://svnweb.freebsd.org/changeset/base/309853

Log:
  MFC r309539:
  Restructure the code to handle reporting of non-exited processes from
  wait(2).

Modified:
  stable/11/sys/kern/kern_exit.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_exit.c
==============================================================================
--- stable/11/sys/kern/kern_exit.c	Sun Dec 11 17:15:25 2016	(r309852)
+++ stable/11/sys/kern/kern_exit.c	Sun Dec 11 18:42:17 2016	(r309853)
@@ -1106,6 +1106,38 @@ kern_wait(struct thread *td, pid_t pid, 
 	return (ret);
 }
 
+static void
+report_alive_proc(struct thread *td, struct proc *p, siginfo_t *siginfo,
+    int *status, int options, int si_code)
+{
+	bool cont;
+
+	PROC_LOCK_ASSERT(p, MA_OWNED);
+	sx_assert(&proctree_lock, SA_XLOCKED);
+	MPASS(si_code == CLD_TRAPPED || si_code == CLD_STOPPED ||
+	    si_code == CLD_CONTINUED);
+
+	cont = si_code == CLD_CONTINUED;
+	if ((options & WNOWAIT) == 0) {
+		if (cont)
+			p->p_flag &= ~P_CONTINUED;
+		else
+			p->p_flag |= P_WAITED;
+		PROC_LOCK(td->td_proc);
+		sigqueue_take(p->p_ksi);
+		PROC_UNLOCK(td->td_proc);
+	}
+	sx_xunlock(&proctree_lock);
+	if (siginfo != NULL) {
+		siginfo->si_code = si_code;
+		siginfo->si_status = cont ? SIGCONT : p->p_xsig;
+	}
+	if (status != NULL)
+		*status = cont ? SIGCONT : W_STOPCODE(p->p_xsig);
+	PROC_UNLOCK(p);
+	td->td_retval[0] = p->p_pid;
+}
+
 int
 kern_wait6(struct thread *td, idtype_t idtype, id_t id, int *status,
     int options, struct __wrusage *wrusage, siginfo_t *siginfo)
@@ -1163,82 +1195,41 @@ loop:
 		}
 
 		PROC_LOCK(p);
-		PROC_SLOCK(p);
+
+		if ((options & (WTRAPPED | WUNTRACED)) != 0)
+			PROC_SLOCK(p);
 
 		if ((options & WTRAPPED) != 0 &&
 		    (p->p_flag & P_TRACED) != 0 &&
 		    (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 &&
-		    (p->p_suspcount == p->p_numthreads) &&
-		    ((p->p_flag & P_WAITED) == 0)) {
+		    p->p_suspcount == p->p_numthreads &&
+		    (p->p_flag & P_WAITED) == 0) {
 			PROC_SUNLOCK(p);
-			if ((options & WNOWAIT) == 0)
-				p->p_flag |= P_WAITED;
-			sx_xunlock(&proctree_lock);
-
-			if (status != NULL)
-				*status = W_STOPCODE(p->p_xsig);
-			if (siginfo != NULL) {
-				siginfo->si_status = p->p_xsig;
-				siginfo->si_code = CLD_TRAPPED;
-			}
-			if ((options & WNOWAIT) == 0) {
-				PROC_LOCK(q);
-				sigqueue_take(p->p_ksi);
-				PROC_UNLOCK(q);
-			}
-
 			CTR4(KTR_PTRACE,
-	    "wait: returning trapped pid %d status %#x (xstat %d) xthread %d",
+			    "wait: returning trapped pid %d status %#x "
+			    "(xstat %d) xthread %d",
 			    p->p_pid, W_STOPCODE(p->p_xsig), p->p_xsig,
-			    p->p_xthread != NULL ? p->p_xthread->td_tid : -1);
-			PROC_UNLOCK(p);
-			td->td_retval[0] = pid;
+			    p->p_xthread != NULL ?
+			    p->p_xthread->td_tid : -1);
+			report_alive_proc(td, p, siginfo, status, options,
+			    CLD_TRAPPED);
 			return (0);
-		}
+			}
 		if ((options & WUNTRACED) != 0 &&
 		    (p->p_flag & P_STOPPED_SIG) != 0 &&
-		    (p->p_suspcount == p->p_numthreads) &&
-		    ((p->p_flag & P_WAITED) == 0)) {
+		    p->p_suspcount == p->p_numthreads &&
+		    (p->p_flag & P_WAITED) == 0) {
 			PROC_SUNLOCK(p);
-			if ((options & WNOWAIT) == 0)
-				p->p_flag |= P_WAITED;
-			sx_xunlock(&proctree_lock);
-
-			if (status != NULL)
-				*status = W_STOPCODE(p->p_xsig);
-			if (siginfo != NULL) {
-				siginfo->si_status = p->p_xsig;
-				siginfo->si_code = CLD_STOPPED;
-			}
-			if ((options & WNOWAIT) == 0) {
-				PROC_LOCK(q);
-				sigqueue_take(p->p_ksi);
-				PROC_UNLOCK(q);
-			}
-
-			PROC_UNLOCK(p);
-			td->td_retval[0] = pid;
+			report_alive_proc(td, p, siginfo, status, options,
+			    CLD_STOPPED);
 			return (0);
 		}
-		PROC_SUNLOCK(p);
+		if ((options & (WTRAPPED | WUNTRACED)) != 0)
+			PROC_SUNLOCK(p);
 		if ((options & WCONTINUED) != 0 &&
 		    (p->p_flag & P_CONTINUED) != 0) {
-			sx_xunlock(&proctree_lock);
-			if ((options & WNOWAIT) == 0) {
-				p->p_flag &= ~P_CONTINUED;
-				PROC_LOCK(q);
-				sigqueue_take(p->p_ksi);
-				PROC_UNLOCK(q);
-			}
-			PROC_UNLOCK(p);
-
-			if (status != NULL)
-				*status = SIGCONT;
-			if (siginfo != NULL) {
-				siginfo->si_status = SIGCONT;
-				siginfo->si_code = CLD_CONTINUED;
-			}
-			td->td_retval[0] = pid;
+			report_alive_proc(td, p, siginfo, status, options,
+			    CLD_CONTINUED);
 			return (0);
 		}
 		PROC_UNLOCK(p);

From owner-svn-src-all@freebsd.org  Sun Dec 11 19:01:28 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CF87C72EA9;
 Sun, 11 Dec 2016 19:01:28 +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 6C9DF1BDC;
 Sun, 11 Dec 2016 19:01:28 +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 uBBJ1RIn088810;
 Sun, 11 Dec 2016 19:01:27 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBBJ1R2F088808;
 Sun, 11 Dec 2016 19:01:27 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612111901.uBBJ1R2F088808@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Sun, 11 Dec 2016 19:01:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309854 - head/sys/x86/acpica
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 19:01:28 -0000

Author: kib
Date: Sun Dec 11 19:01:27 2016
New Revision: 309854
URL: https://svnweb.freebsd.org/changeset/base/309854

Log:
  Prefix hex memory addresses with 0x in diagnostic messages from the
  SRAT parser.
  
  Submitted by:	Oliver Pinter
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D8750

Modified:
  head/sys/x86/acpica/srat.c

Modified: head/sys/x86/acpica/srat.c
==============================================================================
--- head/sys/x86/acpica/srat.c	Sun Dec 11 18:42:17 2016	(r309853)
+++ head/sys/x86/acpica/srat.c	Sun Dec 11 19:01:27 2016	(r309854)
@@ -229,7 +229,7 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *e
 		mem = (ACPI_SRAT_MEM_AFFINITY *)entry;
 		if (bootverbose)
 			printf(
-		    "SRAT: Found memory domain %d addr %jx len %jx: %s\n",
+		    "SRAT: Found memory domain %d addr 0x%jx len 0x%jx: %s\n",
 			    mem->ProximityDomain, (uintmax_t)mem->BaseAddress,
 			    (uintmax_t)mem->Length,
 			    (mem->Flags & ACPI_SRAT_MEM_ENABLED) ?
@@ -238,7 +238,7 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *e
 			break;
 		if (!overlaps_phys_avail(mem->BaseAddress,
 		    mem->BaseAddress + mem->Length)) {
-			printf("SRAT: Ignoring memory at addr %jx\n",
+			printf("SRAT: Ignoring memory at addr 0x%jx\n",
 			    (uintmax_t)mem->BaseAddress);
 			break;
 		}
@@ -335,7 +335,7 @@ check_phys_avail(void)
 				address = mem_info[i].end + 1;
 		}
 	}
-	printf("SRAT: No memory region found for %jx - %jx\n",
+	printf("SRAT: No memory region found for 0x%jx - 0x%jx\n",
 	    (uintmax_t)phys_avail[j], (uintmax_t)phys_avail[j + 1]);
 	return (ENXIO);
 }

From owner-svn-src-all@freebsd.org  Sun Dec 11 19:24:42 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51835C7202A;
 Sun, 11 Dec 2016 19:24:42 +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 2137DFDB;
 Sun, 11 Dec 2016 19:24:42 +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 uBBJOfTG098565;
 Sun, 11 Dec 2016 19:24:41 GMT (envelope-from alc@FreeBSD.org)
Received: (from alc@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBBJOfC6098563;
 Sun, 11 Dec 2016 19:24:41 GMT (envelope-from alc@FreeBSD.org)
Message-Id: <201612111924.uBBJOfC6098563@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org
 using -f
From: Alan Cox <alc@FreeBSD.org>
Date: Sun, 11 Dec 2016 19:24:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309855 - in head/sys: fs/tmpfs kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 19:24:42 -0000

Author: alc
Date: Sun Dec 11 19:24:41 2016
New Revision: 309855
URL: https://svnweb.freebsd.org/changeset/base/309855

Log:
  When tmpfs and POSIX shm pagein a page for the sole purpose of performing
  truncation, immediately queue the page for asynchronous laundering rather
  than making the page pass through inactive queue first.
  
  Reviewed by:	kib, markj

Modified:
  head/sys/fs/tmpfs/tmpfs_subr.c
  head/sys/kern/uipc_shm.c

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_subr.c	Sun Dec 11 19:01:27 2016	(r309854)
+++ head/sys/fs/tmpfs/tmpfs_subr.c	Sun Dec 11 19:24:41 2016	(r309855)
@@ -1376,7 +1376,15 @@ retry:
 				    NULL);
 				vm_page_lock(m);
 				if (rv == VM_PAGER_OK) {
-					vm_page_deactivate(m);
+					/*
+					 * Since the page was not resident,
+					 * and therefore not recently
+					 * accessed, immediately enqueue it
+					 * for asynchronous laundering.  The
+					 * current operation is not regarded
+					 * as an access.
+					 */
+					vm_page_launder(m);
 					vm_page_unlock(m);
 					vm_page_xunbusy(m);
 				} else {

Modified: head/sys/kern/uipc_shm.c
==============================================================================
--- head/sys/kern/uipc_shm.c	Sun Dec 11 19:01:27 2016	(r309854)
+++ head/sys/kern/uipc_shm.c	Sun Dec 11 19:24:41 2016	(r309855)
@@ -460,7 +460,15 @@ retry:
 				    NULL);
 				vm_page_lock(m);
 				if (rv == VM_PAGER_OK) {
-					vm_page_deactivate(m);
+					/*
+					 * Since the page was not resident,
+					 * and therefore not recently
+					 * accessed, immediately enqueue it
+					 * for asynchronous laundering.  The
+					 * current operation is not regarded
+					 * as an access.
+					 */
+					vm_page_launder(m);
 					vm_page_unlock(m);
 					vm_page_xunbusy(m);
 				} else {

From owner-svn-src-all@freebsd.org  Sun Dec 11 19:50:41 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FD10C727FC;
 Sun, 11 Dec 2016 19:50:41 +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 EE9E41E98;
 Sun, 11 Dec 2016 19:50:40 +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 uBBJoeg6007805;
 Sun, 11 Dec 2016 19:50:40 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBBJoeSo007804;
 Sun, 11 Dec 2016 19:50:40 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201612111950.uBBJoeSo007804@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin <mav@FreeBSD.org>
Date: Sun, 11 Dec 2016 19:50:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309856 -
 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 19:50:41 -0000

Author: mav
Date: Sun Dec 11 19:50:39 2016
New Revision: 309856
URL: https://svnweb.freebsd.org/changeset/base/309856

Log:
  Postpone ZVOL media/block size caching till first open.
  
  At least on FreeBSD there are no legal way to access media or get its
  size without opening device/provider first.  Postponing this caching
  allows to skip several disk seeks per ZVOL/snapshot during import.
  
  For HDD pool with 1 ZVOL in dev mode with 1000 snapshots this reduces
  pool import time from 40 to 10 seconds.
  
  MFC after:	2 weeks
  Sponsored by:	iXsystems, Inc.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Sun Dec 11 19:24:41 2016	(r309855)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Sun Dec 11 19:50:39 2016	(r309856)
@@ -585,14 +585,14 @@ zvol_create_minor(const char *name)
 	zfs_soft_state_t *zs;
 	zvol_state_t *zv;
 	objset_t *os;
-	dmu_object_info_t doi;
 #ifdef illumos
+	dmu_object_info_t doi;
 	minor_t minor = 0;
 	char chrbuf[30], blkbuf[30];
 #else
 	struct g_provider *pp;
 	struct g_geom *gp;
-	uint64_t volsize, mode;
+	uint64_t mode;
 #endif
 	int error;
 
@@ -658,20 +658,12 @@ zvol_create_minor(const char *name)
 
 	zv = kmem_zalloc(sizeof(*zv), KM_SLEEP);
 	zv->zv_state = 0;
-	error = zap_lookup(os, ZVOL_ZAP_OBJ, "size", 8, 1, &volsize);
-	if (error) {
-		kmem_free(zv, sizeof(*zv));
-		dmu_objset_disown(os, zvol_tag);
-		mutex_exit(&zfsdev_state_lock);
-		return (error);
-	}
 	error = dsl_prop_get_integer(name,
 	    zfs_prop_to_name(ZFS_PROP_VOLMODE), &mode, NULL);
 	if (error != 0 || mode == ZFS_VOLMODE_DEFAULT)
 		mode = volmode;
 
 	DROP_GIANT();
-	zv->zv_volsize = volsize;
 	zv->zv_volmode = mode;
 	if (zv->zv_volmode == ZFS_VOLMODE_GEOM) {
 		g_topology_lock();
@@ -681,7 +673,7 @@ zvol_create_minor(const char *name)
 		pp = g_new_providerf(gp, "%s/%s", ZVOL_DRIVER, name);
 		pp->flags |= G_PF_DIRECT_RECEIVE | G_PF_DIRECT_SEND;
 		pp->sectorsize = DEV_BSIZE;
-		pp->mediasize = zv->zv_volsize;
+		pp->mediasize = 0;
 		pp->private = zv;
 
 		zv->zv_provider = pp;
@@ -724,10 +716,12 @@ zvol_create_minor(const char *name)
 	    sizeof (rl_t), offsetof(rl_t, r_node));
 	list_create(&zv->zv_extents, sizeof (zvol_extent_t),
 	    offsetof(zvol_extent_t, ze_node));
+#ifdef illumos
 	/* get and cache the blocksize */
 	error = dmu_object_info(os, ZVOL_OBJ, &doi);
 	ASSERT(error == 0);
 	zv->zv_volblocksize = doi.doi_data_block_size;
+#endif
 
 	if (spa_writeable(dmu_objset_spa(os))) {
 		if (zil_replay_disable)
@@ -819,6 +813,7 @@ zvol_remove_minor(const char *name)
 int
 zvol_first_open(zvol_state_t *zv)
 {
+	dmu_object_info_t doi;
 	objset_t *os;
 	uint64_t volsize;
 	int error;
@@ -838,6 +833,15 @@ zvol_first_open(zvol_state_t *zv)
 		return (error);
 	}
 
+	/* get and cache the blocksize */
+	error = dmu_object_info(os, ZVOL_OBJ, &doi);
+	if (error) {
+		ASSERT(error == 0);
+		dmu_objset_disown(os, zvol_tag);
+		return (error);
+	}
+	zv->zv_volblocksize = doi.doi_data_block_size;
+
 	error = dmu_bonus_hold(os, ZVOL_OBJ, zvol_tag, &zv->zv_dbuf);
 	if (error) {
 		dmu_objset_disown(os, zvol_tag);

From owner-svn-src-all@freebsd.org  Sun Dec 11 19:58:15 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58C1CC72BF7;
 Sun, 11 Dec 2016 19:58:15 +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 0DA1C1626;
 Sun, 11 Dec 2016 19:58:14 +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 uBBJwEMk011764;
 Sun, 11 Dec 2016 19:58:14 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBBJwE12011763;
 Sun, 11 Dec 2016 19:58:14 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612111958.uBBJwE12011763@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Sun, 11 Dec 2016 19:58:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309857 - in stable: 10/contrib/llvm/lib/Analysis
 11/contrib/llvm/lib/Analysis 9/contrib/llvm/lib/Analysis
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 19:58:15 -0000

Author: dim
Date: Sun Dec 11 19:58:13 2016
New Revision: 309857
URL: https://svnweb.freebsd.org/changeset/base/309857

Log:
  MFC r309722:
  
  Pull in r281586 from upstream llvm trunk (by Wei Mi):
  
    Add some shortcuts in LazyValueInfo to reduce compile time of
    Correlated Value Propagation.
  
    The patch is to partially fix PR10584. Correlated Value Propagation
    queries LVI to check non-null for pointer params of each callsite. If
    we know the def of param is an alloca instruction, we know it is
    non-null and can return early from LVI. Similarly, CVP queries LVI to
    check whether pointer for each mem access is constant. If the def of
    the pointer is an alloca instruction, we know it is not a constant
    pointer. These shortcuts can reduce the cost of CVP significantly.
  
    Differential Revision: https://reviews.llvm.org/D18066
  
  This significantly reduces memory usage and compilation time when
  compiling a particular C++ source file of the graphics/colmap port.
  
  PR:		215136

Modified:
  stable/10/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
  stable/9/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
Directory Properties:
  stable/11/   (props changed)
  stable/9/contrib/llvm/   (props changed)

Modified: stable/10/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
==============================================================================
--- stable/10/contrib/llvm/lib/Analysis/LazyValueInfo.cpp	Sun Dec 11 19:50:39 2016	(r309856)
+++ stable/10/contrib/llvm/lib/Analysis/LazyValueInfo.cpp	Sun Dec 11 19:58:13 2016	(r309857)
@@ -1033,7 +1033,26 @@ void LazyValueInfo::releaseMemory() {
   }
 }
 
+ 
+/// Returns true if we can statically tell that this value will never be a
+/// "useful" constant.  In practice, this means we've got something like an
+/// alloca or a malloc call for which a comparison against a constant can
+/// only be guarding dead code.  Note that we are potentially giving up some
+/// precision in dead code (a constant result) in favour of avoiding a
+/// expensive search for a easily answered common query.
+static bool isKnownNonConstant(Value *V) {
+  V = V->stripPointerCasts();
+  // The return val of alloc cannot be a Constant.
+  if (isa<AllocaInst>(V))
+    return true;
+  return false;
+}
+
 Constant *LazyValueInfo::getConstant(Value *V, BasicBlock *BB) {
+  // Bail out early if V is known not to be a Constant.
+  if (isKnownNonConstant(V))
+    return nullptr;
+
   LVILatticeVal Result = getCache(PImpl).getValueInBlock(V, BB);
   
   if (Result.isConstant())

From owner-svn-src-all@freebsd.org  Sun Dec 11 19:58:14 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5F2CC72BEB;
 Sun, 11 Dec 2016 19:58:14 +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 93A3A1624;
 Sun, 11 Dec 2016 19:58:14 +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 uBBJwDV0011751;
 Sun, 11 Dec 2016 19:58:13 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBBJwDse011750;
 Sun, 11 Dec 2016 19:58:13 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612111958.uBBJwDse011750@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Sun, 11 Dec 2016 19:58:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r309857 - in stable: 10/contrib/llvm/lib/Analysis
 11/contrib/llvm/lib/Analysis 9/contrib/llvm/lib/Analysis
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 19:58:15 -0000

Author: dim
Date: Sun Dec 11 19:58:13 2016
New Revision: 309857
URL: https://svnweb.freebsd.org/changeset/base/309857

Log:
  MFC r309722:
  
  Pull in r281586 from upstream llvm trunk (by Wei Mi):
  
    Add some shortcuts in LazyValueInfo to reduce compile time of
    Correlated Value Propagation.
  
    The patch is to partially fix PR10584. Correlated Value Propagation
    queries LVI to check non-null for pointer params of each callsite. If
    we know the def of param is an alloca instruction, we know it is
    non-null and can return early from LVI. Similarly, CVP queries LVI to
    check whether pointer for each mem access is constant. If the def of
    the pointer is an alloca instruction, we know it is not a constant
    pointer. These shortcuts can reduce the cost of CVP significantly.
  
    Differential Revision: https://reviews.llvm.org/D18066
  
  This significantly reduces memory usage and compilation time when
  compiling a particular C++ source file of the graphics/colmap port.
  
  PR:		215136

Modified:
  stable/9/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
Directory Properties:
  stable/9/contrib/llvm/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
  stable/11/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/9/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
==============================================================================
--- stable/9/contrib/llvm/lib/Analysis/LazyValueInfo.cpp	Sun Dec 11 19:50:39 2016	(r309856)
+++ stable/9/contrib/llvm/lib/Analysis/LazyValueInfo.cpp	Sun Dec 11 19:58:13 2016	(r309857)
@@ -1033,7 +1033,26 @@ void LazyValueInfo::releaseMemory() {
   }
 }
 
+ 
+/// Returns true if we can statically tell that this value will never be a
+/// "useful" constant.  In practice, this means we've got something like an
+/// alloca or a malloc call for which a comparison against a constant can
+/// only be guarding dead code.  Note that we are potentially giving up some
+/// precision in dead code (a constant result) in favour of avoiding a
+/// expensive search for a easily answered common query.
+static bool isKnownNonConstant(Value *V) {
+  V = V->stripPointerCasts();
+  // The return val of alloc cannot be a Constant.
+  if (isa<AllocaInst>(V))
+    return true;
+  return false;
+}
+
 Constant *LazyValueInfo::getConstant(Value *V, BasicBlock *BB) {
+  // Bail out early if V is known not to be a Constant.
+  if (isKnownNonConstant(V))
+    return nullptr;
+
   LVILatticeVal Result = getCache(PImpl).getValueInBlock(V, BB);
   
   if (Result.isConstant())

From owner-svn-src-all@freebsd.org  Sun Dec 11 19:58:15 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03BB2C72BEC;
 Sun, 11 Dec 2016 19:58:15 +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 CB10B1625;
 Sun, 11 Dec 2016 19:58:14 +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 uBBJwEoR011758;
 Sun, 11 Dec 2016 19:58:14 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBBJwDvN011757;
 Sun, 11 Dec 2016 19:58:13 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612111958.uBBJwDvN011757@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Sun, 11 Dec 2016 19:58:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309857 - in stable: 10/contrib/llvm/lib/Analysis
 11/contrib/llvm/lib/Analysis 9/contrib/llvm/lib/Analysis
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 19:58:15 -0000

Author: dim
Date: Sun Dec 11 19:58:13 2016
New Revision: 309857
URL: https://svnweb.freebsd.org/changeset/base/309857

Log:
  MFC r309722:
  
  Pull in r281586 from upstream llvm trunk (by Wei Mi):
  
    Add some shortcuts in LazyValueInfo to reduce compile time of
    Correlated Value Propagation.
  
    The patch is to partially fix PR10584. Correlated Value Propagation
    queries LVI to check non-null for pointer params of each callsite. If
    we know the def of param is an alloca instruction, we know it is
    non-null and can return early from LVI. Similarly, CVP queries LVI to
    check whether pointer for each mem access is constant. If the def of
    the pointer is an alloca instruction, we know it is not a constant
    pointer. These shortcuts can reduce the cost of CVP significantly.
  
    Differential Revision: https://reviews.llvm.org/D18066
  
  This significantly reduces memory usage and compilation time when
  compiling a particular C++ source file of the graphics/colmap port.
  
  PR:		215136

Modified:
  stable/11/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
  stable/9/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
Directory Properties:
  stable/10/   (props changed)
  stable/9/contrib/llvm/   (props changed)

Modified: stable/11/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
==============================================================================
--- stable/11/contrib/llvm/lib/Analysis/LazyValueInfo.cpp	Sun Dec 11 19:50:39 2016	(r309856)
+++ stable/11/contrib/llvm/lib/Analysis/LazyValueInfo.cpp	Sun Dec 11 19:58:13 2016	(r309857)
@@ -1203,8 +1203,27 @@ void LazyValueInfo::releaseMemory() {
   }
 }
 
+ 
+/// Returns true if we can statically tell that this value will never be a
+/// "useful" constant.  In practice, this means we've got something like an
+/// alloca or a malloc call for which a comparison against a constant can
+/// only be guarding dead code.  Note that we are potentially giving up some
+/// precision in dead code (a constant result) in favour of avoiding a
+/// expensive search for a easily answered common query.
+static bool isKnownNonConstant(Value *V) {
+  V = V->stripPointerCasts();
+  // The return val of alloc cannot be a Constant.
+  if (isa<AllocaInst>(V))
+    return true;
+  return false;
+}
+
 Constant *LazyValueInfo::getConstant(Value *V, BasicBlock *BB,
                                      Instruction *CxtI) {
+  // Bail out early if V is known not to be a Constant.
+  if (isKnownNonConstant(V))
+    return nullptr;
+
   const DataLayout &DL = BB->getModule()->getDataLayout();
   LVILatticeVal Result =
       getCache(PImpl, AC, &DL, DT).getValueInBlock(V, BB, CxtI);
@@ -1322,6 +1341,17 @@ LazyValueInfo::getPredicateOnEdge(unsign
 LazyValueInfo::Tristate
 LazyValueInfo::getPredicateAt(unsigned Pred, Value *V, Constant *C,
                               Instruction *CxtI) {
+  // Is or is not NonNull are common predicates being queried. If
+  // isKnownNonNull can tell us the result of the predicate, we can
+  // return it quickly. But this is only a fastpath, and falling
+  // through would still be correct.
+  if (V->getType()->isPointerTy() && C->isNullValue() &&
+      isKnownNonNull(V->stripPointerCasts())) {
+    if (Pred == ICmpInst::ICMP_EQ)
+      return LazyValueInfo::False;
+    else if (Pred == ICmpInst::ICMP_NE)
+      return LazyValueInfo::True;
+  }
   const DataLayout &DL = CxtI->getModule()->getDataLayout();
   LVILatticeVal Result = getCache(PImpl, AC, &DL, DT).getValueAt(V, CxtI);
   Tristate Ret = getPredicateResult(Pred, C, Result, DL, TLI);

From owner-svn-src-all@freebsd.org  Sun Dec 11 23:14:48 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAA93C7347C;
 Sun, 11 Dec 2016 23:14:48 +0000 (UTC)
 (envelope-from hiren@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5DA12FB7;
 Sun, 11 Dec 2016 23:14:48 +0000 (UTC)
 (envelope-from hiren@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBBNElVQ092757;
 Sun, 11 Dec 2016 23:14:47 GMT (envelope-from hiren@FreeBSD.org)
Received: (from hiren@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBBNElZn092756;
 Sun, 11 Dec 2016 23:14:47 GMT (envelope-from hiren@FreeBSD.org)
Message-Id: <201612112314.uBBNElZn092756@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hiren set sender to
 hiren@FreeBSD.org using -f
From: Hiren Panchasara <hiren@FreeBSD.org>
Date: Sun, 11 Dec 2016 23:14:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309858 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 23:14:48 -0000

Author: hiren
Date: Sun Dec 11 23:14:47 2016
New Revision: 309858
URL: https://svnweb.freebsd.org/changeset/base/309858

Log:
  We currently don't do TSO if ip options are present. In case of IPv6, we look at
  in6p_options to check that. That is incorrect as we carry ip options in
  in6p_outputopts. Also, just checking for in6p_outputopts being NULL won't
  suffice as we combine ip options and ip header fields both in that one field.
  The commit fixes this by using ip6_optlen() which correctly calculates length
  of only ip options for IPv6.
  
  Reviewed by:	    ae, bz
  MFC after:	    3 weeks
  Sponsored by:	    Limelight Networks

Modified:
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_output.c
==============================================================================
--- head/sys/netinet/tcp_output.c	Sun Dec 11 19:58:13 2016	(r309857)
+++ head/sys/netinet/tcp_output.c	Sun Dec 11 23:14:47 2016	(r309858)
@@ -545,6 +545,11 @@ after_sack_rexmit:
 	 * (except for the sequence number) for all generated packets.  This
 	 * makes it impossible to transmit any options which vary per generated
 	 * segment or packet.
+	 *
+	 * IPv4 handling has a clear separation of ip options and ip header
+	 * flags while IPv6 combines both in in6p_outputopts. ip6_optlen() does
+	 * the right thing below to provide length of just ip options and thus
+	 * checking for ipoptlen is enough to decide if ip options are present.
 	 */
 #ifdef IPSEC
 	/*
@@ -553,14 +558,25 @@ after_sack_rexmit:
 	 */
 	ipsec_optlen = ipsec_hdrsiz_tcp(tp);
 #endif
+
+#ifdef INET6
+	if (isipv6)
+		ipoptlen = ip6_optlen(tp->t_inpcb);
+	else
+#endif
+	if (tp->t_inpcb->inp_options)
+		ipoptlen = tp->t_inpcb->inp_options->m_len -
+				offsetof(struct ipoption, ipopt_list);
+	else
+		ipoptlen = 0;
+#ifdef IPSEC
+	ipoptlen += ipsec_optlen;
+#endif
+
 	if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg &&
 	    ((tp->t_flags & TF_SIGNATURE) == 0) &&
 	    tp->rcv_numsacks == 0 && sack_rxmit == 0 &&
-#ifdef IPSEC
-	    ipsec_optlen == 0 &&
-#endif
-	    tp->t_inpcb->inp_options == NULL &&
-	    tp->t_inpcb->in6p_options == NULL)
+	    ipoptlen == 0)
 		tso = 1;
 
 	if (sack_rxmit) {
@@ -833,20 +849,6 @@ send:
 		hdrlen += optlen = tcp_addoptions(&to, opt);
 	}
 
-#ifdef INET6
-	if (isipv6)
-		ipoptlen = ip6_optlen(tp->t_inpcb);
-	else
-#endif
-	if (tp->t_inpcb->inp_options)
-		ipoptlen = tp->t_inpcb->inp_options->m_len -
-				offsetof(struct ipoption, ipopt_list);
-	else
-		ipoptlen = 0;
-#ifdef IPSEC
-	ipoptlen += ipsec_optlen;
-#endif
-
 	/*
 	 * Adjust data length if insertion of options will
 	 * bump the packet length beyond the t_maxseg length.

From owner-svn-src-all@freebsd.org  Sun Dec 11 23:36:12 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AEFCC73A7D;
 Sun, 11 Dec 2016 23:36:12 +0000 (UTC)
 (envelope-from hiren@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1FFFF1B23;
 Sun, 11 Dec 2016 23:36:12 +0000 (UTC)
 (envelope-from hiren@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBBNaB0F001116;
 Sun, 11 Dec 2016 23:36:11 GMT (envelope-from hiren@FreeBSD.org)
Received: (from hiren@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBBNaB9u001115;
 Sun, 11 Dec 2016 23:36:11 GMT (envelope-from hiren@FreeBSD.org)
Message-Id: <201612112336.uBBNaB9u001115@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hiren set sender to
 hiren@FreeBSD.org using -f
From: Hiren Panchasara <hiren@FreeBSD.org>
Date: Sun, 11 Dec 2016 23:36:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309859 - stable/11/sys/kern
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 23:36:12 -0000

Author: hiren
Date: Sun Dec 11 23:36:11 2016
New Revision: 309859
URL: https://svnweb.freebsd.org/changeset/base/309859

Log:
  MFC r307745
  
  In sendit(), if mp->msg_control is present, then in sockargs() we are
  allocating mbuf to store mp->msg_control. Later in kern_sendit(), call
  to getsock_cap(), will check validity of file pointer passed, if this
  fails EBADF is returned but mbuf allocated in sockargs() is not freed.
  Made code changes to free the same.
  
  Since freeing control mbuf in sendit() after checking (control != NULL)
  may lead to double freeing of control mbuf in sendit(), we can free
  control mbuf in kern_sendit() if there are any errors in the routine.
  
  Submitted by:		Lohith Bellad <lohith.bellad@me.com>

Modified:
  stable/11/sys/kern/uipc_syscalls.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/uipc_syscalls.c
==============================================================================
--- stable/11/sys/kern/uipc_syscalls.c	Sun Dec 11 23:14:47 2016	(r309858)
+++ stable/11/sys/kern/uipc_syscalls.c	Sun Dec 11 23:36:11 2016	(r309859)
@@ -806,8 +806,10 @@ kern_sendit(td, s, mp, flags, control, s
 		cap_rights_set(&rights, CAP_CONNECT);
 	}
 	error = getsock_cap(td, s, &rights, &fp, NULL);
-	if (error != 0)
+	if (error != 0) {
+		m_freem(control);
 		return (error);
+	}
 	so = (struct socket *)fp->f_data;
 
 #ifdef KTRACE
@@ -818,12 +820,16 @@ kern_sendit(td, s, mp, flags, control, s
 	if (mp->msg_name != NULL) {
 		error = mac_socket_check_connect(td->td_ucred, so,
 		    mp->msg_name);
-		if (error != 0)
+		if (error != 0) {
+			m_freem(control);
 			goto bad;
+		}
 	}
 	error = mac_socket_check_send(td->td_ucred, so);
-	if (error != 0)
+	if (error != 0) {
+		m_freem(control);
 		goto bad;
+	}
 #endif
 
 	auio.uio_iov = mp->msg_iov;
@@ -837,6 +843,7 @@ kern_sendit(td, s, mp, flags, control, s
 	for (i = 0; i < mp->msg_iovlen; i++, iov++) {
 		if ((auio.uio_resid += iov->iov_len) < 0) {
 			error = EINVAL;
+			m_freem(control);
 			goto bad;
 		}
 	}

From owner-svn-src-all@freebsd.org  Sun Dec 11 23:38:51 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A079C73AF0;
 Sun, 11 Dec 2016 23:38:51 +0000 (UTC)
 (envelope-from hiren@freebsd.org)
Received: from mail.strugglingcoder.info (strugglingcoder.info
 [104.236.146.68])
 by mx1.freebsd.org (Postfix) with ESMTP id 5B6101CB9;
 Sun, 11 Dec 2016 23:38:51 +0000 (UTC)
 (envelope-from hiren@freebsd.org)
Received: from localhost (unknown [10.1.1.3])
 (Authenticated sender: hiren@strugglingcoder.info)
 by mail.strugglingcoder.info (Postfix) with ESMTPA id 968C217D4C;
 Sun, 11 Dec 2016 15:38:45 -0800 (PST)
Date: Sun, 11 Dec 2016 15:38:45 -0800
From: Hiren Panchasara <hiren@freebsd.org>
To: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org, Lohith Bellad <lohith.bellad@me.com>
Subject: Re: svn commit: r307745 - head/sys/kern
Message-ID: <20161211233845.GE27291@strugglingcoder.info>
References: <201610211827.u9LIRUUi010303@repo.freebsd.org>
 <CAPQ4fft5M=5zMtKeTJbmwF5pBg=s7yn9RwMOyEfm-xZYujhkbw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature"; boundary="HFNNDGBA8bk+zEXz"
Content-Disposition: inline
In-Reply-To: <CAPQ4fft5M=5zMtKeTJbmwF5pBg=s7yn9RwMOyEfm-xZYujhkbw@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 23:38:51 -0000


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

On 12/10/16 at 09:35P, Oliver Pinter wrote:
> On 10/21/16, Hiren Panchasara <hiren@freebsd.org> wrote:
> > Author: hiren
> > Date: Fri Oct 21 18:27:30 2016
> > New Revision: 307745
> > URL: https://svnweb.freebsd.org/changeset/base/307745
> >
> > Log:
> >   Rework r306337.
> >
> >   In sendit(), if mp->msg_control is present, then in sockargs() we are
> >   allocating mbuf to store mp->msg_control. Later in kern_sendit(), call
> >   to getsock_cap(), will check validity of file pointer passed, if this
> >   fails EBADF is returned but mbuf allocated in sockargs() is not freed.
> >   Made code changes to free the same.
> >
> >   Since freeing control mbuf in sendit() after checking (control !=3D N=
ULL)
> >   may lead to double freeing of control mbuf in sendit(), we can free
> >   control mbuf in kern_sendit() if there are any errors in the routine.
> >
> >   Submitted by:		    Lohith Bellad <lohith.bellad@me.com>
> >   Reviewed by:		    glebius
> >   MFC after:		    3 weeks
> >   Differential Revision:	    https://reviews.freebsd.org/D8152
>=20
> Hi Hiren!
>=20
> What's the status of the MFC? I not see them (this and r306337) in
> 11-STABLE nor in 10-STABLE branch.

Thanks for the reminder. I MFCd to 11. I don't really track 10 anymore
so I'd request you to do it yourself. If you can't for some reason, let
me know.

Cheers,
Hiren

--HFNNDGBA8bk+zEXz
Content-Type: application/pgp-signature

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

iQF8BAABCgBmBQJYTeOCXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4
QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lPdEH/Rk0RsAfnkmJo7ZgR7nVOmHq
75oEzq8VzcwcmagJH9G1tx1TnisOdOlrUrJk6S741/GA3N22AQjtBhJTtqqX+HFV
0iNH1+QcincKPD654WDhLUeRfl3oD1LjYUit9lCuN45TECzYu/nh2kReQACrLIje
oqskPorMx07TVV40DoB8axGIDEp2xA1pPFUa5BMQvnwLcA2xv+Tx8Gk0oKSzofrk
x02Fk/7NWqxZHqhgH9l3PZMqu2aeN1554omoF820YKtSCqGIKi6U/eVq2j95IVGu
vaI5UsrFae9J6/wKFKy/qZRVzE5uwY7TE8KRjVETZ1PbGP4Meg8CdejYsBxixkM=
=qkad
-----END PGP SIGNATURE-----

--HFNNDGBA8bk+zEXz--

From owner-svn-src-all@freebsd.org  Sun Dec 11 23:57:55 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 147CFC725C5
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Sun, 11 Dec 2016 23:57:55 +0000 (UTC)
 (envelope-from oliver.pinter@hardenedbsd.org)
Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com
 [IPv6:2a00:1450:400c:c09::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 9F2A619AB
 for <svn-src-all@freebsd.org>; Sun, 11 Dec 2016 23:57:54 +0000 (UTC)
 (envelope-from oliver.pinter@hardenedbsd.org)
Received: by mail-wm0-x229.google.com with SMTP id f82so43412028wmf.1
 for <svn-src-all@freebsd.org>; Sun, 11 Dec 2016 15:57:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=fhK02mzFQe5Vl9vSZiGMWr3vTS9pvKkqor7CGu0xqbo=;
 b=RS3JtG6oxF4fIL9hbl+J88Cj1QClv7KX01rE7NoS6+D4NZVyKimroqDKqfIn/5L7qF
 RMTCnuC3SO7dnua4uKHWnlKegcV5fnVCg9H+3oGk/5/jo/ALAloPQhUYRcoxtnV8RVqX
 kPtF9+haDI4JKF0laNsuTmzhSSIGEcMusSFQjHJvshj8dhbzctaMUJweAh/gOxaQfYUw
 V6OTBpXtkLVeHaquRbmbHPUCNS6Rsv5aXoT0Cig+5eh7aCpNsOtD3a3NjGugwyQLD/8D
 bHObTgG/kITl0cC81NqIrR3bBSU6F9cNO3kok0zwiPzq7KmdTAIev8AzHzJ9huS2YdDK
 /p0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=fhK02mzFQe5Vl9vSZiGMWr3vTS9pvKkqor7CGu0xqbo=;
 b=Mw4lUlDRbOHfvwiWu5DVSkQz2D8Cb0drXAuKkR29E4rTwmoOgkuKqulTJmLUakYjFf
 ZsqfhgSVgR4DE3b5hsdns9tcvmq4TuQTaeM10K+P2G7ZEPsNEt65STrDAcKVeR51aua+
 uQFCyD+DO5X1M5IrB57DFvGvwlM9jTQ6YtYyMV/mzCBvj8KFRgj8wrJ2KUjilmWCUi6R
 s8UXoUhiQM0ysO8phCZ1Lz/7lRpobRiaT5Pua4q8W4gZ0bEGBESIVvbuhGW8UbFqNeM0
 3HQnmYbGBv6ZPFJ36MHnR6pNfrOZUYze4X2TNTsRxLvNuHgqRf+9IbnnR8xtfY1QyK/d
 gr4w==
X-Gm-Message-State: AKaTC00gtxNTho3kWx+rB2q23PNHI/8EH7GKUFy7jpILNxwE6feEWQJTiyWUBOfgwD92NCCNEHH1rn/v6dYISwZW
X-Received: by 10.28.39.199 with SMTP id n190mr14476657wmn.124.1481500672841; 
 Sun, 11 Dec 2016 15:57:52 -0800 (PST)
MIME-Version: 1.0
Received: by 10.194.253.65 with HTTP; Sun, 11 Dec 2016 15:57:52 -0800 (PST)
In-Reply-To: <f835a124-8399-1806-b350-b1fb77411386@FreeBSD.org>
References: <201611041656.uA4GuaZF028619@repo.freebsd.org>
 <CAPQ4fftCWc3asYe2dm72=j4Je8087nZGAtj9RJ9D2ri3hBMGKQ@mail.gmail.com>
 <f835a124-8399-1806-b350-b1fb77411386@FreeBSD.org>
From: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Date: Mon, 12 Dec 2016 00:57:52 +0100
Message-ID: <CAPQ4ffuYhjsO3mXF83urwhJFyZCfgu-Y7aziiXSQUkqmuEfiCg@mail.gmail.com>
Subject: Re: MFC reminder emails (was Re: svn commit: r308296 -
 head/sys/cam/scsi)
To: Pedro Giffuni <pfg@freebsd.org>
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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 11 Dec 2016 23:57:55 -0000

Hi Pedro!

On 12/11/16, Pedro Giffuni <pfg@freebsd.org> wrote:
> Hello;
> On 12/10/16 19:58, Oliver Pinter wrote:
> ...
>
>>>   Reviewed by:	ken
>>>   Obtained from:	Netflix
>>>   MFC after:	3 days
>>
>> Hi Scott!
>>
>> What's the status of the MFCs to 10-STABLE and 11-STABLE?
>>
>
> Not meaning to pester anyone but given that you (and others) tend
> to remind about MFCs you would like to see done ...
>
> 1) Committers get an email reminder in due time when they add an
> MFC tag to the commit log.
>
> 2) MFCs are advisory: committer may change mind about them or
> otherwise not do them due to any reason.
>
> 3) It's still not official, but we have an additional service
> that lets committers verify the state of MFC requests if they wish.
>
> Given the points above, which you may not have been aware of,
> it may be seen as rude to post additional reminders.

Thanks for these information and have a nice day.

>
> Pedro.
>
>

From owner-svn-src-all@freebsd.org  Mon Dec 12 00:09:09 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 768BCC72BBB;
 Mon, 12 Dec 2016 00:09:09 +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 45B2F7B;
 Mon, 12 Dec 2016 00:09:09 +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 uBC0982F013255;
 Mon, 12 Dec 2016 00:09:08 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC098pX013254;
 Mon, 12 Dec 2016 00:09:08 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612120009.uBC098pX013254@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Mon, 12 Dec 2016 00:09:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r309860 - stable/9/contrib/llvm/lib/Analysis
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 00:09:09 -0000

Author: dim
Date: Mon Dec 12 00:09:08 2016
New Revision: 309860
URL: https://svnweb.freebsd.org/changeset/base/309860

Log:
  Fix libllvmanalysis build failure after r309857: on stable/9, llvm is
  compiled by gcc, and without -std=c++11, so the nullptr keyword is
  unknown.  Use the old-school plain zero syntax instead.

Modified:
  stable/9/contrib/llvm/lib/Analysis/LazyValueInfo.cpp

Modified: stable/9/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
==============================================================================
--- stable/9/contrib/llvm/lib/Analysis/LazyValueInfo.cpp	Sun Dec 11 23:36:11 2016	(r309859)
+++ stable/9/contrib/llvm/lib/Analysis/LazyValueInfo.cpp	Mon Dec 12 00:09:08 2016	(r309860)
@@ -1051,7 +1051,7 @@ static bool isKnownNonConstant(Value *V)
 Constant *LazyValueInfo::getConstant(Value *V, BasicBlock *BB) {
   // Bail out early if V is known not to be a Constant.
   if (isKnownNonConstant(V))
-    return nullptr;
+    return 0;
 
   LVILatticeVal Result = getCache(PImpl).getValueInBlock(V, BB);
   

From owner-svn-src-all@freebsd.org  Mon Dec 12 00:45:44 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90351C6F623;
 Mon, 12 Dec 2016 00:45:44 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 457E212F0;
 Mon, 12 Dec 2016 00:45:44 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBC0jhx5029508;
 Mon, 12 Dec 2016 00:45:43 GMT (envelope-from delphij@FreeBSD.org)
Received: (from delphij@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC0jhQN029506;
 Mon, 12 Dec 2016 00:45:43 GMT (envelope-from delphij@FreeBSD.org)
Message-Id: <201612120045.uBC0jhQN029506@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: delphij set sender to
 delphij@FreeBSD.org using -f
From: Xin LI <delphij@FreeBSD.org>
Date: Mon, 12 Dec 2016 00:45:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309861 - stable/11/usr.bin/sort
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 00:45:44 -0000

Author: delphij
Date: Mon Dec 12 00:45:43 2016
New Revision: 309861
URL: https://svnweb.freebsd.org/changeset/base/309861

Log:
  MFC r309232-309234:
  
  r309232: Fix an obvious typo.
  r309233: Eliminate variables that are computed, assigned but
           never used.
  r309234: pages and psize are always assigned, so there is no
           need to initialize them as zero.

Modified:
  stable/11/usr.bin/sort/bwstring.c
  stable/11/usr.bin/sort/sort.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/sort/bwstring.c
==============================================================================
--- stable/11/usr.bin/sort/bwstring.c	Mon Dec 12 00:09:08 2016	(r309860)
+++ stable/11/usr.bin/sort/bwstring.c	Mon Dec 12 00:45:43 2016	(r309861)
@@ -910,7 +910,6 @@ bws_month_score(const struct bwstring *s
 
 	if (MB_CUR_MAX == 1) {
 		const unsigned char *end, *s;
-		size_t len;
 
 		s = s0->data.cstr;
 		end = s + s0->len;
@@ -918,8 +917,6 @@ bws_month_score(const struct bwstring *s
 		while (isblank(*s) && s < end)
 			++s;
 
-		len = strlen((const char*)s);
-
 		for (int i = 11; i >= 0; --i) {
 			if (cmonths[i] &&
 			    (s == (unsigned char*)strstr((const char*)s, (char*)(cmonths[i]))))
@@ -928,7 +925,6 @@ bws_month_score(const struct bwstring *s
 
 	} else {
 		const wchar_t *end, *s;
-		size_t len;
 
 		s = s0->data.wstr;
 		end = s + s0->len;
@@ -936,8 +932,6 @@ bws_month_score(const struct bwstring *s
 		while (iswblank(*s) && s < end)
 			++s;
 
-		len = wcslen(s);
-
 		for (int i = 11; i >= 0; --i) {
 			if (wmonths[i] && (s == wcsstr(s, wmonths[i])))
 				return (i);

Modified: stable/11/usr.bin/sort/sort.c
==============================================================================
--- stable/11/usr.bin/sort/sort.c	Mon Dec 12 00:09:08 2016	(r309860)
+++ stable/11/usr.bin/sort/sort.c	Mon Dec 12 00:45:43 2016	(r309861)
@@ -209,14 +209,10 @@ sort_modifier_empty(struct sort_mods *sm
 static void
 usage(bool opt_err)
 {
-	struct option *o;
 	FILE *out;
 
-	out = stdout;
-	o = &(long_options[0]);
+	out = opt_err ? stderr : stdout;
 
-	if (opt_err)
-		out = stderr;
 	fprintf(out, getstr(12), getprogname());
 	if (opt_err)
 		exit(2);
@@ -271,8 +267,6 @@ set_hw_params(void)
 {
 	long pages, psize;
 
-	pages = psize = 0;
-
 #if defined(SORT_THREADS)
 	ncpu = 1;
 #endif
@@ -280,7 +274,7 @@ set_hw_params(void)
 	pages = sysconf(_SC_PHYS_PAGES);
 	if (pages < 1) {
 		perror("sysconf pages");
-		psize = 1;
+		pages = 1;
 	}
 	psize = sysconf(_SC_PAGESIZE);
 	if (psize < 1) {

From owner-svn-src-all@freebsd.org  Mon Dec 12 00:47:14 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 163B8C6F807;
 Mon, 12 Dec 2016 00:47:14 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BCFB515AC;
 Mon, 12 Dec 2016 00:47:13 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBC0lCte029620;
 Mon, 12 Dec 2016 00:47:12 GMT (envelope-from delphij@FreeBSD.org)
Received: (from delphij@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC0lCC0029618;
 Mon, 12 Dec 2016 00:47:12 GMT (envelope-from delphij@FreeBSD.org)
Message-Id: <201612120047.uBC0lCC0029618@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: delphij set sender to
 delphij@FreeBSD.org using -f
From: Xin LI <delphij@FreeBSD.org>
Date: Mon, 12 Dec 2016 00:47:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309862 - stable/10/usr.bin/sort
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 00:47:14 -0000

Author: delphij
Date: Mon Dec 12 00:47:12 2016
New Revision: 309862
URL: https://svnweb.freebsd.org/changeset/base/309862

Log:
  MFC r309232-309234:
  
  r309232: Fix an obvious typo.
  r309233: Eliminate variables that are computed, assigned but
           never used.
  r309234: pages and psize are always assigned, so there is no
           need to initialize them as zero.

Modified:
  stable/10/usr.bin/sort/bwstring.c
  stable/10/usr.bin/sort/sort.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/sort/bwstring.c
==============================================================================
--- stable/10/usr.bin/sort/bwstring.c	Mon Dec 12 00:45:43 2016	(r309861)
+++ stable/10/usr.bin/sort/bwstring.c	Mon Dec 12 00:47:12 2016	(r309862)
@@ -910,7 +910,6 @@ bws_month_score(const struct bwstring *s
 
 	if (MB_CUR_MAX == 1) {
 		const unsigned char *end, *s;
-		size_t len;
 
 		s = s0->data.cstr;
 		end = s + s0->len;
@@ -918,8 +917,6 @@ bws_month_score(const struct bwstring *s
 		while (isblank(*s) && s < end)
 			++s;
 
-		len = strlen((const char*)s);
-
 		for (int i = 11; i >= 0; --i) {
 			if (cmonths[i] &&
 			    (s == (unsigned char*)strstr((const char*)s, (char*)(cmonths[i]))))
@@ -928,7 +925,6 @@ bws_month_score(const struct bwstring *s
 
 	} else {
 		const wchar_t *end, *s;
-		size_t len;
 
 		s = s0->data.wstr;
 		end = s + s0->len;
@@ -936,8 +932,6 @@ bws_month_score(const struct bwstring *s
 		while (iswblank(*s) && s < end)
 			++s;
 
-		len = wcslen(s);
-
 		for (int i = 11; i >= 0; --i) {
 			if (wmonths[i] && (s == wcsstr(s, wmonths[i])))
 				return (i);

Modified: stable/10/usr.bin/sort/sort.c
==============================================================================
--- stable/10/usr.bin/sort/sort.c	Mon Dec 12 00:45:43 2016	(r309861)
+++ stable/10/usr.bin/sort/sort.c	Mon Dec 12 00:47:12 2016	(r309862)
@@ -209,14 +209,10 @@ sort_modifier_empty(struct sort_mods *sm
 static void
 usage(bool opt_err)
 {
-	struct option *o;
 	FILE *out;
 
-	out = stdout;
-	o = &(long_options[0]);
+	out = opt_err ? stderr : stdout;
 
-	if (opt_err)
-		out = stderr;
 	fprintf(out, getstr(12), getprogname());
 	if (opt_err)
 		exit(2);
@@ -271,8 +267,6 @@ set_hw_params(void)
 {
 	long pages, psize;
 
-	pages = psize = 0;
-
 #if defined(SORT_THREADS)
 	ncpu = 1;
 #endif
@@ -280,7 +274,7 @@ set_hw_params(void)
 	pages = sysconf(_SC_PHYS_PAGES);
 	if (pages < 1) {
 		perror("sysconf pages");
-		psize = 1;
+		pages = 1;
 	}
 	psize = sysconf(_SC_PAGESIZE);
 	if (psize < 1) {

From owner-svn-src-all@freebsd.org  Mon Dec 12 02:09:32 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82336C73C42;
 Mon, 12 Dec 2016 02:09: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 5CAF81921;
 Mon, 12 Dec 2016 02:09:32 +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 uBC29VOi061898;
 Mon, 12 Dec 2016 02:09:31 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC29Vvb061894;
 Mon, 12 Dec 2016 02:09:31 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201612120209.uBC29Vvb061894@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 12 Dec 2016 02:09:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r309863 - vendor/libarchive/dist/cpio/test
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 02:09:32 -0000

Author: ngie
Date: Mon Dec 12 02:09:31 2016
New Revision: 309863
URL: https://svnweb.freebsd.org/changeset/base/309863

Log:
  Free p (the memory allocated via slurpfile) when done with the contents
  
  Reported by:	Coverity
  CID:	1331631, 1331632, 1331633, 1331646
  
  Obtained from: libarchive (ebe29c0ec3b1aaa424df9cf884721c6018c676f4)

Modified:
  vendor/libarchive/dist/cpio/test/test_option_J_upper.c
  vendor/libarchive/dist/cpio/test/test_option_Z_upper.c
  vendor/libarchive/dist/cpio/test/test_option_u.c
  vendor/libarchive/dist/cpio/test/test_option_y.c

Modified: vendor/libarchive/dist/cpio/test/test_option_J_upper.c
==============================================================================
--- vendor/libarchive/dist/cpio/test/test_option_J_upper.c	Mon Dec 12 00:47:12 2016	(r309862)
+++ vendor/libarchive/dist/cpio/test/test_option_J_upper.c	Mon Dec 12 02:09:31 2016	(r309863)
@@ -47,10 +47,13 @@ DEFINE_TEST(test_option_J_upper)
 		}
 		failure("-J option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has an xz signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "\3757zXZ", 5);
+done:
+	free(p);
 }

Modified: vendor/libarchive/dist/cpio/test/test_option_Z_upper.c
==============================================================================
--- vendor/libarchive/dist/cpio/test/test_option_Z_upper.c	Mon Dec 12 00:47:12 2016	(r309862)
+++ vendor/libarchive/dist/cpio/test/test_option_Z_upper.c	Mon Dec 12 02:09:31 2016	(r309863)
@@ -47,10 +47,13 @@ DEFINE_TEST(test_option_Z_upper)
 		}
 		failure("-Z option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has a compress signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "\x1f\x9d", 2);
+done:
+	free(p);
 }

Modified: vendor/libarchive/dist/cpio/test/test_option_u.c
==============================================================================
--- vendor/libarchive/dist/cpio/test/test_option_u.c	Mon Dec 12 00:47:12 2016	(r309862)
+++ vendor/libarchive/dist/cpio/test/test_option_u.c	Mon Dec 12 02:09:31 2016	(r309863)
@@ -49,6 +49,7 @@ DEFINE_TEST(test_option_u)
 	p = slurpfile(&s, "copy/f");
 	assertEqualInt(s, 1);
 	assertEqualMem(p, "a", 1);
+	free(p);
 
 	/* Recreate the file with a single "b" */
 	assertMakeFile("f", 0644, "b");
@@ -68,6 +69,7 @@ DEFINE_TEST(test_option_u)
 	p = slurpfile(&s, "copy/f");
 	assertEqualInt(s, 1);
 	assertEqualMem(p, "a", 1);
+	free(p);
 
 	/* Copy the file to the "copy" dir with -u (force) */
 	r = systemf("echo f| %s -pud copy >copy.out 2>copy.err",
@@ -78,4 +80,5 @@ DEFINE_TEST(test_option_u)
 	p = slurpfile(&s, "copy/f");
 	assertEqualInt(s, 1);
 	assertEqualMem(p, "b", 1);
+	free(p);
 }

Modified: vendor/libarchive/dist/cpio/test/test_option_y.c
==============================================================================
--- vendor/libarchive/dist/cpio/test/test_option_y.c	Mon Dec 12 00:47:12 2016	(r309862)
+++ vendor/libarchive/dist/cpio/test/test_option_y.c	Mon Dec 12 02:09:31 2016	(r309863)
@@ -46,11 +46,14 @@ DEFINE_TEST(test_option_y)
 		}
 		failure("-y option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
 	assertTextFileContents("1 block\n", "archive.err");
 	/* Check that the archive file has a bzip2 signature. */
+	free(p);
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "BZh9", 4);
+done:
+	free(p);
 }

From owner-svn-src-all@freebsd.org  Mon Dec 12 02:11:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99FA4C73CA7;
 Mon, 12 Dec 2016 02:11: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 5B9731B27;
 Mon, 12 Dec 2016 02:11: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 uBC2BWEW063563;
 Mon, 12 Dec 2016 02:11:32 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC2BUJM063541;
 Mon, 12 Dec 2016 02:11:30 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201612120211.uBC2BUJM063541@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 12 Dec 2016 02:11:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r309864 - vendor/libarchive/dist/tar/test
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 02:11:33 -0000

Author: ngie
Date: Mon Dec 12 02:11:30 2016
New Revision: 309864
URL: https://svnweb.freebsd.org/changeset/base/309864

Log:
  Merge PR to address tar/test coverity issues
  
  Obtained from:	libarchive (fd0ea220635939ffe4b9ffb5cacaaa526a25b5ae)

Modified:
  vendor/libarchive/dist/tar/test/main.c
  vendor/libarchive/dist/tar/test/test_leading_slash.c
  vendor/libarchive/dist/tar/test/test_option_a.c
  vendor/libarchive/dist/tar/test/test_option_b.c
  vendor/libarchive/dist/tar/test/test_option_b64encode.c
  vendor/libarchive/dist/tar/test/test_option_gid_gname.c
  vendor/libarchive/dist/tar/test/test_option_grzip.c
  vendor/libarchive/dist/tar/test/test_option_j.c
  vendor/libarchive/dist/tar/test/test_option_lrzip.c
  vendor/libarchive/dist/tar/test/test_option_lz4.c
  vendor/libarchive/dist/tar/test/test_option_lzma.c
  vendor/libarchive/dist/tar/test/test_option_lzop.c
  vendor/libarchive/dist/tar/test/test_option_r.c
  vendor/libarchive/dist/tar/test/test_option_uid_uname.c
  vendor/libarchive/dist/tar/test/test_option_uuencode.c
  vendor/libarchive/dist/tar/test/test_option_xz.c
  vendor/libarchive/dist/tar/test/test_option_z.c
  vendor/libarchive/dist/tar/test/test_stdio.c
  vendor/libarchive/dist/tar/test/test_version.c

Modified: vendor/libarchive/dist/tar/test/main.c
==============================================================================
--- vendor/libarchive/dist/tar/test/main.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/main.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -1060,7 +1060,7 @@ assertion_file_contains_lines_any_order(
 	char **expected = NULL;
 	char *p, **actual = NULL;
 	char c;
-	int expected_failure = 0, actual_failure = 0;
+	int expected_failure = 0, actual_failure = 0, retval = 0;
 
 	assertion_count(file, line);
 
@@ -1081,8 +1081,7 @@ assertion_file_contains_lines_any_order(
 		if (expected == NULL) {
 			failure_start(pathname, line, "Can't allocate memory");
 			failure_finish(NULL);
-			free(expected);
-			return (0);
+			goto done;
 		}
 		for (i = 0; lines[i] != NULL; ++i) {
 			expected[i] = strdup(lines[i]);
@@ -1103,8 +1102,7 @@ assertion_file_contains_lines_any_order(
 		if (actual == NULL) {
 			failure_start(pathname, line, "Can't allocate memory");
 			failure_finish(NULL);
-			free(expected);
-			return (0);
+			goto done;
 		}
 		for (j = 0, p = buff; p < buff + buff_size;
 		    p += 1 + strlen(p)) {
@@ -1141,27 +1139,27 @@ assertion_file_contains_lines_any_order(
 			++actual_failure;
 	}
 	if (expected_failure == 0 && actual_failure == 0) {
-		free(buff);
-		free(expected);
-		free(actual);
-		return (1);
+		retval = 1;
+		goto done;
 	}
 	failure_start(file, line, "File doesn't match: %s", pathname);
 	for (i = 0; i < expected_count; ++i) {
-		if (expected[i] != NULL) {
+		if (expected[i] != NULL)
 			logprintf("  Expected but not present: %s\n", expected[i]);
-			free(expected[i]);
-		}
 	}
 	for (j = 0; j < actual_count; ++j) {
 		if (actual[j] != NULL)
 			logprintf("  Present but not expected: %s\n", actual[j]);
 	}
 	failure_finish(NULL);
+done:
+	free(actual);
 	free(buff);
+	for (i = 0; i < expected_count; ++i)
+		free(expected[i]);
 	free(expected);
-	free(actual);
-	return (0);
+
+	return (retval);
 }
 
 /* Verify that a text file does not contains the specified strings */
@@ -1590,7 +1588,7 @@ is_symlink(const char *file, int line,
 	 * really not much point in bothering with this. */
 	return (0);
 #else
-	char buff[300];
+	char buff[301];
 	struct stat st;
 	ssize_t linklen;
 	int r;
@@ -1607,7 +1605,7 @@ is_symlink(const char *file, int line,
 		return (0);
 	if (contents == NULL)
 		return (1);
-	linklen = readlink(pathname, buff, sizeof(buff));
+	linklen = readlink(pathname, buff, sizeof(buff) - 1);
 	if (linklen < 0) {
 		failure_start(file, line, "Can't read symlink %s", pathname);
 		failure_finish(NULL);
@@ -2324,7 +2322,7 @@ extract_reference_file(const char *name)
 	for (;;) {
 		if (fgets(buff, sizeof(buff), in) == NULL) {
 			/* TODO: This is a failure. */
-			return;
+			goto done;
 		}
 		if (memcmp(buff, "begin ", 6) == 0)
 			break;
@@ -2365,6 +2363,7 @@ extract_reference_file(const char *name)
 		}
 	}
 	fclose(out);
+done:
 	fclose(in);
 }
 
@@ -2958,8 +2957,8 @@ main(int argc, char **argv)
 		strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp),
 		    "%Y-%m-%dT%H.%M.%S",
 		    localtime(&now));
-		sprintf(tmpdir, "%s/%s.%s-%03d", tmp, progname,
-		    tmpdir_timestamp, i);
+		snprintf(tmpdir, sizeof(tmpdir), "%s/%s.%s-%03d", tmp,
+		    progname, tmpdir_timestamp, i);
 		if (assertMakeDir(tmpdir,0755))
 			break;
 		if (i >= 999) {

Modified: vendor/libarchive/dist/tar/test/test_leading_slash.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_leading_slash.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_leading_slash.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -44,6 +44,7 @@ DEFINE_TEST(test_leading_slash)
 	if (assertFileExists("test.err")) {
 		errfile = slurpfile(&errfile_size, "test.err");
 		assert(strstr(errfile, expected_errmsg) != NULL);
+		free(errfile);
 	}
 }
 

Modified: vendor/libarchive/dist/tar/test/test_option_a.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_a.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_a.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -43,6 +43,7 @@ DEFINE_TEST(test_option_a)
 	assert(s > 2);
 	failure("The archive should be compressed");
 	assertEqualMem(p, "\x1f\x9d", 2);
+	free(p);
 
 	/* Test2: archive it with .taZ suffix. */
 	assertEqualInt(0,
@@ -53,6 +54,7 @@ DEFINE_TEST(test_option_a)
 	assert(s > 2);
 	failure("The archive should be compressed");
 	assertEqualMem(p, "\x1f\x9d", 2);
+	free(p);
 
 	/* Test3: archive it with .tar.Z.uu suffix. */
 	assertEqualInt(0,
@@ -63,6 +65,7 @@ DEFINE_TEST(test_option_a)
 	assert(s > 12);
 	failure("The archive should be uuencoded");
 	assertEqualMem(p, "begin 644 -\n", 12);
+	free(p);
 
 	/* Test4: archive it with .zip suffix. */
 	assertEqualInt(0,
@@ -73,6 +76,7 @@ DEFINE_TEST(test_option_a)
 	assert(s > 4);
 	failure("The archive should be zipped");
 	assertEqualMem(p, "\x50\x4b\x03\x04", 4);
+	free(p);
 
 	/* Test5: archive it with .tar.Z suffix and --uuencode option. */
 	assertEqualInt(0,
@@ -84,6 +88,7 @@ DEFINE_TEST(test_option_a)
 	assert(s > 2);
 	failure("The archive should be compressed, ignoring --uuencode option");
 	assertEqualMem(p, "\x1f\x9d", 2);
+	free(p);
 
 	/* Test6: archive it with .xxx suffix(unknown suffix) and
 	 * --uuencode option. */
@@ -96,6 +101,7 @@ DEFINE_TEST(test_option_a)
 	assert(s > 12);
 	failure("The archive should be uuencoded");
 	assertEqualMem(p, "begin 644 -\n", 12);
+	free(p);
 
 	/* Test7: archive it with .tar.Z suffix using a long-name option. */
 	assertEqualInt(0,
@@ -107,4 +113,5 @@ DEFINE_TEST(test_option_a)
 	assert(s > 2);
 	failure("The archive should be compressed");
 	assertEqualMem(p, "\x1f\x9d", 2);
+	free(p);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_b.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_b.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_b.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -78,4 +78,6 @@ DEFINE_TEST(test_option_b)
 	 * Note: It's not possible to verify at this level that blocks
 	 * are getting written with the
 	 */
+
+	free(testprog_ustar);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_b64encode.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_b64encode.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_b64encode.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -42,6 +42,7 @@ DEFINE_TEST(test_option_b64encode)
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "begin-base64 644", 16);
+	free(p);
 
 	/* Archive it with uuencode only. */
 	assertEqualInt(0,
@@ -51,4 +52,5 @@ DEFINE_TEST(test_option_b64encode)
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "begin-base64 644", 16);
+	free(p);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_gid_gname.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_gid_gname.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_gid_gname.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -53,6 +53,7 @@ DEFINE_TEST(test_option_gid_gname)
 	/* Should force gid and gname fields in ustar header. */
 	assertEqualMem(data + 116, "000021 \0", 8);
 	assertEqualMem(data + 297, "foofoofoo\0", 10);
+	free(data);
 
 	/* Again with just --gname */
 	failure("Error invoking %s c", testprog);
@@ -65,6 +66,8 @@ DEFINE_TEST(test_option_gid_gname)
 	/* Gid should be unchanged from original reference. */
 	assertEqualMem(data + 116, reference + 116, 8);
 	assertEqualMem(data + 297, "foofoofoo\0", 10);
+	free(data);
+	free(reference);
 
 	/* Again with --gid  and force gname to empty. */
 	failure("Error invoking %s c", testprog);
@@ -77,6 +80,7 @@ DEFINE_TEST(test_option_gid_gname)
 	assertEqualMem(data + 116, "000021 \0", 8);
 	/* Gname field in ustar header should be empty. */
 	assertEqualMem(data + 297, "\0", 1);
+	free(data);
 
 	/* TODO: It would be nice to verify that --gid= by itself
 	 * will look up the associated gname and use that, but

Modified: vendor/libarchive/dist/tar/test/test_option_grzip.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_grzip.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_grzip.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -45,8 +45,11 @@ DEFINE_TEST(test_option_grzip)
 	    testprog));
 	p = slurpfile(&s, "archive.err");
 	p[s] = '\0';
+	free(p);
+
 	/* Check that the archive file has an grzip signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "GRZipII\x00\x02\x04:)", 12);
+	free(p);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_j.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_j.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_j.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -42,15 +42,18 @@ DEFINE_TEST(test_option_j)
 	if (r != 0) {
 		if (!canBzip2()) {
 			skipping("bzip2 is not supported on this platform");
-			return;
+			goto done;
 		}
 		failure("-j option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	assertEmptyFile("archive.err");
 	/* Check that the archive file has a bzip2 signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "BZh9", 4);
+done:
+	free(p);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_lrzip.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_lrzip.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_lrzip.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -45,8 +45,10 @@ DEFINE_TEST(test_option_lrzip)
 	    testprog));
 	p = slurpfile(&s, "archive.err");
 	p[s] = '\0';
+	free(p);
 	/* Check that the archive file has an lzma signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "LRZI\x00", 5);
+	free(p);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_lz4.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_lz4.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_lz4.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -43,7 +43,7 @@ DEFINE_TEST(test_option_lz4)
 		if (strstr(p, "Unsupported compression") != NULL) {
 			skipping("This version of bsdtar was compiled "
 			    "without lz4 support");
-			return;
+			goto done;
 		}
 		/* POSIX permits different handling of the spawnp
 		 * system call used to launch the subsidiary
@@ -52,7 +52,7 @@ DEFINE_TEST(test_option_lz4)
 		if (strstr(p, "Can't launch") != NULL && !canLz4()) {
 			skipping("This version of bsdtar uses an external lz4 program "
 			    "but no such program is available on this system.");
-			return;
+			goto done;
 		}
 		/* Some systems successfully spawn the new process,
 		 * but fail to exec a program within that process.
@@ -61,14 +61,18 @@ DEFINE_TEST(test_option_lz4)
 		if (strstr(p, "Can't write") != NULL && !canLz4()) {
 			skipping("This version of bsdtar uses an external lz4 program "
 			    "but no such program is available on this system.");
-			return;
+			goto done;
 		}
 		failure("--lz4 option is broken: %s", p);
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has an lz4 signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "\x04\x22\x4d\x18", 4);
+
+done:
+	free(p);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_lzma.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_lzma.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_lzma.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -48,10 +48,13 @@ DEFINE_TEST(test_option_lzma)
 		}
 		failure("--lzma option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has an lzma signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "\x5d\00\00", 3);
+done:
+	free(p);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_lzop.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_lzop.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_lzop.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -42,14 +42,17 @@ DEFINE_TEST(test_option_lzop)
 	if (r != 0) {
 		if (!canLzop()) {
 			skipping("lzop is not supported on this platform");
-			return;
+			goto done;
 		}
 		failure("--lzop option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has an lzma signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9);
+done:
+	free(p);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_r.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_r.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_r.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -36,6 +36,10 @@ DEFINE_TEST(test_option_r)
 	size_t s, buff_size_rounded;
 	int r, i;
 
+	buff = NULL;
+	p0 = NULL;
+	p1 = NULL;
+
 	/* Create an archive with one file. */
 	assertMakeFile("f1", 0644, "abc");
 	r = systemf("%s cf archive.tar --format=ustar f1 >step1.out 2>step1.err", testprog);
@@ -47,11 +51,9 @@ DEFINE_TEST(test_option_r)
 	/* Do some basic validation of the constructed archive. */
 	p0 = slurpfile(&s, "archive.tar");
 	if (!assert(p0 != NULL))
-		return;
-	if (!assert(s >= 2048)) {
-		free(p0);
-		return;
-	}
+		goto done;
+	if (!assert(s >= 2048))
+		goto done;
 	assertEqualMem(p0 + 0, "f1", 3);
 	assertEqualMem(p0 + 512, "abc", 3);
 	assertEqualMem(p0 + 1024, "\0\0\0\0\0\0\0\0", 8);
@@ -60,10 +62,8 @@ DEFINE_TEST(test_option_r)
 	/* Edit that file with a lot more data and update the archive with a new copy. */
 	buff = malloc(buff_size);
 	assert(buff != NULL);
-	if (buff == NULL) {
-		free(p0);
-		return;
-	}
+	if (buff == NULL)
+		goto done;
 
 	for (i = 0; i < (int)buff_size; ++i)
 		buff[i] = "abcdefghijklmnopqrstuvwxyz"[rand() % 26];
@@ -77,10 +77,8 @@ DEFINE_TEST(test_option_r)
 
 	/* The constructed archive should just have the new entry appended. */
 	p1 = slurpfile(&s, "archive.tar");
-	if (!assert(p1 != NULL)) {
-		free(p0);
-		return;
-	}
+	if (!assert(p1 != NULL))
+		goto done;
 	buff_size_rounded = ((buff_size + 511) / 512) * 512;
 	assert(s >= 2560 + buff_size_rounded);
 	/* Verify first entry is unchanged. */
@@ -105,10 +103,8 @@ DEFINE_TEST(test_option_r)
 
 	/* Validate the constructed archive. */
 	p1 = slurpfile(&s, "archive.tar");
-	if (!assert(p1 != NULL)) {
-		free(p0);
-		return;
-	}
+	if (!assert(p1 != NULL))
+		goto done;
 	assert(s >= 3584 + buff_size_rounded);
 	/* Verify first two entries are unchanged. */
 	assertEqualMem(p0, p1, 1536 + buff_size_rounded);
@@ -118,7 +114,6 @@ DEFINE_TEST(test_option_r)
 	/* Verify end-of-archive marker. */
 	assertEqualMem(p1 + 2560 + buff_size_rounded, "\0\0\0\0\0\0\0\0", 8);
 	assertEqualMem(p1 + 3072 + buff_size_rounded, "\0\0\0\0\0\0\0\0", 8);
-	free(p0);
 	free(p1);
 
 	/* Unpack everything */
@@ -132,4 +127,7 @@ DEFINE_TEST(test_option_r)
 
 	/* Verify that the second copy of f1 overwrote the first. */
 	assertFileContents(buff, (int)strlen(buff), "f1");
+done:
+	free(buff);
+	free(p0);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_uid_uname.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_uid_uname.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_uid_uname.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -53,6 +53,7 @@ DEFINE_TEST(test_option_uid_uname)
 	/* Should force uid and uname fields in ustar header. */
 	assertEqualMem(data + 108, "000021 \0", 8);
 	assertEqualMem(data + 265, "foofoofoo\0", 10);
+	free(data);
 
 	/* Again with just --uid */
 	failure("Error invoking %s c", testprog);
@@ -65,6 +66,7 @@ DEFINE_TEST(test_option_uid_uname)
 	assertEqualMem(data + 108, "000021 \0", 8);
 	/* Uname field in ustar header should be empty. */
 	assertEqualMem(data + 265, "\0", 1);
+	free(data);
 
 	/* Again with just --uname */
 	failure("Error invoking %s c", testprog);
@@ -77,4 +79,7 @@ DEFINE_TEST(test_option_uid_uname)
 	/* Uid should be unchanged from original reference. */
 	assertEqualMem(data + 108, reference + 108, 8);
 	assertEqualMem(data + 265, "foofoofoo\0", 10);
+	free(data);
+
+	free(reference);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_uuencode.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_uuencode.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_uuencode.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -42,6 +42,7 @@ DEFINE_TEST(test_option_uuencode)
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "begin 644", 9);
+	free(p);
 
 	/* Archive it with uuencode only. */
 	assertEqualInt(0,
@@ -51,4 +52,5 @@ DEFINE_TEST(test_option_uuencode)
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "begin 644", 9);
+	free(p);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_xz.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_xz.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_xz.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -44,14 +44,17 @@ DEFINE_TEST(test_option_xz)
 		if (strstr(p, "Unsupported compression") != NULL) {
 			skipping("This version of bsdtar was compiled "
 			    "without xz support");
-			return;
+			goto done;
 		}
 		failure("--xz option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has an xz signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "\xFD\x37\x7A\x58\x5A\x00", 6);
+done:
+	free(p);
 }

Modified: vendor/libarchive/dist/tar/test/test_option_z.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_option_z.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_option_z.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -42,14 +42,17 @@ DEFINE_TEST(test_option_z)
 	if (r != 0) {
 		if (!canGzip()) {
 			skipping("gzip is not supported on this platform");
-			return;
+			goto done;
 		}
 		failure("-z option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has a gzip signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 4);
 	assertEqualMem(p, "\x1f\x8b\x08\x00", 4);
+done:
+	free(p);
 }

Modified: vendor/libarchive/dist/tar/test/test_stdio.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_stdio.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_stdio.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -116,6 +116,7 @@ DEFINE_TEST(test_stdio)
 	assertEqualInt((int)s, 3);
 	assertEqualMem(p, "abc", 3);
 	/* TODO: Verify xvf.err */
+	free(p);
 
 	/* 'xvf -' should generate list on stderr, empty stdout. */
 	r = systemf("%s xvf - < archive >xvf-.out 2>xvf-.err", testprog);

Modified: vendor/libarchive/dist/tar/test/test_version.c
==============================================================================
--- vendor/libarchive/dist/tar/test/test_version.c	Mon Dec 12 02:09:31 2016	(r309863)
+++ vendor/libarchive/dist/tar/test/test_version.c	Mon Dec 12 02:11:30 2016	(r309864)
@@ -53,7 +53,7 @@ DEFINE_TEST(test_version)
 	assert(s > 6);
 	failure("Version must start with 'bsdtar': ``%s''", p);
 	if (!assertEqualMem(q, "bsdtar ", 7))
-		return;
+		goto done;
 	q += 7; s -= 7;
 	/* Version number is a series of digits and periods. */
 	while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
@@ -98,5 +98,6 @@ DEFINE_TEST(test_version)
 	failure("Version output must end with \\n or \\r\\n");
 	if (*q == '\r') { ++q; --s; }
 	assertEqualMem(q, "\n", 1);
+done:
 	free(p);
 }

From owner-svn-src-all@freebsd.org  Mon Dec 12 02:12:52 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA6BEC73E47;
 Mon, 12 Dec 2016 02:12:52 +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 AB1C51EB9;
 Mon, 12 Dec 2016 02:12:52 +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 uBC2CpPf065739;
 Mon, 12 Dec 2016 02:12:51 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC2CpTL065735;
 Mon, 12 Dec 2016 02:12:51 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201612120212.uBC2CpTL065735@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 12 Dec 2016 02:12:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r309865 - vendor/libarchive/dist/libarchive/test
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 02:12:53 -0000

Author: ngie
Date: Mon Dec 12 02:12:51 2016
New Revision: 309865
URL: https://svnweb.freebsd.org/changeset/base/309865

Log:
  Merge PR to address libarchive/test coverity issues
  
  Obtained from:	libarchive (f9e3de49fb294901374e0c8c6c2ceaeea7b6d6c0)

Modified:
  vendor/libarchive/dist/libarchive/test/read_open_memory.c
  vendor/libarchive/dist/libarchive/test/test_fuzz.c
  vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c
  vendor/libarchive/dist/libarchive/test/test_read_set_format.c

Modified: vendor/libarchive/dist/libarchive/test/read_open_memory.c
==============================================================================
--- vendor/libarchive/dist/libarchive/test/read_open_memory.c	Mon Dec 12 02:11:30 2016	(r309864)
+++ vendor/libarchive/dist/libarchive/test/read_open_memory.c	Mon Dec 12 02:12:51 2016	(r309865)
@@ -86,21 +86,7 @@ static int
 read_open_memory_internal(struct archive *a, const void *buff,
     size_t size, size_t read_size, int level)
 {
-	struct read_memory_data *mine;
-
-	mine = (struct read_memory_data *)malloc(sizeof(*mine));
-	if (mine == NULL) {
-		archive_set_error(a, ENOMEM, "No memory");
-		return (ARCHIVE_FATAL);
-	}
-	memset(mine, 0, sizeof(*mine));
-	mine->start = mine->p = (const unsigned char *)buff;
-	mine->end = mine->start + size;
-	mine->read_size = read_size;
-	mine->copy_buff_offset = 32;
-	mine->copy_buff_size = read_size + mine->copy_buff_offset * 2;
-	mine->copy_buff = malloc(mine->copy_buff_size);
-	memset(mine->copy_buff, 0xA5, mine->copy_buff_size);
+	struct read_memory_data *mine = NULL;
 
 	switch (level) {
 	case 3:
@@ -109,6 +95,20 @@ read_open_memory_internal(struct archive
 		archive_read_set_open_callback(a, memory_read_open);
 		archive_read_set_skip_callback(a, memory_read_skip);
 	case 1:
+		mine = malloc(sizeof(*mine));
+		if (mine == NULL) {
+			archive_set_error(a, ENOMEM, "No memory");
+			return (ARCHIVE_FATAL);
+		}
+		memset(mine, 0, sizeof(*mine));
+		mine->start = mine->p = (const unsigned char *)buff;
+		mine->end = mine->start + size;
+		mine->read_size = read_size;
+		mine->copy_buff_offset = 32;
+		mine->copy_buff_size = read_size + mine->copy_buff_offset * 2;
+		mine->copy_buff = malloc(mine->copy_buff_size);
+		memset(mine->copy_buff, 0xA5, mine->copy_buff_size);
+
 		archive_read_set_read_callback(a, memory_read);
 		archive_read_set_close_callback(a, memory_read_close);
 		archive_read_set_callback_data(a, mine);
@@ -213,7 +213,8 @@ memory_read_close(struct archive *a, voi
 {
 	struct read_memory_data *mine = (struct read_memory_data *)client_data;
 	(void)a; /* UNUSED */
-	free(mine->copy_buff);
+	if (mine != NULL)
+		free(mine->copy_buff);
 	free(mine);
 	return (ARCHIVE_OK);
 }

Modified: vendor/libarchive/dist/libarchive/test/test_fuzz.c
==============================================================================
--- vendor/libarchive/dist/libarchive/test/test_fuzz.c	Mon Dec 12 02:11:30 2016	(r309864)
+++ vendor/libarchive/dist/libarchive/test/test_fuzz.c	Mon Dec 12 02:12:51 2016	(r309865)
@@ -104,16 +104,19 @@ test_fuzz(const struct files *filesets)
 			}
 			if (!assert(size < buffsize)) {
 				free(rawimage);
+				rawimage = NULL;
 				continue;
 			}
 		} else {
 			for (i = 0; filesets[n].names[i] != NULL; ++i)
 			{
 				tmp = slurpfile(&size, filesets[n].names[i]);
-				char *newraw = (char *)realloc(rawimage, oldsize + size);
+				char *newraw = realloc(rawimage, oldsize + size);
 				if (!assert(newraw != NULL))
 				{
 					free(rawimage);
+					rawimage = NULL;
+					free(tmp);
 					continue;
 				}
 				rawimage = newraw;
@@ -123,14 +126,21 @@ test_fuzz(const struct files *filesets)
 				free(tmp);
 			}
 		}
-		if (size == 0)
+		if (size == 0) {
+			free(rawimage);
+			rawimage = NULL;
 			continue;
+		}
 		image = malloc(size);
 		assert(image != NULL);
 		if (image == NULL) {
 			free(rawimage);
+			rawimage = NULL;
 			return;
 		}
+
+		assert(rawimage != NULL);
+
 		srand((unsigned)time(NULL));
 
 		for (i = 0; i < 1000; ++i) {
@@ -162,6 +172,7 @@ test_fuzz(const struct files *filesets)
 				Sleep(100);
 #endif
 			}
+			assert(f != NULL);
 			assertEqualInt((size_t)size, fwrite(image, 1, (size_t)size, f));
 			fclose(f);
 
@@ -195,7 +206,7 @@ test_fuzz(const struct files *filesets)
 				archive_read_close(a);
 			}
 			archive_read_free(a);
-}
+		}
 		free(image);
 		free(rawimage);
 	}

Modified: vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c
==============================================================================
--- vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c	Mon Dec 12 02:11:30 2016	(r309864)
+++ vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c	Mon Dec 12 02:12:51 2016	(r309865)
@@ -1327,6 +1327,7 @@ test_callbacks(void)
 	if (assert((m = archive_match_new()) != NULL)) {
 		archive_entry_free(ae);
 		archive_read_free(a);
+		archive_match_free(m);
 		return;
 	}
 

Modified: vendor/libarchive/dist/libarchive/test/test_read_set_format.c
==============================================================================
--- vendor/libarchive/dist/libarchive/test/test_read_set_format.c	Mon Dec 12 02:11:30 2016	(r309864)
+++ vendor/libarchive/dist/libarchive/test/test_read_set_format.c	Mon Dec 12 02:12:51 2016	(r309865)
@@ -219,8 +219,8 @@ DEFINE_TEST(test_read_append_filter_wron
   /* bunzip2 will write to stderr, redirect it to a file */
   fflush(stderr);
   fgetpos(stderr, &pos);
-  fd = dup(fileno(stderr));
-  fp = freopen("stderr1", "w", stderr); 
+  assert((fd = dup(fileno(stderr))) != -1);
+  fp = freopen("stderr1", "w", stderr);
 #endif
 
   assert((a = archive_read_new()) != NULL);
@@ -238,10 +238,10 @@ DEFINE_TEST(test_read_append_filter_wron
   if (fp != NULL) {
     fflush(stderr);
     dup2(fd, fileno(stderr));
-    close(fd);
     clearerr(stderr);
-    fsetpos(stderr, &pos);
+    (void)fsetpos(stderr, &pos);
   }
+  close(fd);
   assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1");
 #endif
 }

From owner-svn-src-all@freebsd.org  Mon Dec 12 02:13:37 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3BE8C73E9B;
 Mon, 12 Dec 2016 02:13:36 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A9DEA7B;
 Mon, 12 Dec 2016 02:13:36 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBC2DZAf065830;
 Mon, 12 Dec 2016 02:13:35 GMT (envelope-from delphij@FreeBSD.org)
Received: (from delphij@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC2DZVE065829;
 Mon, 12 Dec 2016 02:13:35 GMT (envelope-from delphij@FreeBSD.org)
Message-Id: <201612120213.uBC2DZVE065829@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: delphij set sender to
 delphij@FreeBSD.org using -f
From: Xin LI <delphij@FreeBSD.org>
Date: Mon, 12 Dec 2016 02:13:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309866 - stable/11/bin/kenv
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 02:13:37 -0000

Author: delphij
Date: Mon Dec 12 02:13:35 2016
New Revision: 309866
URL: https://svnweb.freebsd.org/changeset/base/309866

Log:
  MFC r309238,309239:
  
  r309238: Plug a potential memory leak.
  r309239: style(9).

Modified:
  stable/11/bin/kenv/kenv.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/kenv/kenv.c
==============================================================================
--- stable/11/bin/kenv/kenv.c	Mon Dec 12 02:12:51 2016	(r309865)
+++ stable/11/bin/kenv/kenv.c	Mon Dec 12 02:13:35 2016	(r309866)
@@ -63,7 +63,6 @@ main(int argc, char **argv)
 	char *env, *eq, *val;
 	int ch, error;
 
-	error = 0;
 	val = NULL;
 	env = NULL;
 	while ((ch = getopt(argc, argv, "hNquv")) != -1) {
@@ -128,7 +127,7 @@ main(int argc, char **argv)
 static int
 kdumpenv(void)
 {
-	char *buf, *cp;
+	char *buf, *bp, *cp;
 	int buflen, envlen;
 
 	envlen = kenv(KENV_DUMP, NULL, NULL, 0);
@@ -136,10 +135,9 @@ kdumpenv(void)
 		return (-1);
 	for (;;) {
 		buflen = envlen * 120 / 100;
-		buf = malloc(buflen + 1);
+		buf = calloc(1, buflen + 1);
 		if (buf == NULL)
 			return (-1);
-		memset(buf, 0, buflen + 1);	/* Be defensive */
 		envlen = kenv(KENV_DUMP, NULL, buf, buflen);
 		if (envlen < 0) {
 			free(buf);
@@ -151,21 +149,23 @@ kdumpenv(void)
 			break;
 	}
 
-	for (; *buf != '\0'; buf += strlen(buf) + 1) {
+	for (bp = buf; *bp != '\0'; bp += strlen(bp) + 1) {
 		if (hflag) {
-			if (strncmp(buf, "hint.", 5) != 0)
+			if (strncmp(bp, "hint.", 5) != 0)
 				continue;
 		}
-		cp = strchr(buf, '=');
+		cp = strchr(bp, '=');
 		if (cp == NULL)
 			continue;
 		*cp++ = '\0';
 		if (Nflag)
-			printf("%s\n", buf);
+			printf("%s\n", bp);
 		else
-			printf("%s=\"%s\"\n", buf, cp);
-		buf = cp;
+			printf("%s=\"%s\"\n", bp, cp);
+		bp = cp;
 	}
+
+	free(buf);
 	return (0);
 }
 
@@ -190,7 +190,7 @@ ksetenv(const char *env, char *val)
 {
 	int ret;
 
-	ret = kenv(KENV_SET, env, val, strlen(val)+1);
+	ret = kenv(KENV_SET, env, val, strlen(val) + 1);
 	if (ret == 0)
 		printf("%s=\"%s\"\n", env, val);
 	return (ret);
@@ -200,7 +200,7 @@ static int
 kunsetenv(const char *env)
 {
 	int ret;
-	
+
 	ret = kenv(KENV_UNSET, env, NULL, 0);
 	return (ret);
 }

From owner-svn-src-all@freebsd.org  Mon Dec 12 02:14:44 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E41EC73F02;
 Mon, 12 Dec 2016 02:14:44 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D7B041E0;
 Mon, 12 Dec 2016 02:14:43 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBC2EhUM065936;
 Mon, 12 Dec 2016 02:14:43 GMT (envelope-from delphij@FreeBSD.org)
Received: (from delphij@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC2EhjR065935;
 Mon, 12 Dec 2016 02:14:43 GMT (envelope-from delphij@FreeBSD.org)
Message-Id: <201612120214.uBC2EhjR065935@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: delphij set sender to
 delphij@FreeBSD.org using -f
From: Xin LI <delphij@FreeBSD.org>
Date: Mon, 12 Dec 2016 02:14:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309867 - stable/10/bin/kenv
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 02:14:44 -0000

Author: delphij
Date: Mon Dec 12 02:14:42 2016
New Revision: 309867
URL: https://svnweb.freebsd.org/changeset/base/309867

Log:
  MFC r309238,309239:
  
  r309238: Plug a potential memory leak.
  r309239: style(9).

Modified:
  stable/10/bin/kenv/kenv.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/bin/kenv/kenv.c
==============================================================================
--- stable/10/bin/kenv/kenv.c	Mon Dec 12 02:13:35 2016	(r309866)
+++ stable/10/bin/kenv/kenv.c	Mon Dec 12 02:14:42 2016	(r309867)
@@ -63,7 +63,6 @@ main(int argc, char **argv)
 	char *env, *eq, *val;
 	int ch, error;
 
-	error = 0;
 	val = NULL;
 	env = NULL;
 	while ((ch = getopt(argc, argv, "hNquv")) != -1) {
@@ -128,7 +127,7 @@ main(int argc, char **argv)
 static int
 kdumpenv(void)
 {
-	char *buf, *cp;
+	char *buf, *bp, *cp;
 	int buflen, envlen;
 
 	envlen = kenv(KENV_DUMP, NULL, NULL, 0);
@@ -136,10 +135,9 @@ kdumpenv(void)
 		return (-1);
 	for (;;) {
 		buflen = envlen * 120 / 100;
-		buf = malloc(buflen + 1);
+		buf = calloc(1, buflen + 1);
 		if (buf == NULL)
 			return (-1);
-		memset(buf, 0, buflen + 1);	/* Be defensive */
 		envlen = kenv(KENV_DUMP, NULL, buf, buflen);
 		if (envlen < 0) {
 			free(buf);
@@ -151,21 +149,23 @@ kdumpenv(void)
 			break;
 	}
 
-	for (; *buf != '\0'; buf += strlen(buf) + 1) {
+	for (bp = buf; *bp != '\0'; bp += strlen(bp) + 1) {
 		if (hflag) {
-			if (strncmp(buf, "hint.", 5) != 0)
+			if (strncmp(bp, "hint.", 5) != 0)
 				continue;
 		}
-		cp = strchr(buf, '=');
+		cp = strchr(bp, '=');
 		if (cp == NULL)
 			continue;
 		*cp++ = '\0';
 		if (Nflag)
-			printf("%s\n", buf);
+			printf("%s\n", bp);
 		else
-			printf("%s=\"%s\"\n", buf, cp);
-		buf = cp;
+			printf("%s=\"%s\"\n", bp, cp);
+		bp = cp;
 	}
+
+	free(buf);
 	return (0);
 }
 
@@ -190,7 +190,7 @@ ksetenv(const char *env, char *val)
 {
 	int ret;
 
-	ret = kenv(KENV_SET, env, val, strlen(val)+1);
+	ret = kenv(KENV_SET, env, val, strlen(val) + 1);
 	if (ret == 0)
 		printf("%s=\"%s\"\n", env, val);
 	return (ret);
@@ -200,7 +200,7 @@ static int
 kunsetenv(const char *env)
 {
 	int ret;
-	
+
 	ret = kenv(KENV_UNSET, env, NULL, 0);
 	return (ret);
 }

From owner-svn-src-all@freebsd.org  Mon Dec 12 02:20:21 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C45AC730F0;
 Mon, 12 Dec 2016 02:20:21 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5B77676E;
 Mon, 12 Dec 2016 02:20:21 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBC2KKAu066314;
 Mon, 12 Dec 2016 02:20:20 GMT (envelope-from delphij@FreeBSD.org)
Received: (from delphij@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC2KKAX066313;
 Mon, 12 Dec 2016 02:20:20 GMT (envelope-from delphij@FreeBSD.org)
Message-Id: <201612120220.uBC2KKAX066313@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: delphij set sender to
 delphij@FreeBSD.org using -f
From: Xin LI <delphij@FreeBSD.org>
Date: Mon, 12 Dec 2016 02:20:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309868 - stable/11/usr.sbin/ctld
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 02:20:21 -0000

Author: delphij
Date: Mon Dec 12 02:20:20 2016
New Revision: 309868
URL: https://svnweb.freebsd.org/changeset/base/309868

Log:
  MFC r309241,309243:
  
  Plug memory leaks.

Modified:
  stable/11/usr.sbin/ctld/ctld.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/ctld/ctld.c
==============================================================================
--- stable/11/usr.sbin/ctld/ctld.c	Mon Dec 12 02:14:42 2016	(r309867)
+++ stable/11/usr.sbin/ctld/ctld.c	Mon Dec 12 02:20:20 2016	(r309868)
@@ -401,6 +401,7 @@ auth_portal_new(struct auth_group *ag, c
 	return (ap);
 
 error:
+	free(str);
 	free(ap);
 	log_warnx("incorrect initiator portal \"%s\"", portal);
 	return (NULL);
@@ -675,8 +676,10 @@ parse_addr_port(char *arg, const char *d
 		 */
 		arg++;
 		addr = strsep(&arg, "]");
-		if (arg == NULL)
+		if (arg == NULL) {
+			free(str);
 			return (1);
+		}
 		if (arg[0] == '\0') {
 			port = def_port;
 		} else if (arg[0] == ':') {

From owner-svn-src-all@freebsd.org  Mon Dec 12 02:22:00 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 793B4C7324E;
 Mon, 12 Dec 2016 02:22: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 177B7AE7;
 Mon, 12 Dec 2016 02:22: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 uBC2LxbH067845;
 Mon, 12 Dec 2016 02:21:59 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC2Lu5V067817;
 Mon, 12 Dec 2016 02:21:56 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201612120221.uBC2Lu5V067817@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 12 Dec 2016 02:21:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309869 - in head/contrib/libarchive: cpio/test
 libarchive/test tar/test
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 02:22:00 -0000

Author: ngie
Date: Mon Dec 12 02:21:56 2016
New Revision: 309869
URL: https://svnweb.freebsd.org/changeset/base/309869

Log:
  Merge changes from vendor to address several Coverity issues with
  contrib/libarchive's tests
  
  MFC after:	2 weeks
  Obtained from:	libarchive (ebe29c, fd0ea2, f9e3de)
  Reported by:	Coverity

Modified:
  head/contrib/libarchive/cpio/test/test_option_J_upper.c
  head/contrib/libarchive/cpio/test/test_option_Z_upper.c
  head/contrib/libarchive/cpio/test/test_option_u.c
  head/contrib/libarchive/cpio/test/test_option_y.c
  head/contrib/libarchive/libarchive/test/read_open_memory.c
  head/contrib/libarchive/libarchive/test/test_fuzz.c
  head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c
  head/contrib/libarchive/libarchive/test/test_read_set_format.c
  head/contrib/libarchive/tar/test/main.c
  head/contrib/libarchive/tar/test/test_leading_slash.c
  head/contrib/libarchive/tar/test/test_option_a.c
  head/contrib/libarchive/tar/test/test_option_b.c
  head/contrib/libarchive/tar/test/test_option_b64encode.c
  head/contrib/libarchive/tar/test/test_option_gid_gname.c
  head/contrib/libarchive/tar/test/test_option_grzip.c
  head/contrib/libarchive/tar/test/test_option_j.c
  head/contrib/libarchive/tar/test/test_option_lrzip.c
  head/contrib/libarchive/tar/test/test_option_lz4.c
  head/contrib/libarchive/tar/test/test_option_lzma.c
  head/contrib/libarchive/tar/test/test_option_lzop.c
  head/contrib/libarchive/tar/test/test_option_r.c
  head/contrib/libarchive/tar/test/test_option_uid_uname.c
  head/contrib/libarchive/tar/test/test_option_uuencode.c
  head/contrib/libarchive/tar/test/test_option_xz.c
  head/contrib/libarchive/tar/test/test_option_z.c
  head/contrib/libarchive/tar/test/test_stdio.c
  head/contrib/libarchive/tar/test/test_version.c
Directory Properties:
  head/contrib/libarchive/   (props changed)

Modified: head/contrib/libarchive/cpio/test/test_option_J_upper.c
==============================================================================
--- head/contrib/libarchive/cpio/test/test_option_J_upper.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/cpio/test/test_option_J_upper.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -47,10 +47,13 @@ DEFINE_TEST(test_option_J_upper)
 		}
 		failure("-J option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has an xz signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "\3757zXZ", 5);
+done:
+	free(p);
 }

Modified: head/contrib/libarchive/cpio/test/test_option_Z_upper.c
==============================================================================
--- head/contrib/libarchive/cpio/test/test_option_Z_upper.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/cpio/test/test_option_Z_upper.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -47,10 +47,13 @@ DEFINE_TEST(test_option_Z_upper)
 		}
 		failure("-Z option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has a compress signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "\x1f\x9d", 2);
+done:
+	free(p);
 }

Modified: head/contrib/libarchive/cpio/test/test_option_u.c
==============================================================================
--- head/contrib/libarchive/cpio/test/test_option_u.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/cpio/test/test_option_u.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -49,6 +49,7 @@ DEFINE_TEST(test_option_u)
 	p = slurpfile(&s, "copy/f");
 	assertEqualInt(s, 1);
 	assertEqualMem(p, "a", 1);
+	free(p);
 
 	/* Recreate the file with a single "b" */
 	assertMakeFile("f", 0644, "b");
@@ -68,6 +69,7 @@ DEFINE_TEST(test_option_u)
 	p = slurpfile(&s, "copy/f");
 	assertEqualInt(s, 1);
 	assertEqualMem(p, "a", 1);
+	free(p);
 
 	/* Copy the file to the "copy" dir with -u (force) */
 	r = systemf("echo f| %s -pud copy >copy.out 2>copy.err",
@@ -78,4 +80,5 @@ DEFINE_TEST(test_option_u)
 	p = slurpfile(&s, "copy/f");
 	assertEqualInt(s, 1);
 	assertEqualMem(p, "b", 1);
+	free(p);
 }

Modified: head/contrib/libarchive/cpio/test/test_option_y.c
==============================================================================
--- head/contrib/libarchive/cpio/test/test_option_y.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/cpio/test/test_option_y.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -46,11 +46,14 @@ DEFINE_TEST(test_option_y)
 		}
 		failure("-y option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
 	assertTextFileContents("1 block\n", "archive.err");
 	/* Check that the archive file has a bzip2 signature. */
+	free(p);
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "BZh9", 4);
+done:
+	free(p);
 }

Modified: head/contrib/libarchive/libarchive/test/read_open_memory.c
==============================================================================
--- head/contrib/libarchive/libarchive/test/read_open_memory.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/libarchive/test/read_open_memory.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -86,21 +86,7 @@ static int
 read_open_memory_internal(struct archive *a, const void *buff,
     size_t size, size_t read_size, int level)
 {
-	struct read_memory_data *mine;
-
-	mine = (struct read_memory_data *)malloc(sizeof(*mine));
-	if (mine == NULL) {
-		archive_set_error(a, ENOMEM, "No memory");
-		return (ARCHIVE_FATAL);
-	}
-	memset(mine, 0, sizeof(*mine));
-	mine->start = mine->p = (const unsigned char *)buff;
-	mine->end = mine->start + size;
-	mine->read_size = read_size;
-	mine->copy_buff_offset = 32;
-	mine->copy_buff_size = read_size + mine->copy_buff_offset * 2;
-	mine->copy_buff = malloc(mine->copy_buff_size);
-	memset(mine->copy_buff, 0xA5, mine->copy_buff_size);
+	struct read_memory_data *mine = NULL;
 
 	switch (level) {
 	case 3:
@@ -109,6 +95,20 @@ read_open_memory_internal(struct archive
 		archive_read_set_open_callback(a, memory_read_open);
 		archive_read_set_skip_callback(a, memory_read_skip);
 	case 1:
+		mine = malloc(sizeof(*mine));
+		if (mine == NULL) {
+			archive_set_error(a, ENOMEM, "No memory");
+			return (ARCHIVE_FATAL);
+		}
+		memset(mine, 0, sizeof(*mine));
+		mine->start = mine->p = (const unsigned char *)buff;
+		mine->end = mine->start + size;
+		mine->read_size = read_size;
+		mine->copy_buff_offset = 32;
+		mine->copy_buff_size = read_size + mine->copy_buff_offset * 2;
+		mine->copy_buff = malloc(mine->copy_buff_size);
+		memset(mine->copy_buff, 0xA5, mine->copy_buff_size);
+
 		archive_read_set_read_callback(a, memory_read);
 		archive_read_set_close_callback(a, memory_read_close);
 		archive_read_set_callback_data(a, mine);
@@ -213,7 +213,8 @@ memory_read_close(struct archive *a, voi
 {
 	struct read_memory_data *mine = (struct read_memory_data *)client_data;
 	(void)a; /* UNUSED */
-	free(mine->copy_buff);
+	if (mine != NULL)
+		free(mine->copy_buff);
 	free(mine);
 	return (ARCHIVE_OK);
 }

Modified: head/contrib/libarchive/libarchive/test/test_fuzz.c
==============================================================================
--- head/contrib/libarchive/libarchive/test/test_fuzz.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/libarchive/test/test_fuzz.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -104,16 +104,19 @@ test_fuzz(const struct files *filesets)
 			}
 			if (!assert(size < buffsize)) {
 				free(rawimage);
+				rawimage = NULL;
 				continue;
 			}
 		} else {
 			for (i = 0; filesets[n].names[i] != NULL; ++i)
 			{
 				tmp = slurpfile(&size, filesets[n].names[i]);
-				char *newraw = (char *)realloc(rawimage, oldsize + size);
+				char *newraw = realloc(rawimage, oldsize + size);
 				if (!assert(newraw != NULL))
 				{
 					free(rawimage);
+					rawimage = NULL;
+					free(tmp);
 					continue;
 				}
 				rawimage = newraw;
@@ -123,14 +126,21 @@ test_fuzz(const struct files *filesets)
 				free(tmp);
 			}
 		}
-		if (size == 0)
+		if (size == 0) {
+			free(rawimage);
+			rawimage = NULL;
 			continue;
+		}
 		image = malloc(size);
 		assert(image != NULL);
 		if (image == NULL) {
 			free(rawimage);
+			rawimage = NULL;
 			return;
 		}
+
+		assert(rawimage != NULL);
+
 		srand((unsigned)time(NULL));
 
 		for (i = 0; i < 1000; ++i) {
@@ -162,6 +172,7 @@ test_fuzz(const struct files *filesets)
 				Sleep(100);
 #endif
 			}
+			assert(f != NULL);
 			assertEqualInt((size_t)size, fwrite(image, 1, (size_t)size, f));
 			fclose(f);
 
@@ -195,7 +206,7 @@ test_fuzz(const struct files *filesets)
 				archive_read_close(a);
 			}
 			archive_read_free(a);
-}
+		}
 		free(image);
 		free(rawimage);
 	}

Modified: head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c
==============================================================================
--- head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -1327,6 +1327,7 @@ test_callbacks(void)
 	if (assert((m = archive_match_new()) != NULL)) {
 		archive_entry_free(ae);
 		archive_read_free(a);
+		archive_match_free(m);
 		return;
 	}
 

Modified: head/contrib/libarchive/libarchive/test/test_read_set_format.c
==============================================================================
--- head/contrib/libarchive/libarchive/test/test_read_set_format.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/libarchive/test/test_read_set_format.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -219,8 +219,8 @@ DEFINE_TEST(test_read_append_filter_wron
   /* bunzip2 will write to stderr, redirect it to a file */
   fflush(stderr);
   fgetpos(stderr, &pos);
-  fd = dup(fileno(stderr));
-  fp = freopen("stderr1", "w", stderr); 
+  assert((fd = dup(fileno(stderr))) != -1);
+  fp = freopen("stderr1", "w", stderr);
 #endif
 
   assert((a = archive_read_new()) != NULL);
@@ -238,10 +238,10 @@ DEFINE_TEST(test_read_append_filter_wron
   if (fp != NULL) {
     fflush(stderr);
     dup2(fd, fileno(stderr));
-    close(fd);
     clearerr(stderr);
-    fsetpos(stderr, &pos);
+    (void)fsetpos(stderr, &pos);
   }
+  close(fd);
   assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1");
 #endif
 }

Modified: head/contrib/libarchive/tar/test/main.c
==============================================================================
--- head/contrib/libarchive/tar/test/main.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/main.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -1060,7 +1060,7 @@ assertion_file_contains_lines_any_order(
 	char **expected = NULL;
 	char *p, **actual = NULL;
 	char c;
-	int expected_failure = 0, actual_failure = 0;
+	int expected_failure = 0, actual_failure = 0, retval = 0;
 
 	assertion_count(file, line);
 
@@ -1081,8 +1081,7 @@ assertion_file_contains_lines_any_order(
 		if (expected == NULL) {
 			failure_start(pathname, line, "Can't allocate memory");
 			failure_finish(NULL);
-			free(expected);
-			return (0);
+			goto done;
 		}
 		for (i = 0; lines[i] != NULL; ++i) {
 			expected[i] = strdup(lines[i]);
@@ -1103,8 +1102,7 @@ assertion_file_contains_lines_any_order(
 		if (actual == NULL) {
 			failure_start(pathname, line, "Can't allocate memory");
 			failure_finish(NULL);
-			free(expected);
-			return (0);
+			goto done;
 		}
 		for (j = 0, p = buff; p < buff + buff_size;
 		    p += 1 + strlen(p)) {
@@ -1141,27 +1139,27 @@ assertion_file_contains_lines_any_order(
 			++actual_failure;
 	}
 	if (expected_failure == 0 && actual_failure == 0) {
-		free(buff);
-		free(expected);
-		free(actual);
-		return (1);
+		retval = 1;
+		goto done;
 	}
 	failure_start(file, line, "File doesn't match: %s", pathname);
 	for (i = 0; i < expected_count; ++i) {
-		if (expected[i] != NULL) {
+		if (expected[i] != NULL)
 			logprintf("  Expected but not present: %s\n", expected[i]);
-			free(expected[i]);
-		}
 	}
 	for (j = 0; j < actual_count; ++j) {
 		if (actual[j] != NULL)
 			logprintf("  Present but not expected: %s\n", actual[j]);
 	}
 	failure_finish(NULL);
+done:
+	free(actual);
 	free(buff);
+	for (i = 0; i < expected_count; ++i)
+		free(expected[i]);
 	free(expected);
-	free(actual);
-	return (0);
+
+	return (retval);
 }
 
 /* Verify that a text file does not contains the specified strings */
@@ -1590,7 +1588,7 @@ is_symlink(const char *file, int line,
 	 * really not much point in bothering with this. */
 	return (0);
 #else
-	char buff[300];
+	char buff[301];
 	struct stat st;
 	ssize_t linklen;
 	int r;
@@ -1607,7 +1605,7 @@ is_symlink(const char *file, int line,
 		return (0);
 	if (contents == NULL)
 		return (1);
-	linklen = readlink(pathname, buff, sizeof(buff));
+	linklen = readlink(pathname, buff, sizeof(buff) - 1);
 	if (linklen < 0) {
 		failure_start(file, line, "Can't read symlink %s", pathname);
 		failure_finish(NULL);
@@ -2324,7 +2322,7 @@ extract_reference_file(const char *name)
 	for (;;) {
 		if (fgets(buff, sizeof(buff), in) == NULL) {
 			/* TODO: This is a failure. */
-			return;
+			goto done;
 		}
 		if (memcmp(buff, "begin ", 6) == 0)
 			break;
@@ -2365,6 +2363,7 @@ extract_reference_file(const char *name)
 		}
 	}
 	fclose(out);
+done:
 	fclose(in);
 }
 
@@ -2958,8 +2957,8 @@ main(int argc, char **argv)
 		strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp),
 		    "%Y-%m-%dT%H.%M.%S",
 		    localtime(&now));
-		sprintf(tmpdir, "%s/%s.%s-%03d", tmp, progname,
-		    tmpdir_timestamp, i);
+		snprintf(tmpdir, sizeof(tmpdir), "%s/%s.%s-%03d", tmp,
+		    progname, tmpdir_timestamp, i);
 		if (assertMakeDir(tmpdir,0755))
 			break;
 		if (i >= 999) {

Modified: head/contrib/libarchive/tar/test/test_leading_slash.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_leading_slash.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_leading_slash.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -44,6 +44,7 @@ DEFINE_TEST(test_leading_slash)
 	if (assertFileExists("test.err")) {
 		errfile = slurpfile(&errfile_size, "test.err");
 		assert(strstr(errfile, expected_errmsg) != NULL);
+		free(errfile);
 	}
 }
 

Modified: head/contrib/libarchive/tar/test/test_option_a.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_a.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_a.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -43,6 +43,7 @@ DEFINE_TEST(test_option_a)
 	assert(s > 2);
 	failure("The archive should be compressed");
 	assertEqualMem(p, "\x1f\x9d", 2);
+	free(p);
 
 	/* Test2: archive it with .taZ suffix. */
 	assertEqualInt(0,
@@ -53,6 +54,7 @@ DEFINE_TEST(test_option_a)
 	assert(s > 2);
 	failure("The archive should be compressed");
 	assertEqualMem(p, "\x1f\x9d", 2);
+	free(p);
 
 	/* Test3: archive it with .tar.Z.uu suffix. */
 	assertEqualInt(0,
@@ -63,6 +65,7 @@ DEFINE_TEST(test_option_a)
 	assert(s > 12);
 	failure("The archive should be uuencoded");
 	assertEqualMem(p, "begin 644 -\n", 12);
+	free(p);
 
 	/* Test4: archive it with .zip suffix. */
 	assertEqualInt(0,
@@ -73,6 +76,7 @@ DEFINE_TEST(test_option_a)
 	assert(s > 4);
 	failure("The archive should be zipped");
 	assertEqualMem(p, "\x50\x4b\x03\x04", 4);
+	free(p);
 
 	/* Test5: archive it with .tar.Z suffix and --uuencode option. */
 	assertEqualInt(0,
@@ -84,6 +88,7 @@ DEFINE_TEST(test_option_a)
 	assert(s > 2);
 	failure("The archive should be compressed, ignoring --uuencode option");
 	assertEqualMem(p, "\x1f\x9d", 2);
+	free(p);
 
 	/* Test6: archive it with .xxx suffix(unknown suffix) and
 	 * --uuencode option. */
@@ -96,6 +101,7 @@ DEFINE_TEST(test_option_a)
 	assert(s > 12);
 	failure("The archive should be uuencoded");
 	assertEqualMem(p, "begin 644 -\n", 12);
+	free(p);
 
 	/* Test7: archive it with .tar.Z suffix using a long-name option. */
 	assertEqualInt(0,
@@ -107,4 +113,5 @@ DEFINE_TEST(test_option_a)
 	assert(s > 2);
 	failure("The archive should be compressed");
 	assertEqualMem(p, "\x1f\x9d", 2);
+	free(p);
 }

Modified: head/contrib/libarchive/tar/test/test_option_b.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_b.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_b.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -78,4 +78,6 @@ DEFINE_TEST(test_option_b)
 	 * Note: It's not possible to verify at this level that blocks
 	 * are getting written with the
 	 */
+
+	free(testprog_ustar);
 }

Modified: head/contrib/libarchive/tar/test/test_option_b64encode.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_b64encode.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_b64encode.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -42,6 +42,7 @@ DEFINE_TEST(test_option_b64encode)
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "begin-base64 644", 16);
+	free(p);
 
 	/* Archive it with uuencode only. */
 	assertEqualInt(0,
@@ -51,4 +52,5 @@ DEFINE_TEST(test_option_b64encode)
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "begin-base64 644", 16);
+	free(p);
 }

Modified: head/contrib/libarchive/tar/test/test_option_gid_gname.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_gid_gname.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_gid_gname.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -53,6 +53,7 @@ DEFINE_TEST(test_option_gid_gname)
 	/* Should force gid and gname fields in ustar header. */
 	assertEqualMem(data + 116, "000021 \0", 8);
 	assertEqualMem(data + 297, "foofoofoo\0", 10);
+	free(data);
 
 	/* Again with just --gname */
 	failure("Error invoking %s c", testprog);
@@ -65,6 +66,8 @@ DEFINE_TEST(test_option_gid_gname)
 	/* Gid should be unchanged from original reference. */
 	assertEqualMem(data + 116, reference + 116, 8);
 	assertEqualMem(data + 297, "foofoofoo\0", 10);
+	free(data);
+	free(reference);
 
 	/* Again with --gid  and force gname to empty. */
 	failure("Error invoking %s c", testprog);
@@ -77,6 +80,7 @@ DEFINE_TEST(test_option_gid_gname)
 	assertEqualMem(data + 116, "000021 \0", 8);
 	/* Gname field in ustar header should be empty. */
 	assertEqualMem(data + 297, "\0", 1);
+	free(data);
 
 	/* TODO: It would be nice to verify that --gid= by itself
 	 * will look up the associated gname and use that, but

Modified: head/contrib/libarchive/tar/test/test_option_grzip.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_grzip.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_grzip.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -45,8 +45,11 @@ DEFINE_TEST(test_option_grzip)
 	    testprog));
 	p = slurpfile(&s, "archive.err");
 	p[s] = '\0';
+	free(p);
+
 	/* Check that the archive file has an grzip signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "GRZipII\x00\x02\x04:)", 12);
+	free(p);
 }

Modified: head/contrib/libarchive/tar/test/test_option_j.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_j.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_j.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -42,15 +42,18 @@ DEFINE_TEST(test_option_j)
 	if (r != 0) {
 		if (!canBzip2()) {
 			skipping("bzip2 is not supported on this platform");
-			return;
+			goto done;
 		}
 		failure("-j option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	assertEmptyFile("archive.err");
 	/* Check that the archive file has a bzip2 signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "BZh9", 4);
+done:
+	free(p);
 }

Modified: head/contrib/libarchive/tar/test/test_option_lrzip.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_lrzip.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_lrzip.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -45,8 +45,10 @@ DEFINE_TEST(test_option_lrzip)
 	    testprog));
 	p = slurpfile(&s, "archive.err");
 	p[s] = '\0';
+	free(p);
 	/* Check that the archive file has an lzma signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "LRZI\x00", 5);
+	free(p);
 }

Modified: head/contrib/libarchive/tar/test/test_option_lz4.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_lz4.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_lz4.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -43,7 +43,7 @@ DEFINE_TEST(test_option_lz4)
 		if (strstr(p, "Unsupported compression") != NULL) {
 			skipping("This version of bsdtar was compiled "
 			    "without lz4 support");
-			return;
+			goto done;
 		}
 		/* POSIX permits different handling of the spawnp
 		 * system call used to launch the subsidiary
@@ -52,7 +52,7 @@ DEFINE_TEST(test_option_lz4)
 		if (strstr(p, "Can't launch") != NULL && !canLz4()) {
 			skipping("This version of bsdtar uses an external lz4 program "
 			    "but no such program is available on this system.");
-			return;
+			goto done;
 		}
 		/* Some systems successfully spawn the new process,
 		 * but fail to exec a program within that process.
@@ -61,14 +61,18 @@ DEFINE_TEST(test_option_lz4)
 		if (strstr(p, "Can't write") != NULL && !canLz4()) {
 			skipping("This version of bsdtar uses an external lz4 program "
 			    "but no such program is available on this system.");
-			return;
+			goto done;
 		}
 		failure("--lz4 option is broken: %s", p);
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has an lz4 signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "\x04\x22\x4d\x18", 4);
+
+done:
+	free(p);
 }

Modified: head/contrib/libarchive/tar/test/test_option_lzma.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_lzma.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_lzma.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -48,10 +48,13 @@ DEFINE_TEST(test_option_lzma)
 		}
 		failure("--lzma option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has an lzma signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "\x5d\00\00", 3);
+done:
+	free(p);
 }

Modified: head/contrib/libarchive/tar/test/test_option_lzop.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_lzop.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_lzop.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -42,14 +42,17 @@ DEFINE_TEST(test_option_lzop)
 	if (r != 0) {
 		if (!canLzop()) {
 			skipping("lzop is not supported on this platform");
-			return;
+			goto done;
 		}
 		failure("--lzop option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has an lzma signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9);
+done:
+	free(p);
 }

Modified: head/contrib/libarchive/tar/test/test_option_r.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_r.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_r.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -36,6 +36,10 @@ DEFINE_TEST(test_option_r)
 	size_t s, buff_size_rounded;
 	int r, i;
 
+	buff = NULL;
+	p0 = NULL;
+	p1 = NULL;
+
 	/* Create an archive with one file. */
 	assertMakeFile("f1", 0644, "abc");
 	r = systemf("%s cf archive.tar --format=ustar f1 >step1.out 2>step1.err", testprog);
@@ -47,11 +51,9 @@ DEFINE_TEST(test_option_r)
 	/* Do some basic validation of the constructed archive. */
 	p0 = slurpfile(&s, "archive.tar");
 	if (!assert(p0 != NULL))
-		return;
-	if (!assert(s >= 2048)) {
-		free(p0);
-		return;
-	}
+		goto done;
+	if (!assert(s >= 2048))
+		goto done;
 	assertEqualMem(p0 + 0, "f1", 3);
 	assertEqualMem(p0 + 512, "abc", 3);
 	assertEqualMem(p0 + 1024, "\0\0\0\0\0\0\0\0", 8);
@@ -60,10 +62,8 @@ DEFINE_TEST(test_option_r)
 	/* Edit that file with a lot more data and update the archive with a new copy. */
 	buff = malloc(buff_size);
 	assert(buff != NULL);
-	if (buff == NULL) {
-		free(p0);
-		return;
-	}
+	if (buff == NULL)
+		goto done;
 
 	for (i = 0; i < (int)buff_size; ++i)
 		buff[i] = "abcdefghijklmnopqrstuvwxyz"[rand() % 26];
@@ -77,10 +77,8 @@ DEFINE_TEST(test_option_r)
 
 	/* The constructed archive should just have the new entry appended. */
 	p1 = slurpfile(&s, "archive.tar");
-	if (!assert(p1 != NULL)) {
-		free(p0);
-		return;
-	}
+	if (!assert(p1 != NULL))
+		goto done;
 	buff_size_rounded = ((buff_size + 511) / 512) * 512;
 	assert(s >= 2560 + buff_size_rounded);
 	/* Verify first entry is unchanged. */
@@ -105,10 +103,8 @@ DEFINE_TEST(test_option_r)
 
 	/* Validate the constructed archive. */
 	p1 = slurpfile(&s, "archive.tar");
-	if (!assert(p1 != NULL)) {
-		free(p0);
-		return;
-	}
+	if (!assert(p1 != NULL))
+		goto done;
 	assert(s >= 3584 + buff_size_rounded);
 	/* Verify first two entries are unchanged. */
 	assertEqualMem(p0, p1, 1536 + buff_size_rounded);
@@ -118,7 +114,6 @@ DEFINE_TEST(test_option_r)
 	/* Verify end-of-archive marker. */
 	assertEqualMem(p1 + 2560 + buff_size_rounded, "\0\0\0\0\0\0\0\0", 8);
 	assertEqualMem(p1 + 3072 + buff_size_rounded, "\0\0\0\0\0\0\0\0", 8);
-	free(p0);
 	free(p1);
 
 	/* Unpack everything */
@@ -132,4 +127,7 @@ DEFINE_TEST(test_option_r)
 
 	/* Verify that the second copy of f1 overwrote the first. */
 	assertFileContents(buff, (int)strlen(buff), "f1");
+done:
+	free(buff);
+	free(p0);
 }

Modified: head/contrib/libarchive/tar/test/test_option_uid_uname.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_uid_uname.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_uid_uname.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -53,6 +53,7 @@ DEFINE_TEST(test_option_uid_uname)
 	/* Should force uid and uname fields in ustar header. */
 	assertEqualMem(data + 108, "000021 \0", 8);
 	assertEqualMem(data + 265, "foofoofoo\0", 10);
+	free(data);
 
 	/* Again with just --uid */
 	failure("Error invoking %s c", testprog);
@@ -65,6 +66,7 @@ DEFINE_TEST(test_option_uid_uname)
 	assertEqualMem(data + 108, "000021 \0", 8);
 	/* Uname field in ustar header should be empty. */
 	assertEqualMem(data + 265, "\0", 1);
+	free(data);
 
 	/* Again with just --uname */
 	failure("Error invoking %s c", testprog);
@@ -77,4 +79,7 @@ DEFINE_TEST(test_option_uid_uname)
 	/* Uid should be unchanged from original reference. */
 	assertEqualMem(data + 108, reference + 108, 8);
 	assertEqualMem(data + 265, "foofoofoo\0", 10);
+	free(data);
+
+	free(reference);
 }

Modified: head/contrib/libarchive/tar/test/test_option_uuencode.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_uuencode.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_uuencode.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -42,6 +42,7 @@ DEFINE_TEST(test_option_uuencode)
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "begin 644", 9);
+	free(p);
 
 	/* Archive it with uuencode only. */
 	assertEqualInt(0,
@@ -51,4 +52,5 @@ DEFINE_TEST(test_option_uuencode)
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "begin 644", 9);
+	free(p);
 }

Modified: head/contrib/libarchive/tar/test/test_option_xz.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_xz.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_xz.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -44,14 +44,17 @@ DEFINE_TEST(test_option_xz)
 		if (strstr(p, "Unsupported compression") != NULL) {
 			skipping("This version of bsdtar was compiled "
 			    "without xz support");
-			return;
+			goto done;
 		}
 		failure("--xz option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has an xz signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 2);
 	assertEqualMem(p, "\xFD\x37\x7A\x58\x5A\x00", 6);
+done:
+	free(p);
 }

Modified: head/contrib/libarchive/tar/test/test_option_z.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_option_z.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_option_z.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -42,14 +42,17 @@ DEFINE_TEST(test_option_z)
 	if (r != 0) {
 		if (!canGzip()) {
 			skipping("gzip is not supported on this platform");
-			return;
+			goto done;
 		}
 		failure("-z option is broken");
 		assertEqualInt(r, 0);
-		return;
+		goto done;
 	}
+	free(p);
 	/* Check that the archive file has a gzip signature. */
 	p = slurpfile(&s, "archive.out");
 	assert(s > 4);
 	assertEqualMem(p, "\x1f\x8b\x08\x00", 4);
+done:
+	free(p);
 }

Modified: head/contrib/libarchive/tar/test/test_stdio.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_stdio.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_stdio.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -116,6 +116,7 @@ DEFINE_TEST(test_stdio)
 	assertEqualInt((int)s, 3);
 	assertEqualMem(p, "abc", 3);
 	/* TODO: Verify xvf.err */
+	free(p);
 
 	/* 'xvf -' should generate list on stderr, empty stdout. */
 	r = systemf("%s xvf - < archive >xvf-.out 2>xvf-.err", testprog);

Modified: head/contrib/libarchive/tar/test/test_version.c
==============================================================================
--- head/contrib/libarchive/tar/test/test_version.c	Mon Dec 12 02:20:20 2016	(r309868)
+++ head/contrib/libarchive/tar/test/test_version.c	Mon Dec 12 02:21:56 2016	(r309869)
@@ -53,7 +53,7 @@ DEFINE_TEST(test_version)
 	assert(s > 6);
 	failure("Version must start with 'bsdtar': ``%s''", p);
 	if (!assertEqualMem(q, "bsdtar ", 7))
-		return;
+		goto done;
 	q += 7; s -= 7;
 	/* Version number is a series of digits and periods. */
 	while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
@@ -98,5 +98,6 @@ DEFINE_TEST(test_version)
 	failure("Version output must end with \\n or \\r\\n");
 	if (*q == '\r') { ++q; --s; }
 	assertEqualMem(q, "\n", 1);
+done:
 	free(p);
 }

From owner-svn-src-all@freebsd.org  Mon Dec 12 02:22:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A08A4C732A1;
 Mon, 12 Dec 2016 02:22:50 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6FC45CB3;
 Mon, 12 Dec 2016 02:22:50 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBC2Mn4j070020;
 Mon, 12 Dec 2016 02:22:49 GMT (envelope-from delphij@FreeBSD.org)
Received: (from delphij@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC2MnBv070019;
 Mon, 12 Dec 2016 02:22:49 GMT (envelope-from delphij@FreeBSD.org)
Message-Id: <201612120222.uBC2MnBv070019@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: delphij set sender to
 delphij@FreeBSD.org using -f
From: Xin LI <delphij@FreeBSD.org>
Date: Mon, 12 Dec 2016 02:22:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309870 - stable/10/usr.sbin/ctld
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 02:22:50 -0000

Author: delphij
Date: Mon Dec 12 02:22:49 2016
New Revision: 309870
URL: https://svnweb.freebsd.org/changeset/base/309870

Log:
  MFC r309241,309243:
  
  Plug memory leaks.

Modified:
  stable/10/usr.sbin/ctld/ctld.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/ctld/ctld.c
==============================================================================
--- stable/10/usr.sbin/ctld/ctld.c	Mon Dec 12 02:21:56 2016	(r309869)
+++ stable/10/usr.sbin/ctld/ctld.c	Mon Dec 12 02:22:49 2016	(r309870)
@@ -400,6 +400,7 @@ auth_portal_new(struct auth_group *ag, c
 	return (ap);
 
 error:
+	free(str);
 	free(ap);
 	log_errx(1, "Incorrect initiator portal '%s'", portal);
 	return (NULL);
@@ -673,8 +674,10 @@ parse_addr_port(char *arg, const char *d
 		 */
 		arg++;
 		addr = strsep(&arg, "]");
-		if (arg == NULL)
+		if (arg == NULL) {
+			free(str);
 			return (1);
+		}
 		if (arg[0] == '\0') {
 			port = def_port;
 		} else if (arg[0] == ':') {

From owner-svn-src-all@freebsd.org  Mon Dec 12 02:24:47 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4573C73332;
 Mon, 12 Dec 2016 02:24:47 +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 73AACE3B;
 Mon, 12 Dec 2016 02:24:47 +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 uBC2OkVJ070152;
 Mon, 12 Dec 2016 02:24:46 GMT (envelope-from markj@FreeBSD.org)
Received: (from markj@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC2Ok4x070151;
 Mon, 12 Dec 2016 02:24:46 GMT (envelope-from markj@FreeBSD.org)
Message-Id: <201612120224.uBC2Ok4x070151@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: markj set sender to
 markj@FreeBSD.org using -f
From: Mark Johnston <markj@FreeBSD.org>
Date: Mon, 12 Dec 2016 02:24:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309871 - stable/10/sys/kern
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 02:24:47 -0000

Author: markj
Date: Mon Dec 12 02:24:46 2016
New Revision: 309871
URL: https://svnweb.freebsd.org/changeset/base/309871

Log:
  MFC r308350:
  Fix WITNESS hints for pagequeue locks.

Modified:
  stable/10/sys/kern/subr_witness.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/subr_witness.c
==============================================================================
--- stable/10/sys/kern/subr_witness.c	Mon Dec 12 02:22:49 2016	(r309870)
+++ stable/10/sys/kern/subr_witness.c	Mon Dec 12 02:24:46 2016	(r309871)
@@ -592,7 +592,7 @@ static struct witness_order_list_entry o
 	 * CDEV
 	 */
 	{ "vm map (system)", &lock_class_mtx_sleep },
-	{ "vm page queue", &lock_class_mtx_sleep },
+	{ "vm pagequeue", &lock_class_mtx_sleep },
 	{ "vnode interlock", &lock_class_mtx_sleep },
 	{ "cdev", &lock_class_mtx_sleep },
 	{ NULL, NULL },
@@ -602,7 +602,7 @@ static struct witness_order_list_entry o
 	{ "vm map (user)", &lock_class_sx },
 	{ "vm object", &lock_class_rw },
 	{ "vm page", &lock_class_mtx_sleep },
-	{ "vm page queue", &lock_class_mtx_sleep },
+	{ "vm pagequeue", &lock_class_mtx_sleep },
 	{ "pmap pv global", &lock_class_rw },
 	{ "pmap", &lock_class_mtx_sleep },
 	{ "pmap pv list", &lock_class_rw },

From owner-svn-src-all@freebsd.org  Mon Dec 12 02:24:55 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8C9FC7336D;
 Mon, 12 Dec 2016 02:24:55 +0000 (UTC)
 (envelope-from araujo@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 75AFBE87;
 Mon, 12 Dec 2016 02:24:55 +0000 (UTC)
 (envelope-from araujo@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBC2OsE4070206;
 Mon, 12 Dec 2016 02:24:54 GMT (envelope-from araujo@FreeBSD.org)
Received: (from araujo@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC2OsSC070200;
 Mon, 12 Dec 2016 02:24:54 GMT (envelope-from araujo@FreeBSD.org)
Message-Id: <201612120224.uBC2OsSC070200@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: araujo set sender to
 araujo@FreeBSD.org using -f
From: Marcelo Araujo <araujo@FreeBSD.org>
Date: Mon, 12 Dec 2016 02:24:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309872 - stable/11/usr.sbin/ypldap
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 02:24:55 -0000

Author: araujo
Date: Mon Dec 12 02:24:54 2016
New Revision: 309872
URL: https://svnweb.freebsd.org/changeset/base/309872

Log:
  MFC r309392, r309393
  
  r309392:
  String terminators are called NUL, not NULL, also the variable
  mentioned in the comment is p and not u.
  
  Obtained from:	OpenBSD (r1.34)
  
  r309393:
  Use memset(3) instead of bzero(3).
  
  Obtained from:	OpenBSD (r1.12, r1.20, r1.18 and r1.37)

Modified:
  stable/11/usr.sbin/ypldap/aldap.c
  stable/11/usr.sbin/ypldap/ldapclient.c
  stable/11/usr.sbin/ypldap/yp.c
  stable/11/usr.sbin/ypldap/ypldap.c
  stable/11/usr.sbin/ypldap/ypldap_dns.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/ypldap/aldap.c
==============================================================================
--- stable/11/usr.sbin/ypldap/aldap.c	Mon Dec 12 02:24:46 2016	(r309871)
+++ stable/11/usr.sbin/ypldap/aldap.c	Mon Dec 12 02:24:54 2016	(r309872)
@@ -1206,7 +1206,7 @@ isu8cont(unsigned char c)
 /*
  * Parse a LDAP value
  * notes:
- *	the argument u should be a NULL terminated sequence of ASCII bytes.
+ *	the argument p should be a NUL-terminated sequence of ASCII bytes.
  */
 char *
 parseval(char *p, size_t len)

Modified: stable/11/usr.sbin/ypldap/ldapclient.c
==============================================================================
--- stable/11/usr.sbin/ypldap/ldapclient.c	Mon Dec 12 02:24:46 2016	(r309871)
+++ stable/11/usr.sbin/ypldap/ldapclient.c	Mon Dec 12 02:24:54 2016	(r309872)
@@ -363,7 +363,7 @@ ldapclient(int pipe_main2client[2])
 		return (pid);
 	}
 
-	bzero(&env, sizeof(env));
+	memset(&env, 0, sizeof(env));
 	TAILQ_INIT(&env.sc_idms);
 
 	if ((pw = getpwnam(YPLDAP_USER)) == NULL)
@@ -437,7 +437,7 @@ client_build_req(struct idm *idm, struct
 	char	**ldap_attrs;
 	int	 i, k;
 
-	bzero(ir, sizeof(*ir));
+	memset(ir, 0, sizeof(*ir));
 	for (i = min_attr; i < max_attr; i++) {
 		if (idm->idm_flags & F_FIXED_ATTR(i)) {
 			if (strlcat(ir->ir_line, idm->idm_attrs[i],
@@ -594,7 +594,7 @@ client_try_idm(struct env *env, struct i
 		aldap_freemsg(m);
 	}
 
-	bzero(attrs, sizeof(attrs));
+	memset(attrs, 0, sizeof(attrs));
 	for (i = 0, j = 0; i < ATTR_MAX; i++) {
 		if (idm->idm_flags & F_FIXED_ATTR(i))
 			continue;
@@ -611,7 +611,7 @@ client_try_idm(struct env *env, struct i
 	    idm->idm_filters[FILTER_USER], 0, ATTR_MAX, IMSG_PW_ENTRY) == -1)
 		goto bad;
 
-	bzero(attrs, sizeof(attrs));
+	memset(attrs, 0, sizeof(attrs));
 	for (i = ATTR_GR_MIN, j = 0; i < ATTR_GR_MAX; i++) {
 		if (idm->idm_flags & F_FIXED_ATTR(i))
 			continue;

Modified: stable/11/usr.sbin/ypldap/yp.c
==============================================================================
--- stable/11/usr.sbin/ypldap/yp.c	Mon Dec 12 02:24:46 2016	(r309871)
+++ stable/11/usr.sbin/ypldap/yp.c	Mon Dec 12 02:24:54 2016	(r309872)
@@ -342,7 +342,7 @@ ypproc_match_2_svc(ypreq_key *arg, struc
 		log_debug("argument too long");
 		return (NULL);
 	}
-	bzero(key, sizeof(key));
+	memset(key, 0, sizeof(key));
 	(void)strncpy(key, arg->key.keydat_val, arg->key.keydat_len);
 
 	if (strcmp(arg->map, "passwd.byname") == 0 ||
@@ -486,7 +486,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct
 
 	if (strcmp(arg->map, "passwd.byname") == 0 ||
 	    strcmp(arg->map, "master.passwd.byname") == 0) {
-		bzero(key, sizeof(key));
+		memset(key, 0, sizeof(key));
 		(void)strncpy(key, arg->key.keydat_val,
 		    arg->key.keydat_len);
 		ukey.ue_line = key;
@@ -517,7 +517,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct
 
 
 	} else if (strcmp(arg->map, "group.byname") == 0) {
-		bzero(key, sizeof(key));
+		memset(key, 0, sizeof(key));
 		(void)strncpy(key, arg->key.keydat_val,
 		    arg->key.keydat_len);
 		
@@ -567,7 +567,7 @@ ypproc_master_2_svc(ypreq_nokey *arg, st
 	static struct ypresp_master	 res;
 	static char master[YPMAXPEER + 1];
 
-	bzero(&res, sizeof(res));
+	memset(&res, 0, sizeof(res));
 	if (yp_valid_domain(arg->domain, (struct ypresp_val *)&res) == -1)
 		return (&res);
 	
@@ -620,7 +620,7 @@ yp_make_val(struct ypresp_val *res, char
 {
 	static char		 buf[LINE_WIDTH];
 
-	bzero(buf, sizeof(buf));
+	memset(buf, 0, sizeof(buf));
 
 	if (replacecolon)
 		line[strlen(line)] = ':';
@@ -640,8 +640,8 @@ yp_make_keyval(struct ypresp_key_val *re
 	static char	keybuf[YPMAXRECORD+1];
 	static char	buf[LINE_WIDTH];
 
-	bzero(keybuf, sizeof(keybuf));
-	bzero(buf, sizeof(buf));
+	memset(keybuf, 0, sizeof(keybuf));
+	memset(buf, 0, sizeof(buf));
 	
 	(void)strlcpy(keybuf, key, sizeof(keybuf));
 	res->key.keydat_len = strlen(keybuf);

Modified: stable/11/usr.sbin/ypldap/ypldap.c
==============================================================================
--- stable/11/usr.sbin/ypldap/ypldap.c	Mon Dec 12 02:24:46 2016	(r309871)
+++ stable/11/usr.sbin/ypldap/ypldap.c	Mon Dec 12 02:24:54 2016	(r309872)
@@ -609,7 +609,7 @@ main(int argc, char *argv[])
 #warning disabling privilege revocation in debug mode
 #endif
 
-	bzero(&tv, sizeof(tv));
+	memset(&tv, 0, sizeof(tv));
 	evtimer_set(&ev_timer, main_init_timer, &env);
 	evtimer_add(&ev_timer, &tv);
 

Modified: stable/11/usr.sbin/ypldap/ypldap_dns.c
==============================================================================
--- stable/11/usr.sbin/ypldap/ypldap_dns.c	Mon Dec 12 02:24:46 2016	(r309871)
+++ stable/11/usr.sbin/ypldap/ypldap_dns.c	Mon Dec 12 02:24:54 2016	(r309872)
@@ -212,7 +212,7 @@ host_dns(const char *s, struct ypldap_ad
 	struct sockaddr_in6	*sa_in6;
 	struct ypldap_addr	*h;
 
-	bzero(&hints, sizeof(hints));
+	memset(&hints, 0, sizeof(hints));
 	hints.ai_family = PF_UNSPEC;
 	hints.ai_socktype = SOCK_DGRAM; /* DUMMY */
 	error = getaddrinfo(s, NULL, &hints, &res0);

From owner-svn-src-all@freebsd.org  Mon Dec 12 03:46:41 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6FFAC737D7;
 Mon, 12 Dec 2016 03:46:41 +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 9CFE81B2E;
 Mon, 12 Dec 2016 03:46:41 +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 uBC3ke6P003783;
 Mon, 12 Dec 2016 03:46:40 GMT (envelope-from pfg@FreeBSD.org)
Received: (from pfg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC3keb3003780;
 Mon, 12 Dec 2016 03:46:40 GMT (envelope-from pfg@FreeBSD.org)
Message-Id: <201612120346.uBC3keb3003780@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org
 using -f
From: "Pedro F. Giffuni" <pfg@FreeBSD.org>
Date: Mon, 12 Dec 2016 03:46:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309873 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 03:46:42 -0000

Author: pfg
Date: Mon Dec 12 03:46:40 2016
New Revision: 309873
URL: https://svnweb.freebsd.org/changeset/base/309873

Log:
  ed(1): Prevent possible overflows during allocation.
  
  Make sure the parameters used for malloc(3) can hold size_t sizes.
  This should help ed(1) handle bigger data in the future.
  
  MFC after:	2 weeks

Modified:
  head/bin/ed/ed.h
  head/bin/ed/glbl.c
  head/bin/ed/main.c

Modified: head/bin/ed/ed.h
==============================================================================
--- head/bin/ed/ed.h	Mon Dec 12 02:24:54 2016	(r309872)
+++ head/bin/ed/ed.h	Mon Dec 12 03:46:40 2016	(r309873)
@@ -115,7 +115,7 @@ if (--mutex == 0) { \
 /* REALLOC: assure at least a minimum size for buffer b */
 #define REALLOC(b,n,i,err) \
 if ((i) > (n)) { \
-	int ti = (n); \
+	size_t ti = (n); \
 	char *ts; \
 	SPL1(); \
 	if ((b) != NULL) { \
@@ -141,7 +141,7 @@ if ((i) > (n)) { \
 /* REALLOC: assure at least a minimum size for buffer b */
 #define REALLOC(b,n,i,err) \
 if ((i) > (n)) { \
-	int ti = (n); \
+	size_t ti = (n); \
 	char *ts; \
 	SPL1(); \
 	if ((ts = (char *) realloc((b), ti += max((i), MINBUFSZ))) == NULL) { \

Modified: head/bin/ed/glbl.c
==============================================================================
--- head/bin/ed/glbl.c	Mon Dec 12 02:24:54 2016	(r309872)
+++ head/bin/ed/glbl.c	Mon Dec 12 03:46:40 2016	(r309873)
@@ -146,7 +146,7 @@ int
 set_active_node(line_t *lp)
 {
 	if (active_last + 1 > active_size) {
-		int ti = active_size;
+		size_t ti = active_size;
 		line_t **ts;
 		SPL1();
 #if defined(sun) || defined(NO_REALLOC_NULL)

Modified: head/bin/ed/main.c
==============================================================================
--- head/bin/ed/main.c	Mon Dec 12 02:24:54 2016	(r309872)
+++ head/bin/ed/main.c	Mon Dec 12 03:46:40 2016	(r309873)
@@ -1356,7 +1356,7 @@ handle_hup(int signo)
 	char *hup = NULL;		/* hup filename */
 	char *s;
 	char ed_hup[] = "ed.hup";
-	int n;
+	size_t n;
 
 	if (!sigactive)
 		quit(1);

From owner-svn-src-all@freebsd.org  Mon Dec 12 05:04:56 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A766BC73891;
 Mon, 12 Dec 2016 05:04:56 +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 5F2D41CC7;
 Mon, 12 Dec 2016 05:04: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 uBC54tQF035656;
 Mon, 12 Dec 2016 05:04:55 GMT (envelope-from sephe@FreeBSD.org)
Received: (from sephe@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC54tYI035653;
 Mon, 12 Dec 2016 05:04:55 GMT (envelope-from sephe@FreeBSD.org)
Message-Id: <201612120504.uBC54tYI035653@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: sephe set sender to
 sephe@FreeBSD.org using -f
From: Sepherosa Ziehau <sephe@FreeBSD.org>
Date: Mon, 12 Dec 2016 05:04:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309874 - in head/sys/dev/hyperv: include vmbus
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 05:04:56 -0000

Author: sephe
Date: Mon Dec 12 05:04:55 2016
New Revision: 309874
URL: https://svnweb.freebsd.org/changeset/base/309874

Log:
  hyperv/vmbus: Add channel polling support.
  
  MFC after:	1 week
  Sponsored by:	Microsoft
  Differential Revision:	https://reviews.freebsd.org/D8738

Modified:
  head/sys/dev/hyperv/include/vmbus.h
  head/sys/dev/hyperv/vmbus/vmbus_chan.c
  head/sys/dev/hyperv/vmbus/vmbus_chanvar.h

Modified: head/sys/dev/hyperv/include/vmbus.h
==============================================================================
--- head/sys/dev/hyperv/include/vmbus.h	Mon Dec 12 03:46:40 2016	(r309873)
+++ head/sys/dev/hyperv/include/vmbus.h	Mon Dec 12 05:04:55 2016	(r309874)
@@ -49,6 +49,9 @@
 #define VMBUS_VERSION_MAJOR(ver)	(((uint32_t)(ver)) >> 16)
 #define VMBUS_VERSION_MINOR(ver)	(((uint32_t)(ver)) & 0xffff)
 
+#define VMBUS_CHAN_POLLHZ_MIN		100	/* 10ms interval */
+#define VMBUS_CHAN_POLLHZ_MAX		1000000	/* 1us interval */
+
 /*
  * GPA stuffs.
  */
@@ -220,4 +223,8 @@ bool		vmbus_chan_tx_empty(const struct v
 struct taskqueue *
 		vmbus_chan_mgmt_tq(const struct vmbus_channel *chan);
 
+void		vmbus_chan_poll_enable(struct vmbus_channel *chan,
+		    u_int pollhz);
+void		vmbus_chan_poll_disable(struct vmbus_channel *chan);
+
 #endif	/* !_VMBUS_H_ */

Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/vmbus_chan.c	Mon Dec 12 03:46:40 2016	(r309873)
+++ head/sys/dev/hyperv/vmbus/vmbus_chan.c	Mon Dec 12 05:04:55 2016	(r309874)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/bus.h>
+#include <sys/callout.h>
 #include <sys/kernel.h>
 #include <sys/lock.h>
 #include <sys/malloc.h>
@@ -50,6 +51,11 @@ __FBSDID("$FreeBSD$");
 #include <dev/hyperv/vmbus/vmbus_brvar.h>
 #include <dev/hyperv/vmbus/vmbus_chanvar.h>
 
+struct vmbus_chan_pollarg {
+	struct vmbus_channel	*poll_chan;
+	u_int			poll_hz;
+};
+
 static void			vmbus_chan_update_evtflagcnt(
 				    struct vmbus_softc *,
 				    const struct vmbus_channel *);
@@ -68,6 +74,10 @@ static void			vmbus_chan_clear_chmap(str
 static void			vmbus_chan_detach(struct vmbus_channel *);
 static bool			vmbus_chan_wait_revoke(
 				    const struct vmbus_channel *, bool);
+static void			vmbus_chan_poll_timeout(void *);
+static bool			vmbus_chan_poll_cancel_intq(
+				    struct vmbus_channel *);
+static void			vmbus_chan_poll_cancel(struct vmbus_channel *);
 
 static void			vmbus_chan_ins_prilist(struct vmbus_softc *,
 				    struct vmbus_channel *);
@@ -84,7 +94,11 @@ static void			vmbus_chan_rem_sublist(str
 
 static void			vmbus_chan_task(void *, int);
 static void			vmbus_chan_task_nobatch(void *, int);
+static void			vmbus_chan_poll_task(void *, int);
 static void			vmbus_chan_clrchmap_task(void *, int);
+static void			vmbus_chan_pollcfg_task(void *, int);
+static void			vmbus_chan_polldis_task(void *, int);
+static void			vmbus_chan_poll_cancel_task(void *, int);
 static void			vmbus_prichan_attach_task(void *, int);
 static void			vmbus_subchan_attach_task(void *, int);
 static void			vmbus_prichan_detach_task(void *, int);
@@ -782,6 +796,22 @@ vmbus_chan_set_chmap(struct vmbus_channe
 	chan->ch_vmbus->vmbus_chmap[chan->ch_id] = chan;
 }
 
+static void
+vmbus_chan_poll_cancel_task(void *xchan, int pending __unused)
+{
+
+	vmbus_chan_poll_cancel_intq(xchan);
+}
+
+static void
+vmbus_chan_poll_cancel(struct vmbus_channel *chan)
+{
+	struct task poll_cancel;
+
+	TASK_INIT(&poll_cancel, 0, vmbus_chan_poll_cancel_task, chan);
+	vmbus_chan_run_task(chan, &poll_cancel);
+}
+
 static int
 vmbus_chan_close_internal(struct vmbus_channel *chan)
 {
@@ -818,6 +848,11 @@ vmbus_chan_close_internal(struct vmbus_c
 	sysctl_ctx_free(&chan->ch_sysctl_ctx);
 
 	/*
+	 * Cancel polling, if it is enabled.
+	 */
+	vmbus_chan_poll_cancel(chan);
+
+	/*
 	 * NOTE:
 	 * Order is critical.  This channel _must_ be uninstalled first,
 	 * else the channel task may be enqueued by the IDT after it has
@@ -1185,6 +1220,9 @@ vmbus_chan_task(void *xchan, int pending
 	vmbus_chan_callback_t cb = chan->ch_cb;
 	void *cbarg = chan->ch_cbarg;
 
+	KASSERT(chan->ch_poll_intvl == 0,
+	    ("chan%u: interrupted in polling mode", chan->ch_id));
+
 	/*
 	 * Optimize host to guest signaling by ensuring:
 	 * 1. While reading the channel, we disable interrupts from
@@ -1216,9 +1254,145 @@ vmbus_chan_task_nobatch(void *xchan, int
 {
 	struct vmbus_channel *chan = xchan;
 
+	KASSERT(chan->ch_poll_intvl == 0,
+	    ("chan%u: interrupted in polling mode", chan->ch_id));
+	chan->ch_cb(chan, chan->ch_cbarg);
+}
+
+static void
+vmbus_chan_poll_timeout(void *xchan)
+{
+	struct vmbus_channel *chan = xchan;
+
+	KASSERT(chan->ch_poll_intvl != 0,
+	    ("chan%u: polling timeout in interrupt mode", chan->ch_id));
+	taskqueue_enqueue(chan->ch_tq, &chan->ch_poll_task);
+}
+
+static void
+vmbus_chan_poll_task(void *xchan, int pending __unused)
+{
+	struct vmbus_channel *chan = xchan;
+
+	KASSERT(chan->ch_poll_intvl != 0,
+	    ("chan%u: polling in interrupt mode", chan->ch_id));
+	callout_reset_sbt_curcpu(&chan->ch_poll_timeo, chan->ch_poll_intvl, 0,
+	    vmbus_chan_poll_timeout, chan, chan->ch_poll_flags);
 	chan->ch_cb(chan, chan->ch_cbarg);
 }
 
+static void
+vmbus_chan_pollcfg_task(void *xarg, int pending __unused)
+{
+	const struct vmbus_chan_pollarg *arg = xarg;
+	struct vmbus_channel *chan = arg->poll_chan;
+	sbintime_t intvl;
+	int poll_flags;
+
+	/*
+	 * Save polling interval.
+	 */
+	intvl = SBT_1S / arg->poll_hz;
+	if (intvl == 0)
+		intvl = 1;
+	if (intvl == chan->ch_poll_intvl) {
+		/* Nothing changes; done */
+		return;
+	}
+	chan->ch_poll_intvl = intvl;
+
+	/* Adjust callout flags. */
+	poll_flags = C_DIRECT_EXEC;
+	if (arg->poll_hz <= hz)
+		poll_flags |= C_HARDCLOCK;
+	chan->ch_poll_flags = poll_flags;
+
+	/*
+	 * Disable interrupt from the RX bufring (TX bufring does not
+	 * generate interrupt to VM), and disconnect this channel from
+	 * the channel map to make sure that ISR can not enqueue this
+	 * channel task anymore.
+	 */
+	critical_enter();
+	vmbus_rxbr_intr_mask(&chan->ch_rxbr);
+	chan->ch_vmbus->vmbus_chmap[chan->ch_id] = NULL;
+	critical_exit();
+
+	/*
+	 * NOTE:
+	 * At this point, this channel task will not be enqueued by
+	 * the ISR anymore, time to cancel the pending one.
+	 */
+	taskqueue_cancel(chan->ch_tq, &chan->ch_task, NULL);
+
+	/* Kick start! */
+	taskqueue_enqueue(chan->ch_tq, &chan->ch_poll_task);
+}
+
+static bool
+vmbus_chan_poll_cancel_intq(struct vmbus_channel *chan)
+{
+
+	if (chan->ch_poll_intvl == 0) {
+		/* Not enabled. */
+		return (false);
+	}
+
+	/*
+	 * Stop polling callout, so that channel polling task
+	 * will not be enqueued anymore.
+	 */
+	callout_drain(&chan->ch_poll_timeo);
+
+	/*
+	 * Disable polling by resetting polling interval.
+	 *
+	 * NOTE:
+	 * The polling interval resetting MUST be conducted
+	 * after the callout is drained; mainly to keep the
+	 * proper assertion in place.
+	 */
+	chan->ch_poll_intvl = 0;
+
+	/*
+	 * NOTE:
+	 * At this point, this channel polling task will not be
+	 * enqueued by the callout anymore, time to cancel the
+	 * pending one.
+	 */
+	taskqueue_cancel(chan->ch_tq, &chan->ch_poll_task, NULL);
+
+	/* Polling was enabled. */
+	return (true);
+}
+
+static void
+vmbus_chan_polldis_task(void *xchan, int pending __unused)
+{
+	struct vmbus_channel *chan = xchan;
+
+	if (!vmbus_chan_poll_cancel_intq(chan)) {
+		/* Already disabled; done. */
+		return;
+	}
+
+	/*
+	 * Plug this channel back to the channel map and unmask
+	 * the RX bufring interrupt.
+	 */
+	critical_enter();
+	chan->ch_vmbus->vmbus_chmap[chan->ch_id] = chan;
+	__compiler_membar();
+	vmbus_rxbr_intr_unmask(&chan->ch_rxbr);
+	critical_exit();
+
+	/*
+	 * Kick start the interrupt task, just in case unmasking
+	 * interrupt races ISR.
+	 */
+	taskqueue_enqueue(chan->ch_tq, &chan->ch_task);
+}
+
 static __inline void
 vmbus_event_flags_proc(struct vmbus_softc *sc, volatile u_long *event_flags,
     int flag_cnt)
@@ -1333,6 +1507,9 @@ vmbus_chan_alloc(struct vmbus_softc *sc)
 	vmbus_rxbr_init(&chan->ch_rxbr);
 	vmbus_txbr_init(&chan->ch_txbr);
 
+	TASK_INIT(&chan->ch_poll_task, 0, vmbus_chan_poll_task, chan);
+	callout_init(&chan->ch_poll_timeo, 1);
+
 	return chan;
 }
 
@@ -1351,6 +1528,8 @@ vmbus_chan_free(struct vmbus_channel *ch
 	    ("still has orphan xact installed"));
 	KASSERT(chan->ch_refs == 0, ("chan%u: invalid refcnt %d",
 	    chan->ch_id, chan->ch_refs));
+	KASSERT(chan->ch_poll_intvl == 0, ("chan%u: polling is activated",
+	    chan->ch_id));
 
 	hyperv_dmamem_free(&chan->ch_monprm_dma, chan->ch_monprm);
 	mtx_destroy(&chan->ch_subchan_lock);
@@ -1998,3 +2177,32 @@ vmbus_chan_xact_wait(const struct vmbus_
 	}
 	return (ret);
 }
+
+void
+vmbus_chan_poll_enable(struct vmbus_channel *chan, u_int pollhz)
+{
+	struct vmbus_chan_pollarg arg;
+	struct task poll_cfg;
+
+	KASSERT(chan->ch_flags & VMBUS_CHAN_FLAG_BATCHREAD,
+	    ("enable polling on non-batch chan%u", chan->ch_id));
+	KASSERT(pollhz >= VMBUS_CHAN_POLLHZ_MIN &&
+	    pollhz <= VMBUS_CHAN_POLLHZ_MAX, ("invalid pollhz %u", pollhz));
+
+	arg.poll_chan = chan;
+	arg.poll_hz = pollhz;
+	TASK_INIT(&poll_cfg, 0, vmbus_chan_pollcfg_task, &arg);
+	vmbus_chan_run_task(chan, &poll_cfg);
+}
+
+void
+vmbus_chan_poll_disable(struct vmbus_channel *chan)
+{
+	struct task poll_dis;
+
+	KASSERT(chan->ch_flags & VMBUS_CHAN_FLAG_BATCHREAD,
+	    ("disable polling on non-batch chan%u", chan->ch_id));
+
+	TASK_INIT(&poll_dis, 0, vmbus_chan_polldis_task, chan);
+	vmbus_chan_run_task(chan, &poll_dis);
+}

Modified: head/sys/dev/hyperv/vmbus/vmbus_chanvar.h
==============================================================================
--- head/sys/dev/hyperv/vmbus/vmbus_chanvar.h	Mon Dec 12 03:46:40 2016	(r309873)
+++ head/sys/dev/hyperv/vmbus/vmbus_chanvar.h	Mon Dec 12 05:04:55 2016	(r309874)
@@ -30,6 +30,7 @@
 #define _VMBUS_CHANVAR_H_
 
 #include <sys/param.h>
+#include <sys/callout.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
 #include <sys/queue.h>
@@ -49,6 +50,7 @@ struct vmbus_channel {
 	 * target CPU.
 	 */
 	uint32_t			ch_flags;	/* VMBUS_CHAN_FLAG_ */
+	int				ch_poll_flags;	/* callout flags */
 
 	/*
 	 * RX bufring; immediately following ch_txbr.
@@ -57,6 +59,9 @@ struct vmbus_channel {
 
 	struct taskqueue		*ch_tq;
 	struct task			ch_task;
+	struct task			ch_poll_task;
+	sbintime_t			ch_poll_intvl;
+	struct callout			ch_poll_timeo;
 	vmbus_chan_callback_t		ch_cb;
 	void				*ch_cbarg;
 

From owner-svn-src-all@freebsd.org  Mon Dec 12 05:18:05 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 328A7C73B41;
 Mon, 12 Dec 2016 05:18: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 E774C299;
 Mon, 12 Dec 2016 05:18:04 +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 uBC5I4mY039786;
 Mon, 12 Dec 2016 05:18:04 GMT (envelope-from sephe@FreeBSD.org)
Received: (from sephe@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC5I447039784;
 Mon, 12 Dec 2016 05:18:04 GMT (envelope-from sephe@FreeBSD.org)
Message-Id: <201612120518.uBC5I447039784@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: sephe set sender to
 sephe@FreeBSD.org using -f
From: Sepherosa Ziehau <sephe@FreeBSD.org>
Date: Mon, 12 Dec 2016 05:18:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309875 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 05:18:05 -0000

Author: sephe
Date: Mon Dec 12 05:18:03 2016
New Revision: 309875
URL: https://svnweb.freebsd.org/changeset/base/309875

Log:
  hyperv/hn: Add polling support
  
  MFC after:	1 week
  Sponsored by:	Microsoft
  Differential Revision:	https://reviews.freebsd.org/D8739

Modified:
  head/sys/dev/hyperv/netvsc/if_hn.c
  head/sys/dev/hyperv/netvsc/if_hnvar.h

Modified: head/sys/dev/hyperv/netvsc/if_hn.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/if_hn.c	Mon Dec 12 05:04:55 2016	(r309874)
+++ head/sys/dev/hyperv/netvsc/if_hn.c	Mon Dec 12 05:18:03 2016	(r309875)
@@ -293,6 +293,7 @@ static int			hn_txagg_size_sysctl(SYSCTL
 static int			hn_txagg_pkts_sysctl(SYSCTL_HANDLER_ARGS);
 static int			hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARGS);
 static int			hn_txagg_align_sysctl(SYSCTL_HANDLER_ARGS);
+static int			hn_polling_sysctl(SYSCTL_HANDLER_ARGS);
 
 static void			hn_stop(struct hn_softc *);
 static void			hn_init_locked(struct hn_softc *);
@@ -319,6 +320,8 @@ static void			hn_resume_mgmt(struct hn_s
 static void			hn_suspend_mgmt_taskfunc(void *, int);
 static void			hn_chan_drain(struct hn_softc *,
 				    struct vmbus_channel *);
+static void			hn_polling(struct hn_softc *, u_int);
+static void			hn_chan_polling(struct vmbus_channel *, u_int);
 
 static void			hn_update_link_status(struct hn_softc *);
 static void			hn_change_network(struct hn_softc *);
@@ -1117,6 +1120,10 @@ hn_attach(device_t dev)
 	    hn_txagg_pkts_sysctl, "I",
 	    "Packet transmission aggregation packets, "
 	    "0 -- disable, -1 -- auto");
+	SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "polling",
+	    CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0,
+	    hn_polling_sysctl, "I",
+	    "Polling frequency: [100,1000000], 0 disable polling");
 
 	/*
 	 * Setup the ifmedia, which has been initialized earlier.
@@ -2360,6 +2367,9 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
 			break;
 		}
 
+		/* Disable polling. */
+		hn_polling(sc, 0);
+
 		/*
 		 * Suspend this interface before the synthetic parts
 		 * are ripped.
@@ -2405,6 +2415,13 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
 		 */
 		hn_resume(sc);
 
+		/*
+		 * Re-enable polling if this interface is running and
+		 * the polling is requested.
+		 */
+		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) && sc->hn_pollhz > 0)
+			hn_polling(sc, sc->hn_pollhz);
+
 		HN_UNLOCK(sc);
 		break;
 
@@ -2531,6 +2548,9 @@ hn_stop(struct hn_softc *sc)
 	KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED,
 	    ("synthetic parts were not attached"));
 
+	/* Disable polling. */
+	hn_polling(sc, 0);
+
 	/* Clear RUNNING bit _before_ hn_suspend_data() */
 	atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_RUNNING);
 	hn_suspend_data(sc);
@@ -2568,6 +2588,10 @@ hn_init_locked(struct hn_softc *sc)
 
 	/* Everything is ready; unleash! */
 	atomic_set_int(&ifp->if_drv_flags, IFF_DRV_RUNNING);
+
+	/* Re-enable polling if requested. */
+	if (sc->hn_pollhz > 0)
+		hn_polling(sc, sc->hn_pollhz);
 }
 
 static void
@@ -2875,6 +2899,61 @@ hn_txagg_align_sysctl(SYSCTL_HANDLER_ARG
 	return (sysctl_handle_int(oidp, &align, 0, req));
 }
 
+static void
+hn_chan_polling(struct vmbus_channel *chan, u_int pollhz)
+{
+	if (pollhz == 0)
+		vmbus_chan_poll_disable(chan);
+	else
+		vmbus_chan_poll_enable(chan, pollhz);
+}
+
+static void
+hn_polling(struct hn_softc *sc, u_int pollhz)
+{
+	int nsubch = sc->hn_rx_ring_inuse - 1;
+
+	HN_LOCK_ASSERT(sc);
+
+	if (nsubch > 0) {
+		struct vmbus_channel **subch;
+		int i;
+
+		subch = vmbus_subchan_get(sc->hn_prichan, nsubch);
+		for (i = 0; i < nsubch; ++i)
+			hn_chan_polling(subch[i], pollhz);
+		vmbus_subchan_rel(subch, nsubch);
+	}
+	hn_chan_polling(sc->hn_prichan, pollhz);
+}
+
+static int
+hn_polling_sysctl(SYSCTL_HANDLER_ARGS)
+{
+	struct hn_softc *sc = arg1;
+	int pollhz, error;
+
+	pollhz = sc->hn_pollhz;
+	error = sysctl_handle_int(oidp, &pollhz, 0, req);
+	if (error || req->newptr == NULL)
+		return (error);
+
+	if (pollhz != 0 &&
+	    (pollhz < VMBUS_CHAN_POLLHZ_MIN || pollhz > VMBUS_CHAN_POLLHZ_MAX))
+		return (EINVAL);
+
+	HN_LOCK(sc);
+	if (sc->hn_pollhz != pollhz) {
+		sc->hn_pollhz = pollhz;
+		if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) &&
+		    (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED))
+			hn_polling(sc, sc->hn_pollhz);
+	}
+	HN_UNLOCK(sc);
+
+	return (0);
+}
+
 static int
 hn_ndis_version_sysctl(SYSCTL_HANDLER_ARGS)
 {

Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h
==============================================================================
--- head/sys/dev/hyperv/netvsc/if_hnvar.h	Mon Dec 12 05:04:55 2016	(r309874)
+++ head/sys/dev/hyperv/netvsc/if_hnvar.h	Mon Dec 12 05:18:03 2016	(r309875)
@@ -212,6 +212,8 @@ struct hn_softc {
 
 	uint32_t		hn_caps;	/* HN_CAP_ */
 	uint32_t		hn_flags;	/* HN_FLAG_ */
+	u_int			hn_pollhz;
+
 	void			*hn_rxbuf;
 	uint32_t		hn_rxbuf_gpadl;
 	struct hyperv_dma	hn_rxbuf_dma;

From owner-svn-src-all@freebsd.org  Mon Dec 12 06:56:20 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2DCCC73458;
 Mon, 12 Dec 2016 06:56:20 +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 609A5F32;
 Mon, 12 Dec 2016 06:56:20 +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 uBC6uJ7b082266;
 Mon, 12 Dec 2016 06:56:19 GMT (envelope-from bapt@FreeBSD.org)
Received: (from bapt@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC6uJk3082265;
 Mon, 12 Dec 2016 06:56:19 GMT (envelope-from bapt@FreeBSD.org)
Message-Id: <201612120656.uBC6uJk3082265@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bapt set sender to
 bapt@FreeBSD.org using -f
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Mon, 12 Dec 2016 06:56:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309876 - stable/11/share/misc
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 06:56:20 -0000

Author: bapt
Date: Mon Dec 12 06:56:19 2016
New Revision: 309876
URL: https://svnweb.freebsd.org/changeset/base/309876

Log:
  MFC r309795:
  
  Update pci ids database to 2016.11.21

Modified:
  stable/11/share/misc/pci_vendors
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/misc/pci_vendors
==============================================================================
--- stable/11/share/misc/pci_vendors	Mon Dec 12 05:18:03 2016	(r309875)
+++ stable/11/share/misc/pci_vendors	Mon Dec 12 06:56:19 2016	(r309876)
@@ -3,8 +3,8 @@
 #
 #	List of PCI ID's
 #
-#	Version: 2016.10.20
-#	Date:    2016-10-20 03:15:02
+#	Version: 2016.11.21
+#	Date:    2016-11-21 03:15:01
 #
 #	Maintained by Albert Pool, Martin Mares, and other volunteers from
 #	the PCI ID Project at http://pci-ids.ucw.cz/.
@@ -50,9 +50,11 @@
 021b  Compaq Computer Corporation
 	8139  HNE-300 (RealTek RTL8139c) [iPaq Networking]
 0270  Hauppauge computer works Inc. (Wrong ID)
+0291  Davicom Semiconductor, Inc. (Wrong ID)
 # SpeedStream is Efficient Networks, Inc, a Siemens Company
 02ac  SpeedStream
 	1012  1012 PCMCIA 10/100 Ethernet Card [RTL81xx]
+02e0  XFX Pine Group Inc. (Wrong ID)
 0303  Hewlett-Packard Company (Wrong ID)
 0308  ZyXEL Communications Corporation (Wrong ID)
 0315  SK-Electronics Co., Ltd.
@@ -548,12 +550,12 @@
 		1028 1fd3  HBA330 MMZ
 	00ab  SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC)
 	00ac  SAS3416 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)
-		1d49 0201  ThinkSystem 9400-16i PCIe 12Gb HBA
-		1d49 0203  ThinkSystem 9400-16e PCIe 12Gb HBA
+		1d49 0201  ThinkSystem 430-16i SAS/SATA 12Gb HBA
+		1d49 0203  ThinkSystem 430-16e SAS/SATA 12Gb HBA
 	00ae  SAS3508 Fusion-MPT Tri-Mode RAID On Chip (ROC)
 	00af  SAS3408 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)
-		1d49 0200  ThinkSystem 9400-8i PCIe 12Gb HBA
-		1d49 0202  ThinkSystem 9400-8e PCIe 12Gb HBA
+		1d49 0200  ThinkSystem 430-8i SAS/SATA 12Gb HBA
+		1d49 0202  ThinkSystem 430-8e SAS/SATA 12Gb HBA
 	00be  SAS3504 Fusion-MPT Tri-Mode RAID On Chip (ROC)
 	00bf  SAS3404 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)
 	00c0  SAS3324 PCI-Express Fusion-MPT SAS-3
@@ -7531,7 +7533,7 @@
 		1885 0700  Tsunami FPGA PMC with Altera Stratix S40
 		1885 0701  Tsunami FPGA PMC with Altera Stratix S30
 	9733  PEX 9733 33-lane, 9-port PCI Express Gen 3 (8.0 GT/s) Switch
-		1d49 0001  ThinkSystem P310W-4P NVMe Switch Card
+		1d49 0001  ThinkSystem 1610-4P NVMe Switch Adapter
 	9749  PEX 9749 49-lane, 13-port PCI Express Gen 3 (8.0 GT/s) Switch
 	a100  Blackmagic Design DeckLink
 	bb04  B&B 3PCIOSD1A Isolated PCI Serial
@@ -8377,6 +8379,7 @@
 		1048 0c45  GLoria II
 		1048 0c4a  GLoria II-64 Pro
 		1048 0c4b  GLoria II-64 Pro DVII
+		10a9 9002  VPro VR3
 	0110  NV11 [GeForce2 MX/MX 400]
 		1043 4015  AGP-V7100 Pro
 		1043 4021  V7100 Deluxe Combo
@@ -10649,6 +10652,7 @@
 	1b00  GP102 [TITAN X]
 	1b01  GP102
 	1b30  GP102GL [Quadro P6000]
+	1b38  GP102GL [Tesla P40]
 	1b70  GP102GL
 	1b78  GP102GL
 	1b80  GP104 [GeForce GTX 1080]
@@ -10668,10 +10672,11 @@
 	1c03  GP106 [GeForce GTX 1060 6GB]
 	1c20  GP106M [GeForce GTX 1060]
 	1c30  GP106GL
+	1c35  GP106
 	1c60  GP106M [GeForce GTX 1060]
 	1c70  GP106GL
 	1c80  GP107
-	1c81  GP107
+	1c81  GP107 [GeForce GTX 1050]
 	1c82  GP107 [GeForce GTX 1050 Ti]
 	1ca7  GP107GL
 	1ca8  GP107GL
@@ -13729,6 +13734,7 @@
 	7375  PM7375 [LASAR-155 ATM SAR]
 	7384  PM7384 [FREEDM - 84P672 Frm Engine & Datalink Mgr]
 	8000  PM8000  [SPC - SAS Protocol Controller]
+	8009  PM8009 SPCve 8x6G
 	8032  ATTO Celerity FC8xEN
 		117c 003b  Celerity FC-82EN Fibre Channel Adapter
 		117c 003c  Celerity FC-84EN Fibre Channel Adapter
@@ -13742,6 +13748,8 @@
 	8071  PM8071 Tachyon SPCve 12G eight-port SAS/SATA controller
 	8072  PM8072 Tachyon SPCv 12G 16-port SAS/SATA controller
 	8073  PM8073 Tachyon SPCve 12G 16-port SAS/SATA controller
+	8531  PM8531 PFX 24xG3 Fanout PCIe Switches
+	8546  PM8546 B-FEIP PSX 96xG3 PCIe Storage Switch
 11f9  I-Cube Inc
 11fa  Kasan Electronics Company, Ltd.
 11fb  Datel Inc
@@ -16213,6 +16221,71 @@
 	589a  T520-509A Unified Wire Ethernet Controller [VF]
 	589b  T540-509B Unified Wire Ethernet Controller [VF]
 	589c  T520-509C Unified Wire Ethernet Controller [VF]
+	6001  T6225-CR Unified Wire Ethernet Controller
+	6002  T6225-SO-CR Unified Wire Ethernet Controller
+	6003  T6425-CR Unified Wire Ethernet Controller
+	6004  T6425-SO-CR Unified Wire Ethernet Controller
+	6005  T6225-OCP-SO Unified Wire Ethernet Controller
+	6006  T62100-OCP-SO Unified Wire Ethernet Controller
+	6007  T62100-LP-CR Unified Wire Ethernet Controller
+	6008  T62100-SO-CR Unified Wire Ethernet Controller
+	6009  T6210-BT Unified Wire Ethernet Controller
+	600d  T62100-CR Unified Wire Ethernet Controller
+	6011  T6225-LL-CR Unified Wire Ethernet Controller
+	6014  T61100-OCP-SO Unified Wire Ethernet Controller
+	6015  T6201-BT Unified Wire Ethernet Controller
+	6401  T6225-CR Unified Wire Ethernet Controller
+	6402  T6225-SO-CR Unified Wire Ethernet Controller
+	6403  T6425-CR Unified Wire Ethernet Controller
+	6404  T6425-SO-CR Unified Wire Ethernet Controller
+	6405  T6225-OCP-SO Unified Wire Ethernet Controller
+	6406  T62100-OCP-SO Unified Wire Ethernet Controller
+	6407  T62100-LP-CR Unified Wire Ethernet Controller
+	6408  T62100-SO-CR Unified Wire Ethernet Controller
+	6409  T6210-BT Unified Wire Ethernet Controller
+	640d  T62100-CR Unified Wire Ethernet Controller
+	6411  T6225-LL-CR Unified Wire Ethernet Controller
+	6414  T61100-OCP-SO Unified Wire Ethernet Controller
+	6415  T6201-BT Unified Wire Ethernet Controller
+	6501  T6225-CR Unified Wire Storage Controller
+	6502  T6225-SO-CR Unified Wire Storage Controller
+	6503  T6425-CR Unified Wire Storage Controller
+	6504  T6425-SO-CR Unified Wire Storage Controller
+	6505  T6225-OCP-SO Unified Wire Storage Controller
+	6506  T62100-OCP-SO Unified Wire Storage Controller
+	6507  T62100-LP-CR Unified Wire Storage Controller
+	6508  T62100-SO-CR Unified Wire Storage Controller
+	6509  T6210-BT Unified Wire Storage Controller
+	650d  T62100-CR Unified Wire Storage Controller
+	6511  T6225-LL-CR Unified Wire Storage Controller
+	6514  T61100-OCP-SO Unified Wire Storage Controller
+	6515  T6201-BT Unified Wire Storage Controller
+	6601  T6225-CR Unified Wire Storage Controller
+	6602  T6225-SO-CR Unified Wire Storage Controller
+	6603  T6425-CR Unified Wire Storage Controller
+	6604  T6425-SO-CR Unified Wire Storage Controller
+	6605  T6225-OCP-SO Unified Wire Storage Controller
+	6606  T62100-OCP-SO Unified Wire Storage Controller
+	6607  T62100-LP-CR Unified Wire Storage Controller
+	6608  T62100-SO-CR Unified Wire Storage Controller
+	6609  T6210-BT Unified Wire Storage Controller
+	660d  T62100-CR Unified Wire Storage Controller
+	6611  T6225-LL-CR Unified Wire Storage Controller
+	6614  T61100-OCP-SO Unified Wire Storage Controller
+	6615  T6201-BT Unified Wire Storage Controller
+	6801  T6225-CR Unified Wire Ethernet Controller [VF]
+	6802  T6225-SO-CR Unified Wire Ethernet Controller [VF]
+	6803  T6425-CR Unified Wire Ethernet Controller [VF]
+	6804  T6425-SO-CR Unified Wire Ethernet Controller [VF]
+	6805  T6225-OCP-SO Unified Wire Ethernet Controller [VF]
+	6806  T62100-OCP-SO Unified Wire Ethernet Controller [VF]
+	6807  T62100-LP-CR Unified Wire Ethernet Controller [VF]
+	6808  T62100-SO-CR Unified Wire Ethernet Controller [VF]
+	6809  T6210-BT Unified Wire Ethernet Controller [VF]
+	680d  T62100-CR Unified Wire Ethernet Controller [VF]
+	6811  T6225-LL-CR Unified Wire Ethernet Controller [VF]
+	6814  T61100-OCP-SO Unified Wire Ethernet Controller [VF]
+	6815  T6201-BT Unified Wire Ethernet Controller [VF]
 	a000  PE10K Unified Wire Ethernet Controller
 1426  Storage Technology Corp.
 1427  Better On-Line Solutions
@@ -16923,6 +16996,7 @@
 	16bc  BCM57765/57785 SDXC/MMC Card Reader
 	16be  BCM57765/57785 MS Card Reader
 	16bf  BCM57765/57785 xD-Picture Card Reader
+	16c1  NetXtreme-E RDMA Virtual Function
 	16c6  NetXtreme BCM5702A3 Gigabit Ethernet
 		10b7 1100  3C1000B-T 10/100/1000 PCI
 		14e4 000c  BCM5702 1000Base-T
@@ -16969,7 +17043,9 @@
 	16e8  BCM57406 NetXtreme-E Ethernet Partition
 	16e9  BCM57407 NetXtreme-E 25Gb Ethernet Controller
 	16ec  BCM57414 NetXtreme-E Ethernet Partition
+	16ed  BCM57414 NetXtreme-E RDMA Partition
 	16ee  BCM57416 NetXtreme-E Ethernet Partition
+	16ef  BCM57416 NetXtreme-E RDMA Partition
 	16f3  NetXtreme BCM5727 Gigabit Ethernet PCIe
 	16f7  NetXtreme BCM5753 Gigabit Ethernet PCI Express
 	16fd  NetXtreme BCM5753M Gigabit Ethernet PCI Express
@@ -17896,6 +17972,7 @@
 	0209  MT27700 Family [ConnectX-4 Flash Recovery]
 	020b  MT27710 Family [ConnectX-4 Lx Flash Recovery]
 	020d  MT28800 Family [ConnectX-5 Flash Recovery]
+	020f  MT28908A0 Family [ConnectX-6 Flash Recovery]
 # reserved for RM#105916
 	024e  MT53100 [Spectrum-2, Flash recovery mode]
 # Actual value to be used
@@ -17913,6 +17990,7 @@
 	1005  MT27510 Family
 	1006  MT27511 Family
 	1007  MT27520 Family [ConnectX-3 Pro]
+		1014 04eb  2-Port 10GbE NIC and RoCE SR PCIe3
 		103c 22f3  InfiniBand FDR/Ethernet 10Gb/40Gb 2-port 544+QSFP Adapter
 		103c 22f4  InfiniBand FDR/Ethernet 10Gb/40Gb 2-port 544+FLR-QSFP Adapter
 		103c 801f  Ethernet 10G 2-port 546SFP+ Adapter
@@ -17938,8 +18016,8 @@
 	1018  MT27800 Family [ConnectX-5 Virtual Function]
 	1019  MT28800 Family [ConnectX-5 Ex]
 	101a  MT28800 Family [ConnectX-5 Ex Virtual Function]
-	101b  MT28831
-	101c  MT28840
+	101b  MT28908 Family [ConnectX-6]
+	101c  MT28908 Family [ConnectX-6 Virtual Function]
 	101d  MT28841
 	101e  MT28850
 	101f  MT28851
@@ -17969,6 +18047,7 @@
 		103c 1781  NC543i 1-port 4x QDR IB/Flex-10 10Gb Adapter
 		103c 3349  NC543i 2-port 4xQDR IB/10Gb Adapter
 	6750  MT26448 [ConnectX EN 10GigE, PCIe 2.0 5GT/s]
+		1014 0461  2-Port 10 GbE RoCE SR LP PCIe2 (rev b0)
 		15b3 0018  HP 10 GbE PCI-e G2 Dual-Port NIC (rev C1)
 	675a  MT25408 [ConnectX EN 10GigE 10GBaseT, PCIe Gen2 5GT/s]
 	6764  MT26468 [ConnectX EN 10GigE, PCIe 2.0 5GT/s Virtualization+]
@@ -17981,8 +18060,8 @@
 	7121  NPS-600 configuration and management interface
 	7122  NPS-600 network interface PF
 	7123  NPS-600 network interface VF
-	a2d0  MT416842
-	a2d1  MT416842
+	a2d0  MT416842 BlueField SoC Crypto enabled
+	a2d1  MT416842 BlueField SoC Crypto disabled
 	a2d3  MT416842 BlueField multicore SoC family VF
 # SwitchX-2, 40GbE switch
 	c738  MT51136
@@ -19231,7 +19310,7 @@
 18bc  GeCube Technologies, Inc.
 18c3  Micronas Semiconductor Holding AG
 	0720  nGene PCI-Express Multimedia Controller
-		07ca 032e  Hybrid M779 PCI-E
+		1461 032e  Hybrid M779 PCI-E
 # Nee Octigabay System
 18c8  Cray Inc
 18c9  ARVOO Engineering BV
@@ -19330,6 +19409,8 @@
 	0155  NT100E3-1-PTP Network Adapter 1x100Gb
 	0165  NT80E3-2-PTP Network Adapter 2x40Gb
 	0175  NT20E3-2-PTP Network Adapter 2x10Gb
+	0185  NT40A01-4x1 Network Adapter 4x1Gb
+	01a5  NT200A01 Network Adapter 2x100Gb
 18f6  NextIO
 	1000  [Nexsis] Switch Virtual P2P PCIe Bridge
 	1001  [Texsis] Switch Virtual P2P PCIe Bridge
@@ -19763,6 +19844,7 @@
 	0714  OneConnect 10Gb FCoE Initiator (be3)
 		103c 3315  NC553i 10Gb 2-port FlexFabric Converged Network Adapter
 		103c 337b  NC554FLB 10Gb 2-port FlexFabric Converged Network Adapter
+	0800  ServerView iRMC HTI
 19a8  DAQDATA GmbH
 19ac  Kasten Chase Applied Research
 	0001  ACA2400 Crypto Accelerator
@@ -20121,7 +20203,9 @@
 		1bb1 6523  Nytro XP6500-8A4096
 	0100  Nytro Flash Storage
 		1bb1 0101  Nytro XF1440
+		1bb1 0103  Nytro 5000
 		1bb1 0121  Nytro XM1440
+		1bb1 0123  Nytro 5000
 		1bb1 01a1  Nytro XP7102
 1bb3  Bluecherry
 	4304  BC-04120A MPEG4 4 port video encoder / decoder
@@ -20179,7 +20263,9 @@
 	00a5  FBC2XLG Capture 2x40Gb
 	00a6  FBC1CG Capture 1x100Gb
 	00a9  FBC2XGHH Capture 2x10Gb
+	00ad  FBC2CGG3HL Capture 2x200Gb
 	00af  Capture slave device
+	a001  FBC2CGG3 Capture 2x200Gb
 # Used on V120 VME Crate Controller
 1c32  Highland Technology, Inc.
 1c33  Daktronics, Inc
@@ -20259,10 +20345,15 @@
 	100b  K35-2SFP
 	100c  K35-4SFP
 	100d  AR-ARKA-FX0 [Arkville 32B DPDK Data Mover]
+		1d6c 2001  DPDK-Aware Virtual Function [Arkville VF]
 	100e  AR-ARKA-FX1 [Arkville 64B DPDK Data Mover]
+		1d6c 2001  DPDK-Aware Virtual Function [Arkville VF]
 	4200  A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument]
 1d78  DERA
+1d7c  Aerotech, Inc.
 1d8f  Enyx
+1d95  Graphcore Ltd
+1da1  Teko Telecom S.r.l.
 1de1  Tekram Technology Co.,Ltd.
 	0391  TRM-S1040 [DC-315 / DC-395 series]
 	2020  DC-390
@@ -20346,6 +20437,7 @@
 2bd8  ROPEX Industrie-Elektronik GmbH
 3000  Hansol Electronics Inc.
 3112  Satelco Ingenieria S.A.
+3130  AUDIOTRAK
 3142  Post Impression Systems.
 31ab  Zonet
 	1faa  ZEW1602 802.11b/g Wireless Adapter
@@ -22681,6 +22773,8 @@
 		8086 5004  Ethernet 10G 2P X540-t Adapter
 	1529  82599 10 Gigabit Dual Port Network Connection with FCoE
 	152a  82599 10 Gigabit Dual Port Backplane Connection with FCoE
+	152e  82599 Virtual Function
+	1530  X540 Virtual Function
 	1533  I210 Gigabit Network Connection
 		103c 0003  Ethernet I210-T1 GbE NIC
 		1093 7706  Compact Vision System Ethernet Adapter
@@ -22736,6 +22830,7 @@
 		8086 0001  Ethernet Converged Network Adapter X550-T2
 		8086 001a  Ethernet Converged Network Adapter X550-T2
 		8086 0022  Ethernet Converged Network Adapter X550-T2
+	1564  X550 Virtual Function
 	1565  X550 Virtual Function
 	1566  DSL4410 Thunderbolt NHI [Redwood Ridge 2C 2013]
 	1567  DSL4410 Thunderbolt Bridge [Redwood Ridge 2C 2013]
@@ -22755,10 +22850,12 @@
 		103c 0000  Ethernet 10Gb 562SFP+ Adapter
 		103c 22fc  HP Ethernet 10Gb 2-port 562FLR-SFP+ Adapter
 		103c 22fd  HP Ethernet 10Gb 2-port 562SFP+ Adapter
-		1137 0000  Ethernet Converged NIC X710-4
-		1137 013b  Ethernet Converged NIC X710-4
-		1590 0000  Ethernet 10GbE 4P 563SFP+ Adapter
+		1137 0000  Ethernet Converged NIC X710-DA
+		1137 013b  Ethernet Converged NIC X710-DA4
+		1137 020a  Ethernet Converged NIC X710-DA2
+		1590 0000  Ethernet Controller X710 for 10GbE SFP+
 		1590 0225  Ethernet 10GbE 4P 563SFP+ Adapter
+		1590 022f  Ethernet 10Gb 2-port 564i Communication Board
 		17aa 0000  ThinkServer X710 AnyFabric for 10GbE SFP+
 		17aa 4001  ThinkServer X710-4 AnyFabric for 10GbE SFP+
 		17aa 4002  ThinkServer X710-2 AnyFabric for 10GbE SFP+
@@ -22775,7 +22872,7 @@
 		8086 000b  Ethernet Server Adapter X710-DA2 for OCP
 		8086 000d  Ethernet Controller X710 for 10GbE SFP+
 		8086 0010  Ethernet Converged Network Adapter X710
-		8086 4005  Ethernet Controller XL710 for 10 Gigabit SFP+
+		8086 4005  Ethernet Controller X710 for 10GbE SFP+
 		8086 4006  Ethernet Controller X710 for 10GbE SFP+
 	1575  DSL6340 Thunderbolt 3 NHI [Alpine Ridge 2C 2015]
 	1576  DSL6340 Thunderbolt 3 Bridge [Alpine Ridge 2C 2015]
@@ -22847,12 +22944,14 @@
 	15a4  Ethernet Switch FM10000 Host Interface
 	15a5  Ethernet Switch FM10000 Host Virtual Interface
 	15a8  Ethernet Connection X552 Virtual Function
+	15a9  X552 Virtual Function
 	15aa  Ethernet Connection X552 10 GbE Backplane
 		1059 0120  T4008 10GbE interface
 	15ab  Ethernet Connection X552 10 GbE Backplane
 	15ac  Ethernet Connection X552 10 GbE SFP+
 	15ad  Ethernet Connection X552/X557-AT 10GBASE-T
 	15ae  Ethernet Connection X552 1000BASE-T
+	15b4  X553 Virtual Function
 	15b5  DSL6340 USB 3.1 Controller [Alpine Ridge]
 	15b6  DSL6540 USB 3.1 Controller [Alpine Ridge]
 	15b7  Ethernet Connection (2) I219-LM
@@ -22860,6 +22959,7 @@
 	15b9  Ethernet Connection (3) I219-LM
 	15bf  JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016]
 	15c0  JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016]
+	15c5  X553 Virtual Function
 	15d0  Ethernet SDI Adapter FM10420-100GbE-QDA2
 	15d1  Ethernet Controller 10G X550T
 		8086 0002  Ethernet Converged Network Adapter X550-T1
@@ -22974,7 +23074,30 @@
 		e4bf 3100  CX1-BAND
 	1962  80960RM (i960RM) Microprocessor
 		105a 0000  SuperTrak SX6000 I2O CPU
+	19ac  DNV SMBus Contoller - Host
+	19b0  DNV SATA Controller 0
+	19b1  DNV SATA Controller 0
+	19b2  DNV SATA Controller 0
+	19b3  DNV SATA Controller 0
+	19b4  DNV SATA Controller 0
+	19b5  DNV SATA Controller 0
+	19b6  DNV SATA Controller 0
+	19b7  DNV SATA Controller 0
+	19be  DNV SATA Controller 0
+	19bf  DNV SATA Controller 0
+	19c0  DNV SATA Controller 1
+	19c1  DNV SATA Controller 1
+	19c2  DNV SATA Controller 1
+	19c3  DNV SATA Controller 1
+	19c4  DNV SATA Controller 1
+	19c5  DNV SATA Controller 1
+	19c6  DNV SATA Controller 1
+	19c7  DNV SATA Controller 1
+	19ce  DNV SATA Controller 1
+	19cf  DNV SATA Controller 1
+	19dc  DNV LPC or eSPI
 	19df  DNV SMBus controller
+	19e0  DNV SPI Controller
 	1a21  82840 840 [Carmel] Chipset Host Bridge (Hub A)
 	1a23  82840 840 [Carmel] Chipset AGP Bridge
 	1a24  82840 840 [Carmel] Chipset PCI Bridge (Hub B)
@@ -25845,6 +25968,9 @@
 	2f09  Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3
 	2f0a  Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3
 	2f0b  Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3
+	2f0d  Haswell Xeon Non-Transparent Bridge (Back-to-back)
+	2f0e  Haswell Xeon Non-Transparent Bridge (Primary Side)
+	2f0f  Haswell Xeon Non-Transparent Bridge (Secondary Side)
 	2f10  Xeon E7 v3/Xeon E5 v3/Core i7 IIO Debug
 	2f11  Xeon E7 v3/Xeon E5 v3/Core i7 IIO Debug
 	2f12  Xeon E7 v3/Xeon E5 v3/Core i7 IIO Debug
@@ -26272,19 +26398,22 @@
 		17aa 4023  Intel Ethernet Connection X722 for 10GbE backplane
 	37cf  Ethernet Connection X722 for 10GbE QSFP+
 	37d0  Ethernet Connection X722 for 10GbE SFP+
+		17aa 4020  Intel Ethernet Connection X722 for 10G SFP+
+		17aa 4021  Intel Ethernet Connection X722 for 10G SFP+
+		17aa 4022  Ethernet Connection X722 for 10GbE SFP+
 	37d1  Ethernet Connection X722 for 1GbE
+		1590 0216  Ethernet 1Gb 2-port 368i Adapter
+		1590 0217  Ethernet 1Gb 2-port 368FLR-MMT Adapter
 		17aa 4020  Intel Ethernet Connection X722 for 1GbE
 		17aa 4021  Intel Ethernet Connection X722 for 1GbE
 		17aa 4022  Intel Ethernet Connection X722 for 1GbE
-		8086 4020  Ethernet Connection X722 for 1GbE
-		8086 4021  Ethernet Connection X722 for 1GbE
-		8086 4022  Ethernet Connection X722 for 1GbE
 	37d2  Ethernet Connection X722 for 10GBASE-T
+		1590 0218  Ethernet 10Gb 2-port 568FLR-MMT Adapter
 		17aa 4020  Intel Ethernet Connection X722 for 10GBASE
 		17aa 4021  Intel Ethernet Connection X722 for 10GBASE
-		8086 4020  Ethernet Connection X722 for 10GBASE
-		8086 4021  Ethernet Connection X722 for 10GBASE
+		17aa 4022  Ethernet Connection X722 for 10GBASE-T
 	37d3  Ethernet Connection X722 for 10GbE SFP+
+		1590 0219  Ethernet 10Gb 2-port 568FLR-MMSFP+ Adapter
 	37d4  Ethernet Connection X722 for 10GbE QSFP+
 	37d9  X722 Hyper-V Virtual Function
 	3a00  82801JD/DO (ICH10 Family) 4-port SATA IDE Controller
@@ -27641,6 +27770,7 @@
 	a16a  Sunrise Point-H PCI Root Port #20
 	a170  Sunrise Point-H HD Audio
 	a182  Lewisburg SATA Controller [AHCI mode]
+	a186  Lewisburg SATA Controller [RAID mode]
 	a190  Lewisburg PCI Express Root Port #1
 	a191  Lewisburg PCI Express Root Port #2
 	a192  Lewisburg PCI Express Root Port #3
@@ -27676,6 +27806,7 @@
 	a1c6  Lewisburg LPC Controller
 	a1c7  Lewisburg LPC Controller
 	a1d2  Lewisburg SSATA Controller [AHCI mode]
+	a1d6  Lewisburg SSATA Controller [RAID mode]
 	a1e7  Lewisburg PCI Express Root Port #17
 	a1e8  Lewisburg PCI Express Root Port #18
 	a1e9  Lewisburg PCI Express Root Port #19
@@ -27687,6 +27818,14 @@
 	a1fa  Lewisburg IE: IDE-r
 	a1fb  Lewisburg IE: KT Controller
 	a1fc  Lewisburg IE: HECI #3
+	a202  Lewisburg SATA Controller [AHCI mode]
+	a206  Lewisburg SATA Controller [RAID mode]
+	a223  Lewisburg SMBus
+	a224  Lewisburg SPI Controller
+	a242  Lewisburg LPC or eSPI Controller
+	a243  Lewisburg LPC or eSPI Controller
+	a252  Lewisburg SSATA Controller [AHCI mode]
+	a256  Lewisburg SSATA Controller [RAID mode]
 	a620  6400/6402 Advanced Memory Buffer (AMB)
 	abc0  Omni-Path Fabric Switch Silicon 100 Series
 	b152  21152 PCI-to-PCI Bridge

From owner-svn-src-all@freebsd.org  Mon Dec 12 06:58:45 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAE38C734E9;
 Mon, 12 Dec 2016 06:58:45 +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 737CE10A5;
 Mon, 12 Dec 2016 06:58:45 +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 uBC6wijE082784;
 Mon, 12 Dec 2016 06:58:44 GMT (envelope-from bapt@FreeBSD.org)
Received: (from bapt@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC6wiqh082783;
 Mon, 12 Dec 2016 06:58:44 GMT (envelope-from bapt@FreeBSD.org)
Message-Id: <201612120658.uBC6wiqh082783@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bapt set sender to
 bapt@FreeBSD.org using -f
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Mon, 12 Dec 2016 06:58:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309877 - stable/10/share/misc
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 06:58:45 -0000

Author: bapt
Date: Mon Dec 12 06:58:44 2016
New Revision: 309877
URL: https://svnweb.freebsd.org/changeset/base/309877

Log:
  MFC r309795:
  
  Update pci ids database to 2016.11.21

Modified:
  stable/10/share/misc/pci_vendors
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/misc/pci_vendors
==============================================================================
--- stable/10/share/misc/pci_vendors	Mon Dec 12 06:56:19 2016	(r309876)
+++ stable/10/share/misc/pci_vendors	Mon Dec 12 06:58:44 2016	(r309877)
@@ -3,8 +3,8 @@
 #
 #	List of PCI ID's
 #
-#	Version: 2016.10.20
-#	Date:    2016-10-20 03:15:02
+#	Version: 2016.11.21
+#	Date:    2016-11-21 03:15:01
 #
 #	Maintained by Albert Pool, Martin Mares, and other volunteers from
 #	the PCI ID Project at http://pci-ids.ucw.cz/.
@@ -50,9 +50,11 @@
 021b  Compaq Computer Corporation
 	8139  HNE-300 (RealTek RTL8139c) [iPaq Networking]
 0270  Hauppauge computer works Inc. (Wrong ID)
+0291  Davicom Semiconductor, Inc. (Wrong ID)
 # SpeedStream is Efficient Networks, Inc, a Siemens Company
 02ac  SpeedStream
 	1012  1012 PCMCIA 10/100 Ethernet Card [RTL81xx]
+02e0  XFX Pine Group Inc. (Wrong ID)
 0303  Hewlett-Packard Company (Wrong ID)
 0308  ZyXEL Communications Corporation (Wrong ID)
 0315  SK-Electronics Co., Ltd.
@@ -548,12 +550,12 @@
 		1028 1fd3  HBA330 MMZ
 	00ab  SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC)
 	00ac  SAS3416 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)
-		1d49 0201  ThinkSystem 9400-16i PCIe 12Gb HBA
-		1d49 0203  ThinkSystem 9400-16e PCIe 12Gb HBA
+		1d49 0201  ThinkSystem 430-16i SAS/SATA 12Gb HBA
+		1d49 0203  ThinkSystem 430-16e SAS/SATA 12Gb HBA
 	00ae  SAS3508 Fusion-MPT Tri-Mode RAID On Chip (ROC)
 	00af  SAS3408 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)
-		1d49 0200  ThinkSystem 9400-8i PCIe 12Gb HBA
-		1d49 0202  ThinkSystem 9400-8e PCIe 12Gb HBA
+		1d49 0200  ThinkSystem 430-8i SAS/SATA 12Gb HBA
+		1d49 0202  ThinkSystem 430-8e SAS/SATA 12Gb HBA
 	00be  SAS3504 Fusion-MPT Tri-Mode RAID On Chip (ROC)
 	00bf  SAS3404 Fusion-MPT Tri-Mode I/O Controller Chip (IOC)
 	00c0  SAS3324 PCI-Express Fusion-MPT SAS-3
@@ -7531,7 +7533,7 @@
 		1885 0700  Tsunami FPGA PMC with Altera Stratix S40
 		1885 0701  Tsunami FPGA PMC with Altera Stratix S30
 	9733  PEX 9733 33-lane, 9-port PCI Express Gen 3 (8.0 GT/s) Switch
-		1d49 0001  ThinkSystem P310W-4P NVMe Switch Card
+		1d49 0001  ThinkSystem 1610-4P NVMe Switch Adapter
 	9749  PEX 9749 49-lane, 13-port PCI Express Gen 3 (8.0 GT/s) Switch
 	a100  Blackmagic Design DeckLink
 	bb04  B&B 3PCIOSD1A Isolated PCI Serial
@@ -8377,6 +8379,7 @@
 		1048 0c45  GLoria II
 		1048 0c4a  GLoria II-64 Pro
 		1048 0c4b  GLoria II-64 Pro DVII
+		10a9 9002  VPro VR3
 	0110  NV11 [GeForce2 MX/MX 400]
 		1043 4015  AGP-V7100 Pro
 		1043 4021  V7100 Deluxe Combo
@@ -10649,6 +10652,7 @@
 	1b00  GP102 [TITAN X]
 	1b01  GP102
 	1b30  GP102GL [Quadro P6000]
+	1b38  GP102GL [Tesla P40]
 	1b70  GP102GL
 	1b78  GP102GL
 	1b80  GP104 [GeForce GTX 1080]
@@ -10668,10 +10672,11 @@
 	1c03  GP106 [GeForce GTX 1060 6GB]
 	1c20  GP106M [GeForce GTX 1060]
 	1c30  GP106GL
+	1c35  GP106
 	1c60  GP106M [GeForce GTX 1060]
 	1c70  GP106GL
 	1c80  GP107
-	1c81  GP107
+	1c81  GP107 [GeForce GTX 1050]
 	1c82  GP107 [GeForce GTX 1050 Ti]
 	1ca7  GP107GL
 	1ca8  GP107GL
@@ -13729,6 +13734,7 @@
 	7375  PM7375 [LASAR-155 ATM SAR]
 	7384  PM7384 [FREEDM - 84P672 Frm Engine & Datalink Mgr]
 	8000  PM8000  [SPC - SAS Protocol Controller]
+	8009  PM8009 SPCve 8x6G
 	8032  ATTO Celerity FC8xEN
 		117c 003b  Celerity FC-82EN Fibre Channel Adapter
 		117c 003c  Celerity FC-84EN Fibre Channel Adapter
@@ -13742,6 +13748,8 @@
 	8071  PM8071 Tachyon SPCve 12G eight-port SAS/SATA controller
 	8072  PM8072 Tachyon SPCv 12G 16-port SAS/SATA controller
 	8073  PM8073 Tachyon SPCve 12G 16-port SAS/SATA controller
+	8531  PM8531 PFX 24xG3 Fanout PCIe Switches
+	8546  PM8546 B-FEIP PSX 96xG3 PCIe Storage Switch
 11f9  I-Cube Inc
 11fa  Kasan Electronics Company, Ltd.
 11fb  Datel Inc
@@ -16213,6 +16221,71 @@
 	589a  T520-509A Unified Wire Ethernet Controller [VF]
 	589b  T540-509B Unified Wire Ethernet Controller [VF]
 	589c  T520-509C Unified Wire Ethernet Controller [VF]
+	6001  T6225-CR Unified Wire Ethernet Controller
+	6002  T6225-SO-CR Unified Wire Ethernet Controller
+	6003  T6425-CR Unified Wire Ethernet Controller
+	6004  T6425-SO-CR Unified Wire Ethernet Controller
+	6005  T6225-OCP-SO Unified Wire Ethernet Controller
+	6006  T62100-OCP-SO Unified Wire Ethernet Controller
+	6007  T62100-LP-CR Unified Wire Ethernet Controller
+	6008  T62100-SO-CR Unified Wire Ethernet Controller
+	6009  T6210-BT Unified Wire Ethernet Controller
+	600d  T62100-CR Unified Wire Ethernet Controller
+	6011  T6225-LL-CR Unified Wire Ethernet Controller
+	6014  T61100-OCP-SO Unified Wire Ethernet Controller
+	6015  T6201-BT Unified Wire Ethernet Controller
+	6401  T6225-CR Unified Wire Ethernet Controller
+	6402  T6225-SO-CR Unified Wire Ethernet Controller
+	6403  T6425-CR Unified Wire Ethernet Controller
+	6404  T6425-SO-CR Unified Wire Ethernet Controller
+	6405  T6225-OCP-SO Unified Wire Ethernet Controller
+	6406  T62100-OCP-SO Unified Wire Ethernet Controller
+	6407  T62100-LP-CR Unified Wire Ethernet Controller
+	6408  T62100-SO-CR Unified Wire Ethernet Controller
+	6409  T6210-BT Unified Wire Ethernet Controller
+	640d  T62100-CR Unified Wire Ethernet Controller
+	6411  T6225-LL-CR Unified Wire Ethernet Controller
+	6414  T61100-OCP-SO Unified Wire Ethernet Controller
+	6415  T6201-BT Unified Wire Ethernet Controller
+	6501  T6225-CR Unified Wire Storage Controller
+	6502  T6225-SO-CR Unified Wire Storage Controller
+	6503  T6425-CR Unified Wire Storage Controller
+	6504  T6425-SO-CR Unified Wire Storage Controller
+	6505  T6225-OCP-SO Unified Wire Storage Controller
+	6506  T62100-OCP-SO Unified Wire Storage Controller
+	6507  T62100-LP-CR Unified Wire Storage Controller
+	6508  T62100-SO-CR Unified Wire Storage Controller
+	6509  T6210-BT Unified Wire Storage Controller
+	650d  T62100-CR Unified Wire Storage Controller
+	6511  T6225-LL-CR Unified Wire Storage Controller
+	6514  T61100-OCP-SO Unified Wire Storage Controller
+	6515  T6201-BT Unified Wire Storage Controller
+	6601  T6225-CR Unified Wire Storage Controller
+	6602  T6225-SO-CR Unified Wire Storage Controller
+	6603  T6425-CR Unified Wire Storage Controller
+	6604  T6425-SO-CR Unified Wire Storage Controller
+	6605  T6225-OCP-SO Unified Wire Storage Controller
+	6606  T62100-OCP-SO Unified Wire Storage Controller
+	6607  T62100-LP-CR Unified Wire Storage Controller
+	6608  T62100-SO-CR Unified Wire Storage Controller
+	6609  T6210-BT Unified Wire Storage Controller
+	660d  T62100-CR Unified Wire Storage Controller
+	6611  T6225-LL-CR Unified Wire Storage Controller
+	6614  T61100-OCP-SO Unified Wire Storage Controller
+	6615  T6201-BT Unified Wire Storage Controller
+	6801  T6225-CR Unified Wire Ethernet Controller [VF]
+	6802  T6225-SO-CR Unified Wire Ethernet Controller [VF]
+	6803  T6425-CR Unified Wire Ethernet Controller [VF]
+	6804  T6425-SO-CR Unified Wire Ethernet Controller [VF]
+	6805  T6225-OCP-SO Unified Wire Ethernet Controller [VF]
+	6806  T62100-OCP-SO Unified Wire Ethernet Controller [VF]
+	6807  T62100-LP-CR Unified Wire Ethernet Controller [VF]
+	6808  T62100-SO-CR Unified Wire Ethernet Controller [VF]
+	6809  T6210-BT Unified Wire Ethernet Controller [VF]
+	680d  T62100-CR Unified Wire Ethernet Controller [VF]
+	6811  T6225-LL-CR Unified Wire Ethernet Controller [VF]
+	6814  T61100-OCP-SO Unified Wire Ethernet Controller [VF]
+	6815  T6201-BT Unified Wire Ethernet Controller [VF]
 	a000  PE10K Unified Wire Ethernet Controller
 1426  Storage Technology Corp.
 1427  Better On-Line Solutions
@@ -16923,6 +16996,7 @@
 	16bc  BCM57765/57785 SDXC/MMC Card Reader
 	16be  BCM57765/57785 MS Card Reader
 	16bf  BCM57765/57785 xD-Picture Card Reader
+	16c1  NetXtreme-E RDMA Virtual Function
 	16c6  NetXtreme BCM5702A3 Gigabit Ethernet
 		10b7 1100  3C1000B-T 10/100/1000 PCI
 		14e4 000c  BCM5702 1000Base-T
@@ -16969,7 +17043,9 @@
 	16e8  BCM57406 NetXtreme-E Ethernet Partition
 	16e9  BCM57407 NetXtreme-E 25Gb Ethernet Controller
 	16ec  BCM57414 NetXtreme-E Ethernet Partition
+	16ed  BCM57414 NetXtreme-E RDMA Partition
 	16ee  BCM57416 NetXtreme-E Ethernet Partition
+	16ef  BCM57416 NetXtreme-E RDMA Partition
 	16f3  NetXtreme BCM5727 Gigabit Ethernet PCIe
 	16f7  NetXtreme BCM5753 Gigabit Ethernet PCI Express
 	16fd  NetXtreme BCM5753M Gigabit Ethernet PCI Express
@@ -17896,6 +17972,7 @@
 	0209  MT27700 Family [ConnectX-4 Flash Recovery]
 	020b  MT27710 Family [ConnectX-4 Lx Flash Recovery]
 	020d  MT28800 Family [ConnectX-5 Flash Recovery]
+	020f  MT28908A0 Family [ConnectX-6 Flash Recovery]
 # reserved for RM#105916
 	024e  MT53100 [Spectrum-2, Flash recovery mode]
 # Actual value to be used
@@ -17913,6 +17990,7 @@
 	1005  MT27510 Family
 	1006  MT27511 Family
 	1007  MT27520 Family [ConnectX-3 Pro]
+		1014 04eb  2-Port 10GbE NIC and RoCE SR PCIe3
 		103c 22f3  InfiniBand FDR/Ethernet 10Gb/40Gb 2-port 544+QSFP Adapter
 		103c 22f4  InfiniBand FDR/Ethernet 10Gb/40Gb 2-port 544+FLR-QSFP Adapter
 		103c 801f  Ethernet 10G 2-port 546SFP+ Adapter
@@ -17938,8 +18016,8 @@
 	1018  MT27800 Family [ConnectX-5 Virtual Function]
 	1019  MT28800 Family [ConnectX-5 Ex]
 	101a  MT28800 Family [ConnectX-5 Ex Virtual Function]
-	101b  MT28831
-	101c  MT28840
+	101b  MT28908 Family [ConnectX-6]
+	101c  MT28908 Family [ConnectX-6 Virtual Function]
 	101d  MT28841
 	101e  MT28850
 	101f  MT28851
@@ -17969,6 +18047,7 @@
 		103c 1781  NC543i 1-port 4x QDR IB/Flex-10 10Gb Adapter
 		103c 3349  NC543i 2-port 4xQDR IB/10Gb Adapter
 	6750  MT26448 [ConnectX EN 10GigE, PCIe 2.0 5GT/s]
+		1014 0461  2-Port 10 GbE RoCE SR LP PCIe2 (rev b0)
 		15b3 0018  HP 10 GbE PCI-e G2 Dual-Port NIC (rev C1)
 	675a  MT25408 [ConnectX EN 10GigE 10GBaseT, PCIe Gen2 5GT/s]
 	6764  MT26468 [ConnectX EN 10GigE, PCIe 2.0 5GT/s Virtualization+]
@@ -17981,8 +18060,8 @@
 	7121  NPS-600 configuration and management interface
 	7122  NPS-600 network interface PF
 	7123  NPS-600 network interface VF
-	a2d0  MT416842
-	a2d1  MT416842
+	a2d0  MT416842 BlueField SoC Crypto enabled
+	a2d1  MT416842 BlueField SoC Crypto disabled
 	a2d3  MT416842 BlueField multicore SoC family VF
 # SwitchX-2, 40GbE switch
 	c738  MT51136
@@ -19231,7 +19310,7 @@
 18bc  GeCube Technologies, Inc.
 18c3  Micronas Semiconductor Holding AG
 	0720  nGene PCI-Express Multimedia Controller
-		07ca 032e  Hybrid M779 PCI-E
+		1461 032e  Hybrid M779 PCI-E
 # Nee Octigabay System
 18c8  Cray Inc
 18c9  ARVOO Engineering BV
@@ -19330,6 +19409,8 @@
 	0155  NT100E3-1-PTP Network Adapter 1x100Gb
 	0165  NT80E3-2-PTP Network Adapter 2x40Gb
 	0175  NT20E3-2-PTP Network Adapter 2x10Gb
+	0185  NT40A01-4x1 Network Adapter 4x1Gb
+	01a5  NT200A01 Network Adapter 2x100Gb
 18f6  NextIO
 	1000  [Nexsis] Switch Virtual P2P PCIe Bridge
 	1001  [Texsis] Switch Virtual P2P PCIe Bridge
@@ -19763,6 +19844,7 @@
 	0714  OneConnect 10Gb FCoE Initiator (be3)
 		103c 3315  NC553i 10Gb 2-port FlexFabric Converged Network Adapter
 		103c 337b  NC554FLB 10Gb 2-port FlexFabric Converged Network Adapter
+	0800  ServerView iRMC HTI
 19a8  DAQDATA GmbH
 19ac  Kasten Chase Applied Research
 	0001  ACA2400 Crypto Accelerator
@@ -20121,7 +20203,9 @@
 		1bb1 6523  Nytro XP6500-8A4096
 	0100  Nytro Flash Storage
 		1bb1 0101  Nytro XF1440
+		1bb1 0103  Nytro 5000
 		1bb1 0121  Nytro XM1440
+		1bb1 0123  Nytro 5000
 		1bb1 01a1  Nytro XP7102
 1bb3  Bluecherry
 	4304  BC-04120A MPEG4 4 port video encoder / decoder
@@ -20179,7 +20263,9 @@
 	00a5  FBC2XLG Capture 2x40Gb
 	00a6  FBC1CG Capture 1x100Gb
 	00a9  FBC2XGHH Capture 2x10Gb
+	00ad  FBC2CGG3HL Capture 2x200Gb
 	00af  Capture slave device
+	a001  FBC2CGG3 Capture 2x200Gb
 # Used on V120 VME Crate Controller
 1c32  Highland Technology, Inc.
 1c33  Daktronics, Inc
@@ -20259,10 +20345,15 @@
 	100b  K35-2SFP
 	100c  K35-4SFP
 	100d  AR-ARKA-FX0 [Arkville 32B DPDK Data Mover]
+		1d6c 2001  DPDK-Aware Virtual Function [Arkville VF]
 	100e  AR-ARKA-FX1 [Arkville 64B DPDK Data Mover]
+		1d6c 2001  DPDK-Aware Virtual Function [Arkville VF]
 	4200  A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument]
 1d78  DERA
+1d7c  Aerotech, Inc.
 1d8f  Enyx
+1d95  Graphcore Ltd
+1da1  Teko Telecom S.r.l.
 1de1  Tekram Technology Co.,Ltd.
 	0391  TRM-S1040 [DC-315 / DC-395 series]
 	2020  DC-390
@@ -20346,6 +20437,7 @@
 2bd8  ROPEX Industrie-Elektronik GmbH
 3000  Hansol Electronics Inc.
 3112  Satelco Ingenieria S.A.
+3130  AUDIOTRAK
 3142  Post Impression Systems.
 31ab  Zonet
 	1faa  ZEW1602 802.11b/g Wireless Adapter
@@ -22681,6 +22773,8 @@
 		8086 5004  Ethernet 10G 2P X540-t Adapter
 	1529  82599 10 Gigabit Dual Port Network Connection with FCoE
 	152a  82599 10 Gigabit Dual Port Backplane Connection with FCoE
+	152e  82599 Virtual Function
+	1530  X540 Virtual Function
 	1533  I210 Gigabit Network Connection
 		103c 0003  Ethernet I210-T1 GbE NIC
 		1093 7706  Compact Vision System Ethernet Adapter
@@ -22736,6 +22830,7 @@
 		8086 0001  Ethernet Converged Network Adapter X550-T2
 		8086 001a  Ethernet Converged Network Adapter X550-T2
 		8086 0022  Ethernet Converged Network Adapter X550-T2
+	1564  X550 Virtual Function
 	1565  X550 Virtual Function
 	1566  DSL4410 Thunderbolt NHI [Redwood Ridge 2C 2013]
 	1567  DSL4410 Thunderbolt Bridge [Redwood Ridge 2C 2013]
@@ -22755,10 +22850,12 @@
 		103c 0000  Ethernet 10Gb 562SFP+ Adapter
 		103c 22fc  HP Ethernet 10Gb 2-port 562FLR-SFP+ Adapter
 		103c 22fd  HP Ethernet 10Gb 2-port 562SFP+ Adapter
-		1137 0000  Ethernet Converged NIC X710-4
-		1137 013b  Ethernet Converged NIC X710-4
-		1590 0000  Ethernet 10GbE 4P 563SFP+ Adapter
+		1137 0000  Ethernet Converged NIC X710-DA
+		1137 013b  Ethernet Converged NIC X710-DA4
+		1137 020a  Ethernet Converged NIC X710-DA2
+		1590 0000  Ethernet Controller X710 for 10GbE SFP+
 		1590 0225  Ethernet 10GbE 4P 563SFP+ Adapter
+		1590 022f  Ethernet 10Gb 2-port 564i Communication Board
 		17aa 0000  ThinkServer X710 AnyFabric for 10GbE SFP+
 		17aa 4001  ThinkServer X710-4 AnyFabric for 10GbE SFP+
 		17aa 4002  ThinkServer X710-2 AnyFabric for 10GbE SFP+
@@ -22775,7 +22872,7 @@
 		8086 000b  Ethernet Server Adapter X710-DA2 for OCP
 		8086 000d  Ethernet Controller X710 for 10GbE SFP+
 		8086 0010  Ethernet Converged Network Adapter X710
-		8086 4005  Ethernet Controller XL710 for 10 Gigabit SFP+
+		8086 4005  Ethernet Controller X710 for 10GbE SFP+
 		8086 4006  Ethernet Controller X710 for 10GbE SFP+
 	1575  DSL6340 Thunderbolt 3 NHI [Alpine Ridge 2C 2015]
 	1576  DSL6340 Thunderbolt 3 Bridge [Alpine Ridge 2C 2015]
@@ -22847,12 +22944,14 @@
 	15a4  Ethernet Switch FM10000 Host Interface
 	15a5  Ethernet Switch FM10000 Host Virtual Interface
 	15a8  Ethernet Connection X552 Virtual Function
+	15a9  X552 Virtual Function
 	15aa  Ethernet Connection X552 10 GbE Backplane
 		1059 0120  T4008 10GbE interface
 	15ab  Ethernet Connection X552 10 GbE Backplane
 	15ac  Ethernet Connection X552 10 GbE SFP+
 	15ad  Ethernet Connection X552/X557-AT 10GBASE-T
 	15ae  Ethernet Connection X552 1000BASE-T
+	15b4  X553 Virtual Function
 	15b5  DSL6340 USB 3.1 Controller [Alpine Ridge]
 	15b6  DSL6540 USB 3.1 Controller [Alpine Ridge]
 	15b7  Ethernet Connection (2) I219-LM
@@ -22860,6 +22959,7 @@
 	15b9  Ethernet Connection (3) I219-LM
 	15bf  JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016]
 	15c0  JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016]
+	15c5  X553 Virtual Function
 	15d0  Ethernet SDI Adapter FM10420-100GbE-QDA2
 	15d1  Ethernet Controller 10G X550T
 		8086 0002  Ethernet Converged Network Adapter X550-T1
@@ -22974,7 +23074,30 @@
 		e4bf 3100  CX1-BAND
 	1962  80960RM (i960RM) Microprocessor
 		105a 0000  SuperTrak SX6000 I2O CPU
+	19ac  DNV SMBus Contoller - Host
+	19b0  DNV SATA Controller 0
+	19b1  DNV SATA Controller 0
+	19b2  DNV SATA Controller 0
+	19b3  DNV SATA Controller 0
+	19b4  DNV SATA Controller 0
+	19b5  DNV SATA Controller 0
+	19b6  DNV SATA Controller 0
+	19b7  DNV SATA Controller 0
+	19be  DNV SATA Controller 0
+	19bf  DNV SATA Controller 0
+	19c0  DNV SATA Controller 1
+	19c1  DNV SATA Controller 1
+	19c2  DNV SATA Controller 1
+	19c3  DNV SATA Controller 1
+	19c4  DNV SATA Controller 1
+	19c5  DNV SATA Controller 1
+	19c6  DNV SATA Controller 1
+	19c7  DNV SATA Controller 1
+	19ce  DNV SATA Controller 1
+	19cf  DNV SATA Controller 1
+	19dc  DNV LPC or eSPI
 	19df  DNV SMBus controller
+	19e0  DNV SPI Controller
 	1a21  82840 840 [Carmel] Chipset Host Bridge (Hub A)
 	1a23  82840 840 [Carmel] Chipset AGP Bridge
 	1a24  82840 840 [Carmel] Chipset PCI Bridge (Hub B)
@@ -25845,6 +25968,9 @@
 	2f09  Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3
 	2f0a  Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3
 	2f0b  Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3
+	2f0d  Haswell Xeon Non-Transparent Bridge (Back-to-back)
+	2f0e  Haswell Xeon Non-Transparent Bridge (Primary Side)
+	2f0f  Haswell Xeon Non-Transparent Bridge (Secondary Side)
 	2f10  Xeon E7 v3/Xeon E5 v3/Core i7 IIO Debug
 	2f11  Xeon E7 v3/Xeon E5 v3/Core i7 IIO Debug
 	2f12  Xeon E7 v3/Xeon E5 v3/Core i7 IIO Debug
@@ -26272,19 +26398,22 @@
 		17aa 4023  Intel Ethernet Connection X722 for 10GbE backplane
 	37cf  Ethernet Connection X722 for 10GbE QSFP+
 	37d0  Ethernet Connection X722 for 10GbE SFP+
+		17aa 4020  Intel Ethernet Connection X722 for 10G SFP+
+		17aa 4021  Intel Ethernet Connection X722 for 10G SFP+
+		17aa 4022  Ethernet Connection X722 for 10GbE SFP+
 	37d1  Ethernet Connection X722 for 1GbE
+		1590 0216  Ethernet 1Gb 2-port 368i Adapter
+		1590 0217  Ethernet 1Gb 2-port 368FLR-MMT Adapter
 		17aa 4020  Intel Ethernet Connection X722 for 1GbE
 		17aa 4021  Intel Ethernet Connection X722 for 1GbE
 		17aa 4022  Intel Ethernet Connection X722 for 1GbE
-		8086 4020  Ethernet Connection X722 for 1GbE
-		8086 4021  Ethernet Connection X722 for 1GbE
-		8086 4022  Ethernet Connection X722 for 1GbE
 	37d2  Ethernet Connection X722 for 10GBASE-T
+		1590 0218  Ethernet 10Gb 2-port 568FLR-MMT Adapter
 		17aa 4020  Intel Ethernet Connection X722 for 10GBASE
 		17aa 4021  Intel Ethernet Connection X722 for 10GBASE
-		8086 4020  Ethernet Connection X722 for 10GBASE
-		8086 4021  Ethernet Connection X722 for 10GBASE
+		17aa 4022  Ethernet Connection X722 for 10GBASE-T
 	37d3  Ethernet Connection X722 for 10GbE SFP+
+		1590 0219  Ethernet 10Gb 2-port 568FLR-MMSFP+ Adapter
 	37d4  Ethernet Connection X722 for 10GbE QSFP+
 	37d9  X722 Hyper-V Virtual Function
 	3a00  82801JD/DO (ICH10 Family) 4-port SATA IDE Controller
@@ -27641,6 +27770,7 @@
 	a16a  Sunrise Point-H PCI Root Port #20
 	a170  Sunrise Point-H HD Audio
 	a182  Lewisburg SATA Controller [AHCI mode]
+	a186  Lewisburg SATA Controller [RAID mode]
 	a190  Lewisburg PCI Express Root Port #1
 	a191  Lewisburg PCI Express Root Port #2
 	a192  Lewisburg PCI Express Root Port #3
@@ -27676,6 +27806,7 @@
 	a1c6  Lewisburg LPC Controller
 	a1c7  Lewisburg LPC Controller
 	a1d2  Lewisburg SSATA Controller [AHCI mode]
+	a1d6  Lewisburg SSATA Controller [RAID mode]
 	a1e7  Lewisburg PCI Express Root Port #17
 	a1e8  Lewisburg PCI Express Root Port #18
 	a1e9  Lewisburg PCI Express Root Port #19
@@ -27687,6 +27818,14 @@
 	a1fa  Lewisburg IE: IDE-r
 	a1fb  Lewisburg IE: KT Controller
 	a1fc  Lewisburg IE: HECI #3
+	a202  Lewisburg SATA Controller [AHCI mode]
+	a206  Lewisburg SATA Controller [RAID mode]
+	a223  Lewisburg SMBus
+	a224  Lewisburg SPI Controller
+	a242  Lewisburg LPC or eSPI Controller
+	a243  Lewisburg LPC or eSPI Controller
+	a252  Lewisburg SSATA Controller [AHCI mode]
+	a256  Lewisburg SSATA Controller [RAID mode]
 	a620  6400/6402 Advanced Memory Buffer (AMB)
 	abc0  Omni-Path Fabric Switch Silicon 100 Series
 	b152  21152 PCI-to-PCI Bridge

From owner-svn-src-all@freebsd.org  Mon Dec 12 07:00:16 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42DA1C7358B;
 Mon, 12 Dec 2016 07:00:16 +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 11D0C1271;
 Mon, 12 Dec 2016 07:00:15 +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 uBC70F2s083108;
 Mon, 12 Dec 2016 07:00:15 GMT (envelope-from bapt@FreeBSD.org)
Received: (from bapt@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC70F0s083106;
 Mon, 12 Dec 2016 07:00:15 GMT (envelope-from bapt@FreeBSD.org)
Message-Id: <201612120700.uBC70F0s083106@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bapt set sender to
 bapt@FreeBSD.org using -f
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Mon, 12 Dec 2016 07:00:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309878 - in stable/11/contrib/groff: contrib/mm
 src/utils/afmtodit
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 07:00:16 -0000

Author: bapt
Date: Mon Dec 12 07:00:14 2016
New Revision: 309878
URL: https://svnweb.freebsd.org/changeset/base/309878

Log:
  MFC r309796:
  
  Perl is not available in base fix scripts depending on it to use
  the version from ports
  
  PR:		215159
  Reported by:	Anatoly Kamchatnov <akamch@gmail.com>

Modified:
  stable/11/contrib/groff/contrib/mm/mmroff.pl
  stable/11/contrib/groff/src/utils/afmtodit/afmtodit.pl
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/groff/contrib/mm/mmroff.pl
==============================================================================
--- stable/11/contrib/groff/contrib/mm/mmroff.pl	Mon Dec 12 06:58:44 2016	(r309877)
+++ stable/11/contrib/groff/contrib/mm/mmroff.pl	Mon Dec 12 07:00:14 2016	(r309878)
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#! /usr/bin/env perl
 
 use strict;
 # runs groff in safe mode, that seems to be the default

Modified: stable/11/contrib/groff/src/utils/afmtodit/afmtodit.pl
==============================================================================
--- stable/11/contrib/groff/src/utils/afmtodit/afmtodit.pl	Mon Dec 12 06:58:44 2016	(r309877)
+++ stable/11/contrib/groff/src/utils/afmtodit/afmtodit.pl	Mon Dec 12 07:00:14 2016	(r309878)
@@ -1,4 +1,4 @@
-#! /usr/bin/perl -w
+#! /usr/bin/env perl -w
 # -*- Perl -*-
 # Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005
 # Free Software Foundation, Inc.

From owner-svn-src-all@freebsd.org  Mon Dec 12 07:01:07 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 533B7C735EC;
 Mon, 12 Dec 2016 07:01:07 +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 221D115B8;
 Mon, 12 Dec 2016 07: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 uBC716c6083851;
 Mon, 12 Dec 2016 07:01:06 GMT (envelope-from bapt@FreeBSD.org)
Received: (from bapt@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC716xe083849;
 Mon, 12 Dec 2016 07:01:06 GMT (envelope-from bapt@FreeBSD.org)
Message-Id: <201612120701.uBC716xe083849@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bapt set sender to
 bapt@FreeBSD.org using -f
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Mon, 12 Dec 2016 07:01:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309879 - in stable/10/contrib/groff: contrib/mm
 src/utils/afmtodit
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 07:01:07 -0000

Author: bapt
Date: Mon Dec 12 07:01:05 2016
New Revision: 309879
URL: https://svnweb.freebsd.org/changeset/base/309879

Log:
  MFC r309796:
  
  Perl is not available in base fix scripts depending on it to use
  the version from ports
  
  PR:		215159
  Reported by:	Anatoly Kamchatnov <akamch@gmail.com>

Modified:
  stable/10/contrib/groff/contrib/mm/mmroff.pl
  stable/10/contrib/groff/src/utils/afmtodit/afmtodit.pl
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/groff/contrib/mm/mmroff.pl
==============================================================================
--- stable/10/contrib/groff/contrib/mm/mmroff.pl	Mon Dec 12 07:00:14 2016	(r309878)
+++ stable/10/contrib/groff/contrib/mm/mmroff.pl	Mon Dec 12 07:01:05 2016	(r309879)
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#! /usr/bin/env perl
 
 use strict;
 # runs groff in safe mode, that seems to be the default

Modified: stable/10/contrib/groff/src/utils/afmtodit/afmtodit.pl
==============================================================================
--- stable/10/contrib/groff/src/utils/afmtodit/afmtodit.pl	Mon Dec 12 07:00:14 2016	(r309878)
+++ stable/10/contrib/groff/src/utils/afmtodit/afmtodit.pl	Mon Dec 12 07:01:05 2016	(r309879)
@@ -1,4 +1,4 @@
-#! /usr/bin/perl -w
+#! /usr/bin/env perl -w
 # -*- Perl -*-
 # Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005
 # Free Software Foundation, Inc.

From owner-svn-src-all@freebsd.org  Mon Dec 12 07:02:55 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E073C7377C;
 Mon, 12 Dec 2016 07:02: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 E17691846;
 Mon, 12 Dec 2016 07:02:54 +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 uBC72sdq086771;
 Mon, 12 Dec 2016 07:02:54 GMT (envelope-from bapt@FreeBSD.org)
Received: (from bapt@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC72sb7086770;
 Mon, 12 Dec 2016 07:02:54 GMT (envelope-from bapt@FreeBSD.org)
Message-Id: <201612120702.uBC72sb7086770@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bapt set sender to
 bapt@FreeBSD.org using -f
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Mon, 12 Dec 2016 07:02:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309880 - stable/11/usr.sbin/pw
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 07:02:55 -0000

Author: bapt
Date: Mon Dec 12 07:02:53 2016
New Revision: 309880
URL: https://svnweb.freebsd.org/changeset/base/309880

Log:
  MFC r309803:
  
  Fix pw groupshow <gid>
  
  PR:		204676
  Submitted by:	longwitz@incore.de

Modified:
  stable/11/usr.sbin/pw/pw_group.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/pw/pw_group.c
==============================================================================
--- stable/11/usr.sbin/pw/pw_group.c	Mon Dec 12 07:01:05 2016	(r309879)
+++ stable/11/usr.sbin/pw/pw_group.c	Mon Dec 12 07:02:53 2016	(r309880)
@@ -282,7 +282,7 @@ int
 pw_group_show(int argc, char **argv, char *arg1)
 {
 	struct group *grp = NULL;
-	char *name;
+	char *name = NULL;
 	intmax_t id = -1;
 	int ch;
 	bool all, force, quiet, pretty;

From owner-svn-src-all@freebsd.org  Mon Dec 12 07:03:11 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBD53C737DC;
 Mon, 12 Dec 2016 07:03:11 +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 B84D41966;
 Mon, 12 Dec 2016 07:03:11 +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 uBC73ATT086840;
 Mon, 12 Dec 2016 07:03:10 GMT (envelope-from bapt@FreeBSD.org)
Received: (from bapt@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC73A3R086839;
 Mon, 12 Dec 2016 07:03:10 GMT (envelope-from bapt@FreeBSD.org)
Message-Id: <201612120703.uBC73A3R086839@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bapt set sender to
 bapt@FreeBSD.org using -f
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Mon, 12 Dec 2016 07:03:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309881 - stable/10/usr.sbin/pw
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 07:03:12 -0000

Author: bapt
Date: Mon Dec 12 07:03:10 2016
New Revision: 309881
URL: https://svnweb.freebsd.org/changeset/base/309881

Log:
  MFC r309803:
  
  Fix pw groupshow <gid>
  
  PR:		204676
  Submitted by:	longwitz@incore.de

Modified:
  stable/10/usr.sbin/pw/pw_group.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/pw/pw_group.c
==============================================================================
--- stable/10/usr.sbin/pw/pw_group.c	Mon Dec 12 07:02:53 2016	(r309880)
+++ stable/10/usr.sbin/pw/pw_group.c	Mon Dec 12 07:03:10 2016	(r309881)
@@ -282,7 +282,7 @@ int
 pw_group_show(int argc, char **argv, char *arg1)
 {
 	struct group *grp = NULL;
-	char *name;
+	char *name = NULL;
 	intmax_t id = -1;
 	int ch;
 	bool all, force, quiet, pretty;

From owner-svn-src-all@freebsd.org  Mon Dec 12 09:43:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 140CBC705FE;
 Mon, 12 Dec 2016 09:43:50 +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 D131FA7A;
 Mon, 12 Dec 2016 09:43:49 +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 uBC9hnxC051228;
 Mon, 12 Dec 2016 09:43:49 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBC9hmmh051227;
 Mon, 12 Dec 2016 09:43:48 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612120943.uBC9hmmh051227@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Mon, 12 Dec 2016 09:43:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309882 - stable/11/sys/x86/iommu
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 09:43:50 -0000

Author: kib
Date: Mon Dec 12 09:43:48 2016
New Revision: 309882
URL: https://svnweb.freebsd.org/changeset/base/309882

Log:
  MFC r309550:
  Rename fast taskqueues used by DMAR.

Modified:
  stable/11/sys/x86/iommu/intel_fault.c
  stable/11/sys/x86/iommu/intel_qi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/x86/iommu/intel_fault.c
==============================================================================
--- stable/11/sys/x86/iommu/intel_fault.c	Mon Dec 12 07:03:10 2016	(r309881)
+++ stable/11/sys/x86/iommu/intel_fault.c	Mon Dec 12 09:43:48 2016	(r309882)
@@ -271,7 +271,7 @@ dmar_init_fault_log(struct dmar_unit *un
 	    M_DEVBUF, M_WAITOK | M_ZERO);
 
 	TASK_INIT(&unit->fault_task, 0, dmar_fault_task, unit);
-	unit->fault_taskqueue = taskqueue_create_fast("dmar", M_WAITOK,
+	unit->fault_taskqueue = taskqueue_create_fast("dmarff", M_WAITOK,
 	    taskqueue_thread_enqueue, &unit->fault_taskqueue);
 	taskqueue_start_threads(&unit->fault_taskqueue, 1, PI_AV,
 	    "dmar%d fault taskq", unit->unit);

Modified: stable/11/sys/x86/iommu/intel_qi.c
==============================================================================
--- stable/11/sys/x86/iommu/intel_qi.c	Mon Dec 12 07:03:10 2016	(r309881)
+++ stable/11/sys/x86/iommu/intel_qi.c	Mon Dec 12 09:43:48 2016	(r309882)
@@ -378,7 +378,7 @@ dmar_init_qi(struct dmar_unit *unit)
 
 	TAILQ_INIT(&unit->tlb_flush_entries);
 	TASK_INIT(&unit->qi_task, 0, dmar_qi_task, unit);
-	unit->qi_taskqueue = taskqueue_create_fast("dmar", M_WAITOK,
+	unit->qi_taskqueue = taskqueue_create_fast("dmarqf", M_WAITOK,
 	    taskqueue_thread_enqueue, &unit->qi_taskqueue);
 	taskqueue_start_threads(&unit->qi_taskqueue, 1, PI_AV,
 	    "dmar%d qi taskq", unit->unit);

From owner-svn-src-all@freebsd.org  Mon Dec 12 10:57:34 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59FF0C71B4E;
 Mon, 12 Dec 2016 10:57:34 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 345901004;
 Mon, 12 Dec 2016 10:57:34 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCAvX5E079726;
 Mon, 12 Dec 2016 10:57:33 GMT (envelope-from ae@FreeBSD.org)
Received: (from ae@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCAvXaK079722;
 Mon, 12 Dec 2016 10:57:33 GMT (envelope-from ae@FreeBSD.org)
Message-Id: <201612121057.uBCAvXaK079722@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
 using -f
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Mon, 12 Dec 2016 10:57:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309883 - in head/sys: conf netinet6
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 10:57:34 -0000

Author: ae
Date: Mon Dec 12 10:57:32 2016
New Revision: 309883
URL: https://svnweb.freebsd.org/changeset/base/309883

Log:
  Add ip6_tryforward() - a run to completion forwarding implementation
  for IPv6.
  
  It gets performance benefits from reduced number of checks. It doesn't
  copy mbuf to be able send ICMPv6 error message, because it keeps mbuf
  unchanged until the moment, when the route decision has been made.
  It doesn't do IPsec checks, and when some IPsec security policies present,
  ip6_input() uses normal slow path.
  
  Reviewed by:	bz, gnn
  Obtained from:	Yandex LLC
  MFC after:	1 month
  Sponsored by:	Yandex LLC
  Differential Revision:	https://reviews.freebsd.org/D8527

Added:
  head/sys/netinet6/ip6_fastfwd.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/netinet6/in6_var.h
  head/sys/netinet6/ip6_input.c

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Mon Dec 12 09:43:48 2016	(r309882)
+++ head/sys/conf/files	Mon Dec 12 10:57:32 2016	(r309883)
@@ -4129,6 +4129,7 @@ netinet6/in6_proto.c		optional inet6
 netinet6/in6_rmx.c		optional inet6
 netinet6/in6_rss.c		optional inet6 rss
 netinet6/in6_src.c		optional inet6
+netinet6/ip6_fastfwd.c		optional inet6
 netinet6/ip6_forward.c		optional inet6
 netinet6/ip6_gre.c		optional gre inet6
 netinet6/ip6_id.c		optional inet6

Modified: head/sys/netinet6/in6_var.h
==============================================================================
--- head/sys/netinet6/in6_var.h	Mon Dec 12 09:43:48 2016	(r309882)
+++ head/sys/netinet6/in6_var.h	Mon Dec 12 10:57:32 2016	(r309883)
@@ -819,6 +819,7 @@ void	in6_newaddrmsg(struct in6_ifaddr *,
 /*
  * Extended API for IPv6 FIB support.
  */
+struct mbuf *ip6_tryforward(struct mbuf *);
 void	in6_rtredirect(struct sockaddr *, struct sockaddr *, struct sockaddr *,
 	    int, struct sockaddr *, u_int);
 int	in6_rtrequest(int, struct sockaddr *, struct sockaddr *,

Added: head/sys/netinet6/ip6_fastfwd.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/netinet6/ip6_fastfwd.c	Mon Dec 12 10:57:32 2016	(r309883)
@@ -0,0 +1,295 @@
+/*-
+ * Copyright (c) 2014-2016 Andrey V. Elsukov <ae@FreeBSD.org>
+ * 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "opt_inet6.h"
+#include "opt_ipstealth.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+
+#include <net/if.h>
+#include <net/if_var.h>
+#include <net/route.h>
+#include <net/pfil.h>
+#include <net/vnet.h>
+
+#include <netinet/in.h>
+#include <netinet/in_kdtrace.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_var.h>
+#include <netinet/ip6.h>
+#include <netinet/icmp6.h>
+#include <netinet6/in6_var.h>
+#include <netinet6/in6_fib.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/nd6.h>
+
+static int
+ip6_findroute(struct nhop6_basic *pnh, const struct sockaddr_in6 *dst,
+    struct mbuf *m)
+{
+
+	if (fib6_lookup_nh_basic(M_GETFIB(m), &dst->sin6_addr,
+	    dst->sin6_scope_id, 0, dst->sin6_flowinfo, pnh) != 0) {
+		IP6STAT_INC(ip6s_noroute);
+		IP6STAT_INC(ip6s_cantforward);
+		icmp6_error(m, ICMP6_DST_UNREACH,
+		    ICMP6_DST_UNREACH_NOROUTE, 0);
+		return (EHOSTUNREACH);
+	}
+	if (pnh->nh_flags & NHF_BLACKHOLE) {
+		IP6STAT_INC(ip6s_cantforward);
+		m_freem(m);
+		return (EHOSTUNREACH);
+	}
+
+	if (pnh->nh_flags & NHF_REJECT) {
+		IP6STAT_INC(ip6s_cantforward);
+		icmp6_error(m, ICMP6_DST_UNREACH,
+		    ICMP6_DST_UNREACH_REJECT, 0);
+		return (EHOSTUNREACH);
+	}
+	return (0);
+}
+
+struct mbuf*
+ip6_tryforward(struct mbuf *m)
+{
+	struct sockaddr_in6 dst;
+	struct nhop6_basic nh;
+	struct m_tag *fwd_tag;
+	struct ip6_hdr *ip6;
+	struct ifnet *rcvif;
+	uint32_t plen;
+	int error;
+
+	/*
+	 * Fallback conditions to ip6_input for slow path processing.
+	 */
+	ip6 = mtod(m, struct ip6_hdr *);
+	if (ip6->ip6_nxt == IPPROTO_HOPOPTS ||
+	    IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) ||
+	    IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_dst) ||
+	    IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src) ||
+	    IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src) ||
+	    in6_localip(&ip6->ip6_dst))
+		return (m);
+	/*
+	 * Check that the amount of data in the buffers
+	 * is as at least much as the IPv6 header would have us expect.
+	 * Trim mbufs if longer than we expect.
+	 * Drop packet if shorter than we expect.
+	 */
+	rcvif = m->m_pkthdr.rcvif;
+	plen = ntohs(ip6->ip6_plen);
+	if (plen == 0) {
+		/*
+		 * Jumbograms must have hop-by-hop header and go via
+		 * slow path.
+		 */
+		IP6STAT_INC(ip6s_badoptions);
+		goto dropin;
+	}
+	if (m->m_pkthdr.len - sizeof(struct ip6_hdr) < plen) {
+		IP6STAT_INC(ip6s_tooshort);
+		in6_ifstat_inc(rcvif, ifs6_in_truncated);
+		goto dropin;
+	}
+	if (m->m_pkthdr.len > sizeof(struct ip6_hdr) + plen) {
+		if (m->m_len == m->m_pkthdr.len) {
+			m->m_len = sizeof(struct ip6_hdr) + plen;
+			m->m_pkthdr.len = sizeof(struct ip6_hdr) + plen;
+		} else
+			m_adj(m, sizeof(struct ip6_hdr) + plen -
+			    m->m_pkthdr.len);
+	}
+
+	/*
+	 * Hop limit.
+	 */
+#ifdef IPSTEALTH
+	if (!V_ip6stealth)
+#endif
+	if (ip6->ip6_hlim <= IPV6_HLIMDEC) {
+		icmp6_error(m, ICMP6_TIME_EXCEEDED,
+		    ICMP6_TIME_EXCEED_TRANSIT, 0);
+		m = NULL;
+		goto dropin;
+	}
+
+	bzero(&dst, sizeof(dst));
+	dst.sin6_family = AF_INET6;
+	dst.sin6_len = sizeof(dst);
+	dst.sin6_addr = ip6->ip6_dst;
+
+	/*
+	 * Incoming packet firewall processing.
+	 */
+	if (!PFIL_HOOKED(&V_inet6_pfil_hook))
+		goto passin;
+	if (pfil_run_hooks(&V_inet6_pfil_hook, &m, rcvif, PFIL_IN,
+	    NULL) != 0 || m == NULL)
+		goto dropin;
+	/*
+	 * If packet filter sets the M_FASTFWD_OURS flag, this means
+	 * that new destination or next hop is our local address.
+	 * So, we can just go back to ip6_input.
+	 * XXX: should we decrement ip6_hlim in such case?
+	 *
+	 * Also it can forward packet to another destination, e.g.
+	 * M_IP6_NEXTHOP flag is set and fwd_tag is attached to mbuf.
+	 */
+	if (m->m_flags & M_FASTFWD_OURS)
+		return (m);
+
+	ip6 = mtod(m, struct ip6_hdr *);
+	if ((m->m_flags & M_IP6_NEXTHOP) &&
+	    (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) {
+		/*
+		 * Now we will find route to forwarded by pfil destination.
+		 */
+		bcopy((fwd_tag + 1), &dst, sizeof(dst));
+		m->m_flags &= ~M_IP6_NEXTHOP;
+		m_tag_delete(m, fwd_tag);
+	} else {
+		/* Update dst since pfil could change it */
+		dst.sin6_addr = ip6->ip6_dst;
+	}
+passin:
+	/*
+	 * Find route to destination.
+	 */
+	if (ip6_findroute(&nh, &dst, m) != 0) {
+		m = NULL;
+		in6_ifstat_inc(rcvif, ifs6_in_noroute);
+		goto dropin;
+	}
+	/*
+	 * We used slow path processing for packets with scoped addresses.
+	 * So, scope checks aren't needed here.
+	 */
+	if (m->m_pkthdr.len > nh.nh_mtu) {
+		in6_ifstat_inc(nh.nh_ifp, ifs6_in_toobig);
+		icmp6_error(m, ICMP6_PACKET_TOO_BIG, 0, nh.nh_mtu);
+		m = NULL;
+		goto dropout;
+	}
+
+	/*
+	 * Outgoing packet firewall processing.
+	 */
+	if (!PFIL_HOOKED(&V_inet6_pfil_hook))
+		goto passout;
+	if (pfil_run_hooks(&V_inet6_pfil_hook, &m, nh.nh_ifp, PFIL_OUT,
+	    NULL) != 0 || m == NULL)
+		goto dropout;
+	/*
+	 * If packet filter sets the M_FASTFWD_OURS flag, this means
+	 * that new destination or next hop is our local address.
+	 * So, we can just go back to ip6_input.
+	 *
+	 * Also it can forward packet to another destination, e.g.
+	 * M_IP6_NEXTHOP flag is set and fwd_tag is attached to mbuf.
+	 */
+	if (m->m_flags & M_FASTFWD_OURS) {
+		/*
+		 * XXX: we did one hop and should decrement hop limit. But
+		 * now we are the destination and just don't pay attention.
+		 */
+		return (m);
+	}
+	/*
+	 * Again. A packet filter could change the destination address.
+	 */
+	ip6 = mtod(m, struct ip6_hdr *);
+	if (m->m_flags & M_IP6_NEXTHOP)
+		fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL);
+	else
+		fwd_tag = NULL;
+
+	if (fwd_tag != NULL ||
+	    !IN6_ARE_ADDR_EQUAL(&dst.sin6_addr, &ip6->ip6_dst)) {
+		if (fwd_tag != NULL) {
+			bcopy((fwd_tag + 1), &dst, sizeof(dst));
+			m->m_flags &= ~M_IP6_NEXTHOP;
+			m_tag_delete(m, fwd_tag);
+		} else
+			dst.sin6_addr = ip6->ip6_dst;
+		/*
+		 * Redo route lookup with new destination address
+		 */
+		if (ip6_findroute(&nh, &dst, m) != 0) {
+			m = NULL;
+			goto dropout;
+		}
+	}
+passout:
+#ifdef IPSTEALTH
+	if (!V_ip6stealth)
+#endif
+	{
+		ip6->ip6_hlim -= IPV6_HLIMDEC;
+	}
+
+	m_clrprotoflags(m);	/* Avoid confusing lower layers. */
+	IP_PROBE(send, NULL, NULL, ip6, nh.nh_ifp, NULL, ip6);
+
+	/*
+	 * XXX: we need to use destination address with embedded scope
+	 * zone id, because LLTABLE uses such form of addresses for lookup.
+	 */
+	dst.sin6_addr = nh.nh_addr;
+	if (IN6_IS_SCOPE_LINKLOCAL(&dst.sin6_addr))
+		dst.sin6_addr.s6_addr16[1] = htons(nh.nh_ifp->if_index & 0xffff);
+
+	error = (*nh.nh_ifp->if_output)(nh.nh_ifp, m,
+	    (struct sockaddr *)&dst, NULL);
+	if (error != 0) {
+		in6_ifstat_inc(nh.nh_ifp, ifs6_out_discard);
+		IP6STAT_INC(ip6s_cantforward);
+	} else {
+		in6_ifstat_inc(nh.nh_ifp, ifs6_out_forward);
+		IP6STAT_INC(ip6s_forward);
+	}
+	return (NULL);
+dropin:
+	in6_ifstat_inc(rcvif, ifs6_in_discard);
+	goto drop;
+dropout:
+	in6_ifstat_inc(nh.nh_ifp, ifs6_out_discard);
+drop:
+	if (m != NULL)
+		m_freem(m);
+	return (NULL);
+}
+

Modified: head/sys/netinet6/ip6_input.c
==============================================================================
--- head/sys/netinet6/ip6_input.c	Mon Dec 12 09:43:48 2016	(r309882)
+++ head/sys/netinet6/ip6_input.c	Mon Dec 12 10:57:32 2016	(r309883)
@@ -119,6 +119,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet6/in6_rss.h>
 
 #ifdef IPSEC
+#include <netipsec/key.h>
 #include <netipsec/ipsec.h>
 #include <netinet6/ip6_ipsec.h>
 #include <netipsec/ipsec6.h>
@@ -554,6 +555,12 @@ ip6_input(struct mbuf *m)
 	int nxt, ours = 0;
 	int srcrt = 0;
 
+	/*
+	 * Drop the packet if IPv6 operation is disabled on the interface.
+	 */
+	if ((ND_IFINFO(m->m_pkthdr.rcvif)->flags & ND6_IFF_IFDISABLED))
+		goto bad;
+
 #ifdef IPSEC
 	/*
 	 * should the inner packet be considered authentic?
@@ -597,10 +604,6 @@ ip6_input(struct mbuf *m)
 			IP6STAT_INC(ip6s_m1);
 	}
 
-	/* drop the packet if IPv6 operation is disabled on the IF */
-	if ((ND_IFINFO(m->m_pkthdr.rcvif)->flags & ND6_IFF_IFDISABLED))
-		goto bad;
-
 	in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_receive);
 	IP6STAT_INC(ip6s_total);
 
@@ -728,12 +731,21 @@ ip6_input(struct mbuf *m)
 		goto bad;
 	}
 #endif
+	/* Try to forward the packet, but if we fail continue */
 #ifdef IPSEC
+	if (V_ip6_forwarding != 0 && !key_havesp(IPSEC_DIR_INBOUND) &&
+	    !key_havesp(IPSEC_DIR_OUTBOUND))
+		if (ip6_tryforward(m) == NULL)
+			return;
 	/*
 	 * Bypass packet filtering for packets previously handled by IPsec.
 	 */
 	if (ip6_ipsec_filtertunnel(m))
 		goto passin;
+#else
+	if (V_ip6_forwarding != 0)
+		if (ip6_tryforward(m) == NULL)
+			return;
 #endif /* IPSEC */
 
 	/*

From owner-svn-src-all@freebsd.org  Mon Dec 12 11:02:57 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 291CFC71E83;
 Mon, 12 Dec 2016 11:02:57 +0000 (UTC)
 (envelope-from brueffer@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EC0ED155F;
 Mon, 12 Dec 2016 11:02:56 +0000 (UTC)
 (envelope-from brueffer@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCB2uhi083476;
 Mon, 12 Dec 2016 11:02:56 GMT (envelope-from brueffer@FreeBSD.org)
Received: (from brueffer@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCB2uW1083475;
 Mon, 12 Dec 2016 11:02:56 GMT (envelope-from brueffer@FreeBSD.org)
Message-Id: <201612121102.uBCB2uW1083475@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brueffer set sender to
 brueffer@FreeBSD.org using -f
From: Christian Brueffer <brueffer@FreeBSD.org>
Date: Mon, 12 Dec 2016 11:02:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309884 - stable/11/tools/tools/nanobsd/Files/root
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 11:02:57 -0000

Author: brueffer
Date: Mon Dec 12 11:02:55 2016
New Revision: 309884
URL: https://svnweb.freebsd.org/changeset/base/309884

Log:
  MFC: r309060
  
  Fix comment typo.
  
  PR:		208484
  Submitted by:	madpilot

Modified:
  stable/11/tools/tools/nanobsd/Files/root/save_cfg
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/tools/nanobsd/Files/root/save_cfg
==============================================================================
--- stable/11/tools/tools/nanobsd/Files/root/save_cfg	Mon Dec 12 10:57:32 2016	(r309883)
+++ stable/11/tools/tools/nanobsd/Files/root/save_cfg	Mon Dec 12 11:02:55 2016	(r309884)
@@ -66,7 +66,7 @@ do
 			#	i) -> add file to ignore list (/cfg/.ignore hiereachy) and never save
 			#	      try to add this file to /cfg.
 			#
-			# touch is ised to add files to /cfg to keep the script flow straight and easy
+			# touch is used to add files to /cfg to keep the script flow straight and easy
 			#
 			read -p "New file /etc/$filename found. Add to /cfg (y/n/i)? " key
 			case "$key" in

From owner-svn-src-all@freebsd.org  Mon Dec 12 11:04:23 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D27DDC71F05;
 Mon, 12 Dec 2016 11:04:23 +0000 (UTC)
 (envelope-from brueffer@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A0E3716DB;
 Mon, 12 Dec 2016 11:04:23 +0000 (UTC)
 (envelope-from brueffer@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCB4MjR083603;
 Mon, 12 Dec 2016 11:04:22 GMT (envelope-from brueffer@FreeBSD.org)
Received: (from brueffer@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCB4MOS083602;
 Mon, 12 Dec 2016 11:04:22 GMT (envelope-from brueffer@FreeBSD.org)
Message-Id: <201612121104.uBCB4MOS083602@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brueffer set sender to
 brueffer@FreeBSD.org using -f
From: Christian Brueffer <brueffer@FreeBSD.org>
Date: Mon, 12 Dec 2016 11:04:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309885 - stable/10/tools/tools/nanobsd/Files/root
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 11:04:23 -0000

Author: brueffer
Date: Mon Dec 12 11:04:22 2016
New Revision: 309885
URL: https://svnweb.freebsd.org/changeset/base/309885

Log:
  MFC: r309060
  
  Fix comment typo.
  
  PR:		208484
  Submitted by:	madpilot

Modified:
  stable/10/tools/tools/nanobsd/Files/root/save_cfg
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tools/tools/nanobsd/Files/root/save_cfg
==============================================================================
--- stable/10/tools/tools/nanobsd/Files/root/save_cfg	Mon Dec 12 11:02:55 2016	(r309884)
+++ stable/10/tools/tools/nanobsd/Files/root/save_cfg	Mon Dec 12 11:04:22 2016	(r309885)
@@ -66,7 +66,7 @@ do
 			#	i) -> add file to ignore list (/cfg/.ignore hiereachy) and never save
 			#	      try to add this file to /cfg.
 			#
-			# touch is ised to add files to /cfg to keep the script flow straight and easy
+			# touch is used to add files to /cfg to keep the script flow straight and easy
 			#
 			read -p "New file /etc/$filename found. Add to /cfg (y/n/i)? " key
 			case "$key" in

From owner-svn-src-all@freebsd.org  Mon Dec 12 11:11:51 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90F4CC722E3;
 Mon, 12 Dec 2016 11:11:51 +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 608F71BB3;
 Mon, 12 Dec 2016 11:11:51 +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 uBCBBonj086827;
 Mon, 12 Dec 2016 11:11:50 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCBBoE3086826;
 Mon, 12 Dec 2016 11:11:50 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612121111.uBCBBoE3086826@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Mon, 12 Dec 2016 11:11:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309886 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 11:11:51 -0000

Author: kib
Date: Mon Dec 12 11:11:50 2016
New Revision: 309886
URL: https://svnweb.freebsd.org/changeset/base/309886

Log:
  When a zombie gets reparented due to the parent exit, send SIGCHLD to
  the reaper.
  
  The traditional reaper init(8) is aware of zombies silently reparented
  to it after the parents exit, it loops around waitpid(2) to collect
  them.  For other reapers, the silent reparenting is surprising and
  collecting zombies requires a thread blocking in waitpid(2) just for
  that purpose.  It seems that sending second SIGCHLD is a better
  workaround than forcing all reapers to obey the setup.
  
  Reported by:	 Michael Zuo <muh.muhten@gmail.com>, jilles
  PR:	213928
  Reviewed by:	jilles (previous version)
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/kern/kern_exit.c

Modified: head/sys/kern/kern_exit.c
==============================================================================
--- head/sys/kern/kern_exit.c	Mon Dec 12 11:04:22 2016	(r309885)
+++ head/sys/kern/kern_exit.c	Mon Dec 12 11:11:50 2016	(r309886)
@@ -455,6 +455,11 @@ exit1(struct thread *td, int rval, int s
 
 		if (!(q->p_flag & P_TRACED)) {
 			proc_reparent(q, q->p_reaper);
+			if (q->p_state == PRS_ZOMBIE) {
+				PROC_LOCK(q->p_reaper);
+				pksignal(q->p_reaper, SIGCHLD, q->p_ksi);
+				PROC_UNLOCK(q->p_reaper);
+			}
 		} else {
 			/*
 			 * Traced processes are killed since their existence

From owner-svn-src-all@freebsd.org  Mon Dec 12 11:12:06 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 389FCC7231E;
 Mon, 12 Dec 2016 11:12:06 +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 04C5D1DCD;
 Mon, 12 Dec 2016 11:12:05 +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 uBCBC5W9087628;
 Mon, 12 Dec 2016 11:12:05 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCBC5Ho087627;
 Mon, 12 Dec 2016 11:12:05 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612121112.uBCBC5Ho087627@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Mon, 12 Dec 2016 11:12:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309887 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 11:12:06 -0000

Author: kib
Date: Mon Dec 12 11:12:04 2016
New Revision: 309887
URL: https://svnweb.freebsd.org/changeset/base/309887

Log:
  Enable lookup_cap_dotdot and lookup_cap_dotdot_nonlocal.
  
  Requested and reviewed by:	cem
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks
  Differential revision:	https://reviews.freebsd.org/D8746

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c	Mon Dec 12 11:11:50 2016	(r309886)
+++ head/sys/kern/vfs_lookup.c	Mon Dec 12 11:12:04 2016	(r309887)
@@ -161,16 +161,11 @@ static int lookup_shared = 1;
 SYSCTL_INT(_vfs, OID_AUTO, lookup_shared, CTLFLAG_RWTUN, &lookup_shared, 0,
     "enables shared locks for path name translation");
 
-/*
- * Intent is that lookup_cap_dotdot becomes unconditionally enabled,
- * but it defaults to the disabled state until verification efforts
- * are complete.
- */
-static int lookup_cap_dotdot = 0;
+static int lookup_cap_dotdot = 1;
 SYSCTL_INT(_vfs, OID_AUTO, lookup_cap_dotdot, CTLFLAG_RWTUN,
     &lookup_cap_dotdot, 0,
     "enables \"..\" components in path lookup in capability mode");
-static int lookup_cap_dotdot_nonlocal = 0;
+static int lookup_cap_dotdot_nonlocal = 1;
 SYSCTL_INT(_vfs, OID_AUTO, lookup_cap_dotdot_nonlocal, CTLFLAG_RWTUN,
     &lookup_cap_dotdot_nonlocal, 0,
     "enables \"..\" components in path lookup in capability mode "

From owner-svn-src-all@freebsd.org  Mon Dec 12 11:27:00 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF20C72940;
 Mon, 12 Dec 2016 11:27:00 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C6FDEA37;
 Mon, 12 Dec 2016 11:27:00 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCBQxbI091917;
 Mon, 12 Dec 2016 11:26:59 GMT (envelope-from ae@FreeBSD.org)
Received: (from ae@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCBQxQ9091916;
 Mon, 12 Dec 2016 11:26:59 GMT (envelope-from ae@FreeBSD.org)
Message-Id: <201612121126.uBCBQxQ9091916@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
 using -f
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Mon, 12 Dec 2016 11:26:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309888 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 11:27:01 -0000

Author: ae
Date: Mon Dec 12 11:26:59 2016
New Revision: 309888
URL: https://svnweb.freebsd.org/changeset/base/309888

Log:
  Modify IPv6 statistic accounting in ip6_input().
  
  Add rcvif local variable to keep inbound interface pointer. Count
  ifs6_in_discard errors in all "goto bad" cases. Now it will count
  errors even if mbuf was freed. Modify all places where m->m_pkthdr.rcvif
  is used to use local rcvif variable.
  
  Obtained from:	Yandex LLC
  MFC after:	1 month

Modified:
  head/sys/netinet6/ip6_input.c

Modified: head/sys/netinet6/ip6_input.c
==============================================================================
--- head/sys/netinet6/ip6_input.c	Mon Dec 12 11:12:04 2016	(r309887)
+++ head/sys/netinet6/ip6_input.c	Mon Dec 12 11:26:59 2016	(r309888)
@@ -549,6 +549,7 @@ ip6_input(struct mbuf *m)
 	struct in6_addr odst;
 	struct ip6_hdr *ip6;
 	struct in6_ifaddr *ia;
+	struct ifnet *rcvif;
 	u_int32_t plen;
 	u_int32_t rtalert = ~0;
 	int off = sizeof(struct ip6_hdr), nest;
@@ -558,7 +559,8 @@ ip6_input(struct mbuf *m)
 	/*
 	 * Drop the packet if IPv6 operation is disabled on the interface.
 	 */
-	if ((ND_IFINFO(m->m_pkthdr.rcvif)->flags & ND6_IFF_IFDISABLED))
+	rcvif = m->m_pkthdr.rcvif;
+	if ((ND_IFINFO(rcvif)->flags & ND6_IFF_IFDISABLED))
 		goto bad;
 
 #ifdef IPSEC
@@ -595,16 +597,15 @@ ip6_input(struct mbuf *m)
 		if (m->m_next) {
 			if (m->m_flags & M_LOOP) {
 				IP6STAT_INC(ip6s_m2m[V_loif->if_index]);
-			} else if (m->m_pkthdr.rcvif->if_index < IP6S_M2MMAX)
-				IP6STAT_INC(
-				    ip6s_m2m[m->m_pkthdr.rcvif->if_index]);
+			} else if (rcvif->if_index < IP6S_M2MMAX)
+				IP6STAT_INC(ip6s_m2m[rcvif->if_index]);
 			else
 				IP6STAT_INC(ip6s_m2m[0]);
 		} else
 			IP6STAT_INC(ip6s_m1);
 	}
 
-	in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_receive);
+	in6_ifstat_inc(rcvif, ifs6_in_receive);
 	IP6STAT_INC(ip6s_total);
 
 #ifndef PULLDOWN_TEST
@@ -620,10 +621,8 @@ ip6_input(struct mbuf *m)
 			n = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
 		else
 			n = m_gethdr(M_NOWAIT, MT_DATA);
-		if (n == NULL) {
-			m_freem(m);
-			return;	/* ENOBUFS */
-		}
+		if (n == NULL)
+			goto bad;
 
 		m_move_pkthdr(n, m);
 		m_copydata(m, 0, n->m_pkthdr.len, mtod(n, caddr_t));
@@ -635,26 +634,22 @@ ip6_input(struct mbuf *m)
 #endif
 
 	if (m->m_len < sizeof(struct ip6_hdr)) {
-		struct ifnet *inifp;
-		inifp = m->m_pkthdr.rcvif;
 		if ((m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) {
 			IP6STAT_INC(ip6s_toosmall);
-			in6_ifstat_inc(inifp, ifs6_in_hdrerr);
-			return;
+			in6_ifstat_inc(rcvif, ifs6_in_hdrerr);
+			goto bad;
 		}
 	}
 
 	ip6 = mtod(m, struct ip6_hdr *);
-
 	if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) {
 		IP6STAT_INC(ip6s_badvers);
-		in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr);
+		in6_ifstat_inc(rcvif, ifs6_in_hdrerr);
 		goto bad;
 	}
 
 	IP6STAT_INC(ip6s_nxthist[ip6->ip6_nxt]);
-
-	IP_PROBE(receive, NULL, NULL, ip6, m->m_pkthdr.rcvif, NULL, ip6);
+	IP_PROBE(receive, NULL, NULL, ip6, rcvif, NULL, ip6);
 
 	/*
 	 * Check against address spoofing/corruption.
@@ -665,7 +660,7 @@ ip6_input(struct mbuf *m)
 		 * XXX: "badscope" is not very suitable for a multicast source.
 		 */
 		IP6STAT_INC(ip6s_badscope);
-		in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr);
+		in6_ifstat_inc(rcvif, ifs6_in_addrerr);
 		goto bad;
 	}
 	if (IN6_IS_ADDR_MC_INTFACELOCAL(&ip6->ip6_dst) &&
@@ -677,7 +672,7 @@ ip6_input(struct mbuf *m)
 		 * as the outgoing/incoming interface.
 		 */
 		IP6STAT_INC(ip6s_badscope);
-		in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr);
+		in6_ifstat_inc(rcvif, ifs6_in_addrerr);
 		goto bad;
 	}
 	if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) &&
@@ -689,7 +684,7 @@ ip6_input(struct mbuf *m)
 		 * a packet is received, it must be silently dropped.
 		 */
 		IP6STAT_INC(ip6s_badscope);
-		in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr);
+		in6_ifstat_inc(rcvif, ifs6_in_addrerr);
 		goto bad;
 	}
 #ifdef ALTQ
@@ -713,7 +708,7 @@ ip6_input(struct mbuf *m)
 	if (IN6_IS_ADDR_V4MAPPED(&ip6->ip6_src) ||
 	    IN6_IS_ADDR_V4MAPPED(&ip6->ip6_dst)) {
 		IP6STAT_INC(ip6s_badscope);
-		in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr);
+		in6_ifstat_inc(rcvif, ifs6_in_addrerr);
 		goto bad;
 	}
 #if 0
@@ -800,8 +795,8 @@ passin:
 		IP6STAT_INC(ip6s_badscope); /* XXX */
 		goto bad;
 	}
-	if (in6_setscope(&ip6->ip6_src, m->m_pkthdr.rcvif, NULL) ||
-	    in6_setscope(&ip6->ip6_dst, m->m_pkthdr.rcvif, NULL)) {
+	if (in6_setscope(&ip6->ip6_src, rcvif, NULL) ||
+	    in6_setscope(&ip6->ip6_dst, rcvif, NULL)) {
 		IP6STAT_INC(ip6s_badscope);
 		goto bad;
 	}
@@ -811,7 +806,7 @@ passin:
 	 */
 	if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {
 		ours = 1;
-		in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_mcast);
+		in6_ifstat_inc(rcvif, ifs6_in_mcast);
 		goto hbhcheck;
 	}
 	/*
@@ -846,7 +841,6 @@ passin:
 	 */
 	if (!V_ip6_forwarding) {
 		IP6STAT_INC(ip6s_cantforward);
-		in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard);
 		goto bad;
 	}
 
@@ -878,7 +872,7 @@ passin:
 	 */
 	if (m->m_pkthdr.len - sizeof(struct ip6_hdr) < plen) {
 		IP6STAT_INC(ip6s_tooshort);
-		in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_truncated);
+		in6_ifstat_inc(rcvif, ifs6_in_truncated);
 		goto bad;
 	}
 	if (m->m_pkthdr.len > sizeof(struct ip6_hdr) + plen) {
@@ -905,10 +899,8 @@ passin:
 		 * XXX TODO: Check hlim and multicast scope here to avoid
 		 * unnecessarily calling into ip6_mforward().
 		 */
-		if (ip6_mforward &&
-		    ip6_mforward(ip6, m->m_pkthdr.rcvif, m)) {
+		if (ip6_mforward && ip6_mforward(ip6, rcvif, m)) {
 			IP6STAT_INC(ip6s_cantforward);
-			in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard);
 			goto bad;
 		}
 	} else if (!ours) {
@@ -930,7 +922,7 @@ passin:
 	if (IN6_IS_ADDR_V4MAPPED(&ip6->ip6_src) ||
 	    IN6_IS_ADDR_V4MAPPED(&ip6->ip6_dst)) {
 		IP6STAT_INC(ip6s_badscope);
-		in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr);
+		in6_ifstat_inc(rcvif, ifs6_in_addrerr);
 		goto bad;
 	}
 
@@ -938,7 +930,7 @@ passin:
 	 * Tell launch routine the next header
 	 */
 	IP6STAT_INC(ip6s_delivered);
-	in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_deliver);
+	in6_ifstat_inc(rcvif, ifs6_in_deliver);
 	nest = 0;
 
 	while (nxt != IPPROTO_DONE) {
@@ -953,7 +945,7 @@ passin:
 		 */
 		if (m->m_pkthdr.len < off) {
 			IP6STAT_INC(ip6s_tooshort);
-			in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_truncated);
+			in6_ifstat_inc(rcvif, ifs6_in_truncated);
 			goto bad;
 		}
 
@@ -971,7 +963,9 @@ passin:
 	}
 	return;
 bad:
-	m_freem(m);
+	in6_ifstat_inc(rcvif, ifs6_in_discard);
+	if (m != NULL)
+		m_freem(m);
 }
 
 /*

From owner-svn-src-all@freebsd.org  Mon Dec 12 11:37:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0795CC72C4C
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Mon, 12 Dec 2016 11:37:33 +0000 (UTC)
 (envelope-from freebsd@omnilan.de)
Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130])
 (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 753C8101C;
 Mon, 12 Dec 2016 11:37:32 +0000 (UTC)
 (envelope-from freebsd@omnilan.de)
Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net
 [IPv6:2a00:e10:2800::a135])
 by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id uBCBbS9V098988;
 Mon, 12 Dec 2016 12:37:28 +0100 (CET)
 (envelope-from freebsd@omnilan.de)
Received: from titan.inop.mo1.omnilan.net (titan.inop.mo1.omnilan.net
 [IPv6:2001:a60:f0bb:1::3:1])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mh0.gentlemail.de (Postfix) with ESMTPSA id C7BE9FFB;
 Mon, 12 Dec 2016 12:37:27 +0100 (CET)
Message-ID: <584E8BF7.6070908@omnilan.de>
Date: Mon, 12 Dec 2016 12:37:27 +0100
From: Harry Schmalzbauer <freebsd@omnilan.de>
Organization: OmniLAN
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE;
 rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2
MIME-Version: 1.0
To: Oliver Pinter <oliver.pinter@hardenedbsd.org>
CC: Pedro Giffuni <pfg@freebsd.org>, svn-src-all@freebsd.org,
 src-committers@freebsd.org
Subject: Re: MFC reminder emails (was Re: svn commit: r308296 -
 head/sys/cam/scsi)
References: <201611041656.uA4GuaZF028619@repo.freebsd.org>
 <CAPQ4fftCWc3asYe2dm72=j4Je8087nZGAtj9RJ9D2ri3hBMGKQ@mail.gmail.com>
 <f835a124-8399-1806-b350-b1fb77411386@FreeBSD.org>
 <CAPQ4ffuYhjsO3mXF83urwhJFyZCfgu-Y7aziiXSQUkqmuEfiCg@mail.gmail.com>
In-Reply-To: <CAPQ4ffuYhjsO3mXF83urwhJFyZCfgu-Y7aziiXSQUkqmuEfiCg@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7
 (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]);
 Mon, 12 Dec 2016 12:37:28 +0100 (CET)
X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: ;
 Sender-helo: mh0.gentlemail.de; )
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 11:37:33 -0000

 Bezüglich Oliver Pinter's Nachricht vom 12.12.2016 00:57 (localtime):
> Hi Pedro!
>
> On 12/11/16, Pedro Giffuni <pfg@freebsd.org> wrote:
>> Hello;
>> On 12/10/16 19:58, Oliver Pinter wrote:
>> ...
>>
>>>>   Reviewed by:	ken
>>>>   Obtained from:	Netflix
>>>>   MFC after:	3 days
>>> Hi Scott!
>>>
>>> What's the status of the MFCs to 10-STABLE and 11-STABLE?
>>>
>> Not meaning to pester anyone but given that you (and others) tend
>> to remind about MFCs you would like to see done ...
>>
>> 1) Committers get an email reminder in due time when they add an
>> MFC tag to the commit log.
>>
>> 2) MFCs are advisory: committer may change mind about them or
>> otherwise not do them due to any reason.
>>
>> 3) It's still not official, but we have an additional service
>> that lets committers verify the state of MFC requests if they wish.
>>
>> Given the points above, which you may not have been aware of,
>> it may be seen as rude to post additional reminders.

Thanks for explaining, and apologies, since I've been one of those
others too.

But sometimes I got back »Thanks for the reminder, forgt/lost a/b/c...«

So I hope those adressees for whom point 2) was the case will just
ignore it and don't feel disordered.
Since people asking about a MFC status are aware of the committ, the
reminder is meant to support committers and the release quality,
otherwise we could silently adopt ourselfs...

I'm completely unsure if these reminders are welcome or not. Of course,
it's committer-dependent to some degree, but what's the "official"
position: Being quiet or asking if chances are good that it got lost?

Shall we strip svn-src-all@ ?

Thanks,

-harry


From owner-svn-src-all@freebsd.org  Mon Dec 12 15:17:58 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 282C4C73DA0;
 Mon, 12 Dec 2016 15:17:58 +0000 (UTC)
 (envelope-from jchandra@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EBD55D6A;
 Mon, 12 Dec 2016 15:17:57 +0000 (UTC)
 (envelope-from jchandra@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCFHvUQ084813;
 Mon, 12 Dec 2016 15:17:57 GMT (envelope-from jchandra@FreeBSD.org)
Received: (from jchandra@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCFHvP5084812;
 Mon, 12 Dec 2016 15:17:57 GMT (envelope-from jchandra@FreeBSD.org)
Message-Id: <201612121517.uBCFHvP5084812@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jchandra set sender to
 jchandra@FreeBSD.org using -f
From: "Jayachandran C." <jchandra@FreeBSD.org>
Date: Mon, 12 Dec 2016 15:17:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309890 - head/sys/dev/pci
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 15:17:58 -0000

Author: jchandra
Date: Mon Dec 12 15:17:56 2016
New Revision: 309890
URL: https://svnweb.freebsd.org/changeset/base/309890

Log:
  Increase interrupt cells in generic_pcie_fdt_route_interrupt
  
  ARM GIC specification in device trees use 3 cells, so the current
  limit of 2 causes the last cell to be dropped. This in turn can
  cause the interrupt polarity and trigger settings to be incorrect.
  
  Increase the limit to 4 which should handle all reasonable cases.
  This fixes issues seen in QEMU when registering PCI interrupts.

Modified:
  head/sys/dev/pci/pci_host_generic_fdt.c

Modified: head/sys/dev/pci/pci_host_generic_fdt.c
==============================================================================
--- head/sys/dev/pci/pci_host_generic_fdt.c	Mon Dec 12 13:13:48 2016	(r309889)
+++ head/sys/dev/pci/pci_host_generic_fdt.c	Mon Dec 12 15:17:56 2016	(r309890)
@@ -269,7 +269,7 @@ generic_pcie_fdt_route_interrupt(device_
 {
 	struct generic_pcie_fdt_softc *sc;
 	struct ofw_pci_register reg;
-	uint32_t pintr, mintr[2];
+	uint32_t pintr, mintr[4];
 	phandle_t iparent;
 	int intrcells;
 

From owner-svn-src-all@freebsd.org  Mon Dec 12 15:22:23 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33CF8C73FF5;
 Mon, 12 Dec 2016 15:22:23 +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 0392311E4;
 Mon, 12 Dec 2016 15:22:22 +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 uBCFMMKE088699;
 Mon, 12 Dec 2016 15:22:22 GMT (envelope-from trasz@FreeBSD.org)
Received: (from trasz@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCFMMmm088698;
 Mon, 12 Dec 2016 15:22:22 GMT (envelope-from trasz@FreeBSD.org)
Message-Id: <201612121522.uBCFMMmm088698@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: trasz set sender to
 trasz@FreeBSD.org using -f
From: Edward Tomasz Napierala <trasz@FreeBSD.org>
Date: Mon, 12 Dec 2016 15:22:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309891 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 15:22:23 -0000

Author: trasz
Date: Mon Dec 12 15:22:21 2016
New Revision: 309891
URL: https://svnweb.freebsd.org/changeset/base/309891

Log:
  Avoid dereferencing NULL pointers in devtoname().  I've seen it panic,
  called from ufs_print() in DDB.
  
  MFC after:	1 month

Modified:
  head/sys/kern/kern_conf.c

Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c	Mon Dec 12 15:17:56 2016	(r309890)
+++ head/sys/kern/kern_conf.c	Mon Dec 12 15:22:21 2016	(r309891)
@@ -1230,6 +1230,9 @@ const char *
 devtoname(struct cdev *dev)
 {
 
+	if (dev == NULL)
+		return (NULL);
+
 	return (dev->si_name);
 }
 

From owner-svn-src-all@freebsd.org  Mon Dec 12 15:35:58 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF2F7C733DC;
 Mon, 12 Dec 2016 15:35:58 +0000 (UTC)
 (envelope-from jchandra@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9E6251B47;
 Mon, 12 Dec 2016 15:35:58 +0000 (UTC)
 (envelope-from jchandra@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCFZvw8092949;
 Mon, 12 Dec 2016 15:35:57 GMT (envelope-from jchandra@FreeBSD.org)
Received: (from jchandra@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCFZv8Y092948;
 Mon, 12 Dec 2016 15:35:57 GMT (envelope-from jchandra@FreeBSD.org)
Message-Id: <201612121535.uBCFZv8Y092948@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jchandra set sender to
 jchandra@FreeBSD.org using -f
From: "Jayachandran C." <jchandra@FreeBSD.org>
Date: Mon, 12 Dec 2016 15:35:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309892 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 15:35:58 -0000

Author: jchandra
Date: Mon Dec 12 15:35:57 2016
New Revision: 309892
URL: https://svnweb.freebsd.org/changeset/base/309892

Log:
  Fix gic_cpu_mask() calculation in ARM GIC
  
  r309616 changed the definition of GICD_ITARGETSR(n) to take the irq
  id as argument, but the usage of the macro in gic_cpu_mask() was not
  updated to reflect this. This causes the cpu mask to be computed
  incorrectly.
  
  Update the GICD_ITARGETSR() call to fix this, this fixes a hang seen
  while booting freebsd on qemu-system-aarch64 with SMP enabled.

Modified:
  head/sys/arm/arm/gic.c

Modified: head/sys/arm/arm/gic.c
==============================================================================
--- head/sys/arm/arm/gic.c	Mon Dec 12 15:22:21 2016	(r309891)
+++ head/sys/arm/arm/gic.c	Mon Dec 12 15:35:57 2016	(r309892)
@@ -190,7 +190,7 @@ gic_cpu_mask(struct arm_gic_softc *sc)
 
 	/* Read the current cpuid mask by reading ITARGETSR{0..7} */
 	for (i = 0; i < 8; i++) {
-		mask = gic_d_read_4(sc, GICD_ITARGETSR(i));
+		mask = gic_d_read_4(sc, GICD_ITARGETSR(4 * i));
 		if (mask != 0)
 			break;
 	}

From owner-svn-src-all@freebsd.org  Mon Dec 12 15:37:13 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00904C73474;
 Mon, 12 Dec 2016 15:37:13 +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 B576E1CF1;
 Mon, 12 Dec 2016 15:37:12 +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 uBCFbB3x093051;
 Mon, 12 Dec 2016 15:37:11 GMT (envelope-from mjg@FreeBSD.org)
Received: (from mjg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCFbBBk093046;
 Mon, 12 Dec 2016 15:37:11 GMT (envelope-from mjg@FreeBSD.org)
Message-Id: <201612121537.uBCFbBBk093046@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org
 using -f
From: Mateusz Guzik <mjg@FreeBSD.org>
Date: Mon, 12 Dec 2016 15:37:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309893 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 15:37:13 -0000

Author: mjg
Date: Mon Dec 12 15:37:11 2016
New Revision: 309893
URL: https://svnweb.freebsd.org/changeset/base/309893

Log:
  vfs: add vrefact, to be used when the vnode has to be already active
  
  This allows blind increment of relevant counters which under contention
  is cheaper than inc-not-zero loops at least on amd64.
  
  Use it in some of the places which are guaranteed to see already active
  vnodes.
  
  Reviewed by:	kib (previous version)

Modified:
  head/sys/kern/kern_descrip.c
  head/sys/kern/kern_fork.c
  head/sys/kern/vfs_lookup.c
  head/sys/kern/vfs_subr.c
  head/sys/sys/vnode.h

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Mon Dec 12 15:35:57 2016	(r309892)
+++ head/sys/kern/kern_descrip.c	Mon Dec 12 15:37:11 2016	(r309893)
@@ -318,11 +318,11 @@ pwd_ensure_dirs(void)
 	FILEDESC_XLOCK(fdp);
 	if (fdp->fd_cdir == NULL) {
 		fdp->fd_cdir = rootvnode;
-		VREF(rootvnode);
+		vrefact(rootvnode);
 	}
 	if (fdp->fd_rdir == NULL) {
 		fdp->fd_rdir = rootvnode;
-		VREF(rootvnode);
+		vrefact(rootvnode);
 	}
 	FILEDESC_XUNLOCK(fdp);
 }
@@ -1860,13 +1860,13 @@ fdinit(struct filedesc *fdp, bool prepfi
 	FILEDESC_SLOCK(fdp);
 	newfdp->fd_cdir = fdp->fd_cdir;
 	if (newfdp->fd_cdir)
-		VREF(newfdp->fd_cdir);
+		vrefact(newfdp->fd_cdir);
 	newfdp->fd_rdir = fdp->fd_rdir;
 	if (newfdp->fd_rdir)
-		VREF(newfdp->fd_rdir);
+		vrefact(newfdp->fd_rdir);
 	newfdp->fd_jdir = fdp->fd_jdir;
 	if (newfdp->fd_jdir)
-		VREF(newfdp->fd_jdir);
+		vrefact(newfdp->fd_jdir);
 
 	if (!prepfiles) {
 		FILEDESC_SUNLOCK(fdp);
@@ -2769,7 +2769,7 @@ _fgetvp(struct thread *td, int fd, int f
 		error = EINVAL;
 	} else {
 		*vpp = fp->f_vnode;
-		vref(*vpp);
+		vrefact(*vpp);
 	}
 	fdrop(fp, td);
 
@@ -2807,7 +2807,7 @@ fgetvp_rights(struct thread *td, int fd,
 
 	*havecaps = caps;
 	*vpp = fp->f_vnode;
-	vref(*vpp);
+	vrefact(*vpp);
 
 	return (0);
 out:
@@ -3115,10 +3115,10 @@ pwd_chroot(struct thread *td, struct vno
 		}
 	}
 	oldvp = fdp->fd_rdir;
-	VREF(vp);
+	vrefact(vp);
 	fdp->fd_rdir = vp;
 	if (fdp->fd_jdir == NULL) {
-		VREF(vp);
+		vrefact(vp);
 		fdp->fd_jdir = vp;
 	}
 	FILEDESC_XUNLOCK(fdp);
@@ -3166,17 +3166,17 @@ mountcheckdirs(struct vnode *olddp, stru
 			continue;
 		FILEDESC_XLOCK(fdp);
 		if (fdp->fd_cdir == olddp) {
-			vref(newdp);
+			vrefact(newdp);
 			fdp->fd_cdir = newdp;
 			nrele++;
 		}
 		if (fdp->fd_rdir == olddp) {
-			vref(newdp);
+			vrefact(newdp);
 			fdp->fd_rdir = newdp;
 			nrele++;
 		}
 		if (fdp->fd_jdir == olddp) {
-			vref(newdp);
+			vrefact(newdp);
 			fdp->fd_jdir = newdp;
 			nrele++;
 		}
@@ -3185,13 +3185,13 @@ mountcheckdirs(struct vnode *olddp, stru
 	}
 	sx_sunlock(&allproc_lock);
 	if (rootvnode == olddp) {
-		vref(newdp);
+		vrefact(newdp);
 		rootvnode = newdp;
 		nrele++;
 	}
 	mtx_lock(&prison0.pr_mtx);
 	if (prison0.pr_root == olddp) {
-		vref(newdp);
+		vrefact(newdp);
 		prison0.pr_root = newdp;
 		nrele++;
 	}
@@ -3200,7 +3200,7 @@ mountcheckdirs(struct vnode *olddp, stru
 	TAILQ_FOREACH(pr, &allprison, pr_list) {
 		mtx_lock(&pr->pr_mtx);
 		if (pr->pr_root == olddp) {
-			vref(newdp);
+			vrefact(newdp);
 			pr->pr_root = newdp;
 			nrele++;
 		}
@@ -3527,17 +3527,17 @@ kern_proc_filedesc_out(struct proc *p,  
 	/* ktrace vnode */
 	tracevp = p->p_tracevp;
 	if (tracevp != NULL)
-		vref(tracevp);
+		vrefact(tracevp);
 	/* text vnode */
 	textvp = p->p_textvp;
 	if (textvp != NULL)
-		vref(textvp);
+		vrefact(textvp);
 	/* Controlling tty. */
 	cttyvp = NULL;
 	if (p->p_pgrp != NULL && p->p_pgrp->pg_session != NULL) {
 		cttyvp = p->p_pgrp->pg_session->s_ttyvp;
 		if (cttyvp != NULL)
-			vref(cttyvp);
+			vrefact(cttyvp);
 	}
 	fdp = fdhold(p);
 	PROC_UNLOCK(p);
@@ -3561,17 +3561,17 @@ kern_proc_filedesc_out(struct proc *p,  
 	FILEDESC_SLOCK(fdp);
 	/* working directory */
 	if (fdp->fd_cdir != NULL) {
-		vref(fdp->fd_cdir);
+		vrefact(fdp->fd_cdir);
 		export_vnode_to_sb(fdp->fd_cdir, KF_FD_TYPE_CWD, FREAD, efbuf);
 	}
 	/* root directory */
 	if (fdp->fd_rdir != NULL) {
-		vref(fdp->fd_rdir);
+		vrefact(fdp->fd_rdir);
 		export_vnode_to_sb(fdp->fd_rdir, KF_FD_TYPE_ROOT, FREAD, efbuf);
 	}
 	/* jail directory */
 	if (fdp->fd_jdir != NULL) {
-		vref(fdp->fd_jdir);
+		vrefact(fdp->fd_jdir);
 		export_vnode_to_sb(fdp->fd_jdir, KF_FD_TYPE_JAIL, FREAD, efbuf);
 	}
 	for (i = 0; fdp->fd_refcnt > 0 && i <= fdp->fd_lastfile; i++) {
@@ -3661,7 +3661,7 @@ export_vnode_for_osysctl(struct vnode *v
 {
 	int error;
 
-	vref(vp);
+	vrefact(vp);
 	FILEDESC_SUNLOCK(fdp);
 	export_vnode_to_kinfo(vp, type, 0, kif, KERN_FILEDESC_PACK_KINFO);
 	kinfo_to_okinfo(kif, okif);
@@ -3788,7 +3788,7 @@ kern_proc_cwd_out(struct proc *p,  struc
 	if (fdp->fd_cdir == NULL)
 		error = EINVAL;
 	else {
-		vref(fdp->fd_cdir);
+		vrefact(fdp->fd_cdir);
 		error = export_vnode_to_sb(fdp->fd_cdir, KF_FD_TYPE_CWD,
 		    FREAD, efbuf);
 	}

Modified: head/sys/kern/kern_fork.c
==============================================================================
--- head/sys/kern/kern_fork.c	Mon Dec 12 15:35:57 2016	(r309892)
+++ head/sys/kern/kern_fork.c	Mon Dec 12 15:37:11 2016	(r309893)
@@ -547,7 +547,7 @@ do_fork(struct thread *td, struct fork_r
 
 	/* Bump references to the text vnode (for procfs). */
 	if (p2->p_textvp)
-		vref(p2->p_textvp);
+		vrefact(p2->p_textvp);
 
 	/*
 	 * Set up linkage for kernel based threading.

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c	Mon Dec 12 15:35:57 2016	(r309892)
+++ head/sys/kern/vfs_lookup.c	Mon Dec 12 15:37:11 2016	(r309893)
@@ -255,7 +255,7 @@ namei_handle_root(struct nameidata *ndp,
 		ndp->ni_pathlen--;
 	}
 	*dpp = ndp->ni_rootdir;
-	VREF(*dpp);
+	vrefact(*dpp);
 	return (0);
 }
 
@@ -376,7 +376,7 @@ namei(struct nameidata *ndp)
 	 */
 	FILEDESC_SLOCK(fdp);
 	ndp->ni_rootdir = fdp->fd_rdir;
-	VREF(ndp->ni_rootdir);
+	vrefact(ndp->ni_rootdir);
 	ndp->ni_topdir = fdp->fd_jdir;
 
 	/*
@@ -398,7 +398,7 @@ namei(struct nameidata *ndp)
 			startdir_used = 1;
 		} else if (ndp->ni_dirfd == AT_FDCWD) {
 			dp = fdp->fd_cdir;
-			VREF(dp);
+			vrefact(dp);
 		} else {
 			rights = ndp->ni_rightsneeded;
 			cap_rights_set(&rights, CAP_LOOKUP);
@@ -956,7 +956,7 @@ good:
 			vput(ndp->ni_dvp);
 		else
 			vrele(ndp->ni_dvp);
-		vref(vp_crossmp);
+		vrefact(vp_crossmp);
 		ndp->ni_dvp = vp_crossmp;
 		error = VFS_ROOT(mp, compute_cn_lkflags(mp, cnp->cn_lkflags,
 		    cnp->cn_flags), &tdp);

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Mon Dec 12 15:35:57 2016	(r309892)
+++ head/sys/kern/vfs_subr.c	Mon Dec 12 15:37:11 2016	(r309893)
@@ -2647,6 +2647,28 @@ vrefl(struct vnode *vp)
 	v_incr_usecount_locked(vp);
 }
 
+void
+vrefact(struct vnode *vp)
+{
+
+	CTR2(KTR_VFS, "%s: vp %p", __func__, vp);
+	if (__predict_false(vp->v_type == VCHR)) {
+		VNASSERT(vp->v_holdcnt > 0 && vp->v_usecount > 0, vp,
+		    ("%s: wrong ref counts", __func__));
+		vref(vp);
+		return;
+	}
+#ifdef INVARIANTS
+	int old = atomic_fetchadd_int(&vp->v_holdcnt, 1);
+	VNASSERT(old > 0, vp, ("%s: wrong hold count", __func__));
+	old = atomic_fetchadd_int(&vp->v_usecount, 1);
+	VNASSERT(old > 0, vp, ("%s: wrong use count", __func__));
+#else
+	refcount_acquire(&vp->v_holdcnt);
+	refcount_acquire(&vp->v_usecount);
+#endif
+}
+
 /*
  * Return reference count of a vnode.
  *

Modified: head/sys/sys/vnode.h
==============================================================================
--- head/sys/sys/vnode.h	Mon Dec 12 15:35:57 2016	(r309892)
+++ head/sys/sys/vnode.h	Mon Dec 12 15:37:11 2016	(r309893)
@@ -828,6 +828,7 @@ void	vput(struct vnode *vp);
 void	vrele(struct vnode *vp);
 void	vref(struct vnode *vp);
 void	vrefl(struct vnode *vp);
+void	vrefact(struct vnode *vp);
 int	vrefcnt(struct vnode *vp);
 void 	v_addpollinfo(struct vnode *vp);
 

From owner-svn-src-all@freebsd.org  Mon Dec 12 16:33:40 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0F80C73EF3;
 Mon, 12 Dec 2016 16:33: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 58F1936C;
 Mon, 12 Dec 2016 16:33:40 +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 uBCGXVxJ074442
 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
 Mon, 12 Dec 2016 18:33:31 +0200 (EET)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBCGXVxJ074442
Received: (from kostik@localhost)
 by tom.home (8.15.2/8.15.2/Submit) id uBCGXV0C074441;
 Mon, 12 Dec 2016 18:33:31 +0200 (EET)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Mon, 12 Dec 2016 18:33:31 +0200
From: Konstantin Belousov <kostikbel@gmail.com>
To: Edward Tomasz Napierala <trasz@FreeBSD.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r309891 - head/sys/kern
Message-ID: <20161212163331.GH54029@kib.kiev.ua>
References: <201612121522.uBCFMMmm088698@repo.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201612121522.uBCFMMmm088698@repo.freebsd.org>
User-Agent: Mutt/1.7.1 (2016-10-04)
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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 16:33:41 -0000

On Mon, Dec 12, 2016 at 03:22:22PM +0000, Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Mon Dec 12 15:22:21 2016
> New Revision: 309891
> URL: https://svnweb.freebsd.org/changeset/base/309891
> 
> Log:
>   Avoid dereferencing NULL pointers in devtoname().  I've seen it panic,
>   called from ufs_print() in DDB.
Calls from DDB should not panic even if accessing NULL pointers.

That said, I also do not think that this is the right place to change.
UFS um_dev should not be NULL for any active mount.

>   
>   MFC after:	1 month
> 
> Modified:
>   head/sys/kern/kern_conf.c
> 
> Modified: head/sys/kern/kern_conf.c
> ==============================================================================
> --- head/sys/kern/kern_conf.c	Mon Dec 12 15:17:56 2016	(r309890)
> +++ head/sys/kern/kern_conf.c	Mon Dec 12 15:22:21 2016	(r309891)
> @@ -1230,6 +1230,9 @@ const char *
>  devtoname(struct cdev *dev)
>  {
>  
> +	if (dev == NULL)
> +		return (NULL);
> +
>  	return (dev->si_name);
>  }
>  

From owner-svn-src-all@freebsd.org  Mon Dec 12 16:43:32 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92EDFC731F9;
 Mon, 12 Dec 2016 16:43:32 +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 6D976B8F;
 Mon, 12 Dec 2016 16:43:32 +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 uBCGhVsM023737;
 Mon, 12 Dec 2016 16:43:31 GMT (envelope-from manu@FreeBSD.org)
Received: (from manu@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCGhVJl023735;
 Mon, 12 Dec 2016 16:43:31 GMT (envelope-from manu@FreeBSD.org)
Message-Id: <201612121643.uBCGhVJl023735@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: manu set sender to
 manu@FreeBSD.org using -f
From: Emmanuel Vadot <manu@FreeBSD.org>
Date: Mon, 12 Dec 2016 16:43:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309894 - head/sys/dev/extres/clk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 16:43:32 -0000

Author: manu
Date: Mon Dec 12 16:43:31 2016
New Revision: 309894
URL: https://svnweb.freebsd.org/changeset/base/309894

Log:
  clk_div: Add a div lookup table
  
  Some clocks on SoC have a diff between the value written in the register
  and the real divider.
  Add a table that where we can lookup the real value of the divider.
  
  Reviewed by:	mmel (earlier revision)
  Differential Revision:	https://reviews.freebsd.org/D8728

Modified:
  head/sys/dev/extres/clk/clk_div.c
  head/sys/dev/extres/clk/clk_div.h

Modified: head/sys/dev/extres/clk/clk_div.c
==============================================================================
--- head/sys/dev/extres/clk/clk_div.c	Mon Dec 12 15:37:11 2016	(r309893)
+++ head/sys/dev/extres/clk/clk_div.c	Mon Dec 12 16:43:31 2016	(r309894)
@@ -68,6 +68,8 @@ struct clknode_div_sc {
 	uint32_t	f_width;
 	int		div_flags;
 	uint32_t	divider;	/* in natural form */
+
+	struct clk_div_table	*div_table;
 };
 
 static clknode_method_t clknode_div_methods[] = {
@@ -80,6 +82,36 @@ static clknode_method_t clknode_div_meth
 DEFINE_CLASS_1(clknode_div, clknode_div_class, clknode_div_methods,
    sizeof(struct clknode_div_sc), clknode_class);
 
+static uint32_t
+clknode_div_table_get_divider(struct clknode_div_sc *sc, uint32_t divider)
+{
+	struct clk_div_table *table;
+
+	if (!(sc->div_flags & CLK_DIV_WITH_TABLE))
+		return (divider);
+
+	for (table = sc->div_table; table->divider != 0; table++)
+		if (table->value == sc->divider)
+			return (table->divider);
+
+	return (0);
+}
+
+static uint32_t
+clknode_div_table_get_value(struct clknode_div_sc *sc, uint32_t divider)
+{
+	struct clk_div_table *table;
+
+	if (!(sc->div_flags & CLK_DIV_WITH_TABLE))
+		return (divider);
+
+	for (table = sc->div_table; table->divider != 0; table++)
+		if (table->divider == sc->divider)
+			return (table->value);
+
+	return (0);
+}
+
 static int
 clknode_div_init(struct clknode *clk, device_t dev)
 {
@@ -101,6 +133,11 @@ clknode_div_init(struct clknode *clk, de
 		i_div++;
 	f_div = (reg >> sc->f_shift) & sc->f_mask;
 	sc->divider = i_div << sc->f_width | f_div;
+
+	sc->divider = clknode_div_table_get_divider(sc, sc->divider);
+	if (sc->divider == 0)
+		panic("%s: divider is zero!\n", clknode_get_name(clk));
+
 	clknode_init_parent_idx(clk, 0);
 	return(0);
 }
@@ -177,6 +214,10 @@ clknode_div_set_freq(struct clknode *clk
 		    (*fout != (_fin / divider)))
 			return (ERANGE);
 
+		divider = clknode_div_table_get_value(sc, divider);
+		if (divider == 0)
+			return (ERANGE);
+
 		DEVICE_LOCK(clk);
 		rv = MD4(clk, sc->offset,
 		    (sc->i_mask << sc->i_shift) | (sc->f_mask << sc->f_shift),
@@ -214,6 +255,7 @@ clknode_div_register(struct clkdom *clkd
 	sc->f_width = clkdef->f_width;
 	sc->f_mask = (1 << clkdef->f_width) - 1;
 	sc->div_flags = clkdef->div_flags;
+	sc->div_table = clkdef->div_table;
 
 	clknode_register(clkdom, clk);
 	return (0);

Modified: head/sys/dev/extres/clk/clk_div.h
==============================================================================
--- head/sys/dev/extres/clk/clk_div.h	Mon Dec 12 15:37:11 2016	(r309893)
+++ head/sys/dev/extres/clk/clk_div.h	Mon Dec 12 16:43:31 2016	(r309894)
@@ -32,6 +32,12 @@
 #include <dev/extres/clk/clk.h>
 
 #define	CLK_DIV_ZERO_BASED	0x0001 /* Zero based divider. */
+#define	CLK_DIV_WITH_TABLE	0x0002 /* Table to lookup the real value */
+
+struct clk_div_table {
+	uint32_t	value;
+	uint32_t	divider;
+};
 
 struct clk_div_def {
 	struct clknode_init_def clkdef;
@@ -41,6 +47,7 @@ struct clk_div_def {
 	uint32_t		f_shift;	/* Fractional divide bits, */
 	uint32_t		f_width;	/* set to 0 for int divider */
 	int			div_flags;	/* Divider-specific flags */
+	struct clk_div_table	*div_table;	/* Divider table */
 };
 
 int clknode_div_register(struct clkdom *clkdom, struct clk_div_def *clkdef);

From owner-svn-src-all@freebsd.org  Mon Dec 12 16:53:56 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDE92C73490;
 Mon, 12 Dec 2016 16:53:56 +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 8D5481354;
 Mon, 12 Dec 2016 16:53:56 +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 uBCGrtlJ027596;
 Mon, 12 Dec 2016 16:53:55 GMT (envelope-from andrew@FreeBSD.org)
Received: (from andrew@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCGrtFC027595;
 Mon, 12 Dec 2016 16:53:55 GMT (envelope-from andrew@FreeBSD.org)
Message-Id: <201612121653.uBCGrtFC027595@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: andrew set sender to
 andrew@FreeBSD.org using -f
From: Andrew Turner <andrew@FreeBSD.org>
Date: Mon, 12 Dec 2016 16:53:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309895 - head/sys/dev/acpica
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 16:53:56 -0000

Author: andrew
Date: Mon Dec 12 16:53:55 2016
New Revision: 309895
URL: https://svnweb.freebsd.org/changeset/base/309895

Log:
  On non-Intel platforms don't ignore the PCI root bridge mapping in
  acpi_set_resource, the mappings are needed on arm64.
  
  Obtained from:	ABT Systenms Ltd
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c	Mon Dec 12 16:43:31 2016	(r309894)
+++ head/sys/dev/acpica/acpi.c	Mon Dec 12 16:53:55 2016	(r309895)
@@ -1276,7 +1276,9 @@ acpi_set_resource(device_t dev, device_t
     struct acpi_softc *sc = device_get_softc(dev);
     struct acpi_device *ad = device_get_ivars(child);
     struct resource_list *rl = &ad->ad_rl;
+#if defined(__i386__) || defined(__amd64__)
     ACPI_DEVICE_INFO *devinfo;
+#endif
     rman_res_t end;
     
     /* Ignore IRQ resources for PCI link devices. */
@@ -1292,13 +1294,11 @@ acpi_set_resource(device_t dev, device_t
      * x86 of a PCI bridge claiming the I/O ports used for PCI config
      * access.
      */
+#if defined(__i386__) || defined(__amd64__)
     if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) {
 	if (ACPI_SUCCESS(AcpiGetObjectInfo(ad->ad_handle, &devinfo))) {
 	    if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) {
-#if defined(__i386__) || defined(__amd64__)
-		if (!(type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT))
-#endif
-		{
+		if (!(type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT)) {
 		    AcpiOsFree(devinfo);
 		    return (0);
 		}
@@ -1306,6 +1306,7 @@ acpi_set_resource(device_t dev, device_t
 	    AcpiOsFree(devinfo);
 	}
     }
+#endif
 
     /* If the resource is already allocated, fail. */
     if (resource_list_busy(rl, type, rid))

From owner-svn-src-all@freebsd.org  Mon Dec 12 17:08:53 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D290BC73B87;
 Mon, 12 Dec 2016 17:08:53 +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 A25AE1CE2;
 Mon, 12 Dec 2016 17:08:53 +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 uBCH8qDx031957;
 Mon, 12 Dec 2016 17:08:52 GMT (envelope-from br@FreeBSD.org)
Received: (from br@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCH8qsp031956;
 Mon, 12 Dec 2016 17:08:52 GMT (envelope-from br@FreeBSD.org)
Message-Id: <201612121708.uBCH8qsp031956@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org
 using -f
From: Ruslan Bukin <br@FreeBSD.org>
Date: Mon, 12 Dec 2016 17:08:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309896 - head/sys/mips/ingenic
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 17:08:53 -0000

Author: br
Date: Mon Dec 12 17:08:52 2016
New Revision: 309896
URL: https://svnweb.freebsd.org/changeset/base/309896

Log:
  Apply clear_mask correctly.
  
  Reviewed by:	jmcneill, kan
  Sponsored by:	DARPA, AFRL

Modified:
  head/sys/mips/ingenic/jz4780_clock.c

Modified: head/sys/mips/ingenic/jz4780_clock.c
==============================================================================
--- head/sys/mips/ingenic/jz4780_clock.c	Mon Dec 12 16:53:55 2016	(r309895)
+++ head/sys/mips/ingenic/jz4780_clock.c	Mon Dec 12 17:08:52 2016	(r309896)
@@ -589,7 +589,7 @@ jz4780_clock_modify_4(device_t dev, bus_
 
 	sc = device_get_softc(dev);
 	val = CSR_READ_4(sc, addr);
-	val &= clear_mask;
+	val &= ~clear_mask;
 	val |= set_mask;
 	CSR_WRITE_4(sc, addr, val);
 	return (0);

From owner-svn-src-all@freebsd.org  Mon Dec 12 17:23:11 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52191C73394;
 Mon, 12 Dec 2016 17:23:11 +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 12F5FD85;
 Mon, 12 Dec 2016 17:23:11 +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 uBCHNA2I039762;
 Mon, 12 Dec 2016 17:23:10 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCHNAqV039760;
 Mon, 12 Dec 2016 17:23:10 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612121723.uBCHNAqV039760@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Mon, 12 Dec 2016 17:23:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309897 - head/tests/sys/vfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 17:23:11 -0000

Author: cem
Date: Mon Dec 12 17:23:09 2016
New Revision: 309897
URL: https://svnweb.freebsd.org/changeset/base/309897

Log:
  Add basic ATF tests for Capability mode .. lookups
  
  A follow-up to r309887.
  
  Several tests copied verbatim from
  https://github.com/emaste/snippets/blob/master/test_openat.c .
  
  Reviewed by:	kib@, ngie@ (earlier version)
  X-MFC-With:	r309887
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D8748

Added:
  head/tests/sys/vfs/lookup_cap_dotdot.c   (contents, props changed)
Modified:
  head/tests/sys/vfs/Makefile

Modified: head/tests/sys/vfs/Makefile
==============================================================================
--- head/tests/sys/vfs/Makefile	Mon Dec 12 17:08:52 2016	(r309896)
+++ head/tests/sys/vfs/Makefile	Mon Dec 12 17:23:09 2016	(r309897)
@@ -4,6 +4,9 @@ PACKAGE=	tests
 
 TESTSDIR=		${TESTSBASE}/sys/vfs
 
+ATF_TESTS_C+=	lookup_cap_dotdot
+CFLAGS.lookup_cap_dotdot.c+=	-I${SRCTOP}/tests
+
 PLAIN_TESTS_SH+=	trailing_slash
 
 .include <bsd.test.mk>

Added: head/tests/sys/vfs/lookup_cap_dotdot.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tests/sys/vfs/lookup_cap_dotdot.c	Mon Dec 12 17:23:09 2016	(r309897)
@@ -0,0 +1,251 @@
+/*-
+ * Copyright (c) 2016 Ed Maste <emaste@FreeBSD.org>
+ * Copyright (c) 2016 Conrad Meyer <cem@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/capsicum.h>
+#include <sys/sysctl.h>
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "freebsd_test_suite/macros.h"
+
+static int dirfd = -1;
+static char *abspath;
+
+static void
+touchat(int dirfd, const char *name)
+{
+	int fd;
+
+	ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
+	    0777)) >= 0);
+	ATF_REQUIRE(close(fd) == 0);
+}
+
+static void
+prepare_dotdot_tests(void)
+{
+	char cwd[MAXPATHLEN];
+
+	ATF_REQUIRE(getcwd(cwd, sizeof(cwd)) != NULL);
+	asprintf(&abspath, "%s/testdir/d1/f1", cwd);
+
+	ATF_REQUIRE(mkdir("testdir", 0777) == 0);
+	ATF_REQUIRE((dirfd = open("testdir", O_RDONLY)) >= 0);
+
+	ATF_REQUIRE(mkdirat(dirfd, "d1", 0777) == 0);
+	ATF_REQUIRE(mkdirat(dirfd, "d1/d2", 0777) == 0);
+	ATF_REQUIRE(mkdirat(dirfd, "d1/d2/d3", 0777) == 0);
+	touchat(dirfd, "d1/f1");
+	touchat(dirfd, "d1/d2/f2");
+	touchat(dirfd, "d1/d2/d3/f3");
+	ATF_REQUIRE(symlinkat("d1/d2/d3", dirfd, "l3") == 0);
+	ATF_REQUIRE(symlinkat("../testdir/d1", dirfd, "lup") == 0);
+	ATF_REQUIRE(symlinkat("../..", dirfd, "d1/d2/d3/ld1") == 0);
+	ATF_REQUIRE(symlinkat("../../f1", dirfd, "d1/d2/d3/lf1") == 0);
+}
+
+static void
+check_capsicum(void)
+{
+	ATF_REQUIRE_FEATURE("security_capabilities");
+	ATF_REQUIRE_FEATURE("security_capability_mode");
+}
+
+/*
+ * Positive tests
+ */
+ATF_TC(openat__basic_positive);
+ATF_TC_HEAD(openat__basic_positive, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Basic positive openat testcases");
+}
+
+ATF_TC_BODY(openat__basic_positive, tc)
+{
+	prepare_dotdot_tests();
+
+	ATF_REQUIRE(openat(dirfd, "d1/d2/d3/f3", O_RDONLY) >= 0);
+	ATF_REQUIRE(openat(dirfd, "d1/d2/d3/../../f1", O_RDONLY) >= 0);
+	ATF_REQUIRE(openat(dirfd, "l3/f3", O_RDONLY) >= 0);
+	ATF_REQUIRE(openat(dirfd, "l3/../../f1", O_RDONLY) >= 0);
+	ATF_REQUIRE(openat(dirfd, "../testdir/d1/f1", O_RDONLY) >= 0);
+	ATF_REQUIRE(openat(dirfd, "lup/f1", O_RDONLY) >= 0);
+	ATF_REQUIRE(openat(dirfd, "l3/ld1", O_RDONLY) >= 0);
+	ATF_REQUIRE(openat(dirfd, "l3/lf1", O_RDONLY) >= 0);
+	ATF_REQUIRE(open(abspath, O_RDONLY) >= 0);
+	ATF_REQUIRE(openat(dirfd, abspath, O_RDONLY) >= 0);
+}
+
+ATF_TC(lookup_cap_dotdot__basic);
+ATF_TC_HEAD(lookup_cap_dotdot__basic, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	    "Validate cap-mode (testdir)/d1/.. lookup");
+}
+
+ATF_TC_BODY(lookup_cap_dotdot__basic, tc)
+{
+	cap_rights_t rights;
+	int fd;
+
+	check_capsicum();
+	prepare_dotdot_tests();
+
+	cap_rights_init(&rights, CAP_LOOKUP, CAP_READ);
+	ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0);
+
+	ATF_REQUIRE(cap_enter() >= 0);
+
+	ATF_REQUIRE_MSG(openat(dirfd, "d1/..", O_RDONLY) >= 0, "%s",
+	    strerror(errno));
+}
+
+ATF_TC(lookup_cap_dotdot__advanced);
+ATF_TC_HEAD(lookup_cap_dotdot__advanced, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	    "Validate cap-mode (testdir)/d1/.. lookup");
+}
+
+ATF_TC_BODY(lookup_cap_dotdot__advanced, tc)
+{
+	cap_rights_t rights;
+	int fd;
+
+	check_capsicum();
+	prepare_dotdot_tests();
+
+	cap_rights_init(&rights, CAP_LOOKUP, CAP_READ);
+	ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0);
+
+	ATF_REQUIRE(cap_enter() >= 0);
+
+	ATF_REQUIRE(openat(dirfd, "d1/d2/d3/../../f1", O_RDONLY) >= 0);
+	ATF_REQUIRE(openat(dirfd, "l3/../../f1", O_RDONLY) >= 0);
+	ATF_REQUIRE(openat(dirfd, "l3/ld1", O_RDONLY) >= 0);
+	ATF_REQUIRE(openat(dirfd, "l3/lf1", O_RDONLY) >= 0);
+}
+
+/*
+ * Negative tests
+ */
+ATF_TC(openat__basic_negative);
+ATF_TC_HEAD(openat__basic_negative, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Basic negative openat testcases");
+}
+
+ATF_TC_BODY(openat__basic_negative, tc)
+{
+	prepare_dotdot_tests();
+
+	ATF_REQUIRE_ERRNO(ENOENT,
+	    openat(dirfd, "does-not-exist", O_RDONLY) < 0);
+	ATF_REQUIRE_ERRNO(ENOENT,
+	    openat(dirfd, "l3/does-not-exist", O_RDONLY) < 0);
+}
+
+ATF_TC(capmode__negative);
+ATF_TC_HEAD(capmode__negative, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Negative Capability mode testcases");
+}
+
+ATF_TC_BODY(capmode__negative, tc)
+{
+	int subdirfd;
+
+	check_capsicum();
+	prepare_dotdot_tests();
+
+	ATF_REQUIRE(cap_enter() == 0);
+
+	/* open() not permitted in capability mode */
+	ATF_REQUIRE_ERRNO(ECAPMODE, open("testdir", O_RDONLY) < 0);
+
+	/* AT_FDCWD not permitted in capability mode */
+	ATF_REQUIRE_ERRNO(ECAPMODE, openat(AT_FDCWD, "d1/f1", O_RDONLY) < 0);
+
+	/* Relative path above dirfd not capable */
+	ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "..", O_RDONLY) < 0);
+	ATF_REQUIRE((subdirfd = openat(dirfd, "l3", O_RDONLY)) >= 0);
+	ATF_REQUIRE_ERRNO(ENOTCAPABLE,
+	    openat(subdirfd, "../../f1", O_RDONLY) < 0);
+
+	/* Absolute paths not capable */
+	ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, abspath, O_RDONLY) < 0);
+
+	/* Symlink above dirfd */
+	ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "lup/f1", O_RDONLY) < 0);
+}
+
+ATF_TC(lookup_cap_dotdot__negative);
+ATF_TC_HEAD(lookup_cap_dotdot__negative, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	    "Validate cap-mode (testdir)/.. lookup fails");
+}
+
+ATF_TC_BODY(lookup_cap_dotdot__negative, tc)
+{
+	cap_rights_t rights;
+	int fd;
+
+	check_capsicum();
+	prepare_dotdot_tests();
+
+	cap_rights_init(&rights, CAP_LOOKUP, CAP_READ);
+	ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0);
+
+	ATF_REQUIRE(cap_enter() >= 0);
+
+	ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "..", O_RDONLY) < 0);
+	ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "d1/../..", O_RDONLY) < 0);
+	ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "../testdir/d1/f1", O_RDONLY) < 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+	ATF_TP_ADD_TC(tp, openat__basic_positive);
+	ATF_TP_ADD_TC(tp, openat__basic_negative);
+
+	ATF_TP_ADD_TC(tp, capmode__negative);
+
+	ATF_TP_ADD_TC(tp, lookup_cap_dotdot__basic);
+	ATF_TP_ADD_TC(tp, lookup_cap_dotdot__advanced);
+	ATF_TP_ADD_TC(tp, lookup_cap_dotdot__negative);
+
+	return (atf_no_error());
+}

From owner-svn-src-all@freebsd.org  Mon Dec 12 17:47:10 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF9E0C73DFB;
 Mon, 12 Dec 2016 17:47:10 +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 7818529C;
 Mon, 12 Dec 2016 17:47:10 +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 uBCHl9Sj048289;
 Mon, 12 Dec 2016 17:47:09 GMT (envelope-from alc@FreeBSD.org)
Received: (from alc@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCHl96Q048282;
 Mon, 12 Dec 2016 17:47:09 GMT (envelope-from alc@FreeBSD.org)
Message-Id: <201612121747.uBCHl96Q048282@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org
 using -f
From: Alan Cox <alc@FreeBSD.org>
Date: Mon, 12 Dec 2016 17:47:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309898 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 17:47:10 -0000

Author: alc
Date: Mon Dec 12 17:47:09 2016
New Revision: 309898
URL: https://svnweb.freebsd.org/changeset/base/309898

Log:
  Eliminate every mention of PG_CACHED pages from the comments in the machine-
  independent layer of the virtual memory system.  Update some of the nearby
  comments to eliminate redundancy and improve clarity.
  
  In vm/vm_reserv.c, do not use hyphens after adverbs ending in -ly per
  The Chicago Manual of Style.
  
  Update the comment in vm/vm_page.h defining the four types of page queues to
  reflect the elimination of PG_CACHED pages and the introduction of the
  laundry queue.
  
  Reviewed by:	kib, markj
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D8752

Modified:
  head/sys/vm/vm_map.c
  head/sys/vm/vm_object.c
  head/sys/vm/vm_object.h
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h
  head/sys/vm/vm_reserv.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Mon Dec 12 17:23:09 2016	(r309897)
+++ head/sys/vm/vm_map.c	Mon Dec 12 17:47:09 2016	(r309898)
@@ -1858,9 +1858,7 @@ vm_map_submap(
  *	limited number of page mappings are created at the low-end of the
  *	specified address range.  (For this purpose, a superpage mapping
  *	counts as one page mapping.)  Otherwise, all resident pages within
- *	the specified address range are mapped.  Because these mappings are
- *	being created speculatively, cached pages are not reactivated and
- *	mapped.
+ *	the specified address range are mapped.
  */
 static void
 vm_map_pmap_enter(vm_map_t map, vm_offset_t addr, vm_prot_t prot,

Modified: head/sys/vm/vm_object.c
==============================================================================
--- head/sys/vm/vm_object.c	Mon Dec 12 17:23:09 2016	(r309897)
+++ head/sys/vm/vm_object.c	Mon Dec 12 17:47:09 2016	(r309898)
@@ -1356,7 +1356,7 @@ retry:
 			goto retry;
 		}
 
-		/* vm_page_rename() will handle dirty and cache. */
+		/* vm_page_rename() will dirty the page. */
 		if (vm_page_rename(m, new_object, idx)) {
 			VM_OBJECT_WUNLOCK(new_object);
 			VM_OBJECT_WUNLOCK(orig_object);
@@ -1446,7 +1446,7 @@ vm_object_scan_all_shadowed(vm_object_t 
 	/*
 	 * Initial conditions:
 	 *
-	 * We do not want to have to test for the existence of cache or swap
+	 * We do not want to have to test for the existence of swap
 	 * pages in the backing object.  XXX but with the new swapper this
 	 * would be pretty easy to do.
 	 */
@@ -1590,8 +1590,7 @@ vm_object_collapse_scan(vm_object_t obje
 		 * backing object to the main object.
 		 *
 		 * If the page was mapped to a process, it can remain mapped
-		 * through the rename.  vm_page_rename() will handle dirty and
-		 * cache.
+		 * through the rename.  vm_page_rename() will dirty the page.
 		 */
 		if (vm_page_rename(p, object, new_pindex)) {
 			next = vm_object_collapse_scan_wait(object, NULL, next,

Modified: head/sys/vm/vm_object.h
==============================================================================
--- head/sys/vm/vm_object.h	Mon Dec 12 17:23:09 2016	(r309897)
+++ head/sys/vm/vm_object.h	Mon Dec 12 17:47:09 2016	(r309898)
@@ -79,17 +79,6 @@
  *
  *	vm_object_t		Virtual memory object.
  *
- *	The root of cached pages pool is protected by both the per-object lock
- *	and the free pages queue mutex.
- *	On insert in the cache radix trie, the per-object lock is expected
- *	to be already held and the free pages queue mutex will be
- *	acquired during the operation too.
- *	On remove and lookup from the cache radix trie, only the free
- *	pages queue mutex is expected to be locked.
- *	These rules allow for reliably checking for the presence of cached
- *	pages with only the per-object lock held, thereby reducing contention
- *	for the free pages queue mutex.
- *
  * List of locks
  *	(c)	const until freed
  *	(o)	per-object lock 

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Mon Dec 12 17:23:09 2016	(r309897)
+++ head/sys/vm/vm_page.c	Mon Dec 12 17:47:09 2016	(r309898)
@@ -1409,9 +1409,7 @@ vm_page_replace(vm_page_t mnew, vm_objec
  *
  *	Note: we *always* dirty the page.  It is necessary both for the
  *	      fact that we moved it, and because we may be invalidating
- *	      swap.  If the page is on the cache, we have to deactivate it
- *	      or vm_page_dirty() will panic.  Dirty pages are not allowed
- *	      on the cache.
+ *	      swap.
  *
  *	The objects must be locked.
  */
@@ -2042,18 +2040,18 @@ unlock:
 		} else if (level >= 0) {
 			/*
 			 * The page is reserved but not yet allocated.  In
-			 * other words, it is still cached or free.  Extend
-			 * the current run by one page.
+			 * other words, it is still free.  Extend the current
+			 * run by one page.
 			 */
 			run_ext = 1;
 #endif
 		} else if ((order = m->order) < VM_NFREEORDER) {
 			/*
 			 * The page is enqueued in the physical memory
-			 * allocator's cache/free page queues.  Moreover, it
-			 * is the first page in a power-of-two-sized run of
-			 * contiguous cache/free pages.  Add these pages to
-			 * the end of the current run, and jump ahead.
+			 * allocator's free page queues.  Moreover, it is the
+			 * first page in a power-of-two-sized run of
+			 * contiguous free pages.  Add these pages to the end
+			 * of the current run, and jump ahead.
 			 */
 			run_ext = 1 << order;
 			m_inc = 1 << order;
@@ -2061,16 +2059,15 @@ unlock:
 			/*
 			 * Skip the page for one of the following reasons: (1)
 			 * It is enqueued in the physical memory allocator's
-			 * cache/free page queues.  However, it is not the
-			 * first page in a run of contiguous cache/free pages.
-			 * (This case rarely occurs because the scan is
-			 * performed in ascending order.) (2) It is not
-			 * reserved, and it is transitioning from free to
-			 * allocated.  (Conversely, the transition from
-			 * allocated to free for managed pages is blocked by
-			 * the page lock.) (3) It is allocated but not
-			 * contained by an object and not wired, e.g.,
-			 * allocated by Xen's balloon driver.
+			 * free page queues.  However, it is not the first
+			 * page in a run of contiguous free pages.  (This case
+			 * rarely occurs because the scan is performed in
+			 * ascending order.) (2) It is not reserved, and it is
+			 * transitioning from free to allocated.  (Conversely,
+			 * the transition from allocated to free for managed
+			 * pages is blocked by the page lock.) (3) It is
+			 * allocated but not contained by an object and not
+			 * wired, e.g., allocated by Xen's balloon driver.
 			 */
 			run_ext = 0;
 		}
@@ -2282,11 +2279,11 @@ unlock:
 			if (order < VM_NFREEORDER) {
 				/*
 				 * The page is enqueued in the physical memory
-				 * allocator's cache/free page queues.
-				 * Moreover, it is the first page in a power-
-				 * of-two-sized run of contiguous cache/free
-				 * pages.  Jump ahead to the last page within
-				 * that run, and continue from there.
+				 * allocator's free page queues.  Moreover, it
+				 * is the first page in a power-of-two-sized
+				 * run of contiguous free pages.  Jump ahead
+				 * to the last page within that run, and
+				 * continue from there.
 				 */
 				m += (1 << order) - 1;
 			}
@@ -2334,9 +2331,9 @@ CTASSERT(powerof2(NRUNS));
  *	conditions by relocating the virtual pages using that physical memory.
  *	Returns true if reclamation is successful and false otherwise.  Since
  *	relocation requires the allocation of physical pages, reclamation may
- *	fail due to a shortage of cache/free pages.  When reclamation fails,
- *	callers are expected to perform VM_WAIT before retrying a failed
- *	allocation operation, e.g., vm_page_alloc_contig().
+ *	fail due to a shortage of free pages.  When reclamation fails, callers
+ *	are expected to perform VM_WAIT before retrying a failed allocation
+ *	operation, e.g., vm_page_alloc_contig().
  *
  *	The caller must always specify an allocation class through "req".
  *
@@ -2371,8 +2368,8 @@ vm_page_reclaim_contig(int req, u_long n
 		req_class = VM_ALLOC_SYSTEM;
 
 	/*
-	 * Return if the number of cached and free pages cannot satisfy the
-	 * requested allocation.
+	 * Return if the number of free pages cannot satisfy the requested
+	 * allocation.
 	 */
 	count = vm_cnt.v_free_count;
 	if (count < npages + vm_cnt.v_free_reserved || (count < npages +
@@ -2642,9 +2639,8 @@ vm_page_activate(vm_page_t m)
 /*
  *	vm_page_free_wakeup:
  *
- *	Helper routine for vm_page_free_toq() and vm_page_cache().  This
- *	routine is called when a page has been added to the cache or free
- *	queues.
+ *	Helper routine for vm_page_free_toq().  This routine is called
+ *	when a page is added to the free queues.
  *
  *	The page queues must be locked.
  */
@@ -2732,8 +2728,8 @@ vm_page_free_toq(vm_page_t m)
 			pmap_page_set_memattr(m, VM_MEMATTR_DEFAULT);
 
 		/*
-		 * Insert the page into the physical memory allocator's
-		 * cache/free page queues.
+		 * Insert the page into the physical memory allocator's free
+		 * page queues.
 		 */
 		mtx_lock(&vm_page_queue_free_mtx);
 		vm_phys_freecnt_adj(m, 1);
@@ -2833,21 +2829,10 @@ vm_page_unwire(vm_page_t m, uint8_t queu
 /*
  * Move the specified page to the inactive queue.
  *
- * Many pages placed on the inactive queue should actually go
- * into the cache, but it is difficult to figure out which.  What
- * we do instead, if the inactive target is well met, is to put
- * clean pages at the head of the inactive queue instead of the tail.
- * This will cause them to be moved to the cache more quickly and
- * if not actively re-referenced, reclaimed more quickly.  If we just
- * stick these pages at the end of the inactive queue, heavy filesystem
- * meta-data accesses can cause an unnecessary paging load on memory bound
- * processes.  This optimization causes one-time-use metadata to be
- * reused more quickly.
- *
- * Normally noreuse is FALSE, resulting in LRU operation.  noreuse is set
- * to TRUE if we want this page to be 'as if it were placed in the cache',
- * except without unmapping it from the process address space.  In
- * practice this is implemented by inserting the page at the head of the
+ * Normally, "noreuse" is FALSE, resulting in LRU ordering of the inactive
+ * queue.  However, setting "noreuse" to TRUE will accelerate the specified
+ * page's reclamation, but it will not unmap the page from any address space.
+ * This is implemented by inserting the page near the head of the inactive
  * queue, using a marker page to guide FIFO insertion ordering.
  *
  * The page must be locked.
@@ -2974,16 +2959,9 @@ vm_page_advise(vm_page_t m, int advice)
 	if (advice == MADV_FREE)
 		/*
 		 * Mark the page clean.  This will allow the page to be freed
-		 * up by the system.  However, such pages are often reused
-		 * quickly by malloc() so we do not do anything that would
-		 * cause a page fault if we can help it.
-		 *
-		 * Specifically, we do not try to actually free the page now
-		 * nor do we try to put it in the cache (which would cause a
-		 * page fault on reuse).
-		 *
-		 * But we do make the page as freeable as we can without
-		 * actually taking the step of unmapping it.
+		 * without first paging it out.  MADV_FREE pages are often
+		 * quickly reused by malloc(3), so we do not do anything that
+		 * would result in a page fault on a later access.
 		 */
 		vm_page_undirty(m);
 	else if (advice != MADV_DONTNEED)

Modified: head/sys/vm/vm_page.h
==============================================================================
--- head/sys/vm/vm_page.h	Mon Dec 12 17:23:09 2016	(r309897)
+++ head/sys/vm/vm_page.h	Mon Dec 12 17:47:09 2016	(r309898)
@@ -352,19 +352,16 @@ extern struct mtx_padalign pa_lock[];
  *	free
  *		Available for allocation now.
  *
- *	cache
- *		Almost available for allocation. Still associated with
- *		an object, but clean and immediately freeable.
- *
- * The following lists are LRU sorted:
- *
  *	inactive
  *		Low activity, candidates for reclamation.
+ *		This list is approximately LRU ordered.
+ *
+ *	laundry
  *		This is the list of pages that should be
  *		paged out next.
  *
  *	active
- *		Pages that are "active" i.e. they have been
+ *		Pages that are "active", i.e., they have been
  *		recently referenced.
  *
  */

Modified: head/sys/vm/vm_reserv.c
==============================================================================
--- head/sys/vm/vm_reserv.c	Mon Dec 12 17:23:09 2016	(r309897)
+++ head/sys/vm/vm_reserv.c	Mon Dec 12 17:47:09 2016	(r309898)
@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
 
 /*
  * The reservation system supports the speculative allocation of large physical
- * pages ("superpages").  Speculative allocation enables the fully-automatic
+ * pages ("superpages").  Speculative allocation enables the fully automatic
  * utilization of superpages by the virtual memory system.  In other words, no
  * programmatic directives are required to use superpages.
  */
@@ -155,11 +155,11 @@ popmap_is_set(popmap_t popmap[], int i)
  * physical pages for the range [pindex, pindex + VM_LEVEL_0_NPAGES) of offsets
  * within that object.  The reservation's "popcnt" tracks the number of these
  * small physical pages that are in use at any given time.  When and if the
- * reservation is not fully utilized, it appears in the queue of partially-
+ * reservation is not fully utilized, it appears in the queue of partially
  * populated reservations.  The reservation always appears on the containing
  * object's list of reservations.
  *
- * A partially-populated reservation can be broken and reclaimed at any time.
+ * A partially populated reservation can be broken and reclaimed at any time.
  */
 struct vm_reserv {
 	TAILQ_ENTRY(vm_reserv) partpopq;
@@ -196,11 +196,11 @@ struct vm_reserv {
 static vm_reserv_t vm_reserv_array;
 
 /*
- * The partially-populated reservation queue
+ * The partially populated reservation queue
  *
- * This queue enables the fast recovery of an unused cached or free small page
- * from a partially-populated reservation.  The reservation at the head of
- * this queue is the least-recently-changed, partially-populated reservation.
+ * This queue enables the fast recovery of an unused free small page from a
+ * partially populated reservation.  The reservation at the head of this queue
+ * is the least recently changed, partially populated reservation.
  *
  * Access to this queue is synchronized by the free page queue lock.
  */
@@ -225,7 +225,7 @@ SYSCTL_PROC(_vm_reserv, OID_AUTO, fullpo
 static int sysctl_vm_reserv_partpopq(SYSCTL_HANDLER_ARGS);
 
 SYSCTL_OID(_vm_reserv, OID_AUTO, partpopq, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0,
-    sysctl_vm_reserv_partpopq, "A", "Partially-populated reservation queues");
+    sysctl_vm_reserv_partpopq, "A", "Partially populated reservation queues");
 
 static long vm_reserv_reclaimed;
 SYSCTL_LONG(_vm_reserv, OID_AUTO, reclaimed, CTLFLAG_RD,
@@ -267,7 +267,7 @@ sysctl_vm_reserv_fullpop(SYSCTL_HANDLER_
 }
 
 /*
- * Describes the current state of the partially-populated reservation queue.
+ * Describes the current state of the partially populated reservation queue.
  */
 static int
 sysctl_vm_reserv_partpopq(SYSCTL_HANDLER_ARGS)
@@ -301,7 +301,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER
 /*
  * Reduces the given reservation's population count.  If the population count
  * becomes zero, the reservation is destroyed.  Additionally, moves the
- * reservation to the tail of the partially-populated reservation queue if the
+ * reservation to the tail of the partially populated reservation queue if the
  * population count is non-zero.
  *
  * The free page queue lock must be held.
@@ -363,7 +363,7 @@ vm_reserv_has_pindex(vm_reserv_t rv, vm_
 
 /*
  * Increases the given reservation's population count.  Moves the reservation
- * to the tail of the partially-populated reservation queue.
+ * to the tail of the partially populated reservation queue.
  *
  * The free page queue must be locked.
  */
@@ -597,7 +597,7 @@ found:
 }
 
 /*
- * Allocates a page from an existing or newly-created reservation.
+ * Allocates a page from an existing or newly created reservation.
  *
  * The page "mpred" must immediately precede the offset "pindex" within the
  * specified object.
@@ -721,12 +721,12 @@ found:
 }
 
 /*
- * Breaks the given reservation.  Except for the specified cached or free
- * page, all cached and free pages in the reservation are returned to the
- * physical memory allocator.  The reservation's population count and map are
- * reset to their initial state.
+ * Breaks the given reservation.  Except for the specified free page, all free
+ * pages in the reservation are returned to the physical memory allocator.
+ * The reservation's population count and map are reset to their initial
+ * state.
  *
- * The given reservation must not be in the partially-populated reservation
+ * The given reservation must not be in the partially populated reservation
  * queue.  The free page queue lock must be held.
  */
 static void
@@ -895,7 +895,7 @@ vm_reserv_level(vm_page_t m)
 }
 
 /*
- * Returns a reservation level if the given page belongs to a fully-populated
+ * Returns a reservation level if the given page belongs to a fully populated
  * reservation and -1 otherwise.
  */
 int
@@ -908,8 +908,8 @@ vm_reserv_level_iffullpop(vm_page_t m)
 }
 
 /*
- * Breaks the given partially-populated reservation, releasing its cached and
- * free pages to the physical memory allocator.
+ * Breaks the given partially populated reservation, releasing its free pages
+ * to the physical memory allocator.
  *
  * The free page queue lock must be held.
  */
@@ -927,9 +927,9 @@ vm_reserv_reclaim(vm_reserv_t rv)
 }
 
 /*
- * Breaks the reservation at the head of the partially-populated reservation
- * queue, releasing its cached and free pages to the physical memory
- * allocator.  Returns TRUE if a reservation is broken and FALSE otherwise.
+ * Breaks the reservation at the head of the partially populated reservation
+ * queue, releasing its free pages to the physical memory allocator.  Returns
+ * TRUE if a reservation is broken and FALSE otherwise.
  *
  * The free page queue lock must be held.
  */
@@ -947,11 +947,10 @@ vm_reserv_reclaim_inactive(void)
 }
 
 /*
- * Searches the partially-populated reservation queue for the least recently
- * active reservation with unused pages, i.e., cached or free, that satisfy the
- * given request for contiguous physical memory.  If a satisfactory reservation
- * is found, it is broken.  Returns TRUE if a reservation is broken and FALSE
- * otherwise.
+ * Searches the partially populated reservation queue for the least recently
+ * changed reservation with free pages that satisfy the given request for
+ * contiguous physical memory.  If a satisfactory reservation is found, it is
+ * broken.  Returns TRUE if a reservation is broken and FALSE otherwise.
  *
  * The free page queue lock must be held.
  */

From owner-svn-src-all@freebsd.org  Mon Dec 12 17:56:57 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9731AC7415B;
 Mon, 12 Dec 2016 17:56:57 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 66266CC0;
 Mon, 12 Dec 2016 17:56:57 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCHuuux052612;
 Mon, 12 Dec 2016 17:56:56 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCHuuaZ052611;
 Mon, 12 Dec 2016 17:56:56 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121756.uBCHuuaZ052611@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 17:56:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309899 - stable/11/usr.sbin/bsdconfig/share
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 17:56:57 -0000

Author: dteske
Date: Mon Dec 12 17:56:56 2016
New Revision: 309899
URL: https://svnweb.freebsd.org/changeset/base/309899

Log:
  MFC r307402: Guard against bad service name argument(s) to load_rc_config()

Modified:
  stable/11/usr.sbin/bsdconfig/share/sysrc.subr
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bsdconfig/share/sysrc.subr
==============================================================================
--- stable/11/usr.sbin/bsdconfig/share/sysrc.subr	Mon Dec 12 17:47:09 2016	(r309898)
+++ stable/11/usr.sbin/bsdconfig/share/sysrc.subr	Mon Dec 12 17:56:56 2016	(r309899)
@@ -256,7 +256,9 @@ f_sysrc_service_configs()
 			last_name=
 			print_name() {
 				local name="$1"
-				[ "$name" = "$last_name" ] && return
+				case "$name" in
+				""|.|..|*/*|"$last_name") return ;;
+				esac
 				echo "$name" >&9
 				last_name="$name"
 			}

From owner-svn-src-all@freebsd.org  Mon Dec 12 17:58:44 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4459C741E1;
 Mon, 12 Dec 2016 17:58:44 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 735D3E3C;
 Mon, 12 Dec 2016 17:58:44 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCHwhg2052729;
 Mon, 12 Dec 2016 17:58:43 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCHwhJ9052728;
 Mon, 12 Dec 2016 17:58:43 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121758.uBCHwhJ9052728@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 17:58:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309900 - stable/10/usr.sbin/bsdconfig/share
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 17:58:44 -0000

Author: dteske
Date: Mon Dec 12 17:58:43 2016
New Revision: 309900
URL: https://svnweb.freebsd.org/changeset/base/309900

Log:
  MFC r307402: Guard against bad service name argument(s) to load_rc_config()

Modified:
  stable/10/usr.sbin/bsdconfig/share/sysrc.subr
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bsdconfig/share/sysrc.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/share/sysrc.subr	Mon Dec 12 17:56:56 2016	(r309899)
+++ stable/10/usr.sbin/bsdconfig/share/sysrc.subr	Mon Dec 12 17:58:43 2016	(r309900)
@@ -256,7 +256,9 @@ f_sysrc_service_configs()
 			last_name=
 			print_name() {
 				local name="$1"
-				[ "$name" = "$last_name" ] && return
+				case "$name" in
+				""|.|..|*/*|"$last_name") return ;;
+				esac
 				echo "$name" >&9
 				last_name="$name"
 			}

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:05:56 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B300C74410;
 Mon, 12 Dec 2016 18:05:56 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D105D14D3;
 Mon, 12 Dec 2016 18:05:55 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCI5tGv056784;
 Mon, 12 Dec 2016 18:05:55 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCI5trH056783;
 Mon, 12 Dec 2016 18:05:55 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121805.uBCI5trH056783@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:05:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309901 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:05:56 -0000

Author: dteske
Date: Mon Dec 12 18:05:54 2016
New Revision: 309901
URL: https://svnweb.freebsd.org/changeset/base/309901

Log:
  Comments

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 17:58:43 2016	(r309900)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:05:54 2016	(r309901)
@@ -41,8 +41,10 @@ country_set()
 	local iface_up=
 	local ifconfig_args=
 
+	#
 	# Setup what was selected
-	# NB: do not change order of arguments (or regdomain will be ignored)
+	# NB: Do not change order of arguments (or regdomain will be ignored)
+	#
 	if [ ! -z "$2" ]; then
 		ifconfig_args="${ifconfig_args}country $2"
 	fi
@@ -74,9 +76,9 @@ country_set()
 		    --yes-label Change --no-label Ignore --yesno \
 		    "Error while applying chosen settings ($error_str)" 0 0
 		if [ $? -eq $DIALOG_OK ]; then
-			return $FAILURE		# Restart
+			return $FAILURE # Restart
 		else
-			return $SUCCESS		# Skip
+			return $SUCCESS # Skip
 		fi
 	else
 		: > $BSDINSTALL_TMPETC/rc.conf.net.wlan
@@ -97,7 +99,9 @@ dialog_country_select()
 	local regdomain=
 	local country=
 
+	#
 	# Parse available countries/regdomains
+	#
 	input=`ifconfig $WLAN_IFACE list countries | sed 's/DEBUG//gi'`
 	regdomains=`echo $input | sed 's/.*domains://' | tr ' ' '\n' |
 		sort | tr '\n' ' '`
@@ -164,8 +168,10 @@ echo "ap_scan=1" >> $BSDINSTALL_TMPETC/w
 echo "fast_reauth=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
 echo >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
 
+#
 # Try to reach wpa_supplicant. If it isn't running and we can modify the
 # existing system, start it. Otherwise, fail.
+#
 (wpa_cli ping >/dev/null 2>/dev/null || ([ ! -z $BSDINSTALL_CONFIGCURRENT ] &&
 	wpa_supplicant -B -i $1 -c $BSDINSTALL_TMPETC/wpa_supplicant.conf)) ||
 	(dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
@@ -179,8 +185,10 @@ if [ $? -ne 0 -a -z $BSDINSTALL_CONFIGCU
 	exit 1
 fi
 
+#
 # There is no way to check country/regdomain without (possible)
 # interface state modification
+#
 if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
 	# Get current country/regdomain for selected interface
 	WLAN_IFACE=`wpa_cli ifname | tail -n 1`
@@ -242,10 +250,7 @@ do
 		# here we ask if the user wants to select the network manually
 		f_dialog_title "Network Selection"
 		f_dialog_yesno "Do you want to select the network manually?" || exit 1
-		# and take the manual input
-		# first, take the ssid
 		f_dialog_input NETWORK "Enter SSID" || exit 1
-		# then, the encryption
 		ENCRYPTION=$( dialog --backtitle "$DIALOG_BACKTITLE" --title \
 			"$DIALOG_TITLE" --menu "Select encryption type" 0 0 0 \
 			"1 WPA/WPA2 PSK" "" "2 WPA/WPA2 EAP" "" "3 WEP" "" "0 None" "" 2>&1 1>&3 ) || exit 1

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:10:34 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 889D3C745BB;
 Mon, 12 Dec 2016 18:10:34 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 634E01734;
 Mon, 12 Dec 2016 18:10:34 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIAXMQ056993;
 Mon, 12 Dec 2016 18:10:33 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIAXGU056992;
 Mon, 12 Dec 2016 18:10:33 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121810.uBCIAXGU056992@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:10:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309902 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:10:34 -0000

Author: dteske
Date: Mon Dec 12 18:10:33 2016
New Revision: 309902
URL: https://svnweb.freebsd.org/changeset/base/309902

Log:
  Use $( ... ) instead of `...`

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:05:54 2016	(r309901)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:10:33 2016	(r309902)
@@ -60,12 +60,12 @@ country_set()
 	fi
 
 	# Regdomain/country cannot be applied while interface is running
-	iface_up=`ifconfig -lu | grep -w $WLAN_IFACE`
+	iface_up=$( ifconfig -lu | grep -w $WLAN_IFACE )
 	if [ ! -z "$iface_up" ]; then
 		ifconfig $WLAN_IFACE down
 	fi
-	error_str=`ifconfig $WLAN_IFACE $ifconfig_args 2>&1 |
-		sed 's/ifconfig: //'`
+	error_str=$( ifconfig $WLAN_IFACE $ifconfig_args 2>&1 |
+		sed 's/ifconfig: //' )
 	if [ ! -z "$iface_up" ]; then
 		# Restart wpa_supplicant(8) (should not fail).
 		wpa_supplicant -B -i $WLAN_IFACE -c \
@@ -102,10 +102,10 @@ dialog_country_select()
 	#
 	# Parse available countries/regdomains
 	#
-	input=`ifconfig $WLAN_IFACE list countries | sed 's/DEBUG//gi'`
-	regdomains=`echo $input | sed 's/.*domains://' | tr ' ' '\n' |
-		sort | tr '\n' ' '`
-	countries=`echo $input | sed 's/Country codes://' |
+	input=$( ifconfig $WLAN_IFACE list countries | sed 's/DEBUG//gi' )
+	regdomains=$( echo $input | sed 's/.*domains://' | tr ' ' '\n' |
+		sort | tr '\n' ' ' )
+	countries=$( echo $input | sed 's/Country codes://' |
 	    sed 's/Regulatory.*//' | awk '{
 		for (i = 1; i <= NF; i++) {
 			printf "%s", $i
@@ -117,7 +117,7 @@ dialog_country_select()
 			else
 				printf " "
 		}
-	    }' | sort -k 2 | tr '\n' ' '`
+	    }' | sort -k 2 | tr '\n' ' ' )
 
 	# Change default cursor position (if required).
 	if [ "$1" != "<not selected>" ]; then
@@ -130,7 +130,7 @@ dialog_country_select()
 	f_dialog_menu_size height width rows \"Regdomain selection\" \
 	    \"FreeBSD Installer\" \"Select your regdomain.\" \
 	    \"\" $regdomains
-	regdomain=`sh -c "dialog \
+	regdomain=$( sh -c "dialog \
 	    --backtitle \"FreeBSD Installer\" \
 	    --title \"Regdomain selection\" \
 	    --cancel-label \"Skip\" \
@@ -138,19 +138,19 @@ dialog_country_select()
 	    --no-items \
 	    --stdout \
 	    --menu \"Select your regdomain.\" \
-	    $height $width $rows $regdomains"`
+	    $height $width $rows $regdomains" )
 
 	f_dialog_menu_size height width rows \"Country selection\" \
 	    \"FreeBSD Installer\" \"Select your country.\" \
 	    \"\" $countries
-	country=`sh -c "dialog \
+	country=$( sh -c "dialog \
 	    --backtitle \"FreeBSD Installer\" \
 	    --title \"Country selection\" \
 	    --cancel-label \"Skip\" \
 	    $def_item_country \
 	    --stdout \
 	    --menu \"Select your country.\" \
-	    $height $width $rows $countries"`
+	    $height $width $rows $countries" )
 
 	country_set "$regdomain" "$country"
 
@@ -191,13 +191,13 @@ fi
 #
 if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
 	# Get current country/regdomain for selected interface
-	WLAN_IFACE=`wpa_cli ifname | tail -n 1`
-	INPUT=`ifconfig $WLAN_IFACE list regdomain | head -n 1`
-	DEF_REGDOMAIN=`echo $INPUT | cut -w -f 2`
+	WLAN_IFACE=$( wpa_cli ifname | tail -n 1 )
+	INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -n 1 )
+	DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 )
 	if [ "$DEF_REGDOMAIN" = "0" ]; then
 		DEF_REGDOMAIN="<not selected>"
 	fi
-	DEF_COUNTRY=`echo $INPUT | cut -w -f 4`
+	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
 	if [ "$DEF_COUNTRY" = "0" ]; then
 		DEF_COUNTRY="<not selected>"
 	fi
@@ -225,10 +225,10 @@ do
 	    --pause "Waiting 5 seconds to scan for wireless networks..." \
 	    9 40 5 || exit 1
 
-	SCAN_RESULTS=`wpa_cli scan_results`
-	NETWORKS=`echo "$SCAN_RESULTS" | awk -F '\t' \
+	SCAN_RESULTS=$( wpa_cli scan_results )
+	NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' \
 	   '/..:..:..:..:..:../ {if (length($5) > 0) \
-	   printf("\"%s\"\t%s\n", $5, $4);}' | sort | uniq`
+	   printf("\"%s\"\t%s\n", $5, $4);}' | sort | uniq )
 
 	if [ -z "$NETWORKS" ]; then
 		dialog --backtitle "FreeBSD Installer" --title "Error" \
@@ -238,10 +238,10 @@ do
 	fi
 
 	exec 3>&1
-	NETWORK=`sh -c "dialog --extra-button --extra-label \"Rescan\" \
+	NETWORK=$( sh -c "dialog --extra-button --extra-label \"Rescan\" \
 	    --backtitle \"FreeBSD Installer\" --title \"Network Selection\" \
 	    --menu \"Select a wireless network to connect to.\" 0 0 0 \
-	    $(echo $NETWORKS | tr '\n' ' ')" 2>&1 1>&3`
+	    $(echo $NETWORKS | tr '\n' ' ')" 2>&1 1>&3 )
 	case $? in
 	0)	# OK
 		break
@@ -264,16 +264,16 @@ do
 	exec 3>&-
 done
 
-[ -z "$ENCRYPTION" ] && ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \
-    "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}"`
+[ -z "$ENCRYPTION" ] && ENCRYPTION=$( echo "$NETWORKS" | awk -F '\t' \
+    "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}" )
 
 if echo $ENCRYPTION | grep -q 'PSK'; then
 	exec 3>&1
-	PASS=`dialog --insecure --backtitle "FreeBSD Installer" \
+	PASS=$( dialog --insecure --backtitle "FreeBSD Installer" \
 	    --title "WPA Setup" --mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Password" 2 0 "" 2 12 15 63 1 \
-		2>&1 1>&3` \
+		2>&1 1>&3 ) \
 	|| exec $0 $@
 	exec 3>&-
 echo "network={
@@ -284,12 +284,12 @@ echo "network={
 }" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
 elif echo $ENCRYPTION | grep -q EAP; then
 	exec 3>&1
-	USERPASS=`dialog --insecure --backtitle "FreeBSD Installer" \
+	USERPASS=$( dialog --insecure --backtitle "FreeBSD Installer" \
 	    --title "WPA-Enterprise Setup" --mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Username" 2 0 "" 2 12 25 63 0 \
 		"Password" 3 0 "" 3 12 25 63 1 \
-		2>&1 1>&3` \
+		2>&1 1>&3 ) \
 	|| exec $0 $@
 	exec 3>&-
 echo "network={
@@ -308,11 +308,11 @@ echo "	priority=5
 }" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
 elif echo $ENCRYPTION | grep -q WEP; then
 	exec 3>&1
-	WEPKEY=`dialog --insecure --backtitle "FreeBSD Installer" \
+	WEPKEY=$( dialog --insecure --backtitle "FreeBSD Installer" \
 	    --title "WEP Setup" --mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"WEP Key 0" 2 0 "" 2 12 15 0 1 \
-		2>&1 1>&3` \
+		2>&1 1>&3 ) \
 	|| exec $0 $@
 echo "network={
 	ssid=\"$NETWORK\"

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:13:04 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB607C74747;
 Mon, 12 Dec 2016 18:13:04 +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 BAF291B7D;
 Mon, 12 Dec 2016 18:13:04 +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 uBCID3Yf060601;
 Mon, 12 Dec 2016 18:13:03 GMT (envelope-from andrew@FreeBSD.org)
Received: (from andrew@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCID38F060600;
 Mon, 12 Dec 2016 18:13:03 GMT (envelope-from andrew@FreeBSD.org)
Message-Id: <201612121813.uBCID38F060600@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: andrew set sender to
 andrew@FreeBSD.org using -f
From: Andrew Turner <andrew@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:13:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309903 - head/sys/arm64/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:13:05 -0000

Author: andrew
Date: Mon Dec 12 18:13:03 2016
New Revision: 309903
URL: https://svnweb.freebsd.org/changeset/base/309903

Log:
  Enable ACPI on arm64. It's not yet functional, but it will help keeping the
  code building until it is ready.
  
  Obtained from:	ABT Systems Ltd
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/arm64/conf/GENERIC

Modified: head/sys/arm64/conf/GENERIC
==============================================================================
--- head/sys/arm64/conf/GENERIC	Mon Dec 12 18:10:33 2016	(r309902)
+++ head/sys/arm64/conf/GENERIC	Mon Dec 12 18:13:03 2016	(r309903)
@@ -230,7 +230,7 @@ device		bpf		# Berkeley packet filter
 options 	THUNDERX_PASS_1_1_ERRATA
 
 options 	FDT
-#device		acpi
+device		acpi
 
 # The crypto framework is required by IPSEC
 device		crypto			# Required by IPSEC

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:17:31 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9583C747EB;
 Mon, 12 Dec 2016 18:17:31 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 940791D5F;
 Mon, 12 Dec 2016 18:17:31 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIHUoq060787;
 Mon, 12 Dec 2016 18:17:30 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIHUFH060786;
 Mon, 12 Dec 2016 18:17:30 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121817.uBCIHUFH060786@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:17:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309904 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:17:31 -0000

Author: dteske
Date: Mon Dec 12 18:17:30 2016
New Revision: 309904
URL: https://svnweb.freebsd.org/changeset/base/309904

Log:
  Change "[ ! -z ... ]" => "[ ... ]" and "[ -z ... ]" => "[ ! ... ]"

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:13:03 2016	(r309903)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:17:30 2016	(r309904)
@@ -45,33 +45,33 @@ country_set()
 	# Setup what was selected
 	# NB: Do not change order of arguments (or regdomain will be ignored)
 	#
-	if [ ! -z "$2" ]; then
+	if [ "$2" ]; then
 		ifconfig_args="${ifconfig_args}country $2"
 	fi
-	if [ ! -z "$1" ]; then
-		if [ ! -z "$2" ]; then
+	if [ "$1" ]; then
+		if [ "$2" ]; then
 			ifconfig_args="${ifconfig_args} "
 		fi
 		ifconfig_args="${ifconfig_args}regdomain $1"
 	fi
-	if [ -z "$ifconfig_args" ]; then
+	if [ ! "$ifconfig_args" ]; then
 		# Nothing to do (everything was skipped)
 		return $SUCCESS
 	fi
 
 	# Regdomain/country cannot be applied while interface is running
 	iface_up=$( ifconfig -lu | grep -w $WLAN_IFACE )
-	if [ ! -z "$iface_up" ]; then
+	if [ "$iface_up" ]; then
 		ifconfig $WLAN_IFACE down
 	fi
 	error_str=$( ifconfig $WLAN_IFACE $ifconfig_args 2>&1 |
 		sed 's/ifconfig: //' )
-	if [ ! -z "$iface_up" ]; then
+	if [ "$iface_up" ]; then
 		# Restart wpa_supplicant(8) (should not fail).
 		wpa_supplicant -B -i $WLAN_IFACE -c \
 		    $BSDINSTALL_TMPETC/wpa_supplicant.conf
 	fi
-	if [ ! -z "$error_str" ]; then
+	if [ "$error_str" ]; then
 		dialog --backtitle "FreeBSD Installer" --title "Error" \
 		    --yes-label Change --no-label Ignore --yesno \
 		    "Error while applying chosen settings ($error_str)" 0 0
@@ -172,14 +172,14 @@ echo >> $BSDINSTALL_TMPETC/wpa_supplican
 # Try to reach wpa_supplicant. If it isn't running and we can modify the
 # existing system, start it. Otherwise, fail.
 #
-(wpa_cli ping >/dev/null 2>/dev/null || ([ ! -z $BSDINSTALL_CONFIGCURRENT ] &&
+(wpa_cli ping >/dev/null 2>/dev/null || ([ "$BSDINSTALL_CONFIGCURRENT" ] &&
 	wpa_supplicant -B -i $1 -c $BSDINSTALL_TMPETC/wpa_supplicant.conf)) ||
 	(dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
 	"Could not start wpa_supplicant!" 0 0; exit 1) || exit 1
 
 # See if we succeeded
 wpa_cli ping >/dev/null 2>/dev/null
-if [ $? -ne 0 -a -z $BSDINSTALL_CONFIGCURRENT ]; then
+if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then
 	dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
 	"Wireless cannot be configured without making changes to the local system!" \ 0 0
 	exit 1
@@ -189,7 +189,7 @@ fi
 # There is no way to check country/regdomain without (possible)
 # interface state modification
 #
-if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	# Get current country/regdomain for selected interface
 	WLAN_IFACE=$( wpa_cli ifname | tail -n 1 )
 	INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -n 1 )
@@ -230,7 +230,7 @@ do
 	   '/..:..:..:..:..:../ {if (length($5) > 0) \
 	   printf("\"%s\"\t%s\n", $5, $4);}' | sort | uniq )
 
-	if [ -z "$NETWORKS" ]; then
+	if [ ! "$NETWORKS" ]; then
 		dialog --backtitle "FreeBSD Installer" --title "Error" \
 		    --yesno "No wireless networks were found. Rescan?" 0 0 &&
 		    continue
@@ -264,7 +264,7 @@ do
 	exec 3>&-
 done
 
-[ -z "$ENCRYPTION" ] && ENCRYPTION=$( echo "$NETWORKS" | awk -F '\t' \
+[ ! "$ENCRYPTION" ] && ENCRYPTION=$( echo "$NETWORKS" | awk -F '\t' \
     "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}" )
 
 if echo $ENCRYPTION | grep -q 'PSK'; then

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:20:57 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA33AC74982;
 Mon, 12 Dec 2016 18:20:57 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B9B5D90;
 Mon, 12 Dec 2016 18:20:57 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIKu6U061687;
 Mon, 12 Dec 2016 18:20:56 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIKuqC061686;
 Mon, 12 Dec 2016 18:20:56 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121820.uBCIKuqC061686@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:20:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309905 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:20:58 -0000

Author: dteske
Date: Mon Dec 12 18:20:56 2016
New Revision: 309905
URL: https://svnweb.freebsd.org/changeset/base/309905

Log:
  Remove unnecessary local initializers

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:17:30 2016	(r309904)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:20:56 2016	(r309905)
@@ -37,8 +37,8 @@ f_include $BSDCFG_SHARE/dialog.subr
 
 country_set()
 {
-	local error_str=
-	local iface_up=
+	local error_str
+	local iface_up
 	local ifconfig_args=
 
 	#
@@ -91,13 +91,13 @@ country_set()
 
 dialog_country_select()
 {
-	local input=
+	local input
 	local def_item_regdomain=
 	local def_item_country=
-	local regdomains=
-	local countries=
-	local regdomain=
-	local country=
+	local regdomains
+	local countries
+	local regdomain
+	local country
 
 	#
 	# Parse available countries/regdomains

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:21:57 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2805C74ABC;
 Mon, 12 Dec 2016 18:21:57 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8B7425E3;
 Mon, 12 Dec 2016 18:21:57 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCILujF064701;
 Mon, 12 Dec 2016 18:21:56 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCILutB064700;
 Mon, 12 Dec 2016 18:21:56 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121821.uBCILutB064700@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:21:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309906 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:21:57 -0000

Author: dteske
Date: Mon Dec 12 18:21:56 2016
New Revision: 309906
URL: https://svnweb.freebsd.org/changeset/base/309906

Log:
  Consolidate locals

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:20:56 2016	(r309905)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:21:56 2016	(r309906)
@@ -37,9 +37,7 @@ f_include $BSDCFG_SHARE/dialog.subr
 
 country_set()
 {
-	local error_str
-	local iface_up
-	local ifconfig_args=
+	local error_str iface_up ifconfig_args=
 
 	#
 	# Setup what was selected
@@ -91,13 +89,9 @@ country_set()
 
 dialog_country_select()
 {
-	local input
+	local input regdomains countries regdomain country
 	local def_item_regdomain=
 	local def_item_country=
-	local regdomains
-	local countries
-	local regdomain
-	local country
 
 	#
 	# Parse available countries/regdomains

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:24:42 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7DA4C74B75;
 Mon, 12 Dec 2016 18:24:42 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 777DC901;
 Mon, 12 Dec 2016 18:24:42 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIOfUY064848;
 Mon, 12 Dec 2016 18:24:41 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIOfrN064847;
 Mon, 12 Dec 2016 18:24:41 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121824.uBCIOfrN064847@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:24:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309907 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:24:42 -0000

Author: dteske
Date: Mon Dec 12 18:24:41 2016
New Revision: 309907
URL: https://svnweb.freebsd.org/changeset/base/309907

Log:
  Replace funny block with something easy to digest

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:21:56 2016	(r309906)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:24:41 2016	(r309907)
@@ -43,19 +43,10 @@ country_set()
 	# Setup what was selected
 	# NB: Do not change order of arguments (or regdomain will be ignored)
 	#
-	if [ "$2" ]; then
-		ifconfig_args="${ifconfig_args}country $2"
-	fi
-	if [ "$1" ]; then
-		if [ "$2" ]; then
-			ifconfig_args="${ifconfig_args} "
-		fi
-		ifconfig_args="${ifconfig_args}regdomain $1"
-	fi
-	if [ ! "$ifconfig_args" ]; then
-		# Nothing to do (everything was skipped)
-		return $SUCCESS
-	fi
+	[ "$2" ] && ifconfig_args="$ifconfig_args country $2"
+	[ "$1" ] && ifconfig_args="$ifconfig_args regdomain $1"
+	[ "$ifconfig_args" ] || return $SUCCESS # Nothing to do
+	ifconfig_args="${ifconfig_args# }"
 
 	# Regdomain/country cannot be applied while interface is running
 	iface_up=$( ifconfig -lu | grep -w $WLAN_IFACE )

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:28:21 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5478C74C04;
 Mon, 12 Dec 2016 18:28:21 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 84C7BAB5;
 Mon, 12 Dec 2016 18:28:21 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCISKpj065010;
 Mon, 12 Dec 2016 18:28:20 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCISKHj065009;
 Mon, 12 Dec 2016 18:28:20 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121828.uBCISKHj065009@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:28:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309908 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:28:21 -0000

Author: dteske
Date: Mon Dec 12 18:28:20 2016
New Revision: 309908
URL: https://svnweb.freebsd.org/changeset/base/309908

Log:
  Collapse tiny if statements

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:24:41 2016	(r309907)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:28:20 2016	(r309908)
@@ -50,9 +50,7 @@ country_set()
 
 	# Regdomain/country cannot be applied while interface is running
 	iface_up=$( ifconfig -lu | grep -w $WLAN_IFACE )
-	if [ "$iface_up" ]; then
-		ifconfig $WLAN_IFACE down
-	fi
+	[ "$iface_up" ] && ifconfig $WLAN_IFACE down
 	error_str=$( ifconfig $WLAN_IFACE $ifconfig_args 2>&1 |
 		sed 's/ifconfig: //' )
 	if [ "$iface_up" ]; then
@@ -179,13 +177,9 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	WLAN_IFACE=$( wpa_cli ifname | tail -n 1 )
 	INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -n 1 )
 	DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 )
-	if [ "$DEF_REGDOMAIN" = "0" ]; then
-		DEF_REGDOMAIN="<not selected>"
-	fi
+	[ "$DEF_REGDOMAIN" = "0" ] && DEF_REGDOMAIN="<not selected>"
 	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
-	if [ "$DEF_COUNTRY" = "0" ]; then
-		DEF_COUNTRY="<not selected>"
-	fi
+	[ "$DEF_COUNTRY" = "0" ] && DEF_COUNTRY="<not selected>"
 	dialog --backtitle "FreeBSD Installer" --title "Regdomain/country" \
 	    --yesno "Change regdomain/country (now \
 	    $DEF_REGDOMAIN/$DEF_COUNTRY)?" 0 0

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:29:25 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CBCDC74C80;
 Mon, 12 Dec 2016 18:29:25 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5C5A7C5F;
 Mon, 12 Dec 2016 18:29:25 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCITO38065087;
 Mon, 12 Dec 2016 18:29:24 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCITOQC065086;
 Mon, 12 Dec 2016 18:29:24 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121829.uBCITOQC065086@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:29:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309909 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:29:25 -0000

Author: dteske
Date: Mon Dec 12 18:29:24 2016
New Revision: 309909
URL: https://svnweb.freebsd.org/changeset/base/309909

Log:
  Change "[ ! ... ] && ..." to "[ ... ] || ..."

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:28:20 2016	(r309908)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:29:24 2016	(r309909)
@@ -243,7 +243,7 @@ do
 	exec 3>&-
 done
 
-[ ! "$ENCRYPTION" ] && ENCRYPTION=$( echo "$NETWORKS" | awk -F '\t' \
+[ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" | awk -F '\t' \
     "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}" )
 
 if echo $ENCRYPTION | grep -q 'PSK'; then

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:33:41 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 914A7C74E18;
 Mon, 12 Dec 2016 18:33:41 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 60CC210D8;
 Mon, 12 Dec 2016 18:33:41 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIXepa069058;
 Mon, 12 Dec 2016 18:33:40 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIXec9069057;
 Mon, 12 Dec 2016 18:33:40 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121833.uBCIXec9069057@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:33:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309910 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:33:41 -0000

Author: dteske
Date: Mon Dec 12 18:33:40 2016
New Revision: 309910
URL: https://svnweb.freebsd.org/changeset/base/309910

Log:
  Remove unnecessary quotes around number in test

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:29:24 2016	(r309909)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:33:40 2016	(r309910)
@@ -177,9 +177,9 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	WLAN_IFACE=$( wpa_cli ifname | tail -n 1 )
 	INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -n 1 )
 	DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 )
-	[ "$DEF_REGDOMAIN" = "0" ] && DEF_REGDOMAIN="<not selected>"
+	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
-	[ "$DEF_COUNTRY" = "0" ] && DEF_COUNTRY="<not selected>"
+	[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
 	dialog --backtitle "FreeBSD Installer" --title "Regdomain/country" \
 	    --yesno "Change regdomain/country (now \
 	    $DEF_REGDOMAIN/$DEF_COUNTRY)?" 0 0

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:34:22 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 864D9C74E6B;
 Mon, 12 Dec 2016 18:34:22 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 552E612A1;
 Mon, 12 Dec 2016 18:34:22 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIYLAR069129;
 Mon, 12 Dec 2016 18:34:21 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIYLRe069128;
 Mon, 12 Dec 2016 18:34:21 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121834.uBCIYLRe069128@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:34:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309911 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:34:22 -0000

Author: dteske
Date: Mon Dec 12 18:34:21 2016
New Revision: 309911
URL: https://svnweb.freebsd.org/changeset/base/309911

Log:
  Group fallbacks together

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:33:40 2016	(r309910)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:34:21 2016	(r309911)
@@ -177,8 +177,8 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	WLAN_IFACE=$( wpa_cli ifname | tail -n 1 )
 	INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -n 1 )
 	DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 )
-	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
+	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
 	dialog --backtitle "FreeBSD Installer" --title "Regdomain/country" \
 	    --yesno "Change regdomain/country (now \

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:36:47 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E76FC74EE0;
 Mon, 12 Dec 2016 18:36:47 +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 600F3147B;
 Mon, 12 Dec 2016 18:36:47 +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 uBCIakdV069268;
 Mon, 12 Dec 2016 18:36:46 GMT (envelope-from manu@FreeBSD.org)
Received: (from manu@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIakwB069265;
 Mon, 12 Dec 2016 18:36:46 GMT (envelope-from manu@FreeBSD.org)
Message-Id: <201612121836.uBCIakwB069265@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: manu set sender to
 manu@FreeBSD.org using -f
From: Emmanuel Vadot <manu@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:36:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309912 - in head/sys/arm: at91 broadcom/bcm2835 ti
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:36:47 -0000

Author: manu
Date: Mon Dec 12 18:36:46 2016
New Revision: 309912
URL: https://svnweb.freebsd.org/changeset/base/309912

Log:
  CS ivar is uint32_t, not int.
  
  MFC after:	3 days

Modified:
  head/sys/arm/at91/at91_spi.c
  head/sys/arm/broadcom/bcm2835/bcm2835_spi.c
  head/sys/arm/ti/ti_spi.c

Modified: head/sys/arm/at91/at91_spi.c
==============================================================================
--- head/sys/arm/at91/at91_spi.c	Mon Dec 12 18:34:21 2016	(r309911)
+++ head/sys/arm/at91/at91_spi.c	Mon Dec 12 18:36:46 2016	(r309912)
@@ -290,7 +290,8 @@ at91_spi_transfer(device_t dev, device_t
 {
 	struct at91_spi_softc *sc;
 	bus_addr_t addr;
-	int err, i, j, mode[4], cs;
+	int err, i, j, mode[4];
+	uint32_t cs;
 
 	KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz,
 	    ("%s: TX/RX command sizes should be equal", __func__));
@@ -314,7 +315,7 @@ at91_spi_transfer(device_t dev, device_t
 	 * PSCDEC = 0 has a range of 0..3 for chip select.  We
 	 * don't support PSCDEC = 1 which has a range of 0..15.
 	 */
-	if (cs < 0 || cs > 3) {
+	if (cs > 3) {
 		device_printf(dev,
 		    "Invalid chip select %d requested by %s\n", cs,
 		    device_get_nameunit(child));

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_spi.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_spi.c	Mon Dec 12 18:34:21 2016	(r309911)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_spi.c	Mon Dec 12 18:36:46 2016	(r309912)
@@ -421,7 +421,8 @@ static int
 bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
 {
 	struct bcm_spi_softc *sc;
-	int cs, err;
+	uint32_t cs;
+	int err;
 
 	sc = device_get_softc(dev);
 
@@ -432,7 +433,7 @@ bcm_spi_transfer(device_t dev, device_t 
 
 	/* Get the proper chip select for this child. */
 	spibus_get_cs(child, &cs);
-	if (cs < 0 || cs > 2) {
+	if (cs > 2) {
 		device_printf(dev,
 		    "Invalid chip select %d requested by %s\n", cs,
 		    device_get_nameunit(child));

Modified: head/sys/arm/ti/ti_spi.c
==============================================================================
--- head/sys/arm/ti/ti_spi.c	Mon Dec 12 18:34:21 2016	(r309911)
+++ head/sys/arm/ti/ti_spi.c	Mon Dec 12 18:36:46 2016	(r309912)
@@ -444,9 +444,9 @@ ti_spi_gcd(int a, int b)
 static int
 ti_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
 {
-	int cs, err;
+	int err;
 	struct ti_spi_softc *sc;
-	uint32_t reg;
+	uint32_t reg, cs;
 
 	sc = device_get_softc(dev);
 
@@ -457,7 +457,7 @@ ti_spi_transfer(device_t dev, device_t c
 
 	/* Get the proper chip select for this child. */
 	spibus_get_cs(child, &cs);
-	if (cs < 0 || cs > sc->sc_numcs) {
+	if (cs > sc->sc_numcs) {
 		device_printf(dev, "Invalid chip select %d requested by %s\n",
 		    cs, device_get_nameunit(child));
 		return (EINVAL);

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:38:19 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70CFBC720A1;
 Mon, 12 Dec 2016 18:38:19 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4B5B1183B;
 Mon, 12 Dec 2016 18:38:19 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIcIrs069367;
 Mon, 12 Dec 2016 18:38:18 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIcI4X069366;
 Mon, 12 Dec 2016 18:38:18 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121838.uBCIcI4X069366@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:38:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309913 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:38:19 -0000

Author: dteske
Date: Mon Dec 12 18:38:18 2016
New Revision: 309913
URL: https://svnweb.freebsd.org/changeset/base/309913

Log:
  Allow $BSDINSTALL_TMPETC to contain whitespace or special chars

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:36:46 2016	(r309912)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:38:18 2016	(r309913)
@@ -56,7 +56,7 @@ country_set()
 	if [ "$iface_up" ]; then
 		# Restart wpa_supplicant(8) (should not fail).
 		wpa_supplicant -B -i $WLAN_IFACE -c \
-		    $BSDINSTALL_TMPETC/wpa_supplicant.conf
+		    "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 	fi
 	if [ "$error_str" ]; then
 		dialog --backtitle "FreeBSD Installer" --title "Error" \
@@ -68,9 +68,9 @@ country_set()
 			return $SUCCESS # Skip
 		fi
 	else
-		: > $BSDINSTALL_TMPETC/rc.conf.net.wlan
+		: > "$BSDINSTALL_TMPETC/rc.conf.net.wlan"
 		echo create_args_$WLAN_IFACE=\"$ifconfig_args\" >> \
-		    $BSDINSTALL_TMPETC/rc.conf.net.wlan
+		    "$BSDINSTALL_TMPETC/rc.conf.net.wlan"
 	fi
 
 	return $SUCCESS
@@ -142,21 +142,21 @@ dialog_country_select()
 
 ############################################################ MAIN
 
-echo -n > $BSDINSTALL_TMPETC/wpa_supplicant.conf
-chmod 0600 $BSDINSTALL_TMPETC/wpa_supplicant.conf
+echo -n > "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 
-echo "ctrl_interface=/var/run/wpa_supplicant" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
-echo "eapol_version=2" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
-echo "ap_scan=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
-echo "fast_reauth=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
-echo >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+echo "ctrl_interface=/var/run/wpa_supplicant" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+echo "eapol_version=2" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+echo "ap_scan=1" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+echo "fast_reauth=1" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+echo >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 
 #
 # Try to reach wpa_supplicant. If it isn't running and we can modify the
 # existing system, start it. Otherwise, fail.
 #
 (wpa_cli ping >/dev/null 2>/dev/null || ([ "$BSDINSTALL_CONFIGCURRENT" ] &&
-	wpa_supplicant -B -i $1 -c $BSDINSTALL_TMPETC/wpa_supplicant.conf)) ||
+	wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) ||
 	(dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
 	"Could not start wpa_supplicant!" 0 0; exit 1) || exit 1
 
@@ -260,7 +260,7 @@ echo "network={
 	scan_ssid=$SCANSSID
 	psk=\"$PASS\"
 	priority=5
-}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 elif echo $ENCRYPTION | grep -q EAP; then
 	exec 3>&1
 	USERPASS=$( dialog --insecure --backtitle "FreeBSD Installer" \
@@ -274,7 +274,7 @@ elif echo $ENCRYPTION | grep -q EAP; the
 echo "network={
 	ssid=\"$NETWORK\"
 	scan_ssid=$SCANSSID
-	key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+	key_mgmt=WPA-EAP" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 echo "$USERPASS" | awk '
 {
 	if (NR == 1) {
@@ -282,9 +282,9 @@ echo "$USERPASS" | awk '
 	} else if (NR == 2) {
 		printf "	password=\"%s\"\n", $1;
 	}
-}' >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+}' >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 echo "	priority=5
-}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 elif echo $ENCRYPTION | grep -q WEP; then
 	exec 3>&1
 	WEPKEY=$( dialog --insecure --backtitle "FreeBSD Installer" \
@@ -300,21 +300,21 @@ echo "network={
 	wep_key0=\"$WEPKEY\"
 	wep_tx_keyidx=0
 	priority=5
-}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 else	# Open
 echo "network={
 	ssid=\"$NETWORK\"
 	scan_ssid=$SCANSSID
 	key_mgmt=NONE
 	priority=5
-}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 fi
 
 # Connect to any open networks policy
 echo "network={
 	priority=0
 	key_mgmt=NONE
-}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 
 # Bring up new network
 if [ "$BSDINSTALL_CONFIGCURRENT" ]; then

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:39:27 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6942C722F6;
 Mon, 12 Dec 2016 18:39:27 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 860E51A16;
 Mon, 12 Dec 2016 18:39:27 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIdQJu069449;
 Mon, 12 Dec 2016 18:39:26 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIdQoB069448;
 Mon, 12 Dec 2016 18:39:26 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121839.uBCIdQoB069448@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:39:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309914 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:39:27 -0000

Author: dteske
Date: Mon Dec 12 18:39:26 2016
New Revision: 309914
URL: https://svnweb.freebsd.org/changeset/base/309914

Log:
  Add missing `-e' parameter to sed invocations

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:38:18 2016	(r309913)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:39:26 2016	(r309914)
@@ -52,7 +52,7 @@ country_set()
 	iface_up=$( ifconfig -lu | grep -w $WLAN_IFACE )
 	[ "$iface_up" ] && ifconfig $WLAN_IFACE down
 	error_str=$( ifconfig $WLAN_IFACE $ifconfig_args 2>&1 |
-		sed 's/ifconfig: //' )
+		sed -e 's/ifconfig: //' )
 	if [ "$iface_up" ]; then
 		# Restart wpa_supplicant(8) (should not fail).
 		wpa_supplicant -B -i $WLAN_IFACE -c \
@@ -85,11 +85,11 @@ dialog_country_select()
 	#
 	# Parse available countries/regdomains
 	#
-	input=$( ifconfig $WLAN_IFACE list countries | sed 's/DEBUG//gi' )
-	regdomains=$( echo $input | sed 's/.*domains://' | tr ' ' '\n' |
+	input=$( ifconfig $WLAN_IFACE list countries | sed -e 's/DEBUG//gi' )
+	regdomains=$( echo $input | sed -e 's/.*domains://' | tr ' ' '\n' |
 		sort | tr '\n' ' ' )
-	countries=$( echo $input | sed 's/Country codes://' |
-	    sed 's/Regulatory.*//' | awk '{
+	countries=$( echo $input | sed -e 's/Country codes://' |
+	    sed -e 's/Regulatory.*//' | awk '{
 		for (i = 1; i <= NF; i++) {
 			printf "%s", $i
 			if (match($i, "[[:lower:]]"))

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:42:57 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F8F9C7251C;
 Mon, 12 Dec 2016 18:42:57 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DC79B1E78;
 Mon, 12 Dec 2016 18:42:56 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIguGQ073091;
 Mon, 12 Dec 2016 18:42:56 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIguP6073090;
 Mon, 12 Dec 2016 18:42:56 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121842.uBCIguP6073090@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:42:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309915 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:42:57 -0000

Author: dteske
Date: Mon Dec 12 18:42:55 2016
New Revision: 309915
URL: https://svnweb.freebsd.org/changeset/base/309915

Log:
  "echo | sed | sed | awk" is silly (changed to "echo | awk")

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:39:26 2016	(r309914)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:42:55 2016	(r309915)
@@ -88,8 +88,9 @@ dialog_country_select()
 	input=$( ifconfig $WLAN_IFACE list countries | sed -e 's/DEBUG//gi' )
 	regdomains=$( echo $input | sed -e 's/.*domains://' | tr ' ' '\n' |
 		sort | tr '\n' ' ' )
-	countries=$( echo $input | sed -e 's/Country codes://' |
-	    sed -e 's/Regulatory.*//' | awk '{
+	countries=$( echo $input | awk '{
+		sub(/Country codes:/, "")
+		sub(/Regulatory.*/, "")
 		for (i = 1; i <= NF; i++) {
 			printf "%s", $i
 			if (match($i, "[[:lower:]]"))

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:43:43 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8E39C725CF;
 Mon, 12 Dec 2016 18:43:43 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A8727A8;
 Mon, 12 Dec 2016 18:43:43 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIhgGw073162;
 Mon, 12 Dec 2016 18:43:42 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIhgSx073161;
 Mon, 12 Dec 2016 18:43:42 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121843.uBCIhgSx073161@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:43:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309916 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:43:44 -0000

Author: dteske
Date: Mon Dec 12 18:43:42 2016
New Revision: 309916
URL: https://svnweb.freebsd.org/changeset/base/309916

Log:
  Be internally consistent (": > ..." is used elsewhere in this file)

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:42:55 2016	(r309915)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:43:42 2016	(r309916)
@@ -143,7 +143,7 @@ dialog_country_select()
 
 ############################################################ MAIN
 
-echo -n > "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+: > "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 
 echo "ctrl_interface=/var/run/wpa_supplicant" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:45:53 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6E4BC726DA;
 Mon, 12 Dec 2016 18:45:53 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 867012B9;
 Mon, 12 Dec 2016 18:45:53 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIjqe1073296;
 Mon, 12 Dec 2016 18:45:52 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIjq5i073295;
 Mon, 12 Dec 2016 18:45:52 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121845.uBCIjq5i073295@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:45:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309917 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:45:53 -0000

Author: dteske
Date: Mon Dec 12 18:45:52 2016
New Revision: 309917
URL: https://svnweb.freebsd.org/changeset/base/309917

Log:
  awk(1) match() takes a regex, use /.../ to remind ourselves of this
  NB: The difference between "..." and /.../ for a regex in awk is that
  quoted strings go through escape expansion first (e.g., \\ becomes \)

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:43:42 2016	(r309916)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:45:52 2016	(r309917)
@@ -93,8 +93,8 @@ dialog_country_select()
 		sub(/Regulatory.*/, "")
 		for (i = 1; i <= NF; i++) {
 			printf "%s", $i
-			if (match($i, "[[:lower:]]"))
-				if (match($(i+1), "[[:lower:]]"))
+			if (match($i, /[[:lower:]]/))
+				if (match($(i+1), /[[:lower:]]/))
 					printf "\\\\\\ "
 				else
 					printf "\n"

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:48:01 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 801C4C727AE;
 Mon, 12 Dec 2016 18:48:01 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4FB4A6A7;
 Mon, 12 Dec 2016 18:48:01 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIm0Sn073405;
 Mon, 12 Dec 2016 18:48:00 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIm00M073404;
 Mon, 12 Dec 2016 18:48:00 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121848.uBCIm00M073404@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:48:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309918 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:48:01 -0000

Author: dteske
Date: Mon Dec 12 18:48:00 2016
New Revision: 309918
URL: https://svnweb.freebsd.org/changeset/base/309918

Log:
  Remove unnecessary `-n' parameter to head/tail

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:45:52 2016	(r309917)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:48:00 2016	(r309918)
@@ -175,8 +175,8 @@ fi
 #
 if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	# Get current country/regdomain for selected interface
-	WLAN_IFACE=$( wpa_cli ifname | tail -n 1 )
-	INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -n 1 )
+	WLAN_IFACE=$( wpa_cli ifname | tail -1 )
+	INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -1 )
 	DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 )
 	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:52:23 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC4CDC72A1F;
 Mon, 12 Dec 2016 18:52:23 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7ECEBB94;
 Mon, 12 Dec 2016 18:52:23 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIqMsc077275;
 Mon, 12 Dec 2016 18:52:22 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIqM2D077274;
 Mon, 12 Dec 2016 18:52:22 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121852.uBCIqM2D077274@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:52:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309919 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:52:23 -0000

Author: dteske
Date: Mon Dec 12 18:52:22 2016
New Revision: 309919
URL: https://svnweb.freebsd.org/changeset/base/309919

Log:
  Whitespace

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:48:00 2016	(r309918)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:52:22 2016	(r309919)
@@ -56,12 +56,12 @@ country_set()
 	if [ "$iface_up" ]; then
 		# Restart wpa_supplicant(8) (should not fail).
 		wpa_supplicant -B -i $WLAN_IFACE -c \
-		    "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+			"$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 	fi
 	if [ "$error_str" ]; then
 		dialog --backtitle "FreeBSD Installer" --title "Error" \
-		    --yes-label Change --no-label Ignore --yesno \
-		    "Error while applying chosen settings ($error_str)" 0 0
+			--yes-label Change --no-label Ignore --yesno \
+			"Error while applying chosen settings ($error_str)" 0 0
 		if [ $? -eq $DIALOG_OK ]; then
 			return $FAILURE # Restart
 		else
@@ -101,7 +101,7 @@ dialog_country_select()
 			else
 				printf " "
 		}
-	    }' | sort -k 2 | tr '\n' ' ' )
+	}' | sort -k 2 | tr '\n' ' ' )
 
 	# Change default cursor position (if required).
 	if [ "$1" != "<not selected>" ]; then
@@ -112,29 +112,31 @@ dialog_country_select()
 	fi
 
 	f_dialog_menu_size height width rows \"Regdomain selection\" \
-	    \"FreeBSD Installer\" \"Select your regdomain.\" \
-	    \"\" $regdomains
+		\"FreeBSD Installer\" \"Select your regdomain.\" \
+		\"\" $regdomains
 	regdomain=$( sh -c "dialog \
-	    --backtitle \"FreeBSD Installer\" \
-	    --title \"Regdomain selection\" \
-	    --cancel-label \"Skip\" \
-	    $def_item_regdomain \
-	    --no-items \
-	    --stdout \
-	    --menu \"Select your regdomain.\" \
-	    $height $width $rows $regdomains" )
+		--backtitle \"FreeBSD Installer\" \
+		--title \"Regdomain selection\" \
+		--cancel-label \"Skip\" \
+		$def_item_regdomain \
+		--no-items \
+		--stdout \
+		--menu \"Select your regdomain.\" \
+		$height $width $rows $regdomains"
+	)
 
 	f_dialog_menu_size height width rows \"Country selection\" \
 	    \"FreeBSD Installer\" \"Select your country.\" \
 	    \"\" $countries
 	country=$( sh -c "dialog \
-	    --backtitle \"FreeBSD Installer\" \
-	    --title \"Country selection\" \
-	    --cancel-label \"Skip\" \
-	    $def_item_country \
-	    --stdout \
-	    --menu \"Select your country.\" \
-	    $height $width $rows $countries" )
+		--backtitle \"FreeBSD Installer\" \
+		--title \"Country selection\" \
+		--cancel-label \"Skip\" \
+		$def_item_country \
+		--stdout \
+		--menu \"Select your country.\" \
+		$height $width $rows $countries"
+	)
 
 	country_set "$regdomain" "$country"
 
@@ -195,8 +197,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	fi
 fi
 
-while :
-do
+while :; do
 	SCANSSID=0
 	output=$( wpa_cli scan 2>&1 )
 	f_dprintf "%s" "$output"

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:55:42 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68B71C72ADD;
 Mon, 12 Dec 2016 18:55:42 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 37D82D7A;
 Mon, 12 Dec 2016 18:55:42 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCItfov077453;
 Mon, 12 Dec 2016 18:55:41 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCItfTB077452;
 Mon, 12 Dec 2016 18:55:41 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121855.uBCItfTB077452@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:55:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309920 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:55:42 -0000

Author: dteske
Date: Mon Dec 12 18:55:41 2016
New Revision: 309920
URL: https://svnweb.freebsd.org/changeset/base/309920

Log:
  Use provided API instead of hard-coded status integers

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:52:22 2016	(r309919)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:55:41 2016	(r309920)
@@ -224,10 +224,10 @@ while :; do
 	    --menu \"Select a wireless network to connect to.\" 0 0 0 \
 	    $(echo $NETWORKS | tr '\n' ' ')" 2>&1 1>&3 )
 	case $? in
-	0)	# OK
+	$DIALOG_OK)
 		break
 		;;
-	1)	# Cancel
+	$DIALOG_CANCEL)
 		# here we ask if the user wants to select the network manually
 		f_dialog_title "Network Selection"
 		f_dialog_yesno "Do you want to select the network manually?" || exit 1
@@ -239,7 +239,7 @@ while :; do
 		f_dialog_title_restore
 		break
 		;;
-	3)	# Rescan
+	$DIALOG_EXTRA) # Rescan
 		;;
 	esac
 	exec 3>&-

From owner-svn-src-all@freebsd.org  Mon Dec 12 18:56:41 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F077C72B77;
 Mon, 12 Dec 2016 18:56:41 +0000 (UTC)
 (envelope-from robak@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 48035EFD;
 Mon, 12 Dec 2016 18:56:41 +0000 (UTC)
 (envelope-from robak@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIue3i077525;
 Mon, 12 Dec 2016 18:56:40 GMT (envelope-from robak@FreeBSD.org)
Received: (from robak@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIuePK077524;
 Mon, 12 Dec 2016 18:56:40 GMT (envelope-from robak@FreeBSD.org)
Message-Id: <201612121856.uBCIuePK077524@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: robak set sender to
 robak@FreeBSD.org using -f
From: Bartek Rutkowski <robak@FreeBSD.org>
Date: Mon, 12 Dec 2016 18:56:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309921 - head/bin/dd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 18:56:41 -0000

Author: robak (ports committer)
Date: Mon Dec 12 18:56:40 2016
New Revision: 309921
URL: https://svnweb.freebsd.org/changeset/base/309921

Log:
  Fix regression when stdin/out/err fds are are overridden by shell.
  
  Submitted by:	Pawel Biernacki <pawel.biernacki@gmail.com>
  Reported by:	ngie
  Approved by:	ngie
  Sponsored by:	Mysterious Code Ltd.
  Differential Revision:	https://reviews.freebsd.org/D8543

Modified:
  head/bin/dd/dd.c

Modified: head/bin/dd/dd.c
==============================================================================
--- head/bin/dd/dd.c	Mon Dec 12 18:55:41 2016	(r309920)
+++ head/bin/dd/dd.c	Mon Dec 12 18:56:40 2016	(r309921)
@@ -142,8 +142,6 @@ setup(void)
 		in.fd = open(in.name, O_RDONLY, 0);
 		if (in.fd == -1)
 			err(1, "%s", in.name);
-		if (caph_limit_stdin() == -1)
-			err(1, "unable to limit capability rights");
 	}
 
 	getfdtype(&in);
@@ -176,8 +174,6 @@ setup(void)
 		}
 		if (out.fd == -1)
 			err(1, "%s", out.name);
-		if (caph_limit_stdout() == -1)
-			err(1, "unable to limit capability rights");
 	}
 
 	getfdtype(&out);
@@ -188,6 +184,16 @@ setup(void)
 	    errno != ENOSYS)
 		err(1, "unable to limit capability rights");
 
+	if (in.fd != STDIN_FILENO && out.fd != STDIN_FILENO) {
+		if (caph_limit_stdin() == -1)
+			err(1, "unable to limit capability rights");
+	}
+
+	if (in.fd != STDOUT_FILENO && out.fd != STDOUT_FILENO) {
+		if (caph_limit_stdout() == -1)
+			err(1, "unable to limit capability rights");
+	}
+
 	if (in.fd != STDERR_FILENO && out.fd != STDERR_FILENO) {
 		if (caph_limit_stderr() == -1)
 			err(1, "unable to limit capability rights");

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:01:06 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36AA6C72D9F;
 Mon, 12 Dec 2016 19:01:06 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EBD3F12A0;
 Mon, 12 Dec 2016 19:01:05 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCJ15KF078581;
 Mon, 12 Dec 2016 19:01:05 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJ151g078580;
 Mon, 12 Dec 2016 19:01:05 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121901.uBCJ151g078580@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:01:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309922 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:01:06 -0000

Author: dteske
Date: Mon Dec 12 19:01:04 2016
New Revision: 309922
URL: https://svnweb.freebsd.org/changeset/base/309922

Log:
  Centralize backtitle string

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:56:40 2016	(r309921)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:01:04 2016	(r309922)
@@ -32,6 +32,7 @@
 BSDCFG_SHARE="/usr/share/bsdconfig"
 . $BSDCFG_SHARE/common.subr || exit 1
 f_include $BSDCFG_SHARE/dialog.subr
+f_dialog_backtitle "FreeBSD Installer"
 
 ############################################################ FUNCTIONS
 
@@ -59,7 +60,7 @@ country_set()
 			"$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 	fi
 	if [ "$error_str" ]; then
-		dialog --backtitle "FreeBSD Installer" --title "Error" \
+		dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" \
 			--yes-label Change --no-label Ignore --yesno \
 			"Error while applying chosen settings ($error_str)" 0 0
 		if [ $? -eq $DIALOG_OK ]; then
@@ -112,10 +113,10 @@ dialog_country_select()
 	fi
 
 	f_dialog_menu_size height width rows \"Regdomain selection\" \
-		\"FreeBSD Installer\" \"Select your regdomain.\" \
+		\"$DIALOG_BACKTITLE\" \"Select your regdomain.\" \
 		\"\" $regdomains
 	regdomain=$( sh -c "dialog \
-		--backtitle \"FreeBSD Installer\" \
+		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Regdomain selection\" \
 		--cancel-label \"Skip\" \
 		$def_item_regdomain \
@@ -126,10 +127,10 @@ dialog_country_select()
 	)
 
 	f_dialog_menu_size height width rows \"Country selection\" \
-	    \"FreeBSD Installer\" \"Select your country.\" \
+	    \"$DIALOG_BACKTITLE\" \"Select your country.\" \
 	    \"\" $countries
 	country=$( sh -c "dialog \
-		--backtitle \"FreeBSD Installer\" \
+		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Country selection\" \
 		--cancel-label \"Skip\" \
 		$def_item_country \
@@ -160,13 +161,13 @@ echo >> "$BSDINSTALL_TMPETC/wpa_supplica
 #
 (wpa_cli ping >/dev/null 2>/dev/null || ([ "$BSDINSTALL_CONFIGCURRENT" ] &&
 	wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) ||
-	(dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
+	(dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \
 	"Could not start wpa_supplicant!" 0 0; exit 1) || exit 1
 
 # See if we succeeded
 wpa_cli ping >/dev/null 2>/dev/null
 if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then
-	dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
+	dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \
 	"Wireless cannot be configured without making changes to the local system!" \ 0 0
 	exit 1
 fi
@@ -183,7 +184,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
-	dialog --backtitle "FreeBSD Installer" --title "Regdomain/country" \
+	dialog --backtitle "$DIALOG_BACKTITLE" --title "Regdomain/country" \
 	    --yesno "Change regdomain/country (now \
 	    $DEF_REGDOMAIN/$DEF_COUNTRY)?" 0 0
 	if [ $? -eq 0 ]; then
@@ -201,7 +202,7 @@ while :; do
 	SCANSSID=0
 	output=$( wpa_cli scan 2>&1 )
 	f_dprintf "%s" "$output"
-	dialog --backtitle "FreeBSD Installer" --title "Scanning" \
+	dialog --backtitle "$DIALOG_BACKTITLE" --title "Scanning" \
 	    --ok-label "Skip" \
 	    --pause "Waiting 5 seconds to scan for wireless networks..." \
 	    9 40 5 || exit 1
@@ -212,7 +213,7 @@ while :; do
 	   printf("\"%s\"\t%s\n", $5, $4);}' | sort | uniq )
 
 	if [ ! "$NETWORKS" ]; then
-		dialog --backtitle "FreeBSD Installer" --title "Error" \
+		dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" \
 		    --yesno "No wireless networks were found. Rescan?" 0 0 &&
 		    continue
 		exit 1
@@ -220,7 +221,7 @@ while :; do
 
 	exec 3>&1
 	NETWORK=$( sh -c "dialog --extra-button --extra-label \"Rescan\" \
-	    --backtitle \"FreeBSD Installer\" --title \"Network Selection\" \
+	    --backtitle \"$DIALOG_BACKTITLE\" --title \"Network Selection\" \
 	    --menu \"Select a wireless network to connect to.\" 0 0 0 \
 	    $(echo $NETWORKS | tr '\n' ' ')" 2>&1 1>&3 )
 	case $? in
@@ -250,7 +251,7 @@ done
 
 if echo $ENCRYPTION | grep -q 'PSK'; then
 	exec 3>&1
-	PASS=$( dialog --insecure --backtitle "FreeBSD Installer" \
+	PASS=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \
 	    --title "WPA Setup" --mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Password" 2 0 "" 2 12 15 63 1 \
@@ -265,7 +266,7 @@ echo "network={
 }" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 elif echo $ENCRYPTION | grep -q EAP; then
 	exec 3>&1
-	USERPASS=$( dialog --insecure --backtitle "FreeBSD Installer" \
+	USERPASS=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \
 	    --title "WPA-Enterprise Setup" --mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Username" 2 0 "" 2 12 25 63 0 \
@@ -289,7 +290,7 @@ echo "	priority=5
 }" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 elif echo $ENCRYPTION | grep -q WEP; then
 	exec 3>&1
-	WEPKEY=$( dialog --insecure --backtitle "FreeBSD Installer" \
+	WEPKEY=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \
 	    --title "WEP Setup" --mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"WEP Key 0" 2 0 "" 2 12 15 0 1 \

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:04:11 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06BE8C72E75;
 Mon, 12 Dec 2016 19:04:11 +0000 (UTC) (envelope-from devin@shxd.cx)
Received: from shxd.cx (mail.shxd.cx [64.201.244.140])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id ED90E15F0;
 Mon, 12 Dec 2016 19:04:10 +0000 (UTC) (envelope-from devin@shxd.cx)
Received: from [64.201.244.132] (port=60292 helo=[10.0.0.102])
 by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD))
 (envelope-from <devin@shxd.cx>)
 id 1cGVL6-000PBn-9i; Mon, 12 Dec 2016 18:28:40 +0000
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
Subject: Re: svn commit: r309921 - head/bin/dd
From: Devin Teske <dteske@freebsd.org>
In-Reply-To: <201612121856.uBCIuePK077524@repo.freebsd.org>
Date: Mon, 12 Dec 2016 11:04:09 -0800
Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org, Devin Teske <dteske@FreeBSD.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <D7B305BE-D0DE-4F76-B9AF-B03F2C33C928@freebsd.org>
References: <201612121856.uBCIuePK077524@repo.freebsd.org>
To: Bartek Rutkowski <robak@FreeBSD.org>
X-Mailer: Apple Mail (2.2104)
Sender: devin@shxd.cx
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:04:11 -0000

Yay!

=46rom someone whom has tried 2>&- >&- on a dd run to be surprised to =
find the status information go into the destination output file...

Thank you!


> On Dec 12, 2016, at 10:56 AM, Bartek Rutkowski <robak@FreeBSD.org> =
wrote:
>=20
> Author: robak (ports committer)
> Date: Mon Dec 12 18:56:40 2016
> New Revision: 309921
> URL: https://svnweb.freebsd.org/changeset/base/309921
>=20
> Log:
>  Fix regression when stdin/out/err fds are are overridden by shell.
>=20
>  Submitted by:	Pawel Biernacki <pawel.biernacki@gmail.com>
>  Reported by:	ngie
>  Approved by:	ngie
>  Sponsored by:	Mysterious Code Ltd.
>  Differential Revision:	https://reviews.freebsd.org/D8543
>=20
> Modified:
>  head/bin/dd/dd.c
>=20
> Modified: head/bin/dd/dd.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/bin/dd/dd.c	Mon Dec 12 18:55:41 2016	(r309920)
> +++ head/bin/dd/dd.c	Mon Dec 12 18:56:40 2016	(r309921)
> @@ -142,8 +142,6 @@ setup(void)
> 		in.fd =3D open(in.name, O_RDONLY, 0);
> 		if (in.fd =3D=3D -1)
> 			err(1, "%s", in.name);
> -		if (caph_limit_stdin() =3D=3D -1)
> -			err(1, "unable to limit capability rights");
> 	}
>=20
> 	getfdtype(&in);
> @@ -176,8 +174,6 @@ setup(void)
> 		}
> 		if (out.fd =3D=3D -1)
> 			err(1, "%s", out.name);
> -		if (caph_limit_stdout() =3D=3D -1)
> -			err(1, "unable to limit capability rights");
> 	}
>=20
> 	getfdtype(&out);
> @@ -188,6 +184,16 @@ setup(void)
> 	    errno !=3D ENOSYS)
> 		err(1, "unable to limit capability rights");
>=20
> +	if (in.fd !=3D STDIN_FILENO && out.fd !=3D STDIN_FILENO) {
> +		if (caph_limit_stdin() =3D=3D -1)
> +			err(1, "unable to limit capability rights");
> +	}
> +
> +	if (in.fd !=3D STDOUT_FILENO && out.fd !=3D STDOUT_FILENO) {
> +		if (caph_limit_stdout() =3D=3D -1)
> +			err(1, "unable to limit capability rights");
> +	}
> +
> 	if (in.fd !=3D STDERR_FILENO && out.fd !=3D STDERR_FILENO) {
> 		if (caph_limit_stderr() =3D=3D -1)
> 			err(1, "unable to limit capability rights");
>=20


From owner-svn-src-all@freebsd.org  Mon Dec 12 19:07:43 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0214C72FEA;
 Mon, 12 Dec 2016 19:07:43 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8F90718F0;
 Mon, 12 Dec 2016 19:07:43 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCJ7gjk081583;
 Mon, 12 Dec 2016 19:07:42 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJ7gwk081582;
 Mon, 12 Dec 2016 19:07:42 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121907.uBCJ7gwk081582@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:07:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309923 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:07:43 -0000

Author: dteske
Date: Mon Dec 12 19:07:42 2016
New Revision: 309923
URL: https://svnweb.freebsd.org/changeset/base/309923

Log:
  There is zero harm in always passing --default-item to dialog

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:01:04 2016	(r309922)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:07:42 2016	(r309923)
@@ -80,8 +80,9 @@ country_set()
 dialog_country_select()
 {
 	local input regdomains countries regdomain country
-	local def_item_regdomain=
-	local def_item_country=
+	local no_default="<not selected>"
+	local def_item_regdomain="${1:-$no_default}"
+	local def_item_country="${2:-$no_default}"
 
 	#
 	# Parse available countries/regdomains
@@ -104,14 +105,6 @@ dialog_country_select()
 		}
 	}' | sort -k 2 | tr '\n' ' ' )
 
-	# Change default cursor position (if required).
-	if [ "$1" != "<not selected>" ]; then
-		def_item_regdomain="--default-item $1"
-	fi
-	if [ "$2" != "<not selected>" ]; then
-		def_item_country="--default-item $2"
-	fi
-
 	f_dialog_menu_size height width rows \"Regdomain selection\" \
 		\"$DIALOG_BACKTITLE\" \"Select your regdomain.\" \
 		\"\" $regdomains
@@ -119,7 +112,7 @@ dialog_country_select()
 		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Regdomain selection\" \
 		--cancel-label \"Skip\" \
-		$def_item_regdomain \
+		--default-item \"$def_item_regdomain\" \
 		--no-items \
 		--stdout \
 		--menu \"Select your regdomain.\" \

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:09:18 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84F4BC730AE;
 Mon, 12 Dec 2016 19:09:18 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 548591A8D;
 Mon, 12 Dec 2016 19:09:18 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCJ9H83081690;
 Mon, 12 Dec 2016 19:09:17 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJ9H3A081689;
 Mon, 12 Dec 2016 19:09:17 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121909.uBCJ9H3A081689@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:09:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309924 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:09:18 -0000

Author: dteske
Date: Mon Dec 12 19:09:17 2016
New Revision: 309924
URL: https://svnweb.freebsd.org/changeset/base/309924

Log:
  Always pass --default-item parameter to dialog

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:07:42 2016	(r309923)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:09:17 2016	(r309924)
@@ -126,7 +126,7 @@ dialog_country_select()
 		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Country selection\" \
 		--cancel-label \"Skip\" \
-		$def_item_country \
+		--default-item \"$def_item_country\" \
 		--stdout \
 		--menu \"Select your country.\" \
 		$height $width $rows $countries"

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:10:15 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A515DC73147;
 Mon, 12 Dec 2016 19:10:15 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6DA8D1C43;
 Mon, 12 Dec 2016 19:10:15 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCJAEfY081795;
 Mon, 12 Dec 2016 19:10:14 GMT (envelope-from hrs@FreeBSD.org)
Received: (from hrs@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJAEdL081792;
 Mon, 12 Dec 2016 19:10:14 GMT (envelope-from hrs@FreeBSD.org)
Message-Id: <201612121910.uBCJAEdL081792@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org
 using -f
From: Hiroki Sato <hrs@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:10:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309925 - head/usr.sbin/syslogd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:10:15 -0000

Author: hrs
Date: Mon Dec 12 19:10:14 2016
New Revision: 309925
URL: https://svnweb.freebsd.org/changeset/base/309925

Log:
  - Refactor listening socket list.  All of the listening sockets are
    now maintained in a single linked-list in a transport-independent manner.
  - Use queue.h for linked-list structure.
  - Use linked-list for AllowedPeers.
  - Use getaddrinfo(8) even for Unix Domain sockets.
  - Use macros to type-casting from/to struct sockaddr{,_in,_in6}.
  - Define fu_* macro for union f_un to shorten the member names.
  - Remove an extra #include <sys/type.h>.
  - Add "static" to non-exported symbols.
  - !INET support is still incomplete but will be fixed later.
  
  There is no functional change except for some minor debug messages.

Modified:
  head/usr.sbin/syslogd/Makefile
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/Makefile
==============================================================================
--- head/usr.sbin/syslogd/Makefile	Mon Dec 12 19:09:17 2016	(r309924)
+++ head/usr.sbin/syslogd/Makefile	Mon Dec 12 19:10:14 2016	(r309925)
@@ -13,6 +13,9 @@ LIBADD=	util
 
 WARNS?= 3
 
+.if ${MK_INET_SUPPORT} != "no"
+CFLAGS+= -DINET
+.endif
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6
 .endif

Modified: head/usr.sbin/syslogd/syslogd.c
==============================================================================
--- head/usr.sbin/syslogd/syslogd.c	Mon Dec 12 19:09:17 2016	(r309924)
+++ head/usr.sbin/syslogd/syslogd.c	Mon Dec 12 19:10:14 2016	(r309925)
@@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/syslimits.h>
-#include <sys/types.h>
 
 #include <netinet/in.h>
 #include <netdb.h>
@@ -116,43 +115,60 @@ __FBSDID("$FreeBSD$");
 #define SYSLOG_NAMES
 #include <sys/syslog.h>
 
-const char	*ConfFile = _PATH_LOGCONF;
-const char	*PidFile = _PATH_LOGPID;
-const char	ctty[] = _PATH_CONSOLE;
-static const char	include_str[] = "include";
-static const char	include_ext[] = ".conf";
+static const char *ConfFile = _PATH_LOGCONF;
+static const char *PidFile = _PATH_LOGPID;
+static const char ctty[] = _PATH_CONSOLE;
+static const char include_str[] = "include";
+static const char include_ext[] = ".conf";
 
 #define	dprintf		if (Debug) printf
 
 #define	MAXUNAMES	20	/* maximum number of user names */
 
+#define	sstosa(ss)	((struct sockaddr *)(ss))
+#ifdef INET
+#define	satosin(sa)	((struct sockaddr_in *)(void *)(sa))
+#endif
+#ifdef INET6
+#define	satosin6(sa)	((struct sockaddr_in6 *)(void *)(sa))
+#define	s6_addr32	__u6_addr.__u6_addr32
+#define	IN6_ARE_MASKED_ADDR_EQUAL(d, a, m)	(	\
+	(((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \
+	(((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \
+	(((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \
+	(((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 )
+#endif
 /*
- * List of hosts for binding.
+ * List of peers and sockets for binding.
  */
-static STAILQ_HEAD(, host) hqueue;
-struct host {
-	char			*name;
-	STAILQ_ENTRY(host)	next;
+struct peer {
+	const char	*pe_name;
+	const char	*pe_serv;
+	mode_t		pe_mode;
+	STAILQ_ENTRY(peer)	next;
 };
-
-/*
- * Unix sockets.
- * We have two default sockets, one with 666 permissions,
- * and one for privileged programs.
- */
-struct funix {
-	int			s;
-	const char		*name;
-	mode_t			mode;
-	STAILQ_ENTRY(funix)	next;
+struct socklist {
+	struct sockaddr_storage	sl_ss;
+	int			sl_socket;
+	struct peer		*sl_peer;
+	STAILQ_ENTRY(socklist)	next;
 };
-struct funix funix_secure =	{ -1, _PATH_LOG_PRIV, S_IRUSR | S_IWUSR,
-				{ NULL } };
-struct funix funix_default =	{ -1, _PATH_LOG, DEFFILEMODE,
-				{ &funix_secure } };
+static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INITIALIZER(shead);
 
-STAILQ_HEAD(, funix) funixes =	{ &funix_default,
-				&(funix_secure.next.stqe_next) };
+static struct peer funix_secure = {
+	.pe_name = _PATH_LOG_PRIV,
+	.pe_mode = S_IRUSR | S_IWUSR,
+	.next = {NULL},
+};
+static struct peer funix_default = {
+	.pe_name = _PATH_LOG,
+	.pe_mode = DEFFILEMODE,
+	.next = {&funix_secure},
+};
+static STAILQ_HEAD(, peer) pqueue = {
+	&funix_default,
+	&funix_secure.next.stqe_next,
+};
 
 /*
  * Flags to logmsg().
@@ -172,7 +188,7 @@ STAILQ_HEAD(, funix) funixes =	{ &funix_
  */
 
 struct filed {
-	struct	filed *f_next;		/* next in linked list */
+	STAILQ_ENTRY(filed)	next;	/* next in linked list */
 	short	f_type;			/* entry type, see below */
 	short	f_file;			/* file descriptor */
 	time_t	f_time;			/* time this was last written */
@@ -196,6 +212,12 @@ struct filed {
 			pid_t	f_pid;
 		} f_pipe;
 	} f_un;
+#define	fu_uname	f_un.f_uname
+#define	fu_forw_hname	f_un.f_forw.f_hname
+#define	fu_forw_addr	f_un.f_forw.f_addr
+#define	fu_fname	f_un.f_fname
+#define	fu_pipe_pname	f_un.f_pipe.f_pname
+#define	fu_pipe_pid	f_un.f_pipe.f_pid
 	char	f_prevline[MAXSVLINE];		/* last message logged */
 	char	f_lasttime[16];			/* time of last occurrence */
 	char	f_prevhost[MAXHOSTNAMELEN];	/* host from which recd. */
@@ -211,15 +233,12 @@ struct filed {
 /*
  * Queue of about-to-be dead processes we should watch out for.
  */
-
-TAILQ_HEAD(stailhead, deadq_entry) deadq_head;
-struct stailhead *deadq_headp;
-
 struct deadq_entry {
 	pid_t				dq_pid;
 	int				dq_timeout;
 	TAILQ_ENTRY(deadq_entry)	dq_entries;
 };
+static TAILQ_HEAD(, deadq_entry) deadq_head;
 
 /*
  * The timeout to apply to processes waiting on the dead queue.  Unit
@@ -249,7 +268,9 @@ struct allowedpeer {
 #define a_addr u.numeric.addr
 #define a_mask u.numeric.mask
 #define a_name u.name
+	STAILQ_ENTRY(allowedpeer)	next;
 };
+static STAILQ_HEAD(, allowedpeer) aphead = STAILQ_HEAD_INITIALIZER(aphead);
 
 
 /*
@@ -257,7 +278,7 @@ struct allowedpeer {
  * in seconds after previous message is logged.  After each flush,
  * we move to the next interval until we reach the largest.
  */
-int	repeatinterval[] = { 30, 120, 600 };	/* # of secs before flush */
+static int repeatinterval[] = { 30, 120, 600 };	/* # of secs before flush */
 #define	MAXREPEAT ((sizeof(repeatinterval) / sizeof(repeatinterval[0])) - 1)
 #define	REPEATTIME(f)	((f)->f_time + repeatinterval[(f)->f_repeatcount])
 #define	BACKOFF(f)	{ if (++(f)->f_repeatcount > MAXREPEAT) \
@@ -274,12 +295,13 @@ int	repeatinterval[] = { 30, 120, 600 };
 #define F_WALL		6		/* everyone logged on */
 #define F_PIPE		7		/* pipe to program */
 
-const char *TypeNames[8] = {
+static const char *TypeNames[8] = {
 	"UNUSED",	"FILE",		"TTY",		"CONSOLE",
 	"FORW",		"USERS",	"WALL",		"PIPE"
 };
 
-static struct filed *Files;	/* Log files that we write to */
+static STAILQ_HEAD(, filed) fhead =
+    STAILQ_HEAD_INITIALIZER(fhead);	/* Log files that we write to */
 static struct filed consfile;	/* Console */
 
 static int	Debug;		/* debug flag */
@@ -287,7 +309,6 @@ static int	Foreground = 0;	/* Run in for
 static int	resolve = 1;	/* resolve hostname */
 static char	LocalHostName[MAXHOSTNAMELEN];	/* our hostname */
 static const char *LocalDomain;	/* our local domain name */
-static int	*finet;		/* Internet datagram sockets */
 static int	fklog = -1;	/* /dev/klog */
 static int	Initialized;	/* set when we have initialized ourselves */
 static int	MarkInterval = 20 * 60;	/* interval between marks in seconds */
@@ -307,8 +328,6 @@ static int	logflags = O_WRONLY|O_APPEND;
 
 static char	bootfile[MAXLINE+1]; /* booted kernel file */
 
-struct allowedpeer *AllowedPeers; /* List of allowed peers */
-static int	NumAllowed;	/* Number of entries in AllowedPeers */
 static int	RemoteAddDate;	/* Always set the date on remote messages */
 
 static int	UniquePriority;	/* Only log specified priority? */
@@ -318,7 +337,7 @@ static int	KeepKernFac;	/* Keep remotely
 static int	needdofsync = 0; /* Are any file(s) waiting to be fsynced? */
 static struct pidfh *pfh;
 
-volatile sig_atomic_t MarkSet, WantDie;
+static volatile sig_atomic_t MarkSet, WantDie;
 
 static int	allowaddr(char *);
 static void	cfline(const char *, struct filed *,
@@ -332,7 +351,7 @@ static void	dodie(int);
 static void	dofsync(void);
 static void	domark(int);
 static void	fprintlog(struct filed *, int, const char *);
-static int	*socksetup(int, char *);
+static int	socksetup(struct peer *);
 static void	init(int);
 static void	logerror(const char *);
 static void	logmsg(int, const char *, const char *, int);
@@ -368,31 +387,30 @@ close_filed(struct filed *f)
 int
 main(int argc, char *argv[])
 {
-	int ch, i, fdsrmax = 0, l;
-	struct sockaddr_un sunx, fromunix;
-	struct sockaddr_storage frominet;
+	int ch, i, fdsrmax = 0;
+	struct sockaddr_storage ss;
 	fd_set *fdsr = NULL;
 	char line[MAXLINE + 1];
 	const char *hname;
 	struct timeval tv, *tvp;
 	struct sigaction sact;
-	struct host *host;
-	struct funix *fx, *fx1;
+	struct peer *pe;
+	struct socklist *sl;
 	sigset_t mask;
 	pid_t ppid = 1, spid;
-	socklen_t len;
+	socklen_t sslen;
 
 	if (madvise(NULL, 0, MADV_PROTECT) != 0)
 		dprintf("madvise() failed: %s\n", strerror(errno));
 
-	STAILQ_INIT(&hqueue);
-
 	while ((ch = getopt(argc, argv, "468Aa:b:cCdf:Fkl:m:nNop:P:sS:Tuv"))
 	    != -1)
 		switch (ch) {
+#ifdef INET
 		case '4':
 			family = PF_INET;
 			break;
+#endif
 #ifdef INET6
 		case '6':
 			family = PF_INET6;
@@ -409,13 +427,12 @@ main(int argc, char *argv[])
 				usage();
 			break;
 		case 'b':
-		   {
-			if ((host = malloc(sizeof(struct host))) == NULL)
+			if ((pe = calloc(1, sizeof(*pe))) == NULL)
 				err(1, "malloc failed");
-			host->name = optarg;
-			STAILQ_INSERT_TAIL(&hqueue, host, next);
+			pe->pe_name = optarg;
+			pe->pe_serv = NULL;
+			STAILQ_INSERT_TAIL(&pqueue, pe, next);
 			break;
-		   }
 		case 'c':
 			no_compress++;
 			break;
@@ -458,17 +475,12 @@ main(int argc, char *argv[])
 				} else
 					errx(1, "invalid mode %s, exiting",
 					    optarg);
-			} else	/* doesn't begin with '/', and no ':' */
-				errx(1, "can't parse path %s", optarg);
-
-			if (strlen(name) >= sizeof(sunx.sun_path))
-				errx(1, "%s path too long, exiting", name);
-			if ((fx = malloc(sizeof(struct funix))) == NULL)
+			}
+			if ((pe = calloc(1, sizeof(*pe))) == NULL)
 				err(1, "malloc failed");
-			fx->s = -1;
-			fx->name = name;
-			fx->mode = mode;
-			STAILQ_INSERT_TAIL(&funixes, fx, next);
+			pe->pe_name = name;
+			pe->pe_mode = mode;
+			STAILQ_INSERT_TAIL(&pqueue, pe, next);
 			break;
 		   }
 		case 'm':		/* mark interval */
@@ -485,9 +497,7 @@ main(int argc, char *argv[])
 			use_bootfile = 1;
 			break;
 		case 'p':		/* path */
-			if (strlen(optarg) >= sizeof(sunx.sun_path))
-				errx(1, "%s path too long, exiting", optarg);
-			funix_default.name = optarg;
+			funix_default.pe_name = optarg;
 			break;
 		case 'P':		/* path for alt. PID */
 			PidFile = optarg;
@@ -496,9 +506,7 @@ main(int argc, char *argv[])
 			SecureMode++;
 			break;
 		case 'S':		/* path for privileged originator */
-			if (strlen(optarg) >= sizeof(sunx.sun_path))
-				errx(1, "%s path too long, exiting", optarg);
-			funix_secure.name = optarg;
+			funix_secure.pe_name = optarg;
 			break;
 		case 'T':
 			RemoteAddDate = 1;
@@ -514,6 +522,8 @@ main(int argc, char *argv[])
 		}
 	if ((argc -= optind) != 0)
 		usage();
+	STAILQ_FOREACH(pe, &pqueue, next)
+		socksetup(pe);
 
 	pfh = pidfile_open(PidFile, 0600, &spid);
 	if (pfh == NULL) {
@@ -529,16 +539,12 @@ main(int argc, char *argv[])
 			pidfile_remove(pfh);
 			exit(1);
 		}
-	} else if (Debug) {
+	} else if (Debug)
 		setlinebuf(stdout);
-	}
-
-	if (NumAllowed)
-		endservent();
 
 	consfile.f_type = F_CONSOLE;
-	(void)strlcpy(consfile.f_un.f_fname, ctty + sizeof _PATH_DEV - 1,
-	    sizeof(consfile.f_un.f_fname));
+	(void)strlcpy(consfile.fu_fname, ctty + sizeof _PATH_DEV - 1,
+	    sizeof(consfile.fu_fname));
 	(void)strlcpy(bootfile, getbootfile(), sizeof(bootfile));
 	(void)signal(SIGTERM, dodie);
 	(void)signal(SIGINT, Debug ? dodie : SIG_IGN);
@@ -561,69 +567,6 @@ main(int argc, char *argv[])
 
 	TAILQ_INIT(&deadq_head);
 
-#ifndef SUN_LEN
-#define SUN_LEN(unp) (strlen((unp)->sun_path) + 2)
-#endif
-	STAILQ_FOREACH_SAFE(fx, &funixes, next, fx1) {
-		(void)unlink(fx->name);
-		memset(&sunx, 0, sizeof(sunx));
-		sunx.sun_family = AF_LOCAL;
-		(void)strlcpy(sunx.sun_path, fx->name, sizeof(sunx.sun_path));
-		fx->s = socket(PF_LOCAL, SOCK_DGRAM, 0);
-		if (fx->s < 0 ||
-		    bind(fx->s, (struct sockaddr *)&sunx, SUN_LEN(&sunx)) < 0 ||
-		    chmod(fx->name, fx->mode) < 0) {
-			(void)snprintf(line, sizeof line,
-					"cannot create %s", fx->name);
-			logerror(line);
-			dprintf("cannot create %s (%d)\n", fx->name, errno);
-			if (fx == &funix_default || fx == &funix_secure)
-				die(0);
-			else {
-				STAILQ_REMOVE(&funixes, fx, funix, next);
-				continue;
-			}
-		}
-		increase_rcvbuf(fx->s);
-	}
-	if (SecureMode <= 1) {
-		if (STAILQ_EMPTY(&hqueue))
-			finet = socksetup(family, NULL);
-		STAILQ_FOREACH(host, &hqueue, next) {
-			int *finet0, total;
-			finet0 = socksetup(family, host->name);
-			if (finet0 && !finet) {
-				finet = finet0;
-			} else if (finet0 && finet) {
-				total = *finet0 + *finet + 1;
-				finet = realloc(finet, total * sizeof(int));
-				if (finet == NULL)
-					err(1, "realloc failed");
-				for (i = 1; i <= *finet0; i++) {
-					finet[(*finet)+i] = finet0[i];
-				}
-				*finet = total - 1;
-				free(finet0);
-			}
-		}
-	}
-
-	if (finet) {
-		if (SecureMode) {
-			for (i = 0; i < *finet; i++) {
-				if (shutdown(finet[i+1], SHUT_RD) < 0 &&
-				    errno != ENOTCONN) {
-					logerror("shutdown");
-					if (!Debug)
-						die(0);
-				}
-			}
-		} else {
-			dprintf("listening on inet and/or inet6 socket\n");
-		}
-		dprintf("sending on inet and/or inet6 socket\n");
-	}
-
 	if ((fklog = open(_PATH_KLOG, O_RDONLY|O_NONBLOCK, 0)) < 0)
 		dprintf("can't open %s (%d)\n", _PATH_KLOG, errno);
 
@@ -646,15 +589,10 @@ main(int argc, char *argv[])
 
 	if (fklog != -1 && fklog > fdsrmax)
 		fdsrmax = fklog;
-	if (finet && !SecureMode) {
-		for (i = 0; i < *finet; i++) {
-		    if (finet[i+1] != -1 && finet[i+1] > fdsrmax)
-			fdsrmax = finet[i+1];
-		}
+	STAILQ_FOREACH(sl, &shead, next) {
+		if (sl->sl_socket > fdsrmax)
+			fdsrmax = sl->sl_socket;
 	}
-	STAILQ_FOREACH(fx, &funixes, next)
-		if (fx->s > fdsrmax)
-			fdsrmax = fx->s;
 
 	fdsr = (fd_set *)calloc(howmany(fdsrmax+1, NFDBITS),
 	    sizeof(fd_mask));
@@ -672,16 +610,11 @@ main(int argc, char *argv[])
 
 		if (fklog != -1)
 			FD_SET(fklog, fdsr);
-		if (finet && !SecureMode) {
-			for (i = 0; i < *finet; i++) {
-				if (finet[i+1] != -1)
-					FD_SET(finet[i+1], fdsr);
-			}
+		STAILQ_FOREACH(sl, &shead, next) {
+			if (sl->sl_socket != -1)
+				FD_SET(sl->sl_socket, fdsr);
 		}
-		STAILQ_FOREACH(fx, &funixes, next)
-			FD_SET(fx->s, fdsr);
-
-		i = select(fdsrmax+1, fdsr, NULL, NULL,
+		i = select(fdsrmax + 1, fdsr, NULL, NULL,
 		    needdofsync ? &tv : tvp);
 		switch (i) {
 		case 0:
@@ -700,34 +633,40 @@ main(int argc, char *argv[])
 		}
 		if (fklog != -1 && FD_ISSET(fklog, fdsr))
 			readklog();
-		if (finet && !SecureMode) {
-			for (i = 0; i < *finet; i++) {
-				if (FD_ISSET(finet[i+1], fdsr)) {
-					len = sizeof(frominet);
-					l = recvfrom(finet[i+1], line, MAXLINE,
-					     0, (struct sockaddr *)&frominet,
-					     &len);
-					if (l > 0) {
-						line[l] = '\0';
-						hname = cvthname((struct sockaddr *)&frominet);
-						unmapped((struct sockaddr *)&frominet);
-						if (validate((struct sockaddr *)&frominet, hname))
-							printline(hname, line, RemoteAddDate ? ADDDATE : 0);
-					} else if (l < 0 && errno != EINTR)
-						logerror("recvfrom inet");
+		STAILQ_FOREACH(sl, &shead, next) {
+			int date, len;
+
+			if (FD_ISSET(sl->sl_socket, fdsr)) {
+				sslen = sizeof(ss);
+				dprintf("sslen(1) = %d\n", sslen);
+				len = recvfrom(sl->sl_socket, line,
+				    sizeof(line) - 1, 0,
+				    sstosa(&ss), &sslen);
+				dprintf("sslen(2) = %d\n", sslen);
+				if (len == 0)
+					continue;
+				if (len < 0) {
+					if (errno != EINTR)
+						logerror("recvfrom");
+					continue;
 				}
-			}
-		}
-		STAILQ_FOREACH(fx, &funixes, next) {
-			if (FD_ISSET(fx->s, fdsr)) {
-				len = sizeof(fromunix);
-				l = recvfrom(fx->s, line, MAXLINE, 0,
-				    (struct sockaddr *)&fromunix, &len);
-				if (l > 0) {
-					line[l] = '\0';
-					printline(LocalHostName, line, 0);
-				} else if (l < 0 && errno != EINTR)
-					logerror("recvfrom unix");
+				/* Received valid data. */
+				line[len] = '\0';
+				if (sl->sl_ss.ss_family == AF_LOCAL) {
+					hname = LocalHostName;
+					date = 0;
+				} else {
+					hname = cvthname(sstosa(&ss));
+					unmapped(sstosa(&ss));
+					if (validate(sstosa(&ss), hname) == 0)
+						hname = NULL;
+					date = RemoteAddDate ? ADDDATE : 0;
+				}
+				if (hname != NULL)
+					printline(hname, line, date);
+				else
+					dprintf("Invalid msg from "
+					    "%s was ignored.", hname);
 			}
 		}
 	}
@@ -735,30 +674,36 @@ main(int argc, char *argv[])
 		free(fdsr);
 }
 
+#ifdef INET6
 static void
 unmapped(struct sockaddr *sa)
 {
 	struct sockaddr_in6 *sin6;
 	struct sockaddr_in sin4;
 
-	if (sa->sa_family != AF_INET6)
+	if (sa == NULL ||
+	    sa->sa_family != AF_INET6 ||
+	    sa->sa_len != sizeof(*sin6))
 		return;
-	if (sa->sa_len != sizeof(struct sockaddr_in6) ||
-	    sizeof(sin4) > sa->sa_len)
-		return;
-	sin6 = (struct sockaddr_in6 *)sa;
+	sin6 = satosin6(sa);
 	if (!IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr))
 		return;
 
 	memset(&sin4, 0, sizeof(sin4));
 	sin4.sin_family = AF_INET;
-	sin4.sin_len = sizeof(struct sockaddr_in);
+	sin4.sin_len = sizeof(sin4);
 	memcpy(&sin4.sin_addr, &sin6->sin6_addr.s6_addr[12],
 	       sizeof(sin4.sin_addr));
 	sin4.sin_port = sin6->sin6_port;
 
 	memcpy(sa, &sin4, sin4.sin_len);
 }
+#else
+static void
+unmapped(struct sockaddr *sa __unused)
+{
+}
+#endif
 
 static void
 usage(void)
@@ -1043,7 +988,7 @@ logmsg(int pri, const char *msg, const c
 		(void)sigsetmask(omask);
 		return;
 	}
-	for (f = Files; f; f = f->f_next) {
+	STAILQ_FOREACH(f, &fhead, next) {
 		/* skip messages that are incorrect priority */
 		if (!(((f->f_pcmp[fac] & PRI_EQ) && (f->f_pmask[fac] == prilev))
 		     ||((f->f_pcmp[fac] & PRI_LT) && (f->f_pmask[fac] < prilev))
@@ -1120,7 +1065,7 @@ dofsync(void)
 {
 	struct filed *f;
 
-	for (f = Files; f; f = f->f_next) {
+	STAILQ_FOREACH(f, &fhead, next) {
 		if ((f->f_type == F_FILE) &&
 		    (f->f_flags & FFLAG_NEEDSYNC)) {
 			f->f_flags &= ~FFLAG_NEEDSYNC;
@@ -1136,7 +1081,7 @@ fprintlog(struct filed *f, int flags, co
 	struct iovec iov[IOV_SIZE];
 	struct iovec *v;
 	struct addrinfo *r;
-	int i, l, lsent = 0;
+	int l, lsent = 0;
 	char line[MAXLINE + 1], repbuf[80], greetings[200], *wmsg = NULL;
 	char nul[] = "", space[] = " ", lf[] = "\n", crlf[] = "\r\n";
 	const char *msgret;
@@ -1244,12 +1189,11 @@ fprintlog(struct filed *f, int flags, co
 		break;
 
 	case F_FORW:
-		port = (int)ntohs(((struct sockaddr_in *)
-			    (f->f_un.f_forw.f_addr->ai_addr))->sin_port);
+		port = ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port);
 		if (port != 514) {
-			dprintf(" %s:%d\n", f->f_un.f_forw.f_hname, port);
+			dprintf(" %s:%d\n", f->fu_forw_hname, port);
 		} else {
-			dprintf(" %s\n", f->f_un.f_forw.f_hname);
+			dprintf(" %s\n", f->fu_forw_hname);
 		}
 		/* check for local vs remote messages */
 		if (strcasecmp(f->f_prevhost, LocalHostName))
@@ -1266,57 +1210,51 @@ fprintlog(struct filed *f, int flags, co
 		else if (l > MAXLINE)
 			l = MAXLINE;
 
-		if (finet) {
-			for (r = f->f_un.f_forw.f_addr; r; r = r->ai_next) {
-				for (i = 0; i < *finet; i++) {
-#if 0
-					/*
-					 * should we check AF first, or just
-					 * trial and error? FWD
-					 */
-					if (r->ai_family ==
-					    address_family_of(finet[i+1]))
-#endif
-					lsent = sendto(finet[i+1], line, l, 0,
-					    r->ai_addr, r->ai_addrlen);
-					if (lsent == l)
-						break;
-				}
-				if (lsent == l && !send_to_all)
+		for (r = f->fu_forw_addr; r; r = r->ai_next) {
+			struct socklist *sl;
+
+			STAILQ_FOREACH(sl, &shead, next) {
+				if (sl->sl_ss.ss_family == AF_LOCAL)
+					continue;
+				lsent = sendto(sl->sl_socket, line, l, 0,
+				    r->ai_addr, r->ai_addrlen);
+				if (lsent == l)
 					break;
 			}
-			dprintf("lsent/l: %d/%d\n", lsent, l);
-			if (lsent != l) {
-				int e = errno;
-				logerror("sendto");
-				errno = e;
-				switch (errno) {
-				case ENOBUFS:
-				case ENETDOWN:
-				case ENETUNREACH:
-				case EHOSTUNREACH:
-				case EHOSTDOWN:
-				case EADDRNOTAVAIL:
-					break;
-				/* case EBADF: */
-				/* case EACCES: */
-				/* case ENOTSOCK: */
-				/* case EFAULT: */
-				/* case EMSGSIZE: */
-				/* case EAGAIN: */
-				/* case ENOBUFS: */
-				/* case ECONNREFUSED: */
-				default:
-					dprintf("removing entry: errno=%d\n", e);
-					f->f_type = F_UNUSED;
-					break;
-				}
+			if (lsent == l && !send_to_all)
+				break;
+		}
+		dprintf("lsent/l: %d/%d\n", lsent, l);
+		if (lsent != l) {
+			int e = errno;
+			logerror("sendto");
+			errno = e;
+			switch (errno) {
+			case ENOBUFS:
+			case ENETDOWN:
+			case ENETUNREACH:
+			case EHOSTUNREACH:
+			case EHOSTDOWN:
+			case EADDRNOTAVAIL:
+				break;
+			/* case EBADF: */
+			/* case EACCES: */
+			/* case ENOTSOCK: */
+			/* case EFAULT: */
+			/* case EMSGSIZE: */
+			/* case EAGAIN: */
+			/* case ENOBUFS: */
+			/* case ECONNREFUSED: */
+			default:
+				dprintf("removing entry: errno=%d\n", e);
+				f->f_type = F_UNUSED;
+				break;
 			}
 		}
 		break;
 
 	case F_FILE:
-		dprintf(" %s\n", f->f_un.f_fname);
+		dprintf(" %s\n", f->fu_fname);
 		v->iov_base = lf;
 		v->iov_len = 1;
 		if (writev(f->f_file, iov, IOV_SIZE) < 0) {
@@ -1329,7 +1267,7 @@ fprintlog(struct filed *f, int flags, co
 				int e = errno;
 				close_filed(f);
 				errno = e;
-				logerror(f->f_un.f_fname);
+				logerror(f->fu_fname);
 			}
 		} else if ((flags & SYNC_FILE) && (f->f_flags & FFLAG_SYNC)) {
 			f->f_flags |= FFLAG_NEEDSYNC;
@@ -1338,26 +1276,26 @@ fprintlog(struct filed *f, int flags, co
 		break;
 
 	case F_PIPE:
-		dprintf(" %s\n", f->f_un.f_pipe.f_pname);
+		dprintf(" %s\n", f->fu_pipe_pname);
 		v->iov_base = lf;
 		v->iov_len = 1;
-		if (f->f_un.f_pipe.f_pid == 0) {
-			if ((f->f_file = p_open(f->f_un.f_pipe.f_pname,
-						&f->f_un.f_pipe.f_pid)) < 0) {
+		if (f->fu_pipe_pid == 0) {
+			if ((f->f_file = p_open(f->fu_pipe_pname,
+						&f->fu_pipe_pid)) < 0) {
 				f->f_type = F_UNUSED;
-				logerror(f->f_un.f_pipe.f_pname);
+				logerror(f->fu_pipe_pname);
 				break;
 			}
 		}
 		if (writev(f->f_file, iov, IOV_SIZE) < 0) {
 			int e = errno;
 			close_filed(f);
-			if (f->f_un.f_pipe.f_pid > 0)
-				deadq_enter(f->f_un.f_pipe.f_pid,
-					    f->f_un.f_pipe.f_pname);
-			f->f_un.f_pipe.f_pid = 0;
+			if (f->fu_pipe_pid > 0)
+				deadq_enter(f->fu_pipe_pid,
+					    f->fu_pipe_pname);
+			f->fu_pipe_pid = 0;
 			errno = e;
-			logerror(f->f_un.f_pipe.f_pname);
+			logerror(f->fu_pipe_pname);
 		}
 		break;
 
@@ -1369,12 +1307,12 @@ fprintlog(struct filed *f, int flags, co
 		/* FALLTHROUGH */
 
 	case F_TTY:
-		dprintf(" %s%s\n", _PATH_DEV, f->f_un.f_fname);
+		dprintf(" %s%s\n", _PATH_DEV, f->fu_fname);
 		v->iov_base = crlf;
 		v->iov_len = 2;
 
 		errno = 0;	/* ttymsg() only sometimes returns an errno */
-		if ((msgret = ttymsg(iov, IOV_SIZE, f->f_un.f_fname, 10))) {
+		if ((msgret = ttymsg(iov, IOV_SIZE, f->fu_fname, 10))) {
 			f->f_type = F_UNUSED;
 			logerror(msgret);
 		}
@@ -1423,9 +1361,9 @@ wallmsg(struct filed *f, struct iovec *i
 		}
 		/* should we send the message to this user? */
 		for (i = 0; i < MAXUNAMES; i++) {
-			if (!f->f_un.f_uname[i][0])
+			if (!f->fu_uname[i][0])
 				break;
-			if (!strcmp(f->f_un.f_uname[i], ut->ut_user)) {
+			if (!strcmp(f->fu_uname[i], ut->ut_user)) {
 				if ((p = ttymsg_check(iov, iovlen, ut->ut_line,
 				    TTYMSGTIME)) != NULL) {
 					errno = 0;	/* already in msg */
@@ -1476,20 +1414,18 @@ reapchild(int signo __unused)
 
 		/* First, look if it's a process from the dead queue. */
 		if (deadq_remove(pid))
-			goto oncemore;
+			continue;
 
 		/* Now, look in list of active processes. */
-		for (f = Files; f; f = f->f_next)
+		STAILQ_FOREACH(f, &fhead, next) {
 			if (f->f_type == F_PIPE &&
-			    f->f_un.f_pipe.f_pid == pid) {
+			    f->fu_pipe_pid == pid) {
 				close_filed(f);
-				f->f_un.f_pipe.f_pid = 0;
-				log_deadchild(pid, status,
-					      f->f_un.f_pipe.f_pname);
+				f->fu_pipe_pid = 0;
+				log_deadchild(pid, status, f->fu_pipe_pname);
 				break;
 			}
-	  oncemore:
-		continue;
+		}
 	}
 }
 
@@ -1503,9 +1439,9 @@ cvthname(struct sockaddr *f)
 	sigset_t omask, nmask;
 	static char hname[NI_MAXHOST], ip[NI_MAXHOST];
 
-	error = getnameinfo((struct sockaddr *)f,
-			    ((struct sockaddr *)f)->sa_len,
-			    ip, sizeof ip, NULL, 0, NI_NUMERICHOST);
+	dprintf("cvthname(%d) len = %d, %zu\n", f->sa_family, f->sa_len, sizeof(struct sockaddr_in6));
+	error = getnameinfo(f, f->sa_len, ip, sizeof(ip), NULL, 0,
+		    NI_NUMERICHOST);
 	dprintf("cvthname(%s)\n", ip);
 
 	if (error) {
@@ -1575,19 +1511,19 @@ static void
 die(int signo)
 {
 	struct filed *f;
-	struct funix *fx;
+	struct socklist *sl;
 	int was_initialized;
 	char buf[100];
 
 	was_initialized = Initialized;
 	Initialized = 0;	/* Don't log SIGCHLDs. */
-	for (f = Files; f != NULL; f = f->f_next) {
+	STAILQ_FOREACH(f, &fhead, next) {
 		/* flush any pending output */
 		if (f->f_prevcount)
 			fprintlog(f, 0, (char *)NULL);
-		if (f->f_type == F_PIPE && f->f_un.f_pipe.f_pid > 0) {
+		if (f->f_type == F_PIPE && f->fu_pipe_pid > 0) {
 			close_filed(f);
-			f->f_un.f_pipe.f_pid = 0;
+			f->fu_pipe_pid = 0;
 		}
 	}
 	Initialized = was_initialized;
@@ -1597,8 +1533,10 @@ die(int signo)
 		errno = 0;
 		logerror(buf);
 	}
-	STAILQ_FOREACH(fx, &funixes, next)
-		(void)unlink(fx->name);
+	STAILQ_FOREACH(sl, &shead, next) {
+		if (sl->sl_ss.ss_family == AF_LOCAL)
+			unlink(sl->sl_peer->pe_name);
+	}
 	pidfile_remove(pfh);
 
 	exit(1);
@@ -1626,7 +1564,7 @@ configfiles(const struct dirent *dp)
 }
 
 static void
-readconfigfile(FILE *cf, struct filed **nextp, int allow_includes)
+readconfigfile(FILE *cf, int allow_includes)
 {
 	FILE *cf2;
 	struct filed *f;
@@ -1686,7 +1624,7 @@ readconfigfile(FILE *cf, struct filed **
 				if (cf2 == NULL)
 					continue;
 				dprintf("reading %s\n", file);
-				readconfigfile(cf2, nextp, 0);
+				readconfigfile(cf2, 0);
 				fclose(cf2);
 			}
 			free(ent);
@@ -1749,8 +1687,7 @@ readconfigfile(FILE *cf, struct filed **
 			logerror("calloc");
 			exit(1);
 		}
-		*nextp = f;
-		nextp = &f->f_next;
+		STAILQ_INSERT_TAIL(&fhead, f, next);
 		cfline(cline, f, prog, host);
 	}
 }
@@ -1763,7 +1700,7 @@ init(int signo)
 {
 	int i;
 	FILE *cf;
-	struct filed *f, *next, **nextp;
+	struct filed *f;
 	char *p;
 	char oldLocalHostName[MAXHOSTNAMELEN];
 	char hostMsg[2*MAXHOSTNAMELEN+40];
@@ -1808,7 +1745,7 @@ init(int signo)
 	 *  Close all open log files.
 	 */
 	Initialized = 0;
-	for (f = Files; f != NULL; f = next) {
+	STAILQ_FOREACH(f, &fhead, next) {
 		/* flush any pending output */
 		if (f->f_prevcount)
 			fprintlog(f, 0, (char *)NULL);
@@ -1821,42 +1758,48 @@ init(int signo)
 			close_filed(f);
 			break;
 		case F_PIPE:
-			if (f->f_un.f_pipe.f_pid > 0) {
+			if (f->fu_pipe_pid > 0) {
 				close_filed(f);
-				deadq_enter(f->f_un.f_pipe.f_pid,
-					    f->f_un.f_pipe.f_pname);
+				deadq_enter(f->fu_pipe_pid,
+					    f->fu_pipe_pname);
 			}
-			f->f_un.f_pipe.f_pid = 0;
+			f->fu_pipe_pid = 0;
 			break;
 		}
-		next = f->f_next;
-		if (f->f_program) free(f->f_program);
-		if (f->f_host) free(f->f_host);
-		free((char *)f);
 	}
-	Files = NULL;
+	while(!STAILQ_EMPTY(&fhead)) {
+		f = STAILQ_FIRST(&fhead);
+		STAILQ_REMOVE_HEAD(&fhead, next);
+		free(f->f_program);
+		free(f->f_host);
+		free(f);
+	}
 	nextp = &Files;
 
 	/* open the configuration file */
 	if ((cf = fopen(ConfFile, "r")) == NULL) {
 		dprintf("cannot open %s\n", ConfFile);
-		*nextp = (struct filed *)calloc(1, sizeof(*f));
-		if (*nextp == NULL) {
+		f = calloc(1, sizeof(*f));
+		if (f == NULL) {
 			logerror("calloc");
 			exit(1);
 		}
-		cfline("*.ERR\t/dev/console", *nextp, "*", "*");
-		(*nextp)->f_next = (struct filed *)calloc(1, sizeof(*f));
-		if ((*nextp)->f_next == NULL) {
+		cfline("*.ERR\t/dev/console", f, "*", "*");
+		STAILQ_INSERT_TAIL(&fhead, f, next);
+
+		f = calloc(1, sizeof(*f));
+		if (f == NULL) {
 			logerror("calloc");
 			exit(1);
 		}
-		cfline("*.PANIC\t*", (*nextp)->f_next, "*", "*");
+		cfline("*.PANIC\t*", f, "*", "*");
+		STAILQ_INSERT_TAIL(&fhead, f, next);
+
 		Initialized = 1;
 		return;
 	}
 
-	readconfigfile(cf, &Files, 1);
+	readconfigfile(cf, 1);
 
 	/* close the configuration file */
 	(void)fclose(cf);
@@ -1865,7 +1808,7 @@ init(int signo)
 
 	if (Debug) {
 		int port;
-		for (f = Files; f; f = f->f_next) {
+		STAILQ_FOREACH(f, &fhead, next) {
 			for (i = 0; i <= LOG_NFACILITIES; i++)
 				if (f->f_pmask[i] == INTERNAL_NOPRI)
 					printf("X ");
@@ -1874,32 +1817,31 @@ init(int signo)
 			printf("%s: ", TypeNames[f->f_type]);
 			switch (f->f_type) {
 			case F_FILE:
-				printf("%s", f->f_un.f_fname);
+				printf("%s", f->fu_fname);
 				break;
 
 			case F_CONSOLE:
 			case F_TTY:
-				printf("%s%s", _PATH_DEV, f->f_un.f_fname);
+				printf("%s%s", _PATH_DEV, f->fu_fname);
 				break;
 
 			case F_FORW:
-				port = (int)ntohs(((struct sockaddr_in *)
-				    (f->f_un.f_forw.f_addr->ai_addr))->sin_port);
+				port = ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port);
 				if (port != 514) {
 					printf("%s:%d",

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

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:10:40 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61D39C73199;
 Mon, 12 Dec 2016 19:10:40 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3022B1DD1;
 Mon, 12 Dec 2016 19:10:40 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCJAdmZ081851;
 Mon, 12 Dec 2016 19:10:39 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJAdhr081850;
 Mon, 12 Dec 2016 19:10:39 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121910.uBCJAdhr081850@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:10:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309926 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:10:40 -0000

Author: dteske
Date: Mon Dec 12 19:10:39 2016
New Revision: 309926
URL: https://svnweb.freebsd.org/changeset/base/309926

Log:
  Now that these variables do not contain the --default-item flag itself,
  change the name of the variable from $def_item_... to $default_...

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:10:14 2016	(r309925)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:10:39 2016	(r309926)
@@ -81,8 +81,8 @@ dialog_country_select()
 {
 	local input regdomains countries regdomain country
 	local no_default="<not selected>"
-	local def_item_regdomain="${1:-$no_default}"
-	local def_item_country="${2:-$no_default}"
+	local default_regdomain="${1:-$no_default}"
+	local default_country="${2:-$no_default}"
 
 	#
 	# Parse available countries/regdomains
@@ -112,7 +112,7 @@ dialog_country_select()
 		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Regdomain selection\" \
 		--cancel-label \"Skip\" \
-		--default-item \"$def_item_regdomain\" \
+		--default-item \"$default_regdomain\" \
 		--no-items \
 		--stdout \
 		--menu \"Select your regdomain.\" \
@@ -126,7 +126,7 @@ dialog_country_select()
 		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Country selection\" \
 		--cancel-label \"Skip\" \
-		--default-item \"$def_item_country\" \
+		--default-item \"$default_country\" \
 		--stdout \
 		--menu \"Select your country.\" \
 		$height $width $rows $countries"

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:11:05 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E26F3C73309;
 Mon, 12 Dec 2016 19:11:05 +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 B226E1F8F;
 Mon, 12 Dec 2016 19:11:05 +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 uBCJB4UT081934;
 Mon, 12 Dec 2016 19:11:04 GMT (envelope-from trasz@FreeBSD.org)
Received: (from trasz@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJB4cK081933;
 Mon, 12 Dec 2016 19:11:04 GMT (envelope-from trasz@FreeBSD.org)
Message-Id: <201612121911.uBCJB4cK081933@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: trasz set sender to
 trasz@FreeBSD.org using -f
From: Edward Tomasz Napierala <trasz@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:11:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309927 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:11:06 -0000

Author: trasz
Date: Mon Dec 12 19:11:04 2016
New Revision: 309927
URL: https://svnweb.freebsd.org/changeset/base/309927

Log:
  Undo r309891.  Konstantin is right in that this condition normally
  cannot happen - the um_dev field is assigned at mount and never written
  to afterwards.

Modified:
  head/sys/kern/kern_conf.c

Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c	Mon Dec 12 19:10:39 2016	(r309926)
+++ head/sys/kern/kern_conf.c	Mon Dec 12 19:11:04 2016	(r309927)
@@ -1230,9 +1230,6 @@ const char *
 devtoname(struct cdev *dev)
 {
 
-	if (dev == NULL)
-		return (NULL);
-
 	return (dev->si_name);
 }
 

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:12:32 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC913C73389;
 Mon, 12 Dec 2016 19:12:32 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BBEF25E2;
 Mon, 12 Dec 2016 19:12:32 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCJCVNH085671;
 Mon, 12 Dec 2016 19:12:31 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJCVf6085670;
 Mon, 12 Dec 2016 19:12:31 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121912.uBCJCVf6085670@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:12:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309928 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:12:33 -0000

Author: dteske
Date: Mon Dec 12 19:12:31 2016
New Revision: 309928
URL: https://svnweb.freebsd.org/changeset/base/309928

Log:
  If you're not going to make use of the products of a match() in awk
  (e.g., RSTART and RLENGTH variables) then use ~ instead of match()

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:11:04 2016	(r309927)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:12:31 2016	(r309928)
@@ -95,8 +95,8 @@ dialog_country_select()
 		sub(/Regulatory.*/, "")
 		for (i = 1; i <= NF; i++) {
 			printf "%s", $i
-			if (match($i, /[[:lower:]]/))
-				if (match($(i+1), /[[:lower:]]/))
+			if ($i ~ /[[:lower:]]/)
+				if ($(i+1) ~ /[[:lower:]]/)
 					printf "\\\\\\ "
 				else
 					printf "\n"

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:13:02 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC0B2C733E3;
 Mon, 12 Dec 2016 19:13:02 +0000 (UTC)
 (envelope-from etnapierala@gmail.com)
Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com
 [IPv6:2a00:1450:400c:c09::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 3DE0C7F2;
 Mon, 12 Dec 2016 19:13:02 +0000 (UTC)
 (envelope-from etnapierala@gmail.com)
Received: by mail-wm0-x242.google.com with SMTP id u144so13229534wmu.0;
 Mon, 12 Dec 2016 11:13:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:date:from:to:cc:subject:message-id:mail-followup-to
 :references:mime-version:content-disposition:in-reply-to:user-agent;
 bh=fj0D+rHjO6d6ZF3ovxeb56nJ36aNZcj6fWbebI21+N4=;
 b=lXiD88V7ehIDg+j1jwMdw1EJb4NM7f8uYFd/OSRxExHMk3/N9pBv4wdLwTgSgb5Lyv
 5H2X6Wekd+iuUtg19QxiHovno4RnNncgasIDVu8aQ1CZr/J1qvD93y4/QPQM3LVsXs25
 9Ed2Qt+m6/JDK2s1IcC/TIZqLgi5og/fjSBcz1ulhMbEaRiwGqzcWauvk2zgy5Kso4Ki
 x24G/rpdgnYHycffCnKYCnYbWBM6LEpi0kkZh5C+nSp/Zp5jVG6nonyff+43AdvcvyWS
 MhtINFpuH2jxElDALYGfTQqPYgZkCz4fipEgVU4BBX1JVRn+TY7WonTt6Upb4yPX0o58
 NFZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
 :mail-followup-to:references:mime-version:content-disposition
 :in-reply-to:user-agent;
 bh=fj0D+rHjO6d6ZF3ovxeb56nJ36aNZcj6fWbebI21+N4=;
 b=VTZgW6EcH8ntfgDC2/9TSahP7IrqP9T80gc5NpavUXwYlTc8OET79iv8xfAZlUAlTI
 WIBovSYTzOfy/aMF6cMFh5YprmmYAFU+zJ3b7TmjtyfM674/cozSnuh/0c97/LZZ+9OZ
 1lPU1za45XDdP6QUUxyjzfggJe5zLjkpnBhPP9YEiSE5fhfMMyyvXC20PbPx1GWH92rB
 BeP4yl7wOyc9EViD3qeXXrnSi7+yb92gLhBKQ/BvT0T4Ms++84FnwVH8e2KQA5BsBJiy
 dzvVYD1VLgThvloiaZIEaXTFEHhD7sjSwdREiwAula9YU0n8Cu6kV9U1UFiX/fCmKiAo
 qkHg==
X-Gm-Message-State: AKaTC03uuix5EO/JNny+bo3mMI9TcqylWLp7xpReaLdMXlFwiGKNCYkvKvidCQemoxKkNA==
X-Received: by 10.28.74.133 with SMTP id n5mr10306064wmi.132.1481569980688;
 Mon, 12 Dec 2016 11:13:00 -0800 (PST)
Received: from brick (aegh224.neoplus.adsl.tpnet.pl. [79.186.163.224])
 by smtp.gmail.com with ESMTPSA id d85sm36822694wmd.17.2016.12.12.11.12.59
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 12 Dec 2016 11:13:00 -0800 (PST)
Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= <etnapierala@gmail.com>
Date: Mon, 12 Dec 2016 20:12:57 +0100
From: Edward Tomasz Napierala <trasz@FreeBSD.org>
To: Konstantin Belousov <kostikbel@gmail.com>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r309891 - head/sys/kern
Message-ID: <20161212191257.GA11238@brick>
Mail-Followup-To: Konstantin Belousov <kostikbel@gmail.com>,
 src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
References: <201612121522.uBCFMMmm088698@repo.freebsd.org>
 <20161212163331.GH54029@kib.kiev.ua>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20161212163331.GH54029@kib.kiev.ua>
User-Agent: Mutt/1.7.1 (2016-10-04)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:13:02 -0000

On 1212T1833, Konstantin Belousov wrote:
> On Mon, Dec 12, 2016 at 03:22:22PM +0000, Edward Tomasz Napierala wrote:
> > Author: trasz
> > Date: Mon Dec 12 15:22:21 2016
> > New Revision: 309891
> > URL: https://svnweb.freebsd.org/changeset/base/309891
> > 
> > Log:
> >   Avoid dereferencing NULL pointers in devtoname().  I've seen it panic,
> >   called from ufs_print() in DDB.
> Calls from DDB should not panic even if accessing NULL pointers.

Yeah, by "panic" I've meant the "reentering ddb" thing.  It's not a panic
per se, but still breaks eg "show lockedvnodes".

> That said, I also do not think that this is the right place to change.
> UFS um_dev should not be NULL for any active mount.

After looking at this once again I agree.  Looks like some kind of bug
specific to my sources at that point of time.  Backed off.


From owner-svn-src-all@freebsd.org  Mon Dec 12 19:15:47 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 500D9C73494;
 Mon, 12 Dec 2016 19:15: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 BD7EA9AE;
 Mon, 12 Dec 2016 19:15: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 uBCJFfjn014758
 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
 Mon, 12 Dec 2016 21:15:41 +0200 (EET)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBCJFfjn014758
Received: (from kostik@localhost)
 by tom.home (8.15.2/8.15.2/Submit) id uBCJFfVQ014757;
 Mon, 12 Dec 2016 21:15:41 +0200 (EET)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Mon, 12 Dec 2016 21:15:41 +0200
From: Konstantin Belousov <kostikbel@gmail.com>
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r309891 - head/sys/kern
Message-ID: <20161212191541.GM54029@kib.kiev.ua>
References: <201612121522.uBCFMMmm088698@repo.freebsd.org>
 <20161212163331.GH54029@kib.kiev.ua> <20161212191257.GA11238@brick>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20161212191257.GA11238@brick>
User-Agent: Mutt/1.7.1 (2016-10-04)
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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:15:47 -0000

On Mon, Dec 12, 2016 at 08:12:57PM +0100, Edward Tomasz Napierala wrote:
> On 1212T1833, Konstantin Belousov wrote:
> > On Mon, Dec 12, 2016 at 03:22:22PM +0000, Edward Tomasz Napierala wrote:
> > > Author: trasz
> > > Date: Mon Dec 12 15:22:21 2016
> > > New Revision: 309891
> > > URL: https://svnweb.freebsd.org/changeset/base/309891
> > > 
> > > Log:
> > >   Avoid dereferencing NULL pointers in devtoname().  I've seen it panic,
> > >   called from ufs_print() in DDB.
> > Calls from DDB should not panic even if accessing NULL pointers.
> 
> Yeah, by "panic" I've meant the "reentering ddb" thing.  It's not a panic
> per se, but still breaks eg "show lockedvnodes".
> 
> > That said, I also do not think that this is the right place to change.
> > UFS um_dev should not be NULL for any active mount.
> 
> After looking at this once again I agree.  Looks like some kind of bug
> specific to my sources at that point of time.  Backed off.

Thank you.

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:16:36 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56A0EC73526;
 Mon, 12 Dec 2016 19:16:36 +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 267AAB34;
 Mon, 12 Dec 2016 19:16:36 +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 uBCJGZLM085852;
 Mon, 12 Dec 2016 19:16:35 GMT (envelope-from mjg@FreeBSD.org)
Received: (from mjg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJGZpv085849;
 Mon, 12 Dec 2016 19:16:35 GMT (envelope-from mjg@FreeBSD.org)
Message-Id: <201612121916.uBCJGZpv085849@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org
 using -f
From: Mateusz Guzik <mjg@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:16:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309929 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:16:36 -0000

Author: mjg
Date: Mon Dec 12 19:16:35 2016
New Revision: 309929
URL: https://svnweb.freebsd.org/changeset/base/309929

Log:
  vfs: use vrefact in getcwd and fchdir

Modified:
  head/sys/kern/vfs_cache.c
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Mon Dec 12 19:12:31 2016	(r309928)
+++ head/sys/kern/vfs_cache.c	Mon Dec 12 19:16:35 2016	(r309929)
@@ -2066,9 +2066,9 @@ kern___getcwd(struct thread *td, char *b
 	fdp = td->td_proc->p_fd;
 	FILEDESC_SLOCK(fdp);
 	cdir = fdp->fd_cdir;
-	VREF(cdir);
+	vrefact(cdir);
 	rdir = fdp->fd_rdir;
-	VREF(rdir);
+	vrefact(rdir);
 	FILEDESC_SUNLOCK(fdp);
 	error = vn_fullpath1(td, cdir, rdir, tmpbuf, &bp, buflen);
 	vrele(rdir);

Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c	Mon Dec 12 19:12:31 2016	(r309928)
+++ head/sys/kern/vfs_syscalls.c	Mon Dec 12 19:16:35 2016	(r309929)
@@ -754,7 +754,7 @@ sys_fchdir(td, uap)
 	if (error != 0)
 		return (error);
 	vp = fp->f_vnode;
-	VREF(vp);
+	vrefact(vp);
 	fdrop(fp, td);
 	vn_lock(vp, LK_SHARED | LK_RETRY);
 	AUDIT_ARG_VNODE1(vp);

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:24:34 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04193C73B61;
 Mon, 12 Dec 2016 19:24:34 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C7B3A1335;
 Mon, 12 Dec 2016 19:24:33 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCJOWRh089711;
 Mon, 12 Dec 2016 19:24:32 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJOW2g089710;
 Mon, 12 Dec 2016 19:24:32 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121924.uBCJOW2g089710@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:24:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309930 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:24:34 -0000

Author: dteske
Date: Mon Dec 12 19:24:32 2016
New Revision: 309930
URL: https://svnweb.freebsd.org/changeset/base/309930

Log:
  Use ternary operator

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:16:35 2016	(r309929)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:24:32 2016	(r309930)
@@ -96,10 +96,7 @@ dialog_country_select()
 		for (i = 1; i <= NF; i++) {
 			printf "%s", $i
 			if ($i ~ /[[:lower:]]/)
-				if ($(i+1) ~ /[[:lower:]]/)
-					printf "\\\\\\ "
-				else
-					printf "\n"
+				printf $(i+1) ~ /[[:lower:]]/ ? "\\\\\\ " : "\n"
 			else
 				printf " "
 		}

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:24:53 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C54ADC73BBB;
 Mon, 12 Dec 2016 19:24:53 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6D41014EC;
 Mon, 12 Dec 2016 19:24:53 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCJOqqT089769;
 Mon, 12 Dec 2016 19:24:52 GMT (envelope-from hrs@FreeBSD.org)
Received: (from hrs@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJOqwv089767;
 Mon, 12 Dec 2016 19:24:52 GMT (envelope-from hrs@FreeBSD.org)
Message-Id: <201612121924.uBCJOqwv089767@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org
 using -f
From: Hiroki Sato <hrs@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:24:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309931 - head/usr.sbin/syslogd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:24:53 -0000

Author: hrs
Date: Mon Dec 12 19:24:52 2016
New Revision: 309931
URL: https://svnweb.freebsd.org/changeset/base/309931

Log:
  Temporarily backout the previous commit because it was totally broken due to
  unresolved merge conflicts.
  
  Pointy hat to:	hrs

Modified:
  head/usr.sbin/syslogd/Makefile
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/Makefile
==============================================================================
--- head/usr.sbin/syslogd/Makefile	Mon Dec 12 19:24:32 2016	(r309930)
+++ head/usr.sbin/syslogd/Makefile	Mon Dec 12 19:24:52 2016	(r309931)
@@ -13,9 +13,6 @@ LIBADD=	util
 
 WARNS?= 3
 
-.if ${MK_INET_SUPPORT} != "no"
-CFLAGS+= -DINET
-.endif
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6
 .endif

Modified: head/usr.sbin/syslogd/syslogd.c
==============================================================================
--- head/usr.sbin/syslogd/syslogd.c	Mon Dec 12 19:24:32 2016	(r309930)
+++ head/usr.sbin/syslogd/syslogd.c	Mon Dec 12 19:24:52 2016	(r309931)
@@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/syslimits.h>
+#include <sys/types.h>
 
 #include <netinet/in.h>
 #include <netdb.h>
@@ -115,60 +116,43 @@ __FBSDID("$FreeBSD$");
 #define SYSLOG_NAMES
 #include <sys/syslog.h>
 
-static const char *ConfFile = _PATH_LOGCONF;
-static const char *PidFile = _PATH_LOGPID;
-static const char ctty[] = _PATH_CONSOLE;
-static const char include_str[] = "include";
-static const char include_ext[] = ".conf";
+const char	*ConfFile = _PATH_LOGCONF;
+const char	*PidFile = _PATH_LOGPID;
+const char	ctty[] = _PATH_CONSOLE;
+static const char	include_str[] = "include";
+static const char	include_ext[] = ".conf";
 
 #define	dprintf		if (Debug) printf
 
 #define	MAXUNAMES	20	/* maximum number of user names */
 
-#define	sstosa(ss)	((struct sockaddr *)(ss))
-#ifdef INET
-#define	satosin(sa)	((struct sockaddr_in *)(void *)(sa))
-#endif
-#ifdef INET6
-#define	satosin6(sa)	((struct sockaddr_in6 *)(void *)(sa))
-#define	s6_addr32	__u6_addr.__u6_addr32
-#define	IN6_ARE_MASKED_ADDR_EQUAL(d, a, m)	(	\
-	(((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \
-	(((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \
-	(((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \
-	(((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 )
-#endif
 /*
- * List of peers and sockets for binding.
+ * List of hosts for binding.
  */
-struct peer {
-	const char	*pe_name;
-	const char	*pe_serv;
-	mode_t		pe_mode;
-	STAILQ_ENTRY(peer)	next;
-};
-struct socklist {
-	struct sockaddr_storage	sl_ss;
-	int			sl_socket;
-	struct peer		*sl_peer;
-	STAILQ_ENTRY(socklist)	next;
+static STAILQ_HEAD(, host) hqueue;
+struct host {
+	char			*name;
+	STAILQ_ENTRY(host)	next;
 };
-static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INITIALIZER(shead);
 
-static struct peer funix_secure = {
-	.pe_name = _PATH_LOG_PRIV,
-	.pe_mode = S_IRUSR | S_IWUSR,
-	.next = {NULL},
-};
-static struct peer funix_default = {
-	.pe_name = _PATH_LOG,
-	.pe_mode = DEFFILEMODE,
-	.next = {&funix_secure},
-};
-static STAILQ_HEAD(, peer) pqueue = {
-	&funix_default,
-	&funix_secure.next.stqe_next,
+/*
+ * Unix sockets.
+ * We have two default sockets, one with 666 permissions,
+ * and one for privileged programs.
+ */
+struct funix {
+	int			s;
+	const char		*name;
+	mode_t			mode;
+	STAILQ_ENTRY(funix)	next;
 };
+struct funix funix_secure =	{ -1, _PATH_LOG_PRIV, S_IRUSR | S_IWUSR,
+				{ NULL } };
+struct funix funix_default =	{ -1, _PATH_LOG, DEFFILEMODE,
+				{ &funix_secure } };
+
+STAILQ_HEAD(, funix) funixes =	{ &funix_default,
+				&(funix_secure.next.stqe_next) };
 
 /*
  * Flags to logmsg().
@@ -188,7 +172,7 @@ static STAILQ_HEAD(, peer) pqueue = {
  */
 
 struct filed {
-	STAILQ_ENTRY(filed)	next;	/* next in linked list */
+	struct	filed *f_next;		/* next in linked list */
 	short	f_type;			/* entry type, see below */
 	short	f_file;			/* file descriptor */
 	time_t	f_time;			/* time this was last written */
@@ -212,12 +196,6 @@ struct filed {
 			pid_t	f_pid;
 		} f_pipe;
 	} f_un;
-#define	fu_uname	f_un.f_uname
-#define	fu_forw_hname	f_un.f_forw.f_hname
-#define	fu_forw_addr	f_un.f_forw.f_addr
-#define	fu_fname	f_un.f_fname
-#define	fu_pipe_pname	f_un.f_pipe.f_pname
-#define	fu_pipe_pid	f_un.f_pipe.f_pid
 	char	f_prevline[MAXSVLINE];		/* last message logged */
 	char	f_lasttime[16];			/* time of last occurrence */
 	char	f_prevhost[MAXHOSTNAMELEN];	/* host from which recd. */
@@ -233,12 +211,15 @@ struct filed {
 /*
  * Queue of about-to-be dead processes we should watch out for.
  */
+
+TAILQ_HEAD(stailhead, deadq_entry) deadq_head;
+struct stailhead *deadq_headp;
+
 struct deadq_entry {
 	pid_t				dq_pid;
 	int				dq_timeout;
 	TAILQ_ENTRY(deadq_entry)	dq_entries;
 };
-static TAILQ_HEAD(, deadq_entry) deadq_head;
 
 /*
  * The timeout to apply to processes waiting on the dead queue.  Unit
@@ -268,9 +249,7 @@ struct allowedpeer {
 #define a_addr u.numeric.addr
 #define a_mask u.numeric.mask
 #define a_name u.name
-	STAILQ_ENTRY(allowedpeer)	next;
 };
-static STAILQ_HEAD(, allowedpeer) aphead = STAILQ_HEAD_INITIALIZER(aphead);
 
 
 /*
@@ -278,7 +257,7 @@ static STAILQ_HEAD(, allowedpeer) aphead
  * in seconds after previous message is logged.  After each flush,
  * we move to the next interval until we reach the largest.
  */
-static int repeatinterval[] = { 30, 120, 600 };	/* # of secs before flush */
+int	repeatinterval[] = { 30, 120, 600 };	/* # of secs before flush */
 #define	MAXREPEAT ((sizeof(repeatinterval) / sizeof(repeatinterval[0])) - 1)
 #define	REPEATTIME(f)	((f)->f_time + repeatinterval[(f)->f_repeatcount])
 #define	BACKOFF(f)	{ if (++(f)->f_repeatcount > MAXREPEAT) \
@@ -295,13 +274,12 @@ static int repeatinterval[] = { 30, 120,
 #define F_WALL		6		/* everyone logged on */
 #define F_PIPE		7		/* pipe to program */
 
-static const char *TypeNames[8] = {
+const char *TypeNames[8] = {
 	"UNUSED",	"FILE",		"TTY",		"CONSOLE",
 	"FORW",		"USERS",	"WALL",		"PIPE"
 };
 
-static STAILQ_HEAD(, filed) fhead =
-    STAILQ_HEAD_INITIALIZER(fhead);	/* Log files that we write to */
+static struct filed *Files;	/* Log files that we write to */
 static struct filed consfile;	/* Console */
 
 static int	Debug;		/* debug flag */
@@ -309,6 +287,7 @@ static int	Foreground = 0;	/* Run in for
 static int	resolve = 1;	/* resolve hostname */
 static char	LocalHostName[MAXHOSTNAMELEN];	/* our hostname */
 static const char *LocalDomain;	/* our local domain name */
+static int	*finet;		/* Internet datagram sockets */
 static int	fklog = -1;	/* /dev/klog */
 static int	Initialized;	/* set when we have initialized ourselves */
 static int	MarkInterval = 20 * 60;	/* interval between marks in seconds */
@@ -328,6 +307,8 @@ static int	logflags = O_WRONLY|O_APPEND;
 
 static char	bootfile[MAXLINE+1]; /* booted kernel file */
 
+struct allowedpeer *AllowedPeers; /* List of allowed peers */
+static int	NumAllowed;	/* Number of entries in AllowedPeers */
 static int	RemoteAddDate;	/* Always set the date on remote messages */
 
 static int	UniquePriority;	/* Only log specified priority? */
@@ -337,7 +318,7 @@ static int	KeepKernFac;	/* Keep remotely
 static int	needdofsync = 0; /* Are any file(s) waiting to be fsynced? */
 static struct pidfh *pfh;
 
-static volatile sig_atomic_t MarkSet, WantDie;
+volatile sig_atomic_t MarkSet, WantDie;
 
 static int	allowaddr(char *);
 static void	cfline(const char *, struct filed *,
@@ -351,7 +332,7 @@ static void	dodie(int);
 static void	dofsync(void);
 static void	domark(int);
 static void	fprintlog(struct filed *, int, const char *);
-static int	socksetup(struct peer *);
+static int	*socksetup(int, char *);
 static void	init(int);
 static void	logerror(const char *);
 static void	logmsg(int, const char *, const char *, int);
@@ -387,30 +368,31 @@ close_filed(struct filed *f)
 int
 main(int argc, char *argv[])
 {
-	int ch, i, fdsrmax = 0;
-	struct sockaddr_storage ss;
+	int ch, i, fdsrmax = 0, l;
+	struct sockaddr_un sunx, fromunix;
+	struct sockaddr_storage frominet;
 	fd_set *fdsr = NULL;
 	char line[MAXLINE + 1];
 	const char *hname;
 	struct timeval tv, *tvp;
 	struct sigaction sact;
-	struct peer *pe;
-	struct socklist *sl;
+	struct host *host;
+	struct funix *fx, *fx1;
 	sigset_t mask;
 	pid_t ppid = 1, spid;
-	socklen_t sslen;
+	socklen_t len;
 
 	if (madvise(NULL, 0, MADV_PROTECT) != 0)
 		dprintf("madvise() failed: %s\n", strerror(errno));
 
+	STAILQ_INIT(&hqueue);
+
 	while ((ch = getopt(argc, argv, "468Aa:b:cCdf:Fkl:m:nNop:P:sS:Tuv"))
 	    != -1)
 		switch (ch) {
-#ifdef INET
 		case '4':
 			family = PF_INET;
 			break;
-#endif
 #ifdef INET6
 		case '6':
 			family = PF_INET6;
@@ -427,12 +409,13 @@ main(int argc, char *argv[])
 				usage();
 			break;
 		case 'b':
-			if ((pe = calloc(1, sizeof(*pe))) == NULL)
+		   {
+			if ((host = malloc(sizeof(struct host))) == NULL)
 				err(1, "malloc failed");
-			pe->pe_name = optarg;
-			pe->pe_serv = NULL;
-			STAILQ_INSERT_TAIL(&pqueue, pe, next);
+			host->name = optarg;
+			STAILQ_INSERT_TAIL(&hqueue, host, next);
 			break;
+		   }
 		case 'c':
 			no_compress++;
 			break;
@@ -475,12 +458,17 @@ main(int argc, char *argv[])
 				} else
 					errx(1, "invalid mode %s, exiting",
 					    optarg);
-			}
-			if ((pe = calloc(1, sizeof(*pe))) == NULL)
+			} else	/* doesn't begin with '/', and no ':' */
+				errx(1, "can't parse path %s", optarg);
+
+			if (strlen(name) >= sizeof(sunx.sun_path))
+				errx(1, "%s path too long, exiting", name);
+			if ((fx = malloc(sizeof(struct funix))) == NULL)
 				err(1, "malloc failed");
-			pe->pe_name = name;
-			pe->pe_mode = mode;
-			STAILQ_INSERT_TAIL(&pqueue, pe, next);
+			fx->s = -1;
+			fx->name = name;
+			fx->mode = mode;
+			STAILQ_INSERT_TAIL(&funixes, fx, next);
 			break;
 		   }
 		case 'm':		/* mark interval */
@@ -497,7 +485,9 @@ main(int argc, char *argv[])
 			use_bootfile = 1;
 			break;
 		case 'p':		/* path */
-			funix_default.pe_name = optarg;
+			if (strlen(optarg) >= sizeof(sunx.sun_path))
+				errx(1, "%s path too long, exiting", optarg);
+			funix_default.name = optarg;
 			break;
 		case 'P':		/* path for alt. PID */
 			PidFile = optarg;
@@ -506,7 +496,9 @@ main(int argc, char *argv[])
 			SecureMode++;
 			break;
 		case 'S':		/* path for privileged originator */
-			funix_secure.pe_name = optarg;
+			if (strlen(optarg) >= sizeof(sunx.sun_path))
+				errx(1, "%s path too long, exiting", optarg);
+			funix_secure.name = optarg;
 			break;
 		case 'T':
 			RemoteAddDate = 1;
@@ -522,8 +514,6 @@ main(int argc, char *argv[])
 		}
 	if ((argc -= optind) != 0)
 		usage();
-	STAILQ_FOREACH(pe, &pqueue, next)
-		socksetup(pe);
 
 	pfh = pidfile_open(PidFile, 0600, &spid);
 	if (pfh == NULL) {
@@ -539,12 +529,16 @@ main(int argc, char *argv[])
 			pidfile_remove(pfh);
 			exit(1);
 		}
-	} else if (Debug)
+	} else if (Debug) {
 		setlinebuf(stdout);
+	}
+
+	if (NumAllowed)
+		endservent();
 
 	consfile.f_type = F_CONSOLE;
-	(void)strlcpy(consfile.fu_fname, ctty + sizeof _PATH_DEV - 1,
-	    sizeof(consfile.fu_fname));
+	(void)strlcpy(consfile.f_un.f_fname, ctty + sizeof _PATH_DEV - 1,
+	    sizeof(consfile.f_un.f_fname));
 	(void)strlcpy(bootfile, getbootfile(), sizeof(bootfile));
 	(void)signal(SIGTERM, dodie);
 	(void)signal(SIGINT, Debug ? dodie : SIG_IGN);
@@ -567,6 +561,69 @@ main(int argc, char *argv[])
 
 	TAILQ_INIT(&deadq_head);
 
+#ifndef SUN_LEN
+#define SUN_LEN(unp) (strlen((unp)->sun_path) + 2)
+#endif
+	STAILQ_FOREACH_SAFE(fx, &funixes, next, fx1) {
+		(void)unlink(fx->name);
+		memset(&sunx, 0, sizeof(sunx));
+		sunx.sun_family = AF_LOCAL;
+		(void)strlcpy(sunx.sun_path, fx->name, sizeof(sunx.sun_path));
+		fx->s = socket(PF_LOCAL, SOCK_DGRAM, 0);
+		if (fx->s < 0 ||
+		    bind(fx->s, (struct sockaddr *)&sunx, SUN_LEN(&sunx)) < 0 ||
+		    chmod(fx->name, fx->mode) < 0) {
+			(void)snprintf(line, sizeof line,
+					"cannot create %s", fx->name);
+			logerror(line);
+			dprintf("cannot create %s (%d)\n", fx->name, errno);
+			if (fx == &funix_default || fx == &funix_secure)
+				die(0);
+			else {
+				STAILQ_REMOVE(&funixes, fx, funix, next);
+				continue;
+			}
+		}
+		increase_rcvbuf(fx->s);
+	}
+	if (SecureMode <= 1) {
+		if (STAILQ_EMPTY(&hqueue))
+			finet = socksetup(family, NULL);
+		STAILQ_FOREACH(host, &hqueue, next) {
+			int *finet0, total;
+			finet0 = socksetup(family, host->name);
+			if (finet0 && !finet) {
+				finet = finet0;
+			} else if (finet0 && finet) {
+				total = *finet0 + *finet + 1;
+				finet = realloc(finet, total * sizeof(int));
+				if (finet == NULL)
+					err(1, "realloc failed");
+				for (i = 1; i <= *finet0; i++) {
+					finet[(*finet)+i] = finet0[i];
+				}
+				*finet = total - 1;
+				free(finet0);
+			}
+		}
+	}
+
+	if (finet) {
+		if (SecureMode) {
+			for (i = 0; i < *finet; i++) {
+				if (shutdown(finet[i+1], SHUT_RD) < 0 &&
+				    errno != ENOTCONN) {
+					logerror("shutdown");
+					if (!Debug)
+						die(0);
+				}
+			}
+		} else {
+			dprintf("listening on inet and/or inet6 socket\n");
+		}
+		dprintf("sending on inet and/or inet6 socket\n");
+	}
+
 	if ((fklog = open(_PATH_KLOG, O_RDONLY|O_NONBLOCK, 0)) < 0)
 		dprintf("can't open %s (%d)\n", _PATH_KLOG, errno);
 
@@ -589,10 +646,15 @@ main(int argc, char *argv[])
 
 	if (fklog != -1 && fklog > fdsrmax)
 		fdsrmax = fklog;
-	STAILQ_FOREACH(sl, &shead, next) {
-		if (sl->sl_socket > fdsrmax)
-			fdsrmax = sl->sl_socket;
+	if (finet && !SecureMode) {
+		for (i = 0; i < *finet; i++) {
+		    if (finet[i+1] != -1 && finet[i+1] > fdsrmax)
+			fdsrmax = finet[i+1];
+		}
 	}
+	STAILQ_FOREACH(fx, &funixes, next)
+		if (fx->s > fdsrmax)
+			fdsrmax = fx->s;
 
 	fdsr = (fd_set *)calloc(howmany(fdsrmax+1, NFDBITS),
 	    sizeof(fd_mask));
@@ -610,11 +672,16 @@ main(int argc, char *argv[])
 
 		if (fklog != -1)
 			FD_SET(fklog, fdsr);
-		STAILQ_FOREACH(sl, &shead, next) {
-			if (sl->sl_socket != -1)
-				FD_SET(sl->sl_socket, fdsr);
+		if (finet && !SecureMode) {
+			for (i = 0; i < *finet; i++) {
+				if (finet[i+1] != -1)
+					FD_SET(finet[i+1], fdsr);
+			}
 		}
-		i = select(fdsrmax + 1, fdsr, NULL, NULL,
+		STAILQ_FOREACH(fx, &funixes, next)
+			FD_SET(fx->s, fdsr);
+
+		i = select(fdsrmax+1, fdsr, NULL, NULL,
 		    needdofsync ? &tv : tvp);
 		switch (i) {
 		case 0:
@@ -633,40 +700,34 @@ main(int argc, char *argv[])
 		}
 		if (fklog != -1 && FD_ISSET(fklog, fdsr))
 			readklog();
-		STAILQ_FOREACH(sl, &shead, next) {
-			int date, len;
-
-			if (FD_ISSET(sl->sl_socket, fdsr)) {
-				sslen = sizeof(ss);
-				dprintf("sslen(1) = %d\n", sslen);
-				len = recvfrom(sl->sl_socket, line,
-				    sizeof(line) - 1, 0,
-				    sstosa(&ss), &sslen);
-				dprintf("sslen(2) = %d\n", sslen);
-				if (len == 0)
-					continue;
-				if (len < 0) {
-					if (errno != EINTR)
-						logerror("recvfrom");
-					continue;
-				}
-				/* Received valid data. */
-				line[len] = '\0';
-				if (sl->sl_ss.ss_family == AF_LOCAL) {
-					hname = LocalHostName;
-					date = 0;
-				} else {
-					hname = cvthname(sstosa(&ss));
-					unmapped(sstosa(&ss));
-					if (validate(sstosa(&ss), hname) == 0)
-						hname = NULL;
-					date = RemoteAddDate ? ADDDATE : 0;
+		if (finet && !SecureMode) {
+			for (i = 0; i < *finet; i++) {
+				if (FD_ISSET(finet[i+1], fdsr)) {
+					len = sizeof(frominet);
+					l = recvfrom(finet[i+1], line, MAXLINE,
+					     0, (struct sockaddr *)&frominet,
+					     &len);
+					if (l > 0) {
+						line[l] = '\0';
+						hname = cvthname((struct sockaddr *)&frominet);
+						unmapped((struct sockaddr *)&frominet);
+						if (validate((struct sockaddr *)&frominet, hname))
+							printline(hname, line, RemoteAddDate ? ADDDATE : 0);
+					} else if (l < 0 && errno != EINTR)
+						logerror("recvfrom inet");
 				}
-				if (hname != NULL)
-					printline(hname, line, date);
-				else
-					dprintf("Invalid msg from "
-					    "%s was ignored.", hname);
+			}
+		}
+		STAILQ_FOREACH(fx, &funixes, next) {
+			if (FD_ISSET(fx->s, fdsr)) {
+				len = sizeof(fromunix);
+				l = recvfrom(fx->s, line, MAXLINE, 0,
+				    (struct sockaddr *)&fromunix, &len);
+				if (l > 0) {
+					line[l] = '\0';
+					printline(LocalHostName, line, 0);
+				} else if (l < 0 && errno != EINTR)
+					logerror("recvfrom unix");
 			}
 		}
 	}
@@ -674,36 +735,30 @@ main(int argc, char *argv[])
 		free(fdsr);
 }
 
-#ifdef INET6
 static void
 unmapped(struct sockaddr *sa)
 {
 	struct sockaddr_in6 *sin6;
 	struct sockaddr_in sin4;
 
-	if (sa == NULL ||
-	    sa->sa_family != AF_INET6 ||
-	    sa->sa_len != sizeof(*sin6))
+	if (sa->sa_family != AF_INET6)
 		return;
-	sin6 = satosin6(sa);
+	if (sa->sa_len != sizeof(struct sockaddr_in6) ||
+	    sizeof(sin4) > sa->sa_len)
+		return;
+	sin6 = (struct sockaddr_in6 *)sa;
 	if (!IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr))
 		return;
 
 	memset(&sin4, 0, sizeof(sin4));
 	sin4.sin_family = AF_INET;
-	sin4.sin_len = sizeof(sin4);
+	sin4.sin_len = sizeof(struct sockaddr_in);
 	memcpy(&sin4.sin_addr, &sin6->sin6_addr.s6_addr[12],
 	       sizeof(sin4.sin_addr));
 	sin4.sin_port = sin6->sin6_port;
 
 	memcpy(sa, &sin4, sin4.sin_len);
 }
-#else
-static void
-unmapped(struct sockaddr *sa __unused)
-{
-}
-#endif
 
 static void
 usage(void)
@@ -988,7 +1043,7 @@ logmsg(int pri, const char *msg, const c
 		(void)sigsetmask(omask);
 		return;
 	}
-	STAILQ_FOREACH(f, &fhead, next) {
+	for (f = Files; f; f = f->f_next) {
 		/* skip messages that are incorrect priority */
 		if (!(((f->f_pcmp[fac] & PRI_EQ) && (f->f_pmask[fac] == prilev))
 		     ||((f->f_pcmp[fac] & PRI_LT) && (f->f_pmask[fac] < prilev))
@@ -1065,7 +1120,7 @@ dofsync(void)
 {
 	struct filed *f;
 
-	STAILQ_FOREACH(f, &fhead, next) {
+	for (f = Files; f; f = f->f_next) {
 		if ((f->f_type == F_FILE) &&
 		    (f->f_flags & FFLAG_NEEDSYNC)) {
 			f->f_flags &= ~FFLAG_NEEDSYNC;
@@ -1081,7 +1136,7 @@ fprintlog(struct filed *f, int flags, co
 	struct iovec iov[IOV_SIZE];
 	struct iovec *v;
 	struct addrinfo *r;
-	int l, lsent = 0;
+	int i, l, lsent = 0;
 	char line[MAXLINE + 1], repbuf[80], greetings[200], *wmsg = NULL;
 	char nul[] = "", space[] = " ", lf[] = "\n", crlf[] = "\r\n";
 	const char *msgret;
@@ -1189,11 +1244,12 @@ fprintlog(struct filed *f, int flags, co
 		break;
 
 	case F_FORW:
-		port = ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port);
+		port = (int)ntohs(((struct sockaddr_in *)
+			    (f->f_un.f_forw.f_addr->ai_addr))->sin_port);
 		if (port != 514) {
-			dprintf(" %s:%d\n", f->fu_forw_hname, port);
+			dprintf(" %s:%d\n", f->f_un.f_forw.f_hname, port);
 		} else {
-			dprintf(" %s\n", f->fu_forw_hname);
+			dprintf(" %s\n", f->f_un.f_forw.f_hname);
 		}
 		/* check for local vs remote messages */
 		if (strcasecmp(f->f_prevhost, LocalHostName))
@@ -1210,51 +1266,57 @@ fprintlog(struct filed *f, int flags, co
 		else if (l > MAXLINE)
 			l = MAXLINE;
 
-		for (r = f->fu_forw_addr; r; r = r->ai_next) {
-			struct socklist *sl;
-
-			STAILQ_FOREACH(sl, &shead, next) {
-				if (sl->sl_ss.ss_family == AF_LOCAL)
-					continue;
-				lsent = sendto(sl->sl_socket, line, l, 0,
-				    r->ai_addr, r->ai_addrlen);
-				if (lsent == l)
+		if (finet) {
+			for (r = f->f_un.f_forw.f_addr; r; r = r->ai_next) {
+				for (i = 0; i < *finet; i++) {
+#if 0
+					/*
+					 * should we check AF first, or just
+					 * trial and error? FWD
+					 */
+					if (r->ai_family ==
+					    address_family_of(finet[i+1]))
+#endif
+					lsent = sendto(finet[i+1], line, l, 0,
+					    r->ai_addr, r->ai_addrlen);
+					if (lsent == l)
+						break;
+				}
+				if (lsent == l && !send_to_all)
 					break;
 			}
-			if (lsent == l && !send_to_all)
-				break;
-		}
-		dprintf("lsent/l: %d/%d\n", lsent, l);
-		if (lsent != l) {
-			int e = errno;
-			logerror("sendto");
-			errno = e;
-			switch (errno) {
-			case ENOBUFS:
-			case ENETDOWN:
-			case ENETUNREACH:
-			case EHOSTUNREACH:
-			case EHOSTDOWN:
-			case EADDRNOTAVAIL:
-				break;
-			/* case EBADF: */
-			/* case EACCES: */
-			/* case ENOTSOCK: */
-			/* case EFAULT: */
-			/* case EMSGSIZE: */
-			/* case EAGAIN: */
-			/* case ENOBUFS: */
-			/* case ECONNREFUSED: */
-			default:
-				dprintf("removing entry: errno=%d\n", e);
-				f->f_type = F_UNUSED;
-				break;
+			dprintf("lsent/l: %d/%d\n", lsent, l);
+			if (lsent != l) {
+				int e = errno;
+				logerror("sendto");
+				errno = e;
+				switch (errno) {
+				case ENOBUFS:
+				case ENETDOWN:
+				case ENETUNREACH:
+				case EHOSTUNREACH:
+				case EHOSTDOWN:
+				case EADDRNOTAVAIL:
+					break;
+				/* case EBADF: */
+				/* case EACCES: */
+				/* case ENOTSOCK: */
+				/* case EFAULT: */
+				/* case EMSGSIZE: */
+				/* case EAGAIN: */
+				/* case ENOBUFS: */
+				/* case ECONNREFUSED: */
+				default:
+					dprintf("removing entry: errno=%d\n", e);
+					f->f_type = F_UNUSED;
+					break;
+				}
 			}
 		}
 		break;
 
 	case F_FILE:
-		dprintf(" %s\n", f->fu_fname);
+		dprintf(" %s\n", f->f_un.f_fname);
 		v->iov_base = lf;
 		v->iov_len = 1;
 		if (writev(f->f_file, iov, IOV_SIZE) < 0) {
@@ -1267,7 +1329,7 @@ fprintlog(struct filed *f, int flags, co
 				int e = errno;
 				close_filed(f);
 				errno = e;
-				logerror(f->fu_fname);
+				logerror(f->f_un.f_fname);
 			}
 		} else if ((flags & SYNC_FILE) && (f->f_flags & FFLAG_SYNC)) {
 			f->f_flags |= FFLAG_NEEDSYNC;
@@ -1276,26 +1338,26 @@ fprintlog(struct filed *f, int flags, co
 		break;
 
 	case F_PIPE:
-		dprintf(" %s\n", f->fu_pipe_pname);
+		dprintf(" %s\n", f->f_un.f_pipe.f_pname);
 		v->iov_base = lf;
 		v->iov_len = 1;
-		if (f->fu_pipe_pid == 0) {
-			if ((f->f_file = p_open(f->fu_pipe_pname,
-						&f->fu_pipe_pid)) < 0) {
+		if (f->f_un.f_pipe.f_pid == 0) {
+			if ((f->f_file = p_open(f->f_un.f_pipe.f_pname,
+						&f->f_un.f_pipe.f_pid)) < 0) {
 				f->f_type = F_UNUSED;
-				logerror(f->fu_pipe_pname);
+				logerror(f->f_un.f_pipe.f_pname);
 				break;
 			}
 		}
 		if (writev(f->f_file, iov, IOV_SIZE) < 0) {
 			int e = errno;
 			close_filed(f);
-			if (f->fu_pipe_pid > 0)
-				deadq_enter(f->fu_pipe_pid,
-					    f->fu_pipe_pname);
-			f->fu_pipe_pid = 0;
+			if (f->f_un.f_pipe.f_pid > 0)
+				deadq_enter(f->f_un.f_pipe.f_pid,
+					    f->f_un.f_pipe.f_pname);
+			f->f_un.f_pipe.f_pid = 0;
 			errno = e;
-			logerror(f->fu_pipe_pname);
+			logerror(f->f_un.f_pipe.f_pname);
 		}
 		break;
 
@@ -1307,12 +1369,12 @@ fprintlog(struct filed *f, int flags, co
 		/* FALLTHROUGH */
 
 	case F_TTY:
-		dprintf(" %s%s\n", _PATH_DEV, f->fu_fname);
+		dprintf(" %s%s\n", _PATH_DEV, f->f_un.f_fname);
 		v->iov_base = crlf;
 		v->iov_len = 2;
 
 		errno = 0;	/* ttymsg() only sometimes returns an errno */
-		if ((msgret = ttymsg(iov, IOV_SIZE, f->fu_fname, 10))) {
+		if ((msgret = ttymsg(iov, IOV_SIZE, f->f_un.f_fname, 10))) {
 			f->f_type = F_UNUSED;
 			logerror(msgret);
 		}
@@ -1361,9 +1423,9 @@ wallmsg(struct filed *f, struct iovec *i
 		}
 		/* should we send the message to this user? */
 		for (i = 0; i < MAXUNAMES; i++) {
-			if (!f->fu_uname[i][0])
+			if (!f->f_un.f_uname[i][0])
 				break;
-			if (!strcmp(f->fu_uname[i], ut->ut_user)) {
+			if (!strcmp(f->f_un.f_uname[i], ut->ut_user)) {
 				if ((p = ttymsg_check(iov, iovlen, ut->ut_line,
 				    TTYMSGTIME)) != NULL) {
 					errno = 0;	/* already in msg */
@@ -1414,18 +1476,20 @@ reapchild(int signo __unused)
 
 		/* First, look if it's a process from the dead queue. */
 		if (deadq_remove(pid))
-			continue;
+			goto oncemore;
 
 		/* Now, look in list of active processes. */
-		STAILQ_FOREACH(f, &fhead, next) {
+		for (f = Files; f; f = f->f_next)
 			if (f->f_type == F_PIPE &&
-			    f->fu_pipe_pid == pid) {
+			    f->f_un.f_pipe.f_pid == pid) {
 				close_filed(f);
-				f->fu_pipe_pid = 0;
-				log_deadchild(pid, status, f->fu_pipe_pname);
+				f->f_un.f_pipe.f_pid = 0;
+				log_deadchild(pid, status,
+					      f->f_un.f_pipe.f_pname);
 				break;
 			}
-		}
+	  oncemore:
+		continue;
 	}
 }
 
@@ -1439,9 +1503,9 @@ cvthname(struct sockaddr *f)
 	sigset_t omask, nmask;
 	static char hname[NI_MAXHOST], ip[NI_MAXHOST];
 
-	dprintf("cvthname(%d) len = %d, %zu\n", f->sa_family, f->sa_len, sizeof(struct sockaddr_in6));
-	error = getnameinfo(f, f->sa_len, ip, sizeof(ip), NULL, 0,
-		    NI_NUMERICHOST);
+	error = getnameinfo((struct sockaddr *)f,
+			    ((struct sockaddr *)f)->sa_len,
+			    ip, sizeof ip, NULL, 0, NI_NUMERICHOST);
 	dprintf("cvthname(%s)\n", ip);
 
 	if (error) {
@@ -1511,19 +1575,19 @@ static void
 die(int signo)
 {
 	struct filed *f;
-	struct socklist *sl;
+	struct funix *fx;
 	int was_initialized;
 	char buf[100];
 
 	was_initialized = Initialized;
 	Initialized = 0;	/* Don't log SIGCHLDs. */
-	STAILQ_FOREACH(f, &fhead, next) {
+	for (f = Files; f != NULL; f = f->f_next) {
 		/* flush any pending output */
 		if (f->f_prevcount)
 			fprintlog(f, 0, (char *)NULL);
-		if (f->f_type == F_PIPE && f->fu_pipe_pid > 0) {
+		if (f->f_type == F_PIPE && f->f_un.f_pipe.f_pid > 0) {
 			close_filed(f);
-			f->fu_pipe_pid = 0;
+			f->f_un.f_pipe.f_pid = 0;
 		}
 	}
 	Initialized = was_initialized;
@@ -1533,10 +1597,8 @@ die(int signo)
 		errno = 0;
 		logerror(buf);
 	}
-	STAILQ_FOREACH(sl, &shead, next) {
-		if (sl->sl_ss.ss_family == AF_LOCAL)
-			unlink(sl->sl_peer->pe_name);
-	}
+	STAILQ_FOREACH(fx, &funixes, next)
+		(void)unlink(fx->name);
 	pidfile_remove(pfh);
 
 	exit(1);
@@ -1564,7 +1626,7 @@ configfiles(const struct dirent *dp)
 }
 
 static void
-readconfigfile(FILE *cf, int allow_includes)
+readconfigfile(FILE *cf, struct filed **nextp, int allow_includes)
 {
 	FILE *cf2;
 	struct filed *f;
@@ -1624,7 +1686,7 @@ readconfigfile(FILE *cf, int allow_inclu
 				if (cf2 == NULL)
 					continue;
 				dprintf("reading %s\n", file);
-				readconfigfile(cf2, 0);
+				readconfigfile(cf2, nextp, 0);
 				fclose(cf2);
 			}
 			free(ent);
@@ -1687,7 +1749,8 @@ readconfigfile(FILE *cf, int allow_inclu
 			logerror("calloc");
 			exit(1);
 		}
-		STAILQ_INSERT_TAIL(&fhead, f, next);
+		*nextp = f;
+		nextp = &f->f_next;
 		cfline(cline, f, prog, host);
 	}
 }
@@ -1700,7 +1763,7 @@ init(int signo)
 {
 	int i;
 	FILE *cf;
-	struct filed *f;
+	struct filed *f, *next, **nextp;
 	char *p;
 	char oldLocalHostName[MAXHOSTNAMELEN];
 	char hostMsg[2*MAXHOSTNAMELEN+40];
@@ -1745,7 +1808,7 @@ init(int signo)
 	 *  Close all open log files.
 	 */
 	Initialized = 0;
-	STAILQ_FOREACH(f, &fhead, next) {
+	for (f = Files; f != NULL; f = next) {
 		/* flush any pending output */
 		if (f->f_prevcount)
 			fprintlog(f, 0, (char *)NULL);
@@ -1758,48 +1821,42 @@ init(int signo)
 			close_filed(f);
 			break;
 		case F_PIPE:
-			if (f->fu_pipe_pid > 0) {
+			if (f->f_un.f_pipe.f_pid > 0) {
 				close_filed(f);
-				deadq_enter(f->fu_pipe_pid,
-					    f->fu_pipe_pname);
+				deadq_enter(f->f_un.f_pipe.f_pid,
+					    f->f_un.f_pipe.f_pname);
 			}
-			f->fu_pipe_pid = 0;
+			f->f_un.f_pipe.f_pid = 0;
 			break;
 		}
+		next = f->f_next;
+		if (f->f_program) free(f->f_program);
+		if (f->f_host) free(f->f_host);
+		free((char *)f);
 	}
-	while(!STAILQ_EMPTY(&fhead)) {
-		f = STAILQ_FIRST(&fhead);
-		STAILQ_REMOVE_HEAD(&fhead, next);
-		free(f->f_program);
-		free(f->f_host);
-		free(f);
-	}
+	Files = NULL;
 	nextp = &Files;
 
 	/* open the configuration file */
 	if ((cf = fopen(ConfFile, "r")) == NULL) {
 		dprintf("cannot open %s\n", ConfFile);
-		f = calloc(1, sizeof(*f));
-		if (f == NULL) {
+		*nextp = (struct filed *)calloc(1, sizeof(*f));
+		if (*nextp == NULL) {
 			logerror("calloc");
 			exit(1);
 		}
-		cfline("*.ERR\t/dev/console", f, "*", "*");
-		STAILQ_INSERT_TAIL(&fhead, f, next);
-
-		f = calloc(1, sizeof(*f));
-		if (f == NULL) {
+		cfline("*.ERR\t/dev/console", *nextp, "*", "*");
+		(*nextp)->f_next = (struct filed *)calloc(1, sizeof(*f));
+		if ((*nextp)->f_next == NULL) {
 			logerror("calloc");
 			exit(1);
 		}
-		cfline("*.PANIC\t*", f, "*", "*");
-		STAILQ_INSERT_TAIL(&fhead, f, next);
-
+		cfline("*.PANIC\t*", (*nextp)->f_next, "*", "*");
 		Initialized = 1;
 		return;
 	}
 
-	readconfigfile(cf, 1);
+	readconfigfile(cf, &Files, 1);
 
 	/* close the configuration file */
 	(void)fclose(cf);
@@ -1808,7 +1865,7 @@ init(int signo)
 
 	if (Debug) {
 		int port;
-		STAILQ_FOREACH(f, &fhead, next) {
+		for (f = Files; f; f = f->f_next) {
 			for (i = 0; i <= LOG_NFACILITIES; i++)
 				if (f->f_pmask[i] == INTERNAL_NOPRI)
 					printf("X ");
@@ -1817,31 +1874,32 @@ init(int signo)
 			printf("%s: ", TypeNames[f->f_type]);
 			switch (f->f_type) {
 			case F_FILE:
-				printf("%s", f->fu_fname);
+				printf("%s", f->f_un.f_fname);
 				break;
 
 			case F_CONSOLE:
 			case F_TTY:
-				printf("%s%s", _PATH_DEV, f->fu_fname);
+				printf("%s%s", _PATH_DEV, f->f_un.f_fname);
 				break;
 
 			case F_FORW:
-				port = ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port);
+				port = (int)ntohs(((struct sockaddr_in *)
+				    (f->f_un.f_forw.f_addr->ai_addr))->sin_port);
 				if (port != 514) {
 					printf("%s:%d",

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

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:26:56 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6733C73E61;
 Mon, 12 Dec 2016 19:26:56 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B63011963;
 Mon, 12 Dec 2016 19:26:56 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCJQt8G089889;
 Mon, 12 Dec 2016 19:26:55 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJQtnw089888;
 Mon, 12 Dec 2016 19:26:55 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121926.uBCJQtnw089888@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:26:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309932 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:26:57 -0000

Author: dteske
Date: Mon Dec 12 19:26:55 2016
New Revision: 309932
URL: https://svnweb.freebsd.org/changeset/base/309932

Log:
  Remove an unnecessary "return $?" at end of function

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:24:52 2016	(r309931)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:26:55 2016	(r309932)
@@ -130,8 +130,6 @@ dialog_country_select()
 	)
 
 	country_set "$regdomain" "$country"
-
-	return $?
 }
 
 ############################################################ MAIN

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:33:41 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF7FFC7416A;
 Mon, 12 Dec 2016 19:33:41 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B7BCA1F04;
 Mon, 12 Dec 2016 19:33:41 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCJXftb093961;
 Mon, 12 Dec 2016 19:33:41 GMT (envelope-from hrs@FreeBSD.org)
Received: (from hrs@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJXen2093959;
 Mon, 12 Dec 2016 19:33:40 GMT (envelope-from hrs@FreeBSD.org)
Message-Id: <201612121933.uBCJXen2093959@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org
 using -f
From: Hiroki Sato <hrs@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:33:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309933 - head/usr.sbin/syslogd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:33:42 -0000

Author: hrs
Date: Mon Dec 12 19:33:40 2016
New Revision: 309933
URL: https://svnweb.freebsd.org/changeset/base/309933

Log:
  - Refactor listening socket list.  All of the listening sockets are
    now maintained in a single linked-list in a transport-independent manner.
  - Use queue.h for linked-list structure.
  - Use linked-list for AllowedPeers.
  - Use getaddrinfo(8) even for Unix Domain sockets.
  - Use macros to type-casting from/to struct sockaddr{,_in,_in6}.
  - Define fu_* macro for union f_un to shorten the member names.
  - Remove an extra #include <sys/type.h>.
  - Add "static" to non-exported symbols.
  - !INET support is still incomplete but will be fixed later.
  
  There is no functional change except for some minor debug messages.

Modified:
  head/usr.sbin/syslogd/Makefile
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/Makefile
==============================================================================
--- head/usr.sbin/syslogd/Makefile	Mon Dec 12 19:26:55 2016	(r309932)
+++ head/usr.sbin/syslogd/Makefile	Mon Dec 12 19:33:40 2016	(r309933)
@@ -13,6 +13,9 @@ LIBADD=	util
 
 WARNS?= 3
 
+.if ${MK_INET_SUPPORT} != "no"
+CFLAGS+= -DINET
+.endif
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6
 .endif

Modified: head/usr.sbin/syslogd/syslogd.c
==============================================================================
--- head/usr.sbin/syslogd/syslogd.c	Mon Dec 12 19:26:55 2016	(r309932)
+++ head/usr.sbin/syslogd/syslogd.c	Mon Dec 12 19:33:40 2016	(r309933)
@@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/syslimits.h>
-#include <sys/types.h>
 
 #include <netinet/in.h>
 #include <netdb.h>
@@ -116,43 +115,56 @@ __FBSDID("$FreeBSD$");
 #define SYSLOG_NAMES
 #include <sys/syslog.h>
 
-const char	*ConfFile = _PATH_LOGCONF;
-const char	*PidFile = _PATH_LOGPID;
-const char	ctty[] = _PATH_CONSOLE;
-static const char	include_str[] = "include";
-static const char	include_ext[] = ".conf";
+static const char *ConfFile = _PATH_LOGCONF;
+static const char *PidFile = _PATH_LOGPID;
+static const char ctty[] = _PATH_CONSOLE;
+static const char include_str[] = "include";
+static const char include_ext[] = ".conf";
 
 #define	dprintf		if (Debug) printf
 
 #define	MAXUNAMES	20	/* maximum number of user names */
 
-/*
- * List of hosts for binding.
- */
-static STAILQ_HEAD(, host) hqueue;
-struct host {
-	char			*name;
-	STAILQ_ENTRY(host)	next;
+#define	sstosa(ss)	((struct sockaddr *)(ss))
+#define	satosin6(sa)	((struct sockaddr_in6 *)(void *)(sa))
+#define	satosin(sa)	((struct sockaddr_in *)(void *)(sa))
+#define	s6_addr32	__u6_addr.__u6_addr32
+#define	IN6_ARE_MASKED_ADDR_EQUAL(d, a, m)	(	\
+	(((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \
+	(((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \
+	(((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \
+	(((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 )
+/*
+ * List of peers and sockets for binding.
+ */
+struct peer {
+	const char	*pe_name;
+	const char	*pe_serv;
+	mode_t		pe_mode;
+	STAILQ_ENTRY(peer)	next;
 };
-
-/*
- * Unix sockets.
- * We have two default sockets, one with 666 permissions,
- * and one for privileged programs.
- */
-struct funix {
-	int			s;
-	const char		*name;
-	mode_t			mode;
-	STAILQ_ENTRY(funix)	next;
+struct socklist {
+	struct sockaddr_storage	sl_ss;
+	int			sl_socket;
+	struct peer		*sl_peer;
+	STAILQ_ENTRY(socklist)	next;
 };
-struct funix funix_secure =	{ -1, _PATH_LOG_PRIV, S_IRUSR | S_IWUSR,
-				{ NULL } };
-struct funix funix_default =	{ -1, _PATH_LOG, DEFFILEMODE,
-				{ &funix_secure } };
+static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INITIALIZER(shead);
 
-STAILQ_HEAD(, funix) funixes =	{ &funix_default,
-				&(funix_secure.next.stqe_next) };
+static struct peer funix_secure = {
+	.pe_name = _PATH_LOG_PRIV,
+	.pe_mode = S_IRUSR | S_IWUSR,
+	.next = {NULL},
+};
+static struct peer funix_default = {
+	.pe_name = _PATH_LOG,
+	.pe_mode = DEFFILEMODE,
+	.next = {&funix_secure},
+};
+static STAILQ_HEAD(, peer) pqueue = {
+	&funix_default,
+	&funix_secure.next.stqe_next,
+};
 
 /*
  * Flags to logmsg().
@@ -172,7 +184,7 @@ STAILQ_HEAD(, funix) funixes =	{ &funix_
  */
 
 struct filed {
-	struct	filed *f_next;		/* next in linked list */
+	STAILQ_ENTRY(filed)	next;	/* next in linked list */
 	short	f_type;			/* entry type, see below */
 	short	f_file;			/* file descriptor */
 	time_t	f_time;			/* time this was last written */
@@ -196,6 +208,12 @@ struct filed {
 			pid_t	f_pid;
 		} f_pipe;
 	} f_un;
+#define	fu_uname	f_un.f_uname
+#define	fu_forw_hname	f_un.f_forw.f_hname
+#define	fu_forw_addr	f_un.f_forw.f_addr
+#define	fu_fname	f_un.f_fname
+#define	fu_pipe_pname	f_un.f_pipe.f_pname
+#define	fu_pipe_pid	f_un.f_pipe.f_pid
 	char	f_prevline[MAXSVLINE];		/* last message logged */
 	char	f_lasttime[16];			/* time of last occurrence */
 	char	f_prevhost[MAXHOSTNAMELEN];	/* host from which recd. */
@@ -211,15 +229,12 @@ struct filed {
 /*
  * Queue of about-to-be dead processes we should watch out for.
  */
-
-TAILQ_HEAD(stailhead, deadq_entry) deadq_head;
-struct stailhead *deadq_headp;
-
 struct deadq_entry {
 	pid_t				dq_pid;
 	int				dq_timeout;
 	TAILQ_ENTRY(deadq_entry)	dq_entries;
 };
+static TAILQ_HEAD(, deadq_entry) deadq_head;
 
 /*
  * The timeout to apply to processes waiting on the dead queue.  Unit
@@ -249,7 +264,9 @@ struct allowedpeer {
 #define a_addr u.numeric.addr
 #define a_mask u.numeric.mask
 #define a_name u.name
+	STAILQ_ENTRY(allowedpeer)	next;
 };
+static STAILQ_HEAD(, allowedpeer) aphead = STAILQ_HEAD_INITIALIZER(aphead);
 
 
 /*
@@ -257,7 +274,7 @@ struct allowedpeer {
  * in seconds after previous message is logged.  After each flush,
  * we move to the next interval until we reach the largest.
  */
-int	repeatinterval[] = { 30, 120, 600 };	/* # of secs before flush */
+static int repeatinterval[] = { 30, 120, 600 };	/* # of secs before flush */
 #define	MAXREPEAT ((sizeof(repeatinterval) / sizeof(repeatinterval[0])) - 1)
 #define	REPEATTIME(f)	((f)->f_time + repeatinterval[(f)->f_repeatcount])
 #define	BACKOFF(f)	{ if (++(f)->f_repeatcount > MAXREPEAT) \
@@ -274,12 +291,13 @@ int	repeatinterval[] = { 30, 120, 600 };
 #define F_WALL		6		/* everyone logged on */
 #define F_PIPE		7		/* pipe to program */
 
-const char *TypeNames[8] = {
+static const char *TypeNames[8] = {
 	"UNUSED",	"FILE",		"TTY",		"CONSOLE",
 	"FORW",		"USERS",	"WALL",		"PIPE"
 };
 
-static struct filed *Files;	/* Log files that we write to */
+static STAILQ_HEAD(, filed) fhead =
+    STAILQ_HEAD_INITIALIZER(fhead);	/* Log files that we write to */
 static struct filed consfile;	/* Console */
 
 static int	Debug;		/* debug flag */
@@ -287,7 +305,6 @@ static int	Foreground = 0;	/* Run in for
 static int	resolve = 1;	/* resolve hostname */
 static char	LocalHostName[MAXHOSTNAMELEN];	/* our hostname */
 static const char *LocalDomain;	/* our local domain name */
-static int	*finet;		/* Internet datagram sockets */
 static int	fklog = -1;	/* /dev/klog */
 static int	Initialized;	/* set when we have initialized ourselves */
 static int	MarkInterval = 20 * 60;	/* interval between marks in seconds */
@@ -307,8 +324,6 @@ static int	logflags = O_WRONLY|O_APPEND;
 
 static char	bootfile[MAXLINE+1]; /* booted kernel file */
 
-struct allowedpeer *AllowedPeers; /* List of allowed peers */
-static int	NumAllowed;	/* Number of entries in AllowedPeers */
 static int	RemoteAddDate;	/* Always set the date on remote messages */
 
 static int	UniquePriority;	/* Only log specified priority? */
@@ -318,7 +333,7 @@ static int	KeepKernFac;	/* Keep remotely
 static int	needdofsync = 0; /* Are any file(s) waiting to be fsynced? */
 static struct pidfh *pfh;
 
-volatile sig_atomic_t MarkSet, WantDie;
+static volatile sig_atomic_t MarkSet, WantDie;
 
 static int	allowaddr(char *);
 static void	cfline(const char *, struct filed *,
@@ -332,12 +347,12 @@ static void	dodie(int);
 static void	dofsync(void);
 static void	domark(int);
 static void	fprintlog(struct filed *, int, const char *);
-static int	*socksetup(int, char *);
 static void	init(int);
 static void	logerror(const char *);
 static void	logmsg(int, const char *, const char *, int);
 static void	log_deadchild(pid_t, int, const char *);
 static void	markit(void);
+static int	socksetup(struct peer *);
 static int	skip_message(const char *, const char *, int);
 static void	printline(const char *, char *, int);
 static void	printsys(char *);
@@ -368,31 +383,31 @@ close_filed(struct filed *f)
 int
 main(int argc, char *argv[])
 {
-	int ch, i, fdsrmax = 0, l;
-	struct sockaddr_un sunx, fromunix;
-	struct sockaddr_storage frominet;
+	int ch, i, fdsrmax = 0;
+	struct sockaddr_storage ss;
 	fd_set *fdsr = NULL;
 	char line[MAXLINE + 1];
 	const char *hname;
 	struct timeval tv, *tvp;
 	struct sigaction sact;
-	struct host *host;
-	struct funix *fx, *fx1;
+	struct peer *pe;
+	struct socklist *sl;
 	sigset_t mask;
 	pid_t ppid = 1, spid;
-	socklen_t len;
+	socklen_t sslen;
+	char *p;
 
 	if (madvise(NULL, 0, MADV_PROTECT) != 0)
 		dprintf("madvise() failed: %s\n", strerror(errno));
 
-	STAILQ_INIT(&hqueue);
-
 	while ((ch = getopt(argc, argv, "468Aa:b:cCdf:Fkl:m:nNop:P:sS:Tuv"))
 	    != -1)
 		switch (ch) {
+#ifdef INET
 		case '4':
 			family = PF_INET;
 			break;
+#endif
 #ifdef INET6
 		case '6':
 			family = PF_INET6;
@@ -409,13 +424,21 @@ main(int argc, char *argv[])
 				usage();
 			break;
 		case 'b':
-		   {
-			if ((host = malloc(sizeof(struct host))) == NULL)
+			if ((pe = calloc(1, sizeof(*pe))) == NULL)
 				err(1, "malloc failed");
-			host->name = optarg;
-			STAILQ_INSERT_TAIL(&hqueue, host, next);
+			if ((p = strchr(optarg, ':')) == NULL) {
+				/* A hostname or filename only. */
+				pe->pe_name = optarg;
+				pe->pe_serv = "syslog";
+			} else {
+				/* The case of "name:service". */
+				*p++ = '\0';
+				pe->pe_serv = p;
+				pe->pe_name = (strlen(optarg) == 0) ?
+				    NULL : optarg;
+			}
+			STAILQ_INSERT_TAIL(&pqueue, pe, next);
 			break;
-		   }
 		case 'c':
 			no_compress++;
 			break;
@@ -458,17 +481,12 @@ main(int argc, char *argv[])
 				} else
 					errx(1, "invalid mode %s, exiting",
 					    optarg);
-			} else	/* doesn't begin with '/', and no ':' */
-				errx(1, "can't parse path %s", optarg);
-
-			if (strlen(name) >= sizeof(sunx.sun_path))
-				errx(1, "%s path too long, exiting", name);
-			if ((fx = malloc(sizeof(struct funix))) == NULL)
+			}
+			if ((pe = calloc(1, sizeof(*pe))) == NULL)
 				err(1, "malloc failed");
-			fx->s = -1;
-			fx->name = name;
-			fx->mode = mode;
-			STAILQ_INSERT_TAIL(&funixes, fx, next);
+			pe->pe_name = name;
+			pe->pe_mode = mode;
+			STAILQ_INSERT_TAIL(&pqueue, pe, next);
 			break;
 		   }
 		case 'm':		/* mark interval */
@@ -485,9 +503,7 @@ main(int argc, char *argv[])
 			use_bootfile = 1;
 			break;
 		case 'p':		/* path */
-			if (strlen(optarg) >= sizeof(sunx.sun_path))
-				errx(1, "%s path too long, exiting", optarg);
-			funix_default.name = optarg;
+			funix_default.pe_name = optarg;
 			break;
 		case 'P':		/* path for alt. PID */
 			PidFile = optarg;
@@ -496,9 +512,7 @@ main(int argc, char *argv[])
 			SecureMode++;
 			break;
 		case 'S':		/* path for privileged originator */
-			if (strlen(optarg) >= sizeof(sunx.sun_path))
-				errx(1, "%s path too long, exiting", optarg);
-			funix_secure.name = optarg;
+			funix_secure.pe_name = optarg;
 			break;
 		case 'T':
 			RemoteAddDate = 1;
@@ -514,6 +528,8 @@ main(int argc, char *argv[])
 		}
 	if ((argc -= optind) != 0)
 		usage();
+	STAILQ_FOREACH(pe, &pqueue, next)
+		socksetup(pe);
 
 	pfh = pidfile_open(PidFile, 0600, &spid);
 	if (pfh == NULL) {
@@ -529,16 +545,12 @@ main(int argc, char *argv[])
 			pidfile_remove(pfh);
 			exit(1);
 		}
-	} else if (Debug) {
+	} else if (Debug)
 		setlinebuf(stdout);
-	}
-
-	if (NumAllowed)
-		endservent();
 
 	consfile.f_type = F_CONSOLE;
-	(void)strlcpy(consfile.f_un.f_fname, ctty + sizeof _PATH_DEV - 1,
-	    sizeof(consfile.f_un.f_fname));
+	(void)strlcpy(consfile.fu_fname, ctty + sizeof _PATH_DEV - 1,
+	    sizeof(consfile.fu_fname));
 	(void)strlcpy(bootfile, getbootfile(), sizeof(bootfile));
 	(void)signal(SIGTERM, dodie);
 	(void)signal(SIGINT, Debug ? dodie : SIG_IGN);
@@ -561,69 +573,6 @@ main(int argc, char *argv[])
 
 	TAILQ_INIT(&deadq_head);
 
-#ifndef SUN_LEN
-#define SUN_LEN(unp) (strlen((unp)->sun_path) + 2)
-#endif
-	STAILQ_FOREACH_SAFE(fx, &funixes, next, fx1) {
-		(void)unlink(fx->name);
-		memset(&sunx, 0, sizeof(sunx));
-		sunx.sun_family = AF_LOCAL;
-		(void)strlcpy(sunx.sun_path, fx->name, sizeof(sunx.sun_path));
-		fx->s = socket(PF_LOCAL, SOCK_DGRAM, 0);
-		if (fx->s < 0 ||
-		    bind(fx->s, (struct sockaddr *)&sunx, SUN_LEN(&sunx)) < 0 ||
-		    chmod(fx->name, fx->mode) < 0) {
-			(void)snprintf(line, sizeof line,
-					"cannot create %s", fx->name);
-			logerror(line);
-			dprintf("cannot create %s (%d)\n", fx->name, errno);
-			if (fx == &funix_default || fx == &funix_secure)
-				die(0);
-			else {
-				STAILQ_REMOVE(&funixes, fx, funix, next);
-				continue;
-			}
-		}
-		increase_rcvbuf(fx->s);
-	}
-	if (SecureMode <= 1) {
-		if (STAILQ_EMPTY(&hqueue))
-			finet = socksetup(family, NULL);
-		STAILQ_FOREACH(host, &hqueue, next) {
-			int *finet0, total;
-			finet0 = socksetup(family, host->name);
-			if (finet0 && !finet) {
-				finet = finet0;
-			} else if (finet0 && finet) {
-				total = *finet0 + *finet + 1;
-				finet = realloc(finet, total * sizeof(int));
-				if (finet == NULL)
-					err(1, "realloc failed");
-				for (i = 1; i <= *finet0; i++) {
-					finet[(*finet)+i] = finet0[i];
-				}
-				*finet = total - 1;
-				free(finet0);
-			}
-		}
-	}
-
-	if (finet) {
-		if (SecureMode) {
-			for (i = 0; i < *finet; i++) {
-				if (shutdown(finet[i+1], SHUT_RD) < 0 &&
-				    errno != ENOTCONN) {
-					logerror("shutdown");
-					if (!Debug)
-						die(0);
-				}
-			}
-		} else {
-			dprintf("listening on inet and/or inet6 socket\n");
-		}
-		dprintf("sending on inet and/or inet6 socket\n");
-	}
-
 	if ((fklog = open(_PATH_KLOG, O_RDONLY|O_NONBLOCK, 0)) < 0)
 		dprintf("can't open %s (%d)\n", _PATH_KLOG, errno);
 
@@ -646,15 +595,10 @@ main(int argc, char *argv[])
 
 	if (fklog != -1 && fklog > fdsrmax)
 		fdsrmax = fklog;
-	if (finet && !SecureMode) {
-		for (i = 0; i < *finet; i++) {
-		    if (finet[i+1] != -1 && finet[i+1] > fdsrmax)
-			fdsrmax = finet[i+1];
-		}
+	STAILQ_FOREACH(sl, &shead, next) {
+		if (sl->sl_socket > fdsrmax)
+			fdsrmax = sl->sl_socket;
 	}
-	STAILQ_FOREACH(fx, &funixes, next)
-		if (fx->s > fdsrmax)
-			fdsrmax = fx->s;
 
 	fdsr = (fd_set *)calloc(howmany(fdsrmax+1, NFDBITS),
 	    sizeof(fd_mask));
@@ -672,16 +616,11 @@ main(int argc, char *argv[])
 
 		if (fklog != -1)
 			FD_SET(fklog, fdsr);
-		if (finet && !SecureMode) {
-			for (i = 0; i < *finet; i++) {
-				if (finet[i+1] != -1)
-					FD_SET(finet[i+1], fdsr);
-			}
+		STAILQ_FOREACH(sl, &shead, next) {
+			if (sl->sl_socket != -1)
+				FD_SET(sl->sl_socket, fdsr);
 		}
-		STAILQ_FOREACH(fx, &funixes, next)
-			FD_SET(fx->s, fdsr);
-
-		i = select(fdsrmax+1, fdsr, NULL, NULL,
+		i = select(fdsrmax + 1, fdsr, NULL, NULL,
 		    needdofsync ? &tv : tvp);
 		switch (i) {
 		case 0:
@@ -700,34 +639,40 @@ main(int argc, char *argv[])
 		}
 		if (fklog != -1 && FD_ISSET(fklog, fdsr))
 			readklog();
-		if (finet && !SecureMode) {
-			for (i = 0; i < *finet; i++) {
-				if (FD_ISSET(finet[i+1], fdsr)) {
-					len = sizeof(frominet);
-					l = recvfrom(finet[i+1], line, MAXLINE,
-					     0, (struct sockaddr *)&frominet,
-					     &len);
-					if (l > 0) {
-						line[l] = '\0';
-						hname = cvthname((struct sockaddr *)&frominet);
-						unmapped((struct sockaddr *)&frominet);
-						if (validate((struct sockaddr *)&frominet, hname))
-							printline(hname, line, RemoteAddDate ? ADDDATE : 0);
-					} else if (l < 0 && errno != EINTR)
-						logerror("recvfrom inet");
+		STAILQ_FOREACH(sl, &shead, next) {
+			int date, len;
+
+			if (FD_ISSET(sl->sl_socket, fdsr)) {
+				sslen = sizeof(ss);
+				dprintf("sslen(1) = %d\n", sslen);
+				len = recvfrom(sl->sl_socket, line,
+				    sizeof(line) - 1, 0,
+				    sstosa(&ss), &sslen);
+				dprintf("sslen(2) = %d\n", sslen);
+				if (len == 0)
+					continue;
+				if (len < 0) {
+					if (errno != EINTR)
+						logerror("recvfrom");
+					continue;
 				}
-			}
-		}
-		STAILQ_FOREACH(fx, &funixes, next) {
-			if (FD_ISSET(fx->s, fdsr)) {
-				len = sizeof(fromunix);
-				l = recvfrom(fx->s, line, MAXLINE, 0,
-				    (struct sockaddr *)&fromunix, &len);
-				if (l > 0) {
-					line[l] = '\0';
-					printline(LocalHostName, line, 0);
-				} else if (l < 0 && errno != EINTR)
-					logerror("recvfrom unix");
+				/* Received valid data. */
+				line[len] = '\0';
+				if (sl->sl_ss.ss_family == AF_LOCAL) {
+					hname = LocalHostName;
+					date = 0;
+				} else {
+					hname = cvthname(sstosa(&ss));
+					unmapped(sstosa(&ss));
+					if (validate(sstosa(&ss), hname) == 0)
+						hname = NULL;
+					date = RemoteAddDate ? ADDDATE : 0;
+				}
+				if (hname != NULL)
+					printline(hname, line, date);
+				else
+					dprintf("Invalid msg from "
+					    "%s was ignored.", hname);
 			}
 		}
 	}
@@ -741,18 +686,17 @@ unmapped(struct sockaddr *sa)
 	struct sockaddr_in6 *sin6;
 	struct sockaddr_in sin4;
 
-	if (sa->sa_family != AF_INET6)
-		return;
-	if (sa->sa_len != sizeof(struct sockaddr_in6) ||
-	    sizeof(sin4) > sa->sa_len)
+	if (sa == NULL ||
+	    sa->sa_family != AF_INET6 ||
+	    sa->sa_len != sizeof(*sin6))
 		return;
-	sin6 = (struct sockaddr_in6 *)sa;
+	sin6 = satosin6(sa);
 	if (!IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr))
 		return;
 
 	memset(&sin4, 0, sizeof(sin4));
 	sin4.sin_family = AF_INET;
-	sin4.sin_len = sizeof(struct sockaddr_in);
+	sin4.sin_len = sizeof(sin4);
 	memcpy(&sin4.sin_addr, &sin6->sin6_addr.s6_addr[12],
 	       sizeof(sin4.sin_addr));
 	sin4.sin_port = sin6->sin6_port;
@@ -1043,7 +987,7 @@ logmsg(int pri, const char *msg, const c
 		(void)sigsetmask(omask);
 		return;
 	}
-	for (f = Files; f; f = f->f_next) {
+	STAILQ_FOREACH(f, &fhead, next) {
 		/* skip messages that are incorrect priority */
 		if (!(((f->f_pcmp[fac] & PRI_EQ) && (f->f_pmask[fac] == prilev))
 		     ||((f->f_pcmp[fac] & PRI_LT) && (f->f_pmask[fac] < prilev))
@@ -1120,7 +1064,7 @@ dofsync(void)
 {
 	struct filed *f;
 
-	for (f = Files; f; f = f->f_next) {
+	STAILQ_FOREACH(f, &fhead, next) {
 		if ((f->f_type == F_FILE) &&
 		    (f->f_flags & FFLAG_NEEDSYNC)) {
 			f->f_flags &= ~FFLAG_NEEDSYNC;
@@ -1136,7 +1080,7 @@ fprintlog(struct filed *f, int flags, co
 	struct iovec iov[IOV_SIZE];
 	struct iovec *v;
 	struct addrinfo *r;
-	int i, l, lsent = 0;
+	int l, lsent = 0;
 	char line[MAXLINE + 1], repbuf[80], greetings[200], *wmsg = NULL;
 	char nul[] = "", space[] = " ", lf[] = "\n", crlf[] = "\r\n";
 	const char *msgret;
@@ -1244,12 +1188,11 @@ fprintlog(struct filed *f, int flags, co
 		break;
 
 	case F_FORW:
-		port = (int)ntohs(((struct sockaddr_in *)
-			    (f->f_un.f_forw.f_addr->ai_addr))->sin_port);
+		port = ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port);
 		if (port != 514) {
-			dprintf(" %s:%d\n", f->f_un.f_forw.f_hname, port);
+			dprintf(" %s:%d\n", f->fu_forw_hname, port);
 		} else {
-			dprintf(" %s\n", f->f_un.f_forw.f_hname);
+			dprintf(" %s\n", f->fu_forw_hname);
 		}
 		/* check for local vs remote messages */
 		if (strcasecmp(f->f_prevhost, LocalHostName))
@@ -1266,57 +1209,51 @@ fprintlog(struct filed *f, int flags, co
 		else if (l > MAXLINE)
 			l = MAXLINE;
 
-		if (finet) {
-			for (r = f->f_un.f_forw.f_addr; r; r = r->ai_next) {
-				for (i = 0; i < *finet; i++) {
-#if 0
-					/*
-					 * should we check AF first, or just
-					 * trial and error? FWD
-					 */
-					if (r->ai_family ==
-					    address_family_of(finet[i+1]))
-#endif
-					lsent = sendto(finet[i+1], line, l, 0,
-					    r->ai_addr, r->ai_addrlen);
-					if (lsent == l)
-						break;
-				}
-				if (lsent == l && !send_to_all)
+		for (r = f->fu_forw_addr; r; r = r->ai_next) {
+			struct socklist *sl;
+
+			STAILQ_FOREACH(sl, &shead, next) {
+				if (sl->sl_ss.ss_family == AF_LOCAL)
+					continue;
+				lsent = sendto(sl->sl_socket, line, l, 0,
+				    r->ai_addr, r->ai_addrlen);
+				if (lsent == l)
 					break;
 			}
-			dprintf("lsent/l: %d/%d\n", lsent, l);
-			if (lsent != l) {
-				int e = errno;
-				logerror("sendto");
-				errno = e;
-				switch (errno) {
-				case ENOBUFS:
-				case ENETDOWN:
-				case ENETUNREACH:
-				case EHOSTUNREACH:
-				case EHOSTDOWN:
-				case EADDRNOTAVAIL:
-					break;
-				/* case EBADF: */
-				/* case EACCES: */
-				/* case ENOTSOCK: */
-				/* case EFAULT: */
-				/* case EMSGSIZE: */
-				/* case EAGAIN: */
-				/* case ENOBUFS: */
-				/* case ECONNREFUSED: */
-				default:
-					dprintf("removing entry: errno=%d\n", e);
-					f->f_type = F_UNUSED;
-					break;
-				}
+			if (lsent == l && !send_to_all)
+				break;
+		}
+		dprintf("lsent/l: %d/%d\n", lsent, l);
+		if (lsent != l) {
+			int e = errno;
+			logerror("sendto");
+			errno = e;
+			switch (errno) {
+			case ENOBUFS:
+			case ENETDOWN:
+			case ENETUNREACH:
+			case EHOSTUNREACH:
+			case EHOSTDOWN:
+			case EADDRNOTAVAIL:
+				break;
+			/* case EBADF: */
+			/* case EACCES: */
+			/* case ENOTSOCK: */
+			/* case EFAULT: */
+			/* case EMSGSIZE: */
+			/* case EAGAIN: */
+			/* case ENOBUFS: */
+			/* case ECONNREFUSED: */
+			default:
+				dprintf("removing entry: errno=%d\n", e);
+				f->f_type = F_UNUSED;
+				break;
 			}
 		}
 		break;
 
 	case F_FILE:
-		dprintf(" %s\n", f->f_un.f_fname);
+		dprintf(" %s\n", f->fu_fname);
 		v->iov_base = lf;
 		v->iov_len = 1;
 		if (writev(f->f_file, iov, IOV_SIZE) < 0) {
@@ -1329,7 +1266,7 @@ fprintlog(struct filed *f, int flags, co
 				int e = errno;
 				close_filed(f);
 				errno = e;
-				logerror(f->f_un.f_fname);
+				logerror(f->fu_fname);
 			}
 		} else if ((flags & SYNC_FILE) && (f->f_flags & FFLAG_SYNC)) {
 			f->f_flags |= FFLAG_NEEDSYNC;
@@ -1338,26 +1275,26 @@ fprintlog(struct filed *f, int flags, co
 		break;
 
 	case F_PIPE:
-		dprintf(" %s\n", f->f_un.f_pipe.f_pname);
+		dprintf(" %s\n", f->fu_pipe_pname);
 		v->iov_base = lf;
 		v->iov_len = 1;
-		if (f->f_un.f_pipe.f_pid == 0) {
-			if ((f->f_file = p_open(f->f_un.f_pipe.f_pname,
-						&f->f_un.f_pipe.f_pid)) < 0) {
+		if (f->fu_pipe_pid == 0) {
+			if ((f->f_file = p_open(f->fu_pipe_pname,
+						&f->fu_pipe_pid)) < 0) {
 				f->f_type = F_UNUSED;
-				logerror(f->f_un.f_pipe.f_pname);
+				logerror(f->fu_pipe_pname);
 				break;
 			}
 		}
 		if (writev(f->f_file, iov, IOV_SIZE) < 0) {
 			int e = errno;
 			close_filed(f);
-			if (f->f_un.f_pipe.f_pid > 0)
-				deadq_enter(f->f_un.f_pipe.f_pid,
-					    f->f_un.f_pipe.f_pname);
-			f->f_un.f_pipe.f_pid = 0;
+			if (f->fu_pipe_pid > 0)
+				deadq_enter(f->fu_pipe_pid,
+					    f->fu_pipe_pname);
+			f->fu_pipe_pid = 0;
 			errno = e;
-			logerror(f->f_un.f_pipe.f_pname);
+			logerror(f->fu_pipe_pname);
 		}
 		break;
 
@@ -1369,12 +1306,12 @@ fprintlog(struct filed *f, int flags, co
 		/* FALLTHROUGH */
 
 	case F_TTY:
-		dprintf(" %s%s\n", _PATH_DEV, f->f_un.f_fname);
+		dprintf(" %s%s\n", _PATH_DEV, f->fu_fname);
 		v->iov_base = crlf;
 		v->iov_len = 2;
 
 		errno = 0;	/* ttymsg() only sometimes returns an errno */
-		if ((msgret = ttymsg(iov, IOV_SIZE, f->f_un.f_fname, 10))) {
+		if ((msgret = ttymsg(iov, IOV_SIZE, f->fu_fname, 10))) {
 			f->f_type = F_UNUSED;
 			logerror(msgret);
 		}
@@ -1423,9 +1360,9 @@ wallmsg(struct filed *f, struct iovec *i
 		}
 		/* should we send the message to this user? */
 		for (i = 0; i < MAXUNAMES; i++) {
-			if (!f->f_un.f_uname[i][0])
+			if (!f->fu_uname[i][0])
 				break;
-			if (!strcmp(f->f_un.f_uname[i], ut->ut_user)) {
+			if (!strcmp(f->fu_uname[i], ut->ut_user)) {
 				if ((p = ttymsg_check(iov, iovlen, ut->ut_line,
 				    TTYMSGTIME)) != NULL) {
 					errno = 0;	/* already in msg */
@@ -1476,20 +1413,18 @@ reapchild(int signo __unused)
 
 		/* First, look if it's a process from the dead queue. */
 		if (deadq_remove(pid))
-			goto oncemore;
+			continue;
 
 		/* Now, look in list of active processes. */
-		for (f = Files; f; f = f->f_next)
+		STAILQ_FOREACH(f, &fhead, next) {
 			if (f->f_type == F_PIPE &&
-			    f->f_un.f_pipe.f_pid == pid) {
+			    f->fu_pipe_pid == pid) {
 				close_filed(f);
-				f->f_un.f_pipe.f_pid = 0;
-				log_deadchild(pid, status,
-					      f->f_un.f_pipe.f_pname);
+				f->fu_pipe_pid = 0;
+				log_deadchild(pid, status, f->fu_pipe_pname);
 				break;
 			}
-	  oncemore:
-		continue;
+		}
 	}
 }
 
@@ -1503,9 +1438,9 @@ cvthname(struct sockaddr *f)
 	sigset_t omask, nmask;
 	static char hname[NI_MAXHOST], ip[NI_MAXHOST];
 
-	error = getnameinfo((struct sockaddr *)f,
-			    ((struct sockaddr *)f)->sa_len,
-			    ip, sizeof ip, NULL, 0, NI_NUMERICHOST);
+	dprintf("cvthname(%d) len = %d, %zu\n", f->sa_family, f->sa_len, sizeof(struct sockaddr_in6));
+	error = getnameinfo(f, f->sa_len, ip, sizeof(ip), NULL, 0,
+		    NI_NUMERICHOST);
 	dprintf("cvthname(%s)\n", ip);
 
 	if (error) {
@@ -1575,19 +1510,19 @@ static void
 die(int signo)
 {
 	struct filed *f;
-	struct funix *fx;
+	struct socklist *sl;
 	int was_initialized;
 	char buf[100];
 
 	was_initialized = Initialized;
 	Initialized = 0;	/* Don't log SIGCHLDs. */
-	for (f = Files; f != NULL; f = f->f_next) {
+	STAILQ_FOREACH(f, &fhead, next) {
 		/* flush any pending output */
 		if (f->f_prevcount)
 			fprintlog(f, 0, (char *)NULL);
-		if (f->f_type == F_PIPE && f->f_un.f_pipe.f_pid > 0) {
+		if (f->f_type == F_PIPE && f->fu_pipe_pid > 0) {
 			close_filed(f);
-			f->f_un.f_pipe.f_pid = 0;
+			f->fu_pipe_pid = 0;
 		}
 	}
 	Initialized = was_initialized;
@@ -1597,8 +1532,10 @@ die(int signo)
 		errno = 0;
 		logerror(buf);
 	}
-	STAILQ_FOREACH(fx, &funixes, next)
-		(void)unlink(fx->name);
+	STAILQ_FOREACH(sl, &shead, next) {
+		if (sl->sl_ss.ss_family == AF_LOCAL)
+			unlink(sl->sl_peer->pe_name);
+	}
 	pidfile_remove(pfh);
 
 	exit(1);
@@ -1626,7 +1563,7 @@ configfiles(const struct dirent *dp)
 }
 
 static void
-readconfigfile(FILE *cf, struct filed **nextp, int allow_includes)
+readconfigfile(FILE *cf, int allow_includes)
 {
 	FILE *cf2;
 	struct filed *f;
@@ -1686,7 +1623,7 @@ readconfigfile(FILE *cf, struct filed **
 				if (cf2 == NULL)
 					continue;
 				dprintf("reading %s\n", file);
-				readconfigfile(cf2, nextp, 0);
+				readconfigfile(cf2, 0);
 				fclose(cf2);
 			}
 			free(ent);
@@ -1749,8 +1686,7 @@ readconfigfile(FILE *cf, struct filed **
 			logerror("calloc");
 			exit(1);
 		}
-		*nextp = f;
-		nextp = &f->f_next;
+		STAILQ_INSERT_TAIL(&fhead, f, next);
 		cfline(cline, f, prog, host);
 	}
 }
@@ -1763,7 +1699,7 @@ init(int signo)
 {
 	int i;
 	FILE *cf;
-	struct filed *f, *next, **nextp;
+	struct filed *f;
 	char *p;
 	char oldLocalHostName[MAXHOSTNAMELEN];
 	char hostMsg[2*MAXHOSTNAMELEN+40];
@@ -1808,7 +1744,7 @@ init(int signo)
 	 *  Close all open log files.
 	 */
 	Initialized = 0;
-	for (f = Files; f != NULL; f = next) {
+	STAILQ_FOREACH(f, &fhead, next) {
 		/* flush any pending output */
 		if (f->f_prevcount)
 			fprintlog(f, 0, (char *)NULL);
@@ -1821,42 +1757,47 @@ init(int signo)
 			close_filed(f);
 			break;
 		case F_PIPE:
-			if (f->f_un.f_pipe.f_pid > 0) {
+			if (f->fu_pipe_pid > 0) {
 				close_filed(f);
-				deadq_enter(f->f_un.f_pipe.f_pid,
-					    f->f_un.f_pipe.f_pname);
+				deadq_enter(f->fu_pipe_pid,
+					    f->fu_pipe_pname);
 			}
-			f->f_un.f_pipe.f_pid = 0;
+			f->fu_pipe_pid = 0;
 			break;
 		}
-		next = f->f_next;
-		if (f->f_program) free(f->f_program);
-		if (f->f_host) free(f->f_host);
-		free((char *)f);
 	}
-	Files = NULL;
-	nextp = &Files;
+	while(!STAILQ_EMPTY(&fhead)) {
+		f = STAILQ_FIRST(&fhead);
+		STAILQ_REMOVE_HEAD(&fhead, next);
+		free(f->f_program);
+		free(f->f_host);
+		free(f);
+	}
 
 	/* open the configuration file */
 	if ((cf = fopen(ConfFile, "r")) == NULL) {
 		dprintf("cannot open %s\n", ConfFile);
-		*nextp = (struct filed *)calloc(1, sizeof(*f));
-		if (*nextp == NULL) {
+		f = calloc(1, sizeof(*f));
+		if (f == NULL) {
 			logerror("calloc");
 			exit(1);
 		}
-		cfline("*.ERR\t/dev/console", *nextp, "*", "*");
-		(*nextp)->f_next = (struct filed *)calloc(1, sizeof(*f));
-		if ((*nextp)->f_next == NULL) {
+		cfline("*.ERR\t/dev/console", f, "*", "*");
+		STAILQ_INSERT_TAIL(&fhead, f, next);
+
+		f = calloc(1, sizeof(*f));
+		if (f == NULL) {
 			logerror("calloc");
 			exit(1);
 		}
-		cfline("*.PANIC\t*", (*nextp)->f_next, "*", "*");
+		cfline("*.PANIC\t*", f, "*", "*");
+		STAILQ_INSERT_TAIL(&fhead, f, next);
+
 		Initialized = 1;
 		return;
 	}
 
-	readconfigfile(cf, &Files, 1);
+	readconfigfile(cf, 1);
 
 	/* close the configuration file */
 	(void)fclose(cf);
@@ -1865,7 +1806,7 @@ init(int signo)
 
 	if (Debug) {
 		int port;
-		for (f = Files; f; f = f->f_next) {
+		STAILQ_FOREACH(f, &fhead, next) {
 			for (i = 0; i <= LOG_NFACILITIES; i++)
 				if (f->f_pmask[i] == INTERNAL_NOPRI)
 					printf("X ");
@@ -1874,32 +1815,31 @@ init(int signo)
 			printf("%s: ", TypeNames[f->f_type]);
 			switch (f->f_type) {
 			case F_FILE:
-				printf("%s", f->f_un.f_fname);
+				printf("%s", f->fu_fname);
 				break;
 
 			case F_CONSOLE:
 			case F_TTY:
-				printf("%s%s", _PATH_DEV, f->f_un.f_fname);
+				printf("%s%s", _PATH_DEV, f->fu_fname);
 				break;
 
 			case F_FORW:
-				port = (int)ntohs(((struct sockaddr_in *)
-				    (f->f_un.f_forw.f_addr->ai_addr))->sin_port);
+				port = ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port);
 				if (port != 514) {
 					printf("%s:%d",
-						f->f_un.f_forw.f_hname, port);
+						f->fu_forw_hname, port);
 				} else {
-					printf("%s", f->f_un.f_forw.f_hname);
+					printf("%s", f->fu_forw_hname);
 				}

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

From owner-svn-src-all@freebsd.org  Mon Dec 12 19:46:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9E0DC74683;
 Mon, 12 Dec 2016 19:46:50 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9483EC1B;
 Mon, 12 Dec 2016 19:46:50 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCJknuu097913;
 Mon, 12 Dec 2016 19:46:49 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCJkn5G097912;
 Mon, 12 Dec 2016 19:46:49 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612121946.uBCJkn5G097912@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 19:46:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309934 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 19:46:50 -0000

Author: dteske
Date: Mon Dec 12 19:46:49 2016
New Revision: 309934
URL: https://svnweb.freebsd.org/changeset/base/309934

Log:
  Consolidate redirects into here documents, with proper code indentation

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:33:40 2016	(r309933)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:46:49 2016	(r309934)
@@ -69,9 +69,10 @@ country_set()
 			return $SUCCESS # Skip
 		fi
 	else
-		: > "$BSDINSTALL_TMPETC/rc.conf.net.wlan"
-		echo create_args_$WLAN_IFACE=\"$ifconfig_args\" >> \
-		    "$BSDINSTALL_TMPETC/rc.conf.net.wlan"
+		awk 'sub(/^\t\t/,"")||1' \
+			> "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF
+		create_args_$WLAN_IFACE="$ifconfig_args"
+		EOF
 	fi
 
 	return $SUCCESS
@@ -137,11 +138,13 @@ dialog_country_select()
 : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 
-echo "ctrl_interface=/var/run/wpa_supplicant" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
-echo "eapol_version=2" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
-echo "ap_scan=1" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
-echo "fast_reauth=1" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
-echo >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF
+ctrl_interface=/var/run/wpa_supplicant
+eapol_version=2
+ap_scan=1
+fast_reauth=1
+
+EOF
 
 #
 # Try to reach wpa_supplicant. If it isn't running and we can modify the
@@ -246,12 +249,15 @@ if echo $ENCRYPTION | grep -q 'PSK'; the
 		2>&1 1>&3 ) \
 	|| exec $0 $@
 	exec 3>&-
-echo "network={
-	ssid=\"$NETWORK\"
-	scan_ssid=$SCANSSID
-	psk=\"$PASS\"
-	priority=5
-}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+	awk 'sub(/^\t/,"")||1' \
+		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
+	network={
+		ssid="$NETWORK"
+		scan_ssid=$SCANSSID
+		psk="$PASS"
+		priority=5
+	}
+	EOF
 elif echo $ENCRYPTION | grep -q EAP; then
 	exec 3>&1
 	USERPASS=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \
@@ -262,20 +268,23 @@ elif echo $ENCRYPTION | grep -q EAP; the
 		2>&1 1>&3 ) \
 	|| exec $0 $@
 	exec 3>&-
-echo "network={
-	ssid=\"$NETWORK\"
-	scan_ssid=$SCANSSID
-	key_mgmt=WPA-EAP" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
-echo "$USERPASS" | awk '
-{
-	if (NR == 1) {
-		printf "	identity=\"%s\"\n", $1;
-	} else if (NR == 2) {
-		printf "	password=\"%s\"\n", $1;
+	awk 'sub(/^\t/,"")||1' \
+		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
+	network={
+		ssid="$NETWORK"
+		scan_ssid=$SCANSSID
+		key_mgmt=WPA-EAP$(
+		echo "$USERPASS" | awk '
+		{
+			if (NR == 1) {
+				printf "	identity=\"%s\"\n", $1;
+			} else if (NR == 2) {
+				printf "	password=\"%s\"\n", $1;
+			}
+		}' )
+		priority=5
 	}
-}' >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
-echo "	priority=5
-}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+	EOF
 elif echo $ENCRYPTION | grep -q WEP; then
 	exec 3>&1
 	WEPKEY=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \
@@ -284,28 +293,36 @@ elif echo $ENCRYPTION | grep -q WEP; the
 		"WEP Key 0" 2 0 "" 2 12 15 0 1 \
 		2>&1 1>&3 ) \
 	|| exec $0 $@
-echo "network={
-	ssid=\"$NETWORK\"
-	scan_ssid=$SCANSSID
-	key_mgmt=NONE
-	wep_key0=\"$WEPKEY\"
-	wep_tx_keyidx=0
-	priority=5
-}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+	awk 'sub(/^\t/,"")||1' \
+		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
+	network={
+		ssid="$NETWORK"
+		scan_ssid=$SCANSSID
+		key_mgmt=NONE
+		wep_key0="$WEPKEY"
+		wep_tx_keyidx=0
+		priority=5
+	}
+	EOF
 else	# Open
-echo "network={
-	ssid=\"$NETWORK\"
-	scan_ssid=$SCANSSID
-	key_mgmt=NONE
-	priority=5
-}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+	awk 'sub(/^\t/,"")||1' \
+		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
+	network={
+		ssid="$NETWORK"
+		scan_ssid=$SCANSSID
+		key_mgmt=NONE
+		priority=5
+	}
+	EOF
 fi
 
 # Connect to any open networks policy
-echo "network={
+cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF
+network={
 	priority=0
 	key_mgmt=NONE
-}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
+}
+EOF
 
 # Bring up new network
 if [ "$BSDINSTALL_CONFIGCURRENT" ]; then

From owner-svn-src-all@freebsd.org  Mon Dec 12 20:04:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68678C74AFE;
 Mon, 12 Dec 2016 20:04:33 +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 2922315F6;
 Mon, 12 Dec 2016 20:04:33 +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 uBCK4WBq005851;
 Mon, 12 Dec 2016 20:04:32 GMT (envelope-from manu@FreeBSD.org)
Received: (from manu@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCK4VHZ005845;
 Mon, 12 Dec 2016 20:04:31 GMT (envelope-from manu@FreeBSD.org)
Message-Id: <201612122004.uBCK4VHZ005845@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: manu set sender to
 manu@FreeBSD.org using -f
From: Emmanuel Vadot <manu@FreeBSD.org>
Date: Mon, 12 Dec 2016 20:04:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309935 - in head/sys: arm/lpc mips/atheros
 mips/atheros/ar531x mips/mediatek mips/rt305x
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 20:04:33 -0000

Author: manu
Date: Mon Dec 12 20:04:31 2016
New Revision: 309935
URL: https://svnweb.freebsd.org/changeset/base/309935

Log:
  Use the spibus accessor when applicable.
  
  MFC after:	3 days

Modified:
  head/sys/arm/lpc/lpc_spi.c
  head/sys/mips/atheros/ar531x/ar5315_spi.c
  head/sys/mips/atheros/ar71xx_spi.c
  head/sys/mips/mediatek/mtk_spi_v1.c
  head/sys/mips/mediatek/mtk_spi_v2.c
  head/sys/mips/rt305x/rt305x_spi.c

Modified: head/sys/arm/lpc/lpc_spi.c
==============================================================================
--- head/sys/arm/lpc/lpc_spi.c	Mon Dec 12 19:46:49 2016	(r309934)
+++ head/sys/arm/lpc/lpc_spi.c	Mon Dec 12 20:04:31 2016	(r309935)
@@ -141,12 +141,14 @@ static int
 lpc_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
 {
 	struct lpc_spi_softc *sc = device_get_softc(dev);
-	struct spibus_ivar *devi = SPIBUS_IVAR(child);
+	uint32_t cs;
 	uint8_t *in_buf, *out_buf;
 	int i;
 
+	spibus_get_cs(child, &cs);
+
 	/* Set CS active */
-	lpc_gpio_set_state(child, devi->cs, 0);
+	lpc_gpio_set_state(child, cs, 0);
 
 	/* Wait for FIFO to be ready */
 	while ((lpc_spi_read_4(sc, LPC_SSP_SR) & LPC_SSP_SR_TNF) == 0);
@@ -168,7 +170,7 @@ lpc_spi_transfer(device_t dev, device_t 
 	}
 
 	/* Set CS inactive */
-	lpc_gpio_set_state(child, devi->cs, 1);
+	lpc_gpio_set_state(child, cs, 1);
 
 	return (0);
 }

Modified: head/sys/mips/atheros/ar531x/ar5315_spi.c
==============================================================================
--- head/sys/mips/atheros/ar531x/ar5315_spi.c	Mon Dec 12 19:46:49 2016	(r309934)
+++ head/sys/mips/atheros/ar531x/ar5315_spi.c	Mon Dec 12 20:04:31 2016	(r309935)
@@ -155,9 +155,8 @@ ar5315_spi_transfer(device_t dev, device
 {
 	struct ar5315_spi_softc *sc;
 	uint8_t *buf_in, *buf_out;
-	struct spibus_ivar *devi = SPIBUS_IVAR(child);
 	int lin, lout;
-	uint32_t ctl, cnt, op, rdat;
+	uint32_t ctl, cnt, op, rdat, cs;
 	int i, j;
 
 	sc = device_get_softc(dev);
@@ -165,8 +164,10 @@ ar5315_spi_transfer(device_t dev, device
 	if (sc->sc_debug & 0x8000)
 		printf("ar5315_spi_transfer: CMD ");
 
+	spibus_get_cs(child, &cs);
+
 	/* Open SPI controller interface */
-	ar5315_spi_chip_activate(sc, devi->cs);
+	ar5315_spi_chip_activate(sc, cs);
 
 	do {
 		ctl = SPI_READ(sc, ARSPI_REG_CTL);
@@ -243,7 +244,7 @@ ar5315_spi_transfer(device_t dev, device
 		}
 	}
 
-	ar5315_spi_chip_deactivate(sc, devi->cs);
+	ar5315_spi_chip_deactivate(sc, cs);
 	/*
 	 * Close SPI controller interface, restore flash memory mapped access.
 	 */

Modified: head/sys/mips/atheros/ar71xx_spi.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_spi.c	Mon Dec 12 19:46:49 2016	(r309934)
+++ head/sys/mips/atheros/ar71xx_spi.c	Mon Dec 12 20:04:31 2016	(r309935)
@@ -204,13 +204,15 @@ static int
 ar71xx_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
 {
 	struct ar71xx_spi_softc *sc;
+	uint32_t cs;
 	uint8_t *buf_in, *buf_out;
-	struct spibus_ivar *devi = SPIBUS_IVAR(child);
 	int i;
 
 	sc = device_get_softc(dev);
 
-	ar71xx_spi_chip_activate(sc, devi->cs);
+	spibus_get_cs(child, &cs);
+
+	ar71xx_spi_chip_activate(sc, cs);
 
 	KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, 
 	    ("TX/RX command sizes should be equal"));
@@ -223,7 +225,7 @@ ar71xx_spi_transfer(device_t dev, device
 	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] = ar71xx_spi_txrx(sc, devi->cs, buf_out[i]);
+		buf_in[i] = ar71xx_spi_txrx(sc, cs, buf_out[i]);
 
 	/*
 	 * Receive/transmit data (depends on  command)
@@ -231,9 +233,9 @@ ar71xx_spi_transfer(device_t dev, device
 	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] = ar71xx_spi_txrx(sc, devi->cs, buf_out[i]);
+		buf_in[i] = ar71xx_spi_txrx(sc, cs, buf_out[i]);
 
-	ar71xx_spi_chip_deactivate(sc, devi->cs);
+	ar71xx_spi_chip_deactivate(sc, cs);
 
 	return (0);
 }

Modified: head/sys/mips/mediatek/mtk_spi_v1.c
==============================================================================
--- head/sys/mips/mediatek/mtk_spi_v1.c	Mon Dec 12 19:46:49 2016	(r309934)
+++ head/sys/mips/mediatek/mtk_spi_v1.c	Mon Dec 12 20:04:31 2016	(r309935)
@@ -224,12 +224,14 @@ mtk_spi_transfer(device_t dev, device_t 
 {
 	struct mtk_spi_softc *sc;
 	uint8_t *buf, byte, *tx_buf;
-	struct spibus_ivar *devi = SPIBUS_IVAR(child);
+	uint32_t cs;
 	int i, sz, error = 0, write = 0;
 
 	sc = device_get_softc(dev);
 
-	if (devi->cs != 0)
+	spibus_get_cs(child, &cs);
+
+	if (cs != 0)
 		/* Only 1 CS */
 		return (ENXIO);
 

Modified: head/sys/mips/mediatek/mtk_spi_v2.c
==============================================================================
--- head/sys/mips/mediatek/mtk_spi_v2.c	Mon Dec 12 19:46:49 2016	(r309934)
+++ head/sys/mips/mediatek/mtk_spi_v2.c	Mon Dec 12 20:04:31 2016	(r309935)
@@ -229,12 +229,14 @@ mtk_spi_transfer(device_t dev, device_t 
 {
 	struct mtk_spi_softc *sc;
 	uint8_t *buf, byte, *tx_buf;
-	struct spibus_ivar *devi = SPIBUS_IVAR(child);
+	uint32_t cs;
 	int i, sz, error, write = 0;
 
 	sc = device_get_softc(dev);
 
-	if (devi->cs != 0)
+	spibus_get_cs(child, &cs);
+
+	if (cs != 0)
 		/* Only 1 CS */
 		return (ENXIO);
 

Modified: head/sys/mips/rt305x/rt305x_spi.c
==============================================================================
--- head/sys/mips/rt305x/rt305x_spi.c	Mon Dec 12 19:46:49 2016	(r309934)
+++ head/sys/mips/rt305x/rt305x_spi.c	Mon Dec 12 20:04:31 2016	(r309935)
@@ -218,13 +218,15 @@ static int
 rt305x_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
 {
 	struct rt305x_spi_softc *sc;
+	uint32_t cs;
 	uint8_t *buf, byte, *tx_buf;
-	struct spibus_ivar *devi = SPIBUS_IVAR(child);
 	int i, sz, error = 0, write = 0;
 
 	sc = device_get_softc(dev);
 
-	if (devi->cs != 0)
+	spibus_get_cs(child, &cs);
+
+	if (cs != 0)
 		/* Only 1 CS */
 		return (ENXIO);
 

From owner-svn-src-all@freebsd.org  Mon Dec 12 20:26:00 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93881C6E099;
 Mon, 12 Dec 2016 20:26:00 +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 634471BC;
 Mon, 12 Dec 2016 20:26:00 +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 uBCKPx7p014279;
 Mon, 12 Dec 2016 20:25:59 GMT (envelope-from pfg@FreeBSD.org)
Received: (from pfg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCKPxsk014278;
 Mon, 12 Dec 2016 20:25:59 GMT (envelope-from pfg@FreeBSD.org)
Message-Id: <201612122025.uBCKPxsk014278@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org
 using -f
From: "Pedro F. Giffuni" <pfg@FreeBSD.org>
Date: Mon, 12 Dec 2016 20:25:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309936 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 20:26:00 -0000

Author: pfg
Date: Mon Dec 12 20:25:59 2016
New Revision: 309936
URL: https://svnweb.freebsd.org/changeset/base/309936

Log:
  ed(1): Simplify some checks.
  
  The return type for both fread(3) and fwrite(3) cannot be negative, this
  renders some checks invalid and variable 'ct' unnecessary.
  Also bump 'len' to size_t to avoid signed/unsigned comparison warnings.

Modified:
  head/bin/ed/buf.c

Modified: head/bin/ed/buf.c
==============================================================================
--- head/bin/ed/buf.c	Mon Dec 12 20:04:31 2016	(r309935)
+++ head/bin/ed/buf.c	Mon Dec 12 20:25:59 2016	(r309936)
@@ -46,9 +46,9 @@ char *
 get_sbuf_line(line_t *lp)
 {
 	static char *sfbuf = NULL;	/* buffer */
-	static int sfbufsz = 0;		/* buffer size */
+	static size_t sfbufsz;		/* buffer size */
 
-	int len, ct;
+	size_t len;
 
 	if (lp == &buffer_head)
 		return NULL;
@@ -64,7 +64,7 @@ get_sbuf_line(line_t *lp)
 	}
 	len = lp->len;
 	REALLOC(sfbuf, sfbufsz, len + 1, NULL);
-	if ((ct = fread(sfbuf, sizeof(char), len, sfp)) <  0 || ct != len) {
+	if ((fread(sfbuf, sizeof(char), len, sfp)) != len) {
 		fprintf(stderr, "%s\n", strerror(errno));
 		errmsg = "cannot read temp file";
 		return NULL;
@@ -81,7 +81,7 @@ const char *
 put_sbuf_line(const char *cs)
 {
 	line_t *lp;
-	int len, ct;
+	size_t len;
 	const char *s;
 
 	if ((lp = (line_t *) malloc(sizeof(line_t))) == NULL) {
@@ -110,7 +110,7 @@ put_sbuf_line(const char *cs)
 		seek_write = 0;
 	}
 	/* assert: SPL1() */
-	if ((ct = fwrite(cs, sizeof(char), len, sfp)) < 0 || ct != len) {
+	if ((fwrite(cs, sizeof(char), len, sfp)) != len) {
 		sfseek = -1;
 		fprintf(stderr, "%s\n", strerror(errno));
 		errmsg = "cannot write temp file";

From owner-svn-src-all@freebsd.org  Mon Dec 12 20:41:28 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E6A8C6E6FA;
 Mon, 12 Dec 2016 20:41:28 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 38FD5CBA;
 Mon, 12 Dec 2016 20:41:28 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCKfRor018986;
 Mon, 12 Dec 2016 20:41:27 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCKfR21018985;
 Mon, 12 Dec 2016 20:41:27 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122041.uBCKfR21018985@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 20:41:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309937 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 20:41:28 -0000

Author: dteske
Date: Mon Dec 12 20:41:27 2016
New Revision: 309937
URL: https://svnweb.freebsd.org/changeset/base/309937

Log:
  Whitespace (dialog options separated to minimize diffs)

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 20:25:59 2016	(r309936)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 20:41:27 2016	(r309937)
@@ -60,9 +60,14 @@ country_set()
 			"$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 	fi
 	if [ "$error_str" ]; then
-		dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" \
-			--yes-label Change --no-label Ignore --yesno \
-			"Error while applying chosen settings ($error_str)" 0 0
+		dialog \
+			--backtitle "$DIALOG_BACKTITLE" \
+			--title "Error" \
+			--yes-label Change \
+			--no-label Ignore \
+			--yesno \
+			"Error while applying chosen settings ($error_str)" \
+			0 0
 		if [ $? -eq $DIALOG_OK ]; then
 			return $FAILURE # Restart
 		else
@@ -158,8 +163,11 @@ EOF
 # See if we succeeded
 wpa_cli ping >/dev/null 2>/dev/null
 if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then
-	dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \
-	"Wireless cannot be configured without making changes to the local system!" \ 0 0
+	dialog \
+		--backtitle "$DIALOG_BACKTITLE" \
+		--title "Error" \
+		--msgbox "Wireless cannot be configured without making changes to the local system!" \
+		0 0
 	exit 1
 fi
 
@@ -175,9 +183,11 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
-	dialog --backtitle "$DIALOG_BACKTITLE" --title "Regdomain/country" \
-	    --yesno "Change regdomain/country (now \
-	    $DEF_REGDOMAIN/$DEF_COUNTRY)?" 0 0
+	dialog \
+		--backtitle "$DIALOG_BACKTITLE" \
+		--title "Regdomain/country" \
+		--yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" \
+		0 0
 	if [ $? -eq 0 ]; then
 		while :
 		do
@@ -193,28 +203,41 @@ while :; do
 	SCANSSID=0
 	output=$( wpa_cli scan 2>&1 )
 	f_dprintf "%s" "$output"
-	dialog --backtitle "$DIALOG_BACKTITLE" --title "Scanning" \
-	    --ok-label "Skip" \
-	    --pause "Waiting 5 seconds to scan for wireless networks..." \
-	    9 40 5 || exit 1
+	dialog \
+		--backtitle "$DIALOG_BACKTITLE" \
+		--title "Scanning" \
+		--ok-label "Skip" \
+		--pause "Waiting 5 seconds to scan for wireless networks..." \
+		9 40 5 || exit 1
 
 	SCAN_RESULTS=$( wpa_cli scan_results )
-	NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' \
-	   '/..:..:..:..:..:../ {if (length($5) > 0) \
-	   printf("\"%s\"\t%s\n", $5, $4);}' | sort | uniq )
+	NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' '
+		/..:..:..:..:..:../ {
+			if (length($5) > 0)
+				printf("\"%s\"\t%s\n", $5, $4);
+		}
+	' | sort | uniq )
 
 	if [ ! "$NETWORKS" ]; then
-		dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" \
-		    --yesno "No wireless networks were found. Rescan?" 0 0 &&
-		    continue
+		dialog \
+			--backtitle "$DIALOG_BACKTITLE" \
+			--title "Error" \
+			--yesno "No wireless networks were found. Rescan?" \
+			0 0 && continue
 		exit 1
 	fi
 
 	exec 3>&1
-	NETWORK=$( sh -c "dialog --extra-button --extra-label \"Rescan\" \
-	    --backtitle \"$DIALOG_BACKTITLE\" --title \"Network Selection\" \
-	    --menu \"Select a wireless network to connect to.\" 0 0 0 \
-	    $(echo $NETWORKS | tr '\n' ' ')" 2>&1 1>&3 )
+	NETWORK=$( sh -c "dialog \
+		--extra-button \
+		--extra-label \"Rescan\" \
+		--backtitle \"$DIALOG_BACKTITLE\" \
+		--title \"Network Selection\" \
+		--menu \"Select a wireless network to connect to.\" \
+		0 0 0 \
+		$( echo $NETWORKS | tr '\n' ' ' )" \
+		2>&1 1>&3
+	)
 	case $? in
 	$DIALOG_OK)
 		break
@@ -224,9 +247,17 @@ while :; do
 		f_dialog_title "Network Selection"
 		f_dialog_yesno "Do you want to select the network manually?" || exit 1
 		f_dialog_input NETWORK "Enter SSID" || exit 1
-		ENCRYPTION=$( dialog --backtitle "$DIALOG_BACKTITLE" --title \
-			"$DIALOG_TITLE" --menu "Select encryption type" 0 0 0 \
-			"1 WPA/WPA2 PSK" "" "2 WPA/WPA2 EAP" "" "3 WEP" "" "0 None" "" 2>&1 1>&3 ) || exit 1
+		ENCRYPTION=$( dialog \
+			--backtitle "$DIALOG_BACKTITLE" \
+			--title "$DIALOG_TITLE" \
+			--menu "Select encryption type" \
+			0 0 0 \
+			"1 WPA/WPA2 PSK" "" \
+			"2 WPA/WPA2 EAP" "" \
+			"3 WEP" "" \
+			"0 None" "" \
+			2>&1 1>&3
+		) || exit 1
 		SCANSSID=1
 		f_dialog_title_restore
 		break
@@ -237,17 +268,21 @@ while :; do
 	exec 3>&-
 done
 
-[ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" | awk -F '\t' \
-    "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}" )
+[ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" |
+	awk -F '\t' "/^\"$NETWORK\"\t/ { printf(\"%s\n\", \\\$2 ); }" )
 
 if echo $ENCRYPTION | grep -q 'PSK'; then
 	exec 3>&1
-	PASS=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \
-	    --title "WPA Setup" --mixedform "" 0 0 0 \
+	PASS=$( dialog \
+		--insecure \
+		--backtitle "$DIALOG_BACKTITLE" \
+		--title "WPA Setup" \
+		--mixedform "" \
+		0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Password" 2 0 "" 2 12 15 63 1 \
-		2>&1 1>&3 ) \
-	|| exec $0 $@
+		2>&1 1>&3
+	) || exec $0 $@
 	exec 3>&-
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
@@ -260,13 +295,16 @@ if echo $ENCRYPTION | grep -q 'PSK'; the
 	EOF
 elif echo $ENCRYPTION | grep -q EAP; then
 	exec 3>&1
-	USERPASS=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \
-	    --title "WPA-Enterprise Setup" --mixedform "" 0 0 0 \
+	USERPASS=$( dialog \
+		--insecure \
+		--backtitle "$DIALOG_BACKTITLE" \
+		--title "WPA-Enterprise Setup" \
+		--mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Username" 2 0 "" 2 12 25 63 0 \
 		"Password" 3 0 "" 3 12 25 63 1 \
-		2>&1 1>&3 ) \
-	|| exec $0 $@
+		2>&1 1>&3
+	) || exec $0 $@
 	exec 3>&-
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
@@ -287,12 +325,15 @@ elif echo $ENCRYPTION | grep -q EAP; the
 	EOF
 elif echo $ENCRYPTION | grep -q WEP; then
 	exec 3>&1
-	WEPKEY=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \
-	    --title "WEP Setup" --mixedform "" 0 0 0 \
+	WEPKEY=$( dialog \
+		--insecure \
+		--backtitle "$DIALOG_BACKTITLE" \
+		--title "WEP Setup" \
+		--mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"WEP Key 0" 2 0 "" 2 12 15 0 1 \
-		2>&1 1>&3 ) \
-	|| exec $0 $@
+		2>&1 1>&3
+	) || exec $0 $@
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
 	network={
@@ -304,7 +345,7 @@ elif echo $ENCRYPTION | grep -q WEP; the
 		priority=5
 	}
 	EOF
-else	# Open
+else # Open
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
 	network={

From owner-svn-src-all@freebsd.org  Mon Dec 12 20:43:10 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DAF8C6E8CF;
 Mon, 12 Dec 2016 20:43:10 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 084C9F24;
 Mon, 12 Dec 2016 20:43:09 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCKh9vR021889;
 Mon, 12 Dec 2016 20:43:09 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCKh93e021888;
 Mon, 12 Dec 2016 20:43:09 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122043.uBCKh93e021888@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 20:43:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309938 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 20:43:10 -0000

Author: dteske
Date: Mon Dec 12 20:43:09 2016
New Revision: 309938
URL: https://svnweb.freebsd.org/changeset/base/309938

Log:
  Use provided API (change "dialog" to "$DIALOG")

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 20:41:27 2016	(r309937)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 20:43:09 2016	(r309938)
@@ -60,7 +60,7 @@ country_set()
 			"$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 	fi
 	if [ "$error_str" ]; then
-		dialog \
+		$DIALOG \
 			--backtitle "$DIALOG_BACKTITLE" \
 			--title "Error" \
 			--yes-label Change \
@@ -111,7 +111,7 @@ dialog_country_select()
 	f_dialog_menu_size height width rows \"Regdomain selection\" \
 		\"$DIALOG_BACKTITLE\" \"Select your regdomain.\" \
 		\"\" $regdomains
-	regdomain=$( sh -c "dialog \
+	regdomain=$( sh -c "$DIALOG \
 		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Regdomain selection\" \
 		--cancel-label \"Skip\" \
@@ -125,7 +125,7 @@ dialog_country_select()
 	f_dialog_menu_size height width rows \"Country selection\" \
 	    \"$DIALOG_BACKTITLE\" \"Select your country.\" \
 	    \"\" $countries
-	country=$( sh -c "dialog \
+	country=$( sh -c "$DIALOG \
 		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Country selection\" \
 		--cancel-label \"Skip\" \
@@ -157,13 +157,13 @@ EOF
 #
 (wpa_cli ping >/dev/null 2>/dev/null || ([ "$BSDINSTALL_CONFIGCURRENT" ] &&
 	wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) ||
-	(dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \
+	($DIALOG --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \
 	"Could not start wpa_supplicant!" 0 0; exit 1) || exit 1
 
 # See if we succeeded
 wpa_cli ping >/dev/null 2>/dev/null
 if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then
-	dialog \
+	$DIALOG \
 		--backtitle "$DIALOG_BACKTITLE" \
 		--title "Error" \
 		--msgbox "Wireless cannot be configured without making changes to the local system!" \
@@ -183,7 +183,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
-	dialog \
+	$DIALOG \
 		--backtitle "$DIALOG_BACKTITLE" \
 		--title "Regdomain/country" \
 		--yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" \
@@ -203,7 +203,7 @@ while :; do
 	SCANSSID=0
 	output=$( wpa_cli scan 2>&1 )
 	f_dprintf "%s" "$output"
-	dialog \
+	$DIALOG \
 		--backtitle "$DIALOG_BACKTITLE" \
 		--title "Scanning" \
 		--ok-label "Skip" \
@@ -219,7 +219,7 @@ while :; do
 	' | sort | uniq )
 
 	if [ ! "$NETWORKS" ]; then
-		dialog \
+		$DIALOG \
 			--backtitle "$DIALOG_BACKTITLE" \
 			--title "Error" \
 			--yesno "No wireless networks were found. Rescan?" \
@@ -228,7 +228,7 @@ while :; do
 	fi
 
 	exec 3>&1
-	NETWORK=$( sh -c "dialog \
+	NETWORK=$( sh -c "$DIALOG \
 		--extra-button \
 		--extra-label \"Rescan\" \
 		--backtitle \"$DIALOG_BACKTITLE\" \
@@ -247,7 +247,7 @@ while :; do
 		f_dialog_title "Network Selection"
 		f_dialog_yesno "Do you want to select the network manually?" || exit 1
 		f_dialog_input NETWORK "Enter SSID" || exit 1
-		ENCRYPTION=$( dialog \
+		ENCRYPTION=$( $DIALOG \
 			--backtitle "$DIALOG_BACKTITLE" \
 			--title "$DIALOG_TITLE" \
 			--menu "Select encryption type" \
@@ -273,7 +273,7 @@ done
 
 if echo $ENCRYPTION | grep -q 'PSK'; then
 	exec 3>&1
-	PASS=$( dialog \
+	PASS=$( $DIALOG \
 		--insecure \
 		--backtitle "$DIALOG_BACKTITLE" \
 		--title "WPA Setup" \
@@ -295,7 +295,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the
 	EOF
 elif echo $ENCRYPTION | grep -q EAP; then
 	exec 3>&1
-	USERPASS=$( dialog \
+	USERPASS=$( $DIALOG \
 		--insecure \
 		--backtitle "$DIALOG_BACKTITLE" \
 		--title "WPA-Enterprise Setup" \
@@ -325,7 +325,7 @@ elif echo $ENCRYPTION | grep -q EAP; the
 	EOF
 elif echo $ENCRYPTION | grep -q WEP; then
 	exec 3>&1
-	WEPKEY=$( dialog \
+	WEPKEY=$( $DIALOG \
 		--insecure \
 		--backtitle "$DIALOG_BACKTITLE" \
 		--title "WEP Setup" \

From owner-svn-src-all@freebsd.org  Mon Dec 12 20:49:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6EC8C6EA0F;
 Mon, 12 Dec 2016 20:49:50 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9FC36114B;
 Mon, 12 Dec 2016 20:49:50 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCKnnv1022153;
 Mon, 12 Dec 2016 20:49:49 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCKnnXM022152;
 Mon, 12 Dec 2016 20:49:49 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122049.uBCKnnXM022152@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 20:49:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309939 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 20:49:50 -0000

Author: dteske
Date: Mon Dec 12 20:49:49 2016
New Revision: 309939
URL: https://svnweb.freebsd.org/changeset/base/309939

Log:
  Fix incorrect use of provided API
  The result of which was incorrectly sized menu dialogs

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 20:43:09 2016	(r309938)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 20:49:49 2016	(r309939)
@@ -108,9 +108,8 @@ dialog_country_select()
 		}
 	}' | sort -k 2 | tr '\n' ' ' )
 
-	f_dialog_menu_size height width rows \"Regdomain selection\" \
-		\"$DIALOG_BACKTITLE\" \"Select your regdomain.\" \
-		\"\" $regdomains
+	f_dialog_menu_size height width rows "Regdomain selection" \
+		"$DIALOG_BACKTITLE" "Select your regdomain." "" $regdomains
 	regdomain=$( sh -c "$DIALOG \
 		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Regdomain selection\" \
@@ -122,9 +121,8 @@ dialog_country_select()
 		$height $width $rows $regdomains"
 	)
 
-	f_dialog_menu_size height width rows \"Country selection\" \
-	    \"$DIALOG_BACKTITLE\" \"Select your country.\" \
-	    \"\" $countries
+	f_dialog_menu_size height width rows "Country selection" \
+		"$DIALOG_BACKTITLE" "Select your country." "" $countries
 	country=$( sh -c "$DIALOG \
 		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Country selection\" \

From owner-svn-src-all@freebsd.org  Mon Dec 12 20:54:21 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C930C6EC9F;
 Mon, 12 Dec 2016 20:54:21 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4D96E1715;
 Mon, 12 Dec 2016 20:54:21 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCKsK54026220;
 Mon, 12 Dec 2016 20:54:20 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCKsKCL026219;
 Mon, 12 Dec 2016 20:54:20 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122054.uBCKsKCL026219@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 20:54:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309940 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 20:54:21 -0000

Author: dteske
Date: Mon Dec 12 20:54:20 2016
New Revision: 309940
URL: https://svnweb.freebsd.org/changeset/base/309940

Log:
  Reorder dialog parameters based on commonality for readability

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 20:49:49 2016	(r309939)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 20:54:20 2016	(r309940)
@@ -61,8 +61,8 @@ country_set()
 	fi
 	if [ "$error_str" ]; then
 		$DIALOG \
-			--backtitle "$DIALOG_BACKTITLE" \
 			--title "Error" \
+			--backtitle "$DIALOG_BACKTITLE" \
 			--yes-label Change \
 			--no-label Ignore \
 			--yesno \
@@ -111,8 +111,8 @@ dialog_country_select()
 	f_dialog_menu_size height width rows "Regdomain selection" \
 		"$DIALOG_BACKTITLE" "Select your regdomain." "" $regdomains
 	regdomain=$( sh -c "$DIALOG \
-		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Regdomain selection\" \
+		--backtitle \"$DIALOG_BACKTITLE\" \
 		--cancel-label \"Skip\" \
 		--default-item \"$default_regdomain\" \
 		--no-items \
@@ -124,8 +124,8 @@ dialog_country_select()
 	f_dialog_menu_size height width rows "Country selection" \
 		"$DIALOG_BACKTITLE" "Select your country." "" $countries
 	country=$( sh -c "$DIALOG \
-		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Country selection\" \
+		--backtitle \"$DIALOG_BACKTITLE\" \
 		--cancel-label \"Skip\" \
 		--default-item \"$default_country\" \
 		--stdout \
@@ -162,8 +162,8 @@ EOF
 wpa_cli ping >/dev/null 2>/dev/null
 if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then
 	$DIALOG \
-		--backtitle "$DIALOG_BACKTITLE" \
 		--title "Error" \
+		--backtitle "$DIALOG_BACKTITLE" \
 		--msgbox "Wireless cannot be configured without making changes to the local system!" \
 		0 0
 	exit 1
@@ -182,8 +182,8 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
 	$DIALOG \
-		--backtitle "$DIALOG_BACKTITLE" \
 		--title "Regdomain/country" \
+		--backtitle "$DIALOG_BACKTITLE" \
 		--yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" \
 		0 0
 	if [ $? -eq 0 ]; then
@@ -202,8 +202,8 @@ while :; do
 	output=$( wpa_cli scan 2>&1 )
 	f_dprintf "%s" "$output"
 	$DIALOG \
-		--backtitle "$DIALOG_BACKTITLE" \
 		--title "Scanning" \
+		--backtitle "$DIALOG_BACKTITLE" \
 		--ok-label "Skip" \
 		--pause "Waiting 5 seconds to scan for wireless networks..." \
 		9 40 5 || exit 1
@@ -218,8 +218,8 @@ while :; do
 
 	if [ ! "$NETWORKS" ]; then
 		$DIALOG \
-			--backtitle "$DIALOG_BACKTITLE" \
 			--title "Error" \
+			--backtitle "$DIALOG_BACKTITLE" \
 			--yesno "No wireless networks were found. Rescan?" \
 			0 0 && continue
 		exit 1
@@ -227,10 +227,10 @@ while :; do
 
 	exec 3>&1
 	NETWORK=$( sh -c "$DIALOG \
+		--title \"Network Selection\" \
+		--backtitle \"$DIALOG_BACKTITLE\" \
 		--extra-button \
 		--extra-label \"Rescan\" \
-		--backtitle \"$DIALOG_BACKTITLE\" \
-		--title \"Network Selection\" \
 		--menu \"Select a wireless network to connect to.\" \
 		0 0 0 \
 		$( echo $NETWORKS | tr '\n' ' ' )" \
@@ -246,8 +246,8 @@ while :; do
 		f_dialog_yesno "Do you want to select the network manually?" || exit 1
 		f_dialog_input NETWORK "Enter SSID" || exit 1
 		ENCRYPTION=$( $DIALOG \
-			--backtitle "$DIALOG_BACKTITLE" \
 			--title "$DIALOG_TITLE" \
+			--backtitle "$DIALOG_BACKTITLE" \
 			--menu "Select encryption type" \
 			0 0 0 \
 			"1 WPA/WPA2 PSK" "" \
@@ -272,9 +272,9 @@ done
 if echo $ENCRYPTION | grep -q 'PSK'; then
 	exec 3>&1
 	PASS=$( $DIALOG \
-		--insecure \
-		--backtitle "$DIALOG_BACKTITLE" \
 		--title "WPA Setup" \
+		--backtitle "$DIALOG_BACKTITLE" \
+		--insecure \
 		--mixedform "" \
 		0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
@@ -294,9 +294,9 @@ if echo $ENCRYPTION | grep -q 'PSK'; the
 elif echo $ENCRYPTION | grep -q EAP; then
 	exec 3>&1
 	USERPASS=$( $DIALOG \
-		--insecure \
-		--backtitle "$DIALOG_BACKTITLE" \
 		--title "WPA-Enterprise Setup" \
+		--backtitle "$DIALOG_BACKTITLE" \
+		--insecure \
 		--mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Username" 2 0 "" 2 12 25 63 0 \
@@ -324,9 +324,9 @@ elif echo $ENCRYPTION | grep -q EAP; the
 elif echo $ENCRYPTION | grep -q WEP; then
 	exec 3>&1
 	WEPKEY=$( $DIALOG \
-		--insecure \
-		--backtitle "$DIALOG_BACKTITLE" \
 		--title "WEP Setup" \
+		--backtitle "$DIALOG_BACKTITLE" \
+		--insecure \
 		--mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"WEP Key 0" 2 0 "" 2 12 15 0 1 \

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:00:10 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7AC7C7333D;
 Mon, 12 Dec 2016 21:00:10 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5B64BBAD;
 Mon, 12 Dec 2016 21:00:10 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCL09qY029476;
 Mon, 12 Dec 2016 21:00:09 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCL09N8029475;
 Mon, 12 Dec 2016 21:00:09 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122100.uBCL09N8029475@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:00:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309941 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:00:10 -0000

Author: dteske
Date: Mon Dec 12 21:00:09 2016
New Revision: 309941
URL: https://svnweb.freebsd.org/changeset/base/309941

Log:
  Use provided API to centralize dialog title strings

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 20:54:20 2016	(r309940)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:00:09 2016	(r309941)
@@ -108,10 +108,11 @@ dialog_country_select()
 		}
 	}' | sort -k 2 | tr '\n' ' ' )
 
-	f_dialog_menu_size height width rows "Regdomain selection" \
+	f_dialog_title "Regdomain selection"
+	f_dialog_menu_size height width rows "$DIALOG_TITLE" \
 		"$DIALOG_BACKTITLE" "Select your regdomain." "" $regdomains
 	regdomain=$( sh -c "$DIALOG \
-		--title \"Regdomain selection\" \
+		--title \"$DIALOG_TITLE\" \
 		--backtitle \"$DIALOG_BACKTITLE\" \
 		--cancel-label \"Skip\" \
 		--default-item \"$default_regdomain\" \
@@ -121,10 +122,11 @@ dialog_country_select()
 		$height $width $rows $regdomains"
 	)
 
-	f_dialog_menu_size height width rows "Country selection" \
+	f_dialog_title "Country selection"
+	f_dialog_menu_size height width rows "$DIALOG_TITLE" \
 		"$DIALOG_BACKTITLE" "Select your country." "" $countries
 	country=$( sh -c "$DIALOG \
-		--title \"Country selection\" \
+		--title \"$DIALOG_TITLE\" \
 		--backtitle \"$DIALOG_BACKTITLE\" \
 		--cancel-label \"Skip\" \
 		--default-item \"$default_country\" \
@@ -181,8 +183,9 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
+	f_dialog_title "Regdomain/country"
 	$DIALOG \
-		--title "Regdomain/country" \
+		--title "$DIALOG_TITLE" \
 		--backtitle "$DIALOG_BACKTITLE" \
 		--yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" \
 		0 0
@@ -201,8 +204,9 @@ while :; do
 	SCANSSID=0
 	output=$( wpa_cli scan 2>&1 )
 	f_dprintf "%s" "$output"
+	f_dialog_title "Scanning"
 	$DIALOG \
-		--title "Scanning" \
+		--title "$DIALOG_TITLE" \
 		--backtitle "$DIALOG_BACKTITLE" \
 		--ok-label "Skip" \
 		--pause "Waiting 5 seconds to scan for wireless networks..." \
@@ -217,17 +221,19 @@ while :; do
 	' | sort | uniq )
 
 	if [ ! "$NETWORKS" ]; then
+		f_dialog_title "Error"
 		$DIALOG \
-			--title "Error" \
+			--title "$DIALOG_TITLE" \
 			--backtitle "$DIALOG_BACKTITLE" \
 			--yesno "No wireless networks were found. Rescan?" \
 			0 0 && continue
 		exit 1
 	fi
 
+	f_dialog_title "Network Selection"
 	exec 3>&1
 	NETWORK=$( sh -c "$DIALOG \
-		--title \"Network Selection\" \
+		--title \"$DIALOG_TITLE\" \
 		--backtitle \"$DIALOG_BACKTITLE\" \
 		--extra-button \
 		--extra-label \"Rescan\" \

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:01:21 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFAE4C7358A;
 Mon, 12 Dec 2016 21:01:21 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9BBFA12CB;
 Mon, 12 Dec 2016 21:01:21 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCL1K9Q029556;
 Mon, 12 Dec 2016 21:01:20 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCL1KTB029555;
 Mon, 12 Dec 2016 21:01:20 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122101.uBCL1KTB029555@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:01:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309942 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:01:21 -0000

Author: dteske
Date: Mon Dec 12 21:01:20 2016
New Revision: 309942
URL: https://svnweb.freebsd.org/changeset/base/309942

Log:
  Allow the script path to contain whitespace and special characters

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:00:09 2016	(r309941)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:01:20 2016	(r309942)
@@ -286,7 +286,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Password" 2 0 "" 2 12 15 63 1 \
 		2>&1 1>&3
-	) || exec $0 $@
+	) || exec "$0" $@
 	exec 3>&-
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
@@ -308,7 +308,7 @@ elif echo $ENCRYPTION | grep -q EAP; the
 		"Username" 2 0 "" 2 12 25 63 0 \
 		"Password" 3 0 "" 3 12 25 63 1 \
 		2>&1 1>&3
-	) || exec $0 $@
+	) || exec "$0" $@
 	exec 3>&-
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
@@ -337,7 +337,7 @@ elif echo $ENCRYPTION | grep -q WEP; the
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"WEP Key 0" 2 0 "" 2 12 15 0 1 \
 		2>&1 1>&3
-	) || exec $0 $@
+	) || exec "$0" $@
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
 	network={

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:02:35 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FA35C73603;
 Mon, 12 Dec 2016 21:02:35 +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 1A39F1852;
 Mon, 12 Dec 2016 21:02:35 +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 uBCL2YhU033286;
 Mon, 12 Dec 2016 21:02:34 GMT (envelope-from ken@FreeBSD.org)
Received: (from ken@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCL2Yof033285;
 Mon, 12 Dec 2016 21:02:34 GMT (envelope-from ken@FreeBSD.org)
Message-Id: <201612122102.uBCL2Yof033285@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org
 using -f
From: "Kenneth D. Merry" <ken@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:02:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309943 - stable/11/sbin/camcontrol
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:02:35 -0000

Author: ken
Date: Mon Dec 12 21:02:34 2016
New Revision: 309943
URL: https://svnweb.freebsd.org/changeset/base/309943

Log:
  MFC r307684, r307747
    ------------------------------------------------------------------------
    r307684 | ken | 2016-10-20 13:42:26 -0600 (Thu, 20 Oct 2016) | 13 lines
  
    For CCBs allocated on the stack, we need to clear the entire CCB, not just
    the header.  Otherwise stack garbage can lead to random flags getting set.
  
    This showed up as 'camcontrol rescan all' failing with EINVAL because the
    address type wasn't CAM_DATA_VADDR.
  
    sbin/camcontrol/camcontrol.c:
    	In rescan_or_reset_bus(), bzero the stack-allocated CCBs before
    	use instead of clearing the body.
  
    Sponsored by:	Spectra Logic
  
    ------------------------------------------------------------------------
    r307747 | ken | 2016-10-21 12:54:56 -0600 (Fri, 21 Oct 2016) | 27 lines
  
    Fix a problem in camcontrol(8) that cropped up with r307684.
  
    In r307684, I changed rescan_or_reset_bus() to bzero stack-allocated CCBs
    before sending them to the kernel because there was stack garbage in there
    that wound up meaning that bogus CCB flags were set.
  
    While this fixed the 'camcontrol rescan all' case (XPT_DEV_MATCH CCBs were
    failing previously), it broke the 'camcontrol rescan 0' (or any other
    number) case when INVARIANTS are turned on.  Rescanning a single bus
    reliably produced an assert in cam_periph_runccb():
  
    panic: cam_periph_runccb: ccb=0xfffff80044ffe000, func_code=0x708, flags=0xffffdde0
  
    The flags values don't make sense from the code.  Changing the CCBs in
    rescan_or_reset_bus() from stack to heap allocated avoids the problem.
  
    It would be better to understand why userland stack allocated CCBs don't
    work properly, since there may be other code that breaks if stack allocated
    CCBs don't work.
  
    sbin/camcontrol/camcontrol.c:
    	In rescan_or_reset_bus(), allocate the CCBs using malloc(3) instead
    	of on the stack to avoid an assertion in cam_periph_runccb().
  
    Sponsored by:	Spectra Logic
  
    ------------------------------------------------------------------------
  
  Sponsored by:	Spectra Logic

Modified:
  stable/11/sbin/camcontrol/camcontrol.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/camcontrol/camcontrol.c
==============================================================================
--- stable/11/sbin/camcontrol/camcontrol.c	Mon Dec 12 21:01:20 2016	(r309942)
+++ stable/11/sbin/camcontrol/camcontrol.c	Mon Dec 12 21:02:34 2016	(r309943)
@@ -3127,8 +3127,8 @@ dorescan_or_reset(int argc, char **argv,
 static int
 rescan_or_reset_bus(path_id_t bus, int rescan)
 {
-	union ccb ccb, matchccb;
-	int fd, retval;
+	union ccb *ccb = NULL, *matchccb = NULL;
+	int fd = -1, retval;
 	int bufsize;
 
 	retval = 0;
@@ -3139,35 +3139,41 @@ rescan_or_reset_bus(path_id_t bus, int r
 		return(1);
 	}
 
+	ccb = malloc(sizeof(*ccb));
+	if (ccb == NULL) {
+		warn("failed to allocate CCB");
+		retval = 1;
+		goto bailout;
+	}
+	bzero(ccb, sizeof(*ccb));
+
 	if (bus != CAM_BUS_WILDCARD) {
-		ccb.ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS;
-		ccb.ccb_h.path_id = bus;
-		ccb.ccb_h.target_id = CAM_TARGET_WILDCARD;
-		ccb.ccb_h.target_lun = CAM_LUN_WILDCARD;
-		ccb.crcn.flags = CAM_FLAG_NONE;
+		ccb->ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS;
+		ccb->ccb_h.path_id = bus;
+		ccb->ccb_h.target_id = CAM_TARGET_WILDCARD;
+		ccb->ccb_h.target_lun = CAM_LUN_WILDCARD;
+		ccb->crcn.flags = CAM_FLAG_NONE;
 
 		/* run this at a low priority */
-		ccb.ccb_h.pinfo.priority = 5;
+		ccb->ccb_h.pinfo.priority = 5;
 
-		if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
+		if (ioctl(fd, CAMIOCOMMAND, ccb) == -1) {
 			warn("CAMIOCOMMAND ioctl failed");
-			close(fd);
-			return(1);
+			retval = 1;
+			goto bailout;
 		}
 
-		if ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+		if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
 			fprintf(stdout, "%s of bus %d was successful\n",
 			    rescan ? "Re-scan" : "Reset", bus);
 		} else {
 			fprintf(stdout, "%s of bus %d returned error %#x\n",
 				rescan ? "Re-scan" : "Reset", bus,
-				ccb.ccb_h.status & CAM_STATUS_MASK);
+				ccb->ccb_h.status & CAM_STATUS_MASK);
 			retval = 1;
 		}
 
-		close(fd);
-		return(retval);
-
+		goto bailout;
 	}
 
 
@@ -3181,58 +3187,64 @@ 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.
 	 */
-	CCB_CLEAR_ALL_EXCEPT_HDR(&matchccb.cdm);
-	matchccb.ccb_h.func_code = XPT_DEV_MATCH;
-	matchccb.ccb_h.path_id = CAM_BUS_WILDCARD;
+	matchccb = malloc(sizeof(*matchccb));
+	if (matchccb == NULL) {
+		warn("failed to allocate CCB");
+		retval = 1;
+		goto bailout;
+	}
+	bzero(matchccb, sizeof(*matchccb));
+	matchccb->ccb_h.func_code = XPT_DEV_MATCH;
+	matchccb->ccb_h.path_id = CAM_BUS_WILDCARD;
 	bufsize = sizeof(struct dev_match_result) * 20;
-	matchccb.cdm.match_buf_len = bufsize;
-	matchccb.cdm.matches=(struct dev_match_result *)malloc(bufsize);
-	if (matchccb.cdm.matches == NULL) {
+	matchccb->cdm.match_buf_len = bufsize;
+	matchccb->cdm.matches=(struct dev_match_result *)malloc(bufsize);
+	if (matchccb->cdm.matches == NULL) {
 		warnx("can't malloc memory for matches");
 		retval = 1;
 		goto bailout;
 	}
-	matchccb.cdm.num_matches = 0;
+	matchccb->cdm.num_matches = 0;
 
-	matchccb.cdm.num_patterns = 1;
-	matchccb.cdm.pattern_buf_len = sizeof(struct dev_match_pattern);
+	matchccb->cdm.num_patterns = 1;
+	matchccb->cdm.pattern_buf_len = sizeof(struct dev_match_pattern);
 
-	matchccb.cdm.patterns = (struct dev_match_pattern *)malloc(
-		matchccb.cdm.pattern_buf_len);
-	if (matchccb.cdm.patterns == NULL) {
+	matchccb->cdm.patterns = (struct dev_match_pattern *)malloc(
+		matchccb->cdm.pattern_buf_len);
+	if (matchccb->cdm.patterns == NULL) {
 		warnx("can't malloc memory for patterns");
 		retval = 1;
 		goto bailout;
 	}
-	matchccb.cdm.patterns[0].type = DEV_MATCH_BUS;
-	matchccb.cdm.patterns[0].pattern.bus_pattern.flags = BUS_MATCH_ANY;
+	matchccb->cdm.patterns[0].type = DEV_MATCH_BUS;
+	matchccb->cdm.patterns[0].pattern.bus_pattern.flags = BUS_MATCH_ANY;
 
 	do {
 		unsigned int i;
 
-		if (ioctl(fd, CAMIOCOMMAND, &matchccb) == -1) {
+		if (ioctl(fd, CAMIOCOMMAND, matchccb) == -1) {
 			warn("CAMIOCOMMAND ioctl failed");
 			retval = 1;
 			goto bailout;
 		}
 
-		if ((matchccb.ccb_h.status != CAM_REQ_CMP)
-		 || ((matchccb.cdm.status != CAM_DEV_MATCH_LAST)
-		   && (matchccb.cdm.status != CAM_DEV_MATCH_MORE))) {
+		if ((matchccb->ccb_h.status != CAM_REQ_CMP)
+		 || ((matchccb->cdm.status != CAM_DEV_MATCH_LAST)
+		   && (matchccb->cdm.status != CAM_DEV_MATCH_MORE))) {
 			warnx("got CAM error %#x, CDM error %d\n",
-			      matchccb.ccb_h.status, matchccb.cdm.status);
+			      matchccb->ccb_h.status, matchccb->cdm.status);
 			retval = 1;
 			goto bailout;
 		}
 
-		for (i = 0; i < matchccb.cdm.num_matches; i++) {
+		for (i = 0; i < matchccb->cdm.num_matches; i++) {
 			struct bus_match_result *bus_result;
 
 			/* This shouldn't happen. */
-			if (matchccb.cdm.matches[i].type != DEV_MATCH_BUS)
+			if (matchccb->cdm.matches[i].type != DEV_MATCH_BUS)
 				continue;
 
-			bus_result = &matchccb.cdm.matches[i].result.bus_result;
+			bus_result =&matchccb->cdm.matches[i].result.bus_result;
 
 			/*
 			 * We don't want to rescan or reset the xpt bus.
@@ -3241,23 +3253,23 @@ rescan_or_reset_bus(path_id_t bus, int r
 			if (bus_result->path_id == CAM_XPT_PATH_ID)
 				continue;
 
-			ccb.ccb_h.func_code = rescan ? XPT_SCAN_BUS :
+			ccb->ccb_h.func_code = rescan ? XPT_SCAN_BUS :
 						       XPT_RESET_BUS;
-			ccb.ccb_h.path_id = bus_result->path_id;
-			ccb.ccb_h.target_id = CAM_TARGET_WILDCARD;
-			ccb.ccb_h.target_lun = CAM_LUN_WILDCARD;
-			ccb.crcn.flags = CAM_FLAG_NONE;
+			ccb->ccb_h.path_id = bus_result->path_id;
+			ccb->ccb_h.target_id = CAM_TARGET_WILDCARD;
+			ccb->ccb_h.target_lun = CAM_LUN_WILDCARD;
+			ccb->crcn.flags = CAM_FLAG_NONE;
 
 			/* run this at a low priority */
-			ccb.ccb_h.pinfo.priority = 5;
+			ccb->ccb_h.pinfo.priority = 5;
 
-			if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
+			if (ioctl(fd, CAMIOCOMMAND, ccb) == -1) {
 				warn("CAMIOCOMMAND ioctl failed");
 				retval = 1;
 				goto bailout;
 			}
 
-			if ((ccb.ccb_h.status & CAM_STATUS_MASK) ==CAM_REQ_CMP){
+			if ((ccb->ccb_h.status & CAM_STATUS_MASK)==CAM_REQ_CMP){
 				fprintf(stdout, "%s of bus %d was successful\n",
 					rescan? "Re-scan" : "Reset",
 					bus_result->path_id);
@@ -3270,22 +3282,24 @@ rescan_or_reset_bus(path_id_t bus, int r
 				fprintf(stderr, "%s of bus %d returned error "
 					"%#x\n", rescan? "Re-scan" : "Reset",
 					bus_result->path_id,
-					ccb.ccb_h.status & CAM_STATUS_MASK);
+					ccb->ccb_h.status & CAM_STATUS_MASK);
 				retval = 1;
 			}
 		}
-	} while ((matchccb.ccb_h.status == CAM_REQ_CMP)
-		 && (matchccb.cdm.status == CAM_DEV_MATCH_MORE));
+	} while ((matchccb->ccb_h.status == CAM_REQ_CMP)
+		 && (matchccb->cdm.status == CAM_DEV_MATCH_MORE));
 
 bailout:
 
 	if (fd != -1)
 		close(fd);
 
-	if (matchccb.cdm.patterns != NULL)
-		free(matchccb.cdm.patterns);
-	if (matchccb.cdm.matches != NULL)
-		free(matchccb.cdm.matches);
+	if (matchccb != NULL) {
+		free(matchccb->cdm.patterns);
+		free(matchccb->cdm.matches);
+		free(matchccb);
+	}
+	free(ccb);
 
 	return(retval);
 }

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:04:12 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86DCAC736D6;
 Mon, 12 Dec 2016 21:04:12 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 566791A12;
 Mon, 12 Dec 2016 21:04:12 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCL4B9S033379;
 Mon, 12 Dec 2016 21:04:11 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCL4BTp033378;
 Mon, 12 Dec 2016 21:04:11 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122104.uBCL4BTp033378@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:04:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309944 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:04:12 -0000

Author: dteske
Date: Mon Dec 12 21:04:11 2016
New Revision: 309944
URL: https://svnweb.freebsd.org/changeset/base/309944

Log:
  Fix invalid parameter expansion (change $@ to "$@")
  
  Without quotes, $@ loses its special meanining (see below)
  
  % sh -c 'echo $@' /bin/sh "   1   " "   2   "
  1 2
  % sh -c 'echo "$@"' /bin/sh "   1   " "   2   "
     1       2
  
  The quotes are required to get ARGV to be unperterped

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:02:34 2016	(r309943)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:04:11 2016	(r309944)
@@ -286,7 +286,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Password" 2 0 "" 2 12 15 63 1 \
 		2>&1 1>&3
-	) || exec "$0" $@
+	) || exec "$0" "$@"
 	exec 3>&-
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
@@ -308,7 +308,7 @@ elif echo $ENCRYPTION | grep -q EAP; the
 		"Username" 2 0 "" 2 12 25 63 0 \
 		"Password" 3 0 "" 3 12 25 63 1 \
 		2>&1 1>&3
-	) || exec "$0" $@
+	) || exec "$0" "$@"
 	exec 3>&-
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
@@ -337,7 +337,7 @@ elif echo $ENCRYPTION | grep -q WEP; the
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"WEP Key 0" 2 0 "" 2 12 15 0 1 \
 		2>&1 1>&3
-	) || exec "$0" $@
+	) || exec "$0" "$@"
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
 	network={

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:11:56 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B27CC7399C;
 Mon, 12 Dec 2016 21:11:56 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6AD5B1F23;
 Mon, 12 Dec 2016 21:11:56 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCLBt4u037171;
 Mon, 12 Dec 2016 21:11:55 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCLBtue037170;
 Mon, 12 Dec 2016 21:11:55 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122111.uBCLBtue037170@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:11:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309945 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:11:56 -0000

Author: dteske
Date: Mon Dec 12 21:11:55 2016
New Revision: 309945
URL: https://svnweb.freebsd.org/changeset/base/309945

Log:
  1 is the default descriptor for redirects without an fd prefix

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:04:11 2016	(r309944)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:11:55 2016	(r309945)
@@ -240,7 +240,7 @@ while :; do
 		--menu \"Select a wireless network to connect to.\" \
 		0 0 0 \
 		$( echo $NETWORKS | tr '\n' ' ' )" \
-		2>&1 1>&3
+		2>&1 >&3
 	)
 	case $? in
 	$DIALOG_OK)
@@ -260,7 +260,7 @@ while :; do
 			"2 WPA/WPA2 EAP" "" \
 			"3 WEP" "" \
 			"0 None" "" \
-			2>&1 1>&3
+			2>&1 >&3
 		) || exit 1
 		SCANSSID=1
 		f_dialog_title_restore
@@ -285,7 +285,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the
 		0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Password" 2 0 "" 2 12 15 63 1 \
-		2>&1 1>&3
+		2>&1 >&3
 	) || exec "$0" "$@"
 	exec 3>&-
 	awk 'sub(/^\t/,"")||1' \
@@ -307,7 +307,7 @@ elif echo $ENCRYPTION | grep -q EAP; the
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Username" 2 0 "" 2 12 25 63 0 \
 		"Password" 3 0 "" 3 12 25 63 1 \
-		2>&1 1>&3
+		2>&1 >&3
 	) || exec "$0" "$@"
 	exec 3>&-
 	awk 'sub(/^\t/,"")||1' \
@@ -336,7 +336,7 @@ elif echo $ENCRYPTION | grep -q WEP; the
 		--mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"WEP Key 0" 2 0 "" 2 12 15 0 1 \
-		2>&1 1>&3
+		2>&1 >&3
 	) || exec "$0" "$@"
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:16:38 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FC2FC73B23;
 Mon, 12 Dec 2016 21:16:38 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6F5C5264;
 Mon, 12 Dec 2016 21:16:38 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCLGbeh037381;
 Mon, 12 Dec 2016 21:16:37 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCLGbVV037380;
 Mon, 12 Dec 2016 21:16:37 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122116.uBCLGbVV037380@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:16:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309946 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:16:38 -0000

Author: dteske
Date: Mon Dec 12 21:16:37 2016
New Revision: 309946
URL: https://svnweb.freebsd.org/changeset/base/309946

Log:
  Use awk the following (more succinct) awk syntax:
  
  	condition1 { action1 }
  	condition2 { action2 }
  
  instead of the following syntax:
  
  	{
  		if (condition1) { action1 }
  		else if (condition2) { action2 }
  	}

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:11:55 2016	(r309945)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:16:37 2016	(r309946)
@@ -317,13 +317,9 @@ elif echo $ENCRYPTION | grep -q EAP; the
 		scan_ssid=$SCANSSID
 		key_mgmt=WPA-EAP$(
 		echo "$USERPASS" | awk '
-		{
-			if (NR == 1) {
-				printf "	identity=\"%s\"\n", $1;
-			} else if (NR == 2) {
-				printf "	password=\"%s\"\n", $1;
-			}
-		}' )
+			NR == 1 { printf "\n\t\tidentity=\"%s\"", $1; }
+			NR == 2 { printf "\n\t\tpassword=\"%s\"", $1; }
+		' )
 		priority=5
 	}
 	EOF

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:18:26 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18878C73CFA;
 Mon, 12 Dec 2016 21:18:26 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DC29F76D;
 Mon, 12 Dec 2016 21:18:25 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCLIPhY037484;
 Mon, 12 Dec 2016 21:18:25 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCLIPxg037483;
 Mon, 12 Dec 2016 21:18:25 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122118.uBCLIPxg037483@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:18:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309947 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:18:26 -0000

Author: dteske
Date: Mon Dec 12 21:18:24 2016
New Revision: 309947
URL: https://svnweb.freebsd.org/changeset/base/309947

Log:
  Remove unnecessary semi-colons

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:16:37 2016	(r309946)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:18:24 2016	(r309947)
@@ -216,7 +216,7 @@ while :; do
 	NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' '
 		/..:..:..:..:..:../ {
 			if (length($5) > 0)
-				printf("\"%s\"\t%s\n", $5, $4);
+				printf("\"%s\"\t%s\n", $5, $4)
 		}
 	' | sort | uniq )
 
@@ -273,7 +273,7 @@ while :; do
 done
 
 [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" |
-	awk -F '\t' "/^\"$NETWORK\"\t/ { printf(\"%s\n\", \\\$2 ); }" )
+	awk -F '\t' "/^\"$NETWORK\"\t/ { printf(\"%s\n\", \\\$2 ) }" )
 
 if echo $ENCRYPTION | grep -q 'PSK'; then
 	exec 3>&1
@@ -317,8 +317,8 @@ elif echo $ENCRYPTION | grep -q EAP; the
 		scan_ssid=$SCANSSID
 		key_mgmt=WPA-EAP$(
 		echo "$USERPASS" | awk '
-			NR == 1 { printf "\n\t\tidentity=\"%s\"", $1; }
-			NR == 2 { printf "\n\t\tpassword=\"%s\"", $1; }
+			NR == 1 { printf "\n\t\tidentity=\"%s\"", $1 }
+			NR == 2 { printf "\n\t\tpassword=\"%s\"", $1 }
 		' )
 		priority=5
 	}

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:20:58 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4234FC73DD3;
 Mon, 12 Dec 2016 21:20:58 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E9C44948;
 Mon, 12 Dec 2016 21:20:57 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCLKvlh038292;
 Mon, 12 Dec 2016 21:20:57 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCLKvCj038291;
 Mon, 12 Dec 2016 21:20:57 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122120.uBCLKvCj038291@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:20:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309948 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:20:58 -0000

Author: dteske
Date: Mon Dec 12 21:20:56 2016
New Revision: 309948
URL: https://svnweb.freebsd.org/changeset/base/309948

Log:
  Remove incomplete and unnecessary creation of fd3
  
  The provided API already provides a passthru descriptor and even
  gives you a varaible for referring to it.

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:18:24 2016	(r309947)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:20:56 2016	(r309948)
@@ -231,7 +231,6 @@ while :; do
 	fi
 
 	f_dialog_title "Network Selection"
-	exec 3>&1
 	NETWORK=$( sh -c "$DIALOG \
 		--title \"$DIALOG_TITLE\" \
 		--backtitle \"$DIALOG_BACKTITLE\" \
@@ -240,7 +239,7 @@ while :; do
 		--menu \"Select a wireless network to connect to.\" \
 		0 0 0 \
 		$( echo $NETWORKS | tr '\n' ' ' )" \
-		2>&1 >&3
+		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
 	case $? in
 	$DIALOG_OK)
@@ -260,7 +259,7 @@ while :; do
 			"2 WPA/WPA2 EAP" "" \
 			"3 WEP" "" \
 			"0 None" "" \
-			2>&1 >&3
+			2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 		) || exit 1
 		SCANSSID=1
 		f_dialog_title_restore
@@ -269,14 +268,12 @@ while :; do
 	$DIALOG_EXTRA) # Rescan
 		;;
 	esac
-	exec 3>&-
 done
 
 [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" |
 	awk -F '\t' "/^\"$NETWORK\"\t/ { printf(\"%s\n\", \\\$2 ) }" )
 
 if echo $ENCRYPTION | grep -q 'PSK'; then
-	exec 3>&1
 	PASS=$( $DIALOG \
 		--title "WPA Setup" \
 		--backtitle "$DIALOG_BACKTITLE" \
@@ -285,9 +282,8 @@ if echo $ENCRYPTION | grep -q 'PSK'; the
 		0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Password" 2 0 "" 2 12 15 63 1 \
-		2>&1 >&3
+		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	) || exec "$0" "$@"
-	exec 3>&-
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
 	network={
@@ -298,7 +294,6 @@ if echo $ENCRYPTION | grep -q 'PSK'; the
 	}
 	EOF
 elif echo $ENCRYPTION | grep -q EAP; then
-	exec 3>&1
 	USERPASS=$( $DIALOG \
 		--title "WPA-Enterprise Setup" \
 		--backtitle "$DIALOG_BACKTITLE" \
@@ -307,9 +302,8 @@ elif echo $ENCRYPTION | grep -q EAP; the
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Username" 2 0 "" 2 12 25 63 0 \
 		"Password" 3 0 "" 3 12 25 63 1 \
-		2>&1 >&3
+		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	) || exec "$0" "$@"
-	exec 3>&-
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF
 	network={
@@ -324,7 +318,6 @@ elif echo $ENCRYPTION | grep -q EAP; the
 	}
 	EOF
 elif echo $ENCRYPTION | grep -q WEP; then
-	exec 3>&1
 	WEPKEY=$( $DIALOG \
 		--title "WEP Setup" \
 		--backtitle "$DIALOG_BACKTITLE" \
@@ -332,7 +325,7 @@ elif echo $ENCRYPTION | grep -q WEP; the
 		--mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"WEP Key 0" 2 0 "" 2 12 15 0 1 \
-		2>&1 >&3
+		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	) || exec "$0" "$@"
 	awk 'sub(/^\t/,"")||1' \
 		>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:23:49 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E703C7400E;
 Mon, 12 Dec 2016 21:23:49 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B8729D41;
 Mon, 12 Dec 2016 21:23:48 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCLNlO0041360;
 Mon, 12 Dec 2016 21:23:47 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCLNlSQ041359;
 Mon, 12 Dec 2016 21:23:47 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122123.uBCLNlSQ041359@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:23:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309949 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:23:49 -0000

Author: dteske
Date: Mon Dec 12 21:23:47 2016
New Revision: 309949
URL: https://svnweb.freebsd.org/changeset/base/309949

Log:
  Utilize provided i18n strings

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:20:56 2016	(r309948)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:23:47 2016	(r309949)
@@ -61,7 +61,7 @@ country_set()
 	fi
 	if [ "$error_str" ]; then
 		$DIALOG \
-			--title "Error" \
+			--title "$msg_error" \
 			--backtitle "$DIALOG_BACKTITLE" \
 			--yes-label Change \
 			--no-label Ignore \
@@ -114,7 +114,7 @@ dialog_country_select()
 	regdomain=$( sh -c "$DIALOG \
 		--title \"$DIALOG_TITLE\" \
 		--backtitle \"$DIALOG_BACKTITLE\" \
-		--cancel-label \"Skip\" \
+		--cancel-label \"$msg_skip\" \
 		--default-item \"$default_regdomain\" \
 		--no-items \
 		--stdout \
@@ -128,7 +128,7 @@ dialog_country_select()
 	country=$( sh -c "$DIALOG \
 		--title \"$DIALOG_TITLE\" \
 		--backtitle \"$DIALOG_BACKTITLE\" \
-		--cancel-label \"Skip\" \
+		--cancel-label \"$msg_skip\" \
 		--default-item \"$default_country\" \
 		--stdout \
 		--menu \"Select your country.\" \
@@ -157,14 +157,14 @@ EOF
 #
 (wpa_cli ping >/dev/null 2>/dev/null || ([ "$BSDINSTALL_CONFIGCURRENT" ] &&
 	wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) ||
-	($DIALOG --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \
+	($DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \
 	"Could not start wpa_supplicant!" 0 0; exit 1) || exit 1
 
 # See if we succeeded
 wpa_cli ping >/dev/null 2>/dev/null
 if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then
 	$DIALOG \
-		--title "Error" \
+		--title "$msg_error" \
 		--backtitle "$DIALOG_BACKTITLE" \
 		--msgbox "Wireless cannot be configured without making changes to the local system!" \
 		0 0
@@ -208,7 +208,7 @@ while :; do
 	$DIALOG \
 		--title "$DIALOG_TITLE" \
 		--backtitle "$DIALOG_BACKTITLE" \
-		--ok-label "Skip" \
+		--ok-label "$msg_skip" \
 		--pause "Waiting 5 seconds to scan for wireless networks..." \
 		9 40 5 || exit 1
 
@@ -221,7 +221,7 @@ while :; do
 	' | sort | uniq )
 
 	if [ ! "$NETWORKS" ]; then
-		f_dialog_title "Error"
+		f_dialog_title "$msg_error"
 		$DIALOG \
 			--title "$DIALOG_TITLE" \
 			--backtitle "$DIALOG_BACKTITLE" \

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:26:37 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4CCCC740B0;
 Mon, 12 Dec 2016 21:26:37 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6EBA2F22;
 Mon, 12 Dec 2016 21:26:37 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCLQaN0041520;
 Mon, 12 Dec 2016 21:26:36 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCLQat4041519;
 Mon, 12 Dec 2016 21:26:36 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122126.uBCLQat4041519@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:26:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309950 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:26:37 -0000

Author: dteske
Date: Mon Dec 12 21:26:36 2016
New Revision: 309950
URL: https://svnweb.freebsd.org/changeset/base/309950

Log:
  Whitespace

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:23:47 2016	(r309949)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:26:36 2016	(r309950)
@@ -190,8 +190,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 		--yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" \
 		0 0
 	if [ $? -eq 0 ]; then
-		while :
-		do
+		while :; do
 			dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY"
 			if [ $? -eq $SUCCESS ]; then
 				break
@@ -242,9 +241,7 @@ while :; do
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
 	case $? in
-	$DIALOG_OK)
-		break
-		;;
+	$DIALOG_OK) break ;;
 	$DIALOG_CANCEL)
 		# here we ask if the user wants to select the network manually
 		f_dialog_title "Network Selection"
@@ -298,7 +295,8 @@ elif echo $ENCRYPTION | grep -q EAP; the
 		--title "WPA-Enterprise Setup" \
 		--backtitle "$DIALOG_BACKTITLE" \
 		--insecure \
-		--mixedform "" 0 0 0 \
+		--mixedform "" \
+		0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Username" 2 0 "" 2 12 25 63 0 \
 		"Password" 3 0 "" 3 12 25 63 1 \
@@ -322,7 +320,8 @@ elif echo $ENCRYPTION | grep -q WEP; the
 		--title "WEP Setup" \
 		--backtitle "$DIALOG_BACKTITLE" \
 		--insecure \
-		--mixedform "" 0 0 0 \
+		--mixedform "" \
+		0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"WEP Key 0" 2 0 "" 2 12 15 0 1 \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:27:30 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0047C74105;
 Mon, 12 Dec 2016 21:27:30 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7FA0A10A5;
 Mon, 12 Dec 2016 21:27:30 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCLRT6q041594;
 Mon, 12 Dec 2016 21:27:29 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCLRT6i041593;
 Mon, 12 Dec 2016 21:27:29 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122127.uBCLRT6i041593@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:27:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309951 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:27:30 -0000

Author: dteske
Date: Mon Dec 12 21:27:29 2016
New Revision: 309951
URL: https://svnweb.freebsd.org/changeset/base/309951

Log:
  Remove an unnecessary call to f_dialog_title_restore()

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:26:36 2016	(r309950)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:27:29 2016	(r309951)
@@ -259,7 +259,6 @@ while :; do
 			2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 		) || exit 1
 		SCANSSID=1
-		f_dialog_title_restore
 		break
 		;;
 	$DIALOG_EXTRA) # Rescan

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:29:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 185C4C7417A;
 Mon, 12 Dec 2016 21:29:50 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DC0E61284;
 Mon, 12 Dec 2016 21:29:49 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCLTn9j041732;
 Mon, 12 Dec 2016 21:29:49 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCLTnWY041731;
 Mon, 12 Dec 2016 21:29:49 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122129.uBCLTnWY041731@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:29:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309952 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:29:50 -0000

Author: dteske
Date: Mon Dec 12 21:29:48 2016
New Revision: 309952
URL: https://svnweb.freebsd.org/changeset/base/309952

Log:
  In awk, casting a variable as a boolean condition is the same as testing if
  the length of the variable contents is greater than zero
  
  This allows us to also move the secondary condition into the action clause

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:27:29 2016	(r309951)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:29:48 2016	(r309952)
@@ -213,10 +213,7 @@ while :; do
 
 	SCAN_RESULTS=$( wpa_cli scan_results )
 	NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' '
-		/..:..:..:..:..:../ {
-			if (length($5) > 0)
-				printf("\"%s\"\t%s\n", $5, $4)
-		}
+		/..:..:..:..:..:../ && $5 { printf("\"%s\"\t%s\n", $5, $4) }
 	' | sort | uniq )
 
 	if [ ! "$NETWORKS" ]; then

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:43:18 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAA4FC7457C;
 Mon, 12 Dec 2016 21:43:18 +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 954C41AD3;
 Mon, 12 Dec 2016 21:43:18 +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 uBCLhHOB049635;
 Mon, 12 Dec 2016 21:43:17 GMT (envelope-from bapt@FreeBSD.org)
Received: (from bapt@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCLhHZ9049634;
 Mon, 12 Dec 2016 21:43:17 GMT (envelope-from bapt@FreeBSD.org)
Message-Id: <201612122143.uBCLhHZ9049634@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bapt set sender to
 bapt@FreeBSD.org using -f
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:43:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309953 - stable/11/tools/build/mk
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:43:18 -0000

Author: bapt
Date: Mon Dec 12 21:43:17 2016
New Revision: 309953
URL: https://svnweb.freebsd.org/changeset/base/309953

Log:
  MFC r309797-r309802
  
  r309797:
  Add entries to remove timed files with make delete-old if WITHOUT_TIMED is set
  
  r309798:
  Also remove auditdistd files if src.conf has WITHOUT_AUDIT
  
  r309799:
  Respect WITHOUT_RBOOTD in src.conf when running make delete-old
  
  r309800:
  Respect WITHOUT_BOOTPARAMD in src.conf when running make delete-old
  
  r309801:
  Respect WITHOUT_BOOTPD in src.conf when running make delete-old
  
  r309802:
  Respect WITHOUT_FINGER in src.conf when running make delete-old
  
  PR:		213719, 213720, 213721, 213722, 213723, 213724
  Submitted by:	philippe.michel7@sfr.fr

Modified:
  stable/11/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- stable/11/tools/build/mk/OptionalObsoleteFiles.inc	Mon Dec 12 21:29:48 2016	(r309952)
+++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc	Mon Dec 12 21:43:17 2016	(r309953)
@@ -166,12 +166,15 @@ OLD_FILES+=usr/share/snmp/mibs/BEGEMOT-A
 .if ${MK_AUDIT} == no
 OLD_FILES+=usr/sbin/audit
 OLD_FILES+=usr/sbin/auditd
+OLD_FILES+=usr/sbin/auditdistd
 OLD_FILES+=usr/sbin/auditreduce
 OLD_FILES+=usr/sbin/praudit
 OLD_FILES+=usr/share/man/man1/auditreduce.1.gz
 OLD_FILES+=usr/share/man/man1/praudit.1.gz
+OLD_FILES+=usr/share/man/man5/auditdistd.conf.5.gz
 OLD_FILES+=usr/share/man/man8/audit.8.gz
 OLD_FILES+=usr/share/man/man8/auditd.8.gz
+OLD_FILES+=usr/share/man/man8/auditdistd.8.gz
 .endif
 
 .if ${MK_AUTHPF} == no
@@ -650,6 +653,24 @@ OLD_FILES+=usr/share/man/man8/zfsboot.8.
 OLD_FILES+=usr/share/man/man8/zfsloader.8.gz
 .endif
 
+.if ${MK_BOOTPARAMD} == no
+OLD_FILES+=usr/sbin/bootparamd
+OLD_FILES+=usr/share/man/man5/bootparams.5.gz
+OLD_FILES+=usr/share/man/man8/bootparamd.8.gz
+OLD_FILES+=usr/sbin/callbootd
+.endif
+
+.if ${MK_BOOTPD} == no
+OLD_FILES+=usr/libexec/bootpd
+OLD_FILES+=usr/share/man/man5/bootptab.5.gz
+OLD_FILES+=usr/share/man/man8/bootpd.8.gz
+OLD_FILES+=usr/libexec/bootpgw
+OLD_FILES+=usr/sbin/bootpef
+OLD_FILES+=usr/share/man/man8/bootpef.8.gz
+OLD_FILES+=usr/sbin/bootptest
+OLD_FILES+=usr/share/man/man8/bootptest.8.gz
+.endif
+
 .if ${MK_BSD_CPIO} == no
 OLD_FILES+=usr/bin/bsdcpio
 OLD_FILES+=usr/bin/cpio
@@ -1978,6 +1999,14 @@ OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/ee
 # to be filled in
 #.endif
 
+.if ${MK_FINGER} == no
+OLD_FILES+=usr/bin/finger
+OLD_FILES+=usr/share/man/man1/finger.1.gz
+OLD_FILES+=usr/share/man/man5/finger.conf.5.gz
+OLD_FILES+=usr/libexec/fingerd
+OLD_FILES+=usr/share/man/man8/fingerd.8.gz
+.endif
+
 .if ${MK_FLOPPY} == no
 OLD_FILES+=usr/sbin/fdcontrol
 OLD_FILES+=usr/sbin/fdformat
@@ -6777,6 +6806,11 @@ OLD_FILES+=usr/share/man/man8/quotaon.8.
 OLD_FILES+=usr/share/man/man8/repquota.8.gz
 .endif
 
+.if ${MK_RBOOTD} == no
+OLD_FILES+=usr/libexec/rbootd
+OLD_FILES+=usr/share/man/man8/rbootd.8.gz
+.endif
+
 .if ${MK_RCMDS} == no
 OLD_FILES+=bin/rcp
 OLD_FILES+=etc/rc.d/rwho
@@ -7998,6 +8032,13 @@ OLD_FILES+=usr/share/man/man1/colcrt.1.g
 OLD_FILES+=usr/share/man/man1/ul.1.gz
 .endif
 
+.if ${MK_TIMED} == no
+OLD_FILES+=usr/sbin/timed
+OLD_FILES+=usr/sbin/timedc
+OLD_FILES+=usr/share/man/man8/timed.8.gz
+OLD_FILES+=usr/share/man/man8/timedc.8.gz
+.endif
+
 .if ${MK_TOOLCHAIN} == no
 OLD_FILES+=usr/bin/addr2line
 OLD_FILES+=usr/bin/as

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:45:27 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1957FC7465C;
 Mon, 12 Dec 2016 21:45:27 +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 DCD2C1CF6;
 Mon, 12 Dec 2016 21:45:26 +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 uBCLjQiL049842;
 Mon, 12 Dec 2016 21:45:26 GMT (envelope-from bapt@FreeBSD.org)
Received: (from bapt@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCLjQwc049841;
 Mon, 12 Dec 2016 21:45:26 GMT (envelope-from bapt@FreeBSD.org)
Message-Id: <201612122145.uBCLjQwc049841@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bapt set sender to
 bapt@FreeBSD.org using -f
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:45:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309954 - stable/11/share/mk
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:45:27 -0000

Author: bapt
Date: Mon Dec 12 21:45:25 2016
New Revision: 309954
URL: https://svnweb.freebsd.org/changeset/base/309954

Log:
  MFC r309805:
  
  Make WITHOUT_CAPSICUM implying WITHOUT_CASPER
  
  PR:		214562
  Reported by:	dewayne@heuristicsystems.com.au

Modified:
  stable/11/share/mk/src.opts.mk
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/mk/src.opts.mk
==============================================================================
--- stable/11/share/mk/src.opts.mk	Mon Dec 12 21:43:17 2016	(r309953)
+++ stable/11/share/mk/src.opts.mk	Mon Dec 12 21:45:25 2016	(r309954)
@@ -286,6 +286,10 @@ MK_${var}:=	no
 # Force some options off if their dependencies are off.
 # Order is somewhat important.
 #
+.if ${MK_CAPSICUM} == "no"
+MK_CASPER:=	no
+.endif
+
 .if ${MK_LIBPTHREAD} == "no"
 MK_LIBTHR:=	no
 .endif

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:49:30 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FA43C74753;
 Mon, 12 Dec 2016 21:49:30 +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 F31861EF1;
 Mon, 12 Dec 2016 21:49:29 +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 uBCLnTK4050035;
 Mon, 12 Dec 2016 21:49:29 GMT (envelope-from bapt@FreeBSD.org)
Received: (from bapt@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCLnTcE050034;
 Mon, 12 Dec 2016 21:49:29 GMT (envelope-from bapt@FreeBSD.org)
Message-Id: <201612122149.uBCLnTcE050034@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bapt set sender to
 bapt@FreeBSD.org using -f
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:49:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r309955 - stable/11/share/man/man5
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:49:30 -0000

Author: bapt
Date: Mon Dec 12 21:49:29 2016
New Revision: 309955
URL: https://svnweb.freebsd.org/changeset/base/309955

Log:
  Regen after r309954

Modified:
  stable/11/share/man/man5/src.conf.5

Modified: stable/11/share/man/man5/src.conf.5
==============================================================================
--- stable/11/share/man/man5/src.conf.5	Mon Dec 12 21:45:25 2016	(r309954)
+++ stable/11/share/man/man5/src.conf.5	Mon Dec 12 21:49:29 2016	(r309955)
@@ -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
+.\" from FreeBSD: stable/11/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery
 .\" $FreeBSD$
-.Dd June 28, 2016
+.Dd December 12, 2016
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -94,56 +94,56 @@ The following list provides a name and s
 that can be used for source builds.
 .Bl -tag -width indent
 .It Va WITHOUT_ACCT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed
 Set to not build process accounting tools such as
 .Xr accton 8
 and
 .Xr sa 8 .
 .It Va WITHOUT_ACPI
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru
 Set to not build
 .Xr acpiconf 8 ,
 .Xr acpidump 8
 and related programs.
 .It Va WITHOUT_AMD
-.\" from FreeBSD: head/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr amd 8 ,
 and related programs.
 .It Va WITHOUT_APM
-.\" from FreeBSD: head/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr apm 8 ,
 .Xr apmd 8
 and related programs.
 .It Va WITHOUT_ASSERT_DEBUG
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru
 Set to compile programs and libraries without the
 .Xr assert 3
 checks.
 .It Va WITHOUT_AT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr at 1
 and related utilities.
 .It Va WITHOUT_ATM
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru
 Set to not build
 programs and libraries related to ATM networking.
 .It Va WITHOUT_AUDIT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru
 Set to not build audit support into system programs.
 .It Va WITHOUT_AUTHPF
-.\" from FreeBSD: head/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru
 Set to not build
 .Xr authpf 8 .
 .It Va WITHOUT_AUTOFS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_AUTOFS 296264 2016-03-01 11:36:10Z trasz
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_AUTOFS 296264 2016-03-01 11:36:10Z trasz
 Set to not build
 .Xr autofs 5
 related programs, libraries, and kernel modules.
 .It Va WITH_AUTO_OBJ
-.\" from FreeBSD: head/tools/build/options/WITH_AUTO_OBJ 284708 2015-06-22 20:21:57Z sjg
+.\" from FreeBSD: stable/11/tools/build/options/WITH_AUTO_OBJ 284708 2015-06-22 20:21:57Z sjg
 Enable automatic creation of objdirs.
 .Pp
 This must be set in the environment, make command line, or
@@ -151,14 +151,14 @@ This must be set in the environment, mak
 not
 .Pa /etc/src.conf .
 .It Va WITHOUT_BHYVE
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BHYVE 277727 2015-01-26 06:44:48Z ngie
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BHYVE 277727 2015-01-26 06:44:48Z ngie
 Set to not build or install
 .Xr bhyve 8 ,
 associated utilities, and examples.
 .Pp
 This option only affects amd64/amd64.
 .It Va WITHOUT_BINUTILS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 286332 2015-08-05 18:30:00Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BINUTILS 286332 2015-08-05 18:30:00Z emaste
 Set to not build or install binutils (as, ld, objcopy, and objdump ) as part
 of the normal system build.
 The resulting system cannot build programs from source.
@@ -166,14 +166,14 @@ The resulting system cannot build progra
 It is a default setting on
 arm64/aarch64.
 .It Va WITH_BINUTILS
-.\" from FreeBSD: head/tools/build/options/WITH_BINUTILS 295491 2016-02-11 00:14:00Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITH_BINUTILS 295491 2016-02-11 00:14:00Z emaste
 Set to build and install binutils (as, ld, objcopy, and objdump) as part
 of the normal system build.
 .Pp
 It is a default setting on
 amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
 .It Va WITHOUT_BINUTILS_BOOTSTRAP
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP 295490 2016-02-10 23:57:09Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP 295490 2016-02-10 23:57:09Z emaste
 Set to not build binutils (as, ld, objcopy and objdump)
 as part of the bootstrap process.
 .Bf -symbolic
@@ -184,14 +184,14 @@ toolchain is provided.
 It is a default setting on
 arm64/aarch64.
 .It Va WITH_BINUTILS_BOOTSTRAP
-.\" from FreeBSD: head/tools/build/options/WITH_BINUTILS_BOOTSTRAP 295491 2016-02-11 00:14:00Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITH_BINUTILS_BOOTSTRAP 295491 2016-02-11 00:14:00Z emaste
 Set build binutils (as, ld, objcopy and objdump)
 as part of the bootstrap process.
 .Pp
 It is a default setting on
 amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
 .It Va WITHOUT_BLACKLIST
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BLACKLIST 301554 2016-06-07 16:35:55Z lidl
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BLACKLIST 301554 2016-06-07 16:35:55Z lidl
 Set this if you do not want to build blacklistd / blacklistctl.
 When set, it also enforces the following options:
 .Pp
@@ -200,7 +200,7 @@ When set, it also enforces the following
 .Va WITHOUT_BLACKLIST_SUPPORT
 .El
 .It Va WITHOUT_BLACKLIST_SUPPORT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT 301554 2016-06-07 16:35:55Z lidl
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BLACKLIST_SUPPORT 301554 2016-06-07 16:35:55Z lidl
 Set to build some programs without blacklistd support, like
 .Xr fingerd 8 ,
 .Xr ftpd 8 ,
@@ -209,39 +209,39 @@ Set to build some programs without black
 and
 .Xr sshd 8 .
 .It Va WITHOUT_BLUETOOTH
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru
 Set to not build Bluetooth related kernel modules, programs and libraries.
 .It Va WITHOUT_BOOT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru
 Set to not build the boot blocks and loader.
 .It Va WITHOUT_BOOTPARAMD
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BOOTPARAMD 278192 2015-02-04 10:19:32Z ngie
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BOOTPARAMD 278192 2015-02-04 10:19:32Z ngie
 Set to not build or install
 .Xr bootparamd 8 .
 .It Va WITHOUT_BOOTPD
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BOOTPD 278192 2015-02-04 10:19:32Z ngie
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BOOTPD 278192 2015-02-04 10:19:32Z ngie
 Set to not build or install
 .Xr bootpd 8 .
 .It Va WITHOUT_BSDINSTALL
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BSDINSTALL 277677 2015-01-25 04:43:13Z ngie
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BSDINSTALL 277677 2015-01-25 04:43:13Z ngie
 Set to not build
 .Xr bsdinstall 8 ,
 .Xr sade 8 ,
 and related programs.
 .It Va WITHOUT_BSD_CPIO
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BSD_CPIO 179813 2008-06-16 05:48:15Z dougb
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BSD_CPIO 179813 2008-06-16 05:48:15Z dougb
 Set to not build the BSD licensed version of cpio based on
 .Xr libarchive 3 .
 .It Va WITH_BSD_GREP
-.\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien
+.\" from FreeBSD: stable/11/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien
 Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
 .It Va WITHOUT_BSNMP
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam
 Set to not build or install
 .Xr bsnmpd 1
 and related libraries and data files.
 .It Va WITHOUT_BZIP2
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BZIP2 174550 2007-12-12 16:43:17Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BZIP2 174550 2007-12-12 16:43:17Z ru
 Set to not build contributed bzip2 software as a part of the base system.
 .Bf -symbolic
 The option has no effect yet.
@@ -253,20 +253,26 @@ When set, it also enforces the following
 .Va WITHOUT_BZIP2_SUPPORT
 .El
 .It Va WITHOUT_BZIP2_SUPPORT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BZIP2_SUPPORT 166255 2007-01-26 10:19:08Z delphij
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_BZIP2_SUPPORT 166255 2007-01-26 10:19:08Z delphij
 Set to build some programs without optional bzip2 support.
 .It Va WITHOUT_CALENDAR
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CALENDAR 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CALENDAR 156932 2006-03-21 07:50:50Z ru
 Set to not build
 .Xr calendar 1 .
 .It Va WITHOUT_CAPSICUM
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CAPSICUM 229319 2012-01-02 21:57:58Z rwatson
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CAPSICUM 229319 2012-01-02 21:57:58Z rwatson
 Set to not build Capsicum support into system programs.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_CASPER
+.El
 .It Va WITHOUT_CASPER
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CASPER 258838 2013-12-02 08:21:28Z pjd
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CASPER 258838 2013-12-02 08:21:28Z pjd
 Set to not build Casper program and related libraries.
 .It Va WITH_CCACHE_BUILD
-.\" from FreeBSD: head/tools/build/options/WITH_CCACHE_BUILD 297436 2016-03-30 23:53:12Z bdrewery
+.\" from FreeBSD: stable/11/tools/build/options/WITH_CCACHE_BUILD 297436 2016-03-30 23:53:12Z bdrewery
 Set to use
 .Xr ccache 1
 for the build.
@@ -306,12 +312,12 @@ See
 .Xr ccache 1
 for more configuration options.
 .It Va WITHOUT_CCD
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CCD 277678 2015-01-25 04:52:48Z ngie
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CCD 277678 2015-01-25 04:52:48Z ngie
 Set to not build
 .Xr geom_ccd 4
 and related utilities.
 .It Va WITHOUT_CDDL
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CDDL 163861 2006-11-01 09:02:11Z jb
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CDDL 163861 2006-11-01 09:02:11Z jb
 Set to not build code licensed under Sun's CDDL.
 When set, it also enforces the following options:
 .Pp
@@ -322,7 +328,7 @@ When set, it also enforces the following
 .Va WITHOUT_ZFS
 .El
 .It Va WITHOUT_CLANG
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 264660 2014-04-18 17:03:58Z imp
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CLANG 264660 2014-04-18 17:03:58Z imp
 Set to not build the Clang C/C++ compiler during the regular phase of the build.
 .Pp
 It is a default setting on
@@ -336,13 +342,13 @@ When set, it also enforces the following
 .Va WITHOUT_CLANG_FULL
 .El
 .It Va WITH_CLANG
-.\" from FreeBSD: head/tools/build/options/WITH_CLANG 264660 2014-04-18 17:03:58Z imp
+.\" from FreeBSD: stable/11/tools/build/options/WITH_CLANG 264660 2014-04-18 17:03:58Z imp
 Set to build the Clang C/C++ compiler during the normal phase of the build.
 .Pp
 It is a default setting on
 amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64.
 .It Va WITHOUT_CLANG_BOOTSTRAP
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 273177 2014-10-16 18:28:11Z skreuzer
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 273177 2014-10-16 18:28:11Z skreuzer
 Set to not build the Clang C/C++ compiler during the bootstrap phase of the build.
 You must enable either gcc or clang bootstrap to be able to build the system,
 unless an alternative compiler is provided via
@@ -351,30 +357,30 @@ XCC.
 It is a default setting on
 mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
 .It Va WITH_CLANG_BOOTSTRAP
-.\" from FreeBSD: head/tools/build/options/WITH_CLANG_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
+.\" from FreeBSD: stable/11/tools/build/options/WITH_CLANG_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
 Set to build the Clang C/C++ compiler during the bootstrap phase of the build.
 .Pp
 It is a default setting on
 amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386.
 .It Va WITH_CLANG_EXTRAS
-.\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim
+.\" from FreeBSD: stable/11/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim
 Set to build additional clang and llvm tools, such as bugpoint.
 .It Va WITHOUT_CLANG_FULL
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_FULL 246259 2013-02-02 22:28:29Z dim
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CLANG_FULL 246259 2013-02-02 22:28:29Z dim
 Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of
 the Clang C/C++ compiler.
 .Pp
 It is a default setting on
 mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64.
 .It Va WITH_CLANG_FULL
-.\" from FreeBSD: head/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim
+.\" from FreeBSD: stable/11/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim
 Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the
 Clang C/C++ compiler.
 .Pp
 It is a default setting on
 amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64.
 .It Va WITHOUT_CLANG_IS_CC
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks
 Set to install the GCC compiler as
 .Pa /usr/bin/cc ,
 .Pa /usr/bin/c++
@@ -384,7 +390,7 @@ and
 It is a default setting on
 mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
 .It Va WITH_CLANG_IS_CC
-.\" from FreeBSD: head/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb
+.\" from FreeBSD: stable/11/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb
 Set to install the Clang C/C++ compiler as
 .Pa /usr/bin/cc ,
 .Pa /usr/bin/c++
@@ -394,11 +400,11 @@ and
 It is a default setting on
 amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386.
 .It Va WITHOUT_CPP
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru
 Set to not build
 .Xr cpp 1 .
 .It Va WITHOUT_CROSS_COMPILER
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CROSS_COMPILER 275138 2014-11-26 20:43:09Z gjb
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CROSS_COMPILER 275138 2014-11-26 20:43:09Z gjb
 Set to not build any cross compiler in the cross-tools stage of buildworld.
 If you are compiling a different version of
 .Fx
@@ -424,7 +430,7 @@ When set, it also enforces the following
 .Va WITHOUT_GCC_BOOTSTRAP
 .El
 .It Va WITHOUT_CRYPT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CRYPT 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CRYPT 156932 2006-03-21 07:50:50Z ru
 Set to not build any crypto code.
 When set, it also enforces the following options:
 .Pp
@@ -448,20 +454,20 @@ When set, the following options are also
 is set explicitly)
 .El
 .It Va WITH_CTF
-.\" from FreeBSD: head/tools/build/options/WITH_CTF 228159 2011-11-30 18:22:44Z fjoe
+.\" from FreeBSD: stable/11/tools/build/options/WITH_CTF 228159 2011-11-30 18:22:44Z fjoe
 Set to compile with CTF (Compact C Type Format) data.
 CTF data encapsulates a reduced form of debugging information
 similar to DWARF and the venerable stabs and is required for DTrace.
 .It Va WITHOUT_CTM
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr ctm 1
 and related utilities.
 .It Va WITHOUT_CUSE
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CUSE 270171 2014-08-19 15:40:26Z hselasky
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CUSE 270171 2014-08-19 15:40:26Z hselasky
 Set to not build CUSE-related programs and libraries.
 .It Va WITHOUT_CXX
-.\" from FreeBSD: head/tools/build/options/WITHOUT_CXX 281053 2015-04-03 23:55:04Z bdrewery
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_CXX 281053 2015-04-03 23:55:04Z bdrewery
 Set to not build
 .Xr c++ 1
 and related libraries.
@@ -484,14 +490,14 @@ When set, it also enforces the following
 .Va WITHOUT_GROFF
 .El
 .It Va WITHOUT_DEBUG_FILES
-.\" from FreeBSD: head/tools/build/options/WITHOUT_DEBUG_FILES 290059 2015-10-27 20:49:56Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_DEBUG_FILES 290059 2015-10-27 20:49:56Z emaste
 Set to avoid building or installing standalone debug files for each
 executable binary and shared library.
 .It Va WITHOUT_DICT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru
 Set to not build the Webster dictionary files.
 .It Va WITH_DIRDEPS_BUILD
-.\" from FreeBSD: head/tools/build/options/WITH_DIRDEPS_BUILD 298007 2016-04-14 22:00:49Z bdrewery
+.\" from FreeBSD: stable/11/tools/build/options/WITH_DIRDEPS_BUILD 298007 2016-04-14 22:00:49Z bdrewery
 This is an experimental build system.
 For details see
 http://www.crufty.net/sjg/docs/freebsd-meta-mode.htm.
@@ -571,7 +577,7 @@ This must be set in the environment, mak
 not
 .Pa /etc/src.conf .
 .It Va WITH_DIRDEPS_CACHE
-.\" from FreeBSD: head/tools/build/options/WITH_DIRDEPS_CACHE 290816 2015-11-14 03:24:48Z sjg
+.\" from FreeBSD: stable/11/tools/build/options/WITH_DIRDEPS_CACHE 290816 2015-11-14 03:24:48Z sjg
 Cache result of dirdeps.mk which can save significant time
 for subsequent builds.
 Depends on
@@ -582,47 +588,47 @@ This must be set in the environment, mak
 not
 .Pa /etc/src.conf .
 .It Va WITHOUT_DMAGENT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_DMAGENT 262335 2014-02-22 13:05:23Z bapt
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_DMAGENT 262335 2014-02-22 13:05:23Z bapt
 Set to not build dma Mail Transport Agent
 .It Va WITHOUT_DOCCOMPRESS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_DOCCOMPRESS 266752 2014-05-27 15:52:27Z gjb
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_DOCCOMPRESS 266752 2014-05-27 15:52:27Z gjb
 Set to not to install compressed system documentation.
 Only the uncompressed version will be installed.
 .It Va WITH_DTRACE_TESTS
-.\" from FreeBSD: head/tools/build/options/WITH_DTRACE_TESTS 286174 2015-08-02 00:37:33Z markj
+.\" from FreeBSD: stable/11/tools/build/options/WITH_DTRACE_TESTS 286174 2015-08-02 00:37:33Z markj
 Set to build and install the DTrace test suite in
 .Pa /usr/tests/cddl/usr.sbin/dtrace .
 This test suite is considered experimental on architectures other than
 amd64/amd64 and running it may cause system instability.
 .It Va WITHOUT_DYNAMICROOT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru
 Set this if you do not want to link
 .Pa /bin
 and
 .Pa /sbin
 dynamically.
 .It Va WITHOUT_ED_CRYPTO
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ED_CRYPTO 235660 2012-05-19 20:05:27Z marcel
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ED_CRYPTO 235660 2012-05-19 20:05:27Z marcel
 Set to build
 .Xr ed 1
 without support for encryption/decryption.
 .It Va WITHOUT_EE
-.\" from FreeBSD: head/tools/build/options/WITHOUT_EE 277663 2015-01-25 00:03:44Z ngie
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_EE 277663 2015-01-25 00:03:44Z ngie
 Set to not build and install
 .Xr edit 1 ,
 .Xr ee 1 ,
 and related programs.
 .It Va WITH_EISA
-.\" from FreeBSD: head/tools/build/options/WITH_EISA 264654 2014-04-18 16:53:06Z imp
+.\" from FreeBSD: stable/11/tools/build/options/WITH_EISA 264654 2014-04-18 16:53:06Z imp
 Set to build EISA kernel modules.
 .It Va WITHOUT_ELFCOPY_AS_OBJCOPY
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ELFCOPY_AS_OBJCOPY 296193 2016-02-29 16:39:38Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ELFCOPY_AS_OBJCOPY 296193 2016-02-29 16:39:38Z emaste
 Set to build and install
 .Xr objcopy 1
 from GNU Binutils, instead of the one from ELF Tool Chain.
 This option is provided as a transition aid and will be removed in due time.
 .It Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ELFTOOLCHAIN_BOOTSTRAP 295491 2016-02-11 00:14:00Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ELFTOOLCHAIN_BOOTSTRAP 295491 2016-02-11 00:14:00Z emaste
 Set to not build ELF Tool Chain tools
 (addr2line, nm, size, strings and strip)
 as part of the bootstrap process.
@@ -630,76 +636,76 @@ as part of the bootstrap process.
 An alternate bootstrap tool chain must be provided.
 .Ef
 .It Va WITHOUT_EXAMPLES
-.\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru
 Set to avoid installing examples to
 .Pa /usr/share/examples/ .
 .It Va WITH_EXTRA_TCP_STACKS
-.\" from FreeBSD: head/tools/build/options/WITH_EXTRA_TCP_STACKS 302247 2016-06-28 13:37:01Z jtl
+.\" from FreeBSD: stable/11/tools/build/options/WITH_EXTRA_TCP_STACKS 302247 2016-06-28 13:37:01Z jtl
 Set to build extra TCP stack modules.
 .It Va WITHOUT_FDT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru
 Set to not build Flattened Device Tree support as part of the base system.
 This includes the device tree compiler (dtc) and libfdt support library.
 .It Va WITHOUT_FILE
-.\" from FreeBSD: head/tools/build/options/WITHOUT_FILE 278193 2015-02-04 10:24:40Z ngie
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_FILE 278193 2015-02-04 10:24:40Z ngie
 Set to not build
 .Xr file 1
 and related programs.
 .It Va WITHOUT_FINGER
-.\" from FreeBSD: head/tools/build/options/WITHOUT_FINGER 278192 2015-02-04 10:19:32Z ngie
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_FINGER 278192 2015-02-04 10:19:32Z ngie
 Set to not build or install
 .Xr finger 1
 and
 .Xr fingerd 8 .
 .It Va WITHOUT_FLOPPY
-.\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru
 Set to not build or install programs
 for operating floppy disk driver.
 .It Va WITHOUT_FMTREE
-.\" from FreeBSD: head/tools/build/options/WITHOUT_FMTREE 261299 2014-01-30 21:37:43Z brooks
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_FMTREE 261299 2014-01-30 21:37:43Z brooks
 Set to not build and install
 .Pa /usr/sbin/fmtree .
 .It Va WITHOUT_FORMAT_EXTENSIONS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_FORMAT_EXTENSIONS 250658 2013-05-15 13:04:10Z brooks
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_FORMAT_EXTENSIONS 250658 2013-05-15 13:04:10Z brooks
 Set to not enable
 .Fl fformat-extensions
 when compiling the kernel.
 Also disables all format checking.
 .It Va WITHOUT_FORTH
-.\" from FreeBSD: head/tools/build/options/WITHOUT_FORTH 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_FORTH 156932 2006-03-21 07:50:50Z ru
 Set to build bootloaders without Forth support.
 .It Va WITHOUT_FP_LIBC
-.\" from FreeBSD: head/tools/build/options/WITHOUT_FP_LIBC 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_FP_LIBC 156932 2006-03-21 07:50:50Z ru
 Set to build
 .Nm libc
 without floating-point support.
 .It Va WITHOUT_FREEBSD_UPDATE
-.\" from FreeBSD: head/tools/build/options/WITHOUT_FREEBSD_UPDATE 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_FREEBSD_UPDATE 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr freebsd-update 8 .
 .It Va WITHOUT_FTP
-.\" from FreeBSD: head/tools/build/options/WITHOUT_FTP 278192 2015-02-04 10:19:32Z ngie
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_FTP 278192 2015-02-04 10:19:32Z ngie
 Set to not build or install
 .Xr ftp 1
 and
 .Xr ftpd 8 .
 .It Va WITHOUT_GAMES
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GAMES 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GAMES 156932 2006-03-21 07:50:50Z ru
 Set to not build games.
 .It Va WITHOUT_GCC
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GCC 264660 2014-04-18 17:03:58Z imp
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GCC 264660 2014-04-18 17:03:58Z imp
 Set to not build and install gcc and g++ as part of the normal build process.
 .Pp
 It is a default setting on
 amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386.
 .It Va WITH_GCC
-.\" from FreeBSD: head/tools/build/options/WITH_GCC 255326 2013-09-06 20:49:48Z zeising
+.\" from FreeBSD: stable/11/tools/build/options/WITH_GCC 255326 2013-09-06 20:49:48Z zeising
 Set to build and install gcc and g++.
 .Pp
 It is a default setting on
 mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
 .It Va WITHOUT_GCC_BOOTSTRAP
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GCC_BOOTSTRAP 273177 2014-10-16 18:28:11Z skreuzer
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GCC_BOOTSTRAP 273177 2014-10-16 18:28:11Z skreuzer
 Set to not build gcc and g++ as part of the bootstrap process.
 You must enable either gcc or clang bootstrap to be able to build the system,
 unless an alternative compiler is provided via
@@ -708,32 +714,32 @@ XCC.
 It is a default setting on
 amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386.
 .It Va WITH_GCC_BOOTSTRAP
-.\" from FreeBSD: head/tools/build/options/WITH_GCC_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
+.\" from FreeBSD: stable/11/tools/build/options/WITH_GCC_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
 Set to build gcc and g++ as part of the bootstrap process.
 .Pp
 It is a default setting on
 mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
 .It Va WITHOUT_GCOV
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru
 Set to not build the
 .Xr gcov 1
 tool.
 .It Va WITHOUT_GDB
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GDB 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GDB 156932 2006-03-21 07:50:50Z ru
 Set to not build
 .Xr gdb 1 .
 .Pp
 It is a default setting on
 arm64/aarch64.
 .It Va WITH_GDB
-.\" from FreeBSD: head/tools/build/options/WITH_GDB 295493 2016-02-11 00:30:51Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITH_GDB 295493 2016-02-11 00:30:51Z emaste
 Set to build
 .Xr gdb 1 .
 .Pp
 It is a default setting on
 amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
 .It Va WITHOUT_GNU
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU 174550 2007-12-12 16:43:17Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GNU 174550 2007-12-12 16:43:17Z ru
 Set to not build contributed GNU software as a part of the base system.
 This option can be useful if the system built must not contain any code
 covered by the GNU Public License due to legal reasons.
@@ -747,37 +753,37 @@ When set, it also enforces the following
 .Va WITHOUT_GNU_SUPPORT
 .El
 .It Va WITHOUT_GNUCXX
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GNUCXX 255321 2013-09-06 20:08:03Z theraven
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GNUCXX 255321 2013-09-06 20:08:03Z theraven
 Do not build the GNU C++ stack (g++, libstdc++).
 This is the default on platforms where clang is the system compiler.
 .Pp
 It is a default setting on
 amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386.
 .It Va WITH_GNUCXX
-.\" from FreeBSD: head/tools/build/options/WITH_GNUCXX 255321 2013-09-06 20:08:03Z theraven
+.\" from FreeBSD: stable/11/tools/build/options/WITH_GNUCXX 255321 2013-09-06 20:08:03Z theraven
 Build the GNU C++ stack (g++, libstdc++).
 This is the default on platforms where gcc is the system compiler.
 .Pp
 It is a default setting on
 mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
 .It Va WITHOUT_GNU_GREP_COMPAT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_GREP_COMPAT 273421 2014-10-21 20:44:33Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GNU_GREP_COMPAT 273421 2014-10-21 20:44:33Z emaste
 Set this option to omit the gnu extensions to grep from being included in
 BSD grep.
 .It Va WITHOUT_GNU_SUPPORT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru
 Set to build some programs without optional GNU support.
 .It Va WITHOUT_GPIO
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GPIO 228081 2011-11-28 17:54:34Z dim
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GPIO 228081 2011-11-28 17:54:34Z dim
 Set to not build
 .Xr gpioctl 8
 as part of the base system.
 .It Va WITHOUT_GPL_DTC
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GPL_DTC 264515 2014-04-15 20:41:55Z imp
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GPL_DTC 264515 2014-04-15 20:41:55Z imp
 Set to build the BSD licensed version of the device tree compiler, instead of the
 GPL'd one from elinux.org.
 .It Va WITHOUT_GROFF
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs
 Set to not build
 .Xr groff 1
 and
@@ -785,27 +791,27 @@ and
 You should consider installing the textproc/groff port to not break
 .Xr man 1 .
 .It Va WITHOUT_GSSAPI
-.\" from FreeBSD: head/tools/build/options/WITHOUT_GSSAPI 174548 2007-12-12 16:39:32Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_GSSAPI 174548 2007-12-12 16:39:32Z ru
 Set to not build libgssapi.
 .It Va WITHOUT_HAST
-.\" from FreeBSD: head/tools/build/options/WITHOUT_HAST 277725 2015-01-26 06:27:07Z ngie
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_HAST 277725 2015-01-26 06:27:07Z ngie
 Set to not build
 .Xr hastd 8
 and related utilities.
 .It Va WITH_HESIOD
-.\" from FreeBSD: head/tools/build/options/WITH_HESIOD 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITH_HESIOD 156932 2006-03-21 07:50:50Z ru
 Set to build Hesiod support.
 .It Va WITHOUT_HTML
-.\" from FreeBSD: head/tools/build/options/WITHOUT_HTML 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_HTML 156932 2006-03-21 07:50:50Z ru
 Set to not build HTML docs.
 .It Va WITHOUT_HYPERV
-.\" from FreeBSD: head/tools/build/options/WITHOUT_HYPERV 271493 2014-09-13 02:15:31Z delphij
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_HYPERV 271493 2014-09-13 02:15:31Z delphij
 Set to not build or install HyperV utilities.
 .It Va WITHOUT_ICONV
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ICONV 254919 2013-08-26 17:15:56Z antoine
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ICONV 254919 2013-08-26 17:15:56Z antoine
 Set to not build iconv as part of libc.
 .It Va WITHOUT_INCLUDES
-.\" from FreeBSD: head/tools/build/options/WITHOUT_INCLUDES 275138 2014-11-26 20:43:09Z gjb
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_INCLUDES 275138 2014-11-26 20:43:09Z gjb
 Set to not install header files.
 This option used to be spelled
 .Va NO_INCS .
@@ -813,7 +819,7 @@ This option used to be spelled
 The option does not work for build targets.
 .Ef
 .It Va WITHOUT_INET
-.\" from FreeBSD: head/tools/build/options/WITHOUT_INET 221266 2011-04-30 17:58:28Z bz
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_INET 221266 2011-04-30 17:58:28Z bz
 Set to not build programs and libraries related to IPv4 networking.
 When set, it also enforces the following options:
 .Pp
@@ -822,7 +828,7 @@ When set, it also enforces the following
 .Va WITHOUT_INET_SUPPORT
 .El
 .It Va WITHOUT_INET6
-.\" from FreeBSD: head/tools/build/options/WITHOUT_INET6 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_INET6 156932 2006-03-21 07:50:50Z ru
 Set to not build
 programs and libraries related to IPv6 networking.
 When set, it also enforces the following options:
@@ -832,17 +838,17 @@ When set, it also enforces the following
 .Va WITHOUT_INET6_SUPPORT
 .El
 .It Va WITHOUT_INET6_SUPPORT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_INET6_SUPPORT 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_INET6_SUPPORT 156932 2006-03-21 07:50:50Z ru
 Set to build libraries, programs, and kernel modules without IPv6 support.
 .It Va WITHOUT_INETD
-.\" from FreeBSD: head/tools/build/options/WITHOUT_INETD 278192 2015-02-04 10:19:32Z ngie
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_INETD 278192 2015-02-04 10:19:32Z ngie
 Set to not build
 .Xr inetd 8 .
 .It Va WITHOUT_INET_SUPPORT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_INET_SUPPORT 221266 2011-04-30 17:58:28Z bz
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_INET_SUPPORT 221266 2011-04-30 17:58:28Z bz
 Set to build libraries, programs, and kernel modules without IPv4 support.
 .It Va WITHOUT_INSTALLLIB
-.\" from FreeBSD: head/tools/build/options/WITHOUT_INSTALLLIB 297941 2016-04-13 21:01:58Z bdrewery
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_INSTALLLIB 297941 2016-04-13 21:01:58Z bdrewery
 Set this if you do not want to install optional libraries.
 For example when creating a
 .Xr nanobsd 8
@@ -851,7 +857,7 @@ image.
 The option does not work for build targets.
 .Ef
 .It Va WITH_INSTALL_AS_USER
-.\" from FreeBSD: head/tools/build/options/WITH_INSTALL_AS_USER 238021 2012-07-02 20:24:01Z marcel
+.\" from FreeBSD: stable/11/tools/build/options/WITH_INSTALL_AS_USER 238021 2012-07-02 20:24:01Z marcel
 Set to make install targets succeed for non-root users by installing
 files with owner and group attributes set to that of the user running
 the
@@ -861,28 +867,28 @@ The user still has to set the
 .Va DESTDIR
 variable to point to a directory where the user has write permissions.
 .It Va WITHOUT_IPFILTER
-.\" from FreeBSD: head/tools/build/options/WITHOUT_IPFILTER 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_IPFILTER 156932 2006-03-21 07:50:50Z ru
 Set to not build IP Filter package.
 .It Va WITHOUT_IPFW
-.\" from FreeBSD: head/tools/build/options/WITHOUT_IPFW 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_IPFW 183242 2008-09-21 22:02:26Z sam
 Set to not build IPFW tools.
 .It Va WITHOUT_ISCSI
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ISCSI 277675 2015-01-25 04:20:11Z ngie
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_ISCSI 277675 2015-01-25 04:20:11Z ngie
 Set to not build
 .Xr iscid 8
 and related utilities.
 .It Va WITHOUT_JAIL
-.\" from FreeBSD: head/tools/build/options/WITHOUT_JAIL 249966 2013-04-27 04:09:09Z eadler
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_JAIL 249966 2013-04-27 04:09:09Z eadler
 Set to not build tools for the support of jails; e.g.,
 .Xr jail 8 .
 .It Va WITHOUT_KDUMP
-.\" from FreeBSD: head/tools/build/options/WITHOUT_KDUMP 240690 2012-09-19 11:38:37Z zeising
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_KDUMP 240690 2012-09-19 11:38:37Z zeising
 Set to not build
 .Xr kdump 1
 and
 .Xr truss 1 .
 .It Va WITHOUT_KERBEROS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS 174549 2007-12-12 16:42:03Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_KERBEROS 174549 2007-12-12 16:42:03Z ru
 Set this if you do not want to build Kerberos 5 (KTH Heimdal).
 When set, it also enforces the following options:
 .Pp
@@ -900,7 +906,7 @@ When set, the following options are also
 is set explicitly)
 .El
 .It Va WITHOUT_KERBEROS_SUPPORT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS_SUPPORT 251794 2013-06-15 20:29:07Z eadler
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_KERBEROS_SUPPORT 251794 2013-06-15 20:29:07Z eadler
 Set to build some programs without Kerberos support, like
 .Xr ssh 1 ,
 .Xr telnet 1 ,
@@ -908,13 +914,13 @@ Set to build some programs without Kerbe
 and
 .Xr telnetd 8 .
 .It Va WITHOUT_KERNEL_SYMBOLS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_KERNEL_SYMBOLS 222189 2011-05-22 18:23:17Z imp
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_KERNEL_SYMBOLS 222189 2011-05-22 18:23:17Z imp
 Set to not install kernel symbol files.
 .Bf -symbolic
 This option is recommended for those people who have small root partitions.
 .Ef
 .It Va WITHOUT_KVM
-.\" from FreeBSD: head/tools/build/options/WITHOUT_KVM 174550 2007-12-12 16:43:17Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_KVM 174550 2007-12-12 16:43:17Z ru
 Set to not build the
 .Nm libkvm
 library as a part of the base system.
@@ -928,12 +934,12 @@ When set, it also enforces the following
 .Va WITHOUT_KVM_SUPPORT
 .El
 .It Va WITHOUT_KVM_SUPPORT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_KVM_SUPPORT 170644 2007-06-13 02:08:04Z sepotvin
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_KVM_SUPPORT 170644 2007-06-13 02:08:04Z sepotvin
 Set to build some programs without optional
 .Nm libkvm
 support.
 .It Va WITHOUT_LDNS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LDNS 255591 2013-09-15 13:11:13Z des
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LDNS 255591 2013-09-15 13:11:13Z des
 Setting this variable will prevent the LDNS library from being built.
 When set, it also enforces the following options:
 .Pp
@@ -944,27 +950,27 @@ When set, it also enforces the following
 .Va WITHOUT_UNBOUND
 .El
 .It Va WITHOUT_LDNS_UTILS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LDNS_UTILS 255850 2013-09-24 14:33:31Z des
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LDNS_UTILS 255850 2013-09-24 14:33:31Z des
 Setting this variable will prevent building the LDNS utilities
 .Xr drill 1
 and
 .Xr host 1 .
 .It Va WITHOUT_LEGACY_CONSOLE
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LEGACY_CONSOLE 296264 2016-03-01 11:36:10Z trasz
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LEGACY_CONSOLE 296264 2016-03-01 11:36:10Z trasz
 Set to not build programs that support a legacy PC console; e.g.,
 .Xr kbdcontrol 1
 and
 .Xr vidcontrol 1 .
 .It Va WITHOUT_LIB32
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LIB32 274664 2014-11-18 17:06:48Z imp
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LIB32 274664 2014-11-18 17:06:48Z imp
 On 64-bit platforms, set to not build 32-bit library set and a
 .Nm ld-elf32.so.1
 runtime linker.
 .It Va WITHOUT_LIBCPLUSPLUS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBCPLUSPLUS 246262 2013-02-02 22:42:46Z dim
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LIBCPLUSPLUS 246262 2013-02-02 22:42:46Z dim
 Set to avoid building libcxxrt and libc++.
 .It Va WITHOUT_LIBPTHREAD
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm
 Set to not build the
 .Nm libpthread
 providing library,
@@ -976,63 +982,63 @@ When set, it also enforces the following
 .Va WITHOUT_LIBTHR
 .El
 .It Va WITH_LIBSOFT
-.\" from FreeBSD: head/tools/build/options/WITH_LIBSOFT 300325 2016-05-20 19:23:07Z bdrewery
+.\" from FreeBSD: stable/11/tools/build/options/WITH_LIBSOFT 300325 2016-05-20 19:23:07Z bdrewery
 On armv6 only, set to enable soft float ABI compatibility libraries.
 This option is for transitioning to the new hard float ABI.
 .It Va WITHOUT_LIBTHR
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBTHR 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LIBTHR 156932 2006-03-21 07:50:50Z ru
 Set to not build the
 .Nm libthr
 (1:1 threading)
 library.
 .It Va WITHOUT_LLDB
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LLDB 289275 2015-10-14 00:23:31Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LLDB 289275 2015-10-14 00:23:31Z emaste
 Set to not build the LLDB debugger.
 .Pp
 It is a default setting on
 arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
 .It Va WITH_LLDB
-.\" from FreeBSD: head/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste
 Set to build the LLDB debugger.
 .Pp
 It is a default setting on
 amd64/amd64 and arm64/aarch64.
 .It Va WITHOUT_LLVM_LIBUNWIND
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LLVM_LIBUNWIND 293450 2016-01-09 00:42:07Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LLVM_LIBUNWIND 293450 2016-01-09 00:42:07Z emaste
 Set to use GCC's stack unwinder (instead of LLVM's libunwind).
 .Pp
 It is a default setting on
 amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
 .It Va WITH_LLVM_LIBUNWIND
-.\" from FreeBSD: head/tools/build/options/WITH_LLVM_LIBUNWIND 293450 2016-01-09 00:42:07Z emaste
+.\" from FreeBSD: stable/11/tools/build/options/WITH_LLVM_LIBUNWIND 293450 2016-01-09 00:42:07Z emaste
 Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder).
 .Pp
 It is a default setting on
 arm64/aarch64.
 .It Va WITHOUT_LOCALES
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LOCALES 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LOCALES 156932 2006-03-21 07:50:50Z ru
 Set to not build localization files; see
 .Xr locale 1 .
 .It Va WITHOUT_LOCATE
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LOCATE 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LOCATE 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr locate 1
 and related programs.
 .It Va WITHOUT_LPR
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LPR 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LPR 156932 2006-03-21 07:50:50Z ru
 Set to not build
 .Xr lpr 1
 and related programs.
 .It Va WITHOUT_LS_COLORS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LS_COLORS 235660 2012-05-19 20:05:27Z marcel
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LS_COLORS 235660 2012-05-19 20:05:27Z marcel
 Set to build
 .Xr ls 1
 without support for colors to distinguish file types.
 .It Va WITHOUT_LZMA_SUPPORT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_LZMA_SUPPORT 245171 2013-01-08 18:37:12Z obrien
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_LZMA_SUPPORT 245171 2013-01-08 18:37:12Z obrien
 Set to build some programs without optional lzma compression support.
 .It Va WITHOUT_MAIL
-.\" from FreeBSD: head/tools/build/options/WITHOUT_MAIL 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_MAIL 183242 2008-09-21 22:02:26Z sam
 Set to not build any mail support (MUA or MTA).
 When set, it also enforces the following options:
 .Pp
@@ -1045,17 +1051,17 @@ When set, it also enforces the following
 .Va WITHOUT_SENDMAIL
 .El
 .It Va WITHOUT_MAILWRAPPER
-.\" from FreeBSD: head/tools/build/options/WITHOUT_MAILWRAPPER 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_MAILWRAPPER 156932 2006-03-21 07:50:50Z ru
 Set to not build the
 .Xr mailwrapper 8
 MTA selector.
 .It Va WITHOUT_MAKE
-.\" from FreeBSD: head/tools/build/options/WITHOUT_MAKE 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_MAKE 183242 2008-09-21 22:02:26Z sam
 Set to not install
 .Xr make 1
 and related support files.
 .It Va WITHOUT_MAN
-.\" from FreeBSD: head/tools/build/options/WITHOUT_MAN 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_MAN 156932 2006-03-21 07:50:50Z ru
 Set to not build manual pages.
 When set, the following options are also in effect:
 .Pp
@@ -1066,18 +1072,18 @@ When set, the following options are also
 is set explicitly)
 .El
 .It Va WITHOUT_MANCOMPRESS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_MANCOMPRESS 266752 2014-05-27 15:52:27Z gjb
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_MANCOMPRESS 266752 2014-05-27 15:52:27Z gjb
 Set to not to install compressed man pages.
 Only the uncompressed versions will be installed.
 .It Va WITHOUT_MANDOCDB
-.\" from FreeBSD: head/tools/build/options/WITHOUT_MANDOCDB 283777 2015-05-30 17:41:37Z bapt
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_MANDOCDB 283777 2015-05-30 17:41:37Z bapt
 Use the
 .Xr mandoc 1
 version of
 .Xr makewhatis 8
 database and utilities.
 .It Va WITHOUT_MAN_UTILS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim
 Set to not build utilities for manual pages,
 .Xr apropos 1 ,
 .Xr catman 1 ,
@@ -1087,7 +1093,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 301889 2016-06-14 16:20:25Z bdrewery
+.\" from FreeBSD: stable/11/tools/build/options/WITH_META_MODE 301889 2016-06-14 16:20:25Z bdrewery
 Creates
 .Xr make 1
 meta files when building, which can provide a reliable incremental build when
@@ -1155,19 +1161,19 @@ This must be set in the environment, mak
 not
 .Pa /etc/src.conf .
 .It Va WITH_NAND
-.\" from FreeBSD: head/tools/build/options/WITH_NAND 235537 2012-05-17 10:11:18Z gber
+.\" from FreeBSD: stable/11/tools/build/options/WITH_NAND 235537 2012-05-17 10:11:18Z gber
 Set to build the NAND Flash components.
 .It Va WITHOUT_NDIS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_NDIS 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_NDIS 183242 2008-09-21 22:02:26Z sam
 Set to not build programs and libraries
 related to NDIS emulation support.
 .It Va WITHOUT_NETCAT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_NETCAT 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_NETCAT 156932 2006-03-21 07:50:50Z ru
 Set to not build
 .Xr nc 1
 utility.
 .It Va WITHOUT_NETGRAPH
-.\" from FreeBSD: head/tools/build/options/WITHOUT_NETGRAPH 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_NETGRAPH 183242 2008-09-21 22:02:26Z sam
 Set to not build applications to support
 .Xr netgraph 4 .
 When set, it also enforces the following options:
@@ -1181,10 +1187,10 @@ When set, it also enforces the following
 .Va WITHOUT_NETGRAPH_SUPPORT
 .El
 .It Va WITHOUT_NETGRAPH_SUPPORT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_NETGRAPH_SUPPORT 183305 2008-09-23 16:11:15Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_NETGRAPH_SUPPORT 183305 2008-09-23 16:11:15Z sam
 Set to build libraries, programs, and kernel modules without netgraph support.
 .It Va WITHOUT_NIS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_NIS 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_NIS 156932 2006-03-21 07:50:50Z ru
 Set to not build
 .Xr NIS 8
 support and related programs.
@@ -1194,14 +1200,14 @@ and remove
 .Sq nis
 entries.
 .It Va WITHOUT_NLS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_NLS 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_NLS 156932 2006-03-21 07:50:50Z ru
 Set to not build NLS catalogs.
 .It Va WITHOUT_NLS_CATALOGS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru
 Set to not build NLS catalog support for
 .Xr csh 1 .
 .It Va WITHOUT_NS_CACHING
-.\" from FreeBSD: head/tools/build/options/WITHOUT_NS_CACHING 172803 2007-10-19 14:01:25Z ru
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_NS_CACHING 172803 2007-10-19 14:01:25Z ru
 Set to disable name caching in the
 .Pa nsswitch
 subsystem.
@@ -1209,23 +1215,23 @@ The generic caching daemon,
 .Xr nscd 8 ,
 will not be built either if this option is set.
 .It Va WITHOUT_NTP
-.\" from FreeBSD: head/tools/build/options/WITHOUT_NTP 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/11/tools/build/options/WITHOUT_NTP 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr ntpd 8
 and related programs.
 .It Va WITH_OFED
-.\" from FreeBSD: head/tools/build/options/WITH_OFED 228081 2011-11-28 17:54:34Z dim

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

From owner-svn-src-all@freebsd.org  Mon Dec 12 21:54:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F362C7498F;
 Mon, 12 Dec 2016 21:54:50 +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 294EA6A2;
 Mon, 12 Dec 2016 21:54:50 +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 uBCLsnnB053740;
 Mon, 12 Dec 2016 21:54:49 GMT (envelope-from ken@FreeBSD.org)
Received: (from ken@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCLsnGM053739;
 Mon, 12 Dec 2016 21:54:49 GMT (envelope-from ken@FreeBSD.org)
Message-Id: <201612122154.uBCLsnGM053739@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org
 using -f
From: "Kenneth D. Merry" <ken@FreeBSD.org>
Date: Mon, 12 Dec 2016 21:54:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r309956 - stable/10/sbin/camcontrol
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 21:54:50 -0000

Author: ken
Date: Mon Dec 12 21:54:49 2016
New Revision: 309956
URL: https://svnweb.freebsd.org/changeset/base/309956

Log:
  MFC r307684, r307747
    ------------------------------------------------------------------------
    r307684 | ken | 2016-10-20 13:42:26 -0600 (Thu, 20 Oct 2016) | 13 lines
  
    For CCBs allocated on the stack, we need to clear the entire CCB, not just
    the header.  Otherwise stack garbage can lead to random flags getting set.
  
    This showed up as 'camcontrol rescan all' failing with EINVAL because the
    address type wasn't CAM_DATA_VADDR.
  
    sbin/camcontrol/camcontrol.c:
    	In rescan_or_reset_bus(), bzero the stack-allocated CCBs before
    	use instead of clearing the body.
  
    Sponsored by:	Spectra Logic
  
    ------------------------------------------------------------------------
    r307747 | ken | 2016-10-21 12:54:56 -0600 (Fri, 21 Oct 2016) | 27 lines
  
    Fix a problem in camcontrol(8) that cropped up with r307684.
  
    In r307684, I changed rescan_or_reset_bus() to bzero stack-allocated CCBs
    before sending them to the kernel because there was stack garbage in there
    that wound up meaning that bogus CCB flags were set.
  
    While this fixed the 'camcontrol rescan all' case (XPT_DEV_MATCH CCBs were
    failing previously), it broke the 'camcontrol rescan 0' (or any other
    number) case when INVARIANTS are turned on.  Rescanning a single bus
    reliably produced an assert in cam_periph_runccb():
  
    panic: cam_periph_runccb: ccb=0xfffff80044ffe000, func_code=0x708, flags=0xffffdde0
  
    The flags values don't make sense from the code.  Changing the CCBs in
    rescan_or_reset_bus() from stack to heap allocated avoids the problem.
  
    It would be better to understand why userland stack allocated CCBs don't
    work properly, since there may be other code that breaks if stack allocated
    CCBs don't work.
  
    sbin/camcontrol/camcontrol.c:
    	In rescan_or_reset_bus(), allocate the CCBs using malloc(3) instead
    	of on the stack to avoid an assertion in cam_periph_runccb().
  
    Sponsored by:	Spectra Logic
  
    ------------------------------------------------------------------------
  
  Sponsored by:	Spectra Logic

Modified:
  stable/10/sbin/camcontrol/camcontrol.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/camcontrol/camcontrol.c
==============================================================================
--- stable/10/sbin/camcontrol/camcontrol.c	Mon Dec 12 21:49:29 2016	(r309955)
+++ stable/10/sbin/camcontrol/camcontrol.c	Mon Dec 12 21:54:49 2016	(r309956)
@@ -3124,8 +3124,8 @@ dorescan_or_reset(int argc, char **argv,
 static int
 rescan_or_reset_bus(path_id_t bus, int rescan)
 {
-	union ccb ccb, matchccb;
-	int fd, retval;
+	union ccb *ccb = NULL, *matchccb = NULL;
+	int fd = -1, retval;
 	int bufsize;
 
 	retval = 0;
@@ -3136,35 +3136,41 @@ rescan_or_reset_bus(path_id_t bus, int r
 		return(1);
 	}
 
+	ccb = malloc(sizeof(*ccb));
+	if (ccb == NULL) {
+		warn("failed to allocate CCB");
+		retval = 1;
+		goto bailout;
+	}
+	bzero(ccb, sizeof(*ccb));
+
 	if (bus != CAM_BUS_WILDCARD) {
-		ccb.ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS;
-		ccb.ccb_h.path_id = bus;
-		ccb.ccb_h.target_id = CAM_TARGET_WILDCARD;
-		ccb.ccb_h.target_lun = CAM_LUN_WILDCARD;
-		ccb.crcn.flags = CAM_FLAG_NONE;
+		ccb->ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS;
+		ccb->ccb_h.path_id = bus;
+		ccb->ccb_h.target_id = CAM_TARGET_WILDCARD;
+		ccb->ccb_h.target_lun = CAM_LUN_WILDCARD;
+		ccb->crcn.flags = CAM_FLAG_NONE;
 
 		/* run this at a low priority */
-		ccb.ccb_h.pinfo.priority = 5;
+		ccb->ccb_h.pinfo.priority = 5;
 
-		if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
+		if (ioctl(fd, CAMIOCOMMAND, ccb) == -1) {
 			warn("CAMIOCOMMAND ioctl failed");
-			close(fd);
-			return(1);
+			retval = 1;
+			goto bailout;
 		}
 
-		if ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+		if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
 			fprintf(stdout, "%s of bus %d was successful\n",
 			    rescan ? "Re-scan" : "Reset", bus);
 		} else {
 			fprintf(stdout, "%s of bus %d returned error %#x\n",
 				rescan ? "Re-scan" : "Reset", bus,
-				ccb.ccb_h.status & CAM_STATUS_MASK);
+				ccb->ccb_h.status & CAM_STATUS_MASK);
 			retval = 1;
 		}
 
-		close(fd);
-		return(retval);
-
+		goto bailout;
 	}
 
 
@@ -3178,58 +3184,64 @@ 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.
 	 */
-	CCB_CLEAR_ALL_EXCEPT_HDR(&matchccb.cdm);
-	matchccb.ccb_h.func_code = XPT_DEV_MATCH;
-	matchccb.ccb_h.path_id = CAM_BUS_WILDCARD;
+	matchccb = malloc(sizeof(*matchccb));
+	if (matchccb == NULL) {
+		warn("failed to allocate CCB");
+		retval = 1;
+		goto bailout;
+	}
+	bzero(matchccb, sizeof(*matchccb));
+	matchccb->ccb_h.func_code = XPT_DEV_MATCH;
+	matchccb->ccb_h.path_id = CAM_BUS_WILDCARD;
 	bufsize = sizeof(struct dev_match_result) * 20;
-	matchccb.cdm.match_buf_len = bufsize;
-	matchccb.cdm.matches=(struct dev_match_result *)malloc(bufsize);
-	if (matchccb.cdm.matches == NULL) {
+	matchccb->cdm.match_buf_len = bufsize;
+	matchccb->cdm.matches=(struct dev_match_result *)malloc(bufsize);
+	if (matchccb->cdm.matches == NULL) {
 		warnx("can't malloc memory for matches");
 		retval = 1;
 		goto bailout;
 	}
-	matchccb.cdm.num_matches = 0;
+	matchccb->cdm.num_matches = 0;
 
-	matchccb.cdm.num_patterns = 1;
-	matchccb.cdm.pattern_buf_len = sizeof(struct dev_match_pattern);
+	matchccb->cdm.num_patterns = 1;
+	matchccb->cdm.pattern_buf_len = sizeof(struct dev_match_pattern);
 
-	matchccb.cdm.patterns = (struct dev_match_pattern *)malloc(
-		matchccb.cdm.pattern_buf_len);
-	if (matchccb.cdm.patterns == NULL) {
+	matchccb->cdm.patterns = (struct dev_match_pattern *)malloc(
+		matchccb->cdm.pattern_buf_len);
+	if (matchccb->cdm.patterns == NULL) {
 		warnx("can't malloc memory for patterns");
 		retval = 1;
 		goto bailout;
 	}
-	matchccb.cdm.patterns[0].type = DEV_MATCH_BUS;
-	matchccb.cdm.patterns[0].pattern.bus_pattern.flags = BUS_MATCH_ANY;
+	matchccb->cdm.patterns[0].type = DEV_MATCH_BUS;
+	matchccb->cdm.patterns[0].pattern.bus_pattern.flags = BUS_MATCH_ANY;
 
 	do {
 		unsigned int i;
 
-		if (ioctl(fd, CAMIOCOMMAND, &matchccb) == -1) {
+		if (ioctl(fd, CAMIOCOMMAND, matchccb) == -1) {
 			warn("CAMIOCOMMAND ioctl failed");
 			retval = 1;
 			goto bailout;
 		}
 
-		if ((matchccb.ccb_h.status != CAM_REQ_CMP)
-		 || ((matchccb.cdm.status != CAM_DEV_MATCH_LAST)
-		   && (matchccb.cdm.status != CAM_DEV_MATCH_MORE))) {
+		if ((matchccb->ccb_h.status != CAM_REQ_CMP)
+		 || ((matchccb->cdm.status != CAM_DEV_MATCH_LAST)
+		   && (matchccb->cdm.status != CAM_DEV_MATCH_MORE))) {
 			warnx("got CAM error %#x, CDM error %d\n",
-			      matchccb.ccb_h.status, matchccb.cdm.status);
+			      matchccb->ccb_h.status, matchccb->cdm.status);
 			retval = 1;
 			goto bailout;
 		}
 
-		for (i = 0; i < matchccb.cdm.num_matches; i++) {
+		for (i = 0; i < matchccb->cdm.num_matches; i++) {
 			struct bus_match_result *bus_result;
 
 			/* This shouldn't happen. */
-			if (matchccb.cdm.matches[i].type != DEV_MATCH_BUS)
+			if (matchccb->cdm.matches[i].type != DEV_MATCH_BUS)
 				continue;
 
-			bus_result = &matchccb.cdm.matches[i].result.bus_result;
+			bus_result =&matchccb->cdm.matches[i].result.bus_result;
 
 			/*
 			 * We don't want to rescan or reset the xpt bus.
@@ -3238,23 +3250,23 @@ rescan_or_reset_bus(path_id_t bus, int r
 			if (bus_result->path_id == CAM_XPT_PATH_ID)
 				continue;
 
-			ccb.ccb_h.func_code = rescan ? XPT_SCAN_BUS :
+			ccb->ccb_h.func_code = rescan ? XPT_SCAN_BUS :
 						       XPT_RESET_BUS;
-			ccb.ccb_h.path_id = bus_result->path_id;
-			ccb.ccb_h.target_id = CAM_TARGET_WILDCARD;
-			ccb.ccb_h.target_lun = CAM_LUN_WILDCARD;
-			ccb.crcn.flags = CAM_FLAG_NONE;
+			ccb->ccb_h.path_id = bus_result->path_id;
+			ccb->ccb_h.target_id = CAM_TARGET_WILDCARD;
+			ccb->ccb_h.target_lun = CAM_LUN_WILDCARD;
+			ccb->crcn.flags = CAM_FLAG_NONE;
 
 			/* run this at a low priority */
-			ccb.ccb_h.pinfo.priority = 5;
+			ccb->ccb_h.pinfo.priority = 5;
 
-			if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
+			if (ioctl(fd, CAMIOCOMMAND, ccb) == -1) {
 				warn("CAMIOCOMMAND ioctl failed");
 				retval = 1;
 				goto bailout;
 			}
 
-			if ((ccb.ccb_h.status & CAM_STATUS_MASK) ==CAM_REQ_CMP){
+			if ((ccb->ccb_h.status & CAM_STATUS_MASK)==CAM_REQ_CMP){
 				fprintf(stdout, "%s of bus %d was successful\n",
 					rescan? "Re-scan" : "Reset",
 					bus_result->path_id);
@@ -3267,22 +3279,24 @@ rescan_or_reset_bus(path_id_t bus, int r
 				fprintf(stderr, "%s of bus %d returned error "
 					"%#x\n", rescan? "Re-scan" : "Reset",
 					bus_result->path_id,
-					ccb.ccb_h.status & CAM_STATUS_MASK);
+					ccb->ccb_h.status & CAM_STATUS_MASK);
 				retval = 1;
 			}
 		}
-	} while ((matchccb.ccb_h.status == CAM_REQ_CMP)
-		 && (matchccb.cdm.status == CAM_DEV_MATCH_MORE));
+	} while ((matchccb->ccb_h.status == CAM_REQ_CMP)
+		 && (matchccb->cdm.status == CAM_DEV_MATCH_MORE));
 
 bailout:
 
 	if (fd != -1)
 		close(fd);
 
-	if (matchccb.cdm.patterns != NULL)
-		free(matchccb.cdm.patterns);
-	if (matchccb.cdm.matches != NULL)
-		free(matchccb.cdm.matches);
+	if (matchccb != NULL) {
+		free(matchccb->cdm.patterns);
+		free(matchccb->cdm.matches);
+		free(matchccb);
+	}
+	free(ccb);
 
 	return(retval);
 }

From owner-svn-src-all@freebsd.org  Mon Dec 12 22:38:13 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58526C742DE;
 Mon, 12 Dec 2016 22:38:13 +0000 (UTC) (envelope-from ken@kdm.org)
Received: from mithlond.kdm.org (mithlond.kdm.org [96.89.93.250])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "A1-33714", Issuer "A1-33714" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 1D12A1AAF;
 Mon, 12 Dec 2016 22:38:12 +0000 (UTC) (envelope-from ken@kdm.org)
Received: from mithlond.kdm.org (localhost [127.0.0.1])
 by mithlond.kdm.org (8.15.2/8.14.9) with ESMTPS id uBCMXs55016492
 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Mon, 12 Dec 2016 17:33:54 -0500 (EST)
 (envelope-from ken@mithlond.kdm.org)
Received: (from ken@localhost)
 by mithlond.kdm.org (8.15.2/8.14.9/Submit) id uBCMXssu016491;
 Mon, 12 Dec 2016 17:33:54 -0500 (EST) (envelope-from ken)
Date: Mon, 12 Dec 2016 17:33:54 -0500
From: "Kenneth D. Merry" <ken@FreeBSD.ORG>
To: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r307684 - head/sbin/camcontrol
Message-ID: <20161212223354.GA16028@mithlond.kdm.org>
References: <201610201942.u9KJgQOR062772@repo.freebsd.org>
 <CAPQ4ffvpCmQmo2qwdmeNqdOAKZxieq5BAdptvtmT58nu2oMdqQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAPQ4ffvpCmQmo2qwdmeNqdOAKZxieq5BAdptvtmT58nu2oMdqQ@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3
 (mithlond.kdm.org [127.0.0.1]); Mon, 12 Dec 2016 17:33:54 -0500 (EST)
X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 HEADER_FROM_DIFFERENT_DOMAINS autolearn=ham autolearn_force=no version=3.4.1
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mithlond.kdm.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 22:38:13 -0000

On Sun, Dec 11, 2016 at 00:49:12 +0100, Oliver Pinter wrote:
> On 10/20/16, Kenneth D. Merry <ken@freebsd.org> wrote:
> > Author: ken
> > Date: Thu Oct 20 19:42:26 2016
> > New Revision: 307684
> > URL: https://svnweb.freebsd.org/changeset/base/307684
> >
> > Log:
> >   For CCBs allocated on the stack, we need to clear the entire CCB, not
> > just
> >   the header.  Otherwise stack garbage can lead to random flags getting
> > set.
> >
> >   This showed up as 'camcontrol rescan all' failing with EINVAL because the
> >   address type wasn't CAM_DATA_VADDR.
> >
> >   sbin/camcontrol/camcontrol.c:
> >   	In rescan_or_reset_bus(), bzero the stack-allocated CCBs before
> >   	use instead of clearing the body.
> >
> >   MFC after:	3 days
> >   Sponsored by:	Spectra Logic
> 
> The MFC of this commit is missed both for 10-STABLE and 11-STABLE. Is
> this still in plan to do?

Done, thanks for the reminder!

Ken
-- 
Kenneth Merry
ken@FreeBSD.ORG

From owner-svn-src-all@freebsd.org  Mon Dec 12 22:51:31 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 186D2C7494D;
 Mon, 12 Dec 2016 22:51:31 +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 A56253D8;
 Mon, 12 Dec 2016 22:51:30 +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 uBCMpT1e076180;
 Mon, 12 Dec 2016 22:51:29 GMT (envelope-from jilles@FreeBSD.org)
Received: (from jilles@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCMpTcv076179;
 Mon, 12 Dec 2016 22:51:29 GMT (envelope-from jilles@FreeBSD.org)
Message-Id: <201612122251.uBCMpTcv076179@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jilles set sender to
 jilles@FreeBSD.org using -f
From: Jilles Tjoelker <jilles@FreeBSD.org>
Date: Mon, 12 Dec 2016 22:51:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309957 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 22:51:31 -0000

Author: jilles
Date: Mon Dec 12 22:51:29 2016
New Revision: 309957
URL: https://svnweb.freebsd.org/changeset/base/309957

Log:
  Add tests for reaper receiving SIGCHLD (r309886).
  
  PR:		213928
  MFC after:	2 weeks

Modified:
  head/tests/sys/kern/reaper.c

Modified: head/tests/sys/kern/reaper.c
==============================================================================
--- head/tests/sys/kern/reaper.c	Mon Dec 12 21:54:49 2016	(r309956)
+++ head/tests/sys/kern/reaper.c	Mon Dec 12 22:51:29 2016	(r309957)
@@ -35,6 +35,11 @@ __FBSDID("$FreeBSD$");
 #include <signal.h>
 #include <unistd.h>
 
+static void
+dummy_sighandler(int sig __unused, siginfo_t *info __unused, void *ctx __unused)
+{
+}
+
 ATF_TC_WITHOUT_HEAD(reaper_wait_child_first);
 ATF_TC_BODY(reaper_wait_child_first, tc)
 {
@@ -129,6 +134,161 @@ ATF_TC_BODY(reaper_wait_grandchild_first
 	ATF_CHECK_EQ(2, r);
 }
 
+ATF_TC(reaper_sigchld_child_first);
+ATF_TC_HEAD(reaper_sigchld_child_first, tc)
+{
+	atf_tc_set_md_var(tc, "timeout", "2");
+}
+ATF_TC_BODY(reaper_sigchld_child_first, tc)
+{
+	struct sigaction act;
+	sigset_t mask;
+	siginfo_t info;
+	pid_t parent, child, grandchild, pid;
+	int r;
+	int pip[2];
+
+	/* Be paranoid. */
+	pid = waitpid(-1, NULL, WNOHANG);
+	ATF_REQUIRE(pid == -1 && errno == ECHILD);
+
+	act.sa_sigaction = dummy_sighandler;
+	act.sa_flags = SA_SIGINFO | SA_RESTART;
+	r = sigemptyset(&act.sa_mask);
+	ATF_REQUIRE_EQ(0, r);
+	r = sigaction(SIGCHLD, &act, NULL);
+	ATF_REQUIRE_EQ(0, r);
+
+	r = sigemptyset(&mask);
+	ATF_REQUIRE_EQ(0, r);
+	r = sigaddset(&mask, SIGCHLD);
+	ATF_REQUIRE_EQ(0, r);
+	r = sigprocmask(SIG_BLOCK, &mask, NULL);
+	ATF_REQUIRE_EQ(0, r);
+
+	parent = getpid();
+	r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL);
+	ATF_REQUIRE_EQ(0, r);
+
+	r = pipe(pip);
+	ATF_REQUIRE_EQ(0, r);
+
+	child = fork();
+	ATF_REQUIRE(child != -1);
+	if (child == 0) {
+		if (close(pip[1]) != 0)
+			_exit(100);
+		grandchild = fork();
+		if (grandchild == -1)
+			_exit(101);
+		else if (grandchild == 0) {
+			if (read(pip[0], &(uint8_t){ 0 }, 1) != 0)
+				_exit(102);
+			if (getppid() != parent)
+				_exit(103);
+			_exit(2);
+		} else
+			_exit(3);
+	}
+
+	r = sigwaitinfo(&mask, &info);
+	ATF_REQUIRE_EQ(SIGCHLD, r);
+	ATF_CHECK_EQ(SIGCHLD, info.si_signo);
+	ATF_CHECK_EQ(CLD_EXITED, info.si_code);
+	ATF_CHECK_EQ(3, info.si_status);
+	ATF_CHECK_EQ(child, info.si_pid);
+
+	pid = waitpid(child, NULL, 0);
+	ATF_REQUIRE_EQ(child, pid);
+
+	r = close(pip[1]);
+	ATF_REQUIRE_EQ(0, r);
+
+	r = sigwaitinfo(&mask, &info);
+	ATF_REQUIRE_EQ(SIGCHLD, r);
+	ATF_CHECK_EQ(SIGCHLD, info.si_signo);
+	ATF_CHECK_EQ(CLD_EXITED, info.si_code);
+	ATF_CHECK_EQ(2, info.si_status);
+	grandchild = info.si_pid;
+	ATF_REQUIRE(grandchild > 0);
+	ATF_REQUIRE(grandchild != parent);
+	ATF_REQUIRE(grandchild != child);
+
+	pid = waitpid(-1, NULL, 0);
+	ATF_REQUIRE_EQ(grandchild, pid);
+
+	r = close(pip[0]);
+	ATF_REQUIRE_EQ(0, r);
+}
+
+ATF_TC(reaper_sigchld_grandchild_first);
+ATF_TC_HEAD(reaper_sigchld_grandchild_first, tc)
+{
+	atf_tc_set_md_var(tc, "timeout", "2");
+}
+ATF_TC_BODY(reaper_sigchld_grandchild_first, tc)
+{
+	struct sigaction act;
+	sigset_t mask;
+	siginfo_t info;
+	pid_t parent, child, grandchild, pid;
+	int r;
+
+	/* Be paranoid. */
+	pid = waitpid(-1, NULL, WNOHANG);
+	ATF_REQUIRE(pid == -1 && errno == ECHILD);
+
+	act.sa_sigaction = dummy_sighandler;
+	act.sa_flags = SA_SIGINFO | SA_RESTART;
+	r = sigemptyset(&act.sa_mask);
+	ATF_REQUIRE_EQ(0, r);
+	r = sigaction(SIGCHLD, &act, NULL);
+	ATF_REQUIRE_EQ(0, r);
+
+	r = sigemptyset(&mask);
+	ATF_REQUIRE_EQ(0, r);
+	r = sigaddset(&mask, SIGCHLD);
+	ATF_REQUIRE_EQ(0, r);
+	r = sigprocmask(SIG_BLOCK, &mask, NULL);
+	ATF_REQUIRE_EQ(0, r);
+
+	parent = getpid();
+	r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL);
+	ATF_REQUIRE_EQ(0, r);
+
+	child = fork();
+	ATF_REQUIRE(child != -1);
+	if (child == 0) {
+		grandchild = fork();
+		if (grandchild == -1)
+			_exit(101);
+		else if (grandchild == 0)
+			_exit(2);
+		else {
+			if (waitid(P_PID, grandchild, NULL,
+			    WNOWAIT | WEXITED) != 0)
+				_exit(102);
+			_exit(3);
+		}
+	}
+
+	pid = waitpid(child, NULL, 0);
+	ATF_REQUIRE_EQ(child, pid);
+
+	r = sigwaitinfo(&mask, &info);
+	ATF_REQUIRE_EQ(SIGCHLD, r);
+	ATF_CHECK_EQ(SIGCHLD, info.si_signo);
+	ATF_CHECK_EQ(CLD_EXITED, info.si_code);
+	ATF_CHECK_EQ(2, info.si_status);
+	grandchild = info.si_pid;
+	ATF_REQUIRE(grandchild > 0);
+	ATF_REQUIRE(grandchild != parent);
+	ATF_REQUIRE(grandchild != child);
+
+	pid = waitpid(-1, NULL, 0);
+	ATF_REQUIRE_EQ(grandchild, pid);
+}
+
 ATF_TC_WITHOUT_HEAD(reaper_status);
 ATF_TC_BODY(reaper_status, tc)
 {
@@ -484,6 +644,8 @@ ATF_TP_ADD_TCS(tp)
 
 	ATF_TP_ADD_TC(tp, reaper_wait_child_first);
 	ATF_TP_ADD_TC(tp, reaper_wait_grandchild_first);
+	ATF_TP_ADD_TC(tp, reaper_sigchld_child_first);
+	ATF_TP_ADD_TC(tp, reaper_sigchld_grandchild_first);
 	ATF_TP_ADD_TC(tp, reaper_status);
 	ATF_TP_ADD_TC(tp, reaper_getpids);
 	ATF_TP_ADD_TC(tp, reaper_kill_badsig);

From owner-svn-src-all@freebsd.org  Mon Dec 12 22:57:09 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2496DC74B0D;
 Mon, 12 Dec 2016 22:57:09 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CF3F3A4B;
 Mon, 12 Dec 2016 22:57:08 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCMv8G4077827;
 Mon, 12 Dec 2016 22:57:08 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCMv8r8077826;
 Mon, 12 Dec 2016 22:57:08 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612122257.uBCMv8r8077826@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Mon, 12 Dec 2016 22:57:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309958 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 22:57:09 -0000

Author: dteske
Date: Mon Dec 12 22:57:07 2016
New Revision: 309958
URL: https://svnweb.freebsd.org/changeset/base/309958

Log:
  Quote WLAN_IFACE (pedantic)

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 22:51:29 2016	(r309957)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 22:57:07 2016	(r309958)
@@ -50,13 +50,13 @@ country_set()
 	ifconfig_args="${ifconfig_args# }"
 
 	# Regdomain/country cannot be applied while interface is running
-	iface_up=$( ifconfig -lu | grep -w $WLAN_IFACE )
-	[ "$iface_up" ] && ifconfig $WLAN_IFACE down
-	error_str=$( ifconfig $WLAN_IFACE $ifconfig_args 2>&1 |
+	iface_up=$( ifconfig -lu | grep -w "$WLAN_IFACE" )
+	[ "$iface_up" ] && ifconfig "$WLAN_IFACE" down
+	error_str=$( ifconfig "$WLAN_IFACE" $ifconfig_args 2>&1 |
 		sed -e 's/ifconfig: //' )
 	if [ "$iface_up" ]; then
 		# Restart wpa_supplicant(8) (should not fail).
-		wpa_supplicant -B -i $WLAN_IFACE -c \
+		wpa_supplicant -B -i "$WLAN_IFACE" -c \
 			"$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 	fi
 	if [ "$error_str" ]; then
@@ -93,7 +93,7 @@ dialog_country_select()
 	#
 	# Parse available countries/regdomains
 	#
-	input=$( ifconfig $WLAN_IFACE list countries | sed -e 's/DEBUG//gi' )
+	input=$( ifconfig "$WLAN_IFACE" list countries | sed -e 's/DEBUG//gi' )
 	regdomains=$( echo $input | sed -e 's/.*domains://' | tr ' ' '\n' |
 		sort | tr '\n' ' ' )
 	countries=$( echo $input | awk '{
@@ -178,7 +178,7 @@ fi
 if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	# Get current country/regdomain for selected interface
 	WLAN_IFACE=$( wpa_cli ifname | tail -1 )
-	INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -1 )
+	INPUT=$( ifconfig "$WLAN_IFACE" list regdomain | head -1 )
 	DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 )
 	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"

From owner-svn-src-all@freebsd.org  Mon Dec 12 23:20:47 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECEE0C740AD;
 Mon, 12 Dec 2016 23:20:47 +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 ADC8915CC;
 Mon, 12 Dec 2016 23:20:46 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au
 [122.106.153.191])
 by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id C39C0D67AE6;
 Tue, 13 Dec 2016 10:20:30 +1100 (AEDT)
Date: Tue, 13 Dec 2016 10:20:30 +1100 (EST)
From: Bruce Evans <brde@optusnet.com.au>
X-X-Sender: bde@besplex.bde.org
To: Edward Tomasz Napierala <trasz@freebsd.org>
cc: Konstantin Belousov <kostikbel@gmail.com>, src-committers@freebsd.org, 
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r309891 - head/sys/kern
In-Reply-To: <20161212191257.GA11238@brick>
Message-ID: <20161213091945.V1082@besplex.bde.org>
References: <201612121522.uBCFMMmm088698@repo.freebsd.org>
 <20161212163331.GH54029@kib.kiev.ua> <20161212191257.GA11238@brick>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.2 cv=cZeiljLM c=1 sm=1 tr=0
 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17
 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=GK_SPWWWGj36GUyTg_gA:9
 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2016 23:20:48 -0000

On Mon, 12 Dec 2016, Edward Tomasz Napierala wrote:

> On 1212T1833, Konstantin Belousov wrote:
>> On Mon, Dec 12, 2016 at 03:22:22PM +0000, Edward Tomasz Napierala wrote:
>>> Author: trasz
>>> Date: Mon Dec 12 15:22:21 2016
>>> New Revision: 309891
>>> URL: https://svnweb.freebsd.org/changeset/base/309891
>>>
>>> Log:
>>>   Avoid dereferencing NULL pointers in devtoname().  I've seen it panic,
>>>   called from ufs_print() in DDB.
>> Calls from DDB should not panic even if accessing NULL pointers.
>
> Yeah, by "panic" I've meant the "reentering ddb" thing.  It's not a panic
> per se, but still breaks eg "show lockedvnodes".

Hrmph.  kib didn't like my patch to kill the spam from reentering ddb.
The spam messes up even cases where the ddb command handles errors.
Howver, in most cases the error handling is incomplete.  There is always
the outer setjmp/longjmp back to the command loop.  This gives null and
bad error handling for unexpected null pointer accesses like the one here.
Other cases set up inner setjump/longjmps which longjmp back to an inner
context which prints an error message (spammed by the reentry messages)
and should clean up.  However, cleanup is rarely done.  One case is
writing to inaccessible memory on at least x86.  Then the page tables
are left in modified state.

Null pointer panics are also interesting.  They seem to have been broken
on i386 by the double mapping of low memory (PTD[0] = PTD[KERNBASE >> 12] =
shared page table for low physical memory).  So the null pointer is mapped
and points to physical memory 0 .  There are other bugs from the shared
page table.  When I fix the other bugs by changing PTD[0] to 0, this also
fixes null pointers.  It breaks ACPI resume but not much else.  See
locore.s for some details about the mapping -- it is documented as being
mainly for ACPI.  But ACPI somehow works on amd64 with PTD[0] = 0.

>> That said, I also do not think that this is the right place to change.
>> UFS um_dev should not be NULL for any active mount.

It could even be a KASSERT(), but that would break use in ddb.  Perhaps
there are already many KASSERT()s in utility functions that break use
in ddb.

Here is my old fix for a similar bug in the tty driver:

X Index: tty.h
X ===================================================================
X --- tty.h	(revision 309660)
X +++ tty.h	(working copy)
X @@ -205,7 +215,8 @@
X  #define	tty_opened(tp)		((tp)->t_flags & TF_OPENED)
X  #define	tty_gone(tp)		((tp)->t_flags & TF_GONE)
X  #define	tty_softc(tp)		((tp)->t_devswsoftc)
X -#define	tty_devname(tp)		devtoname((tp)->t_dev)
X +#define	tty_devname(tp)		((tp)->t_dev == NULL ? "amnesiac" : \
X +				    devtoname((tp)->t_dev))
X 
X  /* Status line printing. */
X  void	tty_info(struct tty *tp);

In the tty driver, the pointer can be null when the device is going away,
but the ddb command "show [all] tty" accesses the tty until it has
completely gone away.  Perhaps similarly for vnodes -- the state of an
object under construction or destruction is especially interesting.

> After looking at this once again I agree.  Looks like some kind of bug
> specific to my sources at that point of time.  Backed off.

Thanks.  This also fixes a style bug (extra blank line).

Bruce

From owner-svn-src-all@freebsd.org  Tue Dec 13 00:03:01 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D2D4C74D83;
 Tue, 13 Dec 2016 00:03:01 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E2477EE4;
 Tue, 13 Dec 2016 00:03:00 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD030qP005882;
 Tue, 13 Dec 2016 00:03:00 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD030oK005881;
 Tue, 13 Dec 2016 00:03:00 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130003.uBD030oK005881@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 00:03:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309959 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 00:03:01 -0000

Author: dteske
Date: Tue Dec 13 00:02:59 2016
New Revision: 309959
URL: https://svnweb.freebsd.org/changeset/base/309959

Log:
  Use the oft-neglected awk syntax "startcondition, stopcondition { ... }" to
  process the range of country labels which appear as columnar list from the
  "ifconfig DEV list countries" command. Not only improving maintainability,
  but also properly encapsulating arguments in single-quotes instead of
  trying to escape whitespace. It is also completely unnecessary to collapse
  newlines into whitespace (shell will do this for you automatically upon
  expansion of the contents where necessary).
  
  NB: This also changes the sorting algorithm to sort on the country code,
  not the country name. The type-ahead feature of dialog is destroyed if the
  tags are not sorted properly.

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 22:57:07 2016	(r309958)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 00:02:59 2016	(r309959)
@@ -96,17 +96,19 @@ dialog_country_select()
 	input=$( ifconfig "$WLAN_IFACE" list countries | sed -e 's/DEBUG//gi' )
 	regdomains=$( echo $input | sed -e 's/.*domains://' | tr ' ' '\n' |
 		sort | tr '\n' ' ' )
-	countries=$( echo $input | awk '{
-		sub(/Country codes:/, "")
-		sub(/Regulatory.*/, "")
-		for (i = 1; i <= NF; i++) {
-			printf "%s", $i
-			if ($i ~ /[[:lower:]]/)
-				printf $(i+1) ~ /[[:lower:]]/ ? "\\\\\\ " : "\n"
-			else
-				printf " "
+	countries=$( echo "$input" | awk '
+		sub(/Country codes:/, ""), sub(/Regulatory.*/, "") {
+			while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) {
+				country = substr($0, RSTART)
+				sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country)
+				code = substr(country, 1, 2)
+				desc = substr(country, 4)
+				sub(/[[:space:]]*$/, "", desc)
+				printf "'\''%s'\'' '\''%s'\''\n", code, desc
+				$0 = substr($0, RSTART + RLENGTH)
+			}
 		}
-	}' | sort -k 2 | tr '\n' ' ' )
+	' | sort )
 
 	f_dialog_title "Regdomain selection"
 	f_dialog_menu_size height width rows "$DIALOG_TITLE" \
@@ -123,16 +125,18 @@ dialog_country_select()
 	)
 
 	f_dialog_title "Country selection"
-	f_dialog_menu_size height width rows "$DIALOG_TITLE" \
-		"$DIALOG_BACKTITLE" "Select your country." "" $countries
-	country=$( sh -c "$DIALOG \
-		--title \"$DIALOG_TITLE\" \
-		--backtitle \"$DIALOG_BACKTITLE\" \
-		--cancel-label \"$msg_skip\" \
+	eval f_dialog_menu_size height width rows \
+		\"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \
+		\"Select your country.\" \"\" $countries
+	country=$( eval $DIALOG \
+		--title \"\$DIALOG_TITLE\" \
+		--backtitle \"\$DIALOG_BACKTITLE\" \
+		--cancel-label \"\$msg_skip\" \
 		--default-item \"$default_country\" \
-		--stdout \
 		--menu \"Select your country.\" \
-		$height $width $rows $countries"
+		$height $width $rows \
+		$countries \
+		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
 
 	country_set "$regdomain" "$country"

From owner-svn-src-all@freebsd.org  Tue Dec 13 00:18:52 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A77EC732D4;
 Tue, 13 Dec 2016 00:18:52 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 09CA318B2;
 Tue, 13 Dec 2016 00:18:51 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD0IpSr010138;
 Tue, 13 Dec 2016 00:18:51 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD0Ip3c010137;
 Tue, 13 Dec 2016 00:18:51 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130018.uBD0Ip3c010137@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 00:18:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309960 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 00:18:52 -0000

Author: dteske
Date: Tue Dec 13 00:18:51 2016
New Revision: 309960
URL: https://svnweb.freebsd.org/changeset/base/309960

Log:
  Add missing backslash (no real effect; it's pedantic and correct for
  the interpolation level)

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 00:02:59 2016	(r309959)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 00:18:51 2016	(r309960)
@@ -132,7 +132,7 @@ dialog_country_select()
 		--title \"\$DIALOG_TITLE\" \
 		--backtitle \"\$DIALOG_BACKTITLE\" \
 		--cancel-label \"\$msg_skip\" \
-		--default-item \"$default_country\" \
+		--default-item \"\$default_country\" \
 		--menu \"Select your country.\" \
 		$height $width $rows \
 		$countries \

From owner-svn-src-all@freebsd.org  Tue Dec 13 00:22:02 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93C0FC737ED;
 Tue, 13 Dec 2016 00:22:02 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4AFCB1FE7;
 Tue, 13 Dec 2016 00:22:02 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD0M1nv013788;
 Tue, 13 Dec 2016 00:22:01 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD0M1BU013787;
 Tue, 13 Dec 2016 00:22:01 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130022.uBD0M1BU013787@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 00:22:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309961 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 00:22:02 -0000

Author: dteske
Date: Tue Dec 13 00:22:01 2016
New Revision: 309961
URL: https://svnweb.freebsd.org/changeset/base/309961

Log:
  Stop repeating strings (centralize prompt string)
  NB: Changes to strings now only affect a single line

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 00:18:51 2016	(r309960)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 00:22:01 2016	(r309961)
@@ -85,7 +85,7 @@ country_set()
 
 dialog_country_select()
 {
-	local input regdomains countries regdomain country
+	local input regdomains countries regdomain country prompt
 	local no_default="<not selected>"
 	local default_regdomain="${1:-$no_default}"
 	local default_country="${2:-$no_default}"
@@ -111,8 +111,9 @@ dialog_country_select()
 	' | sort )
 
 	f_dialog_title "Regdomain selection"
+	prompt="Select your regdomain."
 	f_dialog_menu_size height width rows "$DIALOG_TITLE" \
-		"$DIALOG_BACKTITLE" "Select your regdomain." "" $regdomains
+		"$DIALOG_BACKTITLE" "$prompt" "" $regdomains
 	regdomain=$( sh -c "$DIALOG \
 		--title \"$DIALOG_TITLE\" \
 		--backtitle \"$DIALOG_BACKTITLE\" \
@@ -120,20 +121,21 @@ dialog_country_select()
 		--default-item \"$default_regdomain\" \
 		--no-items \
 		--stdout \
-		--menu \"Select your regdomain.\" \
+		--menu \"$prompt\" \
 		$height $width $rows $regdomains"
 	)
 
 	f_dialog_title "Country selection"
+	prompt="Select your country."
 	eval f_dialog_menu_size height width rows \
 		\"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \
-		\"Select your country.\" \"\" $countries
+		\"\$prompt\" \"\" $countries
 	country=$( eval $DIALOG \
 		--title \"\$DIALOG_TITLE\" \
 		--backtitle \"\$DIALOG_BACKTITLE\" \
 		--cancel-label \"\$msg_skip\" \
 		--default-item \"\$default_country\" \
-		--menu \"Select your country.\" \
+		--menu \"\$prompt\" \
 		$height $width $rows \
 		$countries \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD

From owner-svn-src-all@freebsd.org  Tue Dec 13 00:27:57 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF288C739EC;
 Tue, 13 Dec 2016 00:27:57 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9EB2C3C8;
 Tue, 13 Dec 2016 00:27:57 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD0Ru3g014036;
 Tue, 13 Dec 2016 00:27:56 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD0Rub9014035;
 Tue, 13 Dec 2016 00:27:56 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130027.uBD0Rub9014035@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 00:27:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309962 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 00:27:57 -0000

Author: dteske
Date: Tue Dec 13 00:27:56 2016
New Revision: 309962
URL: https://svnweb.freebsd.org/changeset/base/309962

Log:
  More efficiently make use of the exit status

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 00:22:01 2016	(r309961)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 00:27:56 2016	(r309962)
@@ -67,12 +67,8 @@ country_set()
 			--no-label Ignore \
 			--yesno \
 			"Error while applying chosen settings ($error_str)" \
-			0 0
-		if [ $? -eq $DIALOG_OK ]; then
-			return $FAILURE # Restart
-		else
-			return $SUCCESS # Skip
-		fi
+			0 0 || return $SUCCESS # Skip
+		return $FAILURE # Restart
 	else
 		awk 'sub(/^\t\t/,"")||1' \
 			> "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF

From owner-svn-src-all@freebsd.org  Tue Dec 13 01:35:27 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B34CCC7468C;
 Tue, 13 Dec 2016 01:35:27 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 66442CE5;
 Tue, 13 Dec 2016 01:35:27 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD1ZQ00041908;
 Tue, 13 Dec 2016 01:35:26 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD1ZQPn041907;
 Tue, 13 Dec 2016 01:35:26 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130135.uBD1ZQPn041907@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 01:35:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309963 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 01:35:27 -0000

Author: dteske
Date: Tue Dec 13 01:35:26 2016
New Revision: 309963
URL: https://svnweb.freebsd.org/changeset/base/309963

Log:
  The --no-items and --stdout options are non-standard and should be avoided
  
  From the dialog(1) manual:
  using [--stdout] in portable scripts is not recommended

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 00:27:56 2016	(r309962)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:35:26 2016	(r309963)
@@ -90,8 +90,13 @@ dialog_country_select()
 	# Parse available countries/regdomains
 	#
 	input=$( ifconfig "$WLAN_IFACE" list countries | sed -e 's/DEBUG//gi' )
-	regdomains=$( echo $input | sed -e 's/.*domains://' | tr ' ' '\n' |
-		sort | tr '\n' ' ' )
+	regdomains=$( echo "$input" | awk '
+		sub(/.*domains:/, ""), /[^[:alnum:][[:space:]]/ {
+			n = split($0, domains)
+			for (i = 1; i <= n; i++)
+				printf "'\''%s'\'' '\'\''", domains[i]
+		}
+	' )
 	countries=$( echo "$input" | awk '
 		sub(/Country codes:/, ""), sub(/Regulatory.*/, "") {
 			while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) {
@@ -108,17 +113,18 @@ dialog_country_select()
 
 	f_dialog_title "Regdomain selection"
 	prompt="Select your regdomain."
-	f_dialog_menu_size height width rows "$DIALOG_TITLE" \
-		"$DIALOG_BACKTITLE" "$prompt" "" $regdomains
-	regdomain=$( sh -c "$DIALOG \
-		--title \"$DIALOG_TITLE\" \
-		--backtitle \"$DIALOG_BACKTITLE\" \
-		--cancel-label \"$msg_skip\" \
-		--default-item \"$default_regdomain\" \
-		--no-items \
-		--stdout \
-		--menu \"$prompt\" \
-		$height $width $rows $regdomains"
+	eval f_dialog_menu_size height width rows \
+		\"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \
+		\"\$prompt\" \"\" $regdomains
+	regdomain=$( eval $DIALOG \
+		--title \"\$DIALOG_TITLE\" \
+		--backtitle \"\$DIALOG_BACKTITLE\" \
+		--cancel-label \"\$msg_skip\" \
+		--default-item \"\$default_regdomain\" \
+		--menu \"\$prompt\" \
+		$height $width $rows \
+		$regdomains \
+		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
 
 	f_dialog_title "Country selection"

From owner-svn-src-all@freebsd.org  Tue Dec 13 01:36:48 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E01AC7478F;
 Tue, 13 Dec 2016 01:36:48 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CAFC11114;
 Tue, 13 Dec 2016 01:36:47 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD1alDM042101;
 Tue, 13 Dec 2016 01:36:47 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD1altZ042100;
 Tue, 13 Dec 2016 01:36:47 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130136.uBD1altZ042100@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 01:36:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309964 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 01:36:48 -0000

Author: dteske
Date: Tue Dec 13 01:36:46 2016
New Revision: 309964
URL: https://svnweb.freebsd.org/changeset/base/309964

Log:
  Sort the domains

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:35:26 2016	(r309963)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:36:46 2016	(r309964)
@@ -96,7 +96,7 @@ dialog_country_select()
 			for (i = 1; i <= n; i++)
 				printf "'\''%s'\'' '\'\''", domains[i]
 		}
-	' )
+	' | sort )
 	countries=$( echo "$input" | awk '
 		sub(/Country codes:/, ""), sub(/Regulatory.*/, "") {
 			while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) {

From owner-svn-src-all@freebsd.org  Tue Dec 13 01:39:10 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEE61C748B6;
 Tue, 13 Dec 2016 01:39:10 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7E8F4132C;
 Tue, 13 Dec 2016 01:39:10 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD1d9v0042219;
 Tue, 13 Dec 2016 01:39:09 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD1d9KF042218;
 Tue, 13 Dec 2016 01:39:09 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130139.uBD1d9KF042218@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 01:39:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309965 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 01:39:10 -0000

Author: dteske
Date: Tue Dec 13 01:39:09 2016
New Revision: 309965
URL: https://svnweb.freebsd.org/changeset/base/309965

Log:
  Whitespace alignment

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:36:46 2016	(r309964)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:39:09 2016	(r309965)
@@ -117,13 +117,13 @@ dialog_country_select()
 		\"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \
 		\"\$prompt\" \"\" $regdomains
 	regdomain=$( eval $DIALOG \
-		--title \"\$DIALOG_TITLE\" \
-		--backtitle \"\$DIALOG_BACKTITLE\" \
-		--cancel-label \"\$msg_skip\" \
+		--title \"\$DIALOG_TITLE\"             \
+		--backtitle \"\$DIALOG_BACKTITLE\"     \
+		--cancel-label \"\$msg_skip\"          \
 		--default-item \"\$default_regdomain\" \
-		--menu \"\$prompt\" \
-		$height $width $rows \
-		$regdomains \
+		--menu \"\$prompt\"                    \
+		$height $width $rows                   \
+		$regdomains                            \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
 
@@ -133,13 +133,13 @@ dialog_country_select()
 		\"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \
 		\"\$prompt\" \"\" $countries
 	country=$( eval $DIALOG \
-		--title \"\$DIALOG_TITLE\" \
-		--backtitle \"\$DIALOG_BACKTITLE\" \
-		--cancel-label \"\$msg_skip\" \
+		--title \"\$DIALOG_TITLE\"           \
+		--backtitle \"\$DIALOG_BACKTITLE\"   \
+		--cancel-label \"\$msg_skip\"        \
 		--default-item \"\$default_country\" \
-		--menu \"\$prompt\" \
-		$height $width $rows \
-		$countries \
+		--menu \"\$prompt\"                  \
+		$height $width $rows                 \
+		$countries                           \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
 

From owner-svn-src-all@freebsd.org  Tue Dec 13 01:41:07 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E7DAC74AA5;
 Tue, 13 Dec 2016 01:41:07 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6B75617DD;
 Tue, 13 Dec 2016 01:41:07 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD1f6eh045343;
 Tue, 13 Dec 2016 01:41:06 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD1f6sF045342;
 Tue, 13 Dec 2016 01:41:06 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130141.uBD1f6sF045342@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 01:41:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309966 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 01:41:07 -0000

Author: dteske
Date: Tue Dec 13 01:41:06 2016
New Revision: 309966
URL: https://svnweb.freebsd.org/changeset/base/309966

Log:
  The output of dialog needs to be sanitized
  for portability/compatibility requirements

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:39:09 2016	(r309965)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:41:06 2016	(r309966)
@@ -126,6 +126,7 @@ dialog_country_select()
 		$regdomains                            \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
+	f_dialog_data_sanitize regdomain
 
 	f_dialog_title "Country selection"
 	prompt="Select your country."
@@ -142,6 +143,7 @@ dialog_country_select()
 		$countries                           \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
+	f_dialog_data_sanitize country
 
 	country_set "$regdomain" "$country"
 }
@@ -245,7 +247,9 @@ while :; do
 		$( echo $NETWORKS | tr '\n' ' ' )" \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
-	case $? in
+	retval=$?
+	f_dialog_data_sanitize NETWORK
+	case $retval in
 	$DIALOG_OK) break ;;
 	$DIALOG_CANCEL)
 		# here we ask if the user wants to select the network manually

From owner-svn-src-all@freebsd.org  Tue Dec 13 01:42:14 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED911C74B6E;
 Tue, 13 Dec 2016 01:42:14 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BD1D01BA6;
 Tue, 13 Dec 2016 01:42:14 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD1gDD4046290;
 Tue, 13 Dec 2016 01:42:13 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD1gDBB046289;
 Tue, 13 Dec 2016 01:42:13 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130142.uBD1gDBB046289@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 01:42:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309967 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 01:42:15 -0000

Author: dteske
Date: Tue Dec 13 01:42:13 2016
New Revision: 309967
URL: https://svnweb.freebsd.org/changeset/base/309967

Log:
  Use more generic f_yesno() from provided API

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:41:06 2016	(r309966)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:42:13 2016	(r309967)
@@ -254,7 +254,7 @@ while :; do
 	$DIALOG_CANCEL)
 		# here we ask if the user wants to select the network manually
 		f_dialog_title "Network Selection"
-		f_dialog_yesno "Do you want to select the network manually?" || exit 1
+		f_yesno "Do you want to select the network manually?" || exit 1
 		f_dialog_input NETWORK "Enter SSID" || exit 1
 		ENCRYPTION=$( $DIALOG \
 			--title "$DIALOG_TITLE" \

From owner-svn-src-all@freebsd.org  Tue Dec 13 01:44:19 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46AEDC74DC5;
 Tue, 13 Dec 2016 01:44:19 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 162D11DE6;
 Tue, 13 Dec 2016 01:44:19 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD1iImp046411;
 Tue, 13 Dec 2016 01:44:18 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD1iIDQ046410;
 Tue, 13 Dec 2016 01:44:18 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130144.uBD1iIDQ046410@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 01:44:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309968 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 01:44:19 -0000

Author: dteske
Date: Tue Dec 13 01:44:18 2016
New Revision: 309968
URL: https://svnweb.freebsd.org/changeset/base/309968

Log:
  Properly quote variable

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:42:13 2016	(r309967)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:44:18 2016	(r309968)
@@ -189,8 +189,8 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	# Get current country/regdomain for selected interface
 	WLAN_IFACE=$( wpa_cli ifname | tail -1 )
 	INPUT=$( ifconfig "$WLAN_IFACE" list regdomain | head -1 )
-	DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 )
-	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
+	DEF_REGDOMAIN=$( echo "$INPUT" | cut -w -f 2 )
+	DEF_COUNTRY=$( echo "$INPUT" | cut -w -f 4 )
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
 	f_dialog_title "Regdomain/country"

From owner-svn-src-all@freebsd.org  Tue Dec 13 01:50:23 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 960D0C74064;
 Tue, 13 Dec 2016 01:50:23 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 65DED1063;
 Tue, 13 Dec 2016 01:50:23 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD1oM5l046669;
 Tue, 13 Dec 2016 01:50:22 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD1oM1g046668;
 Tue, 13 Dec 2016 01:50:22 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130150.uBD1oM1g046668@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 01:50:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309969 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 01:50:23 -0000

Author: dteske
Date: Tue Dec 13 01:50:22 2016
New Revision: 309969
URL: https://svnweb.freebsd.org/changeset/base/309969

Log:
  Why repeat yourself when you can send stderr to the same place as stdout?

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:44:18 2016	(r309968)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:50:22 2016	(r309969)
@@ -165,13 +165,13 @@ EOF
 # Try to reach wpa_supplicant. If it isn't running and we can modify the
 # existing system, start it. Otherwise, fail.
 #
-(wpa_cli ping >/dev/null 2>/dev/null || ([ "$BSDINSTALL_CONFIGCURRENT" ] &&
+(wpa_cli ping > /dev/null 2>&1 || ([ "$BSDINSTALL_CONFIGCURRENT" ] &&
 	wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) ||
 	($DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \
 	"Could not start wpa_supplicant!" 0 0; exit 1) || exit 1
 
 # See if we succeeded
-wpa_cli ping >/dev/null 2>/dev/null
+wpa_cli ping > /dev/null 2>&1
 if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then
 	$DIALOG \
 		--title "$msg_error" \

From owner-svn-src-all@freebsd.org  Tue Dec 13 01:52:11 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E792C74268;
 Tue, 13 Dec 2016 01:52:11 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0E09014E8;
 Tue, 13 Dec 2016 01:52:10 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD1qA6k050336;
 Tue, 13 Dec 2016 01:52:10 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD1qA75050335;
 Tue, 13 Dec 2016 01:52:10 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130152.uBD1qA75050335@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 01:52:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309970 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 01:52:11 -0000

Author: dteske
Date: Tue Dec 13 01:52:10 2016
New Revision: 309970
URL: https://svnweb.freebsd.org/changeset/base/309970

Log:
  Remove completely unnecesary parentheses

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:50:22 2016	(r309969)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:52:10 2016	(r309970)
@@ -165,10 +165,10 @@ EOF
 # Try to reach wpa_supplicant. If it isn't running and we can modify the
 # existing system, start it. Otherwise, fail.
 #
-(wpa_cli ping > /dev/null 2>&1 || ([ "$BSDINSTALL_CONFIGCURRENT" ] &&
-	wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) ||
-	($DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \
-	"Could not start wpa_supplicant!" 0 0; exit 1) || exit 1
+wpa_cli ping > /dev/null 2>&1 || ([ "$BSDINSTALL_CONFIGCURRENT" ] &&
+	wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") ||
+	$DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \
+	"Could not start wpa_supplicant!" 0 0; exit 1 || exit 1
 
 # See if we succeeded
 wpa_cli ping > /dev/null 2>&1

From owner-svn-src-all@freebsd.org  Tue Dec 13 01:54:45 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D2E8C7437B;
 Tue, 13 Dec 2016 01:54:45 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3CC351736;
 Tue, 13 Dec 2016 01:54:45 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD1sieh050465;
 Tue, 13 Dec 2016 01:54:44 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD1siI0050464;
 Tue, 13 Dec 2016 01:54:44 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130154.uBD1siI0050464@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 01:54:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309971 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 01:54:45 -0000

Author: dteske
Date: Tue Dec 13 01:54:44 2016
New Revision: 309971
URL: https://svnweb.freebsd.org/changeset/base/309971

Log:
  Start deconstructing a conveluted hunk of code

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:52:10 2016	(r309970)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:54:44 2016	(r309971)
@@ -165,10 +165,12 @@ EOF
 # Try to reach wpa_supplicant. If it isn't running and we can modify the
 # existing system, start it. Otherwise, fail.
 #
-wpa_cli ping > /dev/null 2>&1 || ([ "$BSDINSTALL_CONFIGCURRENT" ] &&
-	wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") ||
-	$DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \
-	"Could not start wpa_supplicant!" 0 0; exit 1 || exit 1
+if ! wpa_cli ping > /dev/null 2>&1; then
+	([ "$BSDINSTALL_CONFIGCURRENT" ] &&
+		wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") ||
+		$DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \
+		"Could not start wpa_supplicant!" 0 0; exit 1 || exit 1
+fi
 
 # See if we succeeded
 wpa_cli ping > /dev/null 2>&1

From owner-svn-src-all@freebsd.org  Tue Dec 13 01:56:29 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 586A5C74428;
 Tue, 13 Dec 2016 01:56:29 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2820C1973;
 Tue, 13 Dec 2016 01:56:29 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD1uS1F050588;
 Tue, 13 Dec 2016 01:56:28 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD1uSh8050587;
 Tue, 13 Dec 2016 01:56:28 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130156.uBD1uSh8050587@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 01:56:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309972 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 01:56:29 -0000

Author: dteske
Date: Tue Dec 13 01:56:28 2016
New Revision: 309972
URL: https://svnweb.freebsd.org/changeset/base/309972

Log:
  If the first ping succeeded, why on Earth should we ping it again?

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:54:44 2016	(r309971)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:56:28 2016	(r309972)
@@ -170,19 +170,19 @@ if ! wpa_cli ping > /dev/null 2>&1; then
 		wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") ||
 		$DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \
 		"Could not start wpa_supplicant!" 0 0; exit 1 || exit 1
-fi
 
-# See if we succeeded
-wpa_cli ping > /dev/null 2>&1
-if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then
-	$DIALOG \
-		--title "$msg_error" \
-		--backtitle "$DIALOG_BACKTITLE" \
-		--msgbox "Wireless cannot be configured without making changes to the local system!" \
-		0 0
-	exit 1
+	wpa_cli ping > /dev/null 2>&1
+	if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then
+		$DIALOG \
+			--title "$msg_error" \
+			--backtitle "$DIALOG_BACKTITLE" \
+			--msgbox "Wireless cannot be configured without making changes to the local system!" \
+			0 0
+		exit 1
+	fi
 fi
 
+
 #
 # There is no way to check country/regdomain without (possible)
 # interface state modification

From owner-svn-src-all@freebsd.org  Tue Dec 13 01:59:36 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A2B8C7457A;
 Tue, 13 Dec 2016 01:59:36 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 49A931B9C;
 Tue, 13 Dec 2016 01:59:36 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD1xZHP050725;
 Tue, 13 Dec 2016 01:59:35 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD1xZ3b050724;
 Tue, 13 Dec 2016 01:59:35 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130159.uBD1xZ3b050724@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 01:59:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309973 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 01:59:36 -0000

Author: dteske
Date: Tue Dec 13 01:59:35 2016
New Revision: 309973
URL: https://svnweb.freebsd.org/changeset/base/309973

Log:
  Why use $? when you can use the command itself

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:56:28 2016	(r309972)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:59:35 2016	(r309973)
@@ -171,8 +171,7 @@ if ! wpa_cli ping > /dev/null 2>&1; then
 		$DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \
 		"Could not start wpa_supplicant!" 0 0; exit 1 || exit 1
 
-	wpa_cli ping > /dev/null 2>&1
-	if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then
+	if ! wpa_cli ping > /dev/null 2>&1 && [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then
 		$DIALOG \
 			--title "$msg_error" \
 			--backtitle "$DIALOG_BACKTITLE" \

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:02:16 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BC16C747C5;
 Tue, 13 Dec 2016 02:02:16 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CF9541FBA;
 Tue, 13 Dec 2016 02:02:15 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD22FBH053584;
 Tue, 13 Dec 2016 02:02:15 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD22FAA053566;
 Tue, 13 Dec 2016 02:02:15 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130202.uBD22FAA053566@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:02:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309974 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:02:16 -0000

Author: dteske
Date: Tue Dec 13 02:02:14 2016
New Revision: 309974
URL: https://svnweb.freebsd.org/changeset/base/309974

Log:
  These two error messages have always been backwards since inception

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 01:59:35 2016	(r309973)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:02:14 2016	(r309974)
@@ -169,13 +169,13 @@ if ! wpa_cli ping > /dev/null 2>&1; then
 	([ "$BSDINSTALL_CONFIGCURRENT" ] &&
 		wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") ||
 		$DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \
-		"Could not start wpa_supplicant!" 0 0; exit 1 || exit 1
+		"Wireless cannot be configured without making changes to the local system!" 0 0; exit 1 || exit 1
 
 	if ! wpa_cli ping > /dev/null 2>&1 && [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then
 		$DIALOG \
 			--title "$msg_error" \
 			--backtitle "$DIALOG_BACKTITLE" \
-			--msgbox "Wireless cannot be configured without making changes to the local system!" \
+			--msgbox "Could not start wpa_supplicant!" \
 			0 0
 		exit 1
 	fi

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:04:51 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C176FC74884;
 Tue, 13 Dec 2016 02:04:51 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9105F11F5;
 Tue, 13 Dec 2016 02:04:51 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD24oJs054487;
 Tue, 13 Dec 2016 02:04:50 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD24oUm054486;
 Tue, 13 Dec 2016 02:04:50 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130204.uBD24oUm054486@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:04:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309975 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:04:51 -0000

Author: dteske
Date: Tue Dec 13 02:04:50 2016
New Revision: 309975
URL: https://svnweb.freebsd.org/changeset/base/309975

Log:
  Continued resolution of conveluted statement
  We shouldn't be coding things like "x || (x && x) || x || x || x ..."

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:02:14 2016	(r309974)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:04:50 2016	(r309975)
@@ -166,10 +166,12 @@ EOF
 # existing system, start it. Otherwise, fail.
 #
 if ! wpa_cli ping > /dev/null 2>&1; then
-	([ "$BSDINSTALL_CONFIGCURRENT" ] &&
-		wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") ||
+	if [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then
 		$DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \
-		"Wireless cannot be configured without making changes to the local system!" 0 0; exit 1 || exit 1
+			"Wireless cannot be configured without making changes to the local system!" 0 0
+		exit 1
+	fi
+	wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") || exit 1
 
 	if ! wpa_cli ping > /dev/null 2>&1 && [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then
 		$DIALOG \

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:07:14 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06DB6C74908;
 Tue, 13 Dec 2016 02:07:14 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CA16C1392;
 Tue, 13 Dec 2016 02:07:13 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD27D62054612;
 Tue, 13 Dec 2016 02:07:13 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD27CZf054611;
 Tue, 13 Dec 2016 02:07:12 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130207.uBD27CZf054611@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:07:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309976 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:07:14 -0000

Author: dteske
Date: Tue Dec 13 02:07:12 2016
New Revision: 309976
URL: https://svnweb.freebsd.org/changeset/base/309976

Log:
  You don't need parentheses for awk's printf

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:04:50 2016	(r309975)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:07:12 2016	(r309976)
@@ -226,7 +226,7 @@ while :; do
 
 	SCAN_RESULTS=$( wpa_cli scan_results )
 	NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' '
-		/..:..:..:..:..:../ && $5 { printf("\"%s\"\t%s\n", $5, $4) }
+		/..:..:..:..:..:../ && $5 { printf "\"%s\"\t%s\n", $5, $4 }
 	' | sort | uniq )
 
 	if [ ! "$NETWORKS" ]; then

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:11:10 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7782C74A95;
 Tue, 13 Dec 2016 02:11:10 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7ECFD1657;
 Tue, 13 Dec 2016 02:11:10 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2B96J054821;
 Tue, 13 Dec 2016 02:11:09 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2B9mp054820;
 Tue, 13 Dec 2016 02:11:09 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130211.uBD2B9mp054820@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:11:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309977 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:11:10 -0000

Author: dteske
Date: Tue Dec 13 02:11:09 2016
New Revision: 309977
URL: https://svnweb.freebsd.org/changeset/base/309977

Log:
  Whitespace and alignment

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:07:12 2016	(r309976)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:11:09 2016	(r309977)
@@ -183,7 +183,6 @@ if ! wpa_cli ping > /dev/null 2>&1; then
 	fi
 fi
 
-
 #
 # There is no way to check country/regdomain without (possible)
 # interface state modification
@@ -283,13 +282,13 @@ done
 
 if echo $ENCRYPTION | grep -q 'PSK'; then
 	PASS=$( $DIALOG \
-		--title "WPA Setup" \
-		--backtitle "$DIALOG_BACKTITLE" \
-		--insecure \
-		--mixedform "" \
-		0 0 0 \
+		--title "WPA Setup"              \
+		--backtitle "$DIALOG_BACKTITLE"  \
+		--insecure                       \
+		--mixedform ""                   \
+		0 0 0                            \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
-		"Password" 2 0 "" 2 12 15 63 1 \
+		"Password" 2 0 "" 2 12 15 63 1   \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	) || exec "$0" "$@"
 	awk 'sub(/^\t/,"")||1' \
@@ -303,14 +302,14 @@ if echo $ENCRYPTION | grep -q 'PSK'; the
 	EOF
 elif echo $ENCRYPTION | grep -q EAP; then
 	USERPASS=$( $DIALOG \
-		--title "WPA-Enterprise Setup" \
-		--backtitle "$DIALOG_BACKTITLE" \
-		--insecure \
-		--mixedform "" \
-		0 0 0 \
+		--title "WPA-Enterprise Setup"   \
+		--backtitle "$DIALOG_BACKTITLE"  \
+		--insecure                       \
+		--mixedform ""                   \
+		0 0 0                            \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
-		"Username" 2 0 "" 2 12 25 63 0 \
-		"Password" 3 0 "" 3 12 25 63 1 \
+		"Username" 2 0 "" 2 12 25 63 0   \
+		"Password" 3 0 "" 3 12 25 63 1   \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	) || exec "$0" "$@"
 	awk 'sub(/^\t/,"")||1' \
@@ -328,13 +327,13 @@ elif echo $ENCRYPTION | grep -q EAP; the
 	EOF
 elif echo $ENCRYPTION | grep -q WEP; then
 	WEPKEY=$( $DIALOG \
-		--title "WEP Setup" \
-		--backtitle "$DIALOG_BACKTITLE" \
-		--insecure \
-		--mixedform "" \
-		0 0 0 \
+		--title "WEP Setup"              \
+		--backtitle "$DIALOG_BACKTITLE"  \
+		--insecure                       \
+		--mixedform ""                   \
+		0 0 0                            \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
-		"WEP Key 0" 2 0 "" 2 12 15 0 1 \
+		"WEP Key 0" 2 0 "" 2 12 15 0 1   \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	) || exec "$0" "$@"
 	awk 'sub(/^\t/,"")||1' \

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:12:01 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 902C3C74B09;
 Tue, 13 Dec 2016 02:12:01 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 563FB1882;
 Tue, 13 Dec 2016 02:12:01 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2C0UF057813;
 Tue, 13 Dec 2016 02:12:00 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2C0DE057812;
 Tue, 13 Dec 2016 02:12:00 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130212.uBD2C0DE057812@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:12:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309978 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:12:01 -0000

Author: dteske
Date: Tue Dec 13 02:12:00 2016
New Revision: 309978
URL: https://svnweb.freebsd.org/changeset/base/309978

Log:
  Neither printf (and as is commonly known) nor print need parens in awk

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:11:09 2016	(r309977)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:12:00 2016	(r309978)
@@ -278,7 +278,7 @@ while :; do
 done
 
 [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" |
-	awk -F '\t' "/^\"$NETWORK\"\t/ { printf(\"%s\n\", \\\$2 ) }" )
+	awk -F '\t' "/^\"$NETWORK\"\t/ { printf \"%s\n\", \\\$2 }" )
 
 if echo $ENCRYPTION | grep -q 'PSK'; then
 	PASS=$( $DIALOG \

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:13:21 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDE0CC74CC2;
 Tue, 13 Dec 2016 02:13:21 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8D76E1B7D;
 Tue, 13 Dec 2016 02:13:21 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2DKg8058629;
 Tue, 13 Dec 2016 02:13:20 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2DK8q058628;
 Tue, 13 Dec 2016 02:13:20 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130213.uBD2DK8q058628@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:13:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309979 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:13:21 -0000

Author: dteske
Date: Tue Dec 13 02:13:20 2016
New Revision: 309979
URL: https://svnweb.freebsd.org/changeset/base/309979

Log:
  This statement has too many backslashes

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:12:00 2016	(r309978)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:13:20 2016	(r309979)
@@ -278,7 +278,7 @@ while :; do
 done
 
 [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" |
-	awk -F '\t' "/^\"$NETWORK\"\t/ { printf \"%s\n\", \\\$2 }" )
+	awk -F '\t' "/^\"$NETWORK\"\t/ { printf \"%s\n\", \$2 }" )
 
 if echo $ENCRYPTION | grep -q 'PSK'; then
 	PASS=$( $DIALOG \

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:14:42 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25FD1C74D70;
 Tue, 13 Dec 2016 02:14:42 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E9A7E1D23;
 Tue, 13 Dec 2016 02:14:41 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2EfqT058710;
 Tue, 13 Dec 2016 02:14:41 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2EfIw058709;
 Tue, 13 Dec 2016 02:14:41 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130214.uBD2EfIw058709@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:14:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309980 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:14:42 -0000

Author: dteske
Date: Tue Dec 13 02:14:40 2016
New Revision: 309980
URL: https://svnweb.freebsd.org/changeset/base/309980

Log:
  In awk, if you're going to append a newline to your printf
  AND you're going to print only the argument, just use print

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:13:20 2016	(r309979)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:14:40 2016	(r309980)
@@ -278,7 +278,7 @@ while :; do
 done
 
 [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" |
-	awk -F '\t' "/^\"$NETWORK\"\t/ { printf \"%s\n\", \$2 }" )
+	awk -F '\t' "/^\"$NETWORK\"\t/ { print \$2 }" )
 
 if echo $ENCRYPTION | grep -q 'PSK'; then
 	PASS=$( $DIALOG \

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:15:38 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 295A3C74E1B;
 Tue, 13 Dec 2016 02:15:38 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id ECED71EBE;
 Tue, 13 Dec 2016 02:15:37 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2Fbs8058791;
 Tue, 13 Dec 2016 02:15:37 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2Fbx7058790;
 Tue, 13 Dec 2016 02:15:37 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130215.uBD2Fbx7058790@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:15:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309981 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:15:38 -0000

Author: dteske
Date: Tue Dec 13 02:15:36 2016
New Revision: 309981
URL: https://svnweb.freebsd.org/changeset/base/309981

Log:
  Add missing quotes

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:14:40 2016	(r309980)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:15:36 2016	(r309981)
@@ -280,7 +280,7 @@ done
 [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" |
 	awk -F '\t' "/^\"$NETWORK\"\t/ { print \$2 }" )
 
-if echo $ENCRYPTION | grep -q 'PSK'; then
+if echo "$ENCRYPTION" | grep -q 'PSK'; then
 	PASS=$( $DIALOG \
 		--title "WPA Setup"              \
 		--backtitle "$DIALOG_BACKTITLE"  \
@@ -300,7 +300,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the
 		priority=5
 	}
 	EOF
-elif echo $ENCRYPTION | grep -q EAP; then
+elif echo "$ENCRYPTION" | grep -q EAP; then
 	USERPASS=$( $DIALOG \
 		--title "WPA-Enterprise Setup"   \
 		--backtitle "$DIALOG_BACKTITLE"  \
@@ -325,7 +325,7 @@ elif echo $ENCRYPTION | grep -q EAP; the
 		priority=5
 	}
 	EOF
-elif echo $ENCRYPTION | grep -q WEP; then
+elif echo "$ENCRYPTION" | grep -q WEP; then
 	WEPKEY=$( $DIALOG \
 		--title "WEP Setup"              \
 		--backtitle "$DIALOG_BACKTITLE"  \

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:16:01 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8B0EC74E69;
 Tue, 13 Dec 2016 02:16:01 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 98456102A;
 Tue, 13 Dec 2016 02:16:01 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2G0mB058851;
 Tue, 13 Dec 2016 02:16:00 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2G0jP058850;
 Tue, 13 Dec 2016 02:16:00 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130216.uBD2G0jP058850@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:16:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309982 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:16:01 -0000

Author: dteske
Date: Tue Dec 13 02:16:00 2016
New Revision: 309982
URL: https://svnweb.freebsd.org/changeset/base/309982

Log:
  Remove unnecessary quotes

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:15:36 2016	(r309981)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:16:00 2016	(r309982)
@@ -280,7 +280,7 @@ done
 [ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" |
 	awk -F '\t' "/^\"$NETWORK\"\t/ { print \$2 }" )
 
-if echo "$ENCRYPTION" | grep -q 'PSK'; then
+if echo "$ENCRYPTION" | grep -q PSK; then
 	PASS=$( $DIALOG \
 		--title "WPA Setup"              \
 		--backtitle "$DIALOG_BACKTITLE"  \

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:22:22 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 595C6C74415;
 Tue, 13 Dec 2016 02:22:22 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0F3661760;
 Tue, 13 Dec 2016 02:22:21 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2MLc5061928;
 Tue, 13 Dec 2016 02:22:21 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2ML4O061927;
 Tue, 13 Dec 2016 02:22:21 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130222.uBD2ML4O061927@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:22:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309983 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:22:22 -0000

Author: dteske
Date: Tue Dec 13 02:22:21 2016
New Revision: 309983
URL: https://svnweb.freebsd.org/changeset/base/309983

Log:
  Relying on dialog auto-sizing (width/height/rows = 0) is a mistake
  Use the provided API for calculating the appropriate size of menus

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:16:00 2016	(r309982)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:22:21 2016	(r309983)
@@ -239,14 +239,16 @@ while :; do
 	fi
 
 	f_dialog_title "Network Selection"
-	NETWORK=$( sh -c "$DIALOG \
-		--title \"$DIALOG_TITLE\" \
-		--backtitle \"$DIALOG_BACKTITLE\" \
+	prompt="Select a wireless network to connect to."
+	menu_list=$( echo $NETWORKS | tr '\n' ' ' )
+	NETWORK=$( eval $DIALOG \
+		--title \"\$DIALOG_TITLE\" \
+		--backtitle \"\$DIALOG_BACKTITLE\" \
 		--extra-button \
 		--extra-label \"Rescan\" \
-		--menu \"Select a wireless network to connect to.\" \
-		0 0 0 \
-		$( echo $NETWORKS | tr '\n' ' ' )" \
+		--menu \"\$prompt\" \
+		$height $width $rows \
+		$menu_list \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
 	retval=$?
@@ -258,15 +260,21 @@ while :; do
 		f_dialog_title "Network Selection"
 		f_yesno "Do you want to select the network manually?" || exit 1
 		f_dialog_input NETWORK "Enter SSID" || exit 1
-		ENCRYPTION=$( $DIALOG \
-			--title "$DIALOG_TITLE" \
-			--backtitle "$DIALOG_BACKTITLE" \
-			--menu "Select encryption type" \
-			0 0 0 \
-			"1 WPA/WPA2 PSK" "" \
-			"2 WPA/WPA2 EAP" "" \
-			"3 WEP" "" \
-			"0 None" "" \
+		prompt="Select encryption type"
+		menu_list="
+			'1 WPA/WPA2 PSK' ''
+			'2 WPA/WPA2 EAP' ''
+			'3 WEP' ''
+			'0 None' ''
+		" # END-QUOTE
+		eval f_dialog_menu_size height width rows \"\$DIALOG_TITLE\" \
+			\"\$DIALOG_BACKTITLE\" \"\$prompt\" \"\" $menu_list
+		ENCRYPTION=$( eval $DIALOG \
+			--title \"\$DIALOG_TITLE\" \
+			--backtitle \"\$DIALOG_BACKTITLE\" \
+			--menu \"\$prompt\" \
+			$height $width $rows \
+			$menu_list \
 			2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 		) || exit 1
 		SCANSSID=1

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:23:49 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6867FC744B2;
 Tue, 13 Dec 2016 02:23:49 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 37F841930;
 Tue, 13 Dec 2016 02:23:49 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2NmrT062882;
 Tue, 13 Dec 2016 02:23:48 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2NmoS062881;
 Tue, 13 Dec 2016 02:23:48 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130223.uBD2NmoS062881@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:23:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309984 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:23:49 -0000

Author: dteske
Date: Tue Dec 13 02:23:48 2016
New Revision: 309984
URL: https://svnweb.freebsd.org/changeset/base/309984

Log:
  Whitespace alignment

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:22:21 2016	(r309983)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:23:48 2016	(r309984)
@@ -242,13 +242,13 @@ while :; do
 	prompt="Select a wireless network to connect to."
 	menu_list=$( echo $NETWORKS | tr '\n' ' ' )
 	NETWORK=$( eval $DIALOG \
-		--title \"\$DIALOG_TITLE\" \
+		--title \"\$DIALOG_TITLE\"         \
 		--backtitle \"\$DIALOG_BACKTITLE\" \
-		--extra-button \
-		--extra-label \"Rescan\" \
-		--menu \"\$prompt\" \
-		$height $width $rows \
-		$menu_list \
+		--extra-button                     \
+		--extra-label \"Rescan\"           \
+		--menu \"\$prompt\"                \
+		$height $width $rows               \
+		$menu_list                         \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
 	retval=$?
@@ -270,11 +270,11 @@ while :; do
 		eval f_dialog_menu_size height width rows \"\$DIALOG_TITLE\" \
 			\"\$DIALOG_BACKTITLE\" \"\$prompt\" \"\" $menu_list
 		ENCRYPTION=$( eval $DIALOG \
-			--title \"\$DIALOG_TITLE\" \
+			--title \"\$DIALOG_TITLE\"         \
 			--backtitle \"\$DIALOG_BACKTITLE\" \
-			--menu \"\$prompt\" \
-			$height $width $rows \
-			$menu_list \
+			--menu \"\$prompt\"                \
+			$height $width $rows               \
+			$menu_list                         \
 			2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 		) || exit 1
 		SCANSSID=1

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:25:25 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 147EEC7459C;
 Tue, 13 Dec 2016 02:25:25 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D81A61AF2;
 Tue, 13 Dec 2016 02:25:24 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2PO84062985;
 Tue, 13 Dec 2016 02:25:24 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2POVA062984;
 Tue, 13 Dec 2016 02:25:24 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130225.uBD2POVA062984@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:25:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309985 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:25:25 -0000

Author: dteske
Date: Tue Dec 13 02:25:23 2016
New Revision: 309985
URL: https://svnweb.freebsd.org/changeset/base/309985

Log:
  Comment

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:23:48 2016	(r309984)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:25:23 2016	(r309985)
@@ -256,7 +256,7 @@ while :; do
 	case $retval in
 	$DIALOG_OK) break ;;
 	$DIALOG_CANCEL)
-		# here we ask if the user wants to select the network manually
+		# Ask if the user wants to select network manually
 		f_dialog_title "Network Selection"
 		f_yesno "Do you want to select the network manually?" || exit 1
 		f_dialog_input NETWORK "Enter SSID" || exit 1

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:27:39 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D626C74707;
 Tue, 13 Dec 2016 02:27:39 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6CF491CEF;
 Tue, 13 Dec 2016 02:27:39 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2Rc4m063098;
 Tue, 13 Dec 2016 02:27:38 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2Rcdh063097;
 Tue, 13 Dec 2016 02:27:38 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130227.uBD2Rcdh063097@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:27:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309986 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:27:39 -0000

Author: dteske
Date: Tue Dec 13 02:27:38 2016
New Revision: 309986
URL: https://svnweb.freebsd.org/changeset/base/309986

Log:
  There's an API function for displaying errors

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:25:23 2016	(r309985)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:27:38 2016	(r309986)
@@ -167,8 +167,8 @@ EOF
 #
 if ! wpa_cli ping > /dev/null 2>&1; then
 	if [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then
-		$DIALOG --backtitle "$DIALOG_BACKTITLE" --title "$msg_error" --msgbox \
-			"Wireless cannot be configured without making changes to the local system!" 0 0
+		f_show_err "Wireless cannot be configured without %s" \
+		           "making changes to the local system!"
 		exit 1
 	fi
 	wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") || exit 1

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:29:21 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81EF1C74867;
 Tue, 13 Dec 2016 02:29:21 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 517E31ED5;
 Tue, 13 Dec 2016 02:29:21 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2TKuD063193;
 Tue, 13 Dec 2016 02:29:20 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2TKXE063192;
 Tue, 13 Dec 2016 02:29:20 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130229.uBD2TKXE063192@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:29:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309987 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:29:21 -0000

Author: dteske
Date: Tue Dec 13 02:29:20 2016
New Revision: 309987
URL: https://svnweb.freebsd.org/changeset/base/309987

Log:
  There's an API function for displaying yes/no dialogs

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:27:38 2016	(r309986)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:29:20 2016	(r309987)
@@ -196,11 +196,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
 	f_dialog_title "Regdomain/country"
-	$DIALOG \
-		--title "$DIALOG_TITLE" \
-		--backtitle "$DIALOG_BACKTITLE" \
-		--yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?" \
-		0 0
+	f_yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?"
 	if [ $? -eq 0 ]; then
 		while :; do
 			dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY"
@@ -230,11 +226,7 @@ while :; do
 
 	if [ ! "$NETWORKS" ]; then
 		f_dialog_title "$msg_error"
-		$DIALOG \
-			--title "$DIALOG_TITLE" \
-			--backtitle "$DIALOG_BACKTITLE" \
-			--yesno "No wireless networks were found. Rescan?" \
-			0 0 && continue
+		f_yesno "No wireless networks were found. Rescan?" && continue
 		exit 1
 	fi
 

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:30:26 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26281C74904;
 Tue, 13 Dec 2016 02:30:26 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E9DE31061;
 Tue, 13 Dec 2016 02:30:25 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2UP85063291;
 Tue, 13 Dec 2016 02:30:25 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2UPU6063290;
 Tue, 13 Dec 2016 02:30:25 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130230.uBD2UPU6063290@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:30:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309988 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:30:26 -0000

Author: dteske
Date: Tue Dec 13 02:30:24 2016
New Revision: 309988
URL: https://svnweb.freebsd.org/changeset/base/309988

Log:
  There's an API function for displaying pauses

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:29:20 2016	(r309987)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:30:24 2016	(r309988)
@@ -212,12 +212,8 @@ while :; do
 	output=$( wpa_cli scan 2>&1 )
 	f_dprintf "%s" "$output"
 	f_dialog_title "Scanning"
-	$DIALOG \
-		--title "$DIALOG_TITLE" \
-		--backtitle "$DIALOG_BACKTITLE" \
-		--ok-label "$msg_skip" \
-		--pause "Waiting 5 seconds to scan for wireless networks..." \
-		9 40 5 || exit 1
+	f_dialog_pause "Waiting 5 seconds to scan for wireless networks..." 5 ||
+		exit 1
 
 	SCAN_RESULTS=$( wpa_cli scan_results )
 	NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' '

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:40:55 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65D87C74D75;
 Tue, 13 Dec 2016 02:40:55 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 20E1C1667;
 Tue, 13 Dec 2016 02:40:55 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2estR069007;
 Tue, 13 Dec 2016 02:40:54 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2eskc068989;
 Tue, 13 Dec 2016 02:40:54 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130240.uBD2eskc068989@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:40:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309989 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:40:55 -0000

Author: dteske
Date: Tue Dec 13 02:40:54 2016
New Revision: 309989
URL: https://svnweb.freebsd.org/changeset/base/309989

Log:
  There's an API function for catching errors and displaying them or
  logging them to debug output

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:30:24 2016	(r309988)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:40:54 2016	(r309989)
@@ -52,8 +52,9 @@ country_set()
 	# Regdomain/country cannot be applied while interface is running
 	iface_up=$( ifconfig -lu | grep -w "$WLAN_IFACE" )
 	[ "$iface_up" ] && ifconfig "$WLAN_IFACE" down
-	error_str=$( ifconfig "$WLAN_IFACE" $ifconfig_args 2>&1 |
-		sed -e 's/ifconfig: //' )
+	f_eval_catch -dk error_str wlanconfig ifconfig "ifconfig %s %s" \
+		"$WLAN_IFACE" "$ifconfig_args"
+	error_str="${error_str#ifconfig: }"
 	if [ "$iface_up" ]; then
 		# Restart wpa_supplicant(8) (should not fail).
 		wpa_supplicant -B -i "$WLAN_IFACE" -c \
@@ -165,22 +166,17 @@ EOF
 # Try to reach wpa_supplicant. If it isn't running and we can modify the
 # existing system, start it. Otherwise, fail.
 #
-if ! wpa_cli ping > /dev/null 2>&1; then
+if ! f_eval_catch -d wlanconfig wpa_cli "wpa_cli ping"; then
 	if [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then
 		f_show_err "Wireless cannot be configured without %s" \
 		           "making changes to the local system!"
 		exit 1
 	fi
-	wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf") || exit 1
+	f_eval_catch wlanconfig wpa_supplicant \
+		'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \
+		"$1" "$BSDINSTALL_TMPETC" || exit 1
 
-	if ! wpa_cli ping > /dev/null 2>&1 && [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then
-		$DIALOG \
-			--title "$msg_error" \
-			--backtitle "$DIALOG_BACKTITLE" \
-			--msgbox "Could not start wpa_supplicant!" \
-			0 0
-		exit 1
-	fi
+	f_eval_catch wlanconfig wpa_cli "wpa_cli ping" || exit 1
 fi
 
 #
@@ -209,13 +205,12 @@ fi
 
 while :; do
 	SCANSSID=0
-	output=$( wpa_cli scan 2>&1 )
-	f_dprintf "%s" "$output"
+	f_eval_catch -d wlanconfig wpa_cli "wpa_cli scan"
 	f_dialog_title "Scanning"
 	f_dialog_pause "Waiting 5 seconds to scan for wireless networks..." 5 ||
 		exit 1
 
-	SCAN_RESULTS=$( wpa_cli scan_results )
+	f_eval_catch -dk SCAN_RESULTS wlanconfig wpa_cli "wpa_cli scan_results"
 	NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' '
 		/..:..:..:..:..:../ && $5 { printf "\"%s\"\t%s\n", $5, $4 }
 	' | sort | uniq )
@@ -365,8 +360,7 @@ EOF
 
 # Bring up new network
 if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
-	output=$( wpa_cli reconfigure 2>&1 )
-	f_dprintf "%s" "$output"
+	f_eval_catch -d wlanconfig wpa_cli "wpa_cli reconfigure"
 fi
 
 exit $SUCCESS

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:42:12 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 254B9C74E07;
 Tue, 13 Dec 2016 02:42:12 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DBA6619F1;
 Tue, 13 Dec 2016 02:42:11 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2gBUA070087;
 Tue, 13 Dec 2016 02:42:11 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2gBuB070086;
 Tue, 13 Dec 2016 02:42:11 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130242.uBD2gBuB070086@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:42:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309990 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:42:12 -0000

Author: dteske
Date: Tue Dec 13 02:42:10 2016
New Revision: 309990
URL: https://svnweb.freebsd.org/changeset/base/309990

Log:
  Calculate proper size of menu list dialog

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:40:54 2016	(r309989)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:42:10 2016	(r309990)
@@ -224,6 +224,8 @@ while :; do
 	f_dialog_title "Network Selection"
 	prompt="Select a wireless network to connect to."
 	menu_list=$( echo $NETWORKS | tr '\n' ' ' )
+	f_dialog_menu_size height width rows "$DIALOG_TITLE" \
+		"$DIALOG_BACKTITLE" "$prompt" "" $menu_list
 	NETWORK=$( eval $DIALOG \
 		--title \"\$DIALOG_TITLE\"         \
 		--backtitle \"\$DIALOG_BACKTITLE\" \

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:44:34 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DF3CC74FEB;
 Tue, 13 Dec 2016 02:44:34 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5D6921BF2;
 Tue, 13 Dec 2016 02:44:34 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2iXM3070950;
 Tue, 13 Dec 2016 02:44:33 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2iXwg070949;
 Tue, 13 Dec 2016 02:44:33 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130244.uBD2iXwg070949@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:44:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309991 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:44:34 -0000

Author: dteske
Date: Tue Dec 13 02:44:33 2016
New Revision: 309991
URL: https://svnweb.freebsd.org/changeset/base/309991

Log:
  Both simplify bringup of interface after changes and catch errors in debug

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:42:10 2016	(r309990)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:44:33 2016	(r309991)
@@ -55,11 +55,10 @@ country_set()
 	f_eval_catch -dk error_str wlanconfig ifconfig "ifconfig %s %s" \
 		"$WLAN_IFACE" "$ifconfig_args"
 	error_str="${error_str#ifconfig: }"
-	if [ "$iface_up" ]; then
-		# Restart wpa_supplicant(8) (should not fail).
-		wpa_supplicant -B -i "$WLAN_IFACE" -c \
-			"$BSDINSTALL_TMPETC/wpa_supplicant.conf"
-	fi
+	# Restart wpa_supplicant(8) (should not fail).
+	[ "$iface_up" ] && f_eval_catch -d wlanconfig wpa_supplicant \
+		'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \
+		"$WLAN_IFACE" "$BSDINSTALL_TMPETC"
 	if [ "$error_str" ]; then
 		$DIALOG \
 			--title "$msg_error" \

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:45:08 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C564C73097;
 Tue, 13 Dec 2016 02:45:08 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2BDE81D72;
 Tue, 13 Dec 2016 02:45:08 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2j742071021;
 Tue, 13 Dec 2016 02:45:07 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2j7Jw071020;
 Tue, 13 Dec 2016 02:45:07 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130245.uBD2j7Jw071020@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:45:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309992 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:45:08 -0000

Author: dteske
Date: Tue Dec 13 02:45:07 2016
New Revision: 309992
URL: https://svnweb.freebsd.org/changeset/base/309992

Log:
  Restore previous comment

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:44:33 2016	(r309991)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:45:07 2016	(r309992)
@@ -175,6 +175,7 @@ if ! f_eval_catch -d wlanconfig wpa_cli 
 		'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \
 		"$1" "$BSDINSTALL_TMPETC" || exit 1
 
+	# See if we succeeded
 	f_eval_catch wlanconfig wpa_cli "wpa_cli ping" || exit 1
 fi
 

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:45:53 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEC20C73123;
 Tue, 13 Dec 2016 02:45:53 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9E42C1EE9;
 Tue, 13 Dec 2016 02:45:53 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2jq4r071086;
 Tue, 13 Dec 2016 02:45:52 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2jqtF071085;
 Tue, 13 Dec 2016 02:45:52 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130245.uBD2jqtF071085@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:45:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309993 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:45:53 -0000

Author: dteske
Date: Tue Dec 13 02:45:52 2016
New Revision: 309993
URL: https://svnweb.freebsd.org/changeset/base/309993

Log:
  Why test $? when you can test the command

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:45:07 2016	(r309992)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:45:52 2016	(r309993)
@@ -192,8 +192,8 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
 	f_dialog_title "Regdomain/country"
-	f_yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?"
-	if [ $? -eq 0 ]; then
+	if f_yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?"
+	then
 		while :; do
 			dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY"
 			if [ $? -eq $SUCCESS ]; then

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:46:38 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15D12C731BC;
 Tue, 13 Dec 2016 02:46:38 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D98E71081;
 Tue, 13 Dec 2016 02:46:37 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2kbDg071155;
 Tue, 13 Dec 2016 02:46:37 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2kbch071154;
 Tue, 13 Dec 2016 02:46:37 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130246.uBD2kbch071154@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:46:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309994 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:46:38 -0000

Author: dteske
Date: Tue Dec 13 02:46:36 2016
New Revision: 309994
URL: https://svnweb.freebsd.org/changeset/base/309994

Log:
  Wordsmithing

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:45:52 2016	(r309993)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:46:36 2016	(r309994)
@@ -192,7 +192,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
 	f_dialog_title "Regdomain/country"
-	if f_yesno "Change regdomain/country (now $DEF_REGDOMAIN/$DEF_COUNTRY)?"
+	if f_yesno "Change regdomain/country ($DEF_REGDOMAIN/$DEF_COUNTRY)?"
 	then
 		while :; do
 			dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY"

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:47:40 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E81BAC73283;
 Tue, 13 Dec 2016 02:47:40 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B7C78126B;
 Tue, 13 Dec 2016 02:47:40 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2ldqc071232;
 Tue, 13 Dec 2016 02:47:39 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2lddC071231;
 Tue, 13 Dec 2016 02:47:39 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130247.uBD2lddC071231@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:47:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309995 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:47:41 -0000

Author: dteske
Date: Tue Dec 13 02:47:39 2016
New Revision: 309995
URL: https://svnweb.freebsd.org/changeset/base/309995

Log:
  Simplify loop by moving predicate to clause

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:46:36 2016	(r309994)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:47:39 2016	(r309995)
@@ -194,12 +194,8 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	f_dialog_title "Regdomain/country"
 	if f_yesno "Change regdomain/country ($DEF_REGDOMAIN/$DEF_COUNTRY)?"
 	then
-		while :; do
-			dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY"
-			if [ $? -eq $SUCCESS ]; then
-				break
-			fi
-		done
+		while ! dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY"
+		do :; done
 	fi
 fi
 

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:48:15 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56395C73315;
 Tue, 13 Dec 2016 02:48:15 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 25BFC141E;
 Tue, 13 Dec 2016 02:48:15 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2mEvV071298;
 Tue, 13 Dec 2016 02:48:14 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2mEk4071297;
 Tue, 13 Dec 2016 02:48:14 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130248.uBD2mEk4071297@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:48:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309996 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:48:15 -0000

Author: dteske
Date: Tue Dec 13 02:48:14 2016
New Revision: 309996
URL: https://svnweb.freebsd.org/changeset/base/309996

Log:
  Simplify single-line if statements

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:47:39 2016	(r309995)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:48:14 2016	(r309996)
@@ -357,9 +357,8 @@ network={
 EOF
 
 # Bring up new network
-if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
+[ "$BSDINSTALL_CONFIGCURRENT" ] &&
 	f_eval_catch -d wlanconfig wpa_cli "wpa_cli reconfigure"
-fi
 
 exit $SUCCESS
 

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:54:45 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A4CDC73693;
 Tue, 13 Dec 2016 02:54:45 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 39D8519FB;
 Tue, 13 Dec 2016 02:54:45 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2siEv075320;
 Tue, 13 Dec 2016 02:54:44 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2si2H075319;
 Tue, 13 Dec 2016 02:54:44 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130254.uBD2si2H075319@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:54:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309997 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:54:45 -0000

Author: dteske
Date: Tue Dec 13 02:54:44 2016
New Revision: 309997
URL: https://svnweb.freebsd.org/changeset/base/309997

Log:
  The flags of a WLAN need to be quoted (they contain things like brackets)

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:48:14 2016	(r309996)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:54:44 2016	(r309997)
@@ -208,7 +208,7 @@ while :; do
 
 	f_eval_catch -dk SCAN_RESULTS wlanconfig wpa_cli "wpa_cli scan_results"
 	NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' '
-		/..:..:..:..:..:../ && $5 { printf "\"%s\"\t%s\n", $5, $4 }
+		/..:..:..:..:..:../ && $5 { printf "\"%s\"\t\"%s\"\n", $5, $4 }
 	' | sort | uniq )
 
 	if [ ! "$NETWORKS" ]; then

From owner-svn-src-all@freebsd.org  Tue Dec 13 02:56:54 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3385CC7376B;
 Tue, 13 Dec 2016 02:56:54 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 030141BB4;
 Tue, 13 Dec 2016 02:56:53 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD2urpZ075450;
 Tue, 13 Dec 2016 02:56:53 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD2ur59075449;
 Tue, 13 Dec 2016 02:56:53 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130256.uBD2ur59075449@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 02:56:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309998 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 02:56:54 -0000

Author: dteske
Date: Tue Dec 13 02:56:52 2016
New Revision: 309998
URL: https://svnweb.freebsd.org/changeset/base/309998

Log:
  It's completely pointless to replace newlines with space
  (this is done automatically for you upon shell expansion)

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:54:44 2016	(r309997)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:56:52 2016	(r309998)
@@ -219,7 +219,6 @@ while :; do
 
 	f_dialog_title "Network Selection"
 	prompt="Select a wireless network to connect to."
-	menu_list=$( echo $NETWORKS | tr '\n' ' ' )
 	f_dialog_menu_size height width rows "$DIALOG_TITLE" \
 		"$DIALOG_BACKTITLE" "$prompt" "" $menu_list
 	NETWORK=$( eval $DIALOG \
@@ -229,7 +228,7 @@ while :; do
 		--extra-label \"Rescan\"           \
 		--menu \"\$prompt\"                \
 		$height $width $rows               \
-		$menu_list                         \
+		$NETWORKS                          \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
 	retval=$?

From owner-svn-src-all@freebsd.org  Tue Dec 13 03:26:13 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC3BDC6F85D;
 Tue, 13 Dec 2016 03:26:13 +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 BBBA9155B;
 Tue, 13 Dec 2016 03:26:13 +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 uBD3QCDX088718;
 Tue, 13 Dec 2016 03:26:12 GMT (envelope-from gonzo@FreeBSD.org)
Received: (from gonzo@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD3QCOm088717;
 Tue, 13 Dec 2016 03:26:12 GMT (envelope-from gonzo@FreeBSD.org)
Message-Id: <201612130326.uBD3QCOm088717@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: gonzo set sender to
 gonzo@FreeBSD.org using -f
From: Oleksandr Tymoshenko <gonzo@FreeBSD.org>
Date: Tue, 13 Dec 2016 03:26:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r309999 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 03:26:14 -0000

Author: gonzo
Date: Tue Dec 13 03:26:12 2016
New Revision: 309999
URL: https://svnweb.freebsd.org/changeset/base/309999

Log:
  [iMX6] Fix platform compatibility string for i.MX6 Dual
  
  i.MX6 Dual boot was broken since r308533 because ofw_bus_node_is_compatible
  is more strict than fdt_is_compatible and does not accept partial matches

Modified:
  head/sys/arm/freescale/imx/imx6_machdep.c

Modified: head/sys/arm/freescale/imx/imx6_machdep.c
==============================================================================
--- head/sys/arm/freescale/imx/imx6_machdep.c	Tue Dec 13 02:56:52 2016	(r309998)
+++ head/sys/arm/freescale/imx/imx6_machdep.c	Tue Dec 13 03:26:12 2016	(r309999)
@@ -352,5 +352,5 @@ static platform_method_t imx6_methods[] 
 };
 
 FDT_PLATFORM_DEF2(imx6, imx6s, "i.MX6 Solo", 0, "fsl,imx6s", 0);
-FDT_PLATFORM_DEF2(imx6, imx6d, "i.MX6 Dual", 0, "fsl,imx6d", 0);
+FDT_PLATFORM_DEF2(imx6, imx6d, "i.MX6 Dual", 0, "fsl,imx6dl", 0);
 FDT_PLATFORM_DEF2(imx6, imx6q, "i.MX6 Quad", 0, "fsl,imx6q", 0);

From owner-svn-src-all@freebsd.org  Tue Dec 13 03:36:42 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 420F6C6FF22;
 Tue, 13 Dec 2016 03:36:42 +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 119A21B9B;
 Tue, 13 Dec 2016 03:36:41 +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 uBD3afVn092604;
 Tue, 13 Dec 2016 03:36:41 GMT (envelope-from loos@FreeBSD.org)
Received: (from loos@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD3afXR092603;
 Tue, 13 Dec 2016 03:36:41 GMT (envelope-from loos@FreeBSD.org)
Message-Id: <201612130336.uBD3afXR092603@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: loos set sender to
 loos@FreeBSD.org using -f
From: Luiz Otavio O Souza <loos@FreeBSD.org>
Date: Tue, 13 Dec 2016 03:36:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310000 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 03:36:42 -0000

Author: loos
Date: Tue Dec 13 03:36:41 2016
New Revision: 310000
URL: https://svnweb.freebsd.org/changeset/base/310000

Log:
  Remove a too strict test and instead, just filter the passed flags with the
  supported capabilities.
  
  Spotted by:	yamori813@yahoo.co.jp (Hiroki Mori)
  MFC after:	2 weeks

Modified:
  head/sys/dev/gpio/gpiobus.c

Modified: head/sys/dev/gpio/gpiobus.c
==============================================================================
--- head/sys/dev/gpio/gpiobus.c	Tue Dec 13 03:26:12 2016	(r309999)
+++ head/sys/dev/gpio/gpiobus.c	Tue Dec 13 03:36:41 2016	(r310000)
@@ -120,9 +120,9 @@ int
 gpio_check_flags(uint32_t caps, uint32_t flags)
 {
 
-	/* Check for unwanted flags. */
-	if ((flags & caps) == 0 || (flags & caps) != flags)
-		return (EINVAL);
+	/* Filter unwanted flags. */
+	flags &= caps;
+
 	/* Cannot mix input/output together. */
 	if (flags & GPIO_PIN_INPUT && flags & GPIO_PIN_OUTPUT)
 		return (EINVAL);

From owner-svn-src-all@freebsd.org  Tue Dec 13 04:24:43 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 457FBC7437C;
 Tue, 13 Dec 2016 04:24:43 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id ECA2315EF;
 Tue, 13 Dec 2016 04:24:42 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD4Ogim012763;
 Tue, 13 Dec 2016 04:24:42 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD4OgVN012762;
 Tue, 13 Dec 2016 04:24:42 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130424.uBD4OgVN012762@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 04:24:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310001 - stable/11
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 04:24:43 -0000

Author: dteske
Date: Tue Dec 13 04:24:41 2016
New Revision: 310001
URL: https://svnweb.freebsd.org/changeset/base/310001

Log:
  Merge missing mergeinfo for r303877

Modified:
Directory Properties:
  stable/11/   (props changed)

From owner-svn-src-all@freebsd.org  Tue Dec 13 04:35:21 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 173ABC747D4;
 Tue, 13 Dec 2016 04:35:21 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DA88D1B09;
 Tue, 13 Dec 2016 04:35:20 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD4ZKqU016728;
 Tue, 13 Dec 2016 04:35:20 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD4ZKv2016727;
 Tue, 13 Dec 2016 04:35:20 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130435.uBD4ZKv2016727@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 04:35:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310002 - stable/11/etc/defaults
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 04:35:21 -0000

Author: dteske
Date: Tue Dec 13 04:35:19 2016
New Revision: 310002
URL: https://svnweb.freebsd.org/changeset/base/310002

Log:
  MFC r302798 [cy]: Restore lost comment from r301295.
  
  PR:		211027
  Reported by:	Trond.Endrestol@ximalas.info

Modified:
  stable/11/etc/defaults/periodic.conf
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/defaults/periodic.conf
==============================================================================
--- stable/11/etc/defaults/periodic.conf	Tue Dec 13 04:24:41 2016	(r310001)
+++ stable/11/etc/defaults/periodic.conf	Tue Dec 13 04:35:19 2016	(r310002)
@@ -137,6 +137,7 @@ daily_status_mail_rejects_shorten="NO"		
 # 480.leapfile-ntpd
 daily_ntpd_leapfile_enable="YES"			# Fetch NTP leapfile
 daily_ntpd_avoid_congestion="YES"			# Avoid congesting
+							# leapfile sources
 
 # 480.status-ntpd
 daily_status_ntpd_enable="NO"				# Check NTP status

From owner-svn-src-all@freebsd.org  Tue Dec 13 04:37:15 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE95FC748DB;
 Tue, 13 Dec 2016 04:37:15 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8DFC21CB4;
 Tue, 13 Dec 2016 04:37:15 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD4bELG016875;
 Tue, 13 Dec 2016 04:37:14 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD4bEMo016874;
 Tue, 13 Dec 2016 04:37:14 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130437.uBD4bEMo016874@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 04:37:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310003 - stable/11/etc/rc.d
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 04:37:15 -0000

Author: dteske
Date: Tue Dec 13 04:37:14 2016
New Revision: 310003
URL: https://svnweb.freebsd.org/changeset/base/310003

Log:
  MFC r303943: Allow enforce_statfs (see jail(8)) to be set per jail
  
  Reviewed by:	jelischer

Modified:
  stable/11/etc/rc.d/jail
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/rc.d/jail
==============================================================================
--- stable/11/etc/rc.d/jail	Tue Dec 13 04:35:19 2016	(r310002)
+++ stable/11/etc/rc.d/jail	Tue Dec 13 04:37:14 2016	(r310003)
@@ -260,6 +260,7 @@ parse_options()
 
 		extract_var $_jv set_hostname_allow allow.set_hostname YN NO
 		extract_var $_jv sysvipc_allow allow.sysvipc YN NO
+		extract_var $_jv enforce_statfs enforce_statfs - 2
 		extract_var $_jv osreldate osreldate
 		extract_var $_jv osrelease osrelease
 		for _p in $_parameters; do

From owner-svn-src-all@freebsd.org  Tue Dec 13 04:39:45 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1934C74AB7;
 Tue, 13 Dec 2016 04:39:45 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B07111E4A;
 Tue, 13 Dec 2016 04:39:45 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD4di6D017013;
 Tue, 13 Dec 2016 04:39:44 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD4diVc017012;
 Tue, 13 Dec 2016 04:39:44 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130439.uBD4diVc017012@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 04:39:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310004 - stable/11/etc/autofs
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 04:39:46 -0000

Author: dteske
Date: Tue Dec 13 04:39:44 2016
New Revision: 310004
URL: https://svnweb.freebsd.org/changeset/base/310004

Log:
  MFC r305968 [trasz]:
  Make autofs use the "async" flag for msdosfs and ufs filesystems mounted
  on /media.

Modified:
  stable/11/etc/autofs/special_media
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/autofs/special_media
==============================================================================
--- stable/11/etc/autofs/special_media	Tue Dec 13 04:37:14 2016	(r310003)
+++ stable/11/etc/autofs/special_media	Tue Dec 13 04:39:44 2016	(r310004)
@@ -46,6 +46,8 @@ print_map_entry() {
 			    "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first"
 			exit 1
 		fi
+	elif [ "${_fstype}" = "msdosfs" -o "${_fstype}" = "ufs" ]; then
+		echo "-fstype=${_fstype},nosuid,async	:/dev/${_p}" 
 	else
 		echo "-fstype=${_fstype},nosuid	:/dev/${_p}" 
 	fi

From owner-svn-src-all@freebsd.org  Tue Dec 13 04:41:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3CE9C74CAD;
 Tue, 13 Dec 2016 04:41:50 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B3172120F;
 Tue, 13 Dec 2016 04:41:50 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD4fnIm020811;
 Tue, 13 Dec 2016 04:41:49 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD4fnqb020810;
 Tue, 13 Dec 2016 04:41:49 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130441.uBD4fnqb020810@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 04:41:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310005 - stable/11/etc/autofs
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 04:41:51 -0000

Author: dteske
Date: Tue Dec 13 04:41:49 2016
New Revision: 310005
URL: https://svnweb.freebsd.org/changeset/base/310005

Log:
  MFC r305969 [trasz]:
  Make autofs use the "noatime" flag for msdosfs, ntfs, and ufs
  filesystems mounted on /media.

Modified:
  stable/11/etc/autofs/special_media
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/autofs/special_media
==============================================================================
--- stable/11/etc/autofs/special_media	Tue Dec 13 04:39:44 2016	(r310004)
+++ stable/11/etc/autofs/special_media	Tue Dec 13 04:41:49 2016	(r310005)
@@ -40,14 +40,14 @@ print_map_entry() {
 
 	if [ "${_fstype}" = "ntfs" ]; then
 		if [ -f "/usr/local/bin/ntfs-3g" ]; then
-			echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid	:/dev/${_p}" 
+			echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid,noatime	:/dev/${_p}" 
 		else
 			/usr/bin/logger -p info -t "special_media[$$]" \
 			    "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first"
 			exit 1
 		fi
 	elif [ "${_fstype}" = "msdosfs" -o "${_fstype}" = "ufs" ]; then
-		echo "-fstype=${_fstype},nosuid,async	:/dev/${_p}" 
+		echo "-fstype=${_fstype},nosuid,noatime,async	:/dev/${_p}" 
 	else
 		echo "-fstype=${_fstype},nosuid	:/dev/${_p}" 
 	fi

From owner-svn-src-all@freebsd.org  Tue Dec 13 04:43:04 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B762C74D2F;
 Tue, 13 Dec 2016 04:43:04 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6AB2F141A;
 Tue, 13 Dec 2016 04:43:04 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD4h3kV020914;
 Tue, 13 Dec 2016 04:43:03 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD4h3ls020913;
 Tue, 13 Dec 2016 04:43:03 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130443.uBD4h3ls020913@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 04:43:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310006 - stable/11/etc/autofs
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 04:43:04 -0000

Author: dteske
Date: Tue Dec 13 04:43:03 2016
New Revision: 310006
URL: https://svnweb.freebsd.org/changeset/base/310006

Log:
  MFC r306009 [trasz]:
  Make autofs(5) -media map also use "async" and "noatime" for ext2fs(5).

Modified:
  stable/11/etc/autofs/special_media
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/autofs/special_media
==============================================================================
--- stable/11/etc/autofs/special_media	Tue Dec 13 04:41:49 2016	(r310005)
+++ stable/11/etc/autofs/special_media	Tue Dec 13 04:43:03 2016	(r310006)
@@ -38,7 +38,8 @@ print_map_entry() {
 	_fstype="$1"
 	_p="$2"
 
-	if [ "${_fstype}" = "ntfs" ]; then
+	case "${_fstype}" in
+	"ntfs")
 		if [ -f "/usr/local/bin/ntfs-3g" ]; then
 			echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid,noatime	:/dev/${_p}" 
 		else
@@ -46,11 +47,14 @@ print_map_entry() {
 			    "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first"
 			exit 1
 		fi
-	elif [ "${_fstype}" = "msdosfs" -o "${_fstype}" = "ufs" ]; then
+		;;
+	"ext2fs" | "msdosfs" | "ufs")
 		echo "-fstype=${_fstype},nosuid,noatime,async	:/dev/${_p}" 
-	else
+		;;
+	*)
 		echo "-fstype=${_fstype},nosuid	:/dev/${_p}" 
-	fi
+		;;
+	esac
 }
 
 # Determine map entry contents for the given key and print out the entry.

From owner-svn-src-all@freebsd.org  Tue Dec 13 04:44:07 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6121C74DCA;
 Tue, 13 Dec 2016 04:44:07 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7B6D215D0;
 Tue, 13 Dec 2016 04:44:07 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD4i6qv021035;
 Tue, 13 Dec 2016 04:44:06 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD4i6Bb021034;
 Tue, 13 Dec 2016 04:44:06 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130444.uBD4i6Bb021034@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 04:44:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310007 - in stable/11/etc: . autofs
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 04:44:07 -0000

Author: dteske
Date: Tue Dec 13 04:44:06 2016
New Revision: 310007
URL: https://svnweb.freebsd.org/changeset/base/310007

Log:
  MFC r306011 [trasz]:
  Stop appending "noatime" in the autofs -media map, and instead add it
  to auto_master, since all filesystems seem to support it.  It's cleaner
  this way, and easier to customize.

Modified:
  stable/11/etc/auto_master
  stable/11/etc/autofs/special_media
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/auto_master
==============================================================================
--- stable/11/etc/auto_master	Tue Dec 13 04:43:03 2016	(r310006)
+++ stable/11/etc/auto_master	Tue Dec 13 04:44:06 2016	(r310007)
@@ -5,5 +5,5 @@
 /net		-hosts		-nobrowse,nosuid,intr
 # When using the -media special map, make sure to edit devd.conf(5)
 # to move the call to "automount -c" out of the comments section.
-#/media		-media		-nosuid
+#/media		-media		-nosuid,noatime
 #/-		-noauto

Modified: stable/11/etc/autofs/special_media
==============================================================================
--- stable/11/etc/autofs/special_media	Tue Dec 13 04:43:03 2016	(r310006)
+++ stable/11/etc/autofs/special_media	Tue Dec 13 04:44:06 2016	(r310007)
@@ -41,7 +41,7 @@ print_map_entry() {
 	case "${_fstype}" in
 	"ntfs")
 		if [ -f "/usr/local/bin/ntfs-3g" ]; then
-			echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid,noatime	:/dev/${_p}" 
+			echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid	:/dev/${_p}" 
 		else
 			/usr/bin/logger -p info -t "special_media[$$]" \
 			    "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first"
@@ -49,7 +49,7 @@ print_map_entry() {
 		fi
 		;;
 	"ext2fs" | "msdosfs" | "ufs")
-		echo "-fstype=${_fstype},nosuid,noatime,async	:/dev/${_p}" 
+		echo "-fstype=${_fstype},nosuid,async	:/dev/${_p}" 
 		;;
 	*)
 		echo "-fstype=${_fstype},nosuid	:/dev/${_p}" 

From owner-svn-src-all@freebsd.org  Tue Dec 13 04:45:23 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3282FC74E3F;
 Tue, 13 Dec 2016 04:45:23 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 01D9F172D;
 Tue, 13 Dec 2016 04:45:22 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD4jMJb021143;
 Tue, 13 Dec 2016 04:45:22 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD4jMpO021142;
 Tue, 13 Dec 2016 04:45:22 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130445.uBD4jMpO021142@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 04:45:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310008 - stable/11/etc/autofs
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 04:45:23 -0000

Author: dteske
Date: Tue Dec 13 04:45:21 2016
New Revision: 310008
URL: https://svnweb.freebsd.org/changeset/base/310008

Log:
  MFC r306012 [trasz]:
  Fix -media to not mount ufs with "async"; it doesn't make sense when
  there is softupdates.

Modified:
  stable/11/etc/autofs/special_media
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/autofs/special_media
==============================================================================
--- stable/11/etc/autofs/special_media	Tue Dec 13 04:44:06 2016	(r310007)
+++ stable/11/etc/autofs/special_media	Tue Dec 13 04:45:21 2016	(r310008)
@@ -48,7 +48,7 @@ print_map_entry() {
 			exit 1
 		fi
 		;;
-	"ext2fs" | "msdosfs" | "ufs")
+	"ext2fs" | "msdosfs")
 		echo "-fstype=${_fstype},nosuid,async	:/dev/${_p}" 
 		;;
 	*)

From owner-svn-src-all@freebsd.org  Tue Dec 13 04:47:22 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72C36C74F59;
 Tue, 13 Dec 2016 04:47:22 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 41C9318D4;
 Tue, 13 Dec 2016 04:47:22 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD4lLc6021265;
 Tue, 13 Dec 2016 04:47:21 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD4lLvn021263;
 Tue, 13 Dec 2016 04:47:21 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130447.uBD4lLvn021263@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 04:47:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310009 - in stable/11/etc: defaults rc.d
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 04:47:22 -0000

Author: dteske
Date: Tue Dec 13 04:47:21 2016
New Revision: 310009
URL: https://svnweb.freebsd.org/changeset/base/310009

Log:
  MFC r307159: Add jail_confwarn="NO" (default YES)
  
  Differential Revision:	https://reviews.freebsd.org/D7465
  Reviewed by:	jelischer
  Sponsored by:	FIS Global, Inc.

Modified:
  stable/11/etc/defaults/rc.conf
  stable/11/etc/rc.d/jail
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/defaults/rc.conf
==============================================================================
--- stable/11/etc/defaults/rc.conf	Tue Dec 13 04:45:21 2016	(r310008)
+++ stable/11/etc/defaults/rc.conf	Tue Dec 13 04:47:21 2016	(r310009)
@@ -701,6 +701,7 @@ iovctl_files=""		# Config files for iovc
 ### Jail Configuration (see rc.conf(5) manual page) ##########
 ##############################################################
 jail_enable="NO"	# Set to NO to disable starting of any jails
+jail_confwarn="YES"	# Prevent warning about obsolete per-jail configuration
 jail_parallel_start="NO"	# Start jails in the background
 jail_list=""		# Space separated list of names of jails
 jail_reverse_stop="NO"	# Stop jails in reverse order

Modified: stable/11/etc/rc.d/jail
==============================================================================
--- stable/11/etc/rc.d/jail	Tue Dec 13 04:45:21 2016	(r310008)
+++ stable/11/etc/rc.d/jail	Tue Dec 13 04:47:21 2016	(r310009)
@@ -147,7 +147,8 @@ parse_options()
 	#
 	# To relieve confusion, show a warning message.
 	#
-	_confwarn=1
+	: ${jail_confwarn:=YES}
+	checkyesno jail_confwarn && _confwarn=1
 	if [ -r "$jail_conf" -o -r "$_jconf" ]; then
 		if ! checkyesno jail_parallel_start; then
 			warn "$_conf is created and used for jail $_j."

From owner-svn-src-all@freebsd.org  Tue Dec 13 04:50:46 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75731C7405B;
 Tue, 13 Dec 2016 04:50:46 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3E17A1A8C;
 Tue, 13 Dec 2016 04:50:46 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD4ojw8021448;
 Tue, 13 Dec 2016 04:50:45 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD4ojNL021447;
 Tue, 13 Dec 2016 04:50:45 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130450.uBD4ojNL021447@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 04:50:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310010 - stable/11/etc
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 04:50:46 -0000

Author: dteske
Date: Tue Dec 13 04:50:45 2016
New Revision: 310010
URL: https://svnweb.freebsd.org/changeset/base/310010

Log:
  MFC r309504: Fix bug preventing limits(1) from being applied
  
  PR:		misc/212493
  Differential Revision:	https://reviews.freebsd.org/D8232
  Submitted by:	girgen
  Reviewed by:	adrian

Modified:
  stable/11/etc/rc.subr
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/rc.subr
==============================================================================
--- stable/11/etc/rc.subr	Tue Dec 13 04:47:21 2016	(r310009)
+++ stable/11/etc/rc.subr	Tue Dec 13 04:50:45 2016	(r310010)
@@ -1045,6 +1045,7 @@ run_rc_command()
 					#
 			check_startmsgs && echo "Starting ${name}."
 			if [ -n "$_chroot" ]; then
+				_cd=
 				_doit="\
 ${_nice:+nice -n $_nice }\
 ${_fib:+setfib -F $_fib }\
@@ -1052,8 +1053,8 @@ ${_env:+env $_env }\
 chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
 $_chroot $command $rc_flags $command_args"
 			else
+				_cd="${_chdir:+cd $_chdir && }"
 				_doit="\
-${_chdir:+cd $_chdir && }\
 ${_fib:+setfib -F $_fib }\
 ${_env:+env $_env }\
 $command $rc_flags $command_args"
@@ -1072,7 +1073,7 @@ $command $rc_flags $command_args"
 			fi
 
 					# Prepend default limits
-			_doit="limits -C $_login_class $_doit"
+			_doit="$_cd limits -C $_login_class $_doit"
 
 					# run the full command
 					#

From owner-svn-src-all@freebsd.org  Tue Dec 13 04:53:26 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A31C74279;
 Tue, 13 Dec 2016 04:53:26 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B04A51E7E;
 Tue, 13 Dec 2016 04:53:26 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD4rPtT025403;
 Tue, 13 Dec 2016 04:53:25 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD4rPP2025401;
 Tue, 13 Dec 2016 04:53:25 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612130453.uBD4rPP2025401@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 04:53:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310011 - stable/11/share/examples/jails
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 04:53:26 -0000

Author: dteske
Date: Tue Dec 13 04:53:25 2016
New Revision: 310011
URL: https://svnweb.freebsd.org/changeset/base/310011

Log:
  MFC r308615 [brd]:
  Attempt to make the parts that people are supposed to change stand out more
  by capitalizing them.
  
  Approved by:	me

Modified:
  stable/11/share/examples/jails/rc.conf.jails
  stable/11/share/examples/jails/rcjail.xxx.conf
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/examples/jails/rc.conf.jails
==============================================================================
--- stable/11/share/examples/jails/rc.conf.jails	Tue Dec 13 04:50:45 2016	(r310010)
+++ stable/11/share/examples/jails/rc.conf.jails	Tue Dec 13 04:53:25 2016	(r310011)
@@ -5,7 +5,7 @@
 ###############################################################################
 
 jail_enable="YES"
-jail_list="xxx"
+jail_list="XXX"
 
 #
 # Global presets for all jails
@@ -57,19 +57,19 @@ jail_devfs_enable="YES"		# mount devfs
 #
 # XXX
 #
-jail_xxx_hostname="xxx.yyy"			# hostname
-jail_xxx_rootdir="/vm/xxx"			# root directory
+jail_XXX_hostname="XXX.YYY"			# hostname
+jail_XXX_rootdir="/vm/XXX"			# root directory
 # netgraph
-jail_xxx_vnet_interface="ng0_xxx"		# vnet interface(s)
-jail_xxx_exec_prestart0="jng bridge xxx em0"	# bridge interface(s)
-jail_xxx_exec_poststop0="jng shutdown xxx"	# destroy interface(s)
+jail_XXX_vnet_interface="ng0_XXX"		# vnet interface(s)
+jail_XXX_exec_prestart0="jng bridge XXX em0"	# bridge interface(s)
+jail_XXX_exec_poststop0="jng shutdown XXX"	# destroy interface(s)
 # if_bridge
-#jail_xxx_vnet_interface="e0b_xxx"		# vnet interface(s)
-#jail_xxx_exec_prestart0="jib addm xxx em0"	# bridge interface(s)
-#jail_xxx_exec_poststop0="jib destroy xxx"	# destroy interface(s)
+#jail_XXX_vnet_interface="e0b_XXX"		# vnet interface(s)
+#jail_XXX_exec_prestart0="jib addm XXX em0"	# bridge interface(s)
+#jail_XXX_exec_poststop0="jib destroy XXX"	# destroy interface(s)
 # Optional (default off)
-#jail_xxx_devfs_ruleset="11"			# rule to unhide bpf for DHCP
-#jail_xxx_mount_enable="YES"			# mount /etc/fstab.xxx
+#jail_XXX_devfs_ruleset="11"			# rule to unhide bpf for DHCP
+#jail_XXX_mount_enable="YES"			# mount /etc/fstab.XXX
 
 ################################################################################
 # END

Modified: stable/11/share/examples/jails/rcjail.xxx.conf
==============================================================================
--- stable/11/share/examples/jails/rcjail.xxx.conf	Tue Dec 13 04:50:45 2016	(r310010)
+++ stable/11/share/examples/jails/rcjail.xxx.conf	Tue Dec 13 04:53:25 2016	(r310011)
@@ -1,25 +1,25 @@
 # $FreeBSD$
 
-jail_xxx_hostname="xxx.yyy"			# hostname
-jail_xxx_rootdir="/vm/xxx"			# root directory
+jail_XXX_hostname="XXX.YYY"			# hostname
+jail_XXX_rootdir="/vm/XXX"			# root directory
 
 #
 # NB: Below 3 lines required
 #
 # netgraph
-jail_xxx_vnet_interface="ng0_xxx"		# vnet interface(s)
-jail_xxx_exec_prestart0="jng bridge xxx em0"	# bridge interface(s)
-jail_xxx_exec_poststop0="jng shutdown xxx"	# destroy interface(s)
+jail_XXX_vnet_interface="ng0_XXX"		# vnet interface(s)
+jail_XXX_exec_prestart0="jng bridge XXX em0"	# bridge interface(s)
+jail_XXX_exec_poststop0="jng shutdown XXX"	# destroy interface(s)
 # if_bridge
-#jail_xxx_vnet_interface="e0b_xxx"		# vnet interface(s)
-#jail_xxx_exec_prestart0="jib addm xxx em0"	# bridge interface(s)
-#jail_xxx_exec_poststop0="jib destroy xxx"	# destroy interface(s)
+#jail_XXX_vnet_interface="e0b_XXX"		# vnet interface(s)
+#jail_XXX_exec_prestart0="jib addm XXX em0"	# bridge interface(s)
+#jail_XXX_exec_poststop0="jib destroy XXX"	# destroy interface(s)
 
 # Standard recipe
-jail_xxx_devfs_enable="YES"			# mount devfs
+jail_XXX_devfs_enable="YES"			# mount devfs
 
 # Optional (default off)
-#jail_xxx_devfs_ruleset="11"			# rule to unhide bpf for DHCP
-#jail_xxx_mount_enable="YES"			# mount /etc/fstab.xxx
-#jail_xxx_set_hostname_allow="YES"		# Allow hostname to change
-#jail_xxx_sysvipc_allow="YES"			# Allow SysV Interprocess Comm.
+#jail_XXX_devfs_ruleset="11"			# rule to unhide bpf for DHCP
+#jail_XXX_mount_enable="YES"			# mount /etc/fstab.XXX
+#jail_XXX_set_hostname_allow="YES"		# Allow hostname to change
+#jail_XXX_sysvipc_allow="YES"			# Allow SysV Interprocess Comm.

From owner-svn-src-all@freebsd.org  Tue Dec 13 05:09:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2D89C74ECD;
 Tue, 13 Dec 2016 05:09:50 +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 C24F387C;
 Tue, 13 Dec 2016 05:09:50 +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 uBD59n73029545;
 Tue, 13 Dec 2016 05:09:49 GMT (envelope-from gonzo@FreeBSD.org)
Received: (from gonzo@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD59nct029544;
 Tue, 13 Dec 2016 05:09:49 GMT (envelope-from gonzo@FreeBSD.org)
Message-Id: <201612130509.uBD59nct029544@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: gonzo set sender to
 gonzo@FreeBSD.org using -f
From: Oleksandr Tymoshenko <gonzo@FreeBSD.org>
Date: Tue, 13 Dec 2016 05:09:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310012 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 05:09:51 -0000

Author: gonzo
Date: Tue Dec 13 05:09:49 2016
New Revision: 310012
URL: https://svnweb.freebsd.org/changeset/base/310012

Log:
  [iMX6] Add compatibility string for GPT timer on i.MX6 Dual
  
  Up until r295436 GPT timer in i.MX6 Dual dts used the same compatiblity
  string as i.MX6 Quad. After the sync up with Linux in r295436, GPT timer
  stopped getting attached on the i.MX6 Dual
  
  MFC after:	3 days

Modified:
  head/sys/arm/freescale/imx/imx_gpt.c

Modified: head/sys/arm/freescale/imx/imx_gpt.c
==============================================================================
--- head/sys/arm/freescale/imx/imx_gpt.c	Tue Dec 13 04:53:25 2016	(r310011)
+++ head/sys/arm/freescale/imx/imx_gpt.c	Tue Dec 13 05:09:49 2016	(r310012)
@@ -106,6 +106,7 @@ static struct resource_spec imx_gpt_spec
 };
 
 static struct ofw_compat_data compat_data[] = {
+	{"fsl,imx6dl-gpt",  1},
 	{"fsl,imx6q-gpt",  1},
 	{"fsl,imx53-gpt",  1},
 	{"fsl,imx51-gpt",  1},

From owner-svn-src-all@freebsd.org  Tue Dec 13 06:54:15 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0691EC7535C;
 Tue, 13 Dec 2016 06:54:15 +0000 (UTC)
 (envelope-from cperciva@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C9FA01E59;
 Tue, 13 Dec 2016 06:54:14 +0000 (UTC)
 (envelope-from cperciva@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD6sDoh073359;
 Tue, 13 Dec 2016 06:54:13 GMT (envelope-from cperciva@FreeBSD.org)
Received: (from cperciva@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD6sDtF073358;
 Tue, 13 Dec 2016 06:54:13 GMT (envelope-from cperciva@FreeBSD.org)
Message-Id: <201612130654.uBD6sDtF073358@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cperciva set sender to
 cperciva@FreeBSD.org using -f
From: Colin Percival <cperciva@FreeBSD.org>
Date: Tue, 13 Dec 2016 06:54:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310013 - head/sys/dev/xen/blkfront
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 06:54:15 -0000

Author: cperciva
Date: Tue Dec 13 06:54:13 2016
New Revision: 310013
URL: https://svnweb.freebsd.org/changeset/base/310013

Log:
  Check that blkfront devices have a non-zero number of sectors and a
  non-zero sector size.  Such a device would be a virtual disk of zero
  bytes; clearly not useful, and not something we should try to attach.
  
  As a fortuitous side effect, checking that these values are non-zero
  here results in them not *becoming* zero later on the function.  This
  odd behaviour began with r309124 (clang 3.9.0) but is challenging to
  debug; making any changes to this function whatsoever seems to affect
  the llvm optimizer behaviour enough to make the unexpected zeroing of
  the sector_size variable cease.
  
  PR:		215209
  Security:	The potential for variables to unexpectedly become zero
  		has worrying consequences for security in general, but
  		not so much in this particular context.

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

Modified: head/sys/dev/xen/blkfront/blkfront.c
==============================================================================
--- head/sys/dev/xen/blkfront/blkfront.c	Tue Dec 13 05:09:49 2016	(r310012)
+++ head/sys/dev/xen/blkfront/blkfront.c	Tue Dec 13 06:54:13 2016	(r310013)
@@ -1245,6 +1245,14 @@ xbd_connect(struct xbd_softc *sc)
 		    xenbus_get_otherend_path(dev));
 		return;
 	}
+	if ((sectors == 0) || (sector_size == 0)) {
+		xenbus_dev_fatal(dev, 0,
+		    "invalid parameters from %s:"
+		    " sectors = %lu, sector_size = %lu",
+		    xenbus_get_otherend_path(dev),
+		    sectors, sector_size);
+		return;
+	}
 	err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
 	     "physical-sector-size", "%lu", &phys_sector_size,
 	     NULL);

From owner-svn-src-all@freebsd.org  Tue Dec 13 07:58:31 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF111C755A6;
 Tue, 13 Dec 2016 07:58:31 +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 9DC4B1E60;
 Tue, 13 Dec 2016 07:58:31 +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 uBD7wUZJ097673;
 Tue, 13 Dec 2016 07:58:30 GMT (envelope-from ed@FreeBSD.org)
Received: (from ed@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD7wUNN097672;
 Tue, 13 Dec 2016 07:58:30 GMT (envelope-from ed@FreeBSD.org)
Message-Id: <201612130758.uBD7wUNN097672@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org
 using -f
From: Ed Schouten <ed@FreeBSD.org>
Date: Tue, 13 Dec 2016 07:58:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310014 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 07:58:31 -0000

Author: ed
Date: Tue Dec 13 07:58:30 2016
New Revision: 310014
URL: https://svnweb.freebsd.org/changeset/base/310014

Log:
  Remove the only user of sysctl_add_oid().
  
  My plan is to change this function's prototype at some point in the
  future to add a new label argument, which can be used to export all of
  sysctl as metrics that can be scraped by Prometheus. Switch over this
  caller to use the macro wrapper counterpart.

Modified:
  head/sys/compat/linuxkpi/common/include/linux/sysfs.h

Modified: head/sys/compat/linuxkpi/common/include/linux/sysfs.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/sysfs.h	Tue Dec 13 06:54:13 2016	(r310013)
+++ head/sys/compat/linuxkpi/common/include/linux/sysfs.h	Tue Dec 13 07:58:30 2016	(r310014)
@@ -126,7 +126,7 @@ static inline int
 sysfs_create_file(struct kobject *kobj, const struct attribute *attr)
 {
 
-	sysctl_add_oid(NULL, SYSCTL_CHILDREN(kobj->oidp), OID_AUTO,
+	SYSCTL_ADD_OID(NULL, SYSCTL_CHILDREN(kobj->oidp), OID_AUTO,
 	    attr->name, CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_MPSAFE, kobj,
 	    (uintptr_t)attr, sysctl_handle_attr, "A", "");
 
@@ -158,7 +158,7 @@ sysfs_create_group(struct kobject *kobj,
 	oidp = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(kobj->oidp),
 	    OID_AUTO, grp->name, CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, grp->name);
 	for (attr = grp->attrs; *attr != NULL; attr++) {
-		sysctl_add_oid(NULL, SYSCTL_CHILDREN(oidp), OID_AUTO,
+		SYSCTL_ADD_OID(NULL, SYSCTL_CHILDREN(oidp), OID_AUTO,
 		    (*attr)->name, CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_MPSAFE,
 		    kobj, (uintptr_t)*attr, sysctl_handle_attr, "A", "");
 	}

From owner-svn-src-all@freebsd.org  Tue Dec 13 09:17:32 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19E44C6B3DA;
 Tue, 13 Dec 2016 09:17:32 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DBCDE819;
 Tue, 13 Dec 2016 09:17:31 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD9HVVx029800;
 Tue, 13 Dec 2016 09:17:31 GMT (envelope-from ae@FreeBSD.org)
Received: (from ae@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD9HVBQ029799;
 Tue, 13 Dec 2016 09:17:31 GMT (envelope-from ae@FreeBSD.org)
Message-Id: <201612130917.uBD9HVBQ029799@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
 using -f
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Tue, 13 Dec 2016 09:17:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310015 - stable/11/sys/netpfil/ipfw
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 09:17:32 -0000

Author: ae
Date: Tue Dec 13 09:17:30 2016
New Revision: 310015
URL: https://svnweb.freebsd.org/changeset/base/310015

Log:
  MFC r309660:
    Convert result of hash_packet6() into host byte order.
  
    For IPv4 similar function uses addresses and ports in host byte order,
    but for IPv6 it used network byte order. This led to very bad hash
    distribution for IPv6 flows. Now the result looks similar to IPv4.

Modified:
  stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c
==============================================================================
--- stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c	Tue Dec 13 07:58:30 2016	(r310014)
+++ stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c	Tue Dec 13 09:17:30 2016	(r310015)
@@ -256,9 +256,8 @@ hash_packet6(struct ipfw_flow_id *id)
 	i = (id->dst_ip6.__u6_addr.__u6_addr32[2]) ^
 	    (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^
 	    (id->src_ip6.__u6_addr.__u6_addr32[2]) ^
-	    (id->src_ip6.__u6_addr.__u6_addr32[3]) ^
-	    (id->dst_port) ^ (id->src_port);
-	return i;
+	    (id->src_ip6.__u6_addr.__u6_addr32[3]);
+	return ntohl(i);
 }
 #endif
 
@@ -277,9 +276,9 @@ hash_packet(struct ipfw_flow_id *id, int
 		i = hash_packet6(id);
 	else
 #endif /* INET6 */
-	i = (id->dst_ip) ^ (id->src_ip) ^ (id->dst_port) ^ (id->src_port);
-	i &= (buckets - 1);
-	return i;
+	i = (id->dst_ip) ^ (id->src_ip);
+	i ^= (id->dst_port) ^ (id->src_port);
+	return (i & (buckets - 1));
 }
 
 /**

From owner-svn-src-all@freebsd.org  Tue Dec 13 09:43:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9657C6BF39;
 Tue, 13 Dec 2016 09:43:50 +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 A7D49165F;
 Tue, 13 Dec 2016 09:43:50 +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 uBD9hncd041647;
 Tue, 13 Dec 2016 09:43:49 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD9hnCN041646;
 Tue, 13 Dec 2016 09:43:49 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612130943.uBD9hnCN041646@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Tue, 13 Dec 2016 09:43:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310016 - stable/11/lib/libthr/thread
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 09:43:51 -0000

Author: kib
Date: Tue Dec 13 09:43:49 2016
New Revision: 310016
URL: https://svnweb.freebsd.org/changeset/base/310016

Log:
  MFC r309630:
  Do not leak curthread->inact_mtx when cancelling in pthread_cond_wait(3).

Modified:
  stable/11/lib/libthr/thread/thr_cond.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libthr/thread/thr_cond.c
==============================================================================
--- stable/11/lib/libthr/thread/thr_cond.c	Tue Dec 13 09:17:30 2016	(r310015)
+++ stable/11/lib/libthr/thread/thr_cond.c	Tue Dec 13 09:43:49 2016	(r310016)
@@ -224,16 +224,26 @@ cond_wait_kernel(struct pthread_cond *cv
 		 * state and unlock the mutex without making the state
 		 * consistent and the state will be unrecoverable.
 		 */
-		if (error2 == 0 && cancel)
+		if (error2 == 0 && cancel) {
+			if (robust) {
+				_mutex_leave_robust(curthread, mp);
+				robust = false;
+			}
 			_thr_testcancel(curthread);
+		}
 
 		if (error == EINTR)
 			error = 0;
 	} else {
 		/* We know that it didn't unlock the mutex. */
 		_mutex_cv_attach(mp, recurse);
-		if (cancel)
+		if (cancel) {
+			if (robust) {
+				_mutex_leave_robust(curthread, mp);
+				robust = false;
+			}
 			_thr_testcancel(curthread);
+		}
 		error2 = 0;
 	}
 	if (robust)

From owner-svn-src-all@freebsd.org  Tue Dec 13 09:53:45 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2191FC703B3;
 Tue, 13 Dec 2016 09:53:45 +0000 (UTC)
 (envelope-from mizhka@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E3C091D9E;
 Tue, 13 Dec 2016 09:53:44 +0000 (UTC)
 (envelope-from mizhka@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBD9riiB045570;
 Tue, 13 Dec 2016 09:53:44 GMT (envelope-from mizhka@FreeBSD.org)
Received: (from mizhka@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBD9rhAR045568;
 Tue, 13 Dec 2016 09:53:43 GMT (envelope-from mizhka@FreeBSD.org)
Message-Id: <201612130953.uBD9rhAR045568@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mizhka set sender to
 mizhka@FreeBSD.org using -f
From: Michael Zhilin <mizhka@FreeBSD.org>
Date: Tue, 13 Dec 2016 09:53:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310017 - in head/sys: dev/spibus mips/atheros/ar531x
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 09:53:45 -0000

Author: mizhka
Date: Tue Dec 13 09:53:43 2016
New Revision: 310017
URL: https://svnweb.freebsd.org/changeset/base/310017

Log:
  [spi] reformat message and ar5315_spi minor fix
  
  This commit corrects print of nomatch (newline was too early) and fix
  unit number for new child in ar5315_spi (was 0, now is -1 to calculate it
  according to actual system state)
  
  Submitted by:	Hiroki Mori <yamori813@yahoo.co.jp>
  Reviewed by:	ray, loos, mizhka
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D8749

Modified:
  head/sys/dev/spibus/spibus.c
  head/sys/mips/atheros/ar531x/ar5315_spi.c

Modified: head/sys/dev/spibus/spibus.c
==============================================================================
--- head/sys/dev/spibus/spibus.c	Tue Dec 13 09:43:49 2016	(r310016)
+++ head/sys/dev/spibus/spibus.c	Tue Dec 13 09:53:43 2016	(r310017)
@@ -117,8 +117,8 @@ spibus_probe_nomatch(device_t bus, devic
 	struct spibus_ivar *devi = SPIBUS_IVAR(child);
 
 	device_printf(bus, "<unknown card>");
-	printf(" at cs %d\n", devi->cs);
-	printf(" mode %d", devi->mode);
+	printf(" at cs %d", devi->cs);
+	printf(" mode %d\n", devi->mode);
 	return;
 }
 

Modified: head/sys/mips/atheros/ar531x/ar5315_spi.c
==============================================================================
--- head/sys/mips/atheros/ar531x/ar5315_spi.c	Tue Dec 13 09:43:49 2016	(r310016)
+++ head/sys/mips/atheros/ar531x/ar5315_spi.c	Tue Dec 13 09:53:43 2016	(r310017)
@@ -122,7 +122,7 @@ ar5315_spi_attach(device_t dev)
 		return (ENXIO);
 	}
 
-	device_add_child(dev, "spibus", 0);
+	device_add_child(dev, "spibus", -1);
 	ar5315_spi_attach_sysctl(dev);
 
 	return (bus_generic_attach(dev));

From owner-svn-src-all@freebsd.org  Tue Dec 13 10:03:30 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5710AC708DD;
 Tue, 13 Dec 2016 10:03:30 +0000 (UTC)
 (envelope-from mizhka@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 25F3D785;
 Tue, 13 Dec 2016 10:03:30 +0000 (UTC)
 (envelope-from mizhka@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDA3TXR049840;
 Tue, 13 Dec 2016 10:03:29 GMT (envelope-from mizhka@FreeBSD.org)
Received: (from mizhka@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDA3T3Z049839;
 Tue, 13 Dec 2016 10:03:29 GMT (envelope-from mizhka@FreeBSD.org)
Message-Id: <201612131003.uBDA3T3Z049839@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mizhka set sender to
 mizhka@FreeBSD.org using -f
From: Michael Zhilin <mizhka@FreeBSD.org>
Date: Tue, 13 Dec 2016 10:03:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310018 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 10:03:30 -0000

Author: mizhka
Date: Tue Dec 13 10:03:29 2016
New Revision: 310018
URL: https://svnweb.freebsd.org/changeset/base/310018

Log:
  [gpiospi] add clock delay to avoid smashing of bits
  
  Submitted by:	Hiroki Mori <yamori83@yahoo.co.jp>
  Reviewed by:	loos, ray, mizhka
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D8749

Modified:
  head/sys/dev/gpio/gpiospi.c

Modified: head/sys/dev/gpio/gpiospi.c
==============================================================================
--- head/sys/dev/gpio/gpiospi.c	Tue Dec 13 09:53:43 2016	(r310017)
+++ head/sys/dev/gpio/gpiospi.c	Tue Dec 13 10:03:29 2016	(r310018)
@@ -293,6 +293,7 @@ gpio_spi_txrx(struct gpio_spi_softc *sc,
 			gpio_delay(sc);
 			GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev,
 			    sc->sc_sclk, 1);
+			gpio_delay(sc);
 		} else {
 			/* If mode 0 or 3 */
 
@@ -312,6 +313,7 @@ gpio_spi_txrx(struct gpio_spi_softc *sc,
 			gpio_delay(sc);
 			GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev,
 			    sc->sc_sclk, 0);
+			gpio_delay(sc);
 		}
 	}
 

From owner-svn-src-all@freebsd.org  Tue Dec 13 11:43:47 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2919C75E4D;
 Tue, 13 Dec 2016 11:43:47 +0000 (UTC)
 (envelope-from ganbold@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CCF5610D3;
 Tue, 13 Dec 2016 11:43:47 +0000 (UTC)
 (envelope-from ganbold@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDBhlcc089933;
 Tue, 13 Dec 2016 11:43:47 GMT (envelope-from ganbold@FreeBSD.org)
Received: (from ganbold@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDBhk32089928;
 Tue, 13 Dec 2016 11:43:46 GMT (envelope-from ganbold@FreeBSD.org)
Message-Id: <201612131143.uBDBhk32089928@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ganbold set sender to
 ganbold@FreeBSD.org using -f
From: Ganbold Tsagaankhuu <ganbold@FreeBSD.org>
Date: Tue, 13 Dec 2016 11:43:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310019 - in head/sys: arm/conf arm/rockchip conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 11:43:48 -0000

Author: ganbold
Date: Tue Dec 13 11:43:46 2016
New Revision: 310019
URL: https://svnweb.freebsd.org/changeset/base/310019

Log:
  Switch Rockchip RK3188 SoC to use the platform code.
  
  Reviewed by:	andrew, manu
  Differential Revision:	https://reviews.freebsd.org/D8769

Added:
  head/sys/arm/rockchip/rk30xx_mp.h   (contents, props changed)
Modified:
  head/sys/arm/conf/RK3188
  head/sys/arm/rockchip/rk30xx_machdep.c
  head/sys/arm/rockchip/rk30xx_mp.c
  head/sys/conf/options.arm

Modified: head/sys/arm/conf/RK3188
==============================================================================
--- head/sys/arm/conf/RK3188	Tue Dec 13 10:03:29 2016	(r310018)
+++ head/sys/arm/conf/RK3188	Tue Dec 13 11:43:46 2016	(r310019)
@@ -23,8 +23,13 @@ ident		RK3188
 include 	"std.armv6"
 include 	"../rockchip/std.rk30xx"
 
+options 	SOC_ROCKCHIP_RK3188
+
 options 	SCHED_ULE		# ULE scheduler
 options 	SMP			# Enable multiple cores
+options 	PLATFORM
+options 	PLATFORM_SMP
+options 	MULTIDELAY
 
 # Root mount from MMC/SD card
 options 	ROOTDEVNAME=\"ufs:/dev/mmcsd0\"

Modified: head/sys/arm/rockchip/rk30xx_machdep.c
==============================================================================
--- head/sys/arm/rockchip/rk30xx_machdep.c	Tue Dec 13 10:03:29 2016	(r310018)
+++ head/sys/arm/rockchip/rk30xx_machdep.c	Tue Dec 13 11:43:46 2016	(r310019)
@@ -42,33 +42,25 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm.h>
 #include <vm/pmap.h>
 
-#include <machine/armreg.h>
 #include <machine/bus.h>
 #include <machine/machdep.h>
-#include <machine/platform.h> 
+#include <machine/platform.h>
+#include <machine/platformvar.h>
 
 #include <arm/rockchip/rk30xx_wdog.h>
+#include <arm/rockchip/rk30xx_mp.h>
 
-vm_offset_t
-platform_lastaddr(void)
-{
+#include "platform_if.h"
 
-	return (devmap_lastaddr());
-}
-
-void
-platform_probe_and_attach(void)
+static vm_offset_t
+rk30xx_lastaddr(platform_t plat)
 {
 
+	return (devmap_lastaddr());
 }
 
-void
-platform_gpio_init(void)
-{
-}
-
-void
-platform_late_init(void)
+static void
+rk30xx_late_init(platform_t plat)
 {
 
 	/* Enable cache */
@@ -79,8 +71,8 @@ platform_late_init(void)
 /*
  * Set up static device mappings.
  */
-int
-platform_devmap_init(void)
+static int
+rk30xx_devmap_init(platform_t plat)
 {
 
 	devmap_add_entry(0x10000000, 0x00200000);
@@ -89,11 +81,27 @@ platform_devmap_init(void)
 	return (0);
 }
 
-void
-cpu_reset()
+static void
+rk30xx_cpu_reset()
 {
 
 	rk30_wd_watchdog_reset();
 	printf("Reset failed!\n");
 	while (1);
 }
+
+#if defined(SOC_ROCKCHIP_RK3188)
+static platform_method_t rk30xx_methods[] = {
+	PLATFORMMETHOD(platform_lastaddr,	rk30xx_lastaddr),
+	PLATFORMMETHOD(platform_devmap_init,	rk30xx_devmap_init),
+	PLATFORMMETHOD(platform_late_init,	rk30xx_late_init),
+	PLATFORMMETHOD(platform_cpu_reset,	rk30xx_cpu_reset),
+
+#ifdef SMP
+	PLATFORMMETHOD(platform_mp_start_ap,	rk30xx_mp_start_ap),
+	PLATFORMMETHOD(platform_mp_setmaxid,	rk30xx_mp_setmaxid),
+#endif
+	PLATFORMMETHOD_END,
+};
+FDT_PLATFORM_DEF(rk30xx, "RK3188", 0, "rockchip,rk3188", 200);
+#endif

Modified: head/sys/arm/rockchip/rk30xx_mp.c
==============================================================================
--- head/sys/arm/rockchip/rk30xx_mp.c	Tue Dec 13 10:03:29 2016	(r310018)
+++ head/sys/arm/rockchip/rk30xx_mp.c	Tue Dec 13 11:43:46 2016	(r310019)
@@ -37,9 +37,13 @@ __FBSDID("$FreeBSD$");
 #include <vm/pmap.h>
 
 #include <machine/cpu.h>
+#include <machine/cpu-v6.h>
 #include <machine/smp.h>
 #include <machine/fdt.h>
 #include <machine/intr.h>
+#include <machine/platformvar.h>
+
+#include <arm/rockchip/rk30xx_mp.h>
 
 #define	SCU_PHYSBASE			0x1013c000
 #define	SCU_SIZE			0x100
@@ -80,7 +84,7 @@ rk30xx_boot2(void)
 }
 
 void
-platform_mp_setmaxid(void)
+rk30xx_mp_setmaxid(platform_t plat)
 {
 	bus_space_handle_t scu;
 	int ncpu;
@@ -101,7 +105,7 @@ platform_mp_setmaxid(void)
 }
 
 void
-platform_mp_start_ap(void)
+rk30xx_mp_start_ap(platform_t plat)
 {
 	bus_space_handle_t scu;
 	bus_space_handle_t imem;

Added: head/sys/arm/rockchip/rk30xx_mp.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/arm/rockchip/rk30xx_mp.h	Tue Dec 13 11:43:46 2016	(r310019)
@@ -0,0 +1,38 @@
+/*-
+ * Copyright (C) 2016 Ganbold Tsagaankhuu <ganbold@freebsd.org>
+ * 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
+ *
+ * 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 _RK30XX_MP_H_
+#define	_RK30XX_MP_H_
+
+void rk30xx_mp_setmaxid(platform_t plat);
+void rk30xx_mp_start_ap(platform_t plat);
+
+#endif /* _RK30XX_MP_H_ */

Modified: head/sys/conf/options.arm
==============================================================================
--- head/sys/conf/options.arm	Tue Dec 13 10:03:29 2016	(r310018)
+++ head/sys/conf/options.arm	Tue Dec 13 11:43:46 2016	(r310019)
@@ -64,6 +64,7 @@ SOC_MV_LOKIPLUS		opt_global.h
 SOC_MV_ORION		opt_global.h
 SOC_OMAP3		opt_global.h
 SOC_OMAP4		opt_global.h
+SOC_ROCKCHIP_RK3188	opt_global.h
 SOC_TI_AM335X		opt_global.h
 SOC_TEGRA2		opt_global.h
 XSCALE_CACHE_READ_WRITE_ALLOCATE	opt_global.h

From owner-svn-src-all@freebsd.org  Tue Dec 13 12:11:24 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 097BCC72600;
 Tue, 13 Dec 2016 12:11:24 +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 79C90BAB;
 Tue, 13 Dec 2016 12:11:23 +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 uBDCBHuC044928
 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
 Tue, 13 Dec 2016 14:11:18 +0200 (EET)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBDCBHuC044928
Received: (from kostik@localhost)
 by tom.home (8.15.2/8.15.2/Submit) id uBDCBHhf044926;
 Tue, 13 Dec 2016 14:11:17 +0200 (EET)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Tue, 13 Dec 2016 14:11:17 +0200
From: Konstantin Belousov <kostikbel@gmail.com>
To: Bruce Evans <brde@optusnet.com.au>
Cc: Edward Tomasz Napierala <trasz@freebsd.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r309891 - head/sys/kern
Message-ID: <20161213121117.GV54029@kib.kiev.ua>
References: <201612121522.uBCFMMmm088698@repo.freebsd.org>
 <20161212163331.GH54029@kib.kiev.ua> <20161212191257.GA11238@brick>
 <20161213091945.V1082@besplex.bde.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20161213091945.V1082@besplex.bde.org>
User-Agent: Mutt/1.7.1 (2016-10-04)
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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 12:11:24 -0000

On Tue, Dec 13, 2016 at 10:20:30AM +1100, Bruce Evans wrote:
> Hrmph.  kib didn't like my patch to kill the spam from reentering ddb.
> The spam messes up even cases where the ddb command handles errors.
> Howver, in most cases the error handling is incomplete.  There is always
> the outer setjmp/longjmp back to the command loop.  This gives null and
> bad error handling for unexpected null pointer accesses like the one here.
> Other cases set up inner setjump/longjmps which longjmp back to an inner
> context which prints an error message (spammed by the reentry messages)
> and should clean up.  However, cleanup is rarely done.  One case is
> writing to inaccessible memory on at least x86.  Then the page tables
> are left in modified state.
You have a variant of the patch which makes the behaviour adjustable.
I already agreed with that modification, and with making the defaults
to not print the backtrace.

> 
> Null pointer panics are also interesting.  They seem to have been broken
> on i386 by the double mapping of low memory (PTD[0] = PTD[KERNBASE >> 12] =
> shared page table for low physical memory).  So the null pointer is mapped
> and points to physical memory 0 .  There are other bugs from the shared
> page table.  When I fix the other bugs by changing PTD[0] to 0, this also
> fixes null pointers.  It breaks ACPI resume but not much else.  See
> locore.s for some details about the mapping -- it is documented as being
> mainly for ACPI.  But ACPI somehow works on amd64 with PTD[0] = 0.
That page table is only active for the kernel processes, so most often,
when userspace part is present, page at zero is not mapped.

From owner-svn-src-all@freebsd.org  Tue Dec 13 13:07:18 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C2E3C75211;
 Tue, 13 Dec 2016 13:07:18 +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 2B887EE7;
 Tue, 13 Dec 2016 13:07:18 +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 uBDD7H5P022411;
 Tue, 13 Dec 2016 13:07:17 GMT (envelope-from andrew@FreeBSD.org)
Received: (from andrew@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDD7H5i022410;
 Tue, 13 Dec 2016 13:07:17 GMT (envelope-from andrew@FreeBSD.org)
Message-Id: <201612131307.uBDD7H5i022410@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: andrew set sender to
 andrew@FreeBSD.org using -f
From: Andrew Turner <andrew@FreeBSD.org>
Date: Tue, 13 Dec 2016 13:07:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310020 - head/sys/arm/rockchip
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 13:07:18 -0000

Author: andrew
Date: Tue Dec 13 13:07:17 2016
New Revision: 310020
URL: https://svnweb.freebsd.org/changeset/base/310020

Log:
  Use platform_*_t to check the platform function signatures are correct in
  the Rockchip platform code and correct the one place they differ.
  
  Sponsored by:	ABT Systems Ltd

Modified:
  head/sys/arm/rockchip/rk30xx_machdep.c

Modified: head/sys/arm/rockchip/rk30xx_machdep.c
==============================================================================
--- head/sys/arm/rockchip/rk30xx_machdep.c	Tue Dec 13 11:43:46 2016	(r310019)
+++ head/sys/arm/rockchip/rk30xx_machdep.c	Tue Dec 13 13:07:17 2016	(r310020)
@@ -52,6 +52,11 @@ __FBSDID("$FreeBSD$");
 
 #include "platform_if.h"
 
+static platform_lastaddr_t rk30xx_lastaddr;
+static platform_devmap_init_t rk30xx_devmap_init;
+static platform_late_init_t rk30xx_late_init;
+static platform_cpu_reset_t rk30xx_cpu_reset;
+
 static vm_offset_t
 rk30xx_lastaddr(platform_t plat)
 {
@@ -82,7 +87,7 @@ rk30xx_devmap_init(platform_t plat)
 }
 
 static void
-rk30xx_cpu_reset()
+rk30xx_cpu_reset(platform_t plat)
 {
 
 	rk30_wd_watchdog_reset();

From owner-svn-src-all@freebsd.org  Tue Dec 13 13:43:26 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BF2BC741B2;
 Tue, 13 Dec 2016 13:43:26 +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 197CF6A7;
 Tue, 13 Dec 2016 13:43:26 +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 uBDDhPdL038300;
 Tue, 13 Dec 2016 13:43:25 GMT (envelope-from andrew@FreeBSD.org)
Received: (from andrew@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDDhNbC038278;
 Tue, 13 Dec 2016 13:43:23 GMT (envelope-from andrew@FreeBSD.org)
Message-Id: <201612131343.uBDDhNbC038278@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: andrew set sender to
 andrew@FreeBSD.org using -f
From: Andrew Turner <andrew@FreeBSD.org>
Date: Tue, 13 Dec 2016 13:43:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310021 - in head/sys/arm: allwinner amlogic/aml8726 arm
 broadcom/bcm2835 freescale/imx lpc nvidia rockchip ti/am335x versatile xilinx
 xscale/pxa
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 13:43:26 -0000

Author: andrew
Date: Tue Dec 13 13:43:22 2016
New Revision: 310021
URL: https://svnweb.freebsd.org/changeset/base/310021

Log:
  Add the missing void to function signatures in much of the arm code.
  
  Sponsored by:	ABT Systems Ltd

Modified:
  head/sys/arm/allwinner/aw_wdog.c
  head/sys/arm/amlogic/aml8726/aml8726_identsoc.c
  head/sys/arm/amlogic/aml8726/aml8726_machdep.c
  head/sys/arm/amlogic/aml8726/aml8726_wdt.c
  head/sys/arm/arm/cpufunc.c
  head/sys/arm/arm/db_trace.c
  head/sys/arm/arm/physmem.c
  head/sys/arm/arm/undefined.c
  head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c
  head/sys/arm/freescale/imx/imx6_anatop.c
  head/sys/arm/freescale/imx/imx6_src.c
  head/sys/arm/lpc/lpc_gpio.c
  head/sys/arm/nvidia/tegra_efuse.c
  head/sys/arm/rockchip/rk30xx_wdog.c
  head/sys/arm/ti/am335x/am335x_dmtpps.c
  head/sys/arm/versatile/versatile_machdep.c
  head/sys/arm/xilinx/zy7_machdep.c
  head/sys/arm/xilinx/zy7_slcr.c
  head/sys/arm/xscale/pxa/pxa_gpio.c
  head/sys/arm/xscale/pxa/pxa_icu.c
  head/sys/arm/xscale/pxa/pxa_space.c
  head/sys/arm/xscale/pxa/pxa_timer.c

Modified: head/sys/arm/allwinner/aw_wdog.c
==============================================================================
--- head/sys/arm/allwinner/aw_wdog.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/allwinner/aw_wdog.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -237,7 +237,7 @@ aw_wdog_shutdown_fn(void *private, int h
 }
 
 void
-aw_wdog_watchdog_reset()
+aw_wdog_watchdog_reset(void)
 {
 
 	if (aw_wdog_sc == NULL) {

Modified: head/sys/arm/amlogic/aml8726/aml8726_identsoc.c
==============================================================================
--- head/sys/arm/amlogic/aml8726/aml8726_identsoc.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/amlogic/aml8726/aml8726_identsoc.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -87,7 +87,7 @@ static const struct {
 };
 
 void
-aml8726_identify_soc()
+aml8726_identify_soc(void)
 {
 	int err;
 	struct resource res;

Modified: head/sys/arm/amlogic/aml8726/aml8726_machdep.c
==============================================================================
--- head/sys/arm/amlogic/aml8726/aml8726_machdep.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/amlogic/aml8726/aml8726_machdep.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -56,7 +56,7 @@ vm_offset_t aml8726_aobus_kva_base;
 #endif
 
 static void
-aml8726_fixup_busfreq()
+aml8726_fixup_busfreq(void)
 {
 	phandle_t node;
 	pcell_t freq, prop;

Modified: head/sys/arm/amlogic/aml8726/aml8726_wdt.c
==============================================================================
--- head/sys/arm/amlogic/aml8726/aml8726_wdt.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/amlogic/aml8726/aml8726_wdt.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -289,7 +289,7 @@ EARLY_DRIVER_MODULE(wdt, simplebus, aml8
     0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);
 
 void
-cpu_reset()
+cpu_reset(void)
 {
 
 	/* Watchdog has not yet been initialized */

Modified: head/sys/arm/arm/cpufunc.c
==============================================================================
--- head/sys/arm/arm/cpufunc.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/arm/cpufunc.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -485,7 +485,7 @@ static int	arm_dcache_l2_assoc;
 static int	arm_dcache_l2_linesize;
 
 static void
-get_cachetype_cp15()
+get_cachetype_cp15(void)
 {
 	u_int ctype, isize, dsize, cpuid;
 	u_int clevel, csize, i, sel;
@@ -600,7 +600,7 @@ get_cachetype_cp15()
  */
 
 int
-set_cpufuncs()
+set_cpufuncs(void)
 {
 	cputype = cpu_ident();
 	cputype &= CPU_ID_CPU_MASK;

Modified: head/sys/arm/arm/db_trace.c
==============================================================================
--- head/sys/arm/arm/db_trace.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/arm/db_trace.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -130,7 +130,7 @@ db_stack_trace_cmd(struct unwind_state *
 }
 
 void
-db_md_list_watchpoints()
+db_md_list_watchpoints(void)
 {
 
 	dbg_show_watchpoint();

Modified: head/sys/arm/arm/physmem.c
==============================================================================
--- head/sys/arm/arm/physmem.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/arm/physmem.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -145,7 +145,7 @@ physmem_dump_tables(int (*prfunc)(const 
  * Print the contents of the static mapping table.  Used for bootverbose.
  */
 void
-arm_physmem_print_tables()
+arm_physmem_print_tables(void)
 {
 
 	physmem_dump_tables(printf);

Modified: head/sys/arm/arm/undefined.c
==============================================================================
--- head/sys/arm/arm/undefined.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/arm/undefined.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -165,7 +165,7 @@ gdb_trapper(u_int addr, u_int insn, stru
 static struct undefined_handler gdb_uh;
 
 void
-undefined_init()
+undefined_init(void)
 {
 	int loop;
 

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -190,7 +190,7 @@ bcmwd_watchdog_fn(void *private, u_int c
 }
 
 void
-bcmwd_watchdog_reset()
+bcmwd_watchdog_reset(void)
 {
 
 	if (bcmwd_lsc == NULL)

Modified: head/sys/arm/freescale/imx/imx6_anatop.c
==============================================================================
--- head/sys/arm/freescale/imx/imx6_anatop.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/freescale/imx/imx6_anatop.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -776,7 +776,7 @@ imx6_anatop_probe(device_t dev)
 }
 
 uint32_t 
-imx6_get_cpu_clock()
+imx6_get_cpu_clock(void)
 {
 	uint32_t corediv, plldiv;
 

Modified: head/sys/arm/freescale/imx/imx6_src.c
==============================================================================
--- head/sys/arm/freescale/imx/imx6_src.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/freescale/imx/imx6_src.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -70,7 +70,7 @@ WR4(struct src_softc *sc, bus_size_t off
 }
 
 int
-src_reset_ipu()
+src_reset_ipu(void)
 {
 	uint32_t reg;
 	int timeout = 10000;

Modified: head/sys/arm/lpc/lpc_gpio.c
==============================================================================
--- head/sys/arm/lpc/lpc_gpio.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/lpc/lpc_gpio.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -518,7 +518,7 @@ lpc_gpio_get_state(device_t dev, int pin
 }
 
 void
-lpc_gpio_init()
+lpc_gpio_init(void)
 {
 	bus_space_tag_t bst;
 	bus_space_handle_t bsh;

Modified: head/sys/arm/nvidia/tegra_efuse.c
==============================================================================
--- head/sys/arm/nvidia/tegra_efuse.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/nvidia/tegra_efuse.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -236,7 +236,7 @@ tegra_fuse_read_4(int addr) {
 
 
 static void
-tegra_efuse_dump_sku()
+tegra_efuse_dump_sku(void)
 {
 	printf(" TEGRA SKU Info:\n");
 	printf("  chip_id: %u\n", tegra_sku_info.chip_id);

Modified: head/sys/arm/rockchip/rk30xx_wdog.c
==============================================================================
--- head/sys/arm/rockchip/rk30xx_wdog.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/rockchip/rk30xx_wdog.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -170,7 +170,7 @@ rk30_wd_watchdog_fn(void *private, u_int
 }
 
 void
-rk30_wd_watchdog_reset()
+rk30_wd_watchdog_reset(void)
 {
 	bus_space_handle_t bsh;
 

Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c
==============================================================================
--- head/sys/arm/ti/am335x/am335x_dmtpps.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/ti/am335x/am335x_dmtpps.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -163,7 +163,7 @@ dmtpps_translate_nickname(const char *ni
  * fails that IS an error, return -1.
  */
 static int
-dmtpps_find_tmr_num_by_tunable()
+dmtpps_find_tmr_num_by_tunable(void)
 {
 	struct padinfo *pi;
 	char iname[20];
@@ -201,7 +201,7 @@ dmtpps_find_tmr_num_by_tunable()
  * input pin.  If so, return the timer number, if not return 0.
  */
 static int
-dmtpps_find_tmr_num_by_padconf()
+dmtpps_find_tmr_num_by_padconf(void)
 {
 	int err;
 	unsigned int padstate;
@@ -225,7 +225,7 @@ dmtpps_find_tmr_num_by_padconf()
  * configuration.  This is done just once, the first time probe() runs.
  */
 static int
-dmtpps_find_tmr_num()
+dmtpps_find_tmr_num(void)
 {
 	int tmr_num;
 

Modified: head/sys/arm/versatile/versatile_machdep.c
==============================================================================
--- head/sys/arm/versatile/versatile_machdep.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/versatile/versatile_machdep.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -100,7 +100,7 @@ platform_devmap_init(void)
 }
 
 void
-cpu_reset()
+cpu_reset(void)
 {
 	printf("cpu_reset\n");
 	while (1);

Modified: head/sys/arm/xilinx/zy7_machdep.c
==============================================================================
--- head/sys/arm/xilinx/zy7_machdep.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/xilinx/zy7_machdep.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -91,7 +91,7 @@ platform_devmap_init(void)
 }
 
 void
-cpu_reset()
+cpu_reset(void)
 {
 	if (zynq7_cpu_reset != NULL)
 		(*zynq7_cpu_reset)();

Modified: head/sys/arm/xilinx/zy7_slcr.c
==============================================================================
--- head/sys/arm/xilinx/zy7_slcr.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/xilinx/zy7_slcr.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -496,7 +496,7 @@ zy7_pl_fclk_enabled(int unit)
 }
 
 int
-zy7_pl_level_shifters_enabled()
+zy7_pl_level_shifters_enabled(void)
 {
 	struct zy7_slcr_softc *sc = zy7_slcr_softc_p;
 
@@ -513,7 +513,7 @@ zy7_pl_level_shifters_enabled()
 }
 
 void
-zy7_pl_level_shifters_enable()
+zy7_pl_level_shifters_enable(void)
 {
 	struct zy7_slcr_softc *sc = zy7_slcr_softc_p;
 
@@ -528,7 +528,7 @@ zy7_pl_level_shifters_enable()
 }
 
 void
-zy7_pl_level_shifters_disable()
+zy7_pl_level_shifters_disable(void)
 {
 	struct zy7_slcr_softc *sc = zy7_slcr_softc_p;
 

Modified: head/sys/arm/xscale/pxa/pxa_gpio.c
==============================================================================
--- head/sys/arm/xscale/pxa/pxa_gpio.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/xscale/pxa/pxa_gpio.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -331,7 +331,7 @@ pxa_gpio_unmask_irq(int irq)
 }
 
 int
-pxa_gpio_get_next_irq()
+pxa_gpio_get_next_irq(void)
 {
 	struct  pxa_gpio_softc *sc;
 	int     gpio;

Modified: head/sys/arm/xscale/pxa/pxa_icu.c
==============================================================================
--- head/sys/arm/xscale/pxa/pxa_icu.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/xscale/pxa/pxa_icu.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -171,7 +171,7 @@ arm_unmask_irq(uintptr_t nb)
 }
 
 uint32_t
-pxa_icu_get_icip()
+pxa_icu_get_icip(void)
 {
 
 	return (bus_space_read_4(pxa_icu_softc->pi_bst,
@@ -187,7 +187,7 @@ pxa_icu_clear_icip(int irq)
 }
 
 uint32_t
-pxa_icu_get_icfp()
+pxa_icu_get_icfp(void)
 {
 
 	return (bus_space_read_4(pxa_icu_softc->pi_bst,
@@ -203,7 +203,7 @@ pxa_icu_clear_icfp(int irq)
 }
 
 uint32_t
-pxa_icu_get_icmr()
+pxa_icu_get_icmr(void)
 {
 
 	return (bus_space_read_4(pxa_icu_softc->pi_bst,
@@ -219,7 +219,7 @@ pxa_icu_set_icmr(uint32_t val)
 }
 
 uint32_t
-pxa_icu_get_iclr()
+pxa_icu_get_iclr(void)
 {
 
 	return (bus_space_read_4(pxa_icu_softc->pi_bst,
@@ -235,7 +235,7 @@ pxa_icu_set_iclr(uint32_t val)
 }
 
 uint32_t
-pxa_icu_get_icpr()
+pxa_icu_get_icpr(void)
 {
 
 	return (bus_space_read_4(pxa_icu_softc->pi_bst,
@@ -243,7 +243,7 @@ pxa_icu_get_icpr()
 }
 
 void
-pxa_icu_idle_enable()
+pxa_icu_idle_enable(void)
 {
 
 	bus_space_write_4(pxa_icu_softc->pi_bst,
@@ -251,7 +251,7 @@ pxa_icu_idle_enable()
 }
 
 void
-pxa_icu_idle_disable()
+pxa_icu_idle_disable(void)
 {
 
 	bus_space_write_4(pxa_icu_softc->pi_bst,

Modified: head/sys/arm/xscale/pxa/pxa_space.c
==============================================================================
--- head/sys/arm/xscale/pxa/pxa_space.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/xscale/pxa/pxa_space.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -176,7 +176,7 @@ bus_space_tag_t		base_tag = &_base_tag;
 bus_space_tag_t		obio_tag = NULL;
 
 void
-pxa_obio_tag_init()
+pxa_obio_tag_init(void)
 {
 
 	bcopy(&_base_tag, &_obio_tag, sizeof(struct bus_space));

Modified: head/sys/arm/xscale/pxa/pxa_timer.c
==============================================================================
--- head/sys/arm/xscale/pxa/pxa_timer.c	Tue Dec 13 13:07:17 2016	(r310020)
+++ head/sys/arm/xscale/pxa/pxa_timer.c	Tue Dec 13 13:43:22 2016	(r310021)
@@ -235,7 +235,7 @@ pxa_timer_set_osmr(int which, uint32_t v
 }
 
 uint32_t
-pxa_timer_get_oscr()
+pxa_timer_get_oscr(void)
 {
 
 	return (bus_space_read_4(timer_softc->pt_bst,
@@ -251,7 +251,7 @@ pxa_timer_set_oscr(uint32_t val)
 }
 
 uint32_t
-pxa_timer_get_ossr()
+pxa_timer_get_ossr(void)
 {
 
 	return (bus_space_read_4(timer_softc->pt_bst,
@@ -267,7 +267,7 @@ pxa_timer_clear_ossr(uint32_t val)
 }
 
 void
-pxa_timer_watchdog_enable()
+pxa_timer_watchdog_enable(void)
 {
 
 	bus_space_write_4(timer_softc->pt_bst,
@@ -275,7 +275,7 @@ pxa_timer_watchdog_enable()
 }
 
 void
-pxa_timer_watchdog_disable()	
+pxa_timer_watchdog_disable(void)
 {
 
 	bus_space_write_4(timer_softc->pt_bst,

From owner-svn-src-all@freebsd.org  Tue Dec 13 13:46:11 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E6C0C7430E;
 Tue, 13 Dec 2016 13:46:11 +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 62999A4C;
 Tue, 13 Dec 2016 13:46:11 +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 uBDDkAv8038454;
 Tue, 13 Dec 2016 13:46:10 GMT (envelope-from andrew@FreeBSD.org)
Received: (from andrew@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDDk9Al038447;
 Tue, 13 Dec 2016 13:46:09 GMT (envelope-from andrew@FreeBSD.org)
Message-Id: <201612131346.uBDDk9Al038447@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: andrew set sender to
 andrew@FreeBSD.org using -f
From: Andrew Turner <andrew@FreeBSD.org>
Date: Tue, 13 Dec 2016 13:46:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310022 - in head/sys/arm: allwinner broadcom/bcm2835
 freescale/imx nvidia/tegra124 ti
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 13:46:11 -0000

Author: andrew
Date: Tue Dec 13 13:46:09 2016
New Revision: 310022
URL: https://svnweb.freebsd.org/changeset/base/310022

Log:
  Use the platform_*_t typedefs to help check the platform function types are
  correct.
  
  Sponsored by:	ABT Systems Ltd

Modified:
  head/sys/arm/allwinner/aw_machdep.c
  head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
  head/sys/arm/freescale/imx/imx51_machdep.c
  head/sys/arm/freescale/imx/imx53_machdep.c
  head/sys/arm/freescale/imx/imx6_machdep.c
  head/sys/arm/nvidia/tegra124/tegra124_machdep.c
  head/sys/arm/ti/ti_machdep.c

Modified: head/sys/arm/allwinner/aw_machdep.c
==============================================================================
--- head/sys/arm/allwinner/aw_machdep.c	Tue Dec 13 13:43:22 2016	(r310021)
+++ head/sys/arm/allwinner/aw_machdep.c	Tue Dec 13 13:46:09 2016	(r310022)
@@ -54,6 +54,17 @@ __FBSDID("$FreeBSD$");
 
 #include "platform_if.h"
 
+static platform_attach_t a10_attach;
+static platform_attach_t a13_attach;
+static platform_attach_t a20_attach;
+static platform_attach_t a31_attach;
+static platform_attach_t a31s_attach;
+static platform_attach_t a83t_attach;
+static platform_attach_t h3_attach;
+static platform_lastaddr_t allwinner_lastaddr;
+static platform_devmap_init_t allwinner_devmap_init;
+static platform_cpu_reset_t allwinner_cpu_reset;
+
 static u_int soc_type;
 static u_int soc_family;
 

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c	Tue Dec 13 13:43:22 2016	(r310021)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c	Tue Dec 13 13:46:09 2016	(r310022)
@@ -62,6 +62,16 @@ __FBSDID("$FreeBSD$");
 
 #include "platform_if.h"
 
+#ifdef SOC_BCM2835
+static platform_devmap_init_t bcm2835_devmap_init;
+#endif
+#ifdef SOC_BCM2836
+static platform_devmap_init_t bcm2836_devmap_init;
+#endif
+static platform_lastaddr_t bcm2835_lastaddr;
+static platform_late_init_t bcm2835_late_init;
+static platform_cpu_reset_t bcm2835_cpu_reset;
+
 static vm_offset_t
 bcm2835_lastaddr(platform_t plat)
 {

Modified: head/sys/arm/freescale/imx/imx51_machdep.c
==============================================================================
--- head/sys/arm/freescale/imx/imx51_machdep.c	Tue Dec 13 13:43:22 2016	(r310021)
+++ head/sys/arm/freescale/imx/imx51_machdep.c	Tue Dec 13 13:46:09 2016	(r310022)
@@ -45,6 +45,11 @@ __FBSDID("$FreeBSD$");
 
 #include "platform_if.h"
 
+static platform_attach_t imx51_attach;
+static platform_devmap_init_t imx51_devmap_init;
+static platform_lastaddr_t imx51_lastaddr;
+static platform_cpu_reset_t imx51_cpu_reset;
+
 static vm_offset_t
 imx51_lastaddr(platform_t plat)
 {
@@ -88,7 +93,8 @@ imx51_cpu_reset(platform_t plat)
 	imx_wdog_cpu_reset(0x73F98000);
 }
 
-u_int imx_soc_type()
+u_int
+imx_soc_type(void)
 {
 	return (IMXSOC_51);
 }

Modified: head/sys/arm/freescale/imx/imx53_machdep.c
==============================================================================
--- head/sys/arm/freescale/imx/imx53_machdep.c	Tue Dec 13 13:43:22 2016	(r310021)
+++ head/sys/arm/freescale/imx/imx53_machdep.c	Tue Dec 13 13:46:09 2016	(r310022)
@@ -45,6 +45,11 @@ __FBSDID("$FreeBSD$");
 
 #include "platform_if.h"
 
+static platform_attach_t imx53_attach;
+static platform_devmap_init_t imx53_devmap_init;
+static platform_lastaddr_t imx53_lastaddr;
+static platform_cpu_reset_t imx53_cpu_reset;
+
 static vm_offset_t
 imx53_lastaddr(platform_t plat)
 {
@@ -88,7 +93,8 @@ imx53_cpu_reset(platform_t plat)
 	imx_wdog_cpu_reset(0x53F98000);
 }
 
-u_int imx_soc_type()
+u_int
+imx_soc_type(void)
 {
 	return (IMXSOC_53);
 }

Modified: head/sys/arm/freescale/imx/imx6_machdep.c
==============================================================================
--- head/sys/arm/freescale/imx/imx6_machdep.c	Tue Dec 13 13:43:22 2016	(r310021)
+++ head/sys/arm/freescale/imx/imx6_machdep.c	Tue Dec 13 13:46:09 2016	(r310022)
@@ -54,6 +54,12 @@ __FBSDID("$FreeBSD$");
 
 static uint32_t gpio1_node;
 
+static platform_attach_t imx6_attach;
+static platform_devmap_init_t imx6_devmap_init;
+static platform_lastaddr_t imx6_lastaddr;
+static platform_late_init_t imx6_late_init;
+static platform_cpu_reset_t imx6_cpu_reset;
+
 #ifndef INTRNG
 /*
  * Work around the linux workaround for imx6 erratum 006687, in which some
@@ -259,7 +265,8 @@ imx6_cpu_reset(platform_t plat)
  *      hwsoc      = 0x00000063
  *      scu config = 0x00005503
  */
-u_int imx_soc_type()
+u_int
+imx_soc_type(void)
 {
 	uint32_t digprog, hwsoc;
 	uint32_t *pcr;

Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c
==============================================================================
--- head/sys/arm/nvidia/tegra124/tegra124_machdep.c	Tue Dec 13 13:43:22 2016	(r310021)
+++ head/sys/arm/nvidia/tegra124/tegra124_machdep.c	Tue Dec 13 13:46:09 2016	(r310022)
@@ -60,6 +60,12 @@ __FBSDID("$FreeBSD$");
 					PMC_SCRATCH0_MODE_BOOTLOADER | \
 					PMC_SCRATCH0_MODE_RCM)
 
+static platform_attach_t tegra124_attach;
+static platform_lastaddr_t tegra124_lastaddr;
+static platform_devmap_init_t tegra124_devmap_init;
+static platform_late_init_t tegra124_late_init;
+static platform_cpu_reset_t tegra124_cpu_reset;
+
 static vm_offset_t
 tegra124_lastaddr(platform_t plat)
 {

Modified: head/sys/arm/ti/ti_machdep.c
==============================================================================
--- head/sys/arm/ti/ti_machdep.c	Tue Dec 13 13:43:22 2016	(r310021)
+++ head/sys/arm/ti/ti_machdep.c	Tue Dec 13 13:46:09 2016	(r310022)
@@ -58,6 +58,17 @@ __FBSDID("$FreeBSD$");
 
 #include "platform_if.h"
 
+#if defined(SOC_OMAP4)
+static platform_attach_t omap4_attach;
+static platform_devmap_init_t ti_omap4_devmap_init;
+#endif
+#if defined(SOC_TI_AM335X)
+static platform_attach_t ti_am335x_attach;
+static platform_devmap_init_t ti_am335x_devmap_init;
+#endif
+static platform_lastaddr_t ti_lastaddr;
+static platform_cpu_reset_t ti_plat_cpu_reset;
+
 void (*ti_cpu_reset)(void) = NULL;
 
 int _ti_chip = -1;

From owner-svn-src-all@freebsd.org  Tue Dec 13 16:20:12 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13A0DC7614C;
 Tue, 13 Dec 2016 16:20:12 +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 E28E9A16;
 Tue, 13 Dec 2016 16:20:11 +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 uBDGKB9a007686;
 Tue, 13 Dec 2016 16:20:11 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDGKAR0007684;
 Tue, 13 Dec 2016 16:20:10 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201612131620.uBDGKAR0007684@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin <mav@FreeBSD.org>
Date: Tue, 13 Dec 2016 16:20:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310023 - in head/sys/cddl: compat/opensolaris/sys
 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 16:20:12 -0000

Author: mav
Date: Tue Dec 13 16:20:10 2016
New Revision: 310023
URL: https://svnweb.freebsd.org/changeset/base/310023

Log:
  Reduce diff from Illumos by better variables mapping.

Modified:
  head/sys/cddl/compat/opensolaris/sys/kmem.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c

Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/kmem.h	Tue Dec 13 13:46:09 2016	(r310022)
+++ head/sys/cddl/compat/opensolaris/sys/kmem.h	Tue Dec 13 16:20:10 2016	(r310023)
@@ -37,6 +37,7 @@
 #include <vm/uma.h>
 #include <vm/vm.h>
 #include <vm/vm_extern.h>
+#include <vm/vm_pageout.h>
 
 MALLOC_DECLARE(M_SOLARIS);
 
@@ -77,8 +78,10 @@ void kmem_reap(void);
 int kmem_debugging(void);
 void *calloc(size_t n, size_t s);
 
-#define	freemem				vm_cnt.v_free_count
-#define	minfree				vm_cnt.v_free_min
+#define	freemem				(long)vm_cnt.v_free_count
+#define	desfree				(long)vm_cnt.v_free_target
+#define	minfree				(long)vm_cnt.v_free_min
+#define	needfree			(long)vm_pageout_deficit
 #define	heap_arena			kmem_arena
 #define	kmem_alloc(size, kmflags)	zfs_kmem_alloc((size), (kmflags))
 #define	kmem_zalloc(size, kmflags)	zfs_kmem_alloc((size), (kmflags) | M_ZERO)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Dec 13 13:46:09 2016	(r310022)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Dec 13 16:20:10 2016	(r310023)
@@ -357,6 +357,7 @@ int zfs_arc_shrink_shift = 0;
 int zfs_arc_p_min_shift = 0;
 uint64_t zfs_arc_average_blocksize = 8 * 1024; /* 8KB */
 u_int zfs_arc_free_target = 0;
+#define	lotsfree	zfs_arc_free_target
 
 /* Absolute min for arc min / max is 16MB. */
 static uint64_t arc_abs_min = 16 << 20;
@@ -3827,8 +3828,6 @@ arc_shrink(int64_t to_free)
 	}
 }
 
-static long needfree = 0;
-
 typedef enum free_memory_reason_t {
 	FMR_UNKNOWN,
 	FMR_NEEDFREE,
@@ -3875,17 +3874,6 @@ arc_available_memory(void)
 	}
 
 	/*
-	 * Cooperate with pagedaemon when it's time for it to scan
-	 * and reclaim some pages.
-	 */
-	n = PAGESIZE * ((int64_t)freemem - zfs_arc_free_target);
-	if (n < lowest) {
-		lowest = n;
-		r = FMR_LOTSFREE;
-	}
-
-#ifdef illumos
-	/*
 	 * check that we're out of range of the pageout scanner.  It starts to
 	 * schedule paging if freemem is less than lotsfree and needfree.
 	 * lotsfree is the high-water mark for pageout, and needfree is the
@@ -3898,6 +3886,7 @@ arc_available_memory(void)
 		r = FMR_LOTSFREE;
 	}
 
+#ifdef illumos
 	/*
 	 * check to make sure that swapfs has enough space so that anon
 	 * reservations can still succeed. anon_resvmem() checks that the
@@ -4154,9 +4143,6 @@ arc_reclaim_thread(void *dummy __unused)
 		 * infinite loop.
 		 */
 		if (arc_size <= arc_c || evicted == 0) {
-#ifdef _KERNEL
-			needfree = 0;
-#endif
 			/*
 			 * We're either no longer overflowing, or we
 			 * can't evict anything more, so we should wake
@@ -5883,8 +5869,6 @@ arc_lowmem(void *arg __unused, int howto
 {
 
 	mutex_enter(&arc_reclaim_lock);
-	/* XXX: Memory deficit should be passed as argument. */
-	needfree = btoc(arc_c >> arc_shrink_shift);
 	DTRACE_PROBE(arc__needfree);
 	cv_signal(&arc_reclaim_thread_cv);
 

From owner-svn-src-all@freebsd.org  Tue Dec 13 16:53:59 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 516E9C75535;
 Tue, 13 Dec 2016 16:53:59 +0000 (UTC)
 (envelope-from lifanov@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 20EA9F46;
 Tue, 13 Dec 2016 16:53:59 +0000 (UTC)
 (envelope-from lifanov@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDGrwMw024183;
 Tue, 13 Dec 2016 16:53:58 GMT (envelope-from lifanov@FreeBSD.org)
Received: (from lifanov@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDGrwUJ024182;
 Tue, 13 Dec 2016 16:53:58 GMT (envelope-from lifanov@FreeBSD.org)
Message-Id: <201612131653.uBDGrwUJ024182@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: lifanov set sender to
 lifanov@FreeBSD.org using -f
From: Nikolai Lifanov <lifanov@FreeBSD.org>
Date: Tue, 13 Dec 2016 16:53:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310024 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 16:53:59 -0000

Author: lifanov (ports committer)
Date: Tue Dec 13 16:53:58 2016
New Revision: 310024
URL: https://svnweb.freebsd.org/changeset/base/310024

Log:
  add myself as a ports committer and update mentor/mentee relationship
  
  Reviewed by:	matthew
  Approved by:	matthew (mentor)
  Differential Revision:	https://reviews.freebsd.org/D8774

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==============================================================================
--- head/share/misc/committers-ports.dot	Tue Dec 13 16:20:10 2016	(r310023)
+++ head/share/misc/committers-ports.dot	Tue Dec 13 16:53:58 2016	(r310024)
@@ -145,6 +145,7 @@ lawrance [label="Sam Lawrance\nlawrance@
 lbr [label="Lars Balker Rasmussen\nlbr@FreeBSD.org\n2006/04/30"]
 leeym [label="Yen-Ming Lee\nleeym@FreeBSD.org\n2002/08/14"]
 lev [label="Lev Serebryakov\nlev@FreeBSD.org\n2003/06/17"]
+lifanov [label="Nikolai Lifanov\nlifanov@FreeBSD.org\n2016/12/11"]
 linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2003/10/23"]
 lioux [label="Mario Sergio Fujikawa Ferriera\nlioux@FreeBSD.org\n2000/10/14"]
 lippe [label="Felippe de Meirelles Motta\nlippe@FreeBSD.org\n2008/03/08"]
@@ -475,6 +476,8 @@ mat -> tcberner
 mat -> thierry
 mat -> woodsb02
 
+matthew -> lifanov
+
 mezz -> tmclaugh
 
 miwi -> amdmi3

From owner-svn-src-all@freebsd.org  Tue Dec 13 18:05:15 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47D8FC765C0;
 Tue, 13 Dec 2016 18:05:15 +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 174A3F7A;
 Tue, 13 Dec 2016 18:05: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 uBDI5EPS054867;
 Tue, 13 Dec 2016 18:05:14 GMT (envelope-from bdrewery@FreeBSD.org)
Received: (from bdrewery@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDI5EDm054866;
 Tue, 13 Dec 2016 18:05:14 GMT (envelope-from bdrewery@FreeBSD.org)
Message-Id: <201612131805.uBDI5EDm054866@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to
 bdrewery@FreeBSD.org using -f
From: Bryan Drewery <bdrewery@FreeBSD.org>
Date: Tue, 13 Dec 2016 18:05:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310025 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 18:05:15 -0000

Author: bdrewery
Date: Tue Dec 13 18:05:14 2016
New Revision: 310025
URL: https://svnweb.freebsd.org/changeset/base/310025

Log:
  Take write lock for rtld_bind before modifying obj_list in dl_iterate_phdr().
  
  This avoids a race with readers such as dladdr(3)/dlinfo(3)/dlsym(3) and
  the atexit(3) handler.  This race was introduced in r294373.
  
  Reviewed by:	markj, kib, kan
  MFC after:	2 weeks
  Sponsored by:	Dell EMC Isilon

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Tue Dec 13 16:53:58 2016	(r310024)
+++ head/libexec/rtld-elf/rtld.c	Tue Dec 13 18:05:14 2016	(r310025)
@@ -3549,7 +3549,7 @@ dl_iterate_phdr(__dl_iterate_hdr_callbac
 	error = 0;
 
 	wlock_acquire(rtld_phdr_lock, &phdr_lockstate);
-	rlock_acquire(rtld_bind_lock, &bind_lockstate);
+	wlock_acquire(rtld_bind_lock, &bind_lockstate);
 	for (obj = globallist_curr(TAILQ_FIRST(&obj_list)); obj != NULL;) {
 		TAILQ_INSERT_AFTER(&obj_list, obj, &marker, next);
 		rtld_fill_dl_phdr_info(obj, &phdr_info);
@@ -3557,7 +3557,7 @@ dl_iterate_phdr(__dl_iterate_hdr_callbac
 
 		error = callback(&phdr_info, sizeof phdr_info, param);
 
-		rlock_acquire(rtld_bind_lock, &bind_lockstate);
+		wlock_acquire(rtld_bind_lock, &bind_lockstate);
 		obj = globallist_next(&marker);
 		TAILQ_REMOVE(&obj_list, &marker, next);
 		if (error != 0) {

From owner-svn-src-all@freebsd.org  Tue Dec 13 18:15:13 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CBC2C769EB;
 Tue, 13 Dec 2016 18:15:13 +0000 (UTC)
 (envelope-from brueffer@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DDD4B179A;
 Tue, 13 Dec 2016 18:15:12 +0000 (UTC)
 (envelope-from brueffer@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDIFCXU058912;
 Tue, 13 Dec 2016 18:15:12 GMT (envelope-from brueffer@FreeBSD.org)
Received: (from brueffer@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDIFCcs058911;
 Tue, 13 Dec 2016 18:15:12 GMT (envelope-from brueffer@FreeBSD.org)
Message-Id: <201612131815.uBDIFCcs058911@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brueffer set sender to
 brueffer@FreeBSD.org using -f
From: Christian Brueffer <brueffer@FreeBSD.org>
Date: Tue, 13 Dec 2016 18:15:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310026 - head/sbin/decryptcore
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 18:15:13 -0000

Author: brueffer
Date: Tue Dec 13 18:15:11 2016
New Revision: 310026
URL: https://svnweb.freebsd.org/changeset/base/310026

Log:
  Language and mdoc cleanup.

Modified:
  head/sbin/decryptcore/decryptcore.8

Modified: head/sbin/decryptcore/decryptcore.8
==============================================================================
--- head/sbin/decryptcore/decryptcore.8	Tue Dec 13 18:05:14 2016	(r310025)
+++ head/sbin/decryptcore/decryptcore.8	Tue Dec 13 18:15:11 2016	(r310026)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 10, 2016
+.Dd December 13, 2016
 .Dt DECRYPTCORE 8
 .Os
 .Sh NAME
@@ -45,7 +45,7 @@
 .Sh DESCRIPTION
 The
 .Nm
-first decrypts
+utility first decrypts
 .Ar keyfile
 using
 .Ar privatekeyfile
@@ -53,7 +53,7 @@ and then uses the resulting key to decry
 .Ar encryptedcore
 saved by
 .Xr savecore 8 .
-Result is saved in
+The result is saved in
 .Ar core .
 .Pp
 Alternatively a user can decrypt a core dump numbered
@@ -91,24 +91,22 @@ Specify location of an encrypted core.
 .It Fl c Ar core
 Specify location of a resulting decrypted core dump.
 .It Fl d Ar crashdir
-Specify an alternative crash dump directory. The default crash dump directory is
+Specify an alternative crash dump directory.
+The default crash dump directory is
 .Pa /var/crash .
 .It Fl n Ar dumpnr
 Specify a number of a crash dump to be decrypted.
 .El
 .Sh EXIT STATUS
-The
-.Nm
-utility exits 0 on success, and >0 if an error occurs.
+.Ex -std
 .Sh SEE ALSO
+.Xr kgdb 1 ,
 .Xr capsicum 4 ,
 .Xr dumpon 8 ,
-.Xr kgdb 1 ,
 .Xr savecore 8 ,
 .Xr syslogd 8
 .Sh AUTHORS
 The
 .Nm
-was implemented by
-.An -nosplit
+utility was implemented by
 .An Konrad Witaszczyk Aq Mt def@FreeBSD.org .

From owner-svn-src-all@freebsd.org  Tue Dec 13 18:33:36 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E275C76F54;
 Tue, 13 Dec 2016 18:33:36 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com
 [209.85.220.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 F3D3E385;
 Tue, 13 Dec 2016 18:33:35 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: by mail-qk0-f193.google.com with SMTP id h201so15710512qke.3;
 Tue, 13 Dec 2016 10:33:35 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:reply-to:in-reply-to:references
 :from:date:message-id:subject:to:cc;
 bh=jIim6cjcP3ComBgueM6AtmMKydV6D5a3HnHWeUMmaZg=;
 b=UtNXKBG8qwryRjknzWmpynSptvntgPEEfLn1twM1JM3UWJxFgHI4FCM6siYNxVIMOh
 T4sdW/TxB+FO99/pj4j/C6rIqyS33CeWR+ua98jOI/oPzcPSmTigB2kD7268jPvDQ60I
 gKCfFZy/CJMJnu+NxPGv56LJcYy/8yT8DBvi3p2QR4YEGaSw92nzCdYRGsxeursMSyW+
 FrgOxE/5dhh+h/r2H6cK4+mIsfWEFZK5WiSPg7RJBrixFtb/WMUQo2ZWT8gajY+jw2gY
 t6SNiOhvxdok7z/AIf5J93vu+uLe7Pm+xpVHfNY0sY/VashX8fvpC3t1dZQcyPCimV/k
 7wMQ==
X-Gm-Message-State: AKaTC00W+zHwPVQC+suFsu4wabHWPWvUlp9cH/HG5KPTRUs59U1HhBV5X4uRafEU8xfYRw==
X-Received: by 10.55.64.69 with SMTP id n66mr81498248qka.20.1481652894050;
 Tue, 13 Dec 2016 10:14:54 -0800 (PST)
Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com.
 [209.85.220.171])
 by smtp.gmail.com with ESMTPSA id w34sm29688007qtw.10.2016.12.13.10.14.53
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 13 Dec 2016 10:14:53 -0800 (PST)
Received: by mail-qk0-f171.google.com with SMTP id x190so125112366qkb.0;
 Tue, 13 Dec 2016 10:14:53 -0800 (PST)
X-Received: by 10.55.139.134 with SMTP id n128mr84349228qkd.43.1481652893617; 
 Tue, 13 Dec 2016 10:14:53 -0800 (PST)
MIME-Version: 1.0
Reply-To: cem@freebsd.org
Received: by 10.200.58.165 with HTTP; Tue, 13 Dec 2016 10:14:53 -0800 (PST)
In-Reply-To: <201612121933.uBCJXen2093959@repo.freebsd.org>
References: <201612121933.uBCJXen2093959@repo.freebsd.org>
From: Conrad Meyer <cem@freebsd.org>
Date: Tue, 13 Dec 2016 10:14:53 -0800
X-Gmail-Original-Message-ID: <CAG6CVpV=nshki9k8DM-4Cni1gTJ8U-Eh1t8D9KfUqo0MKnC=wA@mail.gmail.com>
Message-ID: <CAG6CVpV=nshki9k8DM-4Cni1gTJ8U-Eh1t8D9KfUqo0MKnC=wA@mail.gmail.com>
Subject: Re: svn commit: r309933 - head/usr.sbin/syslogd
To: Hiroki Sato <hrs@freebsd.org>
Cc: src-committers <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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 18:33:36 -0000

On Mon, Dec 12, 2016 at 11:33 AM, Hiroki Sato <hrs@freebsd.org> wrote:
> Author: hrs
> Date: Mon Dec 12 19:33:40 2016
> New Revision: 309933
> URL: https://svnweb.freebsd.org/changeset/base/309933
>
> Log:
>   - Refactor listening socket list.  All of the listening sockets are
>     now maintained in a single linked-list in a transport-independent manner.
>   - Use queue.h for linked-list structure.
>   - Use linked-list for AllowedPeers.
>   - Use getaddrinfo(8) even for Unix Domain sockets.
>   - Use macros to type-casting from/to struct sockaddr{,_in,_in6}.
>   - Define fu_* macro for union f_un to shorten the member names.
>   - Remove an extra #include <sys/type.h>.
>   - Add "static" to non-exported symbols.
>   - !INET support is still incomplete but will be fixed later.
>
>   There is no functional change except for some minor debug messages.

Hello Hiroki,

This refactor introduced a bug in the IPv6 address comparison/rejection logic.

> Modified: head/usr.sbin/syslogd/syslogd.c
> ==============================================================================
> --- head/usr.sbin/syslogd/syslogd.c     Mon Dec 12 19:26:55 2016        (r309932)
> +++ head/usr.sbin/syslogd/syslogd.c     Mon Dec 12 19:33:40 2016        (r309933)
> ...
>      reject = 0;
> - for (j = 0; j < 16; j += 4) {
> - if ((*(u_int32_t *)&sin6->sin6_addr.s6_addr[j] & *(u_int32_t *)&m6p->sin6_addr.s6_addr[j])
> -    != *(u_int32_t *)&a6p->sin6_addr.s6_addr[j]) {
> - ++reject;
> - break;
> - }
> + if (IN6_ARE_MASKED_ADDR_EQUAL(&sin6->sin6_addr,
> +    &a6p->sin6_addr, &m6p->sin6_addr) != 0) {
> + ++reject;
> + break;
>      }
>      if (reject) {
>       dprintf("rejected in rule %d due to IP mismatch.\n", i);

The new check isn't a loop, so the 'break' breaks out of the outer
loop, which is unintentional.  I think we should just remove 'break'.

This was found by Coverity CID 1366941.

Best,
Conrad

From owner-svn-src-all@freebsd.org  Tue Dec 13 19:04:06 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE2EBC7684F;
 Tue, 13 Dec 2016 19:04:06 +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 8D8F11C5B;
 Tue, 13 Dec 2016 19:04:06 +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 uBDJ45nm079038;
 Tue, 13 Dec 2016 19:04:05 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDJ45aE079037;
 Tue, 13 Dec 2016 19:04:05 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612131904.uBDJ45aE079037@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Tue, 13 Dec 2016 19:04:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310027 - head/sys/dev/drm2/i915
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 19:04:06 -0000

Author: kib
Date: Tue Dec 13 19:04:05 2016
New Revision: 310027
URL: https://svnweb.freebsd.org/changeset/base/310027

Log:
  Fix bug in r309712, do not leak gem object pin count in case of error
  or retry.
  
  Reported and tested by:	Michael Butler <imb@protected-networks.net>
  Sponsored by:	The FreeBSD Foundation
  MFC after:	16 days

Modified:
  head/sys/dev/drm2/i915/i915_gem.c

Modified: head/sys/dev/drm2/i915/i915_gem.c
==============================================================================
--- head/sys/dev/drm2/i915/i915_gem.c	Tue Dec 13 18:15:11 2016	(r310026)
+++ head/sys/dev/drm2/i915/i915_gem.c	Tue Dec 13 19:04:05 2016	(r310027)
@@ -1521,7 +1521,7 @@ retry:
 	/* Now bind it into the GTT if needed */
 	ret = i915_gem_object_pin(obj, 0, true, false);
 	if (ret)
-		goto unpin;
+		goto unlock;
 	pinned = 1;
 
 	ret = i915_gem_object_set_to_gtt_domain(obj, write);
@@ -1580,6 +1580,8 @@ have_page:
 	return (VM_PAGER_OK);
 
 unpin:
+	i915_gem_object_unpin(obj);
+unlock:
 	DRM_UNLOCK(dev);
 out:
 	KASSERT(ret != 0, ("i915_gem_pager_fault: wrong return"));

From owner-svn-src-all@freebsd.org  Tue Dec 13 19:22:44 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B31FC76CE6;
 Tue, 13 Dec 2016 19:22:44 +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 3AB30AE5;
 Tue, 13 Dec 2016 19:22:44 +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 uBDJMhNL087288;
 Tue, 13 Dec 2016 19:22:43 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDJMh2X087287;
 Tue, 13 Dec 2016 19:22:43 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201612131922.uBDJMh2X087287@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin <jhb@FreeBSD.org>
Date: Tue, 13 Dec 2016 19:22:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310028 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 19:22:44 -0000

Author: jhb
Date: Tue Dec 13 19:22:43 2016
New Revision: 310028
URL: https://svnweb.freebsd.org/changeset/base/310028

Log:
  Use db_lookup_proc() in the DDB 'show procvm' command.
  
  This allows processes to be identified by PID as well as a pointer address.
  
  MFC after:	2 weeks
  Sponsored by:	DARPA / AFRL

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Tue Dec 13 19:04:05 2016	(r310027)
+++ head/sys/vm/vm_map.c	Tue Dec 13 19:22:43 2016	(r310028)
@@ -4309,7 +4309,7 @@ DB_SHOW_COMMAND(procvm, procvm)
 	struct proc *p;
 
 	if (have_addr) {
-		p = (struct proc *) addr;
+		p = db_lookup_proc(addr);
 	} else {
 		p = curproc;
 	}

From owner-svn-src-all@freebsd.org  Tue Dec 13 19:27:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1775AC76D4B;
 Tue, 13 Dec 2016 19:27:33 +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 CE34CCE9;
 Tue, 13 Dec 2016 19:27:32 +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 uBDJRWru087487;
 Tue, 13 Dec 2016 19:27:32 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDJRWBO087486;
 Tue, 13 Dec 2016 19:27:32 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201612131927.uBDJRWBO087486@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin <jhb@FreeBSD.org>
Date: Tue, 13 Dec 2016 19:27:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310029 - head/sys/mips/mips
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 19:27:33 -0000

Author: jhb
Date: Tue Dec 13 19:27:31 2016
New Revision: 310029
URL: https://svnweb.freebsd.org/changeset/base/310029

Log:
  Fix remove_userlocal_code() for n32.
  
  n32 kernels use a 64-bit store to the TLS register rather than a 32-bit
  store.
  
  Sponsored by:	DARPA / AFRL

Modified:
  head/sys/mips/mips/cpu.c

Modified: head/sys/mips/mips/cpu.c
==============================================================================
--- head/sys/mips/mips/cpu.c	Tue Dec 13 19:22:43 2016	(r310028)
+++ head/sys/mips/mips/cpu.c	Tue Dec 13 19:27:31 2016	(r310029)
@@ -78,9 +78,6 @@ struct mips_cpuinfo cpuinfo;
 #   define	_ADDU_V0_T0_T1 \
     _ENCODE_INSN(0, T0, T1, V0, OP_DADDU)
 
-#   define _MTC0_V0_USERLOCAL \
-    _ENCODE_INSN(OP_COP0, OP_DMT, V0, 4, 2)
-
 #else /* mips 32 */
 
 #   define	_LOAD_T0_MDTLS_A1 \
@@ -93,10 +90,19 @@ struct mips_cpuinfo cpuinfo;
 #   define	_ADDU_V0_T0_T1 \
     _ENCODE_INSN(0, T0, T1, V0, OP_ADDU)
 
+#endif /* ! __mips_n64 */
+
+#if defined(__mips_n64) || defined(__mips_n32)
+
+#   define _MTC0_V0_USERLOCAL \
+    _ENCODE_INSN(OP_COP0, OP_DMT, V0, 4, 2)
+
+#else /* mips o32 */
+
 #   define _MTC0_V0_USERLOCAL \
     _ENCODE_INSN(OP_COP0, OP_MT, V0, 4, 2)
 
-#endif /* ! __mips_n64 */
+#endif /* ! (__mips_n64 || __mipsn32) */
 
 #define	_JR_RA	_ENCODE_INSN(OP_SPECIAL, RA, 0, 0, OP_JR)
 #define	_NOP	0

From owner-svn-src-all@freebsd.org  Tue Dec 13 19:36:07 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25765C76F22;
 Tue, 13 Dec 2016 19:36:07 +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 E987E120E;
 Tue, 13 Dec 2016 19:36: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 uBDJa6oR091338;
 Tue, 13 Dec 2016 19:36:06 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDJa6QQ091337;
 Tue, 13 Dec 2016 19:36:06 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201612131936.uBDJa6QQ091337@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin <jhb@FreeBSD.org>
Date: Tue, 13 Dec 2016 19:36:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310030 - head/sys/mips/mips
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 19:36:07 -0000

Author: jhb
Date: Tue Dec 13 19:36:05 2016
New Revision: 310030
URL: https://svnweb.freebsd.org/changeset/base/310030

Log:
  Use register_t instead of uintptr_t for register values in backtraces.
  
  This fixes backtraces from DDB in n32 kernels as uintptr_t is only a
  uint32_t.  In particular, the upper 32-bits of each register value were
  treated as the register's value breaking both the output of register
  values, but also the values of 'ra' and 'sp' required to walk up to the
  previous frame.
  
  Sponsored by:	DARPA / AFRL

Modified:
  head/sys/mips/mips/db_trace.c

Modified: head/sys/mips/mips/db_trace.c
==============================================================================
--- head/sys/mips/mips/db_trace.c	Tue Dec 13 19:27:31 2016	(r310029)
+++ head/sys/mips/mips/db_trace.c	Tue Dec 13 19:36:05 2016	(r310030)
@@ -139,8 +139,8 @@ stacktrace_subr(register_t pc, register_
 	 * of these registers is valid, e.g. obtained from the stack
 	 */
 	int valid_args[4];
-	uintptr_t args[4];
-	uintptr_t va, subr;
+	register_t args[4];
+	register_t va, subr;
 	unsigned instr, mask;
 	unsigned int frames = 0;
 	int more, stksize, j;
@@ -379,7 +379,7 @@ done:
 		if (j > 0)
 			(*printfn)(",");
 		if (valid_args[j])
-			(*printfn)("%x", args[j]);
+			(*printfn)("%jx", (uintmax_t)(u_register_t)args[j]);
 		else
 			(*printfn)("?");
 	}

From owner-svn-src-all@freebsd.org  Tue Dec 13 19:58:22 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F790C7672D;
 Tue, 13 Dec 2016 19:58:22 +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 6EE9B1D3;
 Tue, 13 Dec 2016 19:58:22 +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 uBDJwLrN099692;
 Tue, 13 Dec 2016 19:58:21 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDJwLST099691;
 Tue, 13 Dec 2016 19:58:21 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612131958.uBDJwLST099691@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Tue, 13 Dec 2016 19:58:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310031 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 19:58:22 -0000

Author: cem
Date: Tue Dec 13 19:58:21 2016
New Revision: 310031
URL: https://svnweb.freebsd.org/changeset/base/310031

Log:
  linuxkpi: Fix not-found case of linux_pci_find_irq_dev
  
  Linux list_for_each_entry() does not neccessarily end with the iterator
  NULL (it may be an offset from NULL if the list member is not the first
  element of the member struct).
  
  Reported by:	Coverity
  CID:		1366940
  Reviewed by:	hselasky@
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D8780

Modified:
  head/sys/compat/linuxkpi/common/include/linux/pci.h

Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/pci.h	Tue Dec 13 19:36:05 2016	(r310030)
+++ head/sys/compat/linuxkpi/common/include/linux/pci.h	Tue Dec 13 19:58:21 2016	(r310031)
@@ -220,18 +220,19 @@ static inline struct device *
 linux_pci_find_irq_dev(unsigned int irq)
 {
 	struct pci_dev *pdev;
+	struct device *found;
 
+	found = NULL;
 	spin_lock(&pci_lock);
 	list_for_each_entry(pdev, &pci_devices, links) {
-		if (irq == pdev->dev.irq)
-			break;
-		if (irq >= pdev->dev.msix && irq < pdev->dev.msix_max)
+		if (irq == pdev->dev.irq ||
+		    (irq >= pdev->dev.msix && irq < pdev->dev.msix_max)) {
+			found = &pdev->dev;
 			break;
+		}
 	}
 	spin_unlock(&pci_lock);
-	if (pdev)
-		return &pdev->dev;
-	return (NULL);
+	return (found);
 }
 
 static inline unsigned long

From owner-svn-src-all@freebsd.org  Tue Dec 13 20:11:46 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABDD7C76CAB;
 Tue, 13 Dec 2016 20:11:46 +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 7B7D4DF1;
 Tue, 13 Dec 2016 20:11:46 +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 uBDKBjag005898;
 Tue, 13 Dec 2016 20:11:45 GMT (envelope-from glebius@FreeBSD.org)
Received: (from glebius@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDKBjIt005897;
 Tue, 13 Dec 2016 20:11:45 GMT (envelope-from glebius@FreeBSD.org)
Message-Id: <201612132011.uBDKBjIt005897@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: glebius set sender to
 glebius@FreeBSD.org using -f
From: Gleb Smirnoff <glebius@FreeBSD.org>
Date: Tue, 13 Dec 2016 20:11:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310032 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 20:11:46 -0000

Author: glebius
Date: Tue Dec 13 20:11:45 2016
New Revision: 310032
URL: https://svnweb.freebsd.org/changeset/base/310032

Log:
  Zero return value when counter_rate() switches over to next second and
  value is positive, but below the limit.

Modified:
  head/sys/kern/subr_counter.c

Modified: head/sys/kern/subr_counter.c
==============================================================================
--- head/sys/kern/subr_counter.c	Tue Dec 13 19:58:21 2016	(r310031)
+++ head/sys/kern/subr_counter.c	Tue Dec 13 20:11:45 2016	(r310032)
@@ -154,6 +154,8 @@ counter_ratecheck(struct counter_rate *c
 				counter_u64_zero(cr->cr_rate);
 				cr->cr_over = 0;
 				cr->cr_ticks = now;
+				if (val <= limit)
+					val = 0;
 			}
 			atomic_store_rel_int(&cr->cr_lock, 0);
 		} else

From owner-svn-src-all@freebsd.org  Tue Dec 13 20:28:38 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A30D2C753FF;
 Tue, 13 Dec 2016 20:28:38 +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 329DE19D9;
 Tue, 13 Dec 2016 20:28:38 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from [IPv6:2001:7b8:3a7::3903:881:6104:a716] (unknown
 [IPv6:2001:7b8:3a7:0:3903:881:6104:a716])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by tensor.andric.com (Postfix) with ESMTPSA id E0D1712B48;
 Tue, 13 Dec 2016 21:28:34 +0100 (CET)
Content-Type: multipart/signed;
 boundary="Apple-Mail=_CE0A3362-B11A-4518-AE43-BF90CD47FFBB";
 protocol="application/pgp-signature"; micalg=pgp-sha1
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: Re: svn commit: r310013 - head/sys/dev/xen/blkfront
From: Dimitry Andric <dim@FreeBSD.org>
In-Reply-To: <201612130654.uBD6sDtF073358@repo.freebsd.org>
Date: Tue, 13 Dec 2016 21:28:21 +0100
Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org,
 =?utf-8?Q?Roger_Pau_Monn=C3=A9?= <royger@freebsd.org>
Message-Id: <A5CE6877-FDB2-4B07-A611-29FAD91FC9F2@FreeBSD.org>
References: <201612130654.uBD6sDtF073358@repo.freebsd.org>
To: Colin Percival <cperciva@FreeBSD.org>
X-Mailer: Apple Mail (2.3124)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 20:28:38 -0000


--Apple-Mail=_CE0A3362-B11A-4518-AE43-BF90CD47FFBB
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii

On 13 Dec 2016, at 07:54, Colin Percival <cperciva@FreeBSD.org> wrote:
> 
> Author: cperciva
> Date: Tue Dec 13 06:54:13 2016
> New Revision: 310013
> URL: https://svnweb.freebsd.org/changeset/base/310013
> 
> Log:
>  Check that blkfront devices have a non-zero number of sectors and a
>  non-zero sector size.  Such a device would be a virtual disk of zero
>  bytes; clearly not useful, and not something we should try to attach.
> 
>  As a fortuitous side effect, checking that these values are non-zero
>  here results in them not *becoming* zero later on the function.  This
>  odd behaviour began with r309124 (clang 3.9.0) but is challenging to
>  debug; making any changes to this function whatsoever seems to affect
>  the llvm optimizer behaviour enough to make the unexpected zeroing of
>  the sector_size variable cease.

I've been having some fun debugging a kernel under Xen, and what I found
is that sector_size changes from 512 to 0 because of an xs_gather() call
in xbd_connect().  The function starts as follows:

  1222  static void
  1223  xbd_connect(struct xbd_softc *sc)
  1224  {
  1225          device_t dev = sc->xbd_dev;
  1226          unsigned long sectors, sector_size, phys_sector_size;
  1227          unsigned int binfo;
  1228          int err, feature_barrier, feature_flush;
...
  1237          err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
  1238              "sectors", "%lu", &sectors,
  1239              "info", "%u", &binfo,
  1240              "sector-size", "%lu", &sector_size,
  1241              NULL);

After this first call to xs_gather(), sectors is 44040322 (in my case of
a ~21G disk), binfo is zero, and sector_size is 512.  During execution
of the following few lines, sector_size stays 512, until just after the
fourth call to xs_gather():

  1259          err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
  1260               "feature-flush-cache", "%lu", &feature_flush,
  1261               NULL);

and then it becomes zero!  This is because the %lu format scans a 64 bit
unsigned integer, while the feature_flush variable is a 32 bit signed
integer, thus overwriting an adjacent location on the stack, which
happens to contain sector_size: in the assembly output, sector_size is
at -88(%rbp), while feature_flush is at -92(%rbp).

There is another instance of such an incorrect format, a few lines
before this, but it doesn't seem to scribble over important data (or we
didn't panic because of it, yet):

  1253          err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
  1254               "feature-barrier", "%lu", &feature_barrier,
  1255               NULL);

Here, feature_barrier is a 32 bit signed integer, while %lu again scans
a 64 bit unsigned integer.

In short, I think the following change would also fix the problem:

Index: sys/dev/xen/blkfront/blkfront.c
===================================================================
--- sys/dev/xen/blkfront/blkfront.c     (revision 309817)
+++ sys/dev/xen/blkfront/blkfront.c     (working copy)
@@ -1251,13 +1251,13 @@ xbd_connect(struct xbd_softc *sc)
        if (err || phys_sector_size <= sector_size)
                phys_sector_size = 0;
        err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
-            "feature-barrier", "%lu", &feature_barrier,
+            "feature-barrier", "%d", &feature_barrier,
             NULL);
        if (err == 0 && feature_barrier != 0)
                sc->xbd_flags |= XBDF_BARRIER;

        err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
-            "feature-flush-cache", "%lu", &feature_flush,
+            "feature-flush-cache", "%d", &feature_flush,
             NULL);
        if (err == 0 && feature_flush != 0)
                sc->xbd_flags |= XBDF_FLUSH;

However, I have some difficulty getting a custom-built kernel booting on
my very rudimentary Xen setup.  I am using a snapshot raw image, with no
idea how to insert a kernel into it.

E.g, can you please try this out, instead of the zero-check fix?  I am
very curious whether that fixes the panics. :)

-Dimitry

P.S.: We really need AddressSanitizer support in the kernel...


--Apple-Mail=_CE0A3362-B11A-4518-AE43-BF90CD47FFBB
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

iEYEARECAAYFAlhQWfIACgkQsF6jCi4glqNjoACg8Bm/ggGf+Pbrm9wIuajXxm6Y
2qoAoOl3Kob3ZGUUyfZaLS6y/lZgx27I
=RooA
-----END PGP SIGNATURE-----

--Apple-Mail=_CE0A3362-B11A-4518-AE43-BF90CD47FFBB--

From owner-svn-src-all@freebsd.org  Tue Dec 13 20:35:59 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E1E5C757A1;
 Tue, 13 Dec 2016 20:35:59 +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 B8A541FE;
 Tue, 13 Dec 2016 20:35:58 +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 uBDKZv20015821;
 Tue, 13 Dec 2016 20:35:57 GMT (envelope-from np@FreeBSD.org)
Received: (from np@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDKZv9Z015820;
 Tue, 13 Dec 2016 20:35:57 GMT (envelope-from np@FreeBSD.org)
Message-Id: <201612132035.uBDKZv9Z015820@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org
 using -f
From: Navdeep Parhar <np@FreeBSD.org>
Date: Tue, 13 Dec 2016 20:35:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310033 - head/sys/dev/cxgbe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 20:35:59 -0000

Author: np
Date: Tue Dec 13 20:35:57 2016
New Revision: 310033
URL: https://svnweb.freebsd.org/changeset/base/310033

Log:
  cxgbe(4): Retire t4_bus_space_read_8 and t4_bus_space_write_8.
  
  MFC after:	3 days
  Sponsored by:	Chelsio Communications

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

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Tue Dec 13 20:11:45 2016	(r310032)
+++ head/sys/dev/cxgbe/adapter.h	Tue Dec 13 20:35:57 2016	(r310033)
@@ -84,45 +84,6 @@ prefetch(void *x)
 #define SBUF_DRAIN 1
 #endif
 
-#ifdef __amd64__
-/* XXX: need systemwide bus_space_read_8/bus_space_write_8 */
-static __inline uint64_t
-t4_bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle,
-    bus_size_t offset)
-{
-	KASSERT(tag == X86_BUS_SPACE_MEM,
-	    ("%s: can only handle mem space", __func__));
-
-	return (*(volatile uint64_t *)(handle + offset));
-}
-
-static __inline void
-t4_bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh,
-    bus_size_t offset, uint64_t value)
-{
-	KASSERT(tag == X86_BUS_SPACE_MEM,
-	    ("%s: can only handle mem space", __func__));
-
-	*(volatile uint64_t *)(bsh + offset) = value;
-}
-#else
-static __inline uint64_t
-t4_bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle,
-    bus_size_t offset)
-{
-	return (uint64_t)bus_space_read_4(tag, handle, offset) +
-	    ((uint64_t)bus_space_read_4(tag, handle, offset + 4) << 32);
-}
-
-static __inline void
-t4_bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh,
-    bus_size_t offset, uint64_t value)
-{
-	bus_space_write_4(tag, bsh, offset, value);
-	bus_space_write_4(tag, bsh, offset + 4, value >> 32);
-}
-#endif
-
 struct adapter;
 typedef struct adapter adapter_t;
 
@@ -977,14 +938,25 @@ static inline uint64_t
 t4_read_reg64(struct adapter *sc, uint32_t reg)
 {
 
-	return t4_bus_space_read_8(sc->bt, sc->bh, reg);
+#ifdef __LP64__
+	return bus_space_read_8(sc->bt, sc->bh, reg);
+#else
+	return (uint64_t)bus_space_read_4(sc->bt, sc->bh, reg) +
+	    ((uint64_t)bus_space_read_4(sc->bt, sc->bh, reg + 4) << 32);
+
+#endif
 }
 
 static inline void
 t4_write_reg64(struct adapter *sc, uint32_t reg, uint64_t val)
 {
 
-	t4_bus_space_write_8(sc->bt, sc->bh, reg, val);
+#ifdef __LP64__
+	bus_space_write_8(sc->bt, sc->bh, reg, val);
+#else
+	bus_space_write_4(sc->bt, sc->bh, reg, val);
+	bus_space_write_4(sc->bt, sc->bh, reg + 4, val>> 32);
+#endif
 }
 
 static inline void

From owner-svn-src-all@freebsd.org  Tue Dec 13 20:53:04 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D200C761E7;
 Tue, 13 Dec 2016 20:53:04 +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 6095911E6;
 Tue, 13 Dec 2016 20:53:03 +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 WAA17877;
 Tue, 13 Dec 2016 22:52:56 +0200 (EET) (envelope-from avg@FreeBSD.org)
Received: from localhost ([127.0.0.1])
 by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
 id 1cGu4F-00019h-IQ; Tue, 13 Dec 2016 22:52:55 +0200
Subject: Re: svn commit: r310025 - head/libexec/rtld-elf
To: Bryan Drewery <bdrewery@FreeBSD.org>, src-committers@FreeBSD.org,
 svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org
References: <201612131805.uBDI5EDm054866@repo.freebsd.org>
From: Andriy Gapon <avg@FreeBSD.org>
Message-ID: <099725fe-af29-3f9d-852d-53357bb8e8fe@FreeBSD.org>
Date: Tue, 13 Dec 2016 22:51:56 +0200
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101
 Thunderbird/45.5.1
MIME-Version: 1.0
In-Reply-To: <201612131805.uBDI5EDm054866@repo.freebsd.org>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 20:53:04 -0000

On 13/12/2016 20:05, Bryan Drewery wrote:
> Author: bdrewery
> Date: Tue Dec 13 18:05:14 2016
> New Revision: 310025
> URL: https://svnweb.freebsd.org/changeset/base/310025
> 
> Log:
>   Take write lock for rtld_bind before modifying obj_list in dl_iterate_phdr().

What are typical callers of dl_iterate_phdr() ?
In what scenarios this bug would typically be hit?
Thank you!

>   This avoids a race with readers such as dladdr(3)/dlinfo(3)/dlsym(3) and
>   the atexit(3) handler.  This race was introduced in r294373.
>   
>   Reviewed by:	markj, kib, kan
>   MFC after:	2 weeks
>   Sponsored by:	Dell EMC Isilon
> 
> Modified:
>   head/libexec/rtld-elf/rtld.c
> 
> Modified: head/libexec/rtld-elf/rtld.c
> ==============================================================================
> --- head/libexec/rtld-elf/rtld.c	Tue Dec 13 16:53:58 2016	(r310024)
> +++ head/libexec/rtld-elf/rtld.c	Tue Dec 13 18:05:14 2016	(r310025)
> @@ -3549,7 +3549,7 @@ dl_iterate_phdr(__dl_iterate_hdr_callbac
>  	error = 0;
>  
>  	wlock_acquire(rtld_phdr_lock, &phdr_lockstate);
> -	rlock_acquire(rtld_bind_lock, &bind_lockstate);
> +	wlock_acquire(rtld_bind_lock, &bind_lockstate);
>  	for (obj = globallist_curr(TAILQ_FIRST(&obj_list)); obj != NULL;) {
>  		TAILQ_INSERT_AFTER(&obj_list, obj, &marker, next);
>  		rtld_fill_dl_phdr_info(obj, &phdr_info);
> @@ -3557,7 +3557,7 @@ dl_iterate_phdr(__dl_iterate_hdr_callbac
>  
>  		error = callback(&phdr_info, sizeof phdr_info, param);
>  
> -		rlock_acquire(rtld_bind_lock, &bind_lockstate);
> +		wlock_acquire(rtld_bind_lock, &bind_lockstate);
>  		obj = globallist_next(&marker);
>  		TAILQ_REMOVE(&obj_list, &marker, next);
>  		if (error != 0) {
> 


-- 
Andriy Gapon

From owner-svn-src-all@freebsd.org  Tue Dec 13 20:55:47 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C2B7C7629E;
 Tue, 13 Dec 2016 20:55:47 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1BE8F1508;
 Tue, 13 Dec 2016 20:55:47 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDKtk0C023904;
 Tue, 13 Dec 2016 20:55:46 GMT (envelope-from hrs@FreeBSD.org)
Received: (from hrs@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDKtk7V023903;
 Tue, 13 Dec 2016 20:55:46 GMT (envelope-from hrs@FreeBSD.org)
Message-Id: <201612132055.uBDKtk7V023903@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org
 using -f
From: Hiroki Sato <hrs@FreeBSD.org>
Date: Tue, 13 Dec 2016 20:55:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310035 - head/usr.sbin/syslogd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 20:55:47 -0000

Author: hrs
Date: Tue Dec 13 20:55:46 2016
New Revision: 310035
URL: https://svnweb.freebsd.org/changeset/base/310035

Log:
  Remove an extra "break" which could incorrectly terminate an
  STAILQ_FOREACH() loop when an AF_INET6 rule matched.
  
  Spotted by:	cem

Modified:
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/syslogd.c
==============================================================================
--- head/usr.sbin/syslogd/syslogd.c	Tue Dec 13 20:54:38 2016	(r310034)
+++ head/usr.sbin/syslogd/syslogd.c	Tue Dec 13 20:55:46 2016	(r310035)
@@ -2465,7 +2465,6 @@ validate(struct sockaddr *sa, const char
 	struct allowedpeer *ap;
 	struct sockaddr_in *sin4, *a4p = NULL, *m4p = NULL;
 #ifdef INET6
-	int reject;
 	struct sockaddr_in6 *sin6, *a6p = NULL, *m6p = NULL;
 #endif
 	struct addrinfo hints, *res;
@@ -2533,13 +2532,8 @@ validate(struct sockaddr *sa, const char
 					dprintf("rejected in rule %d due to scope mismatch.\n", i);
 					continue;
 				}
-				reject = 0;
 				if (IN6_ARE_MASKED_ADDR_EQUAL(&sin6->sin6_addr,
 				    &a6p->sin6_addr, &m6p->sin6_addr) != 0) {
-					++reject;
-					break;
-				}
-				if (reject) {
 					dprintf("rejected in rule %d due to IP mismatch.\n", i);
 					continue;
 				}

From owner-svn-src-all@freebsd.org  Tue Dec 13 20:58:26 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00190C7632A;
 Tue, 13 Dec 2016 20:58:25 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from mail.allbsd.org (gatekeeper.allbsd.org
 [IPv6:2001:2f0:104:e001::32])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "*.allbsd.org", Issuer "RapidSSL SHA256 CA - G3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 96AE116E7;
 Tue, 13 Dec 2016 20:58:24 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from mail-d.allbsd.org (p2027-ipbf1605funabasi.chiba.ocn.ne.jp
 [123.225.191.27]) (authenticated bits=56)
 by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id uBDKw04E092933
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL)
 (Client CN
 "/OU=GT07882699/OU=See+20www.rapidssl.com/resources/cps+20+28c+2915/OU=Domain+20Control+20Validated+20-+20RapidSSL+28R+29/CN=*.allbsd.org",
 Issuer "/C=US/O=GeoTrust+20Inc./CN=RapidSSL+20SHA256+20CA+20-+20G3"); 
 Wed, 14 Dec 2016 05:58:20 +0900 (JST) (envelope-from hrs@FreeBSD.org)
Received: from alph.allbsd.org (alph.allbsd.org [192.168.0.10])
 by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id uBDKuiwv021620
 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Wed, 14 Dec 2016 05:56:44 +0900 (JST) (envelope-from hrs@FreeBSD.org)
Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0)
 by alph.allbsd.org (8.15.2/8.15.2) with ESMTPA id uBDKugpb021617;
 Wed, 14 Dec 2016 05:56:44 +0900 (JST) (envelope-from hrs@FreeBSD.org)
Date: Wed, 14 Dec 2016 05:56:31 +0900 (JST)
Message-Id: <20161214.055631.1082998771679292922.hrs@allbsd.org>
To: cem@freebsd.org
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r309933 - head/usr.sbin/syslogd
From: Hiroki Sato <hrs@FreeBSD.org>
In-Reply-To: <CAG6CVpV=nshki9k8DM-4Cni1gTJ8U-Eh1t8D9KfUqo0MKnC=wA@mail.gmail.com>
References: <201612121933.uBCJXen2093959@repo.freebsd.org>
 <CAG6CVpV=nshki9k8DM-4Cni1gTJ8U-Eh1t8D9KfUqo0MKnC=wA@mail.gmail.com>
X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530  FFD7 4F2C D3D8 2793 CF2D
X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Multipart/Signed; protocol="application/pgp-signature";
 micalg=pgp-sha1;
 boundary="--Security_Multipart(Wed_Dec_14_05_56_31_2016_032)--"
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.99 at gatekeeper.allbsd.org
X-Virus-Status: Clean
X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.4.3
 (mail.allbsd.org [133.31.130.32]); Wed, 14 Dec 2016 05:58:21 +0900 (JST)
X-Spam-Status: No, score=-99.4 required=13.0 tests=CONTENT_TYPE_PRESENT,
 FAKEDWORD_EXCLAMATION,QENCPTR1,USER_IN_WHITELIST autolearn=no
 autolearn_force=no version=3.4.1
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on
 gatekeeper.allbsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 20:58:26 -0000

----Security_Multipart(Wed_Dec_14_05_56_31_2016_032)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Conrad Meyer <cem@freebsd.org> wrote
  in <CAG6CVpV=nshki9k8DM-4Cni1gTJ8U-Eh1t8D9KfUqo0MKnC=wA@mail.gmail.com>:

ce> On Mon, Dec 12, 2016 at 11:33 AM, Hiroki Sato <hrs@freebsd.org> wrote:
ce> > Author: hrs
ce> > Date: Mon Dec 12 19:33:40 2016
ce> > New Revision: 309933
ce> > URL: https://svnweb.freebsd.org/changeset/base/309933
ce> >
ce> > Log:
ce> >   - Refactor listening socket list.  All of the listening sockets are
ce> >     now maintained in a single linked-list in a transport-independent manner.
ce> >   - Use queue.h for linked-list structure.
ce> >   - Use linked-list for AllowedPeers.
ce> >   - Use getaddrinfo(8) even for Unix Domain sockets.
ce> >   - Use macros to type-casting from/to struct sockaddr{,_in,_in6}.
ce> >   - Define fu_* macro for union f_un to shorten the member names.
ce> >   - Remove an extra #include <sys/type.h>.
ce> >   - Add "static" to non-exported symbols.
ce> >   - !INET support is still incomplete but will be fixed later.
ce> >
ce> >   There is no functional change except for some minor debug messages.
ce>
ce> Hello Hiroki,
ce>
ce> This refactor introduced a bug in the IPv6 address comparison/rejection logic.
ce>
ce> > Modified: head/usr.sbin/syslogd/syslogd.c
ce> > ==============================================================================
ce> > --- head/usr.sbin/syslogd/syslogd.c     Mon Dec 12 19:26:55 2016        (r309932)
ce> > +++ head/usr.sbin/syslogd/syslogd.c     Mon Dec 12 19:33:40 2016        (r309933)
ce> > ...
ce> >      reject = 0;
ce> > - for (j = 0; j < 16; j += 4) {
ce> > - if ((*(u_int32_t *)&sin6->sin6_addr.s6_addr[j] & *(u_int32_t *)&m6p->sin6_addr.s6_addr[j])
ce> > -    != *(u_int32_t *)&a6p->sin6_addr.s6_addr[j]) {
ce> > - ++reject;
ce> > - break;
ce> > - }
ce> > + if (IN6_ARE_MASKED_ADDR_EQUAL(&sin6->sin6_addr,
ce> > +    &a6p->sin6_addr, &m6p->sin6_addr) != 0) {
ce> > + ++reject;
ce> > + break;
ce> >      }
ce> >      if (reject) {
ce> >       dprintf("rejected in rule %d due to IP mismatch.\n", i);
ce>
ce> The new check isn't a loop, so the 'break' breaks out of the outer
ce> loop, which is unintentional.  I think we should just remove 'break'.
ce>
ce> This was found by Coverity CID 1366941.

 Oh, it was my mistake.  Thank you for pointing out it.  Fixed in
 r310035 just now.

-- Hiroki

----Security_Multipart(Wed_Dec_14_05_56_31_2016_032)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEABECAAYFAlhQYH8ACgkQTyzT2CeTzy1alQCgh0NueEwmT5f9vfG3EN5lWbfz
64kAnjvCUCIu0mEtMg5kKzW+fIRr8Bq1
=WD3C
-----END PGP SIGNATURE-----

----Security_Multipart(Wed_Dec_14_05_56_31_2016_032)----

From owner-svn-src-all@freebsd.org  Tue Dec 13 21:08:10 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41D81C7669D;
 Tue, 13 Dec 2016 21:08:10 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com
 [209.85.220.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 086831ECB;
 Tue, 13 Dec 2016 21:08:09 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: by mail-qk0-f171.google.com with SMTP id n204so130105551qke.2;
 Tue, 13 Dec 2016 13:08:09 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:reply-to:in-reply-to:references
 :from:date:message-id:subject:to:cc;
 bh=UC+3tErtMPoVRkIBhqX060FJKRwW4983Sbel6XBvtCY=;
 b=eh759QOVvHxz64MI5tQlODvvQ37E+O9AC+JYfhVLXg6axcsmGF36hs13nFcFI2p/Tb
 1glDqqzDzNLGz5yC22NUdRB4ZAssEmWY7yUotZI7p+5Xt4aUB9pHQCD3HSriB8O8MUtS
 C03YsOn8gZmMLjYE2F4pzRmUvdT6InaG8bW6UuoO1eDUwe000g9IVQvw0QzJQKVRaDWj
 DYD57DE6kx8E4GeSeJB+SkftzBReOd6O8Clxgwp0k6meYJaRgElXiEKkmyUsu5SQo++d
 5zHIfh2yN+TVyEA3LARbObpGRG47m0DMXWK0U73TvfsfmU2o8NoLVv89L4qqrie6g3iW
 OWdA==
X-Gm-Message-State: AKaTC03Pc+lz7wJOBXLuBxUeHlB5Drc2HhtM9OcNbVW2uQlb7ykGYIZ7akywcDh596IeCg==
X-Received: by 10.55.118.3 with SMTP id r3mr30408280qkc.84.1481663283245;
 Tue, 13 Dec 2016 13:08:03 -0800 (PST)
Received: from mail-qk0-f172.google.com (mail-qk0-f172.google.com.
 [209.85.220.172])
 by smtp.gmail.com with ESMTPSA id q3sm29981339qtc.34.2016.12.13.13.08.03
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 13 Dec 2016 13:08:03 -0800 (PST)
Received: by mail-qk0-f172.google.com with SMTP id x190so130245829qkb.0;
 Tue, 13 Dec 2016 13:08:03 -0800 (PST)
X-Received: by 10.55.12.10 with SMTP id 10mr83812237qkm.49.1481663282911; Tue,
 13 Dec 2016 13:08:02 -0800 (PST)
MIME-Version: 1.0
Reply-To: cem@freebsd.org
Received: by 10.200.58.165 with HTTP; Tue, 13 Dec 2016 13:08:02 -0800 (PST)
In-Reply-To: <201612132055.uBDKtk7V023903@repo.freebsd.org>
References: <201612132055.uBDKtk7V023903@repo.freebsd.org>
From: Conrad Meyer <cem@freebsd.org>
Date: Tue, 13 Dec 2016 13:08:02 -0800
X-Gmail-Original-Message-ID: <CAG6CVpWRN+EYyvaq_AP8EcE6Ty5+evbw-R586dtJA_bXUN8hMw@mail.gmail.com>
Message-ID: <CAG6CVpWRN+EYyvaq_AP8EcE6Ty5+evbw-R586dtJA_bXUN8hMw@mail.gmail.com>
Subject: Re: svn commit: r310035 - head/usr.sbin/syslogd
To: Hiroki Sato <hrs@freebsd.org>
Cc: src-committers <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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 21:08:10 -0000

On Tue, Dec 13, 2016 at 12:55 PM, Hiroki Sato <hrs@freebsd.org> wrote:
> Author: hrs
> Date: Tue Dec 13 20:55:46 2016
> New Revision: 310035
> URL: https://svnweb.freebsd.org/changeset/base/310035
>
> Log:
>   Remove an extra "break" which could incorrectly terminate an
>   STAILQ_FOREACH() loop when an AF_INET6 rule matched.
>
>   Spotted by:   cem

Coverity CID: 1366941

Thanks,
Conrad

From owner-svn-src-all@freebsd.org  Tue Dec 13 21:16:41 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44B78C76B36;
 Tue, 13 Dec 2016 21:16:41 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com
 [209.85.216.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 1780499A;
 Tue, 13 Dec 2016 21:16:41 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: by mail-qt0-f193.google.com with SMTP id l20so15248467qta.1;
 Tue, 13 Dec 2016 13:16:40 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:reply-to:in-reply-to:references
 :from:date:message-id:subject:to:cc;
 bh=Qlt2ysOeV1C0EK25O2DVySsX1c7tk/gMt8TaiwmTU/w=;
 b=UBWEeJJeVL/knHl8n3CD4g6NAYR8OwOe+9IQYWrZUaygE9QhxdBKbxzwNd5ri/CSfS
 J1GCHMLXagfjyPfwxXsWSQOEpuOVEAwXLqm4ksVBy+tMVNM20Uat6SueWKS8dkZovR+O
 D4kU7ogl5dhsGWTvoBrHJx2Ao6QFX6ubzGKV95DJlnyaORwAOI4/845HnE8AuvYzrLdP
 T3PcD5UBMpb/wqOgJ6EGqXryJpcOBILUDD1V9XdyWZ+bcGQXc4rsjVpuLS3AEtIV0i3i
 8VsFUdSt79ASYgytHHgbg32aKz2NzNAitjdqs0b4ls4CClHitwatnknD0tOqF0T4M3Wv
 JsJg==
X-Gm-Message-State: AKaTC02ewzMmTBXvfN6seU+46et3WWTx5jFU0nkCyEgKzfpiWqs3DkT0XPc1hOd5/SSZoA==
X-Received: by 10.200.39.200 with SMTP id x8mr85543920qtx.56.1481663005153;
 Tue, 13 Dec 2016 13:03:25 -0800 (PST)
Received: from mail-qt0-f175.google.com (mail-qt0-f175.google.com.
 [209.85.216.175])
 by smtp.gmail.com with ESMTPSA id g97sm29855270qkh.11.2016.12.13.13.03.25
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 13 Dec 2016 13:03:25 -0800 (PST)
Received: by mail-qt0-f175.google.com with SMTP id n6so119583791qtd.1;
 Tue, 13 Dec 2016 13:03:25 -0800 (PST)
X-Received: by 10.237.53.119 with SMTP id b52mr98038085qte.74.1481663004909;
 Tue, 13 Dec 2016 13:03:24 -0800 (PST)
MIME-Version: 1.0
Reply-To: cem@freebsd.org
Received: by 10.200.58.165 with HTTP; Tue, 13 Dec 2016 13:03:24 -0800 (PST)
In-Reply-To: <099725fe-af29-3f9d-852d-53357bb8e8fe@FreeBSD.org>
References: <201612131805.uBDI5EDm054866@repo.freebsd.org>
 <099725fe-af29-3f9d-852d-53357bb8e8fe@FreeBSD.org>
From: Conrad Meyer <cem@freebsd.org>
Date: Tue, 13 Dec 2016 13:03:24 -0800
X-Gmail-Original-Message-ID: <CAG6CVpVQwUWS-v8Nu2L6tRqeBX2YxG_5-VPYTWtpM5crSMA8oQ@mail.gmail.com>
Message-ID: <CAG6CVpVQwUWS-v8Nu2L6tRqeBX2YxG_5-VPYTWtpM5crSMA8oQ@mail.gmail.com>
Subject: Re: svn commit: r310025 - head/libexec/rtld-elf
To: Andriy Gapon <avg@freebsd.org>
Cc: Bryan Drewery <bdrewery@freebsd.org>,
 src-committers <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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 21:16:41 -0000

On Tue, Dec 13, 2016 at 12:51 PM, Andriy Gapon <avg@freebsd.org> wrote:
> On 13/12/2016 20:05, Bryan Drewery wrote:
>> Author: bdrewery
>> Date: Tue Dec 13 18:05:14 2016
>> New Revision: 310025
>> URL: https://svnweb.freebsd.org/changeset/base/310025
>>
>> Log:
>>   Take write lock for rtld_bind before modifying obj_list in dl_iterate_phdr().
>
> What are typical callers of dl_iterate_phdr() ?

libunwind::UnwindCursor<libunwind::LocalAddressSpace,
libunwind::Registers_x86_64>::setInfoBasedOnIPRegister(bool) via
_pthread_exit.

> In what scenarios this bug would typically be hit?
> Thank you!

We mostly hit this during multi-threaded program teardown.  Exiting
threads would be in _pthread_exit -> libunwind -> dl_iterate_phdr at
the same time as the main thread was performing __cxa_finalize ->
_rtld_addr_phdr -> obj_from_addr.

Best,
Conrad

From owner-svn-src-all@freebsd.org  Tue Dec 13 21:22:23 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2180AC76D65;
 Tue, 13 Dec 2016 21:22:23 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170])
 (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 01988DF0;
 Tue, 13 Dec 2016 21:22:22 +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 mail.baldwin.cx (Postfix) with ESMTPSA id B524710AA59;
 Tue, 13 Dec 2016 16:22:14 -0500 (EST)
From: John Baldwin <jhb@freebsd.org>
To: src-committers@freebsd.org
Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r310029 - head/sys/mips/mips
Date: Tue, 13 Dec 2016 11:33:08 -0800
Message-ID: <2546529.BGIUpOVlcU@ralph.baldwin.cx>
User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; )
In-Reply-To: <201612131927.uBDJRWBO087486@repo.freebsd.org>
References: <201612131927.uBDJRWBO087486@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.4.3
 (mail.baldwin.cx); Tue, 13 Dec 2016 16:22:14 -0500 (EST)
X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx
X-Virus-Status: Clean
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 21:22:23 -0000

On Tuesday, December 13, 2016 07:27:32 PM John Baldwin wrote:
> Author: jhb
> Date: Tue Dec 13 19:27:31 2016
> New Revision: 310029
> URL: https://svnweb.freebsd.org/changeset/base/310029
> 
> Log:
>   Fix remove_userlocal_code() for n32.
>   
>   n32 kernels use a 64-bit store to the TLS register rather than a 32-bit
>   store.
>   
>   Sponsored by:	DARPA / AFRL

This permits booting an n32 kernel under qemu-system-mips64.  However,
/sbin/init gets stuck in some sort of recursive loop (I think) which
causes it to overflow its stack, so userland doesn't quite work yet.

-- 
John Baldwin

From owner-svn-src-all@freebsd.org  Tue Dec 13 21:24:38 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3EAC76E09;
 Tue, 13 Dec 2016 21:24:38 +0000 (UTC) (envelope-from jilles@stack.nl)
Received: from mailout.stack.nl (mailout05.stack.nl
 [IPv6:2001:610:1108:5010::202])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mailout.stack.nl",
 Issuer "CA Cert Signing Authority" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 6DAB1FF8;
 Tue, 13 Dec 2016 21:24:38 +0000 (UTC) (envelope-from jilles@stack.nl)
Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131])
 by mailout.stack.nl (Postfix) with ESMTP id B5B4C41F5;
 Tue, 13 Dec 2016 22:24:35 +0100 (CET)
Received: by snail.stack.nl (Postfix, from userid 1677)
 id A4C6128494; Tue, 13 Dec 2016 22:24:35 +0100 (CET)
Date: Tue, 13 Dec 2016 22:24:35 +0100
From: Jilles Tjoelker <jilles@stack.nl>
To: Devin Teske <dteske@FreeBSD.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r309918 - head/usr.sbin/bsdinstall/scripts
Message-ID: <20161213212435.GA34587@stack.nl>
References: <201612121848.uBCIm00M073404@repo.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201612121848.uBCIm00M073404@repo.freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 21:24:38 -0000

On Mon, Dec 12, 2016 at 06:48:00PM +0000, Devin Teske wrote:
> Author: dteske
> Date: Mon Dec 12 18:48:00 2016
> New Revision: 309918
> URL: https://svnweb.freebsd.org/changeset/base/309918

> Log:
>   Remove unnecessary `-n' parameter to head/tail

These -n options are not completely unnecessary since POSIX removed the
obsolete forms without -n years ago, and some minimalistic
implementations (Busybox) followed suit. Therefore, although I use the
obsolete forms frequently interactively, I think head/tail -n should be
the preferred form in scripts.

The obsolete form tail +N (where N is a number) should definitely be
avoided since it conflicts with a file named like that; head -N and tail
-N are valid extensions to the standard.

> Modified:
>   head/usr.sbin/bsdinstall/scripts/wlanconfig
> 
> Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
> ==============================================================================
> --- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:45:52 2016	(r309917)
> +++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:48:00 2016	(r309918)
> @@ -175,8 +175,8 @@ fi
>  #
>  if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
>  	# Get current country/regdomain for selected interface
> -	WLAN_IFACE=$( wpa_cli ifname | tail -n 1 )
> -	INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -n 1 )
> +	WLAN_IFACE=$( wpa_cli ifname | tail -1 )
> +	INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -1 )
>  	DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 )
>  	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
>  	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"

-- 
Jilles Tjoelker

From owner-svn-src-all@freebsd.org  Tue Dec 13 22:16:03 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1144C76893;
 Tue, 13 Dec 2016 22:16:03 +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 A7701ACC;
 Tue, 13 Dec 2016 22:16:03 +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 uBDMG2r3056195;
 Tue, 13 Dec 2016 22:16:02 GMT (envelope-from jkim@FreeBSD.org)
Received: (from jkim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDMG2xP056193;
 Tue, 13 Dec 2016 22:16:02 GMT (envelope-from jkim@FreeBSD.org)
Message-Id: <201612132216.uBDMG2xP056193@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jkim set sender to
 jkim@FreeBSD.org using -f
From: Jung-uk Kim <jkim@FreeBSD.org>
Date: Tue, 13 Dec 2016 22:16:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310036 - in head/contrib/byacc: . package package/debian
 package/pkgsrc test/btyacc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 22:16:04 -0000

Author: jkim
Date: Tue Dec 13 22:16:02 2016
New Revision: 310036
URL: https://svnweb.freebsd.org/changeset/base/310036

Log:
  MFV:	r309561
  
  Merge byacc 20161202.

Modified:
  head/contrib/byacc/CHANGES
  head/contrib/byacc/MANIFEST
  head/contrib/byacc/VERSION
  head/contrib/byacc/aclocal.m4
  head/contrib/byacc/btyaccpar.c
  head/contrib/byacc/btyaccpar.skel
  head/contrib/byacc/config.guess
  head/contrib/byacc/config.sub
  head/contrib/byacc/configure
  head/contrib/byacc/defs.h
  head/contrib/byacc/error.c
  head/contrib/byacc/main.c
  head/contrib/byacc/mstring.c
  head/contrib/byacc/output.c
  head/contrib/byacc/package/byacc.spec
  head/contrib/byacc/package/debian/changelog
  head/contrib/byacc/package/mingw-byacc.spec
  head/contrib/byacc/package/pkgsrc/Makefile
  head/contrib/byacc/reader.c
  head/contrib/byacc/test/btyacc/btyacc_calc1.tab.c
  head/contrib/byacc/test/btyacc/btyacc_demo.tab.c
  head/contrib/byacc/test/btyacc/btyacc_demo.tab.h
  head/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c
  head/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c
  head/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c
  head/contrib/byacc/test/btyacc/calc.tab.c
  head/contrib/byacc/test/btyacc/calc1.tab.c
  head/contrib/byacc/test/btyacc/calc2.tab.c
  head/contrib/byacc/test/btyacc/calc3.tab.c
  head/contrib/byacc/test/btyacc/code_calc.code.c
  head/contrib/byacc/test/btyacc/code_calc.tab.c
  head/contrib/byacc/test/btyacc/code_error.code.c
  head/contrib/byacc/test/btyacc/code_error.tab.c
  head/contrib/byacc/test/btyacc/empty.tab.c
  head/contrib/byacc/test/btyacc/err_inherit3.tab.c
  head/contrib/byacc/test/btyacc/err_inherit4.tab.c
  head/contrib/byacc/test/btyacc/err_inherit4.tab.h
  head/contrib/byacc/test/btyacc/err_syntax10.tab.c
  head/contrib/byacc/test/btyacc/err_syntax11.tab.c
  head/contrib/byacc/test/btyacc/err_syntax12.tab.c
  head/contrib/byacc/test/btyacc/err_syntax18.tab.c
  head/contrib/byacc/test/btyacc/err_syntax20.tab.c
  head/contrib/byacc/test/btyacc/error.tab.c
  head/contrib/byacc/test/btyacc/grammar.tab.c
  head/contrib/byacc/test/btyacc/inherit0.tab.c
  head/contrib/byacc/test/btyacc/inherit1.tab.c
  head/contrib/byacc/test/btyacc/inherit2.tab.c
  head/contrib/byacc/test/btyacc/ok_syntax1.tab.c
  head/contrib/byacc/test/btyacc/pure_calc.tab.c
  head/contrib/byacc/test/btyacc/pure_error.tab.c
  head/contrib/byacc/test/btyacc/quote_calc-s.tab.c
  head/contrib/byacc/test/btyacc/quote_calc.tab.c
  head/contrib/byacc/test/btyacc/quote_calc2-s.tab.c
  head/contrib/byacc/test/btyacc/quote_calc2.tab.c
  head/contrib/byacc/test/btyacc/quote_calc3-s.tab.c
  head/contrib/byacc/test/btyacc/quote_calc3.tab.c
  head/contrib/byacc/test/btyacc/quote_calc4-s.tab.c
  head/contrib/byacc/test/btyacc/quote_calc4.tab.c
  head/contrib/byacc/test/btyacc/rename_debug.c
  head/contrib/byacc/test/btyacc/varsyntax_calc1.tab.c
  head/contrib/byacc/yaccpar.c
  head/contrib/byacc/yaccpar.skel
Directory Properties:
  head/contrib/byacc/   (props changed)

Modified: head/contrib/byacc/CHANGES
==============================================================================
--- head/contrib/byacc/CHANGES	Tue Dec 13 20:55:46 2016	(r310035)
+++ head/contrib/byacc/CHANGES	Tue Dec 13 22:16:02 2016	(r310036)
@@ -1,4 +1,123 @@
-2016-06-06  Thomas E. Dickey  <tom@invisible-island.net>
+2016-12-02  Thomas E. Dickey  <dickey@invisible-island.net>
+
+	* test/btyacc/quote_calc4-s.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/rename_debug.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc
 /btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, btyaccpar.c:
+	regen
+
+	* btyaccpar.skel: changes from NetBSD
+	+ use YYINT rather than short in btyaccpar.skel
+	  (some of this had already been done by Tom Shields)
+	+ remove some casts of malloc/realloc
+
+	* yaccpar.c, yaccpar.skel, output.c: changes from NetBSD
+	- Add some more bison stuff to make the mesa/gallium parser work:
+	    %initial-action (add missing source struct member in location)
+	    %debug (unimplemented)
+	    %error-verbose (unimplemented)
+
+	This changes some existing code:
+	+ yylloc is now a pointer, so
+	+ the first parameter to YYERROR_DECL() is a pointer
+	+ struct YYLTYPE now has a "source" field
+
+	* test/btyacc/btyacc_demo.tab.h, test/btyacc/code_calc.tab.c, test/btyacc/code_error.tab.c, test/btyacc/err_inherit4.tab.h:
+	regen
+
+	* btyaccpar.c, btyaccpar.skel, reader.c: changes from NetBSD
+	- Add some more bison stuff to make the mesa/gallium parser work:
+	    %initial-action (add missing source struct member in location)
+	    %debug (unimplemented)
+	    %error-verbose (unimplemented)
+
+	This changes some existing code:
+	+ yylloc is now a pointer, so
+	+ the first parameter to YYERROR_DECL() is a pointer
+	+ struct YYLTYPE now has a "source" field
+
+	* reader.c:
+	fix from NetBSD: correct off-by-one when adding a null in copy_param()
+
+	* reader.c: adapted from NetBSD
+	- Convert *most* error fingerprints to:
+	    -unterminated_arglist(int a_lineno, char *a_line, char *a_cptr)
+	    +unterminated_arglist(const struct ainfo *a)
+	- Cast new <ctype.h> args to unsigned char
+
+	* defs.h: changes from NetBSD
+	- Add some more bison stuff to make the mesa/gallium parser work:
+	    %initial-action (add missing source struct member in location)
+	    %debug (unimplemented)
+	    %error-verbose (unimplemented)
+
+	This changes some existing code:
+	+ yylloc is now a pointer, so
+	+ the first parameter to YYERROR_DECL() is a pointer
+	+ struct YYLTYPE now has a "source" field
+
+	* defs.h: adapted from NetBSD
+	- Convert *most* error fingerprints to:
+	    -unterminated_arglist(int a_lineno, char *a_line, char *a_cptr)
+	    +unterminated_arglist(const struct ainfo *a)
+	- Cast new <ctype.h> args to unsigned char
+
+	* main.c: changes from NetBSD
+	- Add some more bison stuff to make the mesa/gallium parser work:
+	    %initial-action (add missing source struct member in location)
+	    %debug (unimplemented)
+	    %error-verbose (unimplemented)
+
+	This changes some existing code:
+	+ yylloc is now a pointer, so
+	+ the first parameter to YYERROR_DECL() is a pointer
+	+ struct YYLTYPE now has a "source" field
+
+	* error.c: adapted from NetBSD
+	- Convert *most* error fingerprints to:
+	    -unterminated_arglist(int a_lineno, char *a_line, char *a_cptr)
+	    +unterminated_arglist(const struct ainfo *a)
+	- Cast new <ctype.h> args to unsigned char
+
+	* mstring.c: adapted change from NetBSD to add casts for ctype macros
+
+	* test/btyacc/btyacc_demo.tab.h, test/btyacc/err_inherit4.tab.h: regen
+
+	* output.c: reorder to eliminate a forward-reference
+
+2016-12-02  Tom.Shields
+
+	* output.c:
+	modify output to enable compilation of a lexer generated by flex (using
+	"%option bison-bridge" and "%option bison-locations") to be used with a parser
+	generated by b(t)yacc (using directives "%locations" and "%pure-parser").
+
+2016-12-02  Thomas E. Dickey  <dickey@invisible-island.net>
+
+	* configure: regen
+
+	* aclocal.m4: Improved autoconf macros
+	CF_CC_ENV_FLAGS
+	+ improve split between compiler and options, prompted by report where user
+	  had "ccache" before the compiler
+	+ leave non-preprocessor options in "$CC" (but still copy them to "$CFLAGS"
+	  since that's where they should be)
+	CF_GNU_SOURCE,v
+	+ recent glibc (Debian 2.23-4 for example) has misordered ifdef/checks for new
+	  symbol _DEFAULT_SOURCE, producing warning messages when only _GNU_SOURCE is
+	  defined.  Add a followup check to define _DEFAULT_SOURCE.
+	CF_XOPEN_SOURCE
+	+ add "uclinux" to list of Linux's (patch by Yann E.  Morin)
+	+ use _GNU_SOURCE for cygwin headers
+	+ build-fixes for OS/2
+
+	* VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
+	bump
+
+2016-11-20  Thomas E. Dickey  <dickey@invisible-island.net>
+
+	* config.sub: 2016-11-19
+
+	* config.guess: 2016-10-02
+
+2016-06-06  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* configure: regen
 
@@ -32,7 +151,7 @@
 	small fix for an edge case of initialized data in Chris Dodd's btyacc changes:
 	"Avoid crash when input pops up an Action error at the first token"
 
-2016-06-01  Thomas E. Dickey  <tom@invisible-island.net>
+2016-06-01  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax24.error, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_calc.tab.h, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/rename_debug.c, yaccpar.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-
 s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.error, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, te
 st/btyacc/error.tab.c, test/btyacc/grammar.t!
 ab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.output, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.error, test/btyacc/btyacc_demo.output, test/btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_calc.tab.c, test/btyacc/code_calc.tab.h, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.output, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.output, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.t
 ab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/rename_debug.c, btyaccpar.c:
 	regen
@@ -72,12 +191,12 @@
 
 	+ changes to a couple of test cases for coverage of #3, #4 and #5 above
 
-2016-06-01  Thomas E. Dickey  <tom@invisible-island.net>
+2016-06-01  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
 	bump
 
-2016-03-24  Thomas E. Dickey  <tom@invisible-island.net>
+2016-03-24  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* reader.c: unused variable
 
@@ -90,7 +209,7 @@
 	the first occurrence of ".c" in the name in 2005-08-13 changes rather than
 	at the end of the filename (patch by Jung-uk Kim)
 
-2016-03-24  Thomas E. Dickey  <tom@invisible-island.net>
+2016-03-24  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* aclocal.m4:
 	update CF_WITH_MAN2HTML to use configured shell rather than /bin/sh
@@ -98,11 +217,11 @@
 	* VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
 	bump
 
-2016-01-25  Thomas E. Dickey  <tom@invisible-island.net>
+2016-01-25  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.guess, config.sub: 2016-01-01
 
-2015-07-10  Thomas E. Dickey  <tom@invisible-island.net>
+2015-07-10  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* lr0.c: fix a duplicate-free in the leak-checking
 
@@ -117,7 +236,7 @@
 	make relationship with format/size clearer (prompted by discussion
 	with Pedro Giffuni, Oliver Pinter)
 
-2015-07-05  Thomas E. Dickey  <tom@invisible-island.net>
+2015-07-05  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* configure: regen
 
@@ -131,13 +250,13 @@
 
 	* configure.in: add configure option --with-man2html
 
-2015-05-02  Thomas E. Dickey  <tom@invisible-island.net>
+2015-05-02  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.guess: 2015-03-04
 
 	* config.sub: 2015-03-08
 
-2014-11-28  Thomas E. Dickey  <tom@invisible-island.net>
+2014-11-28  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* lr0.c: coverity #39181: memory leak
 
@@ -159,7 +278,7 @@
 	             Regards
 	                 Jouk.
 
-2014-10-06  Thomas E. Dickey  <tom@invisible-island.net>
+2014-10-06  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/debian/source/format:
 	change to native format to work around regression in Debian packaging.
@@ -179,7 +298,7 @@
 	better fix for get_line, by ensuring there is enough space to null-terminate
 	its result (prompted by discussion with Craig Rodrigues).
 
-2014-10-05  Thomas E. Dickey  <tom@invisible-island.net>
+2014-10-05  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* main.c:
 	make change to umask before calling mkstemp, as suggested in Coverity #56902
@@ -250,7 +369,7 @@
 	modify copy_param() to handle resulting comma-separated list.  Before, it
 	only expected a single parameter.
 
-2014-10-04  Thomas E. Dickey  <tom@invisible-island.net>
+2014-10-04  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* reader.c: split-out save_param() from copy_param()
 
@@ -271,28 +390,28 @@
 	* test/btyacc/btyacc_destroy3.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.error, test/btyacc/btyacc_destroy3.output, test/btyacc/btyacc_destroy3.tab.h, test/btyacc/btyacc_destroy2.error, test/btyacc/btyacc_destroy2.output, test/btyacc/btyacc_destroy2.tab.h:
 	RCS_BASE
 
-2014-10-03  Thomas E. Dickey  <tom@invisible-island.net>
+2014-10-03  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/btyacc/btyacc_demo2.error, test/btyacc/btyacc_demo2.output, test/btyacc/btyacc_demo2.tab.c, test/btyacc/btyacc_demo2.tab.h, test/btyacc/btyacc_destroy1.error, test/btyacc/btyacc_destroy1.output, test/btyacc/btyacc_destroy1.tab.h, test/btyacc_destroy3.y, test/btyacc_destroy1.y, test/btyacc_destroy2.y:
 	RCS_BASE
 
-2014-10-02  Thomas E. Dickey  <tom@invisible-island.net>
+2014-10-02  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* main.c, reader.c, defs.h:
 	use calloc in get_line() when allocating line to ensure it is fully initialized,
 	fixes a later uninitialized value in copy_param() (FreeBSD #193499).
 
-2014-09-17  Thomas E. Dickey  <tom@invisible-island.net>
+2014-09-17  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* closure.c, lalr.c, output.c, defs.h:
 	rephrase odd addressing to fix Coverity #48848, #38950, #38860, not actually
 	a bug.
 
-2014-09-01  Thomas E. Dickey  <tom@invisible-island.net>
+2014-09-01  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.sub: update to 2014-07-28
 
-2014-07-27  Thomas E. Dickey  <tom@invisible-island.net>
+2014-07-27  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* configure: regen
 
@@ -301,7 +420,7 @@
 	* package/pkgsrc/Makefile, VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec:
 	bump
 
-2014-07-15  Thomas E. Dickey  <tom@invisible-island.net>
+2014-07-15  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* aclocal.m4: resync with my-autoconf (no change to configure script)
 
@@ -312,7 +431,7 @@
 	make top-level "make check" work again, by adding another step to filtering
 	the test results.
 
-2014-07-14  Thomas E. Dickey  <tom@invisible-island.net>
+2014-07-14  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/run_test.sh: changes from Garrett Cooper's patch:
 		a) ensure that the script returns an error-code if there are differences
@@ -331,12 +450,12 @@
 
 	* main.c: remove obsolete -D option from usage message
 
-2014-05-27  Thomas E. Dickey  <tom@invisible-island.net>
+2014-05-27  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* VERSION, package/byacc.spec, package/debian/changelog, test/yacc/big_b.output, test/yacc/big_l.output, test/yacc/help.output, test/yacc/no_b_opt.output, test/yacc/no_output2.output, test/yacc/no_p_opt.output, test/yacc/nostdin.output:
 	bump
 
-2014-04-22  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-22  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* mstring.c:
 	use vsnprintf() to ensure that msprintf's buffer is large enough.
@@ -364,12 +483,12 @@
 	drop "NOTES-btyacc-Changes" and "NOTES-btyacc-Disposition", merging relevant
 	content into README.BTYACC
 
-2014-04-22  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-22  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/pkgsrc/Makefile, VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec:
 	bump
 
-2014-04-19  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-19  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.sub: 2014-04-03
 
@@ -379,7 +498,7 @@
 
 	* main.c, defs.h: patch to allow DEBUG build with WIN32 system
 
-2014-04-09  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-09  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* output.c, reader.c: gcc warnings
 
@@ -420,7 +539,7 @@
 	* yacc.1:
 	clarify relationship of btyacc features to default configuration.
 
-2014-04-08  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-08  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/yacc/ok_syntax1.output, test/yacc/ok_syntax1.tab.c, test/yacc/ok_syntax1.tab.h, test/btyacc/ok_syntax1.output, test/btyacc/ok_syntax1.tab.c, test/btyacc/ok_syntax1.tab.h:
 	reference output for testing
@@ -443,7 +562,7 @@
 
 	* mstring.c: minor reformatting to make coverage analysis simpler
 
-2014-04-07  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-07  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/run_test.sh: tidy
 
@@ -478,7 +597,7 @@
 	YYPATCH #define's to make test-outputs easier to compare #line's (report
 	by Tom Shields)
 
-2014-04-06  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-06  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* reader.c: fix for valgrind
 	(the calloc's are intentional - valgrind reported use of uninitialized memory)
@@ -582,7 +701,7 @@
 	* test/run_make.sh:
 	modify to avoid use of VPATH, which has no standard implementation
 
-2014-04-05  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-05  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c:
 	discard a change which merged CountLines() with explicit comparisons against
@@ -613,13 +732,13 @@
 
 	* test/btyacc_demo.y: fix prototypes
 
-2014-04-04  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-04  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* reader.c, defs.h, main.c:
 	more merging of Tom Shield's btyacc changes.  In the merge, I moved the
 	symbol_pval inside the btyacc ifdef's and added some more btyacc ifdefs
 
-2014-04-03  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-03  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* reader.c:
 	merge-in 3/4 of btyacc's changes, deferring those which change test-outputs.
@@ -633,7 +752,7 @@
 	Some of the merge uses ifdef-changes which I applied to ongoing resync,
 	e.g., the introduction of PER_STATE.
 
-2014-04-02  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-02  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c: regen
 
@@ -668,7 +787,7 @@
 
 	* main.c: changes for btyacc
 
-2014-04-01  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-01  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* reader.c:
 	integrate change by Tom Shields to use bsearch rather than successive
@@ -683,7 +802,7 @@
 
 	* verbose.c: changes for btyacc, ifdef'd
 
-2014-04-01  Thomas E. Dickey  <tom@invisible-island.net>
+2014-04-01  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* mkpar.c: eliminate most of the ifdef's using macros
 
@@ -695,7 +814,7 @@
 	new functions used for reporting errors from the btyacc configuration
 	(I reordered some, and ifdef'd the new ones -TD)
 
-2014-03-31  Thomas E. Dickey  <tom@invisible-island.net>
+2014-03-31  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c:
 	omit the GCC_UNUSED, as noted by Tom Shields not really essential
@@ -703,7 +822,7 @@
 	* test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c:
 	regen
 
-2014-03-29  Thomas E. Dickey  <tom@invisible-island.net>
+2014-03-29  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/y
 acc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, skeleton.c:
 	comment-out yysccsid in the banner because it produces unnecessary compiler
@@ -713,7 +832,7 @@
 	* test/run_test.sh:
 	for yacc, ignore the inherit testcases, since they are btyacc-specific
 
-2014-03-28  Thomas E. Dickey  <tom@invisible-island.net>
+2014-03-28  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/yacc/varsyntax_calc1.error, test/yacc/varsyntax_calc1.output, test/yacc/varsyntax_calc1.tab.c, test/yacc/varsyntax_calc1.tab.h, test/yacc/err_inherit3.error, test/yacc/err_inherit3.output, test/yacc/err_inherit3.tab.c, test/yacc/err_inherit3.tab.h, test/yacc/err_inherit4.error, test/yacc/err_inherit4.output, test/yacc/err_inherit4.tab.c, test/yacc/err_inherit4.tab.h, test/yacc/err_inherit5.error, test/yacc/err_inherit5.output, test/yacc/err_inherit5.tab.c, test/yacc/err_inherit5.tab.h, test/yacc/inherit0.error, test/yacc/inherit0.output, test/yacc/inherit0.tab.c, test/yacc/inherit0.tab.h, test/yacc/inherit1.error, test/yacc/inherit1.output, test/yacc/inherit1.tab.c, test/yacc/inherit1.tab.h, test/yacc/inherit2.error, test/yacc/inherit2.output, test/yacc/inherit2.tab.c, test/yacc/inherit2.tab.h, test/yacc/empty.error, test/yacc/empty.output, test/yacc/empty.tab.c, test/yacc/empty.tab.h, test/yacc/err_inherit1.error, test/yacc/err_inherit1.output, test/yacc/err_inherit1.tab.c,
  test/yacc/err_inherit1.tab.h, test/yacc/err_inherit2.error, test/yacc/err_inherit2.output, test/yacc/err_inherit2.tab.c, test/yacc/err_inherit2.tab.h:
 	reference output for testing
@@ -743,7 +862,7 @@
 
 	* yacc.1: document -L/-B features from btyacc
 
-2014-03-25  Thomas E. Dickey  <tom@invisible-island.net>
+2014-03-25  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* yacc.1: typo
 
@@ -762,7 +881,7 @@
 
 	* mstring.c: byacc-btyacc-20140323
 
-2014-03-25  Thomas E. Dickey  <tom@invisible-island.net>
+2014-03-25  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/btyacc/RCS, test/yacc/RCS: PERMIT FILE
 
@@ -777,7 +896,7 @@
 	* test/btyacc/err_syntax1.output, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax1.tab.h, test/btyacc/err_syntax10.error, test/btyacc/err_syntax10.output, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax10.tab.h, test/btyacc/err_syntax11.error, test/btyacc/err_syntax11.output, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax11.tab.h, test/btyacc/err_syntax12.error, test/btyacc/err_syntax12.output, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax12.tab.h, test/btyacc/err_syntax13.error, test/btyacc/err_syntax13.output, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax13.tab.h, test/btyacc/err_syntax14.error, test/btyacc/err_syntax14.output, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax14.tab.h, test/btyacc/err_syntax15.error, test/btyacc/err_syntax15.output, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax15.tab.h, test/btyacc/err_syntax16.error, test/btyacc/err_syntax16.output, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax16.tab.
 h, test/btyacc/err_syntax17.error, test/btyacc/err_syntax17.output, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax17.tab.h, test/btyacc/err_syntax18.error, test/btyacc/err_syntax18.output, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax18.tab.h, test/btyacc/err_syntax19.error, test/btyacc/err_syntax19.output, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax19.tab.h, test/btyacc/err_syntax2.output, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax2.tab.h, test/btyacc/err_syntax20.error, test/btyacc/err_syntax20.output, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax20.tab.h, test/btyacc/err_syntax21.error, test/btyacc/err_syntax21.output, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax21.tab.h, test/btyacc/err_syntax22.error, test/btyacc/err_syntax22.output, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax22.tab.h, test/btyacc/err_syntax23.error, test/btyacc/err_syntax23.output, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax23.tab.
 h, test/btyacc/err_syntax24.error, test/btya!
 cc/err_syntax24.output, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax24.tab.h, test/btyacc/err_syntax25.error, test/btyacc/err_syntax25.output, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax25.tab.h, test/btyacc/err_syntax26.error, test/btyacc/err_syntax26.output, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax26.tab.h, test/btyacc/err_syntax3.output, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax3.tab.h, test/btyacc/err_syntax4.output, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax4.tab.h, test/btyacc/err_syntax5.output, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax5.tab.h, test/btyacc/err_syntax6.output, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax6.tab.h, test/btyacc/err_syntax7.output, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7.tab.h, test/btyacc/err_syntax7a.output, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7a.tab.h, test/btyacc/err_syntax7b.output, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syn
 tax7b.tab.h, test/btyacc/err_syntax8.output, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8.tab.h, test/btyacc/err_syntax8a.output, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax8a.tab.h, test/btyacc/err_syntax9.output, test/btyacc/err_syntax9.tab.c, test/btyacc/err_syntax9.tab.h:
 	reference output for testing
 
-2014-03-24  Thomas E. Dickey  <tom@invisible-island.net>
+2014-03-24  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* defs.h: fix compiler warnings due to mputc()
 
@@ -790,7 +909,7 @@
 
 	* test/varsyntax_calc1.y, test/btyacc_calc1.y: testcase for btyacc
 
-2014-03-23  Thomas E. Dickey  <tom@invisible-island.net>
+2014-03-23  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/err_syntax26.error, test/err_syntax26.output, test/err_syntax26.tab.c, test/err_syntax26.tab.h, test/yacc/err_syntax26.error, test/yacc/err_syntax26.output, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax26.tab.h:
 	reference output for testing
@@ -812,7 +931,7 @@
 	* test/btyacc/quote_calc3-s.error, test/btyacc/quote_calc4-s.error, test/btyacc/quote_calc4.error, test/btyacc/grammar.dot, test/btyacc/grammar.error, test/btyacc/pure_calc.error, test/btyacc/pure_error.error, test/btyacc/quote_calc-s.error, test/btyacc/quote_calc.error, test/btyacc/quote_calc2-s.error, test/btyacc/quote_calc2.error, test/btyacc/quote_calc3.error, test/btyacc/err_syntax2.error, test/btyacc/err_syntax3.error, test/btyacc/err_syntax4.error, test/btyacc/err_syntax5.error, test/btyacc/err_syntax6.error, test/btyacc/err_syntax7.error, test/btyacc/err_syntax7a.error, test/btyacc/err_syntax7b.error, test/btyacc/err_syntax8.error, test/btyacc/err_syntax8a.error, test/btyacc/err_syntax9.error, test/btyacc/error.error, test/btyacc/calc1.error, test/btyacc/calc2.error, test/btyacc/calc3.error, test/btyacc/code_calc.error, test/btyacc/code_error.error, test/btyacc/empty.error, test/btyacc/err_syntax1.error, test/btyacc/btyacc_calc1.error, test/btyacc/btyacc_demo.error:
 	reference output for testing
 
-2014-03-23  Thomas E. Dickey  <tom@invisible-island.net>
+2014-03-23  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/err_syntax23.error, test/err_syntax23.output, test/err_syntax23.tab.c, test/err_syntax23.tab.h, test/yacc/err_syntax23.error, test/yacc/err_syntax23.output, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax23.tab.h:
 	reference output for testing
@@ -824,7 +943,7 @@
 	* test/run_test.sh:
 	move test-outputs into subdirectories to keep btyacc/yacc results separate
 
-2014-03-23  Thomas E. Dickey  <tom@invisible-island.net>
+2014-03-23  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/err_syntax22.error, test/err_syntax22.output, test/err_syntax22.tab.c, test/err_syntax22.tab.h, test/yacc/err_syntax22.error, test/yacc/err_syntax22.output, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax22.tab.h:
 	reference output for testing
@@ -853,7 +972,7 @@
 
 	* test/err_syntax17.y: testcase for unterminated_action()
 
-2014-03-22  Thomas E. Dickey  <tom@invisible-island.net>
+2014-03-22  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/err_syntax16.error, test/err_syntax16.output, test/err_syntax16.tab.c, test/err_syntax16.tab.h, test/yacc/err_syntax16.error, test/yacc/err_syntax16.output, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax16.tab.h:
 	reference output for testing
@@ -891,7 +1010,7 @@
 
 	* test/err_syntax10.y: testcase for retyped_warning()
 
-2014-03-21  Thomas E. Dickey  <tom@invisible-island.net>
+2014-03-21  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/err_syntax9.error, test/err_syntax9.output, test/err_syntax9.tab.c, test/err_syntax9.tab.h, test/yacc/err_syntax9.error, test/yacc/err_syntax9.output, test/yacc/err_syntax9.tab.c, test/yacc/err_syntax9.tab.h:
 	reference output for testing
@@ -1011,7 +1130,7 @@
 
 	* lalr.c: rename MAXSHORT to MAXYYINT
 
-2014-01-01  Thomas E. Dickey  <tom@invisible-island.net>
+2014-01-01  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* yacc.1: document %token-table, improve presentation of double-quotes
 
@@ -1035,7 +1154,7 @@
 	- add YYTRANSLATE() macro
 	- recognize bison's %token-table declaration
 
-2014-01-01  Thomas E. Dickey  <tom@invisible-island.net>
+2014-01-01  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* configure: regen
 
@@ -1047,19 +1166,19 @@
 
 	* configure.in: use CF_MAKE_DOCS
 
-2013-12-26  Thomas E. Dickey  <tom@invisible-island.net>
+2013-12-26  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.guess: 2013-11-29
 
-2013-11-19  Thomas E. Dickey  <tom@invisible-island.net>
+2013-11-19  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* aclocal.m4: resync with my-autoconf (fixes for clang and mingw)
 
-2013-10-25  Thomas E. Dickey  <tom@invisible-island.net>
+2013-10-25  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.sub: 2013-10-01
 
-2013-09-25  Thomas E. Dickey  <tom@invisible-island.net>
+2013-09-25  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* reader.c: fix two loop-limits found by clang 3.3 --analyze
 
@@ -1094,13 +1213,13 @@
 
 	* package/debian/changelog, VERSION, package/byacc.spec: bump
 
-2013-09-07  Thomas E. Dickey  <tom@invisible-island.net>
+2013-09-07  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.sub: update to 2013-09-15
 
 	* config.guess: update to 2013-06-10
 
-2013-03-04  Thomas E. Dickey  <tom@invisible-island.net>
+2013-03-04  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/debian/changelog, VERSION, package/byacc.spec: bump
 
@@ -1130,11 +1249,11 @@
 	* aclocal.m4:
 	another fix for CF_GCC_VERSION to handle Debian's modification of gcc message.
 
-2013-02-10  Thomas E. Dickey  <tom@invisible-island.net>
+2013-02-10  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.sub, config.guess: update to 2013-02-04
 
-2012-10-03  Thomas E. Dickey  <tom@invisible-island.net>
+2012-10-03  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/debian/changelog, package/byacc.spec, VERSION: bump
 
@@ -1156,7 +1275,7 @@
 	suggested patch: drop CF_ANSI_CC_REQD, CF_ANSI_CC_CHECK, CF_PROG_EXT since
 	they are not needed.
 
-2012-10-03  Thomas E. Dickey  <tom@invisible-island.net>
+2012-10-03  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* aclocal.m4:
 	split-out CF_CC_ENV_FLAGS from CF_ANSI_CC_CHECK to avoid losing it in
@@ -1190,13 +1309,13 @@
 		CF_MIXEDCASE_FILENAMES
 		CF_NO_LEAKS_OPTION
 
-2012-10-03  Thomas E. Dickey  <tom@invisible-island.net>
+2012-10-03  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* aclocal.m4:
 	move existence-check for mkstemp out of the AC_TRY_RUN, to help with
 	cross-compiles
 
-2012-10-02  Thomas E. Dickey  <tom@invisible-island.net>
+2012-10-02  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config_h.in:
 	Adrian Bunk request - replace this with the output from autoheader
@@ -1214,7 +1333,7 @@
 
 	* makefile.in: add assignment for datarootdir variable.
 
-2012-05-26  Thomas E. Dickey  <tom@invisible-island.net>
+2012-05-26  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/debian/changelog, package/byacc.spec, VERSION: bump
 
@@ -1242,13 +1361,13 @@
 	use TMALLOC() and TREALLOC() macros to simplify allocation/reallocation
 	(no object change)
 
-2012-05-25  Thomas E. Dickey  <tom@invisible-island.net>
+2012-05-25  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* output.c, main.c, verbose.c, mkpar.c, lr0.c:
 	use TMALLOC() and TREALLOC() macros to simplify allocation/reallocation
 	(no object change)
 
-2012-01-15  Thomas E. Dickey  <tom@invisible-island.net>
+2012-01-15  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/debian/copyright: bump
 
@@ -1353,7 +1472,7 @@
 	* test/quote_calc2-s.tab.c, test/quote_calc3-s.tab.c, test/quote_calc4-s.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2.tab.c, test/quote_calc3.tab.c, test/quote_calc4.tab.c:
 	regen
 
-2012-01-14  Thomas E. Dickey  <tom@invisible-island.net>
+2012-01-14  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/calc2.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/calc1.tab.c:
 	regen
@@ -1384,7 +1503,7 @@
 
 	* test/run_test.sh: generate/test with "-s" option applied.
 
-2012-01-13  Thomas E. Dickey  <tom@invisible-island.net>
+2012-01-13  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/debian/changelog, package/byacc.spec, VERSION: bump
 
@@ -1416,7 +1535,7 @@
 
 	* aclocal.m4: resync with my-autoconf, i.e., fixes for CF_XOPEN_SOURCE
 
-2011-12-19  Thomas E. Dickey  <tom@invisible-island.net>
+2011-12-19  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/debian/changelog, package/byacc.spec, VERSION: bump
 
@@ -1430,7 +1549,7 @@
 	Simply suppressing the second #define makes the behavior closer to yacc.
 	(report by Paulo Andrade).
 
-2011-09-08  Thomas E. Dickey  <tom@invisible-island.net>
+2011-09-08  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/debian/changelog, package/byacc.spec, VERSION: bump
 
@@ -1438,7 +1557,7 @@
 	fix some more interaction between -i and -d flags to ensure YYERRCODE
 	and YYSTYPE are declared, tested with cproto.
 
-2011-09-07  Thomas E. Dickey  <tom@invisible-island.net>
+2011-09-07  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* yacc.1: document "-i" option.
 
@@ -1452,14 +1571,14 @@
 
 	* skeleton.c, output.c, defs.h: changes to support "-i" option.
 
-2011-09-06  Thomas E. Dickey  <tom@invisible-island.net>
+2011-09-06  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* reader.c: pass explicit file-pointer to write_section()
 
 	* main.c:
 	add "-i" option, to generate interface-file (suggested by Denis M. Wilson)
 
-2011-09-05  Thomas E. Dickey  <tom@invisible-island.net>
+2011-09-05  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* configure: regen
 
@@ -1470,15 +1589,15 @@
 	* defs.h, error.c, reader.c:
 	add check for missing "}" on %parse-param and %lex-param lines (report by Denis M Wilson)
 
-2011-04-01  Thomas E. Dickey  <tom@invisible-island.net>
+2011-04-01  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.sub: update to 2011-04-01
 
-2011-02-02  Thomas E. Dickey  <tom@invisible-island.net>
+2011-02-02  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.guess: update to 2011-01-01
 
-2010-12-29  Thomas E. Dickey  <tom@invisible-island.net>
+2010-12-29  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* defs.h, skeleton.c:
 	add const qualifier to skeleton data, per NetBSD changes (report by Christos Zoulas)
@@ -1500,7 +1619,7 @@
 	* test/ftp.y:
 	improve example, which was stuck in 19XX and assumed file sizes were longs.
 
-2010-12-29  Thomas E. Dickey  <tom@invisible-island.net>
+2010-12-29  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c:
 	regen
@@ -1518,11 +1637,11 @@
 
 	* output.c: correct definition for YYERROR_DECL()
 
-2010-12-29  Thomas E. Dickey  <tom@invisible-island.net>
+2010-12-29  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/debian/changelog, package/byacc.spec, VERSION: bump
 
-2010-12-26  Thomas E. Dickey  <tom@invisible-island.net>
+2010-12-26  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* defs.h, main.c:
 	change return-type of allocate() to avoid warnings of alignment problems
@@ -1542,7 +1661,7 @@
 	* aclocal.m4:
 	improve quoting, deprecate ${name-value} in favor of standard ${name:-value}
 
-2010-12-25  Thomas E. Dickey  <tom@invisible-island.net>
+2010-12-25  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* main.c:
 	start revising use of tmpfile(), to make this work with MinGW.  Start by
@@ -1551,7 +1670,7 @@
 
 	* package/debian/changelog, package/byacc.spec, VERSION: bump
 
-2010-11-27  Thomas E. Dickey  <tom@invisible-island.net>
+2010-11-27  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/byacc.spec, package/debian/changelog, VERSION: bump
 
@@ -1561,7 +1680,7 @@
 	corrected use of %parse-param value in yyerror(); it doesn't use &yylval
 	(report by Clifford Yapp)
 
-2010-11-26  Thomas E. Dickey  <tom@invisible-island.net>
+2010-11-26  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* skeleton.c: typo
 
@@ -1612,7 +1731,7 @@
 
 	* package/debian/changelog, package/byacc.spec, VERSION: bump
 
-2010-11-24  Thomas E. Dickey  <tom@invisible-island.net>
+2010-11-24  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* main.c, defs.h, symtab.c, error.c: reduce global variables
 
@@ -1622,7 +1741,7 @@
 	amend fix for Redhat #112617 to still call default_action_warning() for
 	empty rules (report by Bruce Cran).
 
-2010-11-22  Thomas E. Dickey  <tom@invisible-island.net>
+2010-11-22  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* output.c:
 	add ifdef to guard against redefinition of YYSTYPE union (request by Clifford Yapp).
@@ -1654,20 +1773,20 @@
 
 	* package/debian/changelog, package/byacc.spec, VERSION: bump
 
-2010-09-28  Thomas E. Dickey  <tom@invisible-island.net>
+2010-09-28  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.guess: update to 2010-09-24
 
-2010-09-10  Thomas E. Dickey  <tom@invisible-island.net>
+2010-09-10  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.sub: update to 2010-09-11
 
-2010-06-10  Thomas E. Dickey  <tom@invisible-island.net>
+2010-06-10  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* yacc.1, package/debian/changelog, package/byacc.spec, VERSION:
 	bump to 2010/06/10
 
-2010-06-09  Thomas E. Dickey  <tom@invisible-island.net>
+2010-06-09  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* reader.c: free declarations in leak-testing code.
 
@@ -1710,7 +1829,7 @@
 	* test/ftp.tab.c, test/ftp.y, reader.c, symtab.c, verbose.c, lr0.c, main.c, mkpar.c, output.c, defs.h, closure.c:
 	fix warnings from clang --analyze
 
-2010-06-08  Thomas E. Dickey  <tom@invisible-island.net>
+2010-06-08  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* output.c: fix to build with c89, etc.
 
@@ -1742,7 +1861,7 @@
 	add check_make and check_lint rules to help validate the generated files
 	in the test-directory
 
-2010-06-07  Thomas E. Dickey  <tom@invisible-island.net>
+2010-06-07  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/pure_calc.tab.c, test/pure_error.tab.c: RCS_BASE
 
@@ -1807,11 +1926,11 @@
 	anyway.  This allows for better compatibility with yacc sources written
 	for bison.
 
-2010-06-07  Thomas E. Dickey  <tom@invisible-island.net>
+2010-06-07  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* VERSION: bump to 2010/06/07
 
-2010-06-06  Thomas E. Dickey  <tom@invisible-island.net>
+2010-06-06  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/calc.tab.c, configure: regen
 
@@ -1862,12 +1981,12 @@
 		c) CF_GCC_VERSION, ignore stderr
 		d) CF_GCC_WARNINGS, adjust options to work with c89 wrapper of gcc
 
-2010-04-20  Thomas E. Dickey  <tom@invisible-island.net>
+2010-04-20  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/debian/changelog, package/debian/compat, package/debian/control, package/debian/copyright, package/debian/docs, package/debian/postinst, package/debian/prerm, package/debian/rules, package/debian/watch:
 	scripts from Debian package
 
-2010-02-16  Thomas E. Dickey  <tom@invisible-island.net>
+2010-02-16  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* yacc.1: document -P and bison-extensions
 
@@ -1919,24 +2038,24 @@
 
 	* skeleton.c: fix a memory leak in the generated skeleton
 
-2010-01-01  Thomas E. Dickey  <tom@invisible-island.net>
+2010-01-01  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/debian/source/format: scripts from Debian package
 
-2009-12-31  Thomas E. Dickey  <tom@invisible-island.net>
+2009-12-31  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.guess: update to 2009-12-30
 
 	* config.sub: update to 2009-12-31
 
-2009-10-27  Thomas E. Dickey  <tom@invisible-island.net>
+2009-10-27  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* VERSION: 20091027
 
 	* output.c, mkpar.c, defs.h, lalr.c, closure.c, graph.c, lr0.c, verbose.c, main.c, reader.c:
 	strict compiler warnings
 
-2009-10-26  Thomas E. Dickey  <tom@invisible-island.net>
+2009-10-26  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/error.tab.c:
 	resync
@@ -1951,44 +2070,44 @@
 
 	* aclocal.m4: resync with my-autoconf
 
-2009-08-25  Thomas E. Dickey  <tom@invisible-island.net>
+2009-08-25  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.guess, config.sub: update to 2009-08-19
 
-2009-02-21  Thomas E. Dickey  <tom@invisible-island.net>
+2009-02-21  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* VERSION: bump
 
 	* output.c: restore "yylval" symbol, omitted in cleanup on 2008/8/25
 
-2008-12-26  Thomas E. Dickey  <tom@invisible-island.net>
+2008-12-26  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* configure: regen with autoconf-2.52 (patched)
 
-2008-12-25  Thomas E. Dickey  <tom@invisible-island.net>
+2008-12-25  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c:
 	regenerated
 
-2008-12-24  Thomas E. Dickey  <tom@invisible-island.net>
+2008-12-24  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* VERSION: bump
 
 	* skeleton.c:
 	remove ifdef-lint from goto yyerrlab, to quiet gcc warning
 
-2008-11-26  Thomas E. Dickey  <tom@invisible-island.net>
+2008-11-26  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* verbose.c, main.c, defs.h, mkpar.c, reader.c:
 	completed implementation of "%expect" (report by Perry E. Metzger).
 	add "%expect-rr", which is (unlike bison) allowable in LALR parsers.
 
-2008-11-24  Thomas E. Dickey  <tom@invisible-island.net>
+2008-11-24  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* closure.c, defs.h, error.c, graph.c, lalr.c, lr0.c, main.c, mkpar.c, output.c, reader.c, skeleton.c, symtab.c, verbose.c, warshall.c:
 	change indent-style (request by Perry E. Metzger)
 
-2008-08-27  Thomas E. Dickey  <tom@invisible-island.net>
+2008-08-27  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c:
 	better implementation of YYPARSE_PARAM, using YYPARSE_DECL() macro
@@ -2027,12 +2146,12 @@
 	* test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c:
 	remove 'register' keywords
 
-2008-08-26  Thomas E. Dickey  <tom@invisible-island.net>
+2008-08-26  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* warshall.c, verbose.c, symtab.c, skeleton.c, reader.c, output.c, mkpar.c, main.c, lr0.c, lalr.c, graph.c, error.c, closure.c:
 	remove 'register' keywords
 
-2008-08-25  Thomas E. Dickey  <tom@invisible-island.net>
+2008-08-25  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* test/ftp.tab.c: regen'd
 
@@ -2072,7 +2191,7 @@
 
 	* makefile.in: add dependency on VERSION file.
 
-2008-08-24  Thomas E. Dickey  <tom@invisible-island.net>
+2008-08-24  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* VERSION: bump
 
@@ -2090,18 +2209,18 @@
 
 	* aclocal.m4: resync with my-autoconf (no major changes)
 
-2008-07-24  Thomas E. Dickey  <tom@invisible-island.net>
+2008-07-24  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* package/pkgsrc/Makefile, package/pkgsrc/distinfo:
 	scripts from NetBSD pkgsrc, for test-builds
 
-2008-03-14  Thomas E. Dickey  <tom@invisible-island.net>
+2008-03-14  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.sub: update to 2008-03-08
 
 	* config.guess: update to 2008-03-12
 
-2007-05-09  Thomas E. Dickey  <tom@invisible-island.net>
+2007-05-09  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* main.c: close graph, verbose files if opened, on exit.
 
@@ -2128,19 +2247,19 @@
 
 	* main.c: file_prefix did not always have a trailing null.
 
-2007-03-25  Thomas E. Dickey  <tom@invisible-island.net>
+2007-03-25  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* mkdirs.sh: improved version for "make -j"
 
-2006-12-22  Thomas E. Dickey  <tom@invisible-island.net>
+2006-12-22  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.guess: update to 2006/12/22
 
-2006-12-08  Thomas E. Dickey  <tom@invisible-island.net>
+2006-12-08  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* config.sub: update to 2006/12/08
 
-2005-08-13  Thomas E. Dickey  <tom@invisible-island.net>
+2005-08-13  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* main.c: add -V to usage message
 
@@ -2159,23 +2278,23 @@
 	Debian #322858 (don't close union_file, which contained data).
 	This feature is used in groff.
 
-2005-08-13  Thomas E. Dickey  <tom@invisible-island.net>
+2005-08-13  Thomas E. Dickey  <dickey@invisible-island.net>
 
 	* configure: regenerated
 
 	* aclocal.m4: improve checks for Intel compiler warnings

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

From owner-svn-src-all@freebsd.org  Tue Dec 13 22:20:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC17FC769AC;
 Tue, 13 Dec 2016 22:20:33 +0000 (UTC) (envelope-from devin@shxd.cx)
Received: from shxd.cx (mail.shxd.cx [64.201.244.140])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9C94DCFC;
 Tue, 13 Dec 2016 22:20:33 +0000 (UTC) (envelope-from devin@shxd.cx)
Received: from [64.201.244.132] (port=59017 helo=[10.0.0.102])
 by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD))
 (envelope-from <devin@shxd.cx>)
 id 1cGuSw-000Cfb-96; Tue, 13 Dec 2016 21:18:26 +0000
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
Subject: Re: svn commit: r309918 - head/usr.sbin/bsdinstall/scripts
From: Devin Teske <dteske@freebsd.org>
In-Reply-To: <20161213212435.GA34587@stack.nl>
Date: Tue, 13 Dec 2016 14:20:31 -0800
Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org, Devin Teske <dteske@FreeBSD.org>
Message-Id: <751FBC9A-2072-4CB0-8318-7F551BD8EB28@freebsd.org>
References: <201612121848.uBCIm00M073404@repo.freebsd.org>
 <20161213212435.GA34587@stack.nl>
To: Jilles Tjoelker <jilles@stack.nl>
X-Mailer: Apple Mail (2.2104)
Sender: devin@shxd.cx
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.23
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 22:20:33 -0000


> On Dec 13, 2016, at 1:24 PM, Jilles Tjoelker <jilles@stack.nl> wrote:
>=20
> On Mon, Dec 12, 2016 at 06:48:00PM +0000, Devin Teske wrote:
>> Author: dteske
>> Date: Mon Dec 12 18:48:00 2016
>> New Revision: 309918
>> URL: https://svnweb.freebsd.org/changeset/base/309918 =
<https://svnweb.freebsd.org/changeset/base/309918>
>=20
>> Log:
>>  Remove unnecessary `-n' parameter to head/tail
>=20
> These -n options are not completely unnecessary since POSIX removed =
the
> obsolete forms without -n years ago, and some minimalistic
> implementations (Busybox) followed suit. Therefore, although I use the
> obsolete forms frequently interactively, I think head/tail -n should =
be
> the preferred form in scripts.
>=20
> The obsolete form tail +N (where N is a number) should definitely be
> avoided since it conflicts with a file named like that; head -N and =
tail
> -N are valid extensions to the standard.
>=20

Thanks for keeping me abreast of the POSIX changes.

I'll make the applicable change right now and should I see any other =
instances, tackle those in the future as well.
--=20
Cheers,
Devin



>> Modified:
>>  head/usr.sbin/bsdinstall/scripts/wlanconfig
>>=20
>> Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=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/wlanconfig	Mon Dec 12 =
18:45:52 2016	(r309917)
>> +++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 =
18:48:00 2016	(r309918)
>> @@ -175,8 +175,8 @@ fi
>> #
>> if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
>> 	# Get current country/regdomain for selected interface
>> -	WLAN_IFACE=3D$( wpa_cli ifname | tail -n 1 )
>> -	INPUT=3D$( ifconfig $WLAN_IFACE list regdomain | head -n 1 )
>> +	WLAN_IFACE=3D$( wpa_cli ifname | tail -1 )
>> +	INPUT=3D$( ifconfig $WLAN_IFACE list regdomain | head -1 )
>> 	DEF_REGDOMAIN=3D$( echo $INPUT | cut -w -f 2 )
>> 	DEF_COUNTRY=3D$( echo $INPUT | cut -w -f 4 )
>> 	[ "$DEF_REGDOMAIN" =3D 0 ] && DEF_REGDOMAIN=3D"<not selected>"
>=20
> --=20
> Jilles Tjoelker


From owner-svn-src-all@freebsd.org  Tue Dec 13 22:30:49 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E264C76E41;
 Tue, 13 Dec 2016 22:30:49 +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 68C8A136B;
 Tue, 13 Dec 2016 22:30:49 +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 uBDMUmQl060222;
 Tue, 13 Dec 2016 22:30:48 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDMUm1H060220;
 Tue, 13 Dec 2016 22:30:48 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201612132230.uBDMUm1H060220@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin <jhb@FreeBSD.org>
Date: Tue, 13 Dec 2016 22:30:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310037 - head/sys/mips/mips
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 22:30:49 -0000

Author: jhb
Date: Tue Dec 13 22:30:48 2016
New Revision: 310037
URL: https://svnweb.freebsd.org/changeset/base/310037

Log:
  Fix stack traces in DDB for the debugger thread.
  
  When the kernel debugger is entered, makectx() is called to store
  appropriate state from the trapframe for the debugger into a global
  kdb_pcb used as the thread context of the thread entering the
  debugger.  Stack unwinders for DDB called via db_trace_thread() are
  supposed to then use this saved context so that the stack trace for
  the current thread starts at the location of the event that triggered
  debugger entry.
  
  MIPS was instead starting the stack trace of the current thread from
  the context of db_trace_thread itself and unwinding back out through
  the debugger to the original frame.  Fix a couple of things to bring
  MIPS inline with other platforms:
  - Fix makectx() to store the PC, SP, and RA in the right portion of
    the PCB used by db_trace_thread().
  - Fix db_trace_thread() to always use kdb_thr_ctx() (and thus kdb_pcb
    for the debugger thread).
  - Move the logic for tracing curthread from within the current
    function into db_trace_self() to match other architectures.
  
  Sponsored by:	DARPA / AFRL

Modified:
  head/sys/mips/mips/db_trace.c
  head/sys/mips/mips/pm_machdep.c

Modified: head/sys/mips/mips/db_trace.c
==============================================================================
--- head/sys/mips/mips/db_trace.c	Tue Dec 13 22:16:02 2016	(r310036)
+++ head/sys/mips/mips/db_trace.c	Tue Dec 13 22:30:48 2016	(r310037)
@@ -432,7 +432,20 @@ db_md_list_watchpoints()
 void
 db_trace_self(void)
 {
-	db_trace_thread (curthread, -1);
+	register_t pc, ra, sp;
+
+	sp = (register_t)(intptr_t)__builtin_frame_address(0);
+	ra = (register_t)(intptr_t)__builtin_return_address(0);
+
+	__asm __volatile(
+		"jal 99f\n"
+		"nop\n"
+		"99:\n"
+		 "move %0, $31\n" /* get ra */
+		 "move $31, %1\n" /* restore ra */
+		 : "=r" (pc)
+		 : "r" (ra));
+	stacktrace_subr(pc, sp, ra, db_printf);
 	return;
 }
 
@@ -442,28 +455,11 @@ db_trace_thread(struct thread *thr, int 
 	register_t pc, ra, sp;
 	struct pcb *ctx;
 
-	if (thr == curthread) {
-		sp = (register_t)(intptr_t)__builtin_frame_address(0);
-		ra = (register_t)(intptr_t)__builtin_return_address(0);
-
-        	__asm __volatile(
-			"jal 99f\n"
-			"nop\n"
-			"99:\n"
-                         "move %0, $31\n" /* get ra */
-                         "move $31, %1\n" /* restore ra */
-                         : "=r" (pc)
-			 : "r" (ra));
-
-	} else {
-		ctx = kdb_thr_ctx(thr);
-		sp = (register_t)ctx->pcb_context[PCB_REG_SP];
-		pc = (register_t)ctx->pcb_context[PCB_REG_PC];
-		ra = (register_t)ctx->pcb_context[PCB_REG_RA];
-	}
-
-	stacktrace_subr(pc, sp, ra,
-	    (int (*) (const char *, ...))db_printf);
+	ctx = kdb_thr_ctx(thr);
+	sp = (register_t)ctx->pcb_context[PCB_REG_SP];
+	pc = (register_t)ctx->pcb_context[PCB_REG_PC];
+	ra = (register_t)ctx->pcb_context[PCB_REG_RA];
+	stacktrace_subr(pc, sp, ra, db_printf);
 
 	return (0);
 }

Modified: head/sys/mips/mips/pm_machdep.c
==============================================================================
--- head/sys/mips/mips/pm_machdep.c	Tue Dec 13 22:16:02 2016	(r310036)
+++ head/sys/mips/mips/pm_machdep.c	Tue Dec 13 22:30:48 2016	(r310037)
@@ -292,9 +292,9 @@ void
 makectx(struct trapframe *tf, struct pcb *pcb)
 {
 
-	pcb->pcb_regs.ra = tf->ra;
-	pcb->pcb_regs.pc = tf->pc;
-	pcb->pcb_regs.sp = tf->sp;
+	pcb->pcb_context[PCB_REG_RA] = tf->ra;
+	pcb->pcb_context[PCB_REG_PC] = tf->pc;
+	pcb->pcb_context[PCB_REG_SP] = tf->sp;
 }
 
 int

From owner-svn-src-all@freebsd.org  Tue Dec 13 22:31:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72ADFC76FB5;
 Tue, 13 Dec 2016 22:31:50 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 42627171E;
 Tue, 13 Dec 2016 22:31:50 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDMVn6h061889;
 Tue, 13 Dec 2016 22:31:49 GMT (envelope-from dteske@FreeBSD.org)
Received: (from dteske@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDMVnHc061888;
 Tue, 13 Dec 2016 22:31:49 GMT (envelope-from dteske@FreeBSD.org)
Message-Id: <201612132231.uBDMVnHc061888@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dteske set sender to
 dteske@FreeBSD.org using -f
From: Devin Teske <dteske@FreeBSD.org>
Date: Tue, 13 Dec 2016 22:31:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310038 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 22:31:50 -0000

Author: dteske
Date: Tue Dec 13 22:31:49 2016
New Revision: 310038
URL: https://svnweb.freebsd.org/changeset/base/310038

Log:
  Revert r309918 -- modern POSIX has deprecated -<#>/+<#> syntax
  
  Special thanks to:	jilles

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 22:30:48 2016	(r310037)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 22:31:49 2016	(r310038)
@@ -185,8 +185,8 @@ fi
 #
 if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	# Get current country/regdomain for selected interface
-	WLAN_IFACE=$( wpa_cli ifname | tail -1 )
-	INPUT=$( ifconfig "$WLAN_IFACE" list regdomain | head -1 )
+	WLAN_IFACE=$( wpa_cli ifname | tail -n 1 )
+	INPUT=$( ifconfig "$WLAN_IFACE" list regdomain | head -n 1 )
 	DEF_REGDOMAIN=$( echo "$INPUT" | cut -w -f 2 )
 	DEF_COUNTRY=$( echo "$INPUT" | cut -w -f 4 )
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"

From owner-svn-src-all@freebsd.org  Tue Dec 13 23:09:23 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C23F6C7680C;
 Tue, 13 Dec 2016 23:09:23 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 847F2A5D;
 Tue, 13 Dec 2016 23:09:23 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDN9MaP076553;
 Tue, 13 Dec 2016 23:09:22 GMT (envelope-from vangyzen@FreeBSD.org)
Received: (from vangyzen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDN9M36076551;
 Tue, 13 Dec 2016 23:09:22 GMT (envelope-from vangyzen@FreeBSD.org)
Message-Id: <201612132309.uBDN9M36076551@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
 vangyzen@FreeBSD.org using -f
From: Eric van Gyzen <vangyzen@FreeBSD.org>
Date: Tue, 13 Dec 2016 23:09:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310040 - stable/11/usr.bin/locale
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 23:09:23 -0000

Author: vangyzen
Date: Tue Dec 13 23:09:22 2016
New Revision: 310040
URL: https://svnweb.freebsd.org/changeset/base/310040

Log:
  MFC r309364 r309367 r309624
  
  locale: fix buffer management
  
  Also, handle signed and unsigned chars, and more gracefully handle
  invalid input.
  
  locale: enable more warnings; fix them
  
  Do not set WARNS, so it gets the current default of 6.
  Fix the warnings by sprinkling static, const, or strdup.
  Make some constant data tables const.  Fix whitespace.
  
  Sponsored by:	Dell EMC

Modified:
  stable/11/usr.bin/locale/Makefile
  stable/11/usr.bin/locale/locale.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/locale/Makefile
==============================================================================
--- stable/11/usr.bin/locale/Makefile	Tue Dec 13 22:40:09 2016	(r310039)
+++ stable/11/usr.bin/locale/Makefile	Tue Dec 13 23:09:22 2016	(r310040)
@@ -1,7 +1,6 @@
 # $FreeBSD$
 
 PROG=	locale
-WARNS?=	3
 CFLAGS+= -I${.CURDIR}/../../lib/libc/locale
 
 .include <bsd.prog.mk>

Modified: stable/11/usr.bin/locale/locale.c
==============================================================================
--- stable/11/usr.bin/locale/locale.c	Tue Dec 13 22:40:09 2016	(r310039)
+++ stable/11/usr.bin/locale/locale.c	Tue Dec 13 23:09:22 2016	(r310040)
@@ -57,8 +57,8 @@ void	list_charmaps(void);
 void	list_locales(void);
 const char *lookup_localecat(int);
 char	*kwval_lconv(int);
-int	kwval_lookup(char *, char **, int *, int *);
-void	showdetails(char *);
+int	kwval_lookup(const char *, char **, int *, int *);
+void	showdetails(const char *);
 void	showkeywordslist(char *substring);
 void	showlocale(void);
 void	usage(void);
@@ -66,13 +66,12 @@ void	usage(void);
 /* Global variables */
 static StringList *locales = NULL;
 
-int	all_locales = 0;
-int	all_charmaps = 0;
-int	prt_categories = 0;
-int	prt_keywords = 0;
-int	more_params = 0;
+static int	all_locales = 0;
+static int	all_charmaps = 0;
+static int	prt_categories = 0;
+static int	prt_keywords = 0;
 
-struct _lcinfo {
+static const struct _lcinfo {
 	const char	*name;
 	int		id;
 } lcinfo [] = {
@@ -110,7 +109,7 @@ struct _lcinfo {
 #define	KW_INT_P_SIGN_POSN	(KW_ZERO+21)
 #define	KW_INT_N_SIGN_POSN	(KW_ZERO+22)
 
-struct _kwinfo {
+static const struct _kwinfo {
 	const char	*name;
 	int		isstr;		/* true - string, false - number */
 	int		catid;		/* LC_* */
@@ -224,7 +223,7 @@ struct _kwinfo {
 };
 #define	NKWINFO (nitems(kwinfo))
 
-const char *boguslocales[] = { "UTF-8" };
+static const char *boguslocales[] = { "UTF-8" };
 #define	NBOGUS	(nitems(boguslocales))
 
 int
@@ -296,7 +295,7 @@ main(int argc, char *argv[])
 		} else {
 			uint i;
 			for (i = 0; i < nitems(kwinfo); i++)
-				showdetails ((char *)kwinfo [i].name);
+				showdetails(kwinfo[i].name);
 		}
 		exit(0);
 	}
@@ -341,7 +340,7 @@ list_locales(void)
 static int
 scmp(const void *s1, const void *s2)
 {
-	return strcmp(*(const char **)s1, *(const char **)s2);
+	return strcmp(*(const char * const *)s1, *(const char * const *)s2);
 }
 
 /*
@@ -378,7 +377,7 @@ list_charmaps(void)
 
 	/* add US-ASCII, if not yet added */
 	if (sl_find(charmaps, "US-ASCII") == NULL)
-		sl_add(charmaps, "US-ASCII");
+		sl_add(charmaps, strdup("US-ASCII"));
 
 	/* sort the list */
 	qsort(charmaps->sl_str, charmaps->sl_cur, sizeof(char *), scmp);
@@ -437,10 +436,10 @@ init_locales_list(void)
 	 * we also list 'C' for constistency
 	 */
 	if (sl_find(locales, "POSIX") == NULL)
-		sl_add(locales, "POSIX");
+		sl_add(locales, strdup("POSIX"));
 
 	if (sl_find(locales, "C") == NULL)
-		sl_add(locales, "C");
+		sl_add(locales, strdup("C"));
 
 	/* make output nicer, sort the list */
 	qsort(locales->sl_str, locales->sl_cur, sizeof(char *), scmp);
@@ -495,29 +494,31 @@ format_grouping(const char *binary)
 {
 	static char rval[64];
 	const char *cp;
-	size_t len;
+	size_t roff;
+	int len;
 
 	rval[0] = '\0';
+	roff = 0;
 	for (cp = binary; *cp != '\0'; ++cp) {
-		char group[sizeof("127;")];
-		snprintf(group, sizeof(group), "%hhd;", *cp);
-		len = strlcat(rval, group, sizeof(rval));
-		if (len >= sizeof(rval)) {
-			len = sizeof(rval) - 1;
-			break;
-		}
-		if (*cp == CHAR_MAX) {
-			break;
-		}
-	}
-
-	/* Remove the trailing ';'. */
-	rval[len - 1] = '\0';
+#if CHAR_MIN != 0
+		if (*cp < 0)
+			break;		/* garbage input */
+#endif
+		len = snprintf(&rval[roff], sizeof(rval) - roff, "%u;", *cp);
+		if (len < 0 || (unsigned)len >= sizeof(rval) - roff)
+			break;		/* insufficient space for output */
+		roff += len;
+		if (*cp == CHAR_MAX)
+			break;		/* special termination */
+	}
+
+	/* Truncate at the last successfully snprintf()ed semicolon. */
+	if (roff != 0)
+		rval[roff - 1] = '\0';
 
-	return (rval);
+	return (&rval[0]);
 }
 
-
 /*
  * keyword value lookup helper (via localeconv())
  */
@@ -606,7 +607,7 @@ kwval_lconv(int id)
  * keyword value and properties lookup
  */
 int
-kwval_lookup(char *kwname, char **kwval, int *cat, int *isstr)
+kwval_lookup(const char *kwname, char **kwval, int *cat, int *isstr)
 {
 	int	rval;
 	size_t	i;
@@ -634,7 +635,7 @@ kwval_lookup(char *kwname, char **kwval,
  * command line options specified.
  */
 void
-showdetails(char *kw)
+showdetails(const char *kw)
 {
 	int	isstr, cat, tmpval;
 	char	*kwval;
@@ -649,9 +650,9 @@ showdetails(char *kw)
 	}
 
 	if (prt_categories) {
-		  if (prt_keywords)
+		if (prt_keywords)
 			printf("%-20s ", lookup_localecat(cat));
-		  else
+		else
 			printf("%-20s\t%s\n", kw, lookup_localecat(cat));
 	}
 

From owner-svn-src-all@freebsd.org  Tue Dec 13 23:10:37 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DD81C768A3;
 Tue, 13 Dec 2016 23:10:37 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DCC17CBE;
 Tue, 13 Dec 2016 23:10:36 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDNAarc076655;
 Tue, 13 Dec 2016 23:10:36 GMT (envelope-from vangyzen@FreeBSD.org)
Received: (from vangyzen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDNAZVL076653;
 Tue, 13 Dec 2016 23:10:35 GMT (envelope-from vangyzen@FreeBSD.org)
Message-Id: <201612132310.uBDNAZVL076653@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
 vangyzen@FreeBSD.org using -f
From: Eric van Gyzen <vangyzen@FreeBSD.org>
Date: Tue, 13 Dec 2016 23:10:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310041 - stable/10/usr.bin/locale
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 23:10:37 -0000

Author: vangyzen
Date: Tue Dec 13 23:10:35 2016
New Revision: 310041
URL: https://svnweb.freebsd.org/changeset/base/310041

Log:
  MFC r309364 r309367 r309624
  
  locale: fix buffer management
  
  Also, handle signed and unsigned chars, and more gracefully handle
  invalid input.
  
  locale: enable more warnings; fix them
  
  Do not set WARNS, so it gets the current default of 6.
  Fix the warnings by sprinkling static, const, or strdup.
  Make some constant data tables const.  Fix whitespace.
  
  Sponsored by:	Dell EMC

Modified:
  stable/10/usr.bin/locale/Makefile
  stable/10/usr.bin/locale/locale.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/locale/Makefile
==============================================================================
--- stable/10/usr.bin/locale/Makefile	Tue Dec 13 23:09:22 2016	(r310040)
+++ stable/10/usr.bin/locale/Makefile	Tue Dec 13 23:10:35 2016	(r310041)
@@ -1,7 +1,6 @@
 # $FreeBSD$
 
 PROG=	locale
-WARNS?=	3
 CFLAGS+= -I${.CURDIR}/../../lib/libc/locale
 
 .include <bsd.prog.mk>

Modified: stable/10/usr.bin/locale/locale.c
==============================================================================
--- stable/10/usr.bin/locale/locale.c	Tue Dec 13 23:09:22 2016	(r310040)
+++ stable/10/usr.bin/locale/locale.c	Tue Dec 13 23:10:35 2016	(r310041)
@@ -55,8 +55,8 @@ void	list_charmaps(void);
 void	list_locales(void);
 const char *lookup_localecat(int);
 char	*kwval_lconv(int);
-int	kwval_lookup(char *, char **, int *, int *);
-void	showdetails(char *);
+int	kwval_lookup(const char *, char **, int *, int *);
+void	showdetails(const char *);
 void	showkeywordslist(char *substring);
 void	showlocale(void);
 void	usage(void);
@@ -64,13 +64,12 @@ void	usage(void);
 /* Global variables */
 static StringList *locales = NULL;
 
-int	all_locales = 0;
-int	all_charmaps = 0;
-int	prt_categories = 0;
-int	prt_keywords = 0;
-int	more_params = 0;
+static int	all_locales = 0;
+static int	all_charmaps = 0;
+static int	prt_categories = 0;
+static int	prt_keywords = 0;
 
-struct _lcinfo {
+static const struct _lcinfo {
 	const char	*name;
 	int		id;
 } lcinfo [] = {
@@ -108,7 +107,7 @@ struct _lcinfo {
 #define	KW_INT_P_SIGN_POSN	(KW_ZERO+21)
 #define	KW_INT_N_SIGN_POSN	(KW_ZERO+22)
 
-struct _kwinfo {
+static const struct _kwinfo {
 	const char	*name;
 	int		isstr;		/* true - string, false - number */
 	int		catid;		/* LC_* */
@@ -222,7 +221,7 @@ struct _kwinfo {
 };
 #define	NKWINFO (sizeof(kwinfo)/sizeof(kwinfo[0]))
 
-const char *boguslocales[] = { "UTF-8" };
+static const char *boguslocales[] = { "UTF-8" };
 #define	NBOGUS	(sizeof(boguslocales)/sizeof(boguslocales[0]))
 
 int
@@ -294,7 +293,7 @@ main(int argc, char *argv[])
 		} else {
 			uint i;
 			for (i = 0; i < sizeof (kwinfo) / sizeof (struct _kwinfo); i++)
-				showdetails ((char *)kwinfo [i].name);
+				showdetails(kwinfo[i].name);
 		}
 		exit(0);
 	}
@@ -339,7 +338,7 @@ list_locales(void)
 static int
 scmp(const void *s1, const void *s2)
 {
-	return strcmp(*(const char **)s1, *(const char **)s2);
+	return strcmp(*(const char * const *)s1, *(const char * const *)s2);
 }
 
 /*
@@ -376,7 +375,7 @@ list_charmaps(void)
 
 	/* add US-ASCII, if not yet added */
 	if (sl_find(charmaps, "US-ASCII") == NULL)
-		sl_add(charmaps, "US-ASCII");
+		sl_add(charmaps, strdup("US-ASCII"));
 
 	/* sort the list */
 	qsort(charmaps->sl_str, charmaps->sl_cur, sizeof(char *), scmp);
@@ -435,10 +434,10 @@ init_locales_list(void)
 	 * we also list 'C' for constistency
 	 */
 	if (sl_find(locales, "POSIX") == NULL)
-		sl_add(locales, "POSIX");
+		sl_add(locales, strdup("POSIX"));
 
 	if (sl_find(locales, "C") == NULL)
-		sl_add(locales, "C");
+		sl_add(locales, strdup("C"));
 
 	/* make output nicer, sort the list */
 	qsort(locales->sl_str, locales->sl_cur, sizeof(char *), scmp);
@@ -493,29 +492,31 @@ format_grouping(const char *binary)
 {
 	static char rval[64];
 	const char *cp;
-	size_t len;
+	size_t roff;
+	int len;
 
 	rval[0] = '\0';
+	roff = 0;
 	for (cp = binary; *cp != '\0'; ++cp) {
-		char group[sizeof("127;")];
-		snprintf(group, sizeof(group), "%hhd;", *cp);
-		len = strlcat(rval, group, sizeof(rval));
-		if (len >= sizeof(rval)) {
-			len = sizeof(rval) - 1;
-			break;
-		}
-		if (*cp == CHAR_MAX) {
-			break;
-		}
-	}
-
-	/* Remove the trailing ';'. */
-	rval[len - 1] = '\0';
+#if CHAR_MIN != 0
+		if (*cp < 0)
+			break;		/* garbage input */
+#endif
+		len = snprintf(&rval[roff], sizeof(rval) - roff, "%u;", *cp);
+		if (len < 0 || (unsigned)len >= sizeof(rval) - roff)
+			break;		/* insufficient space for output */
+		roff += len;
+		if (*cp == CHAR_MAX)
+			break;		/* special termination */
+	}
+
+	/* Truncate at the last successfully snprintf()ed semicolon. */
+	if (roff != 0)
+		rval[roff - 1] = '\0';
 
-	return (rval);
+	return (&rval[0]);
 }
 
-
 /*
  * keyword value lookup helper (via localeconv())
  */
@@ -604,7 +605,7 @@ kwval_lconv(int id)
  * keyword value and properties lookup
  */
 int
-kwval_lookup(char *kwname, char **kwval, int *cat, int *isstr)
+kwval_lookup(const char *kwname, char **kwval, int *cat, int *isstr)
 {
 	int	rval;
 	size_t	i;
@@ -632,7 +633,7 @@ kwval_lookup(char *kwname, char **kwval,
  * command line options specified.
  */
 void
-showdetails(char *kw)
+showdetails(const char *kw)
 {
 	int	isstr, cat, tmpval;
 	char	*kwval;
@@ -647,9 +648,9 @@ showdetails(char *kw)
 	}
 
 	if (prt_categories) {
-		  if (prt_keywords)
+		if (prt_keywords)
 			printf("%-20s ", lookup_localecat(cat));
-		  else
+		else
 			printf("%-20s\t%s\n", kw, lookup_localecat(cat));
 	}
 

From owner-svn-src-all@freebsd.org  Tue Dec 13 23:13:00 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D61A0C76AF4;
 Tue, 13 Dec 2016 23:13:00 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 96D881105;
 Tue, 13 Dec 2016 23:13:00 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDNCxMT080607;
 Tue, 13 Dec 2016 23:12:59 GMT (envelope-from vangyzen@FreeBSD.org)
Received: (from vangyzen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDNCxuA080606;
 Tue, 13 Dec 2016 23:12:59 GMT (envelope-from vangyzen@FreeBSD.org)
Message-Id: <201612132312.uBDNCxuA080606@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
 vangyzen@FreeBSD.org using -f
From: Eric van Gyzen <vangyzen@FreeBSD.org>
Date: Tue, 13 Dec 2016 23:12:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310042 - stable/11/sbin/rcorder
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 23:13:00 -0000

Author: vangyzen
Date: Tue Dec 13 23:12:59 2016
New Revision: 310042
URL: https://svnweb.freebsd.org/changeset/base/310042

Log:
  MFC r309625
  
  This is imported from NetBSD.  The author--Joerg Sonnenberger--agreed
  to apply a two-clause BSD license, just so the license was clear.
  
  This source tree location matches NetBSD, and is the first place someone
  might look for such a tool.
  
  Obtained from:	Joerg Sonnenberger via NetBSD
  Sponsored by:	Dell EMC

Added:
  stable/11/sbin/rcorder/rcorder-visualize.sh
     - copied unchanged from r309625, head/sbin/rcorder/rcorder-visualize.sh
Modified:
Directory Properties:
  stable/11/   (props changed)

Copied: stable/11/sbin/rcorder/rcorder-visualize.sh (from r309625, head/sbin/rcorder/rcorder-visualize.sh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/11/sbin/rcorder/rcorder-visualize.sh	Tue Dec 13 23:12:59 2016	(r310042, copy of r309625, head/sbin/rcorder/rcorder-visualize.sh)
@@ -0,0 +1,52 @@
+#!/bin/sh
+# $NetBSD: rcorder-visualize.sh,v 1.5 2009/08/09 17:08:53 apb Exp $
+#
+# Copyright (c) 2009 by Joerg Sonnenberger
+# 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$
+#
+# Simple script to show the dependency graph for rc scripts.
+# Output is in the dot(1) language and can be rendered using
+#	sh rcorder-visualize | dot -T svg -o rcorder.svg
+# dot(1) can be found in graphics/graphviz in pkgsrc.
+
+rc_files=${*:-/etc/rc.d/*}
+
+{
+echo ' digraph {'
+for f in $rc_files; do
+< $f awk '
+/# PROVIDE: /	{ provide = $3 }
+/# REQUIRE: /	{ for (i = 3; i <= NF; i++) requires[$i] = $i }
+/# BEFORE: /	{ for (i = 3; i <= NF; i++) befores[$i] = $i }
+
+END {
+	print "    \"" provide "\";"
+	for (x in requires) print "    \"" provide "\"->\"" x "\";"
+	for (x in befores) print "    \"" x "\"->\"" provide "\";"
+}
+'
+done
+echo '}'
+}

From owner-svn-src-all@freebsd.org  Tue Dec 13 23:13:05 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 387EDC76B2E;
 Tue, 13 Dec 2016 23:13:05 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EF4561125;
 Tue, 13 Dec 2016 23:13:04 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDND4DD080661;
 Tue, 13 Dec 2016 23:13:04 GMT (envelope-from vangyzen@FreeBSD.org)
Received: (from vangyzen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDND41D080660;
 Tue, 13 Dec 2016 23:13:04 GMT (envelope-from vangyzen@FreeBSD.org)
Message-Id: <201612132313.uBDND41D080660@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
 vangyzen@FreeBSD.org using -f
From: Eric van Gyzen <vangyzen@FreeBSD.org>
Date: Tue, 13 Dec 2016 23:13:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310043 - stable/10/sbin/rcorder
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 23:13:05 -0000

Author: vangyzen
Date: Tue Dec 13 23:13:03 2016
New Revision: 310043
URL: https://svnweb.freebsd.org/changeset/base/310043

Log:
  MFC r309625
  
  This is imported from NetBSD.  The author--Joerg Sonnenberger--agreed
  to apply a two-clause BSD license, just so the license was clear.
  
  This source tree location matches NetBSD, and is the first place someone
  might look for such a tool.
  
  Obtained from:	Joerg Sonnenberger via NetBSD
  Sponsored by:	Dell EMC

Added:
  stable/10/sbin/rcorder/rcorder-visualize.sh
     - copied unchanged from r309625, head/sbin/rcorder/rcorder-visualize.sh
Modified:
Directory Properties:
  stable/10/   (props changed)

Copied: stable/10/sbin/rcorder/rcorder-visualize.sh (from r309625, head/sbin/rcorder/rcorder-visualize.sh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/10/sbin/rcorder/rcorder-visualize.sh	Tue Dec 13 23:13:03 2016	(r310043, copy of r309625, head/sbin/rcorder/rcorder-visualize.sh)
@@ -0,0 +1,52 @@
+#!/bin/sh
+# $NetBSD: rcorder-visualize.sh,v 1.5 2009/08/09 17:08:53 apb Exp $
+#
+# Copyright (c) 2009 by Joerg Sonnenberger
+# 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$
+#
+# Simple script to show the dependency graph for rc scripts.
+# Output is in the dot(1) language and can be rendered using
+#	sh rcorder-visualize | dot -T svg -o rcorder.svg
+# dot(1) can be found in graphics/graphviz in pkgsrc.
+
+rc_files=${*:-/etc/rc.d/*}
+
+{
+echo ' digraph {'
+for f in $rc_files; do
+< $f awk '
+/# PROVIDE: /	{ provide = $3 }
+/# REQUIRE: /	{ for (i = 3; i <= NF; i++) requires[$i] = $i }
+/# BEFORE: /	{ for (i = 3; i <= NF; i++) befores[$i] = $i }
+
+END {
+	print "    \"" provide "\";"
+	for (x in requires) print "    \"" provide "\"->\"" x "\";"
+	for (x in befores) print "    \"" x "\"->\"" provide "\";"
+}
+'
+done
+echo '}'
+}

From owner-svn-src-all@freebsd.org  Tue Dec 13 23:34:08 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1AA5C76104;
 Tue, 13 Dec 2016 23:34:08 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8B72C1C66;
 Tue, 13 Dec 2016 23:34:08 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDNY7qC088611;
 Tue, 13 Dec 2016 23:34:07 GMT (envelope-from vangyzen@FreeBSD.org)
Received: (from vangyzen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDNY7Uh088608;
 Tue, 13 Dec 2016 23:34:07 GMT (envelope-from vangyzen@FreeBSD.org)
Message-Id: <201612132334.uBDNY7Uh088608@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
 vangyzen@FreeBSD.org using -f
From: Eric van Gyzen <vangyzen@FreeBSD.org>
Date: Tue, 13 Dec 2016 23:34:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310044 - in stable/11: lib/libc/sys share/man/man3
 sys/kern
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Dec 2016 23:34:08 -0000

Author: vangyzen
Date: Tue Dec 13 23:34:07 2016
New Revision: 310044
URL: https://svnweb.freebsd.org/changeset/base/310044

Log:
  MFC r309460
  
  thr_set_name(): silently truncate the given name as needed
  
  Instead of failing with ENAMETOOLONG, which is swallowed by
  pthread_set_name_np() anyway, truncate the given name to MAXCOMLEN+1
  bytes.  This is more likely what the user wants, and saves the
  caller from truncating it before the call (which was the only
  recourse).
  
  Polish pthread_set_name_np(3) and add a .Xr to thr_set_name(2)
  so the user might find the documentation for this behavior.
  
  Sponsored by:	Dell EMC

Modified:
  stable/11/lib/libc/sys/thr_set_name.2
  stable/11/share/man/man3/pthread_set_name_np.3
  stable/11/sys/kern/kern_thr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/sys/thr_set_name.2
==============================================================================
--- stable/11/lib/libc/sys/thr_set_name.2	Tue Dec 13 23:13:03 2016	(r310043)
+++ stable/11/lib/libc/sys/thr_set_name.2	Tue Dec 13 23:34:07 2016	(r310044)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 1, 2016
+.Dd December 2, 2016
 .Dt THR_SET_NAME 2
 .Os
 .Sh NAME
@@ -43,37 +43,34 @@
 .Sh DESCRIPTION
 The
 .Fn thr_set_name
-sets the user-visible name for the kernel thread with the identifier
+system call sets the user-visible name for the thread with the identifier
 .Va id
-in the current process, to the NUL-terminated string
+in the current process to the NUL-terminated string
 .Va name .
+The name will be silently truncated to fit into a buffer of
+.Dv MAXCOMLEN + 1
+bytes.
 The thread name can be seen in the output of the
 .Xr ps 1
 and
 .Xr top 1
 commands, in the kernel debuggers and kernel tracing facility outputs,
-also in userland debuggers and program core files, as notes.
+and in userland debuggers and program core files, as notes.
 .Sh RETURN VALUES
 If successful,
 .Fn thr_set_name
-will return zero, otherwise \-1 is returned, and
+returns zero; otherwise, \-1 is returned, and
 .Va errno
 is set to indicate the error.
 .Sh ERRORS
 The
 .Fn thr_set_name
-operation may return the following errors:
+system call may return the following errors:
 .Bl -tag -width Er
 .It Bq Er EFAULT
 The memory pointed to by the
 .Fa name
 argument is not valid.
-.It Bq Er ENAMETOOLONG
-The string pointed to by the
-.Fa name
-argument exceeds
-.Dv MAXCOMLEN + 1
-bytes in length.
 .It Bq Er ESRCH
 The thread with the identifier
 .Fa id
@@ -92,6 +89,6 @@ does not exist in the current process.
 .Xr ktr 9
 .Sh STANDARDS
 The
-.Fn thr_new
-system call is non-standard and is used by
+.Fn thr_set_name
+system call is non-standard and is used by the
 .Lb libthr .

Modified: stable/11/share/man/man3/pthread_set_name_np.3
==============================================================================
--- stable/11/share/man/man3/pthread_set_name_np.3	Tue Dec 13 23:13:03 2016	(r310043)
+++ stable/11/share/man/man3/pthread_set_name_np.3	Tue Dec 13 23:34:07 2016	(r310044)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 13, 2003
+.Dd December 2, 2016
 .Dt PTHREAD_SET_NAME_NP 3
 .Os
 .Sh NAME
@@ -35,18 +35,19 @@
 .Sh SYNOPSIS
 .In pthread_np.h
 .Ft void
-.Fn pthread_set_name_np "pthread_t tid" "const char *name"
+.Fn pthread_set_name_np "pthread_t thread" "const char *name"
 .Sh DESCRIPTION
 The
 .Fn pthread_set_name_np
-function sets internal name for thread specified by
-.Fa tid
-argument to string value specified by
+function applies a copy of the given
 .Fa name
-argument.
+to the given
+.Fa thread .
 .Sh ERRORS
 Because of the debugging nature of this function, all errors that may
 appear inside are silently ignored.
+.Sh SEE ALSO
+.Xr thr_set_name 2
 .Sh AUTHORS
 This manual page was written by
 .An Alexey Zelkin Aq Mt phantom@FreeBSD.org .

Modified: stable/11/sys/kern/kern_thr.c
==============================================================================
--- stable/11/sys/kern/kern_thr.c	Tue Dec 13 23:13:03 2016	(r310043)
+++ stable/11/sys/kern/kern_thr.c	Tue Dec 13 23:34:07 2016	(r310044)
@@ -579,8 +579,11 @@ sys_thr_set_name(struct thread *td, stru
 	error = 0;
 	name[0] = '\0';
 	if (uap->name != NULL) {
-		error = copyinstr(uap->name, name, sizeof(name),
-			NULL);
+		error = copyinstr(uap->name, name, sizeof(name), NULL);
+		if (error == ENAMETOOLONG) {
+			error = copyin(uap->name, name, sizeof(name) - 1);
+			name[sizeof(name) - 1] = '\0';
+		}
 		if (error)
 			return (error);
 	}

From owner-svn-src-all@freebsd.org  Wed Dec 14 00:18:13 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A97D7C76F02;
 Wed, 14 Dec 2016 00:18:13 +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 5F84A1275;
 Wed, 14 Dec 2016 00:18:13 +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 uBE0IC26004687;
 Wed, 14 Dec 2016 00:18:12 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBE0ICrE004686;
 Wed, 14 Dec 2016 00:18:12 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201612140018.uBE0ICrE004686@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin <jhb@FreeBSD.org>
Date: Wed, 14 Dec 2016 00:18:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310045 - head/sys/ddb
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 00:18:13 -0000

Author: jhb
Date: Wed Dec 14 00:18:12 2016
New Revision: 310045
URL: https://svnweb.freebsd.org/changeset/base/310045

Log:
  Use casts to force an unsigned comparison in db_search_symbol().
  
  On all of our platforms, db_expr_t is a signed integer while
  db_addr_t is an unsigned integer value.  db_search_symbol used variables
  of type db_expr_t to hold the current offset of the requested address from
  the "best" symbol found so far.  This value was initialized to '~0'.
  When a new symbol is found from a symbol table, the associated diff for the
  new symbol is compared against the existing value as 'if (newdiff < diff)'
  to determine if the new symbol had a smaller diff and was thus a closer
  match.
  
  On 64-bit MIPS, the '~0' was treated as a negative value (-1).  A lookup
  that found a perfect match of an address against a symbol returned a diff
  of 0.  However, in signed comparisons, 0 is not less than -1.  As a result,
  DDB on 64-bit MIPS never resolved any addresses to symbols.  Workaround
  this by using casts to force an unsigned comparison.
  
  Probably the diff returned from db_search_symbol() and X_db_search_symbol()
  should be changed to a db_addr_t instead of a db_expr_t as it is an
  unsigned value (and is an offset of an address, so should fit in the same
  size as an address).
  
  Sponsored by:	DARPA / AFRL

Modified:
  head/sys/ddb/db_sym.c

Modified: head/sys/ddb/db_sym.c
==============================================================================
--- head/sys/ddb/db_sym.c	Tue Dec 13 23:34:07 2016	(r310044)
+++ head/sys/ddb/db_sym.c	Wed Dec 14 00:18:12 2016	(r310045)
@@ -373,10 +373,10 @@ db_search_symbol(db_addr_t val, db_strat
 	register int	i;
 	c_db_sym_t	ret = C_DB_SYM_NULL, sym;
 
-	newdiff = diff = ~0;
+	newdiff = diff = val;
 	for (i = 0; i < db_nsymtab; i++) {
 	    sym = X_db_search_symbol(&db_symtabs[i], val, strategy, &newdiff);
-	    if (newdiff < diff) {
+	    if ((uintmax_t)newdiff < (uintmax_t)diff) {
 		db_last_symtab = &db_symtabs[i];
 		diff = newdiff;
 		ret = sym;

From owner-svn-src-all@freebsd.org  Wed Dec 14 00:21:07 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7C6CC76FD7;
 Wed, 14 Dec 2016 00:21:07 +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 90C3C160F;
 Wed, 14 Dec 2016 00:21:07 +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 uBE0L6AS004846;
 Wed, 14 Dec 2016 00:21:06 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBE0L6KB004845;
 Wed, 14 Dec 2016 00:21:06 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201612140021.uBE0L6KB004845@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin <jhb@FreeBSD.org>
Date: Wed, 14 Dec 2016 00:21:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310046 - head/sys/mips/mips
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 00:21:07 -0000

Author: jhb
Date: Wed Dec 14 00:21:06 2016
New Revision: 310046
URL: https://svnweb.freebsd.org/changeset/base/310046

Log:
  Add 'const' to fn_name's return type to remove a cast.

Modified:
  head/sys/mips/mips/db_trace.c

Modified: head/sys/mips/mips/db_trace.c
==============================================================================
--- head/sys/mips/mips/db_trace.c	Wed Dec 14 00:18:12 2016	(r310045)
+++ head/sys/mips/mips/db_trace.c	Wed Dec 14 00:21:06 2016	(r310046)
@@ -105,7 +105,7 @@ static struct {
 /*
  * Map a function address to a string name, if known; or a hex string.
  */
-static char *
+static const char *
 fn_name(uintptr_t addr)
 {
 	static char buf[17];
@@ -113,12 +113,12 @@ fn_name(uintptr_t addr)
 
 	db_expr_t diff;
 	c_db_sym_t sym;
-	char *symname;
+	const char *symname;
 
 	diff = 0;
 	symname = NULL;
 	sym = db_search_symbol((db_addr_t)addr, DB_STGY_ANY, &diff);
-	db_symbol_values(sym, (const char **)&symname, (db_expr_t *)0);
+	db_symbol_values(sym, &symname, NULL);
 	if (symname && diff == 0)
 		return (symname);
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 01:31:12 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7782C755B2;
 Wed, 14 Dec 2016 01:31:12 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170])
 (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 B7009182C;
 Wed, 14 Dec 2016 01:31:12 +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 mail.baldwin.cx (Postfix) with ESMTPSA id BCAD610AA56;
 Tue, 13 Dec 2016 20:31:10 -0500 (EST)
From: John Baldwin <jhb@freebsd.org>
To: src-committers@freebsd.org
Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r310045 - head/sys/ddb
Date: Tue, 13 Dec 2016 17:25:42 -0800
Message-ID: <2285301.DAKmd1GIbI@ralph.baldwin.cx>
User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; )
In-Reply-To: <201612140018.uBE0ICrE004686@repo.freebsd.org>
References: <201612140018.uBE0ICrE004686@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.4.3
 (mail.baldwin.cx); Tue, 13 Dec 2016 20:31:10 -0500 (EST)
X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx
X-Virus-Status: Clean
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 01:31:12 -0000

On Wednesday, December 14, 2016 12:18:12 AM John Baldwin wrote:
> Author: jhb
> Date: Wed Dec 14 00:18:12 2016
> New Revision: 310045
> URL: https://svnweb.freebsd.org/changeset/base/310045
> 
> Log:
>   Use casts to force an unsigned comparison in db_search_symbol().
>   
>   On all of our platforms, db_expr_t is a signed integer while
>   db_addr_t is an unsigned integer value.  db_search_symbol used variables
>   of type db_expr_t to hold the current offset of the requested address from
>   the "best" symbol found so far.  This value was initialized to '~0'.
>   When a new symbol is found from a symbol table, the associated diff for the
>   new symbol is compared against the existing value as 'if (newdiff < diff)'
>   to determine if the new symbol had a smaller diff and was thus a closer
>   match.
>   
>   On 64-bit MIPS, the '~0' was treated as a negative value (-1).  A lookup
>   that found a perfect match of an address against a symbol returned a diff
>   of 0.  However, in signed comparisons, 0 is not less than -1.  As a result,
>   DDB on 64-bit MIPS never resolved any addresses to symbols.  Workaround
>   this by using casts to force an unsigned comparison.

I am somewhat unsure of why this worked on other architectures.  amd64
treated ~0 as 0xffffffff which when assigned to a 64-bit register was
zero-extended.  i386 also used 0xffffffff, but it used an unsigned comparison
(jae instead of jge).  The kernel linker API returns an unsigned long for
the diff, so I do think using db_addr_t for this type is probably the right
solution in the long term.

>   Probably the diff returned from db_search_symbol() and X_db_search_symbol()
>   should be changed to a db_addr_t instead of a db_expr_t as it is an
>   unsigned value (and is an offset of an address, so should fit in the same
>   size as an address).

Also, in case it wasn't clear, this fixes resolution of addresses to names
in MIPS64 stack traces in DDB as well as when using 'x', etc.

-- 
John Baldwin

From owner-svn-src-all@freebsd.org  Wed Dec 14 03:01:17 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1347EC76197;
 Wed, 14 Dec 2016 03:01:17 +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 BEFBC10F3;
 Wed, 14 Dec 2016 03:01:16 +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 uBE31FKE072874;
 Wed, 14 Dec 2016 03:01:15 GMT (envelope-from gjb@FreeBSD.org)
Received: (from gjb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBE31Fc7072873;
 Wed, 14 Dec 2016 03:01:15 GMT (envelope-from gjb@FreeBSD.org)
Message-Id: <201612140301.uBE31Fc7072873@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
 using -f
From: Glen Barber <gjb@FreeBSD.org>
Date: Wed, 14 Dec 2016 03:01:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310047 - head/release/tools
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 03:01:17 -0000

Author: gjb
Date: Wed Dec 14 03:01:15 2016
New Revision: 310047
URL: https://svnweb.freebsd.org/changeset/base/310047

Log:
  - Resize FreeBSD to the size of the OpenStack flavor (growfs).
  - Speeds up the boot process by disabling sendmail.
  - Allows an user to ssh as root with a public key.
  - Make ssh(1) respond faster by disabling DNS lookups.
  - Enable DHCP on the vtnet(4) interface.
  
  Note: The CLOUDWARE list has not yet been changed to include the
  OpenStack target by default yet.
  
  Submitted by:	Diego Casati
  PR:		215258
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/tools/openstack.conf

Modified: head/release/tools/openstack.conf
==============================================================================
--- head/release/tools/openstack.conf	Wed Dec 14 00:21:06 2016	(r310046)
+++ head/release/tools/openstack.conf	Wed Dec 14 03:01:15 2016	(r310047)
@@ -11,8 +11,25 @@ export VM_EXTRA_PACKAGES="net/cloud-init
 # Set to a list of third-party software to enable in rc.conf(5).
 export VM_RC_LIST="cloudinit"
 
+export NOSWAP=YES
+
 vm_extra_pre_umount() {
+	#Enable sshd by default
 	echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf
+
+	# Disable DNS lookups by default to make SSH connect quickly
+	echo 'UseDNS no' >> ${DESTDIR}/etc/ssh/sshd_config
+
+	# Allow root to ssh using keys
+	echo 'PermitRootLogin without-password' >> ${DESTDIR}/etc/ssh/sshd_config
+
+	# Disable sendmail
+	echo 'sendmail_enable="NO"' >> ${DESTDIR}/etc/rc.conf
+	echo 'sendmail_submit_enable="NO"' >> ${DESTDIR}/etc/rc.conf
+	echo 'sendmail_outbound_enable="NO"' >> ${DESTDIR}/etc/rc.conf
+	echo 'sendmail_msp_queue_enable="NO"' >> ${DESTDIR}/etc/rc.conf
+
+	# Enable DHCP for the OpenStack instance
 	echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
 
 	# Openstack wants sudo(8) usable by default without a password.
@@ -21,5 +38,15 @@ vm_extra_pre_umount() {
 
 	rm -f ${DESTDIR}/etc/resolv.conf
 
+	# The console is not interactive, so we might as well boot quickly.
+	echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf
+	echo 'beastie_disable="YES"' >> ${DESTDIR}/boot/loader.conf
+
+	# Reboot quickly, Don't wait at the panic screen
+	echo 'debug.trace_on_panic=1' >> ${DESTDIR}/etc/sysctl.conf
+	echo 'debug.debugger_on_panic=0' >> ${DESTDIR}/etc/sysctl.conf
+	echo 'kern.panic_reboot_wait_time=0' >> ${DESTDIR}/etc/sysctl.conf
+
+	touch ${DESTDIR}/firstboot
 	return 0
 }

From owner-svn-src-all@freebsd.org  Wed Dec 14 03:20:58 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B657CC768D9;
 Wed, 14 Dec 2016 03:20: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 771E51FBB;
 Wed, 14 Dec 2016 03:20:58 +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 uBE3Kv8a079402;
 Wed, 14 Dec 2016 03:20:57 GMT (envelope-from sephe@FreeBSD.org)
Received: (from sephe@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBE3KvWa079399;
 Wed, 14 Dec 2016 03:20:57 GMT (envelope-from sephe@FreeBSD.org)
Message-Id: <201612140320.uBE3KvWa079399@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: sephe set sender to
 sephe@FreeBSD.org using -f
From: Sepherosa Ziehau <sephe@FreeBSD.org>
Date: Wed, 14 Dec 2016 03:20:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310048 - in head/sys/dev/hyperv: include vmbus
 vmbus/amd64
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 03:20:58 -0000

Author: sephe
Date: Wed Dec 14 03:20:57 2016
New Revision: 310048
URL: https://svnweb.freebsd.org/changeset/base/310048

Log:
  hyperv: Implement "enlightened" time counter, which is rdtsc based.
  
  Reviewed by:	kib
  MFC after:	1 week
  Sponsored by:	Microsoft
  Differential Revision:	https://reviews.freebsd.org/D8763

Modified:
  head/sys/dev/hyperv/include/hyperv.h
  head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c
  head/sys/dev/hyperv/vmbus/hyperv_reg.h

Modified: head/sys/dev/hyperv/include/hyperv.h
==============================================================================
--- head/sys/dev/hyperv/include/hyperv.h	Wed Dec 14 03:01:15 2016	(r310047)
+++ head/sys/dev/hyperv/include/hyperv.h	Wed Dec 14 03:20:57 2016	(r310048)
@@ -45,6 +45,7 @@
 #define CPUID_HV_MSR_HYPERCALL		0x0020	/* MSR_HV_GUEST_OS_ID
 						 * MSR_HV_HYPERCALL */
 #define CPUID_HV_MSR_VP_INDEX		0x0040	/* MSR_HV_VP_INDEX */
+#define CPUID_HV_MSR_REFERENCE_TSC	0x0200	/* MSR_HV_REFERENCE_TSC */
 #define CPUID_HV_MSR_GUEST_IDLE		0x0400	/* MSR_HV_GUEST_IDLE */
 
 #ifndef NANOSEC

Modified: head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c	Wed Dec 14 03:01:15 2016	(r310047)
+++ head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c	Wed Dec 14 03:20:57 2016	(r310048)
@@ -28,7 +28,37 @@
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/timetc.h>
+
+#include <machine/cpufunc.h>
+#include <machine/cputypes.h>
+#include <machine/md_var.h>
+
+#include <dev/hyperv/include/hyperv.h>
+#include <dev/hyperv/include/hyperv_busdma.h>
 #include <dev/hyperv/vmbus/hyperv_machdep.h>
+#include <dev/hyperv/vmbus/hyperv_reg.h>
+#include <dev/hyperv/vmbus/hyperv_var.h>
+
+struct hyperv_reftsc_ctx {
+	struct hyperv_reftsc	*tsc_ref;
+	struct hyperv_dma	tsc_ref_dma;
+};
+
+static struct timecounter	hyperv_tsc_timecounter = {
+	.tc_get_timecount	= NULL,	/* based on CPU vendor. */
+	.tc_poll_pps		= NULL,
+	.tc_counter_mask	= 0xffffffff,
+	.tc_frequency		= HYPERV_TIMER_FREQ,
+	.tc_name		= "Hyper-V-TSC",
+	.tc_quality		= 3000,
+	.tc_flags		= 0,
+	.tc_priv		= NULL
+};
+
+static struct hyperv_reftsc_ctx	hyperv_ref_tsc;
 
 uint64_t
 hypercall_md(volatile void *hc_addr, uint64_t in_val,
@@ -41,3 +71,85 @@ hypercall_md(volatile void *hc_addr, uin
 	    "c" (in_val), "d" (in_paddr), "m" (hc_addr));
 	return (status);
 }
+
+#define HYPERV_TSC_TIMECOUNT(fence)					\
+static u_int								\
+hyperv_tsc_timecount_##fence(struct timecounter *tc)			\
+{									\
+	struct hyperv_reftsc *tsc_ref = hyperv_ref_tsc.tsc_ref;		\
+	uint32_t seq;							\
+									\
+	while ((seq = atomic_load_acq_int(&tsc_ref->tsc_seq)) != 0) {	\
+		uint64_t disc, ret, tsc;				\
+		uint64_t scale = tsc_ref->tsc_scale;			\
+		int64_t ofs = tsc_ref->tsc_ofs;				\
+									\
+		fence();						\
+		tsc = rdtsc();						\
+									\
+		/* ret = ((tsc * scale) >> 64) + ofs */			\
+		__asm__ __volatile__ ("mulq %3" :			\
+		    "=d" (ret), "=a" (disc) :				\
+		    "a" (tsc), "r" (scale));				\
+		ret += ofs;						\
+									\
+		atomic_thread_fence_acq();				\
+		if (tsc_ref->tsc_seq == seq)				\
+			return (ret);					\
+									\
+		/* Sequence changed; re-sync. */			\
+	}								\
+	/* Fallback to the generic timecounter, i.e. rdmsr. */		\
+	return (rdmsr(MSR_HV_TIME_REF_COUNT));				\
+}									\
+struct __hack
+
+HYPERV_TSC_TIMECOUNT(lfence);
+HYPERV_TSC_TIMECOUNT(mfence);
+
+static void
+hyperv_tsc_tcinit(void *dummy __unused)
+{
+	uint64_t val, orig;
+
+	if ((hyperv_features &
+	     (CPUID_HV_MSR_TIME_REFCNT | CPUID_HV_MSR_REFERENCE_TSC)) !=
+	    (CPUID_HV_MSR_TIME_REFCNT | CPUID_HV_MSR_REFERENCE_TSC) ||
+	    (cpu_feature & CPUID_SSE2) == 0)	/* SSE2 for mfence/lfence */
+		return;
+
+	switch (cpu_vendor_id) {
+	case CPU_VENDOR_AMD:
+		hyperv_tsc_timecounter.tc_get_timecount =
+		    hyperv_tsc_timecount_mfence;
+		break;
+
+	case CPU_VENDOR_INTEL:
+		hyperv_tsc_timecounter.tc_get_timecount =
+		    hyperv_tsc_timecount_lfence;
+		break;
+
+	default:
+		/* Unsupport CPU vendors. */
+		return;
+	}
+
+	hyperv_ref_tsc.tsc_ref = hyperv_dmamem_alloc(NULL, PAGE_SIZE, 0,
+	    sizeof(struct hyperv_reftsc), &hyperv_ref_tsc.tsc_ref_dma,
+	    BUS_DMA_WAITOK | BUS_DMA_ZERO);
+	if (hyperv_ref_tsc.tsc_ref == NULL) {
+		printf("hyperv: reftsc page allocation failed\n");
+		return;
+	}
+
+	orig = rdmsr(MSR_HV_REFERENCE_TSC);
+	val = MSR_HV_REFTSC_ENABLE | (orig & MSR_HV_REFTSC_RSVD_MASK) |
+	    ((hyperv_ref_tsc.tsc_ref_dma.hv_paddr >> PAGE_SHIFT) <<
+	     MSR_HV_REFTSC_PGSHIFT);
+	wrmsr(MSR_HV_REFERENCE_TSC, val);
+
+	/* Register "enlightened" timecounter. */
+	tc_init(&hyperv_tsc_timecounter);
+}
+SYSINIT(hyperv_tsc_init, SI_SUB_DRIVERS, SI_ORDER_FIRST, hyperv_tsc_tcinit,
+    NULL);

Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h
==============================================================================
--- head/sys/dev/hyperv/vmbus/hyperv_reg.h	Wed Dec 14 03:01:15 2016	(r310047)
+++ head/sys/dev/hyperv/vmbus/hyperv_reg.h	Wed Dec 14 03:20:57 2016	(r310048)
@@ -57,6 +57,11 @@
 
 #define MSR_HV_VP_INDEX			0x40000002
 
+#define MSR_HV_REFERENCE_TSC		0x40000021
+#define MSR_HV_REFTSC_ENABLE		0x0001ULL
+#define MSR_HV_REFTSC_RSVD_MASK		0x0ffeULL
+#define MSR_HV_REFTSC_PGSHIFT		12
+
 #define MSR_HV_SCONTROL			0x40000080
 #define MSR_HV_SCTRL_ENABLE		0x0001ULL
 #define MSR_HV_SCTRL_RSVD_MASK		0xfffffffffffffffeULL
@@ -124,6 +129,17 @@
 #define CPUID_LEAF_HV_HWFEATURES	0x40000006
 
 /*
+ * Hyper-V Reference TSC
+ */
+struct hyperv_reftsc {
+	volatile uint32_t	tsc_seq;
+	volatile uint32_t	tsc_rsvd1;
+	volatile uint64_t	tsc_scale;
+	volatile int64_t	tsc_ofs;
+} __packed __aligned(PAGE_SIZE);
+CTASSERT(sizeof(struct hyperv_reftsc) == PAGE_SIZE);
+
+/*
  * Hyper-V Monitor Notification Facility
  */
 struct hyperv_mon_param {

From owner-svn-src-all@freebsd.org  Wed Dec 14 07:36:37 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FA8BC765A9;
 Wed, 14 Dec 2016 07:36:37 +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 1F86D163D;
 Wed, 14 Dec 2016 07:36:37 +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 uBE7aaaU082925;
 Wed, 14 Dec 2016 07:36:36 GMT (envelope-from np@FreeBSD.org)
Received: (from np@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBE7aape082924;
 Wed, 14 Dec 2016 07:36:36 GMT (envelope-from np@FreeBSD.org)
Message-Id: <201612140736.uBE7aape082924@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org
 using -f
From: Navdeep Parhar <np@FreeBSD.org>
Date: Wed, 14 Dec 2016 07:36:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310049 - head/sys/dev/cxgbe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 07:36:37 -0000

Author: np
Date: Wed Dec 14 07:36:36 2016
New Revision: 310049
URL: https://svnweb.freebsd.org/changeset/base/310049

Log:
  cxgbe(4): Fix the tid range shown for T6 cards in misc.tids.
  
  MFC after:	3 days

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Wed Dec 14 03:20:57 2016	(r310048)
+++ head/sys/dev/cxgbe/t4_main.c	Wed Dec 14 07:36:36 2016	(r310049)
@@ -7219,25 +7219,23 @@ sysctl_tids(SYSCTL_HANDLER_ARGS)
 	}
 
 	if (t->ntids) {
+		sbuf_printf(sb, "TID range: ");
 		if (t4_read_reg(sc, A_LE_DB_CONFIG) & F_HASHEN) {
-			uint32_t b;
+			uint32_t b, hb;
 
-			if (chip_id(sc) <= CHELSIO_T5)
+			if (chip_id(sc) <= CHELSIO_T5) {
 				b = t4_read_reg(sc, A_LE_DB_SERVER_INDEX) / 4;
-			else
-				b = t4_read_reg(sc, A_LE_DB_SRVR_START_INDEX);
-
-			if (b) {
-				sbuf_printf(sb, "TID range: 0-%u, %u-%u", b - 1,
-				    t4_read_reg(sc, A_LE_DB_TID_HASHBASE) / 4,
-				    t->ntids - 1);
+				hb = t4_read_reg(sc, A_LE_DB_TID_HASHBASE) / 4;
 			} else {
-				sbuf_printf(sb, "TID range: %u-%u",
-				    t4_read_reg(sc, A_LE_DB_TID_HASHBASE) / 4,
-				    t->ntids - 1);
+				b = t4_read_reg(sc, A_LE_DB_SRVR_START_INDEX);
+				hb = t4_read_reg(sc, A_T6_LE_DB_HASH_TID_BASE);
 			}
+
+			if (b)
+				sbuf_printf(sb, "0-%u, ", b - 1);
+			sbuf_printf(sb, "%u-%u", hb, t->ntids - 1);
 		} else
-			sbuf_printf(sb, "TID range: 0-%u", t->ntids - 1);
+			sbuf_printf(sb, "0-%u", t->ntids - 1);
 		sbuf_printf(sb, ", in use: %u\n",
 		    atomic_load_acq_int(&t->tids_in_use));
 	}

From owner-svn-src-all@freebsd.org  Wed Dec 14 08:24:56 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F641C77742;
 Wed, 14 Dec 2016 08:24:56 +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 F1D5A10D2;
 Wed, 14 Dec 2016 08:24:55 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au
 [122.106.153.191])
 by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id E23F778036F;
 Wed, 14 Dec 2016 19:24:46 +1100 (AEDT)
Date: Wed, 14 Dec 2016 19:24:46 +1100 (EST)
From: Bruce Evans <brde@optusnet.com.au>
X-X-Sender: bde@besplex.bde.org
To: John Baldwin <jhb@freebsd.org>
cc: src-committers@freebsd.org, svn-src-all@freebsd.org, 
 svn-src-head@freebsd.org
Subject: Re: svn commit: r310045 - head/sys/ddb
In-Reply-To: <2285301.DAKmd1GIbI@ralph.baldwin.cx>
Message-ID: <20161214140645.W3397@besplex.bde.org>
References: <201612140018.uBE0ICrE004686@repo.freebsd.org>
 <2285301.DAKmd1GIbI@ralph.baldwin.cx>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.2 cv=K7JSJ2eI c=1 sm=1 tr=0
 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17
 a=kj9zAlcOel0A:10 a=Qop2jtItP8IHF9h2ioYA:9 a=buPLVkvBn6gS70WA:21
 a=Di1t-CtzPU5t3H5x:21 a=CjuIK1q_8ugA:10
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 08:24:56 -0000

On Tue, 13 Dec 2016, John Baldwin wrote:

> On Wednesday, December 14, 2016 12:18:12 AM John Baldwin wrote:
>>
>> Log:
>>   Use casts to force an unsigned comparison in db_search_symbol().
>>
>>   On all of our platforms, db_expr_t is a signed integer while
>>   db_addr_t is an unsigned integer value.  db_search_symbol used variables
>>   of type db_expr_t to hold the current offset of the requested address from
>>   the "best" symbol found so far.  This value was initialized to '~0'.
>>   When a new symbol is found from a symbol table, the associated diff for the
>>   new symbol is compared against the existing value as 'if (newdiff < diff)'
>>   to determine if the new symbol had a smaller diff and was thus a closer
>>   match.
>>
>>   On 64-bit MIPS, the '~0' was treated as a negative value (-1).  A lookup
>>   that found a perfect match of an address against a symbol returned a diff
>>   of 0.  However, in signed comparisons, 0 is not less than -1.  As a result,
>>   DDB on 64-bit MIPS never resolved any addresses to symbols.  Workaround
>>   this by using casts to force an unsigned comparison.
>
> I am somewhat unsure of why this worked on other architectures.  amd64
> treated ~0 as 0xffffffff which when assigned to a 64-bit register was

It is treated the same on all non-broken arches, and I doubt that MIPS64
is broken here.

~0 is -1 on all arches (since no supported arches are 1's complement),
but it was assigned to 'unsigned diff' which gives 0xffffffff on all
supported arches.  Then diff is assigned to 'size_t newdiff', giving
no change in type or value on 32-bit arches, and zero-extension to the
same value but larger type on 64-bit arches.

Note that the type of diff is very broken.  It is unsigned.  This corrupts
not only ~0, but also the final difference returned in *offp.  The return
value also gets corrupted from 32 bits unsigned to 32 bits signed on
32-bit arches, so offsets >= 2**31 are fragile on all arches.  I think
most cases work because the offset is 0.

I don't see how initializing to 'val' can help.  It still gets corrupted
to unsigned, and I would expect it to make the problem much worse because
the truncation gives an even smaller value.  E.g., if val is any multiple
of 2**32, truncating it gives 0.  Without the truncation, 'val' is a good
upper bound for the offset.

Perhaps the problem is more with the initialization of newdiff.  It is
initialized to the corrupted value in diff.  I don't know the details of
the API, but if X_db_search_symbol() uses this as an input parameter to
limit the search, it might be happier with the smaller corrupted value
than the larger one.  X_db_search_symbol() seems to have working types
and values, though still too much hard-coding of types.

Your casts to uintmax_t have no effect.  The types are already unsigned,
and the corrupted values cannot be fixed by later casts.

Other type errors:
- newdiff has type size_t.  This bug is mostly cosmetic, but the type
   doesn't even match the X_db_search_symbol() API where newdiff is
   initialized.
- db_expr_t hasn't caught up with C99 yet.  It should have type intmax_t.
   Even cpp uses intmax_t for integer expressions.  C99 broke longs, so
   simply changing db_expr_t to intmax_t would break all the printf's that
   convert db_expr_t to long or u_long for printing.  There are also hard-
   coded assumptions that db_expr_t == intptr_t.

> zero-extended.  i386 also used 0xffffffff, but it used an unsigned comparison
> (jae instead of jge).
> 
> The kernel linker API returns an unsigned long for
> the diff, so I do think using db_addr_t for this type is probably the right
> solution in the long term.
> 
>>   Probably the diff returned from db_search_symbol() and X_db_search_symbol()
>>   should be changed to a db_addr_t instead of a db_expr_t as it is an
>>   unsigned value (and is an offset of an address, so should fit in the same
>>   size as an address).

I prefer signed types, and ddb already does this like I prefer.
Sometimes db_search_symbol() returns negative values.  This is most
needed for absolute symbols.  See db_printsym(), where there are many
buggy attempts to determine if the a negative symbol offset is actually
negative or just a representation of a huge unsigned value (usually a
kernel address), for the purpose of printing things like -8(%rbp)
instead of the current spam 0xfffffffffffffff8(%rbp).  Apparently,
offsets from registers are represented using special symbols, and for
the frame and stack pointers these offsets are usually negative, but
the extra bit needed for encoding this is not available/implemented
so it is difficult for db_printsym() to determine the actual offset.

I fixed printing of negative offsets from the frame pointer on i386,
but this is currently broken on i386 and never worked on other arches.
DB_LARGE_VALUE_MIN has the old i386 value on all arches, but this is
now wrong for i386 and never worked on other arches.  This is related
to the current problem: I think offsets like -8 are looked up as
symbols, and found to be at the largest kernel symbol plus some offset.
DB_LARGE_VALUE_MIN is supposed to give essentially the address of this
symbol.  This address was very high on i386 (given by static allocation
of some page table).  Now the highest symbol is not far above KERNBASE,
so is unusable for this purpose.  To fix this, all arches should have
a dummy symbol near the top of the address space.  It must be found
when an offset like -8 is looked up, and should be just a few hundred
K below the top since negative offsets larger than a few hundred K
are likely to be garbage.

> Also, in case it wasn't clear, this fixes resolution of addresses to names
> in MIPS64 stack traces in DDB as well as when using 'x', etc.

Bruce

From owner-svn-src-all@freebsd.org  Wed Dec 14 10:11:41 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2B2EC77193;
 Wed, 14 Dec 2016 10:11:40 +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 890DC1592;
 Wed, 14 Dec 2016 10:11:39 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au
 [122.106.153.191])
 by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 7969C429B4C;
 Wed, 14 Dec 2016 20:48:48 +1100 (AEDT)
Date: Wed, 14 Dec 2016 20:48:47 +1100 (EST)
From: Bruce Evans <brde@optusnet.com.au>
X-X-Sender: bde@besplex.bde.org
To: Bruce Evans <brde@optusnet.com.au>
cc: John Baldwin <jhb@freebsd.org>, src-committers@freebsd.org, 
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r310045 - head/sys/ddb
In-Reply-To: <20161214140645.W3397@besplex.bde.org>
Message-ID: <20161214201041.C4333@besplex.bde.org>
References: <201612140018.uBE0ICrE004686@repo.freebsd.org>
 <2285301.DAKmd1GIbI@ralph.baldwin.cx> <20161214140645.W3397@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.2 cv=cZeiljLM c=1 sm=1 tr=0
 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17
 a=kj9zAlcOel0A:10 a=kXIzg0_sEkvfXePip-IA:9 a=LgnZfvd9FYkpsdvo:21
 a=suFtSTZC6S9h3vpZ:21 a=CjuIK1q_8ugA:10
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 10:11:41 -0000

On Wed, 14 Dec 2016, Bruce Evans wrote:

> I fixed printing of negative offsets from the frame pointer on i386,
> but this is currently broken on i386 and never worked on other arches.
> DB_LARGE_VALUE_MIN has the old i386 value on all arches, but this is
> now wrong for i386 and never worked on other arches.  This is related
> to the current problem: I think offsets like -8 are looked up as
> symbols, and found to be at the largest kernel symbol plus some offset.
> DB_LARGE_VALUE_MIN is supposed to give essentially the address of this
> symbol.  This address was very high on i386 (given by static allocation
> of some page table).  Now the highest symbol is not far above KERNBASE,
> so is unusable for this purpose.  To fix this, all arches should have
> a dummy symbol near the top of the address space.  It must be found
> when an offset like -8 is looked up, and should be just a few hundred
> K below the top since negative offsets larger than a few hundred K
> are likely to be garbage.

The fix for amd64 and i386 was very easy, except it is missing comments
and doesn't clean up old comments:

X Index: amd64/amd64/locore.S
X ===================================================================
X --- amd64/amd64/locore.S	(revision 309660)
X +++ amd64/amd64/locore.S	(working copy)
X @@ -46,6 +46,8 @@
X  	.set	dmapbase,DMAP_MIN_ADDRESS
X  	.set	dmapend,DMAP_MAX_ADDRESS
X 
X +	.set	db_small_value_min,-0x400000
X +
X  	.text
X  /**********************************************************************
X   *
X Index: i386/i386/locore.s
X ===================================================================
X --- i386/i386/locore.s	(revision 309660)
X +++ i386/i386/locore.s	(working copy)
X @@ -80,6 +80,8 @@
X  	.globl	kernload
X  	.set	kernload,KERNLOAD
X 
X +	.set	db_small_value_min,-0x400000
X +
X  /*
X   * Globals
X   */

Please fix it for other arches.

The magic number should be DB_SMALL_VALUE_MIN+-1 (actually, ddb should
use this symbol value directly).  This value doesn't need to be much
more negative than the negative of the kernel stack size.  The historical
value is just a convenient more negative value that old i386 kernels had.

The symbol must be fitted into the kernel address space without too much
conflict with symbols already there.  If there are higher ones, then they
already affect db_printsym().

I have the following old workarounds for the bug:

X diff -u2 ddb/db_sym.c~ ddb/db_sym.c
X --- ddb/db_sym.c~	Wed Feb 25 21:05:51 2004
X +++ ddb/db_sym.c	Wed Feb 25 21:11:09 2004
X @@ -303,5 +303,9 @@
X  	if (name == 0)
X  		value = off;

The (name == 0) case is apparently not executed enough to help.

X +#ifdef magic_large_symbols_unbroken
X  	if (value >= DB_SMALL_VALUE_MIN && value <= DB_SMALL_VALUE_MAX) {
X +#else
X +	if (off >= DB_SMALL_VALUE_MIN && off <= DB_SMALL_VALUE_MAX) {
X +#endif

This forces the check to use the same variable as in the (name == 0) case.

The difference between checking value and off is subtle.  IIRC, value is
for the symbol and off is the original value (not an offset at all), while
the offset is in d (off = value + d).  We want to check 'value' and consider
it as garbage if it is this symbol and use only 'off' in this case.
DB_SMALL_VALUE_MIN is the address of this symbol +-1, where +-1 is to
try to see this symbol, but I think this doesn't work.

X  		db_printf("%+#lr", (long)off);
X  		return;
X diff -u2 i386/include/db_machdep.h~ i386/include/db_machdep.h
X --- i386/include/db_machdep.h~	Mon Nov 10 08:01:53 2003
X +++ i386/include/db_machdep.h	Mon Nov 10 02:54:26 2003
X @@ -87,7 +87,9 @@
X   * _APTmap = 0xffc00000.  Accepting this is OK (unless db_maxoff is
X   * set to >= 0x400000 - (max stack offset)).
X + * XXX _APTD and _APTmap went away.  Now there are SMP_prvspace = 0xffc00000
X + * and lapic = 0xfffff000.
X   */
X  #define	DB_SMALL_VALUE_MAX	0x7fffffff
X -#define	DB_SMALL_VALUE_MIN	(-0x400001)
X +#define	DB_SMALL_VALUE_MIN	(-0x3fffff)
X 
X  #endif /* !_MACHINE_DB_MACHDEP_H_ */

The amendment to the comment is also 15-20 years out of date.  The adjustment
to DB_SMALL_VALUE_MIN is supposed to see SMP_prvspace better, but I doubt
that it works.  Using the dummy symbol avoids problems with seeing or not
seeing the highest real kernel symbol, so the +-1 adjustment doesn't
matter.

The next most obvious bug in amd64 disassembly is that ddb doesn't
understand PC-relative offsets, so the addresses of global variables are
displayed unreadably as something like 0x6e631b(%rip).

Bruce

From owner-svn-src-all@freebsd.org  Wed Dec 14 11:40:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D8CDC7647F;
 Wed, 14 Dec 2016 11:40:33 +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 C7C0810AB;
 Wed, 14 Dec 2016 11:40:32 +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 uBEBeV1B080567;
 Wed, 14 Dec 2016 11:40:31 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEBeVlL080566;
 Wed, 14 Dec 2016 11:40:31 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612141140.uBEBeVlL080566@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Wed, 14 Dec 2016 11:40:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310050 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 11:40:33 -0000

Author: kib
Date: Wed Dec 14 11:40:31 2016
New Revision: 310050
URL: https://svnweb.freebsd.org/changeset/base/310050

Log:
  Provide non-final but valid PCB pointer for thread0 for duration of
  hammer_time().  This makes assembler exception handlers not fault
  itself when setting PCB flags, and allow normal kernel trap handler to
  get control.  The pointer is reset after FPU parameters are obtained.
  
  Set thread0.td_critnest to 1 for duration of hammer_time() as well.
  In particular, page faults at that early stage panic immediately
  instead of trying to call not yet operational VM to resolve it.
  
  As result, faults during second half of the hammer_time() execution
  have a chance to be reported instead of silent machine reboot or hang.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/amd64/amd64/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Wed Dec 14 07:36:36 2016	(r310049)
+++ head/sys/amd64/amd64/machdep.c	Wed Dec 14 11:40:31 2016	(r310050)
@@ -1673,6 +1673,16 @@ hammer_time(u_int64_t modulep, u_int64_t
 	wrmsr(MSR_SF_MASK, PSL_NT|PSL_T|PSL_I|PSL_C|PSL_D);
 
 	/*
+	 * Temporary forge some valid pointer to PCB, for exception
+	 * handlers.  It is reinitialized properly below after FPU is
+	 * set up.  Also set up td_critnest to short-cut the page
+	 * fault handler.
+	 */
+	cpu_max_ext_state_size = sizeof(struct savefpu);
+	thread0.td_pcb = get_pcb_td(&thread0);
+	thread0.td_critnest = 1;
+
+	/*
 	 * The console and kdb should be initialized even earlier than here,
 	 * but some console drivers don't work until after getmemsize().
 	 * Default to late console initialization to support these drivers.
@@ -1762,6 +1772,7 @@ hammer_time(u_int64_t modulep, u_int64_t
 #ifdef FDT
 	x86_init_fdt();
 #endif
+	thread0.td_critnest = 0;
 
 	/* Location of kernel stack for locore */
 	return ((u_int64_t)thread0.td_pcb);

From owner-svn-src-all@freebsd.org  Wed Dec 14 12:04:18 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B12D1C77749;
 Wed, 14 Dec 2016 12:04:18 +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 3CC9914A7;
 Wed, 14 Dec 2016 12:04: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 OAA20604;
 Wed, 14 Dec 2016 14:04:15 +0200 (EET) (envelope-from avg@FreeBSD.org)
Received: from localhost ([127.0.0.1])
 by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
 id 1cH8IA-00024I-Ks; Wed, 14 Dec 2016 14:04:14 +0200
Subject: Re: svn commit: r309714 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
To: Alexander Motin <mav@FreeBSD.org>, src-committers@FreeBSD.org,
 svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org
References: <201612081558.uB8Fw4xA027508@repo.freebsd.org>
From: Andriy Gapon <avg@FreeBSD.org>
Message-ID: <cd831c65-ffb3-b84b-7e0e-b84ae32bace1@FreeBSD.org>
Date: Wed, 14 Dec 2016 14:03:38 +0200
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101
 Thunderbird/45.5.1
MIME-Version: 1.0
In-Reply-To: <201612081558.uB8Fw4xA027508@repo.freebsd.org>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 12:04:18 -0000

On 08/12/2016 17:58, Alexander Motin wrote:
>   This change switches zio_timestamp_compare() from comparing uninitialized
>   io_offset to really populated io_bookmark values.  I haven't decided yet
>   what to do with timestampts, but on simple tests this change gives the
>   same peformance results by just making code to work as declared.

I think that we should just enable precise timestamps.
I just can't see them noticeably hurting performance given the amount of
calculations, memory allocations, locking, etc, that ZFS already has.
And there are layers above and below ZFS too.

-- 
Andriy Gapon

From owner-svn-src-all@freebsd.org  Wed Dec 14 12:39:16 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66859C76317;
 Wed, 14 Dec 2016 12:39:16 +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 D87AF1933;
 Wed, 14 Dec 2016 12:39:14 +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 OAA20694;
 Wed, 14 Dec 2016 14:39:12 +0200 (EET) (envelope-from avg@FreeBSD.org)
Received: from localhost ([127.0.0.1])
 by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
 id 1cH8q0-00025y-Cv; Wed, 14 Dec 2016 14:39:12 +0200
Subject: Re: svn commit: r310023 - in head/sys/cddl: compat/opensolaris/sys
 contrib/opensolaris/uts/common/fs/zfs
To: Alexander Motin <mav@FreeBSD.org>, src-committers@FreeBSD.org,
 svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org
References: <201612131620.uBDGKAR0007684@repo.freebsd.org>
From: Andriy Gapon <avg@FreeBSD.org>
Message-ID: <55217d08-1c39-0d30-58a3-6b3aa48fd79f@FreeBSD.org>
Date: Wed, 14 Dec 2016 14:38:11 +0200
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101
 Thunderbird/45.5.1
MIME-Version: 1.0
In-Reply-To: <201612131620.uBDGKAR0007684@repo.freebsd.org>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 12:39:16 -0000

On 13/12/2016 18:20, Alexander Motin wrote:
> Author: mav
> Date: Tue Dec 13 16:20:10 2016
> New Revision: 310023
> URL: https://svnweb.freebsd.org/changeset/base/310023
> 
> Log:
>   Reduce diff from Illumos by better variables mapping.
> 
> Modified:
>   head/sys/cddl/compat/opensolaris/sys/kmem.h
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
> 
> Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h
> ==============================================================================
> --- head/sys/cddl/compat/opensolaris/sys/kmem.h	Tue Dec 13 13:46:09 2016	(r310022)
> +++ head/sys/cddl/compat/opensolaris/sys/kmem.h	Tue Dec 13 16:20:10 2016	(r310023)
> @@ -37,6 +37,7 @@
>  #include <vm/uma.h>
>  #include <vm/vm.h>
>  #include <vm/vm_extern.h>
> +#include <vm/vm_pageout.h>
>  
>  MALLOC_DECLARE(M_SOLARIS);
>  
> @@ -77,8 +78,10 @@ void kmem_reap(void);
>  int kmem_debugging(void);
>  void *calloc(size_t n, size_t s);
>  
> -#define	freemem				vm_cnt.v_free_count
> -#define	minfree				vm_cnt.v_free_min
> +#define	freemem				(long)vm_cnt.v_free_count
> +#define	desfree				(long)vm_cnt.v_free_target
> +#define	minfree				(long)vm_cnt.v_free_min
> +#define	needfree			(long)vm_pageout_deficit
>  #define	heap_arena			kmem_arena
>  #define	kmem_alloc(size, kmflags)	zfs_kmem_alloc((size), (kmflags))
>  #define	kmem_zalloc(size, kmflags)	zfs_kmem_alloc((size), (kmflags) | M_ZERO)
> 
> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
> ==============================================================================
> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Dec 13 13:46:09 2016	(r310022)
> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Dec 13 16:20:10 2016	(r310023)
> @@ -357,6 +357,7 @@ int zfs_arc_shrink_shift = 0;
>  int zfs_arc_p_min_shift = 0;
>  uint64_t zfs_arc_average_blocksize = 8 * 1024; /* 8KB */
>  u_int zfs_arc_free_target = 0;
> +#define	lotsfree	zfs_arc_free_target
>  
>  /* Absolute min for arc min / max is 16MB. */
>  static uint64_t arc_abs_min = 16 << 20;
> @@ -3827,8 +3828,6 @@ arc_shrink(int64_t to_free)
>  	}
>  }
>  
> -static long needfree = 0;
> -
>  typedef enum free_memory_reason_t {
>  	FMR_UNKNOWN,
>  	FMR_NEEDFREE,
> @@ -3875,17 +3874,6 @@ arc_available_memory(void)
>  	}
>  
>  	/*
> -	 * Cooperate with pagedaemon when it's time for it to scan
> -	 * and reclaim some pages.
> -	 */
> -	n = PAGESIZE * ((int64_t)freemem - zfs_arc_free_target);
> -	if (n < lowest) {
> -		lowest = n;
> -		r = FMR_LOTSFREE;
> -	}
> -
> -#ifdef illumos
> -	/*
>  	 * check that we're out of range of the pageout scanner.  It starts to
>  	 * schedule paging if freemem is less than lotsfree and needfree.
>  	 * lotsfree is the high-water mark for pageout, and needfree is the
> @@ -3898,6 +3886,7 @@ arc_available_memory(void)
>  		r = FMR_LOTSFREE;
>  	}
>  
> +#ifdef illumos
>  	/*
>  	 * check to make sure that swapfs has enough space so that anon
>  	 * reservations can still succeed. anon_resvmem() checks that the
> @@ -4154,9 +4143,6 @@ arc_reclaim_thread(void *dummy __unused)
>  		 * infinite loop.
>  		 */
>  		if (arc_size <= arc_c || evicted == 0) {
> -#

Alexander,

I tried to see how the code looks after expanding illumos variables to FreeBSD
variables before and after your change.

Before:
n = PAGESIZE * ((int64_t)freemem - zfs_arc_free_target);
==>
n = PAGESIZE * ((int64_t)vm_cnt.v_free_count - zfs_arc_free_target);

After:
n = PAGESIZE * (freemem - lotsfree - needfree - desfree);
==>
n = PAGESIZE * ((long)vm_cnt.v_free_count - zfs_arc_free_target -
(long)vm_pageout_deficit - (long)vm_cnt.v_free_target);

Default value of zfs_arc_free_target is vm_pageout_wakeup_thresh and its default
value is (vm_cnt.v_free_min / 10) * 11.

vm_pageout_deficit is probably just a noise most of the time.

But v_free_target is a substantial value (even greater than the default
zfs_arc_free_target).

It seems that now we subtract much more than we did before.
So, this change does not merely reduce diff, it also changes ARC sizing behavior.

I wonder how much testing have you done for this change and if you can qualify
ARC size behavior in various scenarios.  I expect that with your change the ARC
would more easily give in to the memory pressure.  That may delight some, but it
could be an issue for others.  Especially if it forces ARC to its minimum size
for no good reason.

P.S.
My impression is that the page daemon in illumos has a different algorithm from
our page daemon, so some similarities could be misleading rather than helpful.

-- 
Andriy Gapon

From owner-svn-src-all@freebsd.org  Wed Dec 14 12:47:36 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B560C765DF;
 Wed, 14 Dec 2016 12:47:36 +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 13DA71E37;
 Wed, 14 Dec 2016 12:47:36 +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 uBEClZkc008783;
 Wed, 14 Dec 2016 12:47:35 GMT (envelope-from ed@FreeBSD.org)
Received: (from ed@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEClYYq008778;
 Wed, 14 Dec 2016 12:47:34 GMT (envelope-from ed@FreeBSD.org)
Message-Id: <201612141247.uBEClYYq008778@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org
 using -f
From: Ed Schouten <ed@FreeBSD.org>
Date: Wed, 14 Dec 2016 12:47:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310051 - in head: share/man/man9 sys/kern sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 12:47:36 -0000

Author: ed
Date: Wed Dec 14 12:47:34 2016
New Revision: 310051
URL: https://svnweb.freebsd.org/changeset/base/310051

Log:
  Add support for attaching aggregation labels to sysctl objects.
  
  I'm currently working on writing a metrics exporter for the Prometheus
  monitoring system to provide access to sysctl metrics. Prometheus and
  sysctl have some structural differences:
  
  - sysctl is a tree of string component names.
  - Prometheus uses a flat namespace for its metrics, but allows you to
    attach labels with values to them, so that you can do aggregation.
  
  An initial version of my exporter simply translated
  
      hw.acpi.thermal.tz1.temperature
  
  to
  
      sysctl_hw_acpi_thermal_tz1_temperature_celcius
  
  while we should ideally have
  
      sysctl_hw_acpi_thermal_temperature_celcius{thermal_zone="tz1"}
  
  allowing you to graph all thermal zones on a system in one go.
  
  The change presented in this commit adds support for accomplishing this,
  by providing the ability to attach labels to nodes. In the example I
  gave above, the label "thermal_zone" would be attached to "tz1". As this
  is a feature that will only be used very rarely, I decided to not change
  the KPI too aggressively.
  
  Discussed on:	hackers@
  Reviewed by:	cem
  Differential Revision:	https://reviews.freebsd.org/D8775

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/sysctl.9
  head/share/man/man9/sysctl_add_oid.9
  head/sys/kern/kern_sysctl.c
  head/sys/sys/sysctl.h

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Wed Dec 14 11:40:31 2016	(r310050)
+++ head/share/man/man9/Makefile	Wed Dec 14 12:47:34 2016	(r310051)
@@ -1712,6 +1712,7 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \
 	sysctl.9 SYSCTL_ADD_INT.9 \
 	sysctl.9 SYSCTL_ADD_LONG.9 \
 	sysctl.9 SYSCTL_ADD_NODE.9 \
+	sysctl.9 SYSCTL_ADD_NODE_WITH_LABEL.9 \
 	sysctl.9 SYSCTL_ADD_OPAQUE.9 \
 	sysctl.9 SYSCTL_ADD_PROC.9 \
 	sysctl.9 SYSCTL_ADD_QUAD.9 \
@@ -1735,8 +1736,10 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \
 	sysctl.9 SYSCTL_NODE_CHILDREN.9 \
 	sysctl.9 SYSCTL_PARENT.9 \
 	sysctl.9 SYSCTL_INT.9 \
+	sysctl.9 SYSCTL_INT_WITH_LABEL.9 \
 	sysctl.9 SYSCTL_LONG.9 \
 	sysctl.9 SYSCTL_NODE.9 \
+	sysctl.9 SYSCTL_NODE_WITH_LABEL.9 \
 	sysctl.9 SYSCTL_OPAQUE.9 \
 	sysctl.9 SYSCTL_PROC.9 \
 	sysctl.9 SYSCTL_QUAD.9 \

Modified: head/share/man/man9/sysctl.9
==============================================================================
--- head/share/man/man9/sysctl.9	Wed Dec 14 11:40:31 2016	(r310050)
+++ head/share/man/man9/sysctl.9	Wed Dec 14 12:47:34 2016	(r310051)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 23, 2015
+.Dd December 13, 2016
 .Dt SYSCTL 9
 .Os
 .Sh NAME
@@ -33,6 +33,7 @@
 .Nm SYSCTL_ADD_INT ,
 .Nm SYSCTL_ADD_LONG ,
 .Nm SYSCTL_ADD_NODE ,
+.Nm SYSCTL_ADD_NODE_WITH_LABEL ,
 .Nm SYSCTL_ADD_OPAQUE ,
 .Nm SYSCTL_ADD_PROC ,
 .Nm SYSCTL_ADD_QUAD ,
@@ -56,8 +57,10 @@
 .Nm SYSCTL_NODE_CHILDREN ,
 .Nm SYSCTL_PARENT ,
 .Nm SYSCTL_INT ,
+.Nm SYSCTL_INT_WITH_LABEL ,
 .Nm SYSCTL_LONG ,
 .Nm SYSCTL_NODE ,
+.Nm SYSCTL_NODE_WITH_LABEL ,
 .Nm SYSCTL_OPAQUE ,
 .Nm SYSCTL_PROC ,
 .Nm SYSCTL_QUAD ,
@@ -112,6 +115,17 @@
 .Fa "const char *descr"
 .Fc
 .Ft struct sysctl_oid *
+.Fo SYSCTL_ADD_NODE_WITH_LABEL
+.Fa "struct sysctl_ctx_list *ctx"
+.Fa "struct sysctl_oid_list *parent"
+.Fa "int number"
+.Fa "const char *name"
+.Fa "int ctlflags"
+.Fa "int (*handler)(SYSCTL_HANDLER_ARGS)"
+.Fa "const char *descr"
+.Fa "const char *label"
+.Fc
+.Ft struct sysctl_oid *
 .Fo SYSCTL_ADD_OPAQUE
 .Fa "struct sysctl_ctx_list *ctx"
 .Fa "struct sysctl_oid_list *parent"
@@ -324,8 +338,10 @@
 .Fa "struct sysctl_oid *oid"
 .Fc
 .Fn SYSCTL_INT parent number name ctlflags ptr val descr
+.Fn SYSCTL_INT_WITH_LABEL parent number name ctlflags ptr val descr label
 .Fn SYSCTL_LONG parent number name ctlflags ptr val descr
 .Fn SYSCTL_NODE parent number name ctlflags handler descr
+.Fn SYSCTL_NODE_WITH_LABEL parent number name ctlflags handler descr label
 .Fn SYSCTL_OPAQUE parent number name ctlflags ptr len format descr
 .Fn SYSCTL_PROC parent number name ctlflags arg1 arg2 handler format descr
 .Fn SYSCTL_QUAD parent number name ctlflags ptr val descr
@@ -459,6 +475,18 @@ structures
 .El
 .It Fa descr
 A pointer to a textual description of the OID.
+.It Fa label
+A pointer to an aggregation label for this component of the OID.
+To make it easier to export sysctl data to monitoring systems that
+support aggregations through labels (e.g., Prometheus),
+this argument can be used to attach a label name to an OID.
+The label acts as a hint that this component's name should not be part
+of the metric's name,
+but attached to the metric as a label instead.
+.Pp
+Labels should only be applied to siblings that are structurally similar
+and encode the same type of value,
+as aggregation is of no use otherwise.
 .El
 .Sh CREATING ROOT NODES
 Sysctl MIBs or OIDs are created in a hierarchical tree.
@@ -517,8 +545,10 @@ accessible, or needs to be processed bef
 .Sh CREATING A STATIC SYSCTL
 Static sysctls are declared using one of the
 .Fn SYSCTL_INT ,
+.Fn SYSCTL_INT_WITH_LABEL ,
 .Fn SYSCTL_LONG ,
 .Fn SYSCTL_NODE ,
+.Fn SYSCTL_NODE_WITH_LABEL ,
 .Fn SYSCTL_OPAQUE ,
 .Fn SYSCTL_PROC ,
 .Fn SYSCTL_QUAD ,
@@ -543,6 +573,7 @@ Dynamic nodes are created using one of t
 .Fn SYSCTL_ADD_INT ,
 .Fn SYSCTL_ADD_LONG ,
 .Fn SYSCTL_ADD_NODE ,
+.Fn SYSCTL_ADD_NODE_WITH_LABEL ,
 .Fn SYSCTL_ADD_OPAQUE ,
 .Fn SYSCTL_ADD_PROC ,
 .Fn SYSCTL_ADD_QUAD ,

Modified: head/share/man/man9/sysctl_add_oid.9
==============================================================================
--- head/share/man/man9/sysctl_add_oid.9	Wed Dec 14 11:40:31 2016	(r310050)
+++ head/share/man/man9/sysctl_add_oid.9	Wed Dec 14 12:47:34 2016	(r310051)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 6, 2015
+.Dd December 13, 2016
 .Dt SYSCTL_ADD_OID 9
 .Os
 .Sh NAME
@@ -51,6 +51,7 @@
 .Fa "int (*handler) (SYSCTL_HANDLER_ARGS)"
 .Fa "const char *format"
 .Fa "const char *descr"
+.Fa "const char *label"
 .Fc
 .Ft int
 .Fo sysctl_move_oid

Modified: head/sys/kern/kern_sysctl.c
==============================================================================
--- head/sys/kern/kern_sysctl.c	Wed Dec 14 11:40:31 2016	(r310050)
+++ head/sys/kern/kern_sysctl.c	Wed Dec 14 12:47:34 2016	(r310051)
@@ -678,6 +678,9 @@ sysctl_remove_oid_locked(struct sysctl_o
 			if (oidp->oid_descr)
 				free(__DECONST(char *, oidp->oid_descr),
 				    M_SYSCTLOID);
+			if (oidp->oid_label)
+				free(__DECONST(char *, oidp->oid_label),
+				    M_SYSCTLOID);
 			free(__DECONST(char *, oidp->oid_name), M_SYSCTLOID);
 			free(oidp, M_SYSCTLOID);
 		}
@@ -691,7 +694,8 @@ sysctl_remove_oid_locked(struct sysctl_o
 struct sysctl_oid *
 sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent,
 	int number, const char *name, int kind, void *arg1, intmax_t arg2,
-	int (*handler)(SYSCTL_HANDLER_ARGS), const char *fmt, const char *descr)
+	int (*handler)(SYSCTL_HANDLER_ARGS), const char *fmt, const char *descr,
+	const char *label)
 {
 	struct sysctl_oid *oidp;
 
@@ -728,6 +732,8 @@ sysctl_add_oid(struct sysctl_ctx_list *c
 	oidp->oid_fmt = fmt;
 	if (descr != NULL)
 		oidp->oid_descr = strdup(descr, M_SYSCTLOID);
+	if (label != NULL)
+		oidp->oid_label = strdup(label, M_SYSCTLOID);
 	/* Update the context, if used */
 	if (clist != NULL)
 		sysctl_ctx_entry_add(clist, oidp);
@@ -1176,6 +1182,31 @@ sysctl_sysctl_oiddescr(SYSCTL_HANDLER_AR
 static SYSCTL_NODE(_sysctl, 5, oiddescr, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLFLAG_CAPRD,
     sysctl_sysctl_oiddescr, "");
 
+static int
+sysctl_sysctl_oidlabel(SYSCTL_HANDLER_ARGS)
+{
+	struct sysctl_oid *oid;
+	struct rm_priotracker tracker;
+	int error;
+
+	SYSCTL_RLOCK(&tracker);
+	error = sysctl_find_oid(arg1, arg2, &oid, NULL, req);
+	if (error)
+		goto out;
+
+	if (oid->oid_label == NULL) {
+		error = ENOENT;
+		goto out;
+	}
+	error = SYSCTL_OUT(req, oid->oid_label, strlen(oid->oid_label) + 1);
+ out:
+	SYSCTL_RUNLOCK(&tracker);
+	return (error);
+}
+
+static SYSCTL_NODE(_sysctl, 6, oidlabel,
+    CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_oidlabel, "");
+
 /*
  * Default "handler" functions.
  */

Modified: head/sys/sys/sysctl.h
==============================================================================
--- head/sys/sys/sysctl.h	Wed Dec 14 11:40:31 2016	(r310050)
+++ head/sys/sys/sysctl.h	Wed Dec 14 12:47:34 2016	(r310051)
@@ -188,6 +188,7 @@ struct sysctl_oid {
 	int		 oid_refcnt;
 	u_int		 oid_running;
 	const char	*oid_descr;
+	const char	*oid_label;
 };
 
 #define	SYSCTL_IN(r, p, l)	(r->newfunc)(r, p, l)
@@ -252,7 +253,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 #endif
 
 /* This macro is only for internal use */
-#define	SYSCTL_OID_RAW(id, parent_child_head, nbr, name, kind, a1, a2, handler, fmt, descr) \
+#define	SYSCTL_OID_RAW(id, parent_child_head, nbr, name, kind, a1, a2, handler, fmt, descr, label) \
 	struct sysctl_oid id = {					\
 		.oid_parent = (parent_child_head),			\
 		.oid_children = SLIST_HEAD_INITIALIZER(&id.oid_children), \
@@ -263,46 +264,58 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 		.oid_name = (name),					\
 		.oid_handler = (handler),				\
 		.oid_fmt = (fmt),					\
-		.oid_descr = __DESCR(descr)				\
+		.oid_descr = __DESCR(descr),				\
+		.oid_label = (label),					\
 	};								\
 	DATA_SET(sysctl_set, id)
 
 /* This constructs a static "raw" MIB oid. */
 #define	SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
-    static SYSCTL_OID_RAW(sysctl__##parent##_##name, \
-	SYSCTL_CHILDREN(&sysctl__##parent), \
-	nbr, #name, kind, a1, a2, handler, fmt, descr)
+	SYSCTL_OID_WITH_LABEL(parent, nbr, name, kind, a1, a2,		\
+	    handler, fmt, descr, NULL)
+
+#define	SYSCTL_OID_WITH_LABEL(parent, nbr, name, kind, a1, a2, handler, fmt, descr, label) \
+    static SYSCTL_OID_RAW(sysctl__##parent##_##name,			\
+	SYSCTL_CHILDREN(&sysctl__##parent),				\
+	nbr, #name, kind, a1, a2, handler, fmt, descr, label)
 
 /* This constructs a global "raw" MIB oid. */
-#define	SYSCTL_OID_GLOBAL(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
+#define	SYSCTL_OID_GLOBAL(parent, nbr, name, kind, a1, a2, handler, fmt, descr, label) \
     SYSCTL_OID_RAW(sysctl__##parent##_##name, \
 	SYSCTL_CHILDREN(&sysctl__##parent),	\
-	nbr, #name, kind, a1, a2, handler, fmt, descr)
+	nbr, #name, kind, a1, a2, handler, fmt, descr, label)
 
 #define	SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
-	sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, __DESCR(descr))
+	sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, __DESCR(descr), NULL)
 
 /* This constructs a root node from which other nodes can hang. */
 #define	SYSCTL_ROOT_NODE(nbr, name, access, handler, descr)	\
 	SYSCTL_OID_RAW(sysctl___##name, &sysctl__children,	\
 	    nbr, #name, CTLTYPE_NODE|(access), NULL, 0,		\
-	    handler, "N", descr);				\
+	    handler, "N", descr, NULL);				\
 	CTASSERT(((access) & CTLTYPE) == 0 ||			\
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE)
 
 /* This constructs a node from which other oids can hang. */
-#define	SYSCTL_NODE(parent, nbr, name, access, handler, descr)		\
+#define	SYSCTL_NODE(parent, nbr, name, access, handler, descr) \
+	SYSCTL_NODE_WITH_LABEL(parent, nbr, name, access, handler, descr, NULL)
+
+#define	SYSCTL_NODE_WITH_LABEL(parent, nbr, name, access, handler, descr, label) \
 	SYSCTL_OID_GLOBAL(parent, nbr, name, CTLTYPE_NODE|(access),	\
-	    NULL, 0, handler, "N", descr);				\
+	    NULL, 0, handler, "N", descr, label);			\
 	CTASSERT(((access) & CTLTYPE) == 0 ||				\
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE)
 
 #define	SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr)	\
+	SYSCTL_ADD_NODE_WITH_LABEL(ctx, parent, nbr, name, access, \
+	    handler, descr, NULL)
+
+#define	SYSCTL_ADD_NODE_WITH_LABEL(ctx, parent, nbr, name, access, handler, descr, label) \
 ({									\
 	CTASSERT(((access) & CTLTYPE) == 0 ||				\
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE);	\
 	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access),	\
-	    NULL, 0, handler, "N", __DESCR(descr));			\
+	    NULL, 0, handler, "N", __DESCR(descr), label);		\
 })
 
 #define	SYSCTL_ADD_ROOT_NODE(ctx, nbr, name, access, handler, descr)	\
@@ -311,7 +324,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE);	\
 	sysctl_add_oid(ctx, &sysctl__children, nbr, name,		\
 	    CTLTYPE_NODE|(access),					\
-	    NULL, 0, handler, "N", __DESCR(descr));			\
+	    NULL, 0, handler, "N", __DESCR(descr), NULL);		\
 })
 
 /* Oid for a string.  len can be 0 to indicate '\0' termination. */
@@ -327,7 +340,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	CTASSERT(((access) & CTLTYPE) == 0 ||				\
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING);	\
 	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|(access),	\
-	    __arg, len, sysctl_handle_string, "A", __DESCR(descr));	\
+	    __arg, len, sysctl_handle_string, "A", __DESCR(descr),	\
+	    NULL); \
 })
 
 /* Oid for a bool.  If ptr is NULL, val is returned. */
@@ -345,7 +359,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	CTASSERT(((access) & CTLTYPE) == 0);				\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_U8 | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, val, sysctl_handle_bool, "CU", __DESCR(descr));	\
+	    __ptr, val, sysctl_handle_bool, "CU", __DESCR(descr),	\
+	    NULL);							\
 })
 
 /* Oid for a signed 8-bit int.  If ptr is NULL, val is returned. */
@@ -365,7 +380,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S8);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_S8 | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, val, sysctl_handle_8, "C", __DESCR(descr));	\
+	    __ptr, val, sysctl_handle_8, "C", __DESCR(descr), NULL);	\
 })
 
 /* Oid for an unsigned 8-bit int.  If ptr is NULL, val is returned. */
@@ -385,7 +400,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U8);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_U8 | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, val, sysctl_handle_8, "CU", __DESCR(descr));	\
+	    __ptr, val, sysctl_handle_8, "CU", __DESCR(descr), NULL);	\
 })
 
 /* Oid for a signed 16-bit int.  If ptr is NULL, val is returned. */
@@ -405,7 +420,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S16);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_S16 | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, val, sysctl_handle_16, "S", __DESCR(descr));	\
+	    __ptr, val, sysctl_handle_16, "S", __DESCR(descr), NULL);	\
 })
 
 /* Oid for an unsigned 16-bit int.  If ptr is NULL, val is returned. */
@@ -425,7 +440,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U16);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_U16 | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, val, sysctl_handle_16, "SU", __DESCR(descr));	\
+	    __ptr, val, sysctl_handle_16, "SU", __DESCR(descr), NULL);	\
 })
 
 /* Oid for a signed 32-bit int.  If ptr is NULL, val is returned. */
@@ -445,7 +460,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S32);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_S32 | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, val, sysctl_handle_32, "I", __DESCR(descr));	\
+	    __ptr, val, sysctl_handle_32, "I", __DESCR(descr), NULL);	\
 })
 
 /* Oid for an unsigned 32-bit int.  If ptr is NULL, val is returned. */
@@ -465,7 +480,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U32);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_U32 | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, val, sysctl_handle_32, "IU", __DESCR(descr));	\
+	    __ptr, val, sysctl_handle_32, "IU", __DESCR(descr), NULL);	\
 })
 
 /* Oid for a signed 64-bit int.  If ptr is NULL, val is returned. */
@@ -485,7 +500,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_S64 | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, val, sysctl_handle_64, "Q", __DESCR(descr));	\
+	    __ptr, val, sysctl_handle_64, "Q", __DESCR(descr), NULL);	\
 })
 
 /* Oid for an unsigned 64-bit int.  If ptr is NULL, val is returned. */
@@ -505,16 +520,19 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_U64 | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, val, sysctl_handle_64, "QU", __DESCR(descr));	\
+	    __ptr, val, sysctl_handle_64, "QU", __DESCR(descr), NULL);	\
 })
 
 /* Oid for an int.  If ptr is SYSCTL_NULL_INT_PTR, val is returned. */
 #define	SYSCTL_NULL_INT_PTR ((int *)NULL)
-#define	SYSCTL_INT(parent, nbr, name, access, ptr, val, descr)	\
-	SYSCTL_OID(parent, nbr, name,				\
-	    CTLTYPE_INT | CTLFLAG_MPSAFE | (access),		\
-	    ptr, val, sysctl_handle_int, "I", descr);		\
-	CTASSERT((((access) & CTLTYPE) == 0 ||			\
+#define	SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) \
+	SYSCTL_INT_WITH_LABEL(parent, nbr, name, access, ptr, val, descr, NULL)
+
+#define	SYSCTL_INT_WITH_LABEL(parent, nbr, name, access, ptr, val, descr, label) \
+	SYSCTL_OID_WITH_LABEL(parent, nbr, name,			\
+	    CTLTYPE_INT | CTLFLAG_MPSAFE | (access),			\
+	    ptr, val, sysctl_handle_int, "I", descr, label);		\
+	CTASSERT((((access) & CTLTYPE) == 0 ||				\
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT) && \
 	    sizeof(int) == sizeof(*(ptr)))
 
@@ -525,7 +543,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_INT | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, val, sysctl_handle_int, "I", __DESCR(descr));	\
+	    __ptr, val, sysctl_handle_int, "I", __DESCR(descr), NULL);	\
 })
 
 /* Oid for an unsigned int.  If ptr is NULL, val is returned. */
@@ -545,7 +563,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_UINT);	\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_UINT | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, val, sysctl_handle_int, "IU", __DESCR(descr));	\
+	    __ptr, val, sysctl_handle_int, "IU", __DESCR(descr), NULL);	\
 })
 
 /* Oid for a long.  The pointer must be non NULL. */
@@ -565,7 +583,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_LONG);	\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_LONG | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, 0, sysctl_handle_long, "L", __DESCR(descr));		\
+	    __ptr, 0, sysctl_handle_long, "L", __DESCR(descr), NULL);	\
 })
 
 /* Oid for an unsigned long.  The pointer must be non NULL. */
@@ -585,7 +603,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_ULONG);	\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, 0, sysctl_handle_long, "LU", __DESCR(descr));	\
+	    __ptr, 0, sysctl_handle_long, "LU", __DESCR(descr), NULL);	\
 })
 
 /* Oid for a quad.  The pointer must be non NULL. */
@@ -605,7 +623,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_S64 | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, 0, sysctl_handle_64, "Q", __DESCR(descr));		\
+	    __ptr, 0, sysctl_handle_64, "Q", __DESCR(descr), NULL);	\
 })
 
 #define	SYSCTL_NULL_UQUAD_PTR ((uint64_t *)NULL)
@@ -624,7 +642,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_U64 | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, 0, sysctl_handle_64, "QU", __DESCR(descr));		\
+	    __ptr, 0, sysctl_handle_64, "QU", __DESCR(descr), NULL);	\
 })
 
 /* Oid for a CPU dependent variable */
@@ -638,12 +656,12 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 		__ret = sysctl_add_oid(ctx, parent, nbr, name,		\
 		    CTLTYPE_U64 | CTLFLAG_MPSAFE | (access),		\
 		    (ptr), 0, sysctl_handle_64, "QU",			\
-		    __DESCR(descr));					\
+		    __DESCR(descr), NULL);				\
 	} else {							\
 		__ret = sysctl_add_oid(ctx, parent, nbr, name,		\
 		    CTLTYPE_UINT | CTLFLAG_MPSAFE | (access),		\
 		    (ptr), 0, sysctl_handle_int, "IU",			\
-		    __DESCR(descr));					\
+		    __DESCR(descr), NULL);				\
 	}								\
 	__ret;								\
 })
@@ -665,7 +683,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_U64 | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr));	\
+	    __ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr),	\
+	    NULL);							\
 })
 
 /* Oid for an array of counter(9)s.  The pointer and length must be non zero. */
@@ -687,7 +706,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access),			\
 	    __ptr, len, sysctl_handle_counter_u64_array, "S",		\
-	    __DESCR(descr));						\
+	    __DESCR(descr), NULL);					\
 })
 
 /* Oid for an opaque object.  Specified by a pointer and a length. */
@@ -702,7 +721,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	CTASSERT(((access) & CTLTYPE) == 0 ||				\
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE);	\
 	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access),	\
-	    ptr, len, sysctl_handle_opaque, fmt, __DESCR(descr));	\
+	    ptr, len, sysctl_handle_opaque, fmt, __DESCR(descr), NULL);	\
 })
 
 /* Oid for a struct.  Specified by a pointer and a type. */
@@ -719,7 +738,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE);	\
 	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access),	\
 	    (ptr), sizeof(struct type),					\
-	    sysctl_handle_opaque, "S," #type, __DESCR(descr));		\
+	    sysctl_handle_opaque, "S," #type, __DESCR(descr), NULL);	\
 })
 
 /* Oid for a procedure.  Specified by a pointer and an arg. */
@@ -732,7 +751,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 ({									\
 	CTASSERT(((access) & CTLTYPE) != 0);				\
 	sysctl_add_oid(ctx, parent, nbr, name, (access),		\
-	    (ptr), (arg), (handler), (fmt), __DESCR(descr));		\
+	    (ptr), (arg), (handler), (fmt), __DESCR(descr), NULL);	\
 })
 
 /* Oid to handle limits on uma(9) zone specified by pointer. */
@@ -750,7 +769,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_INT | CTLFLAG_MPSAFE | (access),			\
-	    __ptr, 0, sysctl_handle_uma_zone_max, "I", __DESCR(descr));	\
+	    __ptr, 0, sysctl_handle_uma_zone_max, "I", __DESCR(descr),	\
+	    NULL);							\
 })
 
 /* Oid to obtain current use of uma(9) zone specified by pointer. */
@@ -768,7 +788,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT);		\
 	sysctl_add_oid(ctx, parent, nbr, name,				\
 	    CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access),	\
-	    __ptr, 0, sysctl_handle_uma_zone_cur, "I", __DESCR(descr));	\
+	    __ptr, 0, sysctl_handle_uma_zone_cur, "I", __DESCR(descr),	\
+	    NULL);							\
 })
 
 /*
@@ -993,7 +1014,7 @@ extern char	kern_ident[];
 struct sysctl_oid *sysctl_add_oid(struct sysctl_ctx_list *clist,
 	    struct sysctl_oid_list *parent, int nbr, const char *name, int kind,
 	    void *arg1, intmax_t arg2, int (*handler)(SYSCTL_HANDLER_ARGS),
-	    const char *fmt, const char *descr);
+	    const char *fmt, const char *descr, const char *label);
 int	sysctl_remove_name(struct sysctl_oid *parent, const char *name, int del,
 	    int recurse);
 void	sysctl_rename_oid(struct sysctl_oid *oidp, const char *name);

From owner-svn-src-all@freebsd.org  Wed Dec 14 12:53:35 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59619C76884;
 Wed, 14 Dec 2016 12:53:35 +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 1A4C81321;
 Wed, 14 Dec 2016 12:53:35 +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 uBECrYkf012694;
 Wed, 14 Dec 2016 12:53:34 GMT (envelope-from ed@FreeBSD.org)
Received: (from ed@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBECrXZ1012688;
 Wed, 14 Dec 2016 12:53:33 GMT (envelope-from ed@FreeBSD.org)
Message-Id: <201612141253.uBECrXZ1012688@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org
 using -f
From: Ed Schouten <ed@FreeBSD.org>
Date: Wed, 14 Dec 2016 12:53:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310052 - in head/sys/cam: ata nvme scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 12:53:35 -0000

Author: ed
Date: Wed Dec 14 12:53:33 2016
New Revision: 310052
URL: https://svnweb.freebsd.org/changeset/base/310052

Log:
  Add label annotations to CAM sysctls.
  
  Under kern.cam we have certain sysctls that are per-device, such as the
  ones under kern.cam.ada.[0-9]+.*. Add a "device_index" label annotation
  to such sysctls, so that the Prometheus metrics exporter will give all
  of those metrics the same name. The device number will be added to the
  metric name as the "device_index" label.
  
  Reviewed by:	cem
  Differential Revision:	https://reviews.freebsd.org/D8775

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_pmp.c
  head/sys/cam/nvme/nvme_da.c
  head/sys/cam/scsi/scsi_cd.c
  head/sys/cam/scsi/scsi_da.c
  head/sys/cam/scsi/scsi_sa.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Wed Dec 14 12:47:34 2016	(r310051)
+++ head/sys/cam/ata/ata_da.c	Wed Dec 14 12:53:33 2016	(r310052)
@@ -1394,9 +1394,9 @@ adasysctlinit(void *context, int pending
 
 	sysctl_ctx_init(&softc->sysctl_ctx);
 	softc->flags |= ADA_FLAG_SCTX_INIT;
-	softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
+	softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx,
 		SYSCTL_STATIC_CHILDREN(_kern_cam_ada), OID_AUTO, tmpstr2,
-		CTLFLAG_RD, 0, tmpstr);
+		CTLFLAG_RD, 0, tmpstr, "device_index");
 	if (softc->sysctl_tree == NULL) {
 		printf("adasysctlinit: unable to allocate sysctl tree\n");
 		cam_periph_release(periph);

Modified: head/sys/cam/ata/ata_pmp.c
==============================================================================
--- head/sys/cam/ata/ata_pmp.c	Wed Dec 14 12:47:34 2016	(r310051)
+++ head/sys/cam/ata/ata_pmp.c	Wed Dec 14 12:53:33 2016	(r310052)
@@ -350,9 +350,9 @@ pmpsysctlinit(void *context, int pending
 
 	sysctl_ctx_init(&softc->sysctl_ctx);
 	softc->flags |= PMP_FLAG_SCTX_INIT;
-	softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
+	softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx,
 		SYSCTL_STATIC_CHILDREN(_kern_cam_pmp), OID_AUTO, tmpstr2,
-		CTLFLAG_RD, 0, tmpstr);
+		CTLFLAG_RD, 0, tmpstr, "device_index");
 	if (softc->sysctl_tree == NULL) {
 		printf("pmpsysctlinit: unable to allocate sysctl tree\n");
 		cam_periph_release(periph);

Modified: head/sys/cam/nvme/nvme_da.c
==============================================================================
--- head/sys/cam/nvme/nvme_da.c	Wed Dec 14 12:47:34 2016	(r310051)
+++ head/sys/cam/nvme/nvme_da.c	Wed Dec 14 12:53:33 2016	(r310052)
@@ -608,9 +608,9 @@ ndasysctlinit(void *context, int pending
 
 	sysctl_ctx_init(&softc->sysctl_ctx);
 	softc->flags |= NDA_FLAG_SCTX_INIT;
-	softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
+	softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx,
 		SYSCTL_STATIC_CHILDREN(_kern_cam_nda), OID_AUTO, tmpstr2,
-		CTLFLAG_RD, 0, tmpstr);
+		CTLFLAG_RD, 0, tmpstr, "device_index");
 	if (softc->sysctl_tree == NULL) {
 		printf("ndasysctlinit: unable to allocate sysctl tree\n");
 		cam_periph_release(periph);

Modified: head/sys/cam/scsi/scsi_cd.c
==============================================================================
--- head/sys/cam/scsi/scsi_cd.c	Wed Dec 14 12:47:34 2016	(r310051)
+++ head/sys/cam/scsi/scsi_cd.c	Wed Dec 14 12:53:33 2016	(r310052)
@@ -481,9 +481,9 @@ cdsysctlinit(void *context, int pending)
 
 	sysctl_ctx_init(&softc->sysctl_ctx);
 	softc->flags |= CD_FLAG_SCTX_INIT;
-	softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
+	softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx,
 		SYSCTL_STATIC_CHILDREN(_kern_cam_cd), OID_AUTO,
-		tmpstr2, CTLFLAG_RD, 0, tmpstr);
+		tmpstr2, CTLFLAG_RD, 0, tmpstr, "device_index");
 
 	if (softc->sysctl_tree == NULL) {
 		printf("cdsysctlinit: unable to allocate sysctl tree\n");

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Wed Dec 14 12:47:34 2016	(r310051)
+++ head/sys/cam/scsi/scsi_da.c	Wed Dec 14 12:53:33 2016	(r310052)
@@ -1924,9 +1924,9 @@ dasysctlinit(void *context, int pending)
 
 	sysctl_ctx_init(&softc->sysctl_ctx);
 	softc->flags |= DA_FLAG_SCTX_INIT;
-	softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
+	softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx,
 		SYSCTL_STATIC_CHILDREN(_kern_cam_da), OID_AUTO, tmpstr2,
-		CTLFLAG_RD, 0, tmpstr);
+		CTLFLAG_RD, 0, tmpstr, "device_index");
 	if (softc->sysctl_tree == NULL) {
 		printf("dasysctlinit: unable to allocate sysctl tree\n");
 		cam_periph_release(periph);

Modified: head/sys/cam/scsi/scsi_sa.c
==============================================================================
--- head/sys/cam/scsi/scsi_sa.c	Wed Dec 14 12:47:34 2016	(r310051)
+++ head/sys/cam/scsi/scsi_sa.c	Wed Dec 14 12:53:33 2016	(r310052)
@@ -2308,9 +2308,9 @@ sasysctlinit(void *context, int pending)
 
 	sysctl_ctx_init(&softc->sysctl_ctx);
 	softc->flags |= SA_FLAG_SCTX_INIT;
-	softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
+	softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx,
 	    SYSCTL_STATIC_CHILDREN(_kern_cam_sa), OID_AUTO, tmpstr2,
-                    CTLFLAG_RD, 0, tmpstr);
+	    CTLFLAG_RD, 0, tmpstr, "device_index");
 	if (softc->sysctl_tree == NULL)
 		goto bailout;
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 12:56:59 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E354C76937;
 Wed, 14 Dec 2016 12:56:59 +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 2452B15B9;
 Wed, 14 Dec 2016 12:56:59 +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 uBECuwLq012864;
 Wed, 14 Dec 2016 12:56:58 GMT (envelope-from ed@FreeBSD.org)
Received: (from ed@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBECuwHv012862;
 Wed, 14 Dec 2016 12:56:58 GMT (envelope-from ed@FreeBSD.org)
Message-Id: <201612141256.uBECuwHv012862@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org
 using -f
From: Ed Schouten <ed@FreeBSD.org>
Date: Wed, 14 Dec 2016 12:56:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310053 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 12:56:59 -0000

Author: ed
Date: Wed Dec 14 12:56:58 2016
New Revision: 310053
URL: https://svnweb.freebsd.org/changeset/base/310053

Log:
  Add labels to sysctls related to clocks.
  
  Sysctls like kern.eventtimer.et.*.quality currently embed the name of
  the clock device. This is problematic for the Prometheus metrics
  exporter for two reasons:
  
  - Some of those clocks have dashes in their names, which Prometheus
    doesn't allow to be used in metric names.
  - It doesn't allow for extracting the same property of all clocks on the
    system from within a single query.
  
  Attach these nodes to have a label, so that the Prometheus metrics
  exporter gives these metric a uniform name with the name of the clock
  attached as a label.
  
  Reviewed by:	cem
  Differential Revision:	https://reviews.freebsd.org/D8775

Modified:
  head/sys/kern/kern_et.c
  head/sys/kern/kern_tc.c

Modified: head/sys/kern/kern_et.c
==============================================================================
--- head/sys/kern/kern_et.c	Wed Dec 14 12:53:33 2016	(r310052)
+++ head/sys/kern/kern_et.c	Wed Dec 14 12:56:58 2016	(r310053)
@@ -66,9 +66,9 @@ et_register(struct eventtimer *et)
 		}
 	}
 	KASSERT(et->et_start, ("et_register: timer has no start function"));
-	et->et_sysctl = SYSCTL_ADD_NODE(NULL,
+	et->et_sysctl = SYSCTL_ADD_NODE_WITH_LABEL(NULL,
 	    SYSCTL_STATIC_CHILDREN(_kern_eventtimer_et), OID_AUTO, et->et_name,
-	    CTLFLAG_RW, 0, "event timer description");
+	    CTLFLAG_RW, 0, "event timer description", "eventtimer");
 	SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO,
 	    "flags", CTLFLAG_RD, &(et->et_flags), 0,
 	    "Event timer capabilities");

Modified: head/sys/kern/kern_tc.c
==============================================================================
--- head/sys/kern/kern_tc.c	Wed Dec 14 12:53:33 2016	(r310052)
+++ head/sys/kern/kern_tc.c	Wed Dec 14 12:56:58 2016	(r310053)
@@ -1218,9 +1218,9 @@ tc_init(struct timecounter *tc)
 	/*
 	 * Set up sysctl tree for this counter.
 	 */
-	tc_root = SYSCTL_ADD_NODE(NULL,
+	tc_root = SYSCTL_ADD_NODE_WITH_LABEL(NULL,
 	    SYSCTL_STATIC_CHILDREN(_kern_timecounter_tc), OID_AUTO, tc->tc_name,
-	    CTLFLAG_RW, 0, "timecounter description");
+	    CTLFLAG_RW, 0, "timecounter description", "timecounter");
 	SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(tc_root), OID_AUTO,
 	    "mask", CTLFLAG_RD, &(tc->tc_counter_mask), 0,
 	    "mask for implemented bits");

From owner-svn-src-all@freebsd.org  Wed Dec 14 13:00:29 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03362C769C0;
 Wed, 14 Dec 2016 13:00:29 +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 C72C4177A;
 Wed, 14 Dec 2016 13:00:28 +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 uBED0RIO013053;
 Wed, 14 Dec 2016 13:00:27 GMT (envelope-from ed@FreeBSD.org)
Received: (from ed@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBED0RPk013052;
 Wed, 14 Dec 2016 13:00:27 GMT (envelope-from ed@FreeBSD.org)
Message-Id: <201612141300.uBED0RPk013052@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org
 using -f
From: Ed Schouten <ed@FreeBSD.org>
Date: Wed, 14 Dec 2016 13:00:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310054 - head/sys/dev/acpica
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 13:00:29 -0000

Author: ed
Date: Wed Dec 14 13:00:27 2016
New Revision: 310054
URL: https://svnweb.freebsd.org/changeset/base/310054

Log:
  Attach a "thermal_zone" label to the ACPI thermal zone sysctls.
  
  In order to make Prometheus do graphing/alerting on thermal sensors in a
  generic fashion, we should attach the name of the thermal zone device as
  a label. That way there is only a single metric for the temperature of a
  thermal zone, with its name attached as a label.
  
  Reviewed by:	cem
  Differential Revision:	https://reviews.freebsd.org/D8775

Modified:
  head/sys/dev/acpica/acpi_thermal.c

Modified: head/sys/dev/acpica/acpi_thermal.c
==============================================================================
--- head/sys/dev/acpica/acpi_thermal.c	Wed Dec 14 12:56:58 2016	(r310053)
+++ head/sys/dev/acpica/acpi_thermal.c	Wed Dec 14 13:00:27 2016	(r310054)
@@ -258,9 +258,9 @@ acpi_tz_attach(device_t dev)
     }
     sysctl_ctx_init(&sc->tz_sysctl_ctx);
     sprintf(oidname, "tz%d", device_get_unit(dev));
-    sc->tz_sysctl_tree = SYSCTL_ADD_NODE(&sc->tz_sysctl_ctx,
-					 SYSCTL_CHILDREN(acpi_tz_sysctl_tree),
-					 OID_AUTO, oidname, CTLFLAG_RD, 0, "");
+    sc->tz_sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&sc->tz_sysctl_ctx,
+			 SYSCTL_CHILDREN(acpi_tz_sysctl_tree),
+			 OID_AUTO, oidname, CTLFLAG_RD, 0, "", "thermal_zone");
     SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
 		    OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD,
 		    &sc->tz_temperature, 0, sysctl_handle_int,

From owner-svn-src-all@freebsd.org  Wed Dec 14 13:03:02 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B84EEC76BC0;
 Wed, 14 Dec 2016 13:03:02 +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 8843C1BC1;
 Wed, 14 Dec 2016 13:03:02 +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 uBED310Z016936;
 Wed, 14 Dec 2016 13:03:01 GMT (envelope-from ed@FreeBSD.org)
Received: (from ed@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBED31wQ016935;
 Wed, 14 Dec 2016 13:03:01 GMT (envelope-from ed@FreeBSD.org)
Message-Id: <201612141303.uBED31wQ016935@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org
 using -f
From: Ed Schouten <ed@FreeBSD.org>
Date: Wed, 14 Dec 2016 13:03:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310055 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 13:03:02 -0000

Author: ed
Date: Wed Dec 14 13:03:01 2016
New Revision: 310055
URL: https://svnweb.freebsd.org/changeset/base/310055

Log:
  Add a "device_index" label to all sysctls under dev.$driver.$index.
  
  This way it becomes possible to graph a property for all instances of a
  single driver. For example, graphing the number of packets across all
  USB controllers, the amount of dropped packets on all NICs, etc.
  
  Reviewed by:	cem
  Differential Revision:	https://reviews.freebsd.org/D8775

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Wed Dec 14 13:00:27 2016	(r310054)
+++ head/sys/kern/subr_bus.c	Wed Dec 14 13:03:01 2016	(r310055)
@@ -288,10 +288,10 @@ device_sysctl_init(device_t dev)
 		return;
 	devclass_sysctl_init(dc);
 	sysctl_ctx_init(&dev->sysctl_ctx);
-	dev->sysctl_tree = SYSCTL_ADD_NODE(&dev->sysctl_ctx,
+	dev->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&dev->sysctl_ctx,
 	    SYSCTL_CHILDREN(dc->sysctl_tree), OID_AUTO,
 	    dev->nameunit + strlen(dc->name),
-	    CTLFLAG_RD, NULL, "");
+	    CTLFLAG_RD, NULL, "", "device_index");
 	SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree),
 	    OID_AUTO, "%desc", CTLTYPE_STRING | CTLFLAG_RD,
 	    dev, DEVICE_SYSCTL_DESC, device_sysctl_handler, "A",

From owner-svn-src-all@freebsd.org  Wed Dec 14 13:05:06 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 042C8C76C50;
 Wed, 14 Dec 2016 13:05:06 +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 C80B01D66;
 Wed, 14 Dec 2016 13:05:05 +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 uBED544S017048;
 Wed, 14 Dec 2016 13:05:04 GMT (envelope-from ed@FreeBSD.org)
Received: (from ed@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBED54Sb017047;
 Wed, 14 Dec 2016 13:05:04 GMT (envelope-from ed@FreeBSD.org)
Message-Id: <201612141305.uBED54Sb017047@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org
 using -f
From: Ed Schouten <ed@FreeBSD.org>
Date: Wed, 14 Dec 2016 13:05:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310056 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 13:05:06 -0000

Author: ed
Date: Wed Dec 14 13:05:04 2016
New Revision: 310056
URL: https://svnweb.freebsd.org/changeset/base/310056

Log:
  Let all FEATURE()s use the same Prometheus metric.
  
  Without this change, every individual FEATURE() declaration would have
  an individual metric in Prometheus. Though this wouldn't be harmful, it
  would look very cluttered.
  
  By letting it use a single metric with the name of the feature attached
  as a label, it also becomes easier to search, as you can apply regex
  matching, etc.
  
  Reviewed by:	cem
  Differential Revision:	https://reviews.freebsd.org/D8775

Modified:
  head/sys/sys/sysctl.h

Modified: head/sys/sys/sysctl.h
==============================================================================
--- head/sys/sys/sysctl.h	Wed Dec 14 13:03:01 2016	(r310055)
+++ head/sys/sys/sysctl.h	Wed Dec 14 13:05:04 2016	(r310056)
@@ -796,9 +796,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
  * A macro to generate a read-only sysctl to indicate the presence of optional
  * kernel features.
  */
-#define	FEATURE(name, desc)						\
-	SYSCTL_INT(_kern_features, OID_AUTO, name, CTLFLAG_RD | CTLFLAG_CAPRD, \
-	    SYSCTL_NULL_INT_PTR, 1, desc)
+#define	FEATURE(name, desc, label)					\
+	SYSCTL_INT_WITH_LABEL(_kern_features, OID_AUTO, name,		\
+	    CTLFLAG_RD | CTLFLAG_CAPRD, SYSCTL_NULL_INT_PTR, 1, desc, "feature")
 
 #endif /* _KERNEL */
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 13:35:34 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A01D8C774C9;
 Wed, 14 Dec 2016 13:35:34 +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 6FA171B4C;
 Wed, 14 Dec 2016 13:35:34 +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 uBEDZXVI028735;
 Wed, 14 Dec 2016 13:35:33 GMT (envelope-from ed@FreeBSD.org)
Received: (from ed@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEDZXLh028734;
 Wed, 14 Dec 2016 13:35:33 GMT (envelope-from ed@FreeBSD.org)
Message-Id: <201612141335.uBEDZXLh028734@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org
 using -f
From: Ed Schouten <ed@FreeBSD.org>
Date: Wed, 14 Dec 2016 13:35:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310057 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 13:35:34 -0000

Author: ed
Date: Wed Dec 14 13:35:33 2016
New Revision: 310057
URL: https://svnweb.freebsd.org/changeset/base/310057

Log:
  Revert accidental change made in r310056.
  
  Because I had to cherry-pick some of my changes in r310051, I
  accidentally made a typo when manually applying the rest in r310056.

Modified:
  head/sys/sys/sysctl.h

Modified: head/sys/sys/sysctl.h
==============================================================================
--- head/sys/sys/sysctl.h	Wed Dec 14 13:05:04 2016	(r310056)
+++ head/sys/sys/sysctl.h	Wed Dec 14 13:35:33 2016	(r310057)
@@ -796,7 +796,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
  * A macro to generate a read-only sysctl to indicate the presence of optional
  * kernel features.
  */
-#define	FEATURE(name, desc, label)					\
+#define	FEATURE(name, desc)						\
 	SYSCTL_INT_WITH_LABEL(_kern_features, OID_AUTO, name,		\
 	    CTLFLAG_RD | CTLFLAG_CAPRD, SYSCTL_NULL_INT_PTR, 1, desc, "feature")
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 14:13:45 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE88AC77164;
 Wed, 14 Dec 2016 14:13:45 +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 6F7C36CC;
 Wed, 14 Dec 2016 14:13:45 +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 uBEEDiFW044937;
 Wed, 14 Dec 2016 14:13:44 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEEDiQ7044936;
 Wed, 14 Dec 2016 14:13:44 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201612141413.uBEEDiQ7044936@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky <hselasky@FreeBSD.org>
Date: Wed, 14 Dec 2016 14:13:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310058 - head/sys/dev/mlx4/mlx4_core
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 14:13:45 -0000

Author: hselasky
Date: Wed Dec 14 14:13:44 2016
New Revision: 310058
URL: https://svnweb.freebsd.org/changeset/base/310058

Log:
  Fix initialisation of mlx4_pci_table's .driver_data fields.
  
  MFC after:		1 week
  Differential Revision:	https://reviews.freebsd.org/D8791
  Sponsored by:		Mellanox Technologies
  Submitted by:		Dexuan Cui <decui@microsoft.com>

Modified:
  head/sys/dev/mlx4/mlx4_core/mlx4_main.c

Modified: head/sys/dev/mlx4/mlx4_core/mlx4_main.c
==============================================================================
--- head/sys/dev/mlx4/mlx4_core/mlx4_main.c	Wed Dec 14 13:35:33 2016	(r310057)
+++ head/sys/dev/mlx4/mlx4_core/mlx4_main.c	Wed Dec 14 14:13:44 2016	(r310058)
@@ -3635,47 +3635,61 @@ int mlx4_restart_one(struct pci_dev *pde
 
 static DEFINE_PCI_DEVICE_TABLE(mlx4_pci_table) = {
 	/* MT25408 "Hermon" SDR */
-	{ PCI_VDEVICE(MELLANOX, 0x6340), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+	{ PCI_VDEVICE(MELLANOX, 0x6340),
+		.driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
 	/* MT25408 "Hermon" DDR */
-	{ PCI_VDEVICE(MELLANOX, 0x634a), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+	{ PCI_VDEVICE(MELLANOX, 0x634a),
+		.driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
 	/* MT25408 "Hermon" QDR */
-	{ PCI_VDEVICE(MELLANOX, 0x6354), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+	{ PCI_VDEVICE(MELLANOX, 0x6354),
+		.driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
 	/* MT25408 "Hermon" DDR PCIe gen2 */
-	{ PCI_VDEVICE(MELLANOX, 0x6732), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+	{ PCI_VDEVICE(MELLANOX, 0x6732),
+		.driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
 	/* MT25408 "Hermon" QDR PCIe gen2 */
-	{ PCI_VDEVICE(MELLANOX, 0x673c), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+	{ PCI_VDEVICE(MELLANOX, 0x673c),
+		.driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
 	/* MT25408 "Hermon" EN 10GigE */
-	{ PCI_VDEVICE(MELLANOX, 0x6368), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+	{ PCI_VDEVICE(MELLANOX, 0x6368),
+		.driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
 	/* MT25408 "Hermon" EN 10GigE PCIe gen2 */
-	{ PCI_VDEVICE(MELLANOX, 0x6750), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+	{ PCI_VDEVICE(MELLANOX, 0x6750),
+		.driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
 	/* MT25458 ConnectX EN 10GBASE-T 10GigE */
-	{ PCI_VDEVICE(MELLANOX, 0x6372), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+	{ PCI_VDEVICE(MELLANOX, 0x6372),
+		.driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
 	/* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */
-	{ PCI_VDEVICE(MELLANOX, 0x675a), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+	{ PCI_VDEVICE(MELLANOX, 0x675a),
+		.driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
 	/* MT26468 ConnectX EN 10GigE PCIe gen2*/
-	{ PCI_VDEVICE(MELLANOX, 0x6764), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+	{ PCI_VDEVICE(MELLANOX, 0x6764),
+		.driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
 	/* MT26438 ConnectX EN 40GigE PCIe gen2 5GT/s */
-	{ PCI_VDEVICE(MELLANOX, 0x6746), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+	{ PCI_VDEVICE(MELLANOX, 0x6746),
+		.driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
 	/* MT26478 ConnectX2 40GigE PCIe gen2 */
-	{ PCI_VDEVICE(MELLANOX, 0x676e), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+	{ PCI_VDEVICE(MELLANOX, 0x676e),
+		.driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
 	/* MT25400 Family [ConnectX-2 Virtual Function] */
-	{ PCI_VDEVICE(MELLANOX, 0x1002), MLX4_PCI_DEV_IS_VF },
+	{ PCI_VDEVICE(MELLANOX, 0x1002),
+		.driver_data = MLX4_PCI_DEV_IS_VF },
 	/* MT27500 Family [ConnectX-3] */
-	{ PCI_VDEVICE(MELLANOX, 0x1003), 0 },
+	{ PCI_VDEVICE(MELLANOX, 0x1003) },
 	/* MT27500 Family [ConnectX-3 Virtual Function] */
-	{ PCI_VDEVICE(MELLANOX, 0x1004), MLX4_PCI_DEV_IS_VF },
-	{ PCI_VDEVICE(MELLANOX, 0x1005), 0 }, /* MT27510 Family */
-	{ PCI_VDEVICE(MELLANOX, 0x1006), 0 }, /* MT27511 Family */
-	{ PCI_VDEVICE(MELLANOX, 0x1007), 0 }, /* MT27520 Family */
-	{ PCI_VDEVICE(MELLANOX, 0x1008), 0 }, /* MT27521 Family */
-	{ PCI_VDEVICE(MELLANOX, 0x1009), 0 }, /* MT27530 Family */
-	{ PCI_VDEVICE(MELLANOX, 0x100a), 0 }, /* MT27531 Family */
-	{ PCI_VDEVICE(MELLANOX, 0x100b), 0 }, /* MT27540 Family */
-	{ PCI_VDEVICE(MELLANOX, 0x100c), 0 }, /* MT27541 Family */
-	{ PCI_VDEVICE(MELLANOX, 0x100d), 0 }, /* MT27550 Family */
-	{ PCI_VDEVICE(MELLANOX, 0x100e), 0 }, /* MT27551 Family */
-	{ PCI_VDEVICE(MELLANOX, 0x100f), 0 }, /* MT27560 Family */
-	{ PCI_VDEVICE(MELLANOX, 0x1010), 0 }, /* MT27561 Family */
+	{ PCI_VDEVICE(MELLANOX, 0x1004),
+		.driver_data = MLX4_PCI_DEV_IS_VF },
+	{ PCI_VDEVICE(MELLANOX, 0x1005) }, /* MT27510 Family */
+	{ PCI_VDEVICE(MELLANOX, 0x1006) }, /* MT27511 Family */
+	{ PCI_VDEVICE(MELLANOX, 0x1007) }, /* MT27520 Family */
+	{ PCI_VDEVICE(MELLANOX, 0x1008) }, /* MT27521 Family */
+	{ PCI_VDEVICE(MELLANOX, 0x1009) }, /* MT27530 Family */
+	{ PCI_VDEVICE(MELLANOX, 0x100a) }, /* MT27531 Family */
+	{ PCI_VDEVICE(MELLANOX, 0x100b) }, /* MT27540 Family */
+	{ PCI_VDEVICE(MELLANOX, 0x100c) }, /* MT27541 Family */
+	{ PCI_VDEVICE(MELLANOX, 0x100d) }, /* MT27550 Family */
+	{ PCI_VDEVICE(MELLANOX, 0x100e) }, /* MT27551 Family */
+	{ PCI_VDEVICE(MELLANOX, 0x100f) }, /* MT27560 Family */
+	{ PCI_VDEVICE(MELLANOX, 0x1010) }, /* MT27561 Family */
 	{ 0, }
 };
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 14:20:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A89C772F5;
 Wed, 14 Dec 2016 14:20:33 +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 823BCA2D;
 Wed, 14 Dec 2016 14:20:33 +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 uBEEKWEw045238;
 Wed, 14 Dec 2016 14:20:32 GMT (envelope-from des@FreeBSD.org)
Received: (from des@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEEKWNZ045234;
 Wed, 14 Dec 2016 14:20:32 GMT (envelope-from des@FreeBSD.org)
Message-Id: <201612141420.uBEEKWNZ045234@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?= <des@FreeBSD.org>
Date: Wed, 14 Dec 2016 14:20:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310059 - stable/11/lib/libfetch
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 14:20:33 -0000

Author: des
Date: Wed Dec 14 14:20:32 2016
New Revision: 310059
URL: https://svnweb.freebsd.org/changeset/base/310059

Log:
  MFH (r308996, r309051, r309738): refactor, avoid repeating DNS requests

Modified:
  stable/11/lib/libfetch/common.c
  stable/11/lib/libfetch/common.h
  stable/11/lib/libfetch/ftp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libfetch/common.c
==============================================================================
--- stable/11/lib/libfetch/common.c	Wed Dec 14 14:13:44 2016	(r310058)
+++ stable/11/lib/libfetch/common.c	Wed Dec 14 14:20:32 2016	(r310059)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 1998-2014 Dag-Erling Smørgrav
+ * Copyright (c) 1998-2016 Dag-Erling Smørgrav
  * Copyright (c) 2013 Michael Gmelin <freebsd@grem.de>
  * All rights reserved.
  *
@@ -241,27 +241,79 @@ fetch_ref(conn_t *conn)
 
 
 /*
+ * Resolve an address
+ */
+struct addrinfo *
+fetch_resolve(const char *addr, int port, int af)
+{
+	char hbuf[256], sbuf[8];
+	struct addrinfo hints, *res;
+	const char *sep, *host, *service;
+	int err, len;
+
+	/* split address if necessary */
+	err = EAI_SYSTEM;
+	if ((sep = strchr(addr, ':')) != NULL) {
+		len = snprintf(hbuf, sizeof(hbuf),
+		    "%.*s", (int)(sep - addr), addr);
+		if (len < 0)
+			return (NULL);
+		if (len >= (int)sizeof(hbuf)) {
+			errno = ENAMETOOLONG;
+			fetch_syserr();
+			return (NULL);
+		}
+		host = hbuf;
+		service = sep + 1;
+	} else if (port != 0) {
+		if (port < 1 || port > 65535) {
+			errno = EINVAL;
+			fetch_syserr();
+			return (NULL);
+		}
+		if (snprintf(sbuf, sizeof(sbuf), "%d", port) < 0) {
+			fetch_syserr();
+			return (NULL);
+		}
+		host = addr;
+		service = sbuf;
+	} else {
+		host = addr;
+		service = NULL;
+	}
+
+	/* resolve */
+	memset(&hints, 0, sizeof(hints));
+	hints.ai_family = af;
+	hints.ai_socktype = SOCK_STREAM;
+	hints.ai_flags = AI_ADDRCONFIG;
+	if ((err = getaddrinfo(host, service, &hints, &res)) != 0) {
+		netdb_seterr(err);
+		return (NULL);
+	}
+	return (res);
+}
+
+
+
+/*
  * Bind a socket to a specific local address
  */
 int
 fetch_bind(int sd, int af, const char *addr)
 {
-	struct addrinfo hints, *res, *res0;
+	struct addrinfo *cliai, *ai;
 	int err;
 
-	memset(&hints, 0, sizeof(hints));
-	hints.ai_family = af;
-	hints.ai_socktype = SOCK_STREAM;
-	hints.ai_protocol = 0;
-	if ((err = getaddrinfo(addr, NULL, &hints, &res0)) != 0)
+	if ((cliai = fetch_resolve(addr, 0, af)) == NULL)
 		return (-1);
-	for (res = res0; res; res = res->ai_next)
-		if (bind(sd, res->ai_addr, res->ai_addrlen) == 0) {
-			freeaddrinfo(res0);
-			return (0);
-		}
-	freeaddrinfo(res0);
-	return (-1);
+	for (ai = cliai; ai != NULL; ai = ai->ai_next)
+		if ((err = bind(sd, ai->ai_addr, ai->ai_addrlen)) == 0)
+			break;
+	if (err != 0)
+		fetch_syserr();
+	freeaddrinfo(cliai);
+	return (err == 0 ? 0 : -1);
 }
 
 
@@ -271,59 +323,76 @@ fetch_bind(int sd, int af, const char *a
 conn_t *
 fetch_connect(const char *host, int port, int af, int verbose)
 {
-	conn_t *conn;
-	char pbuf[10];
+	struct addrinfo *cais = NULL, *sais = NULL, *cai, *sai;
 	const char *bindaddr;
-	struct addrinfo hints, *res, *res0;
-	int sd, err;
+	conn_t *conn = NULL;
+	int err = 0, sd = -1;
 
 	DEBUG(fprintf(stderr, "---> %s:%d\n", host, port));
 
+	/* resolve server address */
 	if (verbose)
-		fetch_info("looking up %s", host);
+		fetch_info("resolving server address: %s:%d", host, port);
+	if ((sais = fetch_resolve(host, port, af)) == NULL)
+		goto fail;
 
-	/* look up host name and set up socket address structure */
-	snprintf(pbuf, sizeof(pbuf), "%d", port);
-	memset(&hints, 0, sizeof(hints));
-	hints.ai_family = af;
-	hints.ai_socktype = SOCK_STREAM;
-	hints.ai_protocol = 0;
-	if ((err = getaddrinfo(host, pbuf, &hints, &res0)) != 0) {
-		netdb_seterr(err);
-		return (NULL);
-	}
+	/* resolve client address */
 	bindaddr = getenv("FETCH_BIND_ADDRESS");
+	if (bindaddr != NULL && *bindaddr != '\0') {
+		if (verbose)
+			fetch_info("resolving client address: %s", bindaddr);
+		if ((cais = fetch_resolve(bindaddr, 0, af)) == NULL)
+			goto fail;
+	}
 
-	if (verbose)
-		fetch_info("connecting to %s:%d", host, port);
-
-	/* try to connect */
-	for (sd = -1, res = res0; res; sd = -1, res = res->ai_next) {
-		if ((sd = socket(res->ai_family, res->ai_socktype,
-			 res->ai_protocol)) == -1)
-			continue;
-		if (bindaddr != NULL && *bindaddr != '\0' &&
-		    fetch_bind(sd, res->ai_family, bindaddr) != 0) {
-			fetch_info("failed to bind to '%s'", bindaddr);
-			close(sd);
-			continue;
+	/* try each server address in turn */
+	for (err = 0, sai = sais; sai != NULL; sai = sai->ai_next) {
+		/* open socket */
+		if ((sd = socket(sai->ai_family, SOCK_STREAM, 0)) < 0)
+			goto syserr;
+		/* attempt to bind to client address */
+		for (err = 0, cai = cais; cai != NULL; cai = cai->ai_next) {
+			if (cai->ai_family != sai->ai_family)
+				continue;
+			if ((err = bind(sd, cai->ai_addr, cai->ai_addrlen)) == 0)
+				break;
+		}
+		if (err != 0) {
+			if (verbose)
+				fetch_info("failed to bind to %s", bindaddr);
+			goto syserr;
 		}
-		if (connect(sd, res->ai_addr, res->ai_addrlen) == 0 &&
-		    fcntl(sd, F_SETFL, O_NONBLOCK) == 0)
+		/* attempt to connect to server address */
+		if ((err = connect(sd, sai->ai_addr, sai->ai_addrlen)) == 0)
 			break;
+		/* clean up before next attempt */
 		close(sd);
+		sd = -1;
 	}
-	freeaddrinfo(res0);
-	if (sd == -1) {
-		fetch_syserr();
-		return (NULL);
+	if (err != 0) {
+		if (verbose)
+			fetch_info("failed to connect to %s:%s", host, port);
+		goto syserr;
 	}
 
-	if ((conn = fetch_reopen(sd)) == NULL) {
-		fetch_syserr();
-		close(sd);
-	}
+	if ((conn = fetch_reopen(sd)) == NULL)
+		goto syserr;
+	if (cais != NULL)
+		freeaddrinfo(cais);
+	if (sais != NULL)
+		freeaddrinfo(sais);
 	return (conn);
+syserr:
+	fetch_syserr();
+	goto fail;
+fail:
+	if (sd >= 0)
+		close(sd);
+	if (cais != NULL)
+		freeaddrinfo(cais);
+	if (sais != NULL)
+		freeaddrinfo(sais);
+	return (NULL);
 }
 
 #ifdef WITH_SSL

Modified: stable/11/lib/libfetch/common.h
==============================================================================
--- stable/11/lib/libfetch/common.h	Wed Dec 14 14:13:44 2016	(r310058)
+++ stable/11/lib/libfetch/common.h	Wed Dec 14 14:20:32 2016	(r310059)
@@ -76,6 +76,7 @@ void		 fetch_syserr(void);
 void		 fetch_info(const char *, ...);
 int		 fetch_default_port(const char *);
 int		 fetch_default_proxy_port(const char *);
+struct addrinfo *fetch_resolve(const char *, int, int);
 int		 fetch_bind(int, int, const char *);
 conn_t		*fetch_connect(const char *, int, int, int);
 conn_t		*fetch_reopen(int);

Modified: stable/11/lib/libfetch/ftp.c
==============================================================================
--- stable/11/lib/libfetch/ftp.c	Wed Dec 14 14:13:44 2016	(r310058)
+++ stable/11/lib/libfetch/ftp.c	Wed Dec 14 14:20:32 2016	(r310059)
@@ -768,8 +768,8 @@ ftp_transfer(conn_t *conn, const char *o
 			fetch_info("opening data connection");
 		bindaddr = getenv("FETCH_BIND_ADDRESS");
 		if (bindaddr != NULL && *bindaddr != '\0' &&
-		    fetch_bind(sd, sa.ss_family, bindaddr) != 0)
-			goto sysouch;
+		    (e = fetch_bind(sd, sa.ss_family, bindaddr)) != 0)
+			goto ouch;
 		if (connect(sd, (struct sockaddr *)&sa, sa.ss_len) == -1)
 			goto sysouch;
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 14:23:26 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8775BC775D7;
 Wed, 14 Dec 2016 14:23:26 +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 62268F8E;
 Wed, 14 Dec 2016 14:23:26 +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 uBEENPGA049049;
 Wed, 14 Dec 2016 14:23:25 GMT (envelope-from des@FreeBSD.org)
Received: (from des@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEENP9j049046;
 Wed, 14 Dec 2016 14:23:25 GMT (envelope-from des@FreeBSD.org)
Message-Id: <201612141423.uBEENP9j049046@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?= <des@FreeBSD.org>
Date: Wed, 14 Dec 2016 14:23:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310060 - stable/10/lib/libfetch
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 14:23:26 -0000

Author: des
Date: Wed Dec 14 14:23:25 2016
New Revision: 310060
URL: https://svnweb.freebsd.org/changeset/base/310060

Log:
  MFH (r308996, r309051, r309738): refactor, avoid repeating DNS requests

Modified:
  stable/10/lib/libfetch/common.c
  stable/10/lib/libfetch/common.h
  stable/10/lib/libfetch/ftp.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libfetch/common.c
==============================================================================
--- stable/10/lib/libfetch/common.c	Wed Dec 14 14:20:32 2016	(r310059)
+++ stable/10/lib/libfetch/common.c	Wed Dec 14 14:23:25 2016	(r310060)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 1998-2014 Dag-Erling Smørgrav
+ * Copyright (c) 1998-2016 Dag-Erling Smørgrav
  * Copyright (c) 2013 Michael Gmelin <freebsd@grem.de>
  * All rights reserved.
  *
@@ -241,27 +241,79 @@ fetch_ref(conn_t *conn)
 
 
 /*
+ * Resolve an address
+ */
+struct addrinfo *
+fetch_resolve(const char *addr, int port, int af)
+{
+	char hbuf[256], sbuf[8];
+	struct addrinfo hints, *res;
+	const char *sep, *host, *service;
+	int err, len;
+
+	/* split address if necessary */
+	err = EAI_SYSTEM;
+	if ((sep = strchr(addr, ':')) != NULL) {
+		len = snprintf(hbuf, sizeof(hbuf),
+		    "%.*s", (int)(sep - addr), addr);
+		if (len < 0)
+			return (NULL);
+		if (len >= (int)sizeof(hbuf)) {
+			errno = ENAMETOOLONG;
+			fetch_syserr();
+			return (NULL);
+		}
+		host = hbuf;
+		service = sep + 1;
+	} else if (port != 0) {
+		if (port < 1 || port > 65535) {
+			errno = EINVAL;
+			fetch_syserr();
+			return (NULL);
+		}
+		if (snprintf(sbuf, sizeof(sbuf), "%d", port) < 0) {
+			fetch_syserr();
+			return (NULL);
+		}
+		host = addr;
+		service = sbuf;
+	} else {
+		host = addr;
+		service = NULL;
+	}
+
+	/* resolve */
+	memset(&hints, 0, sizeof(hints));
+	hints.ai_family = af;
+	hints.ai_socktype = SOCK_STREAM;
+	hints.ai_flags = AI_ADDRCONFIG;
+	if ((err = getaddrinfo(host, service, &hints, &res)) != 0) {
+		netdb_seterr(err);
+		return (NULL);
+	}
+	return (res);
+}
+
+
+
+/*
  * Bind a socket to a specific local address
  */
 int
 fetch_bind(int sd, int af, const char *addr)
 {
-	struct addrinfo hints, *res, *res0;
+	struct addrinfo *cliai, *ai;
 	int err;
 
-	memset(&hints, 0, sizeof(hints));
-	hints.ai_family = af;
-	hints.ai_socktype = SOCK_STREAM;
-	hints.ai_protocol = 0;
-	if ((err = getaddrinfo(addr, NULL, &hints, &res0)) != 0)
+	if ((cliai = fetch_resolve(addr, 0, af)) == NULL)
 		return (-1);
-	for (res = res0; res; res = res->ai_next)
-		if (bind(sd, res->ai_addr, res->ai_addrlen) == 0) {
-			freeaddrinfo(res0);
-			return (0);
-		}
-	freeaddrinfo(res0);
-	return (-1);
+	for (ai = cliai; ai != NULL; ai = ai->ai_next)
+		if ((err = bind(sd, ai->ai_addr, ai->ai_addrlen)) == 0)
+			break;
+	if (err != 0)
+		fetch_syserr();
+	freeaddrinfo(cliai);
+	return (err == 0 ? 0 : -1);
 }
 
 
@@ -271,59 +323,76 @@ fetch_bind(int sd, int af, const char *a
 conn_t *
 fetch_connect(const char *host, int port, int af, int verbose)
 {
-	conn_t *conn;
-	char pbuf[10];
+	struct addrinfo *cais = NULL, *sais = NULL, *cai, *sai;
 	const char *bindaddr;
-	struct addrinfo hints, *res, *res0;
-	int sd, err;
+	conn_t *conn = NULL;
+	int err = 0, sd = -1;
 
 	DEBUG(fprintf(stderr, "---> %s:%d\n", host, port));
 
+	/* resolve server address */
 	if (verbose)
-		fetch_info("looking up %s", host);
+		fetch_info("resolving server address: %s:%d", host, port);
+	if ((sais = fetch_resolve(host, port, af)) == NULL)
+		goto fail;
 
-	/* look up host name and set up socket address structure */
-	snprintf(pbuf, sizeof(pbuf), "%d", port);
-	memset(&hints, 0, sizeof(hints));
-	hints.ai_family = af;
-	hints.ai_socktype = SOCK_STREAM;
-	hints.ai_protocol = 0;
-	if ((err = getaddrinfo(host, pbuf, &hints, &res0)) != 0) {
-		netdb_seterr(err);
-		return (NULL);
-	}
+	/* resolve client address */
 	bindaddr = getenv("FETCH_BIND_ADDRESS");
+	if (bindaddr != NULL && *bindaddr != '\0') {
+		if (verbose)
+			fetch_info("resolving client address: %s", bindaddr);
+		if ((cais = fetch_resolve(bindaddr, 0, af)) == NULL)
+			goto fail;
+	}
 
-	if (verbose)
-		fetch_info("connecting to %s:%d", host, port);
-
-	/* try to connect */
-	for (sd = -1, res = res0; res; sd = -1, res = res->ai_next) {
-		if ((sd = socket(res->ai_family, res->ai_socktype,
-			 res->ai_protocol)) == -1)
-			continue;
-		if (bindaddr != NULL && *bindaddr != '\0' &&
-		    fetch_bind(sd, res->ai_family, bindaddr) != 0) {
-			fetch_info("failed to bind to '%s'", bindaddr);
-			close(sd);
-			continue;
+	/* try each server address in turn */
+	for (err = 0, sai = sais; sai != NULL; sai = sai->ai_next) {
+		/* open socket */
+		if ((sd = socket(sai->ai_family, SOCK_STREAM, 0)) < 0)
+			goto syserr;
+		/* attempt to bind to client address */
+		for (err = 0, cai = cais; cai != NULL; cai = cai->ai_next) {
+			if (cai->ai_family != sai->ai_family)
+				continue;
+			if ((err = bind(sd, cai->ai_addr, cai->ai_addrlen)) == 0)
+				break;
+		}
+		if (err != 0) {
+			if (verbose)
+				fetch_info("failed to bind to %s", bindaddr);
+			goto syserr;
 		}
-		if (connect(sd, res->ai_addr, res->ai_addrlen) == 0 &&
-		    fcntl(sd, F_SETFL, O_NONBLOCK) == 0)
+		/* attempt to connect to server address */
+		if ((err = connect(sd, sai->ai_addr, sai->ai_addrlen)) == 0)
 			break;
+		/* clean up before next attempt */
 		close(sd);
+		sd = -1;
 	}
-	freeaddrinfo(res0);
-	if (sd == -1) {
-		fetch_syserr();
-		return (NULL);
+	if (err != 0) {
+		if (verbose)
+			fetch_info("failed to connect to %s:%s", host, port);
+		goto syserr;
 	}
 
-	if ((conn = fetch_reopen(sd)) == NULL) {
-		fetch_syserr();
-		close(sd);
-	}
+	if ((conn = fetch_reopen(sd)) == NULL)
+		goto syserr;
+	if (cais != NULL)
+		freeaddrinfo(cais);
+	if (sais != NULL)
+		freeaddrinfo(sais);
 	return (conn);
+syserr:
+	fetch_syserr();
+	goto fail;
+fail:
+	if (sd >= 0)
+		close(sd);
+	if (cais != NULL)
+		freeaddrinfo(cais);
+	if (sais != NULL)
+		freeaddrinfo(sais);
+	return (NULL);
 }
 
 #ifdef WITH_SSL

Modified: stable/10/lib/libfetch/common.h
==============================================================================
--- stable/10/lib/libfetch/common.h	Wed Dec 14 14:20:32 2016	(r310059)
+++ stable/10/lib/libfetch/common.h	Wed Dec 14 14:23:25 2016	(r310060)
@@ -76,6 +76,7 @@ void		 fetch_syserr(void);
 void		 fetch_info(const char *, ...);
 int		 fetch_default_port(const char *);
 int		 fetch_default_proxy_port(const char *);
+struct addrinfo *fetch_resolve(const char *, int, int);
 int		 fetch_bind(int, int, const char *);
 conn_t		*fetch_connect(const char *, int, int, int);
 conn_t		*fetch_reopen(int);

Modified: stable/10/lib/libfetch/ftp.c
==============================================================================
--- stable/10/lib/libfetch/ftp.c	Wed Dec 14 14:20:32 2016	(r310059)
+++ stable/10/lib/libfetch/ftp.c	Wed Dec 14 14:23:25 2016	(r310060)
@@ -768,8 +768,8 @@ ftp_transfer(conn_t *conn, const char *o
 			fetch_info("opening data connection");
 		bindaddr = getenv("FETCH_BIND_ADDRESS");
 		if (bindaddr != NULL && *bindaddr != '\0' &&
-		    fetch_bind(sd, sa.ss_family, bindaddr) != 0)
-			goto sysouch;
+		    (e = fetch_bind(sd, sa.ss_family, bindaddr)) != 0)
+			goto ouch;
 		if (connect(sd, (struct sockaddr *)&sa, sa.ss_len) == -1)
 			goto sysouch;
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 15:00:25 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8786C801A2;
 Wed, 14 Dec 2016 15:00:25 +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 A8211947;
 Wed, 14 Dec 2016 15:00:25 +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 uBEF0Ouu061674;
 Wed, 14 Dec 2016 15:00:24 GMT (envelope-from manu@FreeBSD.org)
Received: (from manu@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEF0OMV061673;
 Wed, 14 Dec 2016 15:00:24 GMT (envelope-from manu@FreeBSD.org)
Message-Id: <201612141500.uBEF0OMV061673@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: manu set sender to
 manu@FreeBSD.org using -f
From: Emmanuel Vadot <manu@FreeBSD.org>
Date: Wed, 14 Dec 2016 15:00:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310061 - head/sys/arm/allwinner
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 15:00:25 -0000

Author: manu
Date: Wed Dec 14 15:00:24 2016
New Revision: 310061
URL: https://svnweb.freebsd.org/changeset/base/310061

Log:
  Add new compatible string "allwinner,sun7i-a20-mmc".
  
  New upstream DTS is using this now for A20 SoC.
  
  MFC after:	3 days

Modified:
  head/sys/arm/allwinner/a10_mmc.c

Modified: head/sys/arm/allwinner/a10_mmc.c
==============================================================================
--- head/sys/arm/allwinner/a10_mmc.c	Wed Dec 14 14:23:25 2016	(r310060)
+++ head/sys/arm/allwinner/a10_mmc.c	Wed Dec 14 15:00:24 2016	(r310061)
@@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$");
 static struct ofw_compat_data compat_data[] = {
 	{"allwinner,sun4i-a10-mmc", 1},
 	{"allwinner,sun5i-a13-mmc", 1},
+	{"allwinner,sun7i-a20-mmc", 1},
 	{NULL,             0}
 };
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 15:38:29 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A128BC80B15;
 Wed, 14 Dec 2016 15:38:29 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 654F61E2B;
 Wed, 14 Dec 2016 15:38:29 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEFcS89077402;
 Wed, 14 Dec 2016 15:38:28 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEFcSWl077401;
 Wed, 14 Dec 2016 15:38:28 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141538.uBEFcSWl077401@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 15:38:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310062 - stable/10/sys/dev/smbus
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 15:38:29 -0000

Author: avg
Date: Wed Dec 14 15:38:28 2016
New Revision: 310062
URL: https://svnweb.freebsd.org/changeset/base/310062

Log:
  make smbus_get_addr() an ivar accessor
  
  This is a direct commit to this branch.
  
  smbus_get_addr() was declared as a funciton prototype, but the function
  was never defined.  read_ivar and write_ivar methods were unused.
  
  This was exposed after jedec_ts driver was imported to this branch
  as that driver turned out to be the first user of smbus_get_addr().
  
  This change is a small subset of a larger change in r281985.
  
  Reported by:	jhb
  Pointyhat to:	avg

Modified:
  stable/10/sys/dev/smbus/smbconf.h

Modified: stable/10/sys/dev/smbus/smbconf.h
==============================================================================
--- stable/10/sys/dev/smbus/smbconf.h	Wed Dec 14 15:00:24 2016	(r310061)
+++ stable/10/sys/dev/smbus/smbconf.h	Wed Dec 14 15:38:28 2016	(r310062)
@@ -74,7 +74,9 @@
 /*
  * ivars codes
  */
-#define SMBUS_IVAR_ADDR	0x1	/* slave address of the device */
+enum smbus_ivars {
+    SMBUS_IVAR_ADDR,	/* slave address of the device */
+};
 
 int	smbus_request_bus(device_t, device_t, int);
 int	smbus_release_bus(device_t, device_t);
@@ -83,7 +85,12 @@ int	smbus_error(int error);
 
 void	smbus_intr(device_t, u_char, char low, char high, int error);
 
-u_char	smbus_get_addr(device_t);
+#define SMBUS_ACCESSOR(var, ivar, type)					\
+	__BUS_ACCESSOR(smbus, var, SMBUS, ivar, type)
+
+SMBUS_ACCESSOR(addr,		ADDR,		int)
+
+#undef SMBUS_ACCESSOR
 
 extern driver_t smbus_driver;
 extern devclass_t smbus_devclass;

From owner-svn-src-all@freebsd.org  Wed Dec 14 15:42:54 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE41FC80DC1;
 Wed, 14 Dec 2016 15:42:54 +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 626A785D;
 Wed, 14 Dec 2016 15:42:46 +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 RAA21043;
 Wed, 14 Dec 2016 17:42:45 +0200 (EET) (envelope-from avg@FreeBSD.org)
Received: from localhost ([127.0.0.1])
 by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
 id 1cHBhd-0002GJ-Aw; Wed, 14 Dec 2016 17:42:45 +0200
Subject: Re: svn commit: r308371 - in stable/10: share/man/man4 sys/conf
 sys/dev/jedec_ts sys/modules/i2c sys/modules/i2c/jedec_ts
To: John Baldwin <jhb@FreeBSD.org>
References: <201611061356.uA6DuYcO079294@repo.freebsd.org>
 <1625245.4edrXav981@ralph.baldwin.cx>
Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org,
 svn-src-stable@FreeBSD.org, svn-src-stable-10@FreeBSD.org
From: Andriy Gapon <avg@FreeBSD.org>
Message-ID: <912ba7fd-353c-006e-ef65-faa12b83de9f@FreeBSD.org>
Date: Wed, 14 Dec 2016 17:41:47 +0200
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101
 Thunderbird/45.5.1
MIME-Version: 1.0
In-Reply-To: <1625245.4edrXav981@ralph.baldwin.cx>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 15:42:55 -0000

On 05/12/2016 23:49, John Baldwin wrote:
> On Sunday, November 06, 2016 01:56:34 PM Andriy Gapon wrote:
>> Author: avg
>> Date: Sun Nov  6 13:56:34 2016
>> New Revision: 308371
>> URL: https://svnweb.freebsd.org/changeset/base/308371
>>
>> Log:
>>   MFC r307768: jedec_ts: a driver for thermal sensors on memory modules
>>
>> Added:
>>   stable/10/share/man/man4/jedec_ts.4
>>      - copied unchanged from r307768, head/share/man/man4/jedec_ts.4
>>   stable/10/sys/dev/jedec_ts/
>>      - copied from r307768, head/sys/dev/jedec_ts/
>>   stable/10/sys/modules/i2c/jedec_ts/
>>      - copied from r307768, head/sys/modules/i2c/jedec_ts/
>> Modified:
>>   stable/10/sys/conf/NOTES
>>   stable/10/sys/conf/files
>>   stable/10/sys/modules/i2c/Makefile
>> Directory Properties:
>>   stable/10/   (props changed)
> 
> FYI, this doesn't work and has broken tinderbox builds on stable/10.
> smbus_get_addr() doesn't exist on 10.  It was originally a hand-rolled
> ivar wrapper that was removed in r93023 in 2002.  The function prototype
> was not removed, so the compile works, but linking fails.  The stale
> prototype is still present in smbconf.h in HEAD (and should be removed).
> The "real" smbus_get_addr() was added back to smbconf.h along with an
> implementation of smbus_read_ivar() in r281985.  Parts of that commit
> probably need to be MFC'd to 10.
> 

John,

thank you for catching this and sorry for the trouble.
Could you please check if r310062 really fixes the problem?


-- 
Andriy Gapon

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:03:25 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23BCCC6655C;
 Wed, 14 Dec 2016 16:03:25 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E72F313A6;
 Wed, 14 Dec 2016 16:03:24 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEG3Ol8089722;
 Wed, 14 Dec 2016 16:03:24 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEG3Oes089721;
 Wed, 14 Dec 2016 16:03:24 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141603.uBEG3Oes089721@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:03:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310063 - stable/10/sys/dev/hwpmc
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:03:25 -0000

Author: avg
Date: Wed Dec 14 16:03:23 2016
New Revision: 310063
URL: https://svnweb.freebsd.org/changeset/base/310063

Log:
  MFC r308480: pmc_process_csw_out: ignore deleted counters

Modified:
  stable/10/sys/dev/hwpmc/hwpmc_mod.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/hwpmc/hwpmc_mod.c
==============================================================================
--- stable/10/sys/dev/hwpmc/hwpmc_mod.c	Wed Dec 14 15:38:28 2016	(r310062)
+++ stable/10/sys/dev/hwpmc/hwpmc_mod.c	Wed Dec 14 16:03:23 2016	(r310063)
@@ -1432,8 +1432,8 @@ pmc_process_csw_out(struct thread *td)
 		 * save the reading.
 		 */
 
-		if (pp != NULL && pp->pp_pmcs[ri].pp_pmc != NULL) {
-
+		if (pm->pm_state != PMC_STATE_DELETED && pp != NULL &&
+		    pp->pp_pmcs[ri].pp_pmc != NULL) {
 			KASSERT(pm == pp->pp_pmcs[ri].pp_pmc,
 			    ("[pmc,%d] pm %p != pp_pmcs[%d] %p", __LINE__,
 				pm, ri, pp->pp_pmcs[ri].pp_pmc));

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:04:05 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1E1FC665C2;
 Wed, 14 Dec 2016 16:04:05 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 810081577;
 Wed, 14 Dec 2016 16:04:05 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEG44ou089811;
 Wed, 14 Dec 2016 16:04:04 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEG44x2089810;
 Wed, 14 Dec 2016 16:04:04 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141604.uBEG44x2089810@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:04:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310064 - stable/11/sys/dev/hwpmc
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:04:05 -0000

Author: avg
Date: Wed Dec 14 16:04:04 2016
New Revision: 310064
URL: https://svnweb.freebsd.org/changeset/base/310064

Log:
  MFC r308480: pmc_process_csw_out: ignore deleted counters

Modified:
  stable/11/sys/dev/hwpmc/hwpmc_mod.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c
==============================================================================
--- stable/11/sys/dev/hwpmc/hwpmc_mod.c	Wed Dec 14 16:03:23 2016	(r310063)
+++ stable/11/sys/dev/hwpmc/hwpmc_mod.c	Wed Dec 14 16:04:04 2016	(r310064)
@@ -1431,8 +1431,8 @@ pmc_process_csw_out(struct thread *td)
 		 * save the reading.
 		 */
 
-		if (pp != NULL && pp->pp_pmcs[ri].pp_pmc != NULL) {
-
+		if (pm->pm_state != PMC_STATE_DELETED && pp != NULL &&
+		    pp->pp_pmcs[ri].pp_pmc != NULL) {
 			KASSERT(pm == pp->pp_pmcs[ri].pp_pmc,
 			    ("[pmc,%d] pm %p != pp_pmcs[%d] %p", __LINE__,
 				pm, ri, pp->pp_pmcs[ri].pp_pmc));

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:05:49 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF770C666C5;
 Wed, 14 Dec 2016 16:05:49 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 86730182B;
 Wed, 14 Dec 2016 16:05:49 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEG5mi3090089;
 Wed, 14 Dec 2016 16:05:48 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEG5mgV090087;
 Wed, 14 Dec 2016 16:05:48 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141605.uBEG5mgV090087@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:05:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310065 - stable/11/sys/dev/smbus
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:05:49 -0000

Author: avg
Date: Wed Dec 14 16:05:48 2016
New Revision: 310065
URL: https://svnweb.freebsd.org/changeset/base/310065

Log:
  MFC r308527: smb: fix SMB_READB, SMB_READW, SMB_PCALL to work as documented

Modified:
  stable/11/sys/dev/smbus/smb.c
  stable/11/sys/dev/smbus/smb.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/smbus/smb.c
==============================================================================
--- stable/11/sys/dev/smbus/smb.c	Wed Dec 14 16:04:04 2016	(r310064)
+++ stable/11/sys/dev/smbus/smb.c	Wed Dec 14 16:05:48 2016	(r310065)
@@ -41,7 +41,9 @@
 
 #include "smbus_if.h"
 
-#define BUFSIZE 1024
+#define SMB_OLD_READB	_IOW('i', 7, struct smbcmd)
+#define SMB_OLD_READW	_IOW('i', 8, struct smbcmd)
+#define SMB_OLD_PCALL	_IOW('i', 9, struct smbcmd)
 
 struct smb_softc {
 	device_t sc_dev;
@@ -224,7 +226,9 @@ smbioctl(struct cdev *dev, u_long cmd, c
 						s->cmd, s->wdata.word));
 		break;
 
+	case SMB_OLD_READB:
 	case SMB_READB:
+		/* NB: for SMB_OLD_READB the read data goes to rbuf only. */
 		error = smbus_error(smbus_readb(parent, s->slave, s->cmd,
 		    &s->rdata.byte));
 		if (error)
@@ -235,7 +239,9 @@ smbioctl(struct cdev *dev, u_long cmd, c
 		}
 		break;
 
+	case SMB_OLD_READW:
 	case SMB_READW:
+		/* NB: for SMB_OLD_READW the read data goes to rbuf only. */
 		error = smbus_error(smbus_readw(parent, s->slave, s->cmd,
 		    &s->rdata.word));
 		if (error)
@@ -248,7 +254,9 @@ smbioctl(struct cdev *dev, u_long cmd, c
 		}
 		break;
 
+	case SMB_OLD_PCALL:
 	case SMB_PCALL:
+		/* NB: for SMB_OLD_PCALL the read data goes to rbuf only. */
 		error = smbus_error(smbus_pcall(parent, s->slave, s->cmd,
 		    s->wdata.word, &s->rdata.word));
 		if (error)

Modified: stable/11/sys/dev/smbus/smb.h
==============================================================================
--- stable/11/sys/dev/smbus/smb.h	Wed Dec 14 16:04:04 2016	(r310064)
+++ stable/11/sys/dev/smbus/smb.h	Wed Dec 14 16:05:48 2016	(r310065)
@@ -66,11 +66,10 @@ struct smbcmd {
 #define SMB_RECVB	_IOWR('i', 4, struct smbcmd)
 #define SMB_WRITEB	_IOW('i', 5, struct smbcmd)
 #define SMB_WRITEW	_IOW('i', 6, struct smbcmd)
-#define SMB_READB	_IOW('i', 7, struct smbcmd)
-#define SMB_READW	_IOW('i', 8, struct smbcmd)
-#define SMB_PCALL	_IOW('i', 9, struct smbcmd)
+#define SMB_READB	_IOWR('i', 7, struct smbcmd)
+#define SMB_READW	_IOWR('i', 8, struct smbcmd)
+#define SMB_PCALL	_IOWR('i', 9, struct smbcmd)
 #define SMB_BWRITE	_IOW('i', 10, struct smbcmd)
-#define SMB_OLD_BREAD	_IOW('i', 11, struct smbcmd)
 #define SMB_BREAD	_IOWR('i', 11, struct smbcmd)
 #define SMB_TRANS	_IOWR('i', 12, struct smbcmd)
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:08:30 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DD5CC667C3;
 Wed, 14 Dec 2016 16:08:30 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1CE101AD2;
 Wed, 14 Dec 2016 16:08:30 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEG8Tu6090759;
 Wed, 14 Dec 2016 16:08:29 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEG8TrT090757;
 Wed, 14 Dec 2016 16:08:29 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141608.uBEG8TrT090757@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:08:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310066 -
 stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:08:30 -0000

Author: avg
Date: Wed Dec 14 16:08:28 2016
New Revision: 310066
URL: https://svnweb.freebsd.org/changeset/base/310066

Log:
  MFC r308887,309090: fix unsafe modification of zfs_vnodeops when
  DIAGNOSTIC is enabled

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Wed Dec 14 16:05:48 2016	(r310065)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Wed Dec 14 16:08:28 2016	(r310066)
@@ -5976,26 +5976,17 @@ zfs_lock(ap)
 		int line;
 	} */ *ap;
 {
-	zfsvfs_t *zfsvfs;
-	znode_t *zp;
 	vnode_t *vp;
-	int flags;
+	znode_t *zp;
 	int err;
 
-	vp = ap->a_vp;
-	flags = ap->a_flags;
-	if ((flags & LK_INTERLOCK) == 0 && (flags & LK_NOWAIT) == 0 &&
-	    (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL &&
-	    (zp->z_pflags & ZFS_XATTR) == 0) {
-		zfsvfs = zp->z_zfsvfs;
-		VERIFY(!RRM_LOCK_HELD(&zfsvfs->z_teardown_lock));
-	}
 	err = vop_stdlock(ap);
-	if ((flags & LK_INTERLOCK) != 0 && (flags & LK_NOWAIT) == 0 &&
-	    (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL &&
-	    (zp->z_pflags & ZFS_XATTR) == 0) {
-		zfsvfs = zp->z_zfsvfs;
-		VERIFY(!RRM_LOCK_HELD(&zfsvfs->z_teardown_lock));
+	if (err == 0 && (ap->a_flags & LK_NOWAIT) == 0) {
+		vp = ap->a_vp;
+		zp = vp->v_data;
+		if (vp->v_mount != NULL && (vp->v_iflag & VI_DOOMED) == 0 &&
+		    zp != NULL && (zp->z_pflags & ZFS_XATTR) == 0)
+			VERIFY(!RRM_LOCK_HELD(&zp->z_zfsvfs->z_teardown_lock));
 	}
 	return (err);
 }

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Wed Dec 14 16:05:48 2016	(r310065)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Wed Dec 14 16:08:28 2016	(r310066)
@@ -727,14 +727,7 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu
 	/*
 	 * Acquire vnode lock before making it available to the world.
 	 */
-#ifdef DIAGNOSTIC
-	vop_lock1_t *orig_lock = vp->v_op->vop_lock1;
-	vp->v_op->vop_lock1 = vop_stdlock;
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-	vp->v_op->vop_lock1 = orig_lock;
-#else
-	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-#endif
 	VN_LOCK_AREC(vp);
 	if (vp->v_type != VFIFO)
 		VN_LOCK_ASHARE(vp);

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:08:36 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9617FC667FB;
 Wed, 14 Dec 2016 16:08:36 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4CEB01B04;
 Wed, 14 Dec 2016 16:08:36 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEG8ZjR090816;
 Wed, 14 Dec 2016 16:08:35 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEG8ZNf090814;
 Wed, 14 Dec 2016 16:08:35 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141608.uBEG8ZNf090814@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:08:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310067 -
 stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:08:36 -0000

Author: avg
Date: Wed Dec 14 16:08:35 2016
New Revision: 310067
URL: https://svnweb.freebsd.org/changeset/base/310067

Log:
  MFC r308887,309090: fix unsafe modification of zfs_vnodeops when
  DIAGNOSTIC is enabled

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Wed Dec 14 16:08:28 2016	(r310066)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Wed Dec 14 16:08:35 2016	(r310067)
@@ -6020,26 +6020,17 @@ zfs_lock(ap)
 		int line;
 	} */ *ap;
 {
-	zfsvfs_t *zfsvfs;
-	znode_t *zp;
 	vnode_t *vp;
-	int flags;
+	znode_t *zp;
 	int err;
 
-	vp = ap->a_vp;
-	flags = ap->a_flags;
-	if ((flags & LK_INTERLOCK) == 0 && (flags & LK_NOWAIT) == 0 &&
-	    (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL &&
-	    (zp->z_pflags & ZFS_XATTR) == 0) {
-		zfsvfs = zp->z_zfsvfs;
-		VERIFY(!RRM_LOCK_HELD(&zfsvfs->z_teardown_lock));
-	}
 	err = vop_stdlock(ap);
-	if ((flags & LK_INTERLOCK) != 0 && (flags & LK_NOWAIT) == 0 &&
-	    (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL &&
-	    (zp->z_pflags & ZFS_XATTR) == 0) {
-		zfsvfs = zp->z_zfsvfs;
-		VERIFY(!RRM_LOCK_HELD(&zfsvfs->z_teardown_lock));
+	if (err == 0 && (ap->a_flags & LK_NOWAIT) == 0) {
+		vp = ap->a_vp;
+		zp = vp->v_data;
+		if (vp->v_mount != NULL && (vp->v_iflag & VI_DOOMED) == 0 &&
+		    zp != NULL && (zp->z_pflags & ZFS_XATTR) == 0)
+			VERIFY(!RRM_LOCK_HELD(&zp->z_zfsvfs->z_teardown_lock));
 	}
 	return (err);
 }

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Wed Dec 14 16:08:28 2016	(r310066)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Wed Dec 14 16:08:35 2016	(r310067)
@@ -727,14 +727,7 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu
 	/*
 	 * Acquire vnode lock before making it available to the world.
 	 */
-#ifdef DIAGNOSTIC
-	vop_lock1_t *orig_lock = vp->v_op->vop_lock1;
-	vp->v_op->vop_lock1 = vop_stdlock;
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-	vp->v_op->vop_lock1 = orig_lock;
-#else
-	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-#endif
 	VN_LOCK_AREC(vp);
 	if (vp->v_type != VFIFO)
 		VN_LOCK_ASHARE(vp);

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:10:59 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50918C66A14;
 Wed, 14 Dec 2016 16:10:59 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1FD691E3D;
 Wed, 14 Dec 2016 16:10:59 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGAwu7091188;
 Wed, 14 Dec 2016 16:10:58 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGAw0r091187;
 Wed, 14 Dec 2016 16:10:58 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141610.uBEGAw0r091187@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:10:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310068 -
 stable/11/cddl/contrib/opensolaris/lib/libzfs/common
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:10:59 -0000

Author: avg
Date: Wed Dec 14 16:10:58 2016
New Revision: 310068
URL: https://svnweb.freebsd.org/changeset/base/310068

Log:
  MFC r308985: revert r304520, set canmount=on is not supposed to mount
  the filesystem

Modified:
  stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
==============================================================================
--- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Wed Dec 14 16:08:35 2016	(r310067)
+++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Wed Dec 14 16:10:58 2016	(r310068)
@@ -1615,17 +1615,12 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvl
 		assert(cl_idx < nvl_len);
 		/*
 		 * We don't want to unmount & remount the dataset when changing
-		 * its canmount property.  We only use the changelist logic to
-		 * unmount when setting canmount=off for a mounted filesystem
-		 * or when setting canmount=on for an unmounted filesystem.
-		 * For all other changes to canmount property the filesystem
-		 * remains the same.
+		 * its canmount property to 'on' or 'noauto'.  We only use
+		 * the changelist logic to unmount when setting canmount=off.
 		 */
 		if (prop != ZFS_PROP_CANMOUNT ||
 		    (fnvpair_value_uint64(elem) == ZFS_CANMOUNT_OFF &&
-		     zfs_is_mounted(zhp, NULL)) ||
-		    (fnvpair_value_uint64(elem) == ZFS_CANMOUNT_ON &&
-		     !zfs_is_mounted(zhp, NULL))) {
+		     zfs_is_mounted(zhp, NULL))) {
 			cls[cl_idx] = changelist_gather(zhp, prop, 0, 0);
 			if (cls[cl_idx] == NULL)
 				goto error;

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:11:20 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A0E3C66AC9;
 Wed, 14 Dec 2016 16:11:20 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3D453113A;
 Wed, 14 Dec 2016 16:11:20 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGBJlU091286;
 Wed, 14 Dec 2016 16:11:19 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGBJuu091285;
 Wed, 14 Dec 2016 16:11:19 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141611.uBEGBJuu091285@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:11:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310069 -
 stable/10/cddl/contrib/opensolaris/lib/libzfs/common
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:11:20 -0000

Author: avg
Date: Wed Dec 14 16:11:19 2016
New Revision: 310069
URL: https://svnweb.freebsd.org/changeset/base/310069

Log:
  MFC r308985: revert r304520, set canmount=on is not supposed to mount
  the filesystem

Modified:
  stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Wed Dec 14 16:10:58 2016	(r310068)
+++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Wed Dec 14 16:11:19 2016	(r310069)
@@ -1609,17 +1609,12 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvl
 		assert(cl_idx < nvl_len);
 		/*
 		 * We don't want to unmount & remount the dataset when changing
-		 * its canmount property.  We only use the changelist logic to
-		 * unmount when setting canmount=off for a mounted filesystem
-		 * or when setting canmount=on for an unmounted filesystem.
-		 * For all other changes to canmount property the filesystem
-		 * remains the same.
+		 * its canmount property to 'on' or 'noauto'.  We only use
+		 * the changelist logic to unmount when setting canmount=off.
 		 */
 		if (prop != ZFS_PROP_CANMOUNT ||
 		    (fnvpair_value_uint64(elem) == ZFS_CANMOUNT_OFF &&
-		     zfs_is_mounted(zhp, NULL)) ||
-		    (fnvpair_value_uint64(elem) == ZFS_CANMOUNT_ON &&
-		     !zfs_is_mounted(zhp, NULL))) {
+		     zfs_is_mounted(zhp, NULL))) {
 			cls[cl_idx] = changelist_gather(zhp, prop, 0, 0);
 			if (cls[cl_idx] == NULL)
 				goto error;

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:20:52 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56914C80146;
 Wed, 14 Dec 2016 16:20:52 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 25E321BCE;
 Wed, 14 Dec 2016 16:20:52 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGKpAI095338;
 Wed, 14 Dec 2016 16:20:51 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGKpqQ095337;
 Wed, 14 Dec 2016 16:20:51 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141620.uBEGKpqQ095337@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:20:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310070 - stable/11/sys/dev/iicbus
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:20:52 -0000

Author: avg
Date: Wed Dec 14 16:20:51 2016
New Revision: 310070
URL: https://svnweb.freebsd.org/changeset/base/310070

Log:
  MFC r306589: Implement iicbus_write_ivar and impelemnt the NOSTOP ivar
  in both read and write.

Modified:
  stable/11/sys/dev/iicbus/iicbus.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/iicbus/iicbus.c
==============================================================================
--- stable/11/sys/dev/iicbus/iicbus.c	Wed Dec 14 16:11:19 2016	(r310069)
+++ stable/11/sys/dev/iicbus/iicbus.c	Wed Dec 14 16:20:51 2016	(r310070)
@@ -192,6 +192,26 @@ iicbus_read_ivar(device_t bus, device_t 
 	case IICBUS_IVAR_ADDR:
 		*result = devi->addr;
 		break;
+	case IICBUS_IVAR_NOSTOP:
+		*result = devi->nostop;
+		break;
+	}
+	return (0);
+}
+
+static int
+iicbus_write_ivar(device_t bus, device_t child, int which, uintptr_t value)
+{
+	struct iicbus_ivar *devi = IICBUS_IVAR(child);
+
+	switch (which) {
+	default:
+		return (EINVAL);
+	case IICBUS_IVAR_ADDR:
+		return (EINVAL);
+	case IICBUS_IVAR_NOSTOP:
+		devi->nostop = value;
+		break;
 	}
 	return (0);
 }
@@ -328,6 +348,7 @@ static device_method_t iicbus_methods[] 
 	DEVMETHOD(bus_print_child,	iicbus_print_child),
 	DEVMETHOD(bus_probe_nomatch,	iicbus_probe_nomatch),
 	DEVMETHOD(bus_read_ivar,	iicbus_read_ivar),
+	DEVMETHOD(bus_write_ivar,	iicbus_write_ivar),
 	DEVMETHOD(bus_child_pnpinfo_str, iicbus_child_pnpinfo_str),
 	DEVMETHOD(bus_child_location_str, iicbus_child_location_str),
 	DEVMETHOD(bus_hinted_child,	iicbus_hinted_child),

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:21:11 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA393C80197;
 Wed, 14 Dec 2016 16:21:11 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 99B5A1D41;
 Wed, 14 Dec 2016 16:21:11 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGLAXX096134;
 Wed, 14 Dec 2016 16:21:10 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGLAdL096133;
 Wed, 14 Dec 2016 16:21:10 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141621.uBEGLAdL096133@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:21:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310071 - stable/10/sys/dev/iicbus
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:21:11 -0000

Author: avg
Date: Wed Dec 14 16:21:10 2016
New Revision: 310071
URL: https://svnweb.freebsd.org/changeset/base/310071

Log:
  MFC r306589: Implement iicbus_write_ivar and impelemnt the NOSTOP ivar
  in both read and write.

Modified:
  stable/10/sys/dev/iicbus/iicbus.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/iicbus/iicbus.c
==============================================================================
--- stable/10/sys/dev/iicbus/iicbus.c	Wed Dec 14 16:20:51 2016	(r310070)
+++ stable/10/sys/dev/iicbus/iicbus.c	Wed Dec 14 16:21:10 2016	(r310071)
@@ -192,6 +192,26 @@ iicbus_read_ivar(device_t bus, device_t 
 	case IICBUS_IVAR_ADDR:
 		*result = devi->addr;
 		break;
+	case IICBUS_IVAR_NOSTOP:
+		*result = devi->nostop;
+		break;
+	}
+	return (0);
+}
+
+static int
+iicbus_write_ivar(device_t bus, device_t child, int which, uintptr_t value)
+{
+	struct iicbus_ivar *devi = IICBUS_IVAR(child);
+
+	switch (which) {
+	default:
+		return (EINVAL);
+	case IICBUS_IVAR_ADDR:
+		return (EINVAL);
+	case IICBUS_IVAR_NOSTOP:
+		devi->nostop = value;
+		break;
 	}
 	return (0);
 }
@@ -302,6 +322,7 @@ static device_method_t iicbus_methods[] 
         DEVMETHOD(bus_print_child,      iicbus_print_child),
 	DEVMETHOD(bus_probe_nomatch,	iicbus_probe_nomatch),
 	DEVMETHOD(bus_read_ivar,	iicbus_read_ivar),
+	DEVMETHOD(bus_write_ivar,	iicbus_write_ivar),
 	DEVMETHOD(bus_child_pnpinfo_str, iicbus_child_pnpinfo_str),
 	DEVMETHOD(bus_child_location_str, iicbus_child_location_str),
 	DEVMETHOD(bus_hinted_child,	iicbus_hinted_child),

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:27:31 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A0CC80389;
 Wed, 14 Dec 2016 16:27:31 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0210F1223;
 Wed, 14 Dec 2016 16:27:30 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGRUlj099387;
 Wed, 14 Dec 2016 16:27:30 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGRTjc099374;
 Wed, 14 Dec 2016 16:27:29 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141627.uBEGRTjc099374@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:27:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310072 - in stable/11: . share/man/man4 sys/conf
 sys/dev/chromebook_platform sys/dev/cyapa sys/dev/ichiic sys/dev/iicbus
 sys/dev/isl sys/modules sys/modules/chromebook_platform sys/mod...
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:27:31 -0000

Author: avg
Date: Wed Dec 14 16:27:28 2016
New Revision: 310072
URL: https://svnweb.freebsd.org/changeset/base/310072

Log:
  MFC r308104: add iic interface to ig4 driver, move isl and cyapa to iicbus

Added:
  stable/11/share/man/man4/chromebook_platform.4
     - copied unchanged from r308104, head/share/man/man4/chromebook_platform.4
  stable/11/sys/dev/chromebook_platform/
     - copied from r308104, head/sys/dev/chromebook_platform/
  stable/11/sys/modules/chromebook_platform/
     - copied from r308104, head/sys/modules/chromebook_platform/
Modified:
  stable/11/UPDATING
  stable/11/share/man/man4/cyapa.4
  stable/11/share/man/man4/ig4.4
  stable/11/share/man/man4/isl.4
  stable/11/sys/conf/files
  stable/11/sys/dev/cyapa/cyapa.c
  stable/11/sys/dev/ichiic/ig4_iic.c
  stable/11/sys/dev/ichiic/ig4_pci.c
  stable/11/sys/dev/ichiic/ig4_var.h
  stable/11/sys/dev/iicbus/iicbus.c
  stable/11/sys/dev/isl/isl.c
  stable/11/sys/modules/Makefile
  stable/11/sys/modules/i2c/controllers/ichiic/Makefile
  stable/11/sys/modules/i2c/cyapa/Makefile
  stable/11/sys/modules/i2c/isl/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/UPDATING
==============================================================================
--- stable/11/UPDATING	Wed Dec 14 16:21:10 2016	(r310071)
+++ stable/11/UPDATING	Wed Dec 14 16:27:28 2016	(r310072)
@@ -16,6 +16,12 @@ from older versions of FreeBSD, try WITH
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20161030:
+	isl(4) and cyapa(4) drivers now require a new driver,
+	chromebook_platform(4), to work properly on Chromebook-class hardware.
+	On other types of hardware the drivers may need to be configured using
+	device hints.  Please see the corresponding manual pages for details.
+
 20161210:
 	Relocatable object files with the extension of .So have been renamed
 	to use an extension of .pico instead.  The purpose of this change is

Copied: stable/11/share/man/man4/chromebook_platform.4 (from r308104, head/share/man/man4/chromebook_platform.4)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/11/share/man/man4/chromebook_platform.4	Wed Dec 14 16:27:28 2016	(r310072, copy of r308104, head/share/man/man4/chromebook_platform.4)
@@ -0,0 +1,68 @@
+.\" Copyright (c) 2016 Andriy Gapon <avg@FreeBSD.org>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd October 13, 2016
+.Dt CHROMEBOOK_PLATFORM 4
+.Os
+.Sh NAME
+.Nm chromebook_platform
+.Nd support driver for hardware on various Chromebook models
+.Sh SYNOPSIS
+To compile this driver into the kernel, place the following lines into
+the kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device chromebook_platform"
+.Ed
+.Pp
+Alternatively, to load the driver as a module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+chromebook_platform_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides automatic configuration for devices that cannot be enumerated
+or safely probed.
+In particular, I2C peripherals are different from model to model.
+.Nm
+has a model-specific information about the I2C peripherals, their drivers,
+their bus attachments and slave addresses.
+.Pp
+Note that
+.Nm
+does not load driver modules for the peripherals.
+Those have to be compiled into the kernel or loaded separately.
+.Sh SEE ALSO
+.Xr cyapa 4 ,
+.Xr iicbus 4 ,
+.Xr isl 4 ,
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver and this manual page were written by
+.An Andriy Gapon Aq Mt avg@FreeBSD.org .

Modified: stable/11/share/man/man4/cyapa.4
==============================================================================
--- stable/11/share/man/man4/cyapa.4	Wed Dec 14 16:21:10 2016	(r310071)
+++ stable/11/share/man/man4/cyapa.4	Wed Dec 14 16:27:28 2016	(r310072)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 25, 2015
+.Dd October 03, 2016
 .Dt CYAPA 4
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@ the kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "device cyapa"
 .Cd "device ig4"
-.Cd "device smbus"
+.Cd "device iicbus"
 .Ed
 .Pp
 Alternatively, to load the driver as a module at boot time, place the following line in
@@ -45,6 +45,13 @@ Alternatively, to load the driver as a m
 cyapa_load="YES"
 ig4_load="YES"
 .Ed
+.Pp
+In
+.Pa /boot/device.hints :
+.Cd hint.cyapa.0.at="iicbus0"
+.Cd hint.cyapa.0.addr="0xCE"
+.Cd hint.cyapa.1.at="iicbus1"
+.Cd hint.cyapa.1.addr="0xCE"
 .Sh DESCRIPTION
 The
 .Nm
@@ -86,6 +93,20 @@ The upper right corner issues a MIDDLE b
 The lower right corner issues a RIGHT button.
 Optionally, tap to click can be enabled (see below).
 .El
+.Pp
+On a system using
+.Xr device.hints 5 ,
+these values are configurable for
+.Nm :
+.Bl -tag -width "hint.cyapa.%d.addr"
+.It Va hint.cyapa.%d.at
+target
+.Xr iicbus 4 .
+.It Va hint.cyapa.%d.addr
+.Nm
+i2c address on the
+.Xr iicbus 4 .
+.El
 .Sh SYSCTL VARIABLES
 These
 .Xr sysctl 8
@@ -175,7 +196,7 @@ file:
 .Dl debug.cyapa_enable_tapclick=2
 .Sh SEE ALSO
 .Xr ig4 4 ,
-.Xr smbus 4 ,
+.Xr iicbus 4 ,
 .Xr sysmouse 4 ,
 .Xr moused 8
 .Sh AUTHORS
@@ -195,6 +216,6 @@ This manual page was written by
 .Sh BUGS
 The
 .Nm
-driver detects the device based on its I2C address (0x67).
+driver detects the device from the I2C address.
 This might have unforeseen consequences if the initialization sequence
 is sent to an unknown device at that address.

Modified: stable/11/share/man/man4/ig4.4
==============================================================================
--- stable/11/share/man/man4/ig4.4	Wed Dec 14 16:21:10 2016	(r310071)
+++ stable/11/share/man/man4/ig4.4	Wed Dec 14 16:27:28 2016	(r310072)
@@ -24,18 +24,18 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 30, 2015
+.Dd October 03, 2016
 .Dt IG4 4
 .Os
 .Sh NAME
 .Nm ig4
-.Nd Intel(R) fourth generation mobile CPU integrated I2C SMBus driver
+.Nd Intel(R) fourth generation mobile CPU integrated I2C driver
 .Sh SYNOPSIS
 To compile this driver into the kernel, place the following lines into
 the kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "device ig4"
-.Cd "device smbus"
+.Cd "device iicbus"
 .Ed
 .Pp
 Alternatively, to load the driver as a module at boot time, place the following line in
@@ -46,9 +46,10 @@ ig4_load="YES"
 .Sh DESCRIPTION
 The
 .Nm
-driver provides access to peripherals attached to an I2C SMB controller.
+driver provides access to peripherals attached to an I2C controller.
+.Sh HARDWARE
 .Nm
-supports the SMBus controller found in fourth generation Intel(R) Core(TM)
+supports the I2C controllers found in fourth generation Intel(R) Core(TM)
 processors based on the mobile U-processor line for intelligent systems.
 This includes the i7-4650U, i5-4300U, i3-4010U, and 2980U.
 .Sh SYSCTL VARIABLES
@@ -57,13 +58,15 @@ These
 variables are available:
 .Bl -tag -width "debug.ig4_dump"
 .It Va debug.ig4_dump
-Setting this to a non-zero value dumps controller registers to console and
-syslog once.
-The sysctl resets to zero immediately.
+This sysctl is a zero-based bit mask.
+When any of the bits are set, a register dump is printed for
+every I2C transfer on an
+.Nm
+device with the same unit number.
 .El
 .Sh SEE ALSO
-.Xr smb 4 ,
-.Xr smbus 4
+.Xr iic 4 ,
+.Xr iicbus 4
 .Sh AUTHORS
 .An -nosplit
 The

Modified: stable/11/share/man/man4/isl.4
==============================================================================
--- stable/11/share/man/man4/isl.4	Wed Dec 14 16:21:10 2016	(r310071)
+++ stable/11/share/man/man4/isl.4	Wed Dec 14 16:27:28 2016	(r310072)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 25, 2015
+.Dd October 03, 2016
 .Dt ISL 4
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@ the kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "device isl"
 .Cd "device ig4"
-.Cd "device smbus"
+.Cd "device iicbus"
 .Ed
 .Pp
 Alternatively, to load the driver as a module at boot time, place the following line in
@@ -45,6 +45,13 @@ Alternatively, to load the driver as a m
 isl_load="YES"
 ig4_load="YES"
 .Ed
+.Pp
+In
+.Pa /boot/device.hints :
+.Cd hint.isl.0.at="iicbus0"
+.Cd hint.isl.0.addr="0x88"
+.Cd hint.isl.1.at="iicbus1"
+.Cd hint.isl.1.addr="0x88"
 .Sh DESCRIPTION
 The
 .Nm
@@ -54,6 +61,20 @@ Function.
 Functionality is basic and provided through the
 .Xr sysctl 8
 interface.
+.Pp
+On a system using
+.Xr device.hints 5 ,
+these values are configurable for
+.Nm :
+.Bl -tag -width "hint.isl.%d.addr"
+.It Va hint.isl.%d.at
+target
+.Xr iicbus 4 .
+.It Va hint.isl.%d.addr
+.Nm
+i2c address on the
+.Xr iicbus 4 .
+.El
 .Sh SYSCTL VARIABLES
 The following
 .Xr sysctl 8
@@ -86,7 +107,7 @@ $ sh /usr/local/share/examples/intel-bac
 .Ed
 .Sh SEE ALSO
 .Xr ig4 4 ,
-.Xr smbus 4
+.Xr iicbus 4
 .Sh AUTHORS
 .An -nosplit
 The
@@ -99,6 +120,6 @@ This manual page was written by
 .Sh BUGS
 The
 .Nm
-driver detects the device based on its I2C address (0x44).
+driver detects the device based from the I2C address.
 This might have unforeseen consequences if the initialization sequence
 is sent to an unknown device at that address.

Modified: stable/11/sys/conf/files
==============================================================================
--- stable/11/sys/conf/files	Wed Dec 14 16:21:10 2016	(r310071)
+++ stable/11/sys/conf/files	Wed Dec 14 16:27:28 2016	(r310072)
@@ -1222,6 +1222,7 @@ dev/cfi/cfi_bus_nexus.c		optional cfi
 dev/cfi/cfi_core.c		optional cfi
 dev/cfi/cfi_dev.c		optional cfi
 dev/cfi/cfi_disk.c		optional cfid
+dev/chromebook_platform/chromebook_platform.c	optional chromebook_platform
 dev/ciss/ciss.c			optional ciss
 dev/cm/smc90cx6.c		optional cm
 dev/cmx/cmx.c			optional cmx
@@ -1362,7 +1363,7 @@ t6fw.fw			optional cxgbe					\
 dev/cy/cy.c			optional cy
 dev/cy/cy_isa.c			optional cy isa
 dev/cy/cy_pci.c			optional cy pci
-dev/cyapa/cyapa.c		optional cyapa smbus
+dev/cyapa/cyapa.c		optional cyapa iicbus
 dev/dc/if_dc.c			optional dc pci
 dev/dc/dcphy.c			optional dc pci
 dev/dc/pnphy.c			optional dc pci
@@ -1613,8 +1614,8 @@ dev/hptiop/hptiop.c		optional hptiop scb
 dev/hwpmc/hwpmc_logging.c	optional hwpmc
 dev/hwpmc/hwpmc_mod.c		optional hwpmc
 dev/hwpmc/hwpmc_soft.c		optional hwpmc
-dev/ichiic/ig4_iic.c		optional ig4 smbus
-dev/ichiic/ig4_pci.c		optional ig4 pci smbus
+dev/ichiic/ig4_iic.c		optional ig4 iicbus
+dev/ichiic/ig4_pci.c		optional ig4 pci iicbus
 dev/ichsmb/ichsmb.c		optional ichsmb
 dev/ichsmb/ichsmb_pci.c		optional ichsmb pci
 dev/ida/ida.c			optional ida
@@ -1710,7 +1711,7 @@ dev/iscsi_initiator/isc_soc.c	optional i
 dev/iscsi_initiator/isc_sm.c	optional iscsi_initiator scbus
 dev/iscsi_initiator/isc_subr.c	optional iscsi_initiator scbus
 dev/ismt/ismt.c			optional ismt
-dev/isl/isl.c			optional isl smbus
+dev/isl/isl.c			optional isl iicbus
 dev/isp/isp.c			optional isp
 dev/isp/isp_freebsd.c		optional isp
 dev/isp/isp_library.c		optional isp

Modified: stable/11/sys/dev/cyapa/cyapa.c
==============================================================================
--- stable/11/sys/dev/cyapa/cyapa.c	Wed Dec 14 16:21:10 2016	(r310071)
+++ stable/11/sys/dev/cyapa/cyapa.c	Wed Dec 14 16:27:28 2016	(r310072)
@@ -122,11 +122,11 @@ __FBSDID("$FreeBSD$");
 #include <sys/uio.h>
 #include <sys/vnode.h>
 
-#include <dev/smbus/smbconf.h>
-#include <dev/smbus/smbus.h>
+#include <dev/iicbus/iiconf.h>
+#include <dev/iicbus/iicbus.h>
 #include <dev/cyapa/cyapa.h>
 
-#include "smbus_if.h"
+#include "iicbus_if.h"
 #include "bus_if.h"
 #include "device_if.h"
 
@@ -149,7 +149,6 @@ struct cyapa_fifo {
 struct cyapa_softc {
 	device_t dev;
 	int	count;			/* >0 if device opened */
-	int	addr;
 	struct cdev *devnode;
 	struct selinfo selinfo;
 	struct mtx mutex;
@@ -273,6 +272,30 @@ static int cyapa_reset = 0;
 SYSCTL_INT(_debug, OID_AUTO, cyapa_reset, CTLFLAG_RW,
 	    &cyapa_reset, 0, "Reset track pad");
 
+static int
+cyapa_read_bytes(device_t dev, uint8_t reg, uint8_t *val, int cnt)
+{
+	uint16_t addr = iicbus_get_addr(dev);
+	struct iic_msg msgs[] = {
+	     { addr, IIC_M_WR | IIC_M_NOSTOP, 1, &reg },
+	     { addr, IIC_M_RD, cnt, val },
+	};
+
+	return (iicbus_transfer(dev, msgs, nitems(msgs)));
+}
+
+static int
+cyapa_write_bytes(device_t dev, uint8_t reg, const uint8_t *val, int cnt)
+{
+	uint16_t addr = iicbus_get_addr(dev);
+	struct iic_msg msgs[] = {
+	     { addr, IIC_M_WR | IIC_M_NOSTOP, 1, &reg },
+	     { addr, IIC_M_WR | IIC_M_NOSTART, cnt, __DECONST(uint8_t *, val) },
+	};
+
+	return (iicbus_transfer(dev, msgs, nitems(msgs)));
+}
+
 static void
 cyapa_lock(struct cyapa_softc *sc)
 {
@@ -318,7 +341,7 @@ cyapa_notify(struct cyapa_softc *sc)
  * Initialize the device
  */
 static int
-init_device(device_t dev, struct cyapa_cap *cap, int addr, int probe)
+init_device(device_t dev, struct cyapa_cap *cap, int probe)
 {
 	static char bl_exit[] = {
 		0x00, 0xff, 0xa5, 0x00, 0x01,
@@ -326,17 +349,13 @@ init_device(device_t dev, struct cyapa_c
 	static char bl_deactivate[] = {
 		0x00, 0xff, 0x3b, 0x00, 0x01,
 		0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };
-	device_t bus;
 	struct cyapa_boot_regs boot;
 	int error;
 	int retries;
 
-	bus = device_get_parent(dev);	/* smbus */
-
 	/* Get status */
-	error = smbus_trans(bus, addr, CMD_BOOT_STATUS,
-	    SMB_TRANS_NOCNT | SMB_TRANS_7BIT,
-	    NULL, 0, (void *)&boot, sizeof(boot), NULL);
+	error = cyapa_read_bytes(dev, CMD_BOOT_STATUS,
+	    (void *)&boot, sizeof(boot));
 	if (error)
 		goto done;
 
@@ -350,25 +369,21 @@ init_device(device_t dev, struct cyapa_c
 			/* Busy, wait loop. */
 		} else if (boot.error & CYAPA_ERROR_BOOTLOADER) {
 			/* Magic */
-			error = smbus_trans(bus, addr, CMD_BOOT_STATUS,
-			    SMB_TRANS_NOCNT | SMB_TRANS_7BIT,
-			    bl_deactivate, sizeof(bl_deactivate),
-			    NULL, 0, NULL);
+			error = cyapa_write_bytes(dev, CMD_BOOT_STATUS,
+			    bl_deactivate, sizeof(bl_deactivate));
 			if (error)
 				goto done;
 		} else {
 			/* Magic */
-			error = smbus_trans(bus, addr, CMD_BOOT_STATUS,
-			    SMB_TRANS_NOCNT | SMB_TRANS_7BIT,
-			    bl_exit, sizeof(bl_exit), NULL, 0, NULL);
+			error = cyapa_write_bytes(dev, CMD_BOOT_STATUS,
+			    bl_exit, sizeof(bl_exit));
 			if (error)
 				goto done;
 		}
 		pause("cyapab1", (hz * 2) / 10);
 		--retries;
-		error = smbus_trans(bus, addr, CMD_BOOT_STATUS,
-		    SMB_TRANS_NOCNT | SMB_TRANS_7BIT,
-		    NULL, 0, (void *)&boot, sizeof(boot), NULL);
+		error = cyapa_read_bytes(dev, CMD_BOOT_STATUS,
+		    (void *)&boot, sizeof(boot));
 		if (error)
 			goto done;
 	}
@@ -381,9 +396,8 @@ init_device(device_t dev, struct cyapa_c
 
 	/* Check identity */
 	if (cap) {
-		error = smbus_trans(bus, addr, CMD_QUERY_CAPABILITIES,
-		    SMB_TRANS_NOCNT | SMB_TRANS_7BIT,
-		    NULL, 0, (void *)cap, sizeof(*cap), NULL);
+		error = cyapa_read_bytes(dev, CMD_QUERY_CAPABILITIES,
+		    (void *)cap, sizeof(*cap));
 
 		if (strncmp(cap->prod_ida, "CYTRA", 5) != 0) {
 			device_printf(dev, "Product ID \"%5.5s\" mismatch\n",
@@ -391,9 +405,8 @@ init_device(device_t dev, struct cyapa_c
 			error = ENXIO;
 		}
 	}
-	error = smbus_trans(bus, addr, CMD_BOOT_STATUS,
-	    SMB_TRANS_NOCNT | SMB_TRANS_7BIT,
-	    NULL, 0, (void *)&boot, sizeof(boot), NULL);
+	error = cyapa_read_bytes(dev, CMD_BOOT_STATUS,
+	    (void *)&boot, sizeof(boot));
 
 	if (probe == 0)		/* official init */
 		device_printf(dev, "cyapa init status %02x\n", boot.stat);
@@ -452,16 +465,16 @@ cyapa_probe(device_t dev)
 	int addr;
 	int error;
 
-	addr = smbus_get_addr(dev);
+	addr = iicbus_get_addr(dev);
 
 	/*
 	 * 0x67 - cypress trackpad on the acer c720
 	 * (other devices might use other ids).
 	 */
-	if (addr != 0x67)
+	if (addr != 0xce)
 		return (ENXIO);
 
-	error = init_device(dev, &cap, addr, 1);
+	error = init_device(dev, &cap, 1);
 	if (error != 0)
 		return (ENXIO);
 
@@ -482,15 +495,14 @@ cyapa_attach(device_t dev)
 	sc->reporting_mode = 1;
 
 	unit = device_get_unit(dev);
-	addr = smbus_get_addr(dev);
+	addr = iicbus_get_addr(dev);
 
-	if (init_device(dev, &cap, addr, 0))
+	if (init_device(dev, &cap, 0))
 		return (ENXIO);
 
 	mtx_init(&sc->mutex, "cyapa", NULL, MTX_DEF);
 
 	sc->dev = dev;
-	sc->addr = addr;
 
 	knlist_init_mtx(&sc->selinfo.si_note, &sc->mutex);
 
@@ -1159,7 +1171,7 @@ cyapa_poll_thread(void *arg)
 {
 	struct cyapa_softc *sc;
 	struct cyapa_regs regs;
-	device_t bus;		/* smbus */
+	device_t bus;		/* iicbus */
 	int error;
 	int freq;
 	int isidle;
@@ -1180,12 +1192,10 @@ cyapa_poll_thread(void *arg)
 
 	while (!sc->detaching) {
 		cyapa_unlock(sc);
-		error = smbus_request_bus(bus, sc->dev, SMB_WAIT);
+		error = iicbus_request_bus(bus, sc->dev, IIC_WAIT);
 		if (error == 0) {
-			error = smbus_trans(bus, sc->addr, CMD_DEV_STATUS,
-			    SMB_TRANS_NOCNT | SMB_TRANS_7BIT,
-			    NULL, 0,
-			    (void *)&regs, sizeof(regs), NULL);
+			error = cyapa_read_bytes(sc->dev, CMD_DEV_STATUS,
+			    (void *)&regs, sizeof(regs));
 			if (error == 0) {
 				isidle = cyapa_raw_input(sc, &regs, freq);
 			}
@@ -1200,9 +1210,9 @@ cyapa_poll_thread(void *arg)
 			     (unsigned)(ticks - last_reset) > TIME_TO_RESET)) {
 				cyapa_reset = 0;
 				last_reset = ticks;
-				init_device(sc->dev, NULL, sc->addr, 2);
+				init_device(sc->dev, NULL, 2);
 			}
-			smbus_release_bus(bus, sc->dev);
+			iicbus_release_bus(bus, sc->dev);
 		}
 		pause("cyapw", hz / freq);
 		++sc->poll_ticks;
@@ -1531,18 +1541,16 @@ cyapa_set_power_mode(struct cyapa_softc 
 	int error;
 
 	bus = device_get_parent(sc->dev);
-	error = smbus_request_bus(bus, sc->dev, SMB_WAIT);
+	error = iicbus_request_bus(bus, sc->dev, IIC_WAIT);
 	if (error == 0) {
-		error = smbus_trans(bus, sc->addr, CMD_POWER_MODE,
-		    SMB_TRANS_NOCNT | SMB_TRANS_7BIT,
-		    NULL, 0, (void *)&data, 1, NULL);
+		error = cyapa_read_bytes(sc->dev, CMD_POWER_MODE,
+		    &data, 1);
 		data = (data & ~0xFC) | mode;
 		if (error == 0) {
-			error = smbus_trans(bus, sc->addr, CMD_POWER_MODE,
-			    SMB_TRANS_NOCNT | SMB_TRANS_7BIT,
-			    (void *)&data, 1, NULL, 0, NULL);
+			error = cyapa_write_bytes(sc->dev, CMD_POWER_MODE,
+			    &data, 1);
 		}
-		smbus_release_bus(bus, sc->dev);
+		iicbus_release_bus(bus, sc->dev);
 	}
 }
 
@@ -1697,6 +1705,6 @@ cyapa_fuzz(int delta, int *fuzzp)
 	return (delta);
 }
 
-DRIVER_MODULE(cyapa, smbus, cyapa_driver, cyapa_devclass, NULL, NULL);
-MODULE_DEPEND(cyapa, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
+DRIVER_MODULE(cyapa, iicbus, cyapa_driver, cyapa_devclass, NULL, NULL);
+MODULE_DEPEND(cyapa, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER);
 MODULE_VERSION(cyapa, 1);

Modified: stable/11/sys/dev/ichiic/ig4_iic.c
==============================================================================
--- stable/11/sys/dev/ichiic/ig4_iic.c	Wed Dec 14 16:21:10 2016	(r310071)
+++ stable/11/sys/dev/ichiic/ig4_iic.c	Wed Dec 14 16:27:28 2016	(r310072)
@@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$");
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pcireg.h>
 #include <dev/smbus/smbconf.h>
+#include <dev/iicbus/iicbus.h>
+#include <dev/iicbus/iiconf.h>
 
 #include <dev/ichiic/ig4_reg.h>
 #include <dev/ichiic/ig4_var.h>
@@ -120,7 +122,7 @@ set_controller(ig4iic_softc_t *sc, uint3
 		reg_write(sc, IG4_REG_INTR_MASK, 0);
 
 	reg_write(sc, IG4_REG_I2C_EN, ctl);
-	error = SMB_ETIMEOUT;
+	error = IIC_ETIMEOUT;
 
 	for (retry = 100; retry > 0; --retry) {
 		v = reg_read(sc, IG4_REG_ENABLE_STATUS);
@@ -148,7 +150,7 @@ wait_status(ig4iic_softc_t *sc, uint32_t
 	u_int count_us = 0;
 	u_int limit_us = 25000; /* 25ms */
 
-	error = SMB_ETIMEOUT;
+	error = IIC_ETIMEOUT;
 
 	for (;;) {
 		/*
@@ -484,6 +486,236 @@ done:
 }
 
 /*
+ *				IICBUS API FUNCTIONS
+ */
+static int
+ig4iic_xfer_start(ig4iic_softc_t *sc, uint16_t slave)
+{
+	/* XXX 10-bit address support? */
+	set_slave_addr(sc, slave >> 1, 0);
+	return (0);
+}
+
+static int
+ig4iic_read(ig4iic_softc_t *sc, uint8_t *buf, uint16_t len,
+    bool repeated_start, bool stop)
+{
+	uint32_t cmd;
+	uint16_t i;
+	int error;
+
+	if (len == 0)
+		return (0);
+
+	cmd = IG4_DATA_COMMAND_RD;
+	cmd |= repeated_start ? IG4_DATA_RESTART : 0;
+	cmd |= stop && len == 1 ? IG4_DATA_STOP : 0;
+
+	/* Issue request for the first byte (could be last as well). */
+	reg_write(sc, IG4_REG_DATA_CMD, cmd);
+
+	for (i = 0; i < len; i++) {
+		/*
+		 * Maintain a pipeline by queueing the allowance for the next
+		 * read before waiting for the current read.
+		 */
+		cmd = IG4_DATA_COMMAND_RD;
+		if (i < len - 1) {
+			cmd = IG4_DATA_COMMAND_RD;
+			cmd |= stop && i == len - 2 ? IG4_DATA_STOP : 0;
+			reg_write(sc, IG4_REG_DATA_CMD, cmd);
+		}
+		error = wait_status(sc, IG4_STATUS_RX_NOTEMPTY);
+		if (error)
+			break;
+		buf[i] = data_read(sc);
+	}
+
+	(void)reg_read(sc, IG4_REG_TX_ABRT_SOURCE);
+	return (error);
+}
+
+static int
+ig4iic_write(ig4iic_softc_t *sc, uint8_t *buf, uint16_t len,
+    bool repeated_start, bool stop)
+{
+	uint32_t cmd;
+	uint16_t i;
+	int error;
+
+	if (len == 0)
+		return (0);
+
+	cmd = repeated_start ? IG4_DATA_RESTART : 0;
+	for (i = 0; i < len; i++) {
+		error = wait_status(sc, IG4_STATUS_TX_NOTFULL);
+		if (error)
+			break;
+		cmd |= buf[i];
+		cmd |= stop && i == len - 1 ? IG4_DATA_STOP : 0;
+		reg_write(sc, IG4_REG_DATA_CMD, cmd);
+		cmd = 0;
+	}
+
+	(void)reg_read(sc, IG4_REG_TX_ABRT_SOURCE);
+	return (error);
+}
+
+int
+ig4iic_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
+{
+	ig4iic_softc_t *sc = device_get_softc(dev);
+	const char *reason = NULL;
+	uint32_t i;
+	int error;
+	int unit;
+	bool rpstart;
+	bool stop;
+
+	/*
+	 * The hardware interface imposes limits on allowed I2C messages.
+	 * It is not possible to explicitly send a start or stop.
+	 * They are automatically sent (or not sent, depending on the
+	 * configuration) when a data byte is transferred.
+	 * For this reason it's impossible to send a message with no data
+	 * at all (like an SMBus quick message).
+	 * The start condition is automatically generated after the stop
+	 * condition, so it's impossible to not have a start after a stop.
+	 * The repeated start condition is automatically sent if a change
+	 * of the transfer direction happens, so it's impossible to have
+	 * a change of direction without a (repeated) start.
+	 * The repeated start can be forced even without the change of
+	 * direction.
+	 * Changing the target slave address requires resetting the hardware
+	 * state, so it's impossible to do that without the stop followed
+	 * by the start.
+	 */
+	for (i = 0; i < nmsgs; i++) {
+#if 0
+		if (i == 0 && (msgs[i].flags & IIC_M_NOSTART) != 0) {
+			reason = "first message without start";
+			break;
+		}
+		if (i == nmsgs - 1 && (msgs[i].flags & IIC_M_NOSTOP) != 0) {
+			reason = "last message without stop";
+			break;
+		}
+#endif
+		if (msgs[i].len == 0) {
+			reason = "message with no data";
+			break;
+		}
+		if (i > 0) {
+			if ((msgs[i].flags & IIC_M_NOSTART) != 0 &&
+			    (msgs[i - 1].flags & IIC_M_NOSTOP) == 0) {
+				reason = "stop not followed by start";
+				break;
+			}
+			if ((msgs[i - 1].flags & IIC_M_NOSTOP) != 0 &&
+			    msgs[i].slave != msgs[i - 1].slave) {
+				reason = "change of slave without stop";
+				break;
+			}
+			if ((msgs[i].flags & IIC_M_NOSTART) != 0 &&
+			    (msgs[i].flags & IIC_M_RD) !=
+			    (msgs[i - 1].flags & IIC_M_RD)) {
+				reason = "change of direction without repeated"
+				    " start";
+				break;
+			}
+		}
+	}
+	if (reason != NULL) {
+		if (bootverbose)
+			device_printf(dev, "%s\n", reason);
+		return (IIC_ENOTSUPP);
+	}
+
+	sx_xlock(&sc->call_lock);
+	mtx_lock(&sc->io_lock);
+
+	/* Debugging - dump registers. */
+	if (ig4_dump) {
+		unit = device_get_unit(dev);
+		if (ig4_dump & (1 << unit)) {
+			ig4_dump &= ~(1 << unit);
+			ig4iic_dump(sc);
+		}
+	}
+
+	/*
+	 * Clear any previous abort condition that may have been holding
+	 * the txfifo in reset.
+	 */
+	reg_read(sc, IG4_REG_CLR_TX_ABORT);
+
+	/*
+	 * Clean out any previously received data.
+	 */
+	if (sc->rpos != sc->rnext && bootverbose) {
+		device_printf(sc->dev, "discarding %d bytes of spurious data\n",
+		    sc->rnext - sc->rpos);
+	}
+	sc->rpos = 0;
+	sc->rnext = 0;
+
+	rpstart = false;
+	error = 0;
+	for (i = 0; i < nmsgs; i++) {
+		if ((msgs[i].flags & IIC_M_NOSTART) == 0) {
+			error = ig4iic_xfer_start(sc, msgs[i].slave);
+		} else {
+			if (!sc->slave_valid ||
+			    (msgs[i].slave >> 1) != sc->last_slave) {
+				device_printf(dev, "start condition suppressed"
+				    "but slave address is not set up");
+				error = EINVAL;
+				break;
+			}
+			rpstart = false;
+		}
+		if (error != 0)
+			break;
+
+		stop = (msgs[i].flags & IIC_M_NOSTOP) == 0;
+		if (msgs[i].flags & IIC_M_RD)
+			error = ig4iic_read(sc, msgs[i].buf, msgs[i].len,
+			    rpstart, stop);
+		else
+			error = ig4iic_write(sc, msgs[i].buf, msgs[i].len,
+			    rpstart, stop);
+		if (error != 0)
+			break;
+
+		rpstart = !stop;
+	}
+
+	mtx_unlock(&sc->io_lock);
+	sx_unlock(&sc->call_lock);
+	return (error);
+}
+
+int
+ig4iic_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr)
+{
+	ig4iic_softc_t *sc = device_get_softc(dev);
+
+	sx_xlock(&sc->call_lock);
+	mtx_lock(&sc->io_lock);
+
+	/* TODO handle speed configuration? */
+	if (oldaddr != NULL)
+		*oldaddr = sc->last_slave << 1;
+	set_slave_addr(sc, addr >> 1, 0);
+	if (addr == IIC_UNKNOWN)
+		sc->slave_valid = false;
+
+	mtx_unlock(&sc->io_lock);
+	sx_unlock(&sc->call_lock);
+	return (0);
+}
+
+/*
  *				SMBUS API FUNCTIONS
  *
  * Called from ig4iic_pci_attach/detach()
@@ -549,9 +781,9 @@ ig4iic_attach(ig4iic_softc_t *sc)
 		  IG4_CTL_RESTARTEN |
 		  IG4_CTL_SPEED_STD);
 
-	sc->smb = device_add_child(sc->dev, "smbus", -1);
-	if (sc->smb == NULL) {
-		device_printf(sc->dev, "smbus driver not found\n");
+	sc->iicbus = device_add_child(sc->dev, "iicbus", -1);
+	if (sc->iicbus == NULL) {
+		device_printf(sc->dev, "iicbus driver not found\n");
 		error = ENXIO;
 		goto done;
 	}
@@ -624,15 +856,15 @@ ig4iic_detach(ig4iic_softc_t *sc)
 		if (error)
 			return (error);
 	}
-	if (sc->smb)
-		device_delete_child(sc->dev, sc->smb);
+	if (sc->iicbus)
+		device_delete_child(sc->dev, sc->iicbus);
 	if (sc->intr_handle)
 		bus_teardown_intr(sc->dev, sc->intr_res, sc->intr_handle);
 
 	sx_xlock(&sc->call_lock);
 	mtx_lock(&sc->io_lock);
 
-	sc->smb = NULL;
+	sc->iicbus = NULL;
 	sc->intr_handle = NULL;
 	reg_write(sc, IG4_REG_INTR_MASK, 0);
 	set_controller(sc, 0);
@@ -976,4 +1208,4 @@ ig4iic_dump(ig4iic_softc_t *sc)
 }
 #undef REGDUMP
 
-DRIVER_MODULE(smbus, ig4iic, smbus_driver, smbus_devclass, NULL, NULL);
+DRIVER_MODULE(iicbus, ig4iic, iicbus_driver, iicbus_devclass, NULL, NULL);

Modified: stable/11/sys/dev/ichiic/ig4_pci.c
==============================================================================
--- stable/11/sys/dev/ichiic/ig4_pci.c	Wed Dec 14 16:21:10 2016	(r310071)
+++ stable/11/sys/dev/ichiic/ig4_pci.c	Wed Dec 14 16:27:28 2016	(r310072)
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pcireg.h>
 #include <dev/smbus/smbconf.h>
+#include <dev/iicbus/iiconf.h>
 
 #include "smbus_if.h"
 
@@ -180,6 +181,10 @@ static device_method_t ig4iic_pci_method
 	DEVMETHOD(smbus_bread, ig4iic_smb_bread),
 	DEVMETHOD(smbus_trans, ig4iic_smb_trans),
 
+	DEVMETHOD(iicbus_transfer, ig4iic_transfer),
+	DEVMETHOD(iicbus_reset, ig4iic_reset),
+	DEVMETHOD(iicbus_callback, iicbus_null_callback),
+
 	DEVMETHOD_END
 };
 
@@ -191,7 +196,9 @@ static driver_t ig4iic_pci_driver = {
 
 static devclass_t ig4iic_pci_devclass;
 
-DRIVER_MODULE(ig4iic, pci, ig4iic_pci_driver, ig4iic_pci_devclass, 0, 0);
+DRIVER_MODULE_ORDERED(ig4iic, pci, ig4iic_pci_driver, ig4iic_pci_devclass, 0, 0,
+    SI_ORDER_ANY);
 MODULE_DEPEND(ig4iic, pci, 1, 1, 1);
 MODULE_DEPEND(ig4iic, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
+MODULE_DEPEND(ig4iic, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER);
 MODULE_VERSION(ig4iic, 1);

Modified: stable/11/sys/dev/ichiic/ig4_var.h
==============================================================================
--- stable/11/sys/dev/ichiic/ig4_var.h	Wed Dec 14 16:21:10 2016	(r310071)
+++ stable/11/sys/dev/ichiic/ig4_var.h	Wed Dec 14 16:27:28 2016	(r310072)
@@ -42,6 +42,7 @@
 #include "device_if.h"
 #include "pci_if.h"
 #include "smbus_if.h"
+#include "iicbus_if.h"
 
 #define IG4_RBUFSIZE	128
 #define IG4_RBUFMASK	(IG4_RBUFSIZE - 1)
@@ -51,7 +52,7 @@ enum ig4_op { IG4_IDLE, IG4_READ, IG4_WR
 struct ig4iic_softc {
 	device_t	dev;
 	struct		intr_config_hook enum_hook;
-	device_t	smb;
+	device_t	iicbus;
 	struct resource	*regs_res;
 	int		regs_rid;
 	struct resource	*intr_res;
@@ -115,5 +116,7 @@ extern smbus_pcall_t    ig4iic_smb_pcall
 extern smbus_bwrite_t   ig4iic_smb_bwrite;
 extern smbus_bread_t    ig4iic_smb_bread;
 extern smbus_trans_t    ig4iic_smb_trans;
+extern iicbus_transfer_t ig4iic_transfer;
+extern iicbus_reset_t   ig4iic_reset;
 
 #endif

Modified: stable/11/sys/dev/iicbus/iicbus.c
==============================================================================
--- stable/11/sys/dev/iicbus/iicbus.c	Wed Dec 14 16:21:10 2016	(r310071)
+++ stable/11/sys/dev/iicbus/iicbus.c	Wed Dec 14 16:27:28 2016	(r310072)
@@ -208,7 +208,9 @@ iicbus_write_ivar(device_t bus, device_t
 	default:
 		return (EINVAL);
 	case IICBUS_IVAR_ADDR:
-		return (EINVAL);
+		if (devi->addr != 0)
+			return (EINVAL);
+		devi->addr = value;
 	case IICBUS_IVAR_NOSTOP:
 		devi->nostop = value;
 		break;

Modified: stable/11/sys/dev/isl/isl.c
==============================================================================
--- stable/11/sys/dev/isl/isl.c	Wed Dec 14 16:21:10 2016	(r310071)
+++ stable/11/sys/dev/isl/isl.c	Wed Dec 14 16:27:28 2016	(r310072)
@@ -52,14 +52,12 @@ __FBSDID("$FreeBSD$");
 #include <sys/sysctl.h>
 #include <sys/systm.h>
 #include <sys/systm.h>
-#include <sys/uio.h>
-#include <sys/vnode.h>
 
-#include <dev/smbus/smbconf.h>
-#include <dev/smbus/smbus.h>
+#include <dev/iicbus/iiconf.h>
+#include <dev/iicbus/iicbus.h>
 #include <dev/isl/isl.h>
 
-#include "smbus_if.h"
+#include "iicbus_if.h"
 #include "bus_if.h"
 #include "device_if.h"
 
@@ -71,46 +69,58 @@ __FBSDID("$FreeBSD$");
 
 struct isl_softc {
 	device_t	dev;
-	int		addr;
-
 	struct sx	isl_sx;
 };
 
 /* Returns < 0 on problem. */
-static int isl_read_sensor(device_t dev, int addr, uint8_t cmd_mask);
+static int isl_read_sensor(device_t dev, uint8_t cmd_mask);
+
+static int
+isl_read_byte(device_t dev, uint8_t reg, uint8_t *val)
+{
+	uint16_t addr = iicbus_get_addr(dev);
+	struct iic_msg msgs[] = {
+	     { addr, IIC_M_WR | IIC_M_NOSTOP, 1, &reg },
+	     { addr, IIC_M_RD, 1, val },
+	};
+
+	return (iicbus_transfer(dev, msgs, nitems(msgs)));
+}
+
+static int
+isl_write_byte(device_t dev, uint8_t reg, uint8_t val)

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

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:30:48 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7881C804FA;
 Wed, 14 Dec 2016 16:30:48 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 86FF213DE;
 Wed, 14 Dec 2016 16:30:48 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGUl8b099571;
 Wed, 14 Dec 2016 16:30:47 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGUlZl099570;
 Wed, 14 Dec 2016 16:30:47 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141630.uBEGUlZl099570@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:30:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310073 - stable/11/sys/dev/firewire
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:30:48 -0000

Author: avg
Date: Wed Dec 14 16:30:47 2016
New Revision: 310073
URL: https://svnweb.freebsd.org/changeset/base/310073

Log:
  MFC r309092: fwohci: report whether PhysicalUpperBound register is implemented

Modified:
  stable/11/sys/dev/firewire/fwohci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/firewire/fwohci.c
==============================================================================
--- stable/11/sys/dev/firewire/fwohci.c	Wed Dec 14 16:27:28 2016	(r310072)
+++ stable/11/sys/dev/firewire/fwohci.c	Wed Dec 14 16:30:47 2016	(r310073)
@@ -1860,6 +1860,16 @@ fwohci_intr_core(struct fwohci_softc *sc
 				prequpper = OHCI_PREQUPPER_MAX;
 			}
 			OWRITE(sc, OHCI_PREQUPPER, prequpper & 0xffffffff);
+			if (OREAD(sc, OHCI_PREQUPPER) !=
+			    (prequpper & 0xffffffff)) {
+				device_printf(fc->dev,
+				   "PhysicalUpperBound register is not "
+				   "implemented.  Physical memory access "
+				   "is limited to the first 4GB\n");
+				device_printf(fc->dev,
+				   "PhysicalUpperBound = 0x%08x\n",
+				    OREAD(sc, OHCI_PREQUPPER));
+			}
 		}
 		/* Set ATRetries register */
 		OWRITE(sc, OHCI_ATRETRY, 1<<(13 + 16) | 0xfff);

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:30:54 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92697C80526;
 Wed, 14 Dec 2016 16:30:54 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 61BA91445;
 Wed, 14 Dec 2016 16:30:54 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGUrwf099623;
 Wed, 14 Dec 2016 16:30:53 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGUrKP099622;
 Wed, 14 Dec 2016 16:30:53 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141630.uBEGUrKP099622@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:30:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310074 - stable/10/sys/dev/firewire
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:30:54 -0000

Author: avg
Date: Wed Dec 14 16:30:53 2016
New Revision: 310074
URL: https://svnweb.freebsd.org/changeset/base/310074

Log:
  MFC r309092: fwohci: report whether PhysicalUpperBound register is implemented

Modified:
  stable/10/sys/dev/firewire/fwohci.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/firewire/fwohci.c
==============================================================================
--- stable/10/sys/dev/firewire/fwohci.c	Wed Dec 14 16:30:47 2016	(r310073)
+++ stable/10/sys/dev/firewire/fwohci.c	Wed Dec 14 16:30:53 2016	(r310074)
@@ -1874,6 +1874,16 @@ fwohci_intr_core(struct fwohci_softc *sc
 			OWRITE(sc, OHCI_PREQLO, 0xffffffff);
 			/* 0 to 4GB region */
 			OWRITE(sc, OHCI_PREQUPPER, 0x10000);
+			if (OREAD(sc, OHCI_PREQUPPER) !=
+			    (prequpper & 0xffffffff)) {
+				device_printf(fc->dev,
+				   "PhysicalUpperBound register is not "
+				   "implemented.  Physical memory access "
+				   "is limited to the first 4GB\n");
+				device_printf(fc->dev,
+				   "PhysicalUpperBound = 0x%08x\n",
+				    OREAD(sc, OHCI_PREQUPPER));
+			}
 		}
 		/* Set ATRetries register */
 		OWRITE(sc, OHCI_ATRETRY, 1<<(13+16) | 0xfff);

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:34:14 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ACC1C806C1;
 Wed, 14 Dec 2016 16:34:14 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 305281B47;
 Wed, 14 Dec 2016 16:34:14 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGYD5X003584;
 Wed, 14 Dec 2016 16:34:13 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGYDn5003583;
 Wed, 14 Dec 2016 16:34:13 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141634.uBEGYDn5003583@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:34:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310075 - stable/11/sys/dev/intpm
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:34:14 -0000

Author: avg
Date: Wed Dec 14 16:34:13 2016
New Revision: 310075
URL: https://svnweb.freebsd.org/changeset/base/310075

Log:
  MFC r308529: intpm: clean up intsmb_bread and intsmb_pcall

Modified:
  stable/11/sys/dev/intpm/intpm.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/intpm/intpm.c
==============================================================================
--- stable/11/sys/dev/intpm/intpm.c	Wed Dec 14 16:30:53 2016	(r310074)
+++ stable/11/sys/dev/intpm/intpm.c	Wed Dec 14 16:34:13 2016	(r310075)
@@ -785,39 +785,11 @@ intsmb_readw(device_t dev, u_char slave,
 	return (error);
 }
 
-/*
- * Data sheet claims that it implements all function, but also claims
- * that it implements 7 function and not mention PCALL. So I don't know
- * whether it will work.
- */
 static int
 intsmb_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata)
 {
-#ifdef PROCCALL_TEST
-	struct intsmb_softc *sc = device_get_softc(dev);
-	int error;
 
-	INTSMB_LOCK(sc);
-	error = intsmb_free(sc);
-	if (error) {
-		INTSMB_UNLOCK(sc);
-		return (error);
-	}
-	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave & ~LSB);
-	bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd);
-	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT0, sdata & 0xff);
-	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT1, (sdata & 0xff) >> 8);
-	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_WDATA, 0);
-	error = intsmb_stop(sc);
-	if (error == 0) {
-		*rdata = bus_read_1(sc->io_res, PIIX4_SMBHSTDAT0);
-		*rdata |= bus_read_1(sc->io_res, PIIX4_SMBHSTDAT1) << 8;
-	}
-	INTSMB_UNLOCK(sc);
-	return (error);
-#else
 	return (SMB_ENOTSUPP);
-#endif
 }
 
 static int
@@ -857,9 +829,6 @@ intsmb_bread(device_t dev, u_char slave,
 	int error, i;
 	u_char data, nread;
 
-	if (*count > SMBBLOCKTRANS_MAX || *count == 0)
-		return (SMB_EINVAL);
-
 	INTSMB_LOCK(sc);
 	error = intsmb_free(sc);
 	if (error) {
@@ -872,18 +841,14 @@ intsmb_bread(device_t dev, u_char slave,
 
 	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave | LSB);
 	bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd);
-	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT0, *count);
 	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_BLOCK, 0);
 	error = intsmb_stop(sc);
 	if (error == 0) {
 		nread = bus_read_1(sc->io_res, PIIX4_SMBHSTDAT0);
 		if (nread != 0 && nread <= SMBBLOCKTRANS_MAX) {
-			for (i = 0; i < nread; i++) {
-				data = bus_read_1(sc->io_res, PIIX4_SMBBLKDAT);
-				if (i < *count)
-					buf[i] = data;
-			}
 			*count = nread;
+			for (i = 0; i < nread; i++)
+				data = bus_read_1(sc->io_res, PIIX4_SMBBLKDAT);
 		} else
 			error = SMB_EBUSERR;
 	}

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:35:18 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A197C8071C;
 Wed, 14 Dec 2016 16:35:18 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2D7DD1CDB;
 Wed, 14 Dec 2016 16:35:18 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGZHgA003680;
 Wed, 14 Dec 2016 16:35:17 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGZHM2003679;
 Wed, 14 Dec 2016 16:35:17 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141635.uBEGZHM2003679@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:35:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310076 - stable/10/sys/pci
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:35:18 -0000

Author: avg
Date: Wed Dec 14 16:35:17 2016
New Revision: 310076
URL: https://svnweb.freebsd.org/changeset/base/310076

Log:
  MFC r308529: intpm: clean up intsmb_bread and intsmb_pcall

Modified:
  stable/10/sys/pci/intpm.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/pci/intpm.c
==============================================================================
--- stable/10/sys/pci/intpm.c	Wed Dec 14 16:34:13 2016	(r310075)
+++ stable/10/sys/pci/intpm.c	Wed Dec 14 16:35:17 2016	(r310076)
@@ -785,39 +785,11 @@ intsmb_readw(device_t dev, u_char slave,
 	return (error);
 }
 
-/*
- * Data sheet claims that it implements all function, but also claims
- * that it implements 7 function and not mention PCALL. So I don't know
- * whether it will work.
- */
 static int
 intsmb_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata)
 {
-#ifdef PROCCALL_TEST
-	struct intsmb_softc *sc = device_get_softc(dev);
-	int error;
 
-	INTSMB_LOCK(sc);
-	error = intsmb_free(sc);
-	if (error) {
-		INTSMB_UNLOCK(sc);
-		return (error);
-	}
-	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave & ~LSB);
-	bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd);
-	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT0, sdata & 0xff);
-	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT1, (sdata & 0xff) >> 8);
-	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_WDATA, 0);
-	error = intsmb_stop(sc);
-	if (error == 0) {
-		*rdata = bus_read_1(sc->io_res, PIIX4_SMBHSTDAT0);
-		*rdata |= bus_read_1(sc->io_res, PIIX4_SMBHSTDAT1) << 8;
-	}
-	INTSMB_UNLOCK(sc);
-	return (error);
-#else
 	return (SMB_ENOTSUPP);
-#endif
 }
 
 static int
@@ -857,9 +829,6 @@ intsmb_bread(device_t dev, u_char slave,
 	int error, i;
 	u_char data, nread;
 
-	if (*count > SMBBLOCKTRANS_MAX || *count == 0)
-		return (SMB_EINVAL);
-
 	INTSMB_LOCK(sc);
 	error = intsmb_free(sc);
 	if (error) {
@@ -872,18 +841,14 @@ intsmb_bread(device_t dev, u_char slave,
 
 	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave | LSB);
 	bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd);
-	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT0, *count);
 	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_BLOCK, 0);
 	error = intsmb_stop(sc);
 	if (error == 0) {
 		nread = bus_read_1(sc->io_res, PIIX4_SMBHSTDAT0);
 		if (nread != 0 && nread <= SMBBLOCKTRANS_MAX) {
-			for (i = 0; i < nread; i++) {
-				data = bus_read_1(sc->io_res, PIIX4_SMBBLKDAT);
-				if (i < *count)
-					buf[i] = data;
-			}
 			*count = nread;
+			for (i = 0; i < nread; i++)
+				data = bus_read_1(sc->io_res, PIIX4_SMBBLKDAT);
 		} else
 			error = SMB_EBUSERR;
 	}

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:43:05 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3995C80ABF;
 Wed, 14 Dec 2016 16:43:05 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A2ED27C2;
 Wed, 14 Dec 2016 16:43:05 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGh4oq007704;
 Wed, 14 Dec 2016 16:43:04 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGh45K007703;
 Wed, 14 Dec 2016 16:43:04 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141643.uBEGh45K007703@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:43:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310077 - stable/11/sys/dev/firewire
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:43:05 -0000

Author: avg
Date: Wed Dec 14 16:43:04 2016
New Revision: 310077
URL: https://svnweb.freebsd.org/changeset/base/310077

Log:
  MFC r309093: firewire: initialize tag label to -1 in fw_xfer_alloc()

Modified:
  stable/11/sys/dev/firewire/firewire.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/firewire/firewire.c
==============================================================================
--- stable/11/sys/dev/firewire/firewire.c	Wed Dec 14 16:35:17 2016	(r310076)
+++ stable/11/sys/dev/firewire/firewire.c	Wed Dec 14 16:43:04 2016	(r310077)
@@ -1098,6 +1098,7 @@ fw_xfer_alloc(struct malloc_type *type)
 		return xfer;
 
 	xfer->malloc = type;
+	xfer->tl = -1;
 
 	return xfer;
 }

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:43:10 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49A55C80AF6;
 Wed, 14 Dec 2016 16:43:10 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 190657EC;
 Wed, 14 Dec 2016 16:43:10 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGh9Qi007754;
 Wed, 14 Dec 2016 16:43:09 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGh9Yh007753;
 Wed, 14 Dec 2016 16:43:09 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141643.uBEGh9Yh007753@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:43:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310078 - stable/10/sys/dev/firewire
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:43:10 -0000

Author: avg
Date: Wed Dec 14 16:43:09 2016
New Revision: 310078
URL: https://svnweb.freebsd.org/changeset/base/310078

Log:
  MFC r309093: firewire: initialize tag label to -1 in fw_xfer_alloc()

Modified:
  stable/10/sys/dev/firewire/firewire.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/firewire/firewire.c
==============================================================================
--- stable/10/sys/dev/firewire/firewire.c	Wed Dec 14 16:43:04 2016	(r310077)
+++ stable/10/sys/dev/firewire/firewire.c	Wed Dec 14 16:43:09 2016	(r310078)
@@ -1126,6 +1126,7 @@ fw_xfer_alloc(struct malloc_type *type)
 		return xfer;
 
 	xfer->malloc = type;
+	xfer->tl = -1;
 
 	return xfer;
 }

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:44:35 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36C88C80B93;
 Wed, 14 Dec 2016 16:44:35 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 060AEA8E;
 Wed, 14 Dec 2016 16:44:34 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGiYmc007885;
 Wed, 14 Dec 2016 16:44:34 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGiYMa007884;
 Wed, 14 Dec 2016 16:44:34 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141644.uBEGiYMa007884@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:44:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310079 - stable/11/sys/dev/virtio/pci
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:44:35 -0000

Author: avg
Date: Wed Dec 14 16:44:33 2016
New Revision: 310079
URL: https://svnweb.freebsd.org/changeset/base/310079

Log:
  MFC r309119: virtio_pci: fix announcement of MSI-X interrupts for queues

Modified:
  stable/11/sys/dev/virtio/pci/virtio_pci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/virtio/pci/virtio_pci.c
==============================================================================
--- stable/11/sys/dev/virtio/pci/virtio_pci.c	Wed Dec 14 16:43:09 2016	(r310078)
+++ stable/11/sys/dev/virtio/pci/virtio_pci.c	Wed Dec 14 16:44:33 2016	(r310079)
@@ -1087,7 +1087,8 @@ vtpci_set_host_msix_vectors(struct vtpci
 		 * For shared MSIX, all the virtqueues share the first
 		 * interrupt.
 		 */
-		if ((sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) == 0)
+		if (!sc->vtpci_vqs[idx].vtv_no_intr &&
+		    (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) == 0)
 			intr++;
 	}
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:44:40 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26A69C80BCB;
 Wed, 14 Dec 2016 16:44:40 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EA10BAB8;
 Wed, 14 Dec 2016 16:44:39 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEGidGC007934;
 Wed, 14 Dec 2016 16:44:39 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEGid13007933;
 Wed, 14 Dec 2016 16:44:39 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141644.uBEGid13007933@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 16:44:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310080 - stable/10/sys/dev/virtio/pci
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:44:40 -0000

Author: avg
Date: Wed Dec 14 16:44:38 2016
New Revision: 310080
URL: https://svnweb.freebsd.org/changeset/base/310080

Log:
  MFC r309119: virtio_pci: fix announcement of MSI-X interrupts for queues

Modified:
  stable/10/sys/dev/virtio/pci/virtio_pci.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/virtio/pci/virtio_pci.c
==============================================================================
--- stable/10/sys/dev/virtio/pci/virtio_pci.c	Wed Dec 14 16:44:33 2016	(r310079)
+++ stable/10/sys/dev/virtio/pci/virtio_pci.c	Wed Dec 14 16:44:38 2016	(r310080)
@@ -1087,7 +1087,8 @@ vtpci_set_host_msix_vectors(struct vtpci
 		 * For shared MSIX, all the virtqueues share the first
 		 * interrupt.
 		 */
-		if ((sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) == 0)
+		if (!sc->vtpci_vqs[idx].vtv_no_intr &&
+		    (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) == 0)
 			intr++;
 	}
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 16:47:13 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6FFAC80CBC;
 Wed, 14 Dec 2016 16:47:13 +0000 (UTC)
 (envelope-from royger@gmail.com)
Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com
 [IPv6:2a00:1450:400c:c09::241])
 (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 8C9ABE23;
 Wed, 14 Dec 2016 16:47:13 +0000 (UTC)
 (envelope-from royger@gmail.com)
Received: by mail-wm0-x241.google.com with SMTP id g23so378666wme.1;
 Wed, 14 Dec 2016 08:47:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=T97Gta3wstkBhWadqzKBpNgMkkx5ZcpptRdI9wMSsKA=;
 b=FexxSBQzthoS+hGAfEszg11QBgRxknM3vlmKL5Y01+1/oA0wZD/85FXtoq9GjCOyQm
 G+c6/gdJo+hJPHh0SWXkN84wu8SHqxWhwaEkINAGxecY6km9rHfSlIXckLFUUBcFj7ps
 Xi6RrzU0Z4fXm8mUk6Gl+QbldP7RLPvp68QRxgyxo1llvW8NNGg33XoJOCFuiPNrg5yo
 nEbwzO1lIDSrANMjOMUqCzBcEhkwVcyAdORl/mtCnZbk8ZeUp5qrg1WZXHRdaJGTuzuS
 TxUvUSZLKFyAvEuJdoNN1M/Rp+e91g+kvZTuHEEewXkmP0rd0EINNyak25gJKJiU4sf6
 //3w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
 :references:mime-version:content-disposition:in-reply-to:user-agent;
 bh=T97Gta3wstkBhWadqzKBpNgMkkx5ZcpptRdI9wMSsKA=;
 b=KBUgnBlx4hOBomMDf1MTdmEPETQBBRTdleGDbpqlt76OJS8LEE7vxYOg61ZJQ3OD4V
 5I5VEDpXHH7+DVO5nT8bVVfbzwujaGaHbKAzRozXp2iPd46CS4Pg0Qk71Q6vJbtk65Wf
 r/Ec3LdSLmCX3s0Ve3QBg5PJa3iJDhf7AJcWsnSTQHAT30ktLY8qv/re87QhAvfbpcoi
 9YmC28rNdhyS4CXmkThkunVRjhHDmMugB6txL2jRgXIYNqrB0joZxt6/+xgbJx+qQz1M
 w8loJx49WeR1khpOGtM+VvDZd6DRK/LMagvSEU5H2UgZffRYfjS7FzCcnX9JNRyZu3Qd
 7LeA==
X-Gm-Message-State: AKaTC01ypfPj2IuarznMUKXtFrEeeiM6VuJbiE4zinE6ryAyN1Myu1/mDirGd7Dda0Cm0A==
X-Received: by 10.28.45.212 with SMTP id t203mr8104397wmt.46.1481734031234;
 Wed, 14 Dec 2016 08:47:11 -0800 (PST)
Received: from localhost (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id x7sm23961661wjp.18.2016.12.14.08.47.10
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 14 Dec 2016 08:47:10 -0800 (PST)
Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <royger@gmail.com>
Date: Wed, 14 Dec 2016 16:47:05 +0000
From: Roger Pau =?iso-8859-1?Q?Monn=E9?= <royger@freebsd.org>
To: Dimitry Andric <dim@FreeBSD.org>
Cc: Colin Percival <cperciva@FreeBSD.org>,
 src-committers <src-committers@freebsd.org>,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r310013 - head/sys/dev/xen/blkfront
Message-ID: <20161214164704.grn5gvsm3u6difs2@dhcp-3-221.uk.xensource.com>
References: <201612130654.uBD6sDtF073358@repo.freebsd.org>
 <A5CE6877-FDB2-4B07-A611-29FAD91FC9F2@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <A5CE6877-FDB2-4B07-A611-29FAD91FC9F2@FreeBSD.org>
User-Agent: NeoMutt/20161126 (1.7.1)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 16:47:14 -0000

On Tue, Dec 13, 2016 at 09:28:21PM +0100, Dimitry Andric wrote:
> On 13 Dec 2016, at 07:54, Colin Percival <cperciva@FreeBSD.org> wrote:
> > 
> > Author: cperciva
> > Date: Tue Dec 13 06:54:13 2016
> > New Revision: 310013
> > URL: https://svnweb.freebsd.org/changeset/base/310013
> > 
> > Log:
> >  Check that blkfront devices have a non-zero number of sectors and a
> >  non-zero sector size.  Such a device would be a virtual disk of zero
> >  bytes; clearly not useful, and not something we should try to attach.
> > 
> >  As a fortuitous side effect, checking that these values are non-zero
> >  here results in them not *becoming* zero later on the function.  This
> >  odd behaviour began with r309124 (clang 3.9.0) but is challenging to
> >  debug; making any changes to this function whatsoever seems to affect
> >  the llvm optimizer behaviour enough to make the unexpected zeroing of
> >  the sector_size variable cease.
> 
> I've been having some fun debugging a kernel under Xen, and what I found
> is that sector_size changes from 512 to 0 because of an xs_gather() call
> in xbd_connect().  The function starts as follows:
> 
>   1222  static void
>   1223  xbd_connect(struct xbd_softc *sc)
>   1224  {
>   1225          device_t dev = sc->xbd_dev;
>   1226          unsigned long sectors, sector_size, phys_sector_size;
>   1227          unsigned int binfo;
>   1228          int err, feature_barrier, feature_flush;
> ...
>   1237          err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
>   1238              "sectors", "%lu", &sectors,
>   1239              "info", "%u", &binfo,
>   1240              "sector-size", "%lu", &sector_size,
>   1241              NULL);
> 
> After this first call to xs_gather(), sectors is 44040322 (in my case of
> a ~21G disk), binfo is zero, and sector_size is 512.  During execution
> of the following few lines, sector_size stays 512, until just after the
> fourth call to xs_gather():
> 
>   1259          err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
>   1260               "feature-flush-cache", "%lu", &feature_flush,
>   1261               NULL);
> 
> and then it becomes zero!  This is because the %lu format scans a 64 bit
> unsigned integer, while the feature_flush variable is a 32 bit signed
> integer, thus overwriting an adjacent location on the stack, which
> happens to contain sector_size: in the assembly output, sector_size is
> at -88(%rbp), while feature_flush is at -92(%rbp).
> 
> There is another instance of such an incorrect format, a few lines
> before this, but it doesn't seem to scribble over important data (or we
> didn't panic because of it, yet):
> 
>   1253          err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
>   1254               "feature-barrier", "%lu", &feature_barrier,
>   1255               NULL);
> 
> Here, feature_barrier is a 32 bit signed integer, while %lu again scans
> a 64 bit unsigned integer.
> 
> In short, I think the following change would also fix the problem:
> 
> Index: sys/dev/xen/blkfront/blkfront.c
> ===================================================================
> --- sys/dev/xen/blkfront/blkfront.c     (revision 309817)
> +++ sys/dev/xen/blkfront/blkfront.c     (working copy)
> @@ -1251,13 +1251,13 @@ xbd_connect(struct xbd_softc *sc)
>         if (err || phys_sector_size <= sector_size)
>                 phys_sector_size = 0;
>         err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
> -            "feature-barrier", "%lu", &feature_barrier,
> +            "feature-barrier", "%d", &feature_barrier,
>              NULL);
>         if (err == 0 && feature_barrier != 0)
>                 sc->xbd_flags |= XBDF_BARRIER;
> 
>         err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
> -            "feature-flush-cache", "%lu", &feature_flush,
> +            "feature-flush-cache", "%d", &feature_flush,
>              NULL);
>         if (err == 0 && feature_flush != 0)
>                 sc->xbd_flags |= XBDF_FLUSH;
> 
> However, I have some difficulty getting a custom-built kernel booting on
> my very rudimentary Xen setup.  I am using a snapshot raw image, with no
> idea how to insert a kernel into it.
> 
> E.g, can you please try this out, instead of the zero-check fix?  I am
> very curious whether that fixes the panics. :)

Yes, this indeed fixes the panic, I've reverted Colin's patch and applied yours, 
and everything seems fine. Please go ahead and commit it.

xs_gather should really go away and we should use something that we can sanitize 
at compile time using __scanflike & friends.

Thanks, Roger.

From owner-svn-src-all@freebsd.org  Wed Dec 14 17:17:09 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 423E1C778A2;
 Wed, 14 Dec 2016 17:17:09 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0410F681;
 Wed, 14 Dec 2016 17:17:08 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEHH8JR020250;
 Wed, 14 Dec 2016 17:17:08 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEHH8e4020249;
 Wed, 14 Dec 2016 17:17:08 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201612141717.uBEHH8e4020249@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon <avg@FreeBSD.org>
Date: Wed, 14 Dec 2016 17:17:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310081 - stable/10/sys/dev/firewire
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 17:17:09 -0000

Author: avg
Date: Wed Dec 14 17:17:07 2016
New Revision: 310081
URL: https://svnweb.freebsd.org/changeset/base/310081

Log:
  MFC r277511: Fix remote DMA based firewire debugging when targeting
  systems with more than 4GB of physical memory.

Modified:
  stable/10/sys/dev/firewire/fwohci.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/firewire/fwohci.c
==============================================================================
--- stable/10/sys/dev/firewire/fwohci.c	Wed Dec 14 16:44:38 2016	(r310080)
+++ stable/10/sys/dev/firewire/fwohci.c	Wed Dec 14 17:17:07 2016	(r310081)
@@ -55,6 +55,7 @@
 #include <sys/kdb.h>
 
 #include <machine/bus.h>
+#include <machine/md_var.h>
 
 #if defined(__DragonFly__) || __FreeBSD_version < 500000
 #include <machine/clock.h>		/* for DELAY() */
@@ -202,6 +203,7 @@ static void fwohci_task_dma(void *, int)
 #define	OHCI_PREQLO		0x118
 #define	OHCI_PREQLOCLR		0x11c
 #define	OHCI_PREQUPPER		0x120
+#define OHCI_PREQUPPER_MAX	0xffff0000
 
 #define	OHCI_SID_BUF		0x64
 #define	OHCI_SID_CNT		0x68
@@ -869,7 +871,7 @@ fwohci_execute_db2(void *arg, bus_dma_se
 static void
 fwohci_start(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
 {
-	int i, s;
+	int i;
 	int tcode, hdr_len, pl_off;
 	int fsegment = -1;
 	uint32_t off;
@@ -895,7 +897,6 @@ fwohci_start(struct fwohci_softc *sc, st
 	if (dbch->flags & FWOHCI_DBCH_FULL)
 		return;
 
-	s = splfw();
 	db_tr = dbch->top;
 txloop:
 	xfer = STAILQ_FIRST(&dbch->xferq.q);
@@ -1045,7 +1046,6 @@ kick:
 	}
 
 	dbch->top = db_tr;
-	splx(s);
 	return;
 }
 
@@ -1841,6 +1841,7 @@ static void
 fwohci_intr_core(struct fwohci_softc *sc, uint32_t stat, int count)
 {
 	struct firewire_comm *fc = (struct firewire_comm *)sc;
+	uintmax_t prequpper;
 	uint32_t node_id, plen;
 
 	FW_GLOCK_ASSERT(fc);
@@ -1872,8 +1873,17 @@ fwohci_intr_core(struct fwohci_softc *sc
 			/* allow from all nodes */
 			OWRITE(sc, OHCI_PREQHI, 0x7fffffff);
 			OWRITE(sc, OHCI_PREQLO, 0xffffffff);
-			/* 0 to 4GB region */
-			OWRITE(sc, OHCI_PREQUPPER, 0x10000);
+			prequpper = ((uintmax_t)Maxmem << PAGE_SHIFT) >> 16;
+			if (prequpper > OHCI_PREQUPPER_MAX) {
+				device_printf(fc->dev,
+				    "Physical memory size of 0x%jx exceeds "
+				    "fire wire address space.  Limiting dma "
+				    "to memory below 0x%jx\n",
+				    (uintmax_t)Maxmem << PAGE_SHIFT,
+				    (uintmax_t)OHCI_PREQUPPER_MAX << 16);
+				prequpper = OHCI_PREQUPPER_MAX;
+			}
+			OWRITE(sc, OHCI_PREQUPPER, prequpper & 0xffffffff);
 			if (OREAD(sc, OHCI_PREQUPPER) !=
 			    (prequpper & 0xffffffff)) {
 				device_printf(fc->dev,
@@ -2203,7 +2213,7 @@ fwohci_rbuf_update(struct fwohci_softc *
 	struct fw_bulkxfer *chunk;
 	struct fw_xferq *ir;
 	uint32_t stat;
-	int s, w = 0, ldesc;
+	int w = 0, ldesc;
 
 	ir = fc->ir[dmach];
 	ldesc = sc->ir[dmach].ndesc - 1;
@@ -2211,7 +2221,6 @@ fwohci_rbuf_update(struct fwohci_softc *
 #if 0
 	dump_db(sc, dmach);
 #endif
-	s = splfw();
 	if ((ir->flag & FWXFERQ_HANDLER) == 0)
 		FW_GLOCK(fc);
 	fwdma_sync_multiseg_all(sc->ir[dmach].am, BUS_DMASYNC_POSTREAD);
@@ -2250,7 +2259,6 @@ fwohci_rbuf_update(struct fwohci_softc *
 	}
 	if ((ir->flag & FWXFERQ_HANDLER) == 0)
 		FW_GUNLOCK(fc);
-	splx(s);
 	if (w == 0)
 		return;
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 17:17:23 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A3A4C778FC;
 Wed, 14 Dec 2016 17:17:23 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from mail.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 E948F7B1;
 Wed, 14 Dec 2016 17:17:22 +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 mail.baldwin.cx (Postfix) with ESMTPSA id AC33D10A76C;
 Wed, 14 Dec 2016 12:17:21 -0500 (EST)
From: John Baldwin <jhb@freebsd.org>
To: Bruce Evans <brde@optusnet.com.au>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r310045 - head/sys/ddb
Date: Wed, 14 Dec 2016 09:17:17 -0800
Message-ID: <1943330.5ZCxhTZVMq@ralph.baldwin.cx>
User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; )
In-Reply-To: <20161214140645.W3397@besplex.bde.org>
References: <201612140018.uBE0ICrE004686@repo.freebsd.org>
 <2285301.DAKmd1GIbI@ralph.baldwin.cx> <20161214140645.W3397@besplex.bde.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.4.3
 (mail.baldwin.cx); Wed, 14 Dec 2016 12:17:21 -0500 (EST)
X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx
X-Virus-Status: Clean
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 17:17:23 -0000

On Wednesday, December 14, 2016 07:24:46 PM Bruce Evans wrote:
> On Tue, 13 Dec 2016, John Baldwin wrote:
> 
> > On Wednesday, December 14, 2016 12:18:12 AM John Baldwin wrote:
> >>
> >> Log:
> >>   Use casts to force an unsigned comparison in db_search_symbol().
> >>
> >>   On all of our platforms, db_expr_t is a signed integer while
> >>   db_addr_t is an unsigned integer value.  db_search_symbol used variables
> >>   of type db_expr_t to hold the current offset of the requested address from
> >>   the "best" symbol found so far.  This value was initialized to '~0'.
> >>   When a new symbol is found from a symbol table, the associated diff for the
> >>   new symbol is compared against the existing value as 'if (newdiff < diff)'
> >>   to determine if the new symbol had a smaller diff and was thus a closer
> >>   match.
> >>
> >>   On 64-bit MIPS, the '~0' was treated as a negative value (-1).  A lookup
> >>   that found a perfect match of an address against a symbol returned a diff
> >>   of 0.  However, in signed comparisons, 0 is not less than -1.  As a result,
> >>   DDB on 64-bit MIPS never resolved any addresses to symbols.  Workaround
> >>   this by using casts to force an unsigned comparison.
> >
> > I am somewhat unsure of why this worked on other architectures.  amd64
> > treated ~0 as 0xffffffff which when assigned to a 64-bit register was
> 
> It is treated the same on all non-broken arches, and I doubt that MIPS64
> is broken here.
> 
> ~0 is -1 on all arches (since no supported arches are 1's complement),
> but it was assigned to 'unsigned diff' which gives 0xffffffff on all
> supported arches.  Then diff is assigned to 'size_t newdiff', giving
> no change in type or value on 32-bit arches, and zero-extension to the
> same value but larger type on 64-bit arches.
> 
> Note that the type of diff is very broken.  It is unsigned.  This corrupts
> not only ~0, but also the final difference returned in *offp.  The return
> value also gets corrupted from 32 bits unsigned to 32 bits signed on
> 32-bit arches, so offsets >= 2**31 are fragile on all arches.  I think
> most cases work because the offset is 0.
> 
> I don't see how initializing to 'val' can help.  It still gets corrupted
> to unsigned, and I would expect it to make the problem much worse because
> the truncation gives an even smaller value.  E.g., if val is any multiple
> of 2**32, truncating it gives 0.  Without the truncation, 'val' is a good
> upper bound for the offset.

I should have mentioned this change in the commit.  Other symbol resolution
APIs in the kernel follow the convention that the raw address is returned
as the offset ('diff') if no matching symbol is found.  This change made
db_search_symbol() consistent with that.

> Perhaps the problem is more with the initialization of newdiff.  It is
> initialized to the corrupted value in diff.  I don't know the details of
> the API, but if X_db_search_symbol() uses this as an input parameter to
> limit the search, it might be happier with the smaller corrupted value
> than the larger one.  X_db_search_symbol() seems to have working types
> and values, though still too much hard-coding of types.
> 
> Your casts to uintmax_t have no effect.  The types are already unsigned,
> and the corrupted values cannot be fixed by later casts.

So I got myself into a bit of a mess and the hints are in my commit message
(but obscurely).  I am working within a branch and one of the things I had
done in this branch was to fix numerous warnings compiling DDB with a MIPS
n32 kernel.  n32 is quite special in that pointers are 32-bits while registers
are 64-bits, so db_addr_t is a uint32_t, and db_expr_t was a int64_t.  I had
"fixed" newdiff and diff to both be db_expr_t to match the type that
X_db_search_symbol() returns and that is how I got into trouble as that
changed 'diff' to be signed instead of unsigned.  I will revert the commit
from HEAD (though perhaps re-commit the 'val' part of initializing diff if
making that API consistent is a good thing to do).

-- 
John Baldwin

From owner-svn-src-all@freebsd.org  Wed Dec 14 17:27:45 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAFE9C77F64;
 Wed, 14 Dec 2016 17:27:45 +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 AA0C115B2;
 Wed, 14 Dec 2016 17:27:45 +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 uBEHRigd024507;
 Wed, 14 Dec 2016 17:27:44 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEHRi6V024506;
 Wed, 14 Dec 2016 17:27:44 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612141727.uBEHRi6V024506@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Wed, 14 Dec 2016 17:27:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310082 - stable/10/contrib/llvm/lib/Analysis
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 17:27:46 -0000

Author: dim
Date: Wed Dec 14 17:27:44 2016
New Revision: 310082
URL: https://svnweb.freebsd.org/changeset/base/310082

Log:
  Merge r309860 from stable/9, as this also applies to stable/10:
  
  Fix libllvmanalysis build failure after r309857: on stable/9, llvm is
  compiled by gcc, and without -std=c++11, so the nullptr keyword is
  unknown.  Use the old-school plain zero syntax instead.

Modified:
  stable/10/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
==============================================================================
--- stable/10/contrib/llvm/lib/Analysis/LazyValueInfo.cpp	Wed Dec 14 17:17:07 2016	(r310081)
+++ stable/10/contrib/llvm/lib/Analysis/LazyValueInfo.cpp	Wed Dec 14 17:27:44 2016	(r310082)
@@ -1051,7 +1051,7 @@ static bool isKnownNonConstant(Value *V)
 Constant *LazyValueInfo::getConstant(Value *V, BasicBlock *BB) {
   // Bail out early if V is known not to be a Constant.
   if (isKnownNonConstant(V))
-    return nullptr;
+    return 0;
 
   LVILatticeVal Result = getCache(PImpl).getValueInBlock(V, BB);
   

From owner-svn-src-all@freebsd.org  Wed Dec 14 17:28:56 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3A8EC77FD4;
 Wed, 14 Dec 2016 17:28:56 +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 845691730;
 Wed, 14 Dec 2016 17:28:56 +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 uBEHStvX024589;
 Wed, 14 Dec 2016 17:28:55 GMT (envelope-from alc@FreeBSD.org)
Received: (from alc@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEHStwQ024588;
 Wed, 14 Dec 2016 17:28:55 GMT (envelope-from alc@FreeBSD.org)
Message-Id: <201612141728.uBEHStwQ024588@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org
 using -f
From: Alan Cox <alc@FreeBSD.org>
Date: Wed, 14 Dec 2016 17:28:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310083 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 17:28:56 -0000

Author: alc
Date: Wed Dec 14 17:28:55 2016
New Revision: 310083
URL: https://svnweb.freebsd.org/changeset/base/310083

Log:
  Tidy up.  Mostly, remove or replace stale comments.  Most of the comments
  in this file actually described the operation of the swap pager, not the
  default pager.  Given that this is the wrong place to discuss the
  implementation of the swap pager, it shouldn't come as a surprise that as
  the swap pager evolved these comments became increasingly stale.  In
  addition, apply some style fixes, like modernizing a few remaining old-
  style function definitions.
  
  Reviewed by:	kib, markj
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D8781

Modified:
  head/sys/vm/default_pager.c

Modified: head/sys/vm/default_pager.c
==============================================================================
--- head/sys/vm/default_pager.c	Wed Dec 14 17:27:44 2016	(r310082)
+++ head/sys/vm/default_pager.c	Wed Dec 14 17:28:55 2016	(r310083)
@@ -27,14 +27,6 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * The default pager is responsible for supplying backing store to unbacked
- * storage.  The backing store is usually swap so we just fall through to
- * the swap routines.  However, since swap metadata has not been assigned,
- * the swap routines assign and manage the swap backing store through the
- * vm_page->swapblk field.  The object is only converted when the page is 
- * physically freed after having been cleaned and even then vm_page->swapblk
- * is maintained whenever a resident page also has swap backing store.
  */
 
 #include <sys/cdefs.h>
@@ -53,14 +45,16 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_pager.h>
 #include <vm/swap_pager.h>
 
-static vm_object_t default_pager_alloc(void *, vm_ooffset_t, vm_prot_t,
-    vm_ooffset_t, struct ucred *);
-static void default_pager_dealloc(vm_object_t);
-static int default_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *);
-static void default_pager_putpages(vm_object_t, vm_page_t *, int, 
-		boolean_t, int *);
-static boolean_t default_pager_haspage(vm_object_t, vm_pindex_t, int *, 
-		int *);
+static vm_object_t	default_pager_alloc(void *, vm_ooffset_t, vm_prot_t,
+			    vm_ooffset_t, struct ucred *);
+static void		default_pager_dealloc(vm_object_t);
+static int		default_pager_getpages(vm_object_t, vm_page_t *, int,
+			    int *, int *);
+static void		default_pager_putpages(vm_object_t, vm_page_t *, int, 
+			    boolean_t, int *);
+static boolean_t	default_pager_haspage(vm_object_t, vm_pindex_t, int *, 
+			    int *);
+
 /*
  * pagerops for OBJT_DEFAULT - "default pager".
  */
@@ -73,7 +67,7 @@ struct pagerops defaultpagerops = {
 };
 
 /*
- * no_pager_alloc just returns an initialized object.
+ * Return an initialized object.
  */
 static vm_object_t
 default_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
@@ -100,68 +94,54 @@ default_pager_alloc(void *handle, vm_oof
 }
 
 /*
- * deallocate resources associated with default objects.   The default objects
- * have no special resources allocated to them, but the vm_page's being used
- * in this object might.  Still, we do not have to do anything - we will free
- * the swapblk in the underlying vm_page's when we free the vm_page or
- * garbage collect the vm_page cache list.
+ * Deallocate resources associated with the object.
  */
 static void
-default_pager_dealloc(object)
-	vm_object_t object;
+default_pager_dealloc(vm_object_t object)
 {
-	/*
-	 * OBJT_DEFAULT objects have no special resources allocated to them.
-	 */
+
+	/* Reserved swap is released by vm_object_destroy(). */
 	object->type = OBJT_DEAD;
 }
 
 /*
- * Load pages from backing store.  Since OBJT_DEFAULT is converted to
- * OBJT_SWAP at the time a swap-backed vm_page_t is freed, we will never
- * see a vm_page with assigned swap here.
+ * Load pages from backing store.
  */
 static int
 default_pager_getpages(vm_object_t object, vm_page_t *m, int count,
     int *rbehind, int *rahead)
 {
 
+	/*
+	 * Since an OBJT_DEFAULT object is converted to OBJT_SWAP by the first
+	 * call to the putpages method, this function will never be called on
+	 * a vm_page with assigned swap.
+	 */
 	return (VM_PAGER_FAIL);
 }
 
 /*
- * Store pages to backing store.  We should assign swap and initiate
- * I/O.  We do not actually convert the object to OBJT_SWAP here.  The
- * object will be converted when the written-out vm_page_t is moved from the
- * cache to the free list.
+ * Store pages to backing store.
  */
 static void
 default_pager_putpages(vm_object_t object, vm_page_t *m, int count,
     int flags, int *rtvals)
 {
 
+	/* The swap pager will convert the object to OBJT_SWAP. */
 	swappagerops.pgo_putpages(object, m, count, flags, rtvals);
 }
 
 /*
- * Tell us whether the backing store for the requested (object,index) is
- * synchronized.  i.e. tell us whether we can throw the page away and 
- * reload it later.  So, for example, if we are in the process of writing
- * the page to its backing store, or if no backing store has been assigned,
- * it is not yet synchronized.
- *
- * It is possible to have fully-synchronized swap assigned without the
- * object having been converted.  We just call swap_pager_haspage() to
- * deal with it since it must already deal with it plus deal with swap
- * meta-data structures.
+ * Tell us whether the requested (object,index) is available from the object's
+ * backing store.
  */
 static boolean_t
-default_pager_haspage(object, pindex, before, after)
-	vm_object_t object;
-	vm_pindex_t pindex;
-	int *before;
-	int *after;
+default_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before,
+    int *after)
 {
-	return FALSE;
+
+	/* An OBJT_DEFAULT object has no backing store. */
+	return (FALSE);
 }
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 19:00:10 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17F7AC802FD;
 Wed, 14 Dec 2016 19:00:10 +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 D4B3F190E;
 Wed, 14 Dec 2016 19:00: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 uBEJ09eF062345;
 Wed, 14 Dec 2016 19:00:09 GMT (envelope-from markj@FreeBSD.org)
Received: (from markj@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEJ090i062344;
 Wed, 14 Dec 2016 19:00:09 GMT (envelope-from markj@FreeBSD.org)
Message-Id: <201612141900.uBEJ090i062344@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: markj set sender to
 markj@FreeBSD.org using -f
From: Mark Johnston <markj@FreeBSD.org>
Date: Wed, 14 Dec 2016 19:00:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310084 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 19:00:10 -0000

Author: markj
Date: Wed Dec 14 19:00:08 2016
New Revision: 310084
URL: https://svnweb.freebsd.org/changeset/base/310084

Log:
  Don't run the MCA record refill task during boot.
  
  The MCA taskqueue is not initialized until some time after CMCIs are
  enabled on the BSP.
  
  Reviewed by:	cem, jhb
  MFC after:	1 week
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D8783

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

Modified: head/sys/x86/x86/mca.c
==============================================================================
--- head/sys/x86/x86/mca.c	Wed Dec 14 17:28:55 2016	(r310083)
+++ head/sys/x86/x86/mca.c	Wed Dec 14 19:00:08 2016	(r310084)
@@ -508,7 +508,7 @@ mca_record_entry(enum scan_mode mode, co
 	STAILQ_INSERT_TAIL(&mca_records, rec, link);
 	mca_count++;
 	mtx_unlock_spin(&mca_lock);
-	if (mode == CMCI)
+	if (mode == CMCI && !cold)
 		taskqueue_enqueue(mca_tq, &mca_refill_task);
 }
 
@@ -714,6 +714,9 @@ mca_createtq(void *dummy)
 	mca_tq = taskqueue_create_fast("mca", M_WAITOK,
 	    taskqueue_thread_enqueue, &mca_tq);
 	taskqueue_start_threads(&mca_tq, 1, PI_SWI(SWI_TQ), "mca taskq");
+
+	/* CMCIs during boot may have claimed items from the freelist. */
+	mca_fill_freelist();
 }
 SYSINIT(mca_createtq, SI_SUB_CONFIGURE, SI_ORDER_ANY, mca_createtq, NULL);
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 19:01:44 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3803C8036B;
 Wed, 14 Dec 2016 19:01:44 +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 C31CE1CC6;
 Wed, 14 Dec 2016 19:01:44 +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 uBEJ1hBX065251;
 Wed, 14 Dec 2016 19:01:43 GMT (envelope-from markj@FreeBSD.org)
Received: (from markj@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEJ1hng065250;
 Wed, 14 Dec 2016 19:01:43 GMT (envelope-from markj@FreeBSD.org)
Message-Id: <201612141901.uBEJ1hng065250@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: markj set sender to
 markj@FreeBSD.org using -f
From: Mark Johnston <markj@FreeBSD.org>
Date: Wed, 14 Dec 2016 19:01:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310085 - head/cddl/usr.sbin/dtrace/tests/tools
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 19:01:45 -0000

Author: markj
Date: Wed Dec 14 19:01:43 2016
New Revision: 310085
URL: https://svnweb.freebsd.org/changeset/base/310085

Log:
  Skip a ustack test that triggers an assertion on INVARIANTS kernels.
  
  Reported by:	ngie
  Sponsored by:	Dell EMC Isilon
  X-MFC-With:	r309698

Modified:
  head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh

Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
==============================================================================
--- head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh	Wed Dec 14 19:00:08 2016	(r310084)
+++ head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh	Wed Dec 14 19:01:43 2016	(r310085)
@@ -188,3 +188,6 @@ exclude EXFAIL common/usdt/tst.static2.k
 
 # Uses the Solaris-specific ppriv(1).
 exclude EXFAIL common/usdt/tst.user.ksh
+
+# Triggers a lock assertion by using the raise() action from a profile probe.
+exclude SKIP common/ustack/tst.spin.ksh

From owner-svn-src-all@freebsd.org  Wed Dec 14 19:28:20 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87614C80F35;
 Wed, 14 Dec 2016 19:28:20 +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 5701312E9;
 Wed, 14 Dec 2016 19:28:20 +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 uBEJSJDl074349;
 Wed, 14 Dec 2016 19:28:19 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEJSJor074348;
 Wed, 14 Dec 2016 19:28:19 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612141928.uBEJSJor074348@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Wed, 14 Dec 2016 19:28:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310086 - head/sys/dev/xen/blkfront
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 19:28:20 -0000

Author: dim
Date: Wed Dec 14 19:28:19 2016
New Revision: 310086
URL: https://svnweb.freebsd.org/changeset/base/310086

Log:
  In xbd_connect(), use correct scanf conversion specifiers for the
  feature_barrier and feature_flush variables.  Otherwise, adjacent
  variables on the stack, such as sector_size, may be overwritten, with
  disastrous results.
  
  Note that I did not see a good reason to revert the addition of zero
  checks introduced in r310013.  Better safe than sorry.
  
  PR:		215209
  Tested by:	royger
  MFC after:	3 days

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

Modified: head/sys/dev/xen/blkfront/blkfront.c
==============================================================================
--- head/sys/dev/xen/blkfront/blkfront.c	Wed Dec 14 19:01:43 2016	(r310085)
+++ head/sys/dev/xen/blkfront/blkfront.c	Wed Dec 14 19:28:19 2016	(r310086)
@@ -1259,13 +1259,13 @@ xbd_connect(struct xbd_softc *sc)
 	if (err || phys_sector_size <= sector_size)
 		phys_sector_size = 0;
 	err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
-	     "feature-barrier", "%lu", &feature_barrier,
+	     "feature-barrier", "%d", &feature_barrier,
 	     NULL);
 	if (err == 0 && feature_barrier != 0)
 		sc->xbd_flags |= XBDF_BARRIER;
 
 	err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
-	     "feature-flush-cache", "%lu", &feature_flush,
+	     "feature-flush-cache", "%d", &feature_flush,
 	     NULL);
 	if (err == 0 && feature_flush != 0)
 		sc->xbd_flags |= XBDF_FLUSH;

From owner-svn-src-all@freebsd.org  Wed Dec 14 19:49:06 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A884C807AD;
 Wed, 14 Dec 2016 19:49:06 +0000 (UTC)
 (envelope-from mavbsd@gmail.com)
Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com
 [IPv6:2a00:1450:400c:c09::241])
 (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 41D0C13D1;
 Wed, 14 Dec 2016 19:49:06 +0000 (UTC)
 (envelope-from mavbsd@gmail.com)
Received: by mail-wm0-x241.google.com with SMTP id g23so1382505wme.1;
 Wed, 14 Dec 2016 11:49:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-transfer-encoding;
 bh=FCMpIC4poDpsidj3S82JRBpKjT9Gq/XUZ65tYyrMIZ8=;
 b=uriIXybuvKl8RZ7BYK+alRIVVnjv/AuHuhrUBivNc9VsFW3rRK/xjPWrCZT2ALXrz9
 ag86CKPxOqifmVV+aGwIIq6p7bZK8nq3BmteoUrn6pnrlFMJKLOISQHOEdaiGajC0efu
 9F0rHQ+UOtgWTKgIhNrPacYitZAnU/1vI4PH6az2PcJpAxFf7mZTQ+H2cR0m8U3t4aqM
 9/e8noEt65o5QtWFQWxg+JOME6Zrb9Wu7NkoVDVWtzlPCBQepVw2/jqi96whyZt2iWGW
 jGjl0m3HApO0+t402z74AAZNlCal3FfLtpB66Re8XIQaJpQHe1vaFDYGHqYUAPZhSFYC
 W1Uw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-transfer-encoding;
 bh=FCMpIC4poDpsidj3S82JRBpKjT9Gq/XUZ65tYyrMIZ8=;
 b=llSdfXGewq/0EkvQwG5ulC3HlAtc6PgQEFY3tHn+AkErtbyySfbiUlM+OuymfkBKyr
 m53SdhqJfdOHYSN4DbtzpN9e9rGpnv4ILrH/wYGgMuE6rt8ZQ2CsTE4ImOgwf2GlJaOe
 co5ps5LxDnMnVrGOX1dEqKcxn9lo4QMzFJ7zdsgWx8qFQvbI/tzyRPNsAIUch0b0+TEW
 jhicsqD8uEXNtTzBGl6PNpRuW2hqLxZoLE4XfHmS06VpjWJ94AA1UzadeTEr2C2L1qsR
 fdrFzabhTZwHKtCG1h40PGiA8k3uC1Bwhl5UJbZYBi3h3xlOA5ebHg0JWznnYVzr1gLA
 CHUw==
X-Gm-Message-State: AKaTC02gJC2SSk2heJ56hl2MZxEip59W/1hn4GcoW6vNkz5d8P2DF4FuGNpcQuF20sMZUw==
X-Received: by 10.25.125.132 with SMTP id y126mr35014934lfc.86.1481744943226; 
 Wed, 14 Dec 2016 11:49:03 -0800 (PST)
Received: from spectre.mavhome.dp.ua ([134.249.139.101])
 by smtp.gmail.com with ESMTPSA id c78sm10975384lfc.39.2016.12.14.11.49.02
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 14 Dec 2016 11:49:02 -0800 (PST)
Sender: Alexander Motin <mavbsd@gmail.com>
Subject: Re: svn commit: r309714 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
To: Andriy Gapon <avg@FreeBSD.org>, src-committers@FreeBSD.org,
 svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org
References: <201612081558.uB8Fw4xA027508@repo.freebsd.org>
 <cd831c65-ffb3-b84b-7e0e-b84ae32bace1@FreeBSD.org>
From: Alexander Motin <mav@FreeBSD.org>
Message-ID: <eaaef2a9-eb5a-5629-c8f3-54c3a45b16b5@FreeBSD.org>
Date: Wed, 14 Dec 2016 21:49:01 +0200
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101
 Thunderbird/45.4.0
MIME-Version: 1.0
In-Reply-To: <cd831c65-ffb3-b84b-7e0e-b84ae32bace1@FreeBSD.org>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 19:49:06 -0000

On 14.12.2016 14:03, Andriy Gapon wrote:
> On 08/12/2016 17:58, Alexander Motin wrote:
>>   This change switches zio_timestamp_compare() from comparing uninitialized
>>   io_offset to really populated io_bookmark values.  I haven't decided yet
>>   what to do with timestampts, but on simple tests this change gives the
>>   same peformance results by just making code to work as declared.
> 
> I think that we should just enable precise timestamps.
> I just can't see them noticeably hurting performance given the amount of
> calculations, memory allocations, locking, etc, that ZFS already has.
> And there are layers above and below ZFS too.

It is orthogonal to this change and can be done any time, if decided.  I
worried mostly about some older systems still using HPET or ACPI
timecounters, where half dozen extra timer calls per single I/O may be
quite expensive.

I've recently reviewed all places where ZFS calls gethrtime(), and found
that in most of them precision is not needed, even 1 second would be
enough, not even 1/hz.  I've found only two cases where precision is
important, both about ZIO sorting in different places (this is one of
the two), and both of them are now workarounded now by using offset as
secondary key.

-- 
Alexander Motin

From owner-svn-src-all@freebsd.org  Wed Dec 14 20:53:48 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0516DC7785A;
 Wed, 14 Dec 2016 20:53:48 +0000 (UTC)
 (envelope-from rene@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C91AD1CE5;
 Wed, 14 Dec 2016 20:53:47 +0000 (UTC)
 (envelope-from rene@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBEKrkTF010982;
 Wed, 14 Dec 2016 20:53:46 GMT (envelope-from rene@FreeBSD.org)
Received: (from rene@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEKrk31010981;
 Wed, 14 Dec 2016 20:53:46 GMT (envelope-from rene@FreeBSD.org)
Message-Id: <201612142053.uBEKrk31010981@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rene set sender to
 rene@FreeBSD.org using -f
From: Rene Ladan <rene@FreeBSD.org>
Date: Wed, 14 Dec 2016 20:53:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310087 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 20:53:48 -0000

Author: rene (doc,ports committer)
Date: Wed Dec 14 20:53:46 2016
New Revision: 310087
URL: https://svnweb.freebsd.org/changeset/base/310087

Log:
  Add adamw, feld and rene to the portmgr organization

Modified:
  head/share/misc/organization.dot

Modified: head/share/misc/organization.dot
==============================================================================
--- head/share/misc/organization.dot	Wed Dec 14 19:28:19 2016	(r310086)
+++ head/share/misc/organization.dot	Wed Dec 14 20:53:46 2016	(r310087)
@@ -30,7 +30,7 @@ coresecretary [label="Core Team Secretar
 doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"]
 doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"]
 portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"]
-portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bdrewery,\nmat, swills"]
+portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nadamw, antoine, bdrewery, feld\nmat, rene, swills"]
 portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"]
 re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"]
 secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, gavin, gjb,\nglebius, remko"]

From owner-svn-src-all@freebsd.org  Wed Dec 14 21:11:43 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FDAEC77E7B;
 Wed, 14 Dec 2016 21:11:43 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 305DCBFB;
 Wed, 14 Dec 2016 21:11:43 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBELBgPx019151;
 Wed, 14 Dec 2016 21:11:42 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBELBga8019149;
 Wed, 14 Dec 2016 21:11:42 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201612142111.uBELBga8019149@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis <brooks@FreeBSD.org>
Date: Wed, 14 Dec 2016 21:11:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310088 - head/bin/df
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 21:11:43 -0000

Author: brooks
Date: Wed Dec 14 21:11:42 2016
New Revision: 310088
URL: https://svnweb.freebsd.org/changeset/base/310088

Log:
  Put the undocumented df feature of mounting filesystems from device nodes
  under an ifdef.  Leave enabled.
  
  Reviewed by:	cem
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D8513

Modified:
  head/bin/df/Makefile
  head/bin/df/df.c

Modified: head/bin/df/Makefile
==============================================================================
--- head/bin/df/Makefile	Wed Dec 14 20:53:46 2016	(r310087)
+++ head/bin/df/Makefile	Wed Dec 14 21:11:42 2016	(r310088)
@@ -9,6 +9,7 @@ PROG=	df
 SRCS=	df.c vfslist.c
 
 CFLAGS+= -I${MOUNT}
+CFLAGS+= -DMOUNT_CHAR_DEVS
 
 LIBADD=	xo util
 

Modified: head/bin/df/df.c
==============================================================================
--- head/bin/df/df.c	Wed Dec 14 20:53:46 2016	(r310087)
+++ head/bin/df/df.c	Wed Dec 14 21:11:42 2016	(r310088)
@@ -50,7 +50,9 @@ __FBSDID("$FreeBSD$");
 #include <sys/stat.h>
 #include <sys/mount.h>
 #include <sys/sysctl.h>
+#ifdef MOUNT_CHAR_DEVS
 #include <ufs/ufs/ufsmount.h>
+#endif
 #include <err.h>
 #include <libutil.h>
 #include <locale.h>
@@ -98,7 +100,9 @@ imax(int a, int b)
 
 static int	aflag = 0, cflag, hflag, iflag, kflag, lflag = 0, nflag, Tflag;
 static int	thousands;
+#ifdef MOUNT_CHAR_DEVS
 static struct	ufs_args mdev;
+#endif
 
 int
 main(int argc, char *argv[])
@@ -108,7 +112,10 @@ main(int argc, char *argv[])
 	struct maxwidths maxwidths;
 	struct statfs *mntbuf;
 	const char *fstype;
-	char *mntpath, *mntpt;
+#ifdef MOUNT_CHAR_DEVS
+	char *mntpath;
+#endif
+	char *mntpt;
 	const char **vfslist;
 	int i, mntsize;
 	int ch, rv;
@@ -227,6 +234,7 @@ main(int argc, char *argv[])
 				rv = 1;
 				continue;
 			}
+#ifdef MOUNT_CHAR_DEVS
 		} else if (S_ISCHR(stbuf.st_mode)) {
 			if ((mntpt = getmntpt(*argv)) == NULL) {
 				mdev.fspec = *argv;
@@ -264,6 +272,7 @@ main(int argc, char *argv[])
 				free(mntpath);
 				continue;
 			}
+#endif
 		} else
 			mntpt = *argv;
 

From owner-svn-src-all@freebsd.org  Wed Dec 14 21:12:44 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 591C4C77F37;
 Wed, 14 Dec 2016 21:12: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 28E8FF42;
 Wed, 14 Dec 2016 21:12: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 uBELCh56019236;
 Wed, 14 Dec 2016 21:12:43 GMT (envelope-from avos@FreeBSD.org)
Received: (from avos@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBELChTK019235;
 Wed, 14 Dec 2016 21:12:43 GMT (envelope-from avos@FreeBSD.org)
Message-Id: <201612142112.uBELChTK019235@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avos set sender to
 avos@FreeBSD.org using -f
From: Andriy Voskoboinyk <avos@FreeBSD.org>
Date: Wed, 14 Dec 2016 21:12:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310089 - head/sbin/ifconfig
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 21:12:44 -0000

Author: avos
Date: Wed Dec 14 21:12:43 2016
New Revision: 310089
URL: https://svnweb.freebsd.org/changeset/base/310089

Log:
  ifconfig: do not truncate SSID in verbose mode.
  
  Fix 32-character SSID abbreviation for 'ifconfig -v wlan0 scan' command.
  
  PR:		215301
  Submitted by:	<ms-freebsd-bugzilla@stoffnet.at>
  MFC after:	4 days

Modified:
  head/sbin/ifconfig/ifieee80211.c

Modified: head/sbin/ifconfig/ifieee80211.c
==============================================================================
--- head/sbin/ifconfig/ifieee80211.c	Wed Dec 14 21:11:42 2016	(r310088)
+++ head/sbin/ifconfig/ifieee80211.c	Wed Dec 14 21:12:43 2016	(r310089)
@@ -3305,7 +3305,7 @@ list_scan(int s)
 
 	getchaninfo(s);
 
-	ssidmax = verbose ? IEEE80211_NWID_LEN - 1 : 14;
+	ssidmax = verbose ? IEEE80211_NWID_LEN : 14;
 	printf("%-*.*s  %-17.17s  %4s %4s   %-7s  %3s %4s\n"
 		, ssidmax, ssidmax, "SSID/MESH ID"
 		, "BSSID"

From owner-svn-src-all@freebsd.org  Wed Dec 14 21:13:12 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15144C77FB3;
 Wed, 14 Dec 2016 21:13:12 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D8FE810E0;
 Wed, 14 Dec 2016 21:13:11 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBELDBs6019311;
 Wed, 14 Dec 2016 21:13:11 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBELDBj0019310;
 Wed, 14 Dec 2016 21:13:11 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201612142113.uBELDBj0019310@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis <brooks@FreeBSD.org>
Date: Wed, 14 Dec 2016 21:13:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310090 - head/bin/df
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 21:13:12 -0000

Author: brooks
Date: Wed Dec 14 21:13:10 2016
New Revision: 310090
URL: https://svnweb.freebsd.org/changeset/base/310090

Log:
  Mount filesystems without executable permissions since they should never
  be used.
  
  Reviewed by:	cem
  MFC after:	1 week
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D8513

Modified:
  head/bin/df/df.c

Modified: head/bin/df/df.c
==============================================================================
--- head/bin/df/df.c	Wed Dec 14 21:12:43 2016	(r310089)
+++ head/bin/df/df.c	Wed Dec 14 21:13:10 2016	(r310090)
@@ -251,7 +251,7 @@ main(int argc, char *argv[])
 					free(mntpath);
 					continue;
 				}
-				if (mount(fstype, mntpt, MNT_RDONLY,
+				if (mount(fstype, mntpt, MNT_RDONLY|MNT_NOEXEC,
 				    &mdev) != 0) {
 					xo_warn("%s", *argv);
 					rv = 1;

From owner-svn-src-all@freebsd.org  Wed Dec 14 21:14:44 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F250C80038;
 Wed, 14 Dec 2016 21:14:44 +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 3EA6B12D5;
 Wed, 14 Dec 2016 21:14:44 +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 uBELEhM6019413;
 Wed, 14 Dec 2016 21:14:43 GMT (envelope-from pfg@FreeBSD.org)
Received: (from pfg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBELEhZ1019412;
 Wed, 14 Dec 2016 21:14:43 GMT (envelope-from pfg@FreeBSD.org)
Message-Id: <201612142114.uBELEhZ1019412@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org
 using -f
From: "Pedro F. Giffuni" <pfg@FreeBSD.org>
Date: Wed, 14 Dec 2016 21:14:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310091 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 21:14:44 -0000

Author: pfg
Date: Wed Dec 14 21:14:43 2016
New Revision: 310091
URL: https://svnweb.freebsd.org/changeset/base/310091

Log:
  ed(1): drop redundant parenthesis.
  
  These were Left-over from the cleanup in r309936.

Modified:
  head/bin/ed/buf.c

Modified: head/bin/ed/buf.c
==============================================================================
--- head/bin/ed/buf.c	Wed Dec 14 21:13:10 2016	(r310090)
+++ head/bin/ed/buf.c	Wed Dec 14 21:14:43 2016	(r310091)
@@ -64,7 +64,7 @@ get_sbuf_line(line_t *lp)
 	}
 	len = lp->len;
 	REALLOC(sfbuf, sfbufsz, len + 1, NULL);
-	if ((fread(sfbuf, sizeof(char), len, sfp)) != len) {
+	if (fread(sfbuf, sizeof(char), len, sfp) != len) {
 		fprintf(stderr, "%s\n", strerror(errno));
 		errmsg = "cannot read temp file";
 		return NULL;
@@ -110,7 +110,7 @@ put_sbuf_line(const char *cs)
 		seek_write = 0;
 	}
 	/* assert: SPL1() */
-	if ((fwrite(cs, sizeof(char), len, sfp)) != len) {
+	if (fwrite(cs, sizeof(char), len, sfp) != len) {
 		sfseek = -1;
 		fprintf(stderr, "%s\n", strerror(errno));
 		errmsg = "cannot write temp file";

From owner-svn-src-all@freebsd.org  Wed Dec 14 21:26:45 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 145DCC803B9;
 Wed, 14 Dec 2016 21:26:45 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D82B31971;
 Wed, 14 Dec 2016 21:26:44 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBELQiaQ023537;
 Wed, 14 Dec 2016 21:26:44 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBELQh2J023535;
 Wed, 14 Dec 2016 21:26:43 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201612142126.uBELQh2J023535@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis <brooks@FreeBSD.org>
Date: Wed, 14 Dec 2016 21:26:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310092 - head/sbin/mount
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 21:26:45 -0000

Author: brooks
Date: Wed Dec 14 21:26:43 2016
New Revision: 310092
URL: https://svnweb.freebsd.org/changeset/base/310092

Log:
  Add a free_iovec() function to reset iovec's.
  
  The primary purpose is to call nmount() in a loop with new iovec's so
  free_iovec takes arguments by reference and resets their values.
  
  Reviewed by:	cem
  MFC after:	1 week
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D8513

Modified:
  head/sbin/mount/getmntopts.c
  head/sbin/mount/mntopts.h

Modified: head/sbin/mount/getmntopts.c
==============================================================================
--- head/sbin/mount/getmntopts.c	Wed Dec 14 21:14:43 2016	(r310091)
+++ head/sbin/mount/getmntopts.c	Wed Dec 14 21:26:43 2016	(r310092)
@@ -181,3 +181,17 @@ build_iovec_argf(struct iovec **iov, int
 	va_end(ap);
 	build_iovec(iov, iovlen, name, strdup(val), (size_t)-1);
 }
+
+/*
+ * Free the iovec and reset to NULL with zero length.  Useful for calling
+ * nmount in a loop.
+ */
+void
+free_iovec(struct iovec **iov, int *iovlen)
+{
+	int i;
+
+	for (i = 0; i < *iovlen; i++)
+		free((*iov)[i].iov_base);
+	free(*iov);
+}

Modified: head/sbin/mount/mntopts.h
==============================================================================
--- head/sbin/mount/mntopts.h	Wed Dec 14 21:14:43 2016	(r310091)
+++ head/sbin/mount/mntopts.h	Wed Dec 14 21:26:43 2016	(r310092)
@@ -99,3 +99,4 @@ int checkpath(const char *, char resolve
 extern int getmnt_silent;
 void build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, size_t len);
 void build_iovec_argf(struct iovec **iov, int *iovlen, const char *name, const char *fmt, ...);
+void free_iovec(struct iovec **iovec, int *iovlen);

From owner-svn-src-all@freebsd.org  Wed Dec 14 21:29:13 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87949C804B0;
 Wed, 14 Dec 2016 21:29:13 +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 56C8A1B2C;
 Wed, 14 Dec 2016 21:29:13 +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 uBELTCLj023668;
 Wed, 14 Dec 2016 21:29:12 GMT (envelope-from kp@FreeBSD.org)
Received: (from kp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBELTCJW023667;
 Wed, 14 Dec 2016 21:29:12 GMT (envelope-from kp@FreeBSD.org)
Message-Id: <201612142129.uBELTCJW023667@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org
 using -f
From: Kristof Provost <kp@FreeBSD.org>
Date: Wed, 14 Dec 2016 21:29:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310093 - stable/11/sys/netpfil/pf
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 21:29:13 -0000

Author: kp
Date: Wed Dec 14 21:29:12 2016
New Revision: 310093
URL: https://svnweb.freebsd.org/changeset/base/310093

Log:
  MFC r309563: pflog: Correctly initialise subrulenr
  
  subrulenr is considered unset if it's set to -1, not if it's set to 1.
  See contrib/tcpdump/print-pflog.c pflog_print() for a user.
  
  This caused incorrect pflog output (tcpdump -n -e -ttt -i pflog0):
    rule 0..16777216(match)
  instead of the correct output of
    rule 0/0(match)
  
  PR:		214832
  Submitted by:	andywhite@gmail.com

Modified:
  stable/11/sys/netpfil/pf/if_pflog.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netpfil/pf/if_pflog.c
==============================================================================
--- stable/11/sys/netpfil/pf/if_pflog.c	Wed Dec 14 21:26:43 2016	(r310092)
+++ stable/11/sys/netpfil/pf/if_pflog.c	Wed Dec 14 21:29:12 2016	(r310093)
@@ -221,7 +221,7 @@ pflog_packet(struct pfi_kif *kif, struct
 
 	if (am == NULL) {
 		hdr.rulenr = htonl(rm->nr);
-		hdr.subrulenr =  1;
+		hdr.subrulenr = -1;
 	} else {
 		hdr.rulenr = htonl(am->nr);
 		hdr.subrulenr = htonl(rm->nr);

From owner-svn-src-all@freebsd.org  Wed Dec 14 21:30:36 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E80CC8055D;
 Wed, 14 Dec 2016 21:30:36 +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 3E00F1D75;
 Wed, 14 Dec 2016 21:30:36 +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 uBELUZ6M023791;
 Wed, 14 Dec 2016 21:30:35 GMT (envelope-from kp@FreeBSD.org)
Received: (from kp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBELUZ4a023790;
 Wed, 14 Dec 2016 21:30:35 GMT (envelope-from kp@FreeBSD.org)
Message-Id: <201612142130.uBELUZ4a023790@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org
 using -f
From: Kristof Provost <kp@FreeBSD.org>
Date: Wed, 14 Dec 2016 21:30:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310094 - stable/10/sys/netpfil/pf
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 21:30:36 -0000

Author: kp
Date: Wed Dec 14 21:30:35 2016
New Revision: 310094
URL: https://svnweb.freebsd.org/changeset/base/310094

Log:
  MFC r309563: pflog: Correctly initialise subrulenr
  
  subrulenr is considered unset if it's set to -1, not if it's set to 1.
  See contrib/tcpdump/print-pflog.c pflog_print() for a user.
  
  This caused incorrect pflog output (tcpdump -n -e -ttt -i pflog0):
    rule 0..16777216(match)
  instead of the correct output of
    rule 0/0(match)
  
  PR:		214832
  Submitted by:	andywhite@gmail.com

Modified:
  stable/10/sys/netpfil/pf/if_pflog.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netpfil/pf/if_pflog.c
==============================================================================
--- stable/10/sys/netpfil/pf/if_pflog.c	Wed Dec 14 21:29:12 2016	(r310093)
+++ stable/10/sys/netpfil/pf/if_pflog.c	Wed Dec 14 21:30:35 2016	(r310094)
@@ -217,7 +217,7 @@ pflog_packet(struct pfi_kif *kif, struct
 
 	if (am == NULL) {
 		hdr.rulenr = htonl(rm->nr);
-		hdr.subrulenr =  1;
+		hdr.subrulenr = -1;
 	} else {
 		hdr.rulenr = htonl(am->nr);
 		hdr.subrulenr = htonl(rm->nr);

From owner-svn-src-all@freebsd.org  Wed Dec 14 21:30:45 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E66CDC805B0;
 Wed, 14 Dec 2016 21:30:45 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9C2591E18;
 Wed, 14 Dec 2016 21:30:45 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBELUioa023856;
 Wed, 14 Dec 2016 21:30:44 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBELUimH023854;
 Wed, 14 Dec 2016 21:30:44 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201612142130.uBELUimH023854@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis <brooks@FreeBSD.org>
Date: Wed, 14 Dec 2016 21:30:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310095 - head/bin/df
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 21:30:46 -0000

Author: brooks
Date: Wed Dec 14 21:30:44 2016
New Revision: 310095
URL: https://svnweb.freebsd.org/changeset/base/310095

Log:
  Use nmount(2) rather than the obsolete mount(2).
  
  Reviewed by:	cem
  MFC after:	1 week
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D8513

Modified:
  head/bin/df/Makefile
  head/bin/df/df.c

Modified: head/bin/df/Makefile
==============================================================================
--- head/bin/df/Makefile	Wed Dec 14 21:30:35 2016	(r310094)
+++ head/bin/df/Makefile	Wed Dec 14 21:30:44 2016	(r310095)
@@ -9,7 +9,9 @@ PROG=	df
 SRCS=	df.c vfslist.c
 
 CFLAGS+= -I${MOUNT}
+
 CFLAGS+= -DMOUNT_CHAR_DEVS
+SRCS+=	getmntopts.c
 
 LIBADD=	xo util
 

Modified: head/bin/df/df.c
==============================================================================
--- head/bin/df/df.c	Wed Dec 14 21:30:35 2016	(r310094)
+++ head/bin/df/df.c	Wed Dec 14 21:30:44 2016	(r310095)
@@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$");
 #include <err.h>
 #include <libutil.h>
 #include <locale.h>
+#ifdef MOUNT_CHAR_DEVS
+#include <mntopts.h>
+#endif
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -111,14 +114,21 @@ main(int argc, char *argv[])
 	struct statfs statfsbuf, totalbuf;
 	struct maxwidths maxwidths;
 	struct statfs *mntbuf;
+#ifdef MOUNT_CHAR_DEVS
+	struct iovec *iov = NULL;
+#endif
 	const char *fstype;
 #ifdef MOUNT_CHAR_DEVS
 	char *mntpath;
+	char errmsg[255] = {0};
 #endif
 	char *mntpt;
 	const char **vfslist;
 	int i, mntsize;
 	int ch, rv;
+#ifdef MOUNT_CHAR_DEVS
+	int iovlen = 0;
+#endif
 
 	fstype = "ufs";
 	(void)setlocale(LC_ALL, "");
@@ -251,9 +261,23 @@ main(int argc, char *argv[])
 					free(mntpath);
 					continue;
 				}
-				if (mount(fstype, mntpt, MNT_RDONLY|MNT_NOEXEC,
-				    &mdev) != 0) {
-					xo_warn("%s", *argv);
+				if (iov != NULL)
+					free_iovec(&iov, &iovlen);
+				build_iovec_argf(&iov, &iovlen, "fstype", "%s",
+				    fstype);
+				build_iovec_argf(&iov, &iovlen, "fspath", "%s",
+				    mntpath);
+				build_iovec_argf(&iov, &iovlen, "from", "%s",
+				    *argv);
+				build_iovec(&iov, &iovlen, "errmsg", errmsg,
+				    sizeof(errmsg));
+				if (nmount(iov, iovlen,
+				    MNT_RDONLY|MNT_NOEXEC) < 0) {
+					if (errmsg[0])
+						xo_warn("%s: %s", *argv,
+						    errmsg);
+					else
+						xo_warn("%s", *argv);
 					rv = 1;
 					(void)rmdir(mntpt);
 					free(mntpath);

From owner-svn-src-all@freebsd.org  Wed Dec 14 22:49:21 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F66EC77008;
 Wed, 14 Dec 2016 22:49:21 +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 2A2F17E7;
 Wed, 14 Dec 2016 22:49:21 +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 uBEMnKvd057012;
 Wed, 14 Dec 2016 22:49:20 GMT (envelope-from jilles@FreeBSD.org)
Received: (from jilles@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBEMnK6O057010;
 Wed, 14 Dec 2016 22:49:20 GMT (envelope-from jilles@FreeBSD.org)
Message-Id: <201612142249.uBEMnK6O057010@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jilles set sender to
 jilles@FreeBSD.org using -f
From: Jilles Tjoelker <jilles@FreeBSD.org>
Date: Wed, 14 Dec 2016 22:49:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310096 - in head: sys/kern 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 22:49:21 -0000

Author: jilles
Date: Wed Dec 14 22:49:20 2016
New Revision: 310096
URL: https://svnweb.freebsd.org/changeset/base/310096

Log:
  reaper: Make REAPER_KILL_SUBTREE actually work.
  
  MFC after:	2 weeks

Modified:
  head/sys/kern/kern_procctl.c
  head/tests/sys/kern/reaper.c

Modified: head/sys/kern/kern_procctl.c
==============================================================================
--- head/sys/kern/kern_procctl.c	Wed Dec 14 21:30:44 2016	(r310095)
+++ head/sys/kern/kern_procctl.c	Wed Dec 14 22:49:20 2016	(r310096)
@@ -243,7 +243,7 @@ reap_kill(struct thread *td, struct proc
 		return (ECAPMODE);
 	if (rk->rk_sig <= 0 || rk->rk_sig > _SIG_MAXSIG)
 		return (EINVAL);
-	if ((rk->rk_flags & ~REAPER_KILL_CHILDREN) != 0)
+	if ((rk->rk_flags & ~(REAPER_KILL_CHILDREN | REAPER_KILL_SUBTREE)) != 0)
 		return (EINVAL);
 	PROC_UNLOCK(p);
 	reap = (p->p_treeflag & P_TREE_REAPER) == 0 ? p->p_reaper : p;

Modified: head/tests/sys/kern/reaper.c
==============================================================================
--- head/tests/sys/kern/reaper.c	Wed Dec 14 21:30:44 2016	(r310095)
+++ head/tests/sys/kern/reaper.c	Wed Dec 14 22:49:20 2016	(r310096)
@@ -639,6 +639,107 @@ ATF_TC_BODY(reaper_kill_normal, tc)
 	ATF_REQUIRE_EQ(0, r);
 }
 
+ATF_TC_WITHOUT_HEAD(reaper_kill_subtree);
+ATF_TC_BODY(reaper_kill_subtree, tc)
+{
+	struct procctl_reaper_kill params;
+	ssize_t sr;
+	pid_t parent, child1, child2, grandchild1, grandchild2, pid;
+	int r, status;
+	int pip[2];
+
+	parent = getpid();
+	r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL);
+	ATF_REQUIRE_EQ(0, r);
+
+	r = pipe(pip);
+	ATF_REQUIRE_EQ(0, r);
+	child1 = fork();
+	ATF_REQUIRE(child1 != -1);
+	if (child1 == 0) {
+		if (close(pip[0]) != 0)
+			_exit(100);
+		grandchild1 = fork();
+		if (grandchild1 == -1)
+			_exit(101);
+		if (grandchild1 == 0) {
+			if (write(pip[1], &(uint8_t){ 0 }, 1) != 1)
+				_exit(102);
+			for (;;)
+				pause();
+		}
+		for (;;)
+			pause();
+	}
+	child2 = fork();
+	ATF_REQUIRE(child2 != -1);
+	if (child2 == 0) {
+		if (close(pip[0]) != 0)
+			_exit(100);
+		grandchild2 = fork();
+		if (grandchild2 == -1)
+			_exit(101);
+		if (grandchild2 == 0) {
+			if (write(pip[1], &(uint8_t){ 0 }, 1) != 1)
+				_exit(102);
+			for (;;)
+				pause();
+		}
+		for (;;)
+			pause();
+	}
+	r = close(pip[1]);
+	ATF_REQUIRE_EQ(0, r);
+
+	sr = read(pip[0], &(uint8_t){ 0 }, 1);
+	ATF_REQUIRE_EQ(1, sr);
+	sr = read(pip[0], &(uint8_t){ 0 }, 1);
+	ATF_REQUIRE_EQ(1, sr);
+
+	params.rk_sig = SIGUSR1;
+	params.rk_flags = REAPER_KILL_SUBTREE;
+	params.rk_subtree = child1;
+	params.rk_killed = 77;
+	r = procctl(P_PID, parent, PROC_REAP_KILL, &params);
+	ATF_REQUIRE_EQ(0, r);
+	ATF_REQUIRE_EQ(2, params.rk_killed);
+	ATF_CHECK_EQ(-1, params.rk_fpid);
+
+	pid = waitpid(child1, &status, 0);
+	ATF_REQUIRE_EQ(child1, pid);
+	ATF_CHECK(WIFSIGNALED(status) && WTERMSIG(status) == SIGUSR1);
+
+	pid = waitpid(-1, &status, 0);
+	ATF_REQUIRE(pid > 0);
+	ATF_CHECK(pid != parent);
+	ATF_CHECK(pid != child1);
+	ATF_CHECK(pid != child2);
+	ATF_CHECK(WIFSIGNALED(status) && WTERMSIG(status) == SIGUSR1);
+
+	params.rk_sig = SIGUSR2;
+	params.rk_flags = REAPER_KILL_SUBTREE;
+	params.rk_subtree = child2;
+	params.rk_killed = 77;
+	r = procctl(P_PID, parent, PROC_REAP_KILL, &params);
+	ATF_REQUIRE_EQ(0, r);
+	ATF_REQUIRE_EQ(2, params.rk_killed);
+	ATF_CHECK_EQ(-1, params.rk_fpid);
+
+	pid = waitpid(child2, &status, 0);
+	ATF_REQUIRE_EQ(child2, pid);
+	ATF_CHECK(WIFSIGNALED(status) && WTERMSIG(status) == SIGUSR2);
+
+	pid = waitpid(-1, &status, 0);
+	ATF_REQUIRE(pid > 0);
+	ATF_CHECK(pid != parent);
+	ATF_CHECK(pid != child1);
+	ATF_CHECK(pid != child2);
+	ATF_CHECK(WIFSIGNALED(status) && WTERMSIG(status) == SIGUSR2);
+
+	r = close(pip[0]);
+	ATF_REQUIRE_EQ(0, r);
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
@@ -652,5 +753,6 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC(tp, reaper_kill_sigzero);
 	ATF_TP_ADD_TC(tp, reaper_kill_empty);
 	ATF_TP_ADD_TC(tp, reaper_kill_normal);
+	ATF_TP_ADD_TC(tp, reaper_kill_subtree);
 	return (atf_no_error());
 }

From owner-svn-src-all@freebsd.org  Wed Dec 14 23:34:27 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CFA5C80007;
 Wed, 14 Dec 2016 23:34: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 020E1310;
 Wed, 14 Dec 2016 23:34: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 uBENYQpW076786;
 Wed, 14 Dec 2016 23:34:26 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBENYQm1076785;
 Wed, 14 Dec 2016 23:34:26 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612142334.uBENYQm1076785@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Wed, 14 Dec 2016 23:34:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310097 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 23:34:27 -0000

Author: kib
Date: Wed Dec 14 23:34:25 2016
New Revision: 310097
URL: https://svnweb.freebsd.org/changeset/base/310097

Log:
  Remove locking around accounting initialization of the default object.
  
  The object is not yet fully constructed and must not be available to
  other threads.  This makes default_pager_alloc() almost identical to
  swap_pager_alloc_init().
  
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/vm/default_pager.c

Modified: head/sys/vm/default_pager.c
==============================================================================
--- head/sys/vm/default_pager.c	Wed Dec 14 22:49:20 2016	(r310096)
+++ head/sys/vm/default_pager.c	Wed Dec 14 23:34:25 2016	(r310097)
@@ -85,10 +85,8 @@ default_pager_alloc(void *handle, vm_oof
 	object = vm_object_allocate(OBJT_DEFAULT,
 	    OFF_TO_IDX(round_page(offset + size)));
 	if (cred != NULL) {
-		VM_OBJECT_WLOCK(object);
 		object->cred = cred;
 		object->charge = size;
-		VM_OBJECT_WUNLOCK(object);
 	}
 	return (object);
 }

From owner-svn-src-all@freebsd.org  Wed Dec 14 23:36:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6D0AC800C1;
 Wed, 14 Dec 2016 23:36:33 +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 B69C56D6;
 Wed, 14 Dec 2016 23:36:33 +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 uBENaWo8076904;
 Wed, 14 Dec 2016 23:36:32 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBENaWX7076903;
 Wed, 14 Dec 2016 23:36:32 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612142336.uBENaWX7076903@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Wed, 14 Dec 2016 23:36:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310098 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 23:36:34 -0000

Author: kib
Date: Wed Dec 14 23:36:32 2016
New Revision: 310098
URL: https://svnweb.freebsd.org/changeset/base/310098

Log:
  Provide introductory description of the default pager.
  
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/vm/default_pager.c

Modified: head/sys/vm/default_pager.c
==============================================================================
--- head/sys/vm/default_pager.c	Wed Dec 14 23:34:25 2016	(r310097)
+++ head/sys/vm/default_pager.c	Wed Dec 14 23:36:32 2016	(r310098)
@@ -57,6 +57,16 @@ static boolean_t	default_pager_haspage(v
 
 /*
  * pagerops for OBJT_DEFAULT - "default pager".
+ *
+ * This pager handles anonymous (no handle) swap-backed memory, just
+ * like the swap pager.  It allows several optimizations based on the
+ * fact that no pages of a default object can be swapped out.  The
+ * most important optimization is in vm_fault(), where the pager is
+ * never asked for a non-resident page.  Instead, a freshly allocated
+ * zeroed page is used.
+ *
+ * On the first request to page out a page from a default object, the
+ * object is converted to swap pager type.
  */
 struct pagerops defaultpagerops = {
 	.pgo_alloc =	default_pager_alloc,

From owner-svn-src-all@freebsd.org  Thu Dec 15 01:45:32 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4C88C768D3;
 Thu, 15 Dec 2016 01:45:32 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B3FD116F8;
 Thu, 15 Dec 2016 01:45:32 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBF1jVmB030899;
 Thu, 15 Dec 2016 01:45:31 GMT (envelope-from vangyzen@FreeBSD.org)
Received: (from vangyzen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBF1jV7S030898;
 Thu, 15 Dec 2016 01:45:31 GMT (envelope-from vangyzen@FreeBSD.org)
Message-Id: <201612150145.uBF1jV7S030898@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
 vangyzen@FreeBSD.org using -f
From: Eric van Gyzen <vangyzen@FreeBSD.org>
Date: Thu, 15 Dec 2016 01:45:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310099 - stable/10/sys/kern
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 01:45:33 -0000

Author: vangyzen
Date: Thu Dec 15 01:45:31 2016
New Revision: 310099
URL: https://svnweb.freebsd.org/changeset/base/310099

Log:
  MFC r309460
  
  thr_set_name(): silently truncate the given name as needed
  
  Instead of failing with ENAMETOOLONG, which is swallowed by
  pthread_set_name_np() anyway, truncate the given name to MAXCOMLEN+1
  bytes.  This is more likely what the user wants, and saves the
  caller from truncating it before the call (which was the only
  recourse).
  
  The man page changes were not merged because thr_set_name.2
  does not exist on stable/10.
  
  Sponsored by:	Dell EMC

Modified:
  stable/10/sys/kern/kern_thr.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_thr.c
==============================================================================
--- stable/10/sys/kern/kern_thr.c	Wed Dec 14 23:36:32 2016	(r310098)
+++ stable/10/sys/kern/kern_thr.c	Thu Dec 15 01:45:31 2016	(r310099)
@@ -569,8 +569,11 @@ sys_thr_set_name(struct thread *td, stru
 	error = 0;
 	name[0] = '\0';
 	if (uap->name != NULL) {
-		error = copyinstr(uap->name, name, sizeof(name),
-			NULL);
+		error = copyinstr(uap->name, name, sizeof(name), NULL);
+		if (error == ENAMETOOLONG) {
+			error = copyin(uap->name, name, sizeof(name) - 1);
+			name[sizeof(name) - 1] = '\0';
+		}
 		if (error)
 			return (error);
 	}

From owner-svn-src-all@freebsd.org  Thu Dec 15 02:05:30 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9D26C800F8;
 Thu, 15 Dec 2016 02:05:30 +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 9A5A21CE;
 Thu, 15 Dec 2016 02:05:30 +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 uBF25T6T039367;
 Thu, 15 Dec 2016 02:05:29 GMT (envelope-from np@FreeBSD.org)
Received: (from np@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBF25T3O039363;
 Thu, 15 Dec 2016 02:05:29 GMT (envelope-from np@FreeBSD.org)
Message-Id: <201612150205.uBF25T3O039363@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org
 using -f
From: Navdeep Parhar <np@FreeBSD.org>
Date: Thu, 15 Dec 2016 02:05:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310100 - in head/sys/dev/cxgbe: . common
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 02:05:31 -0000

Author: np
Date: Thu Dec 15 02:05:29 2016
New Revision: 310100
URL: https://svnweb.freebsd.org/changeset/base/310100

Log:
  cxgbe(4): Deal with compressed error vectors.
  
  MFC after:	3 days
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/common/common.h
  head/sys/dev/cxgbe/common/t4_hw.c
  head/sys/dev/cxgbe/common/t4_msg.h
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/common/common.h
==============================================================================
--- head/sys/dev/cxgbe/common/common.h	Thu Dec 15 01:45:31 2016	(r310099)
+++ head/sys/dev/cxgbe/common/common.h	Thu Dec 15 02:05:29 2016	(r310100)
@@ -227,7 +227,7 @@ struct tp_params {
 
 	uint32_t vlan_pri_map;
 	uint32_t ingress_config;
-	uint32_t rx_pkt_encap;
+	__be16 err_vec_mask;
 
 	int8_t fcoe_shift;
 	int8_t port_shift;

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==============================================================================
--- head/sys/dev/cxgbe/common/t4_hw.c	Thu Dec 15 01:45:31 2016	(r310099)
+++ head/sys/dev/cxgbe/common/t4_hw.c	Thu Dec 15 02:05:29 2016	(r310100)
@@ -8020,12 +8020,17 @@ int t4_init_tp_params(struct adapter *ad
 	read_filter_mode_and_ingress_config(adap);
 
 	/*
-	 * For T6, cache the adapter's compressed error vector
-	 * and passing outer header info for encapsulated packets.
+	 * Cache a mask of the bits that represent the error vector portion of
+	 * rx_pkt.err_vec.  T6+ can use a compressed error vector to make room
+	 * for information about outer encapsulation (GENEVE/VXLAN/NVGRE).
 	 */
+	tpp->err_vec_mask = htobe16(0xffff);
 	if (chip_id(adap) > CHELSIO_T5) {
 		v = t4_read_reg(adap, A_TP_OUT_CONFIG);
-		tpp->rx_pkt_encap = (v & F_CRXPKTENC) ? 1 : 0;
+		if (v & F_CRXPKTENC) {
+			tpp->err_vec_mask =
+			    htobe16(V_T6_COMPR_RXERR_VEC(M_T6_COMPR_RXERR_VEC));
+		}
 	}
 
 	return 0;

Modified: head/sys/dev/cxgbe/common/t4_msg.h
==============================================================================
--- head/sys/dev/cxgbe/common/t4_msg.h	Thu Dec 15 01:45:31 2016	(r310099)
+++ head/sys/dev/cxgbe/common/t4_msg.h	Thu Dec 15 02:05:29 2016	(r310100)
@@ -2014,7 +2014,7 @@ struct cpl_rx_pkt {
 
 #define S_T6_COMPR_RXERR_VEC    0
 #define M_T6_COMPR_RXERR_VEC    0x3F
-#define V_T6_COMPR_RXERR_VEC(x) ((x) << S_T6_COMPR_RXERR_LEN)
+#define V_T6_COMPR_RXERR_VEC(x) ((x) << S_T6_COMPR_RXERR_VEC)
 #define G_T6_COMPR_RXERR_VEC(x) \
 		(((x) >> S_T6_COMPR_RXERR_VEC) & M_T6_COMPR_RXERR_VEC)
 

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c	Thu Dec 15 01:45:31 2016	(r310099)
+++ head/sys/dev/cxgbe/t4_sge.c	Thu Dec 15 02:05:29 2016	(r310100)
@@ -1808,7 +1808,7 @@ t4_eth_rx(struct sge_iq *iq, const struc
 	M_HASHTYPE_SET(m0, sw_hashtype[rss->hash_type][rss->ipv6]);
 	m0->m_pkthdr.flowid = be32toh(rss->hash_val);
 
-	if (cpl->csum_calc && !cpl->err_vec) {
+	if (cpl->csum_calc && !(cpl->err_vec & sc->params.tp.err_vec_mask)) {
 		if (ifp->if_capenable & IFCAP_RXCSUM &&
 		    cpl->l2info & htobe32(F_RXF_IP)) {
 			m0->m_pkthdr.csum_flags = (CSUM_IP_CHECKED |

From owner-svn-src-all@freebsd.org  Thu Dec 15 03:32:25 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6EE5C80381;
 Thu, 15 Dec 2016 03:32:25 +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 8AC971503;
 Thu, 15 Dec 2016 03:32:25 +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 uBF3WOV6075797;
 Thu, 15 Dec 2016 03:32:24 GMT (envelope-from sephe@FreeBSD.org)
Received: (from sephe@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBF3WOdS075152;
 Thu, 15 Dec 2016 03:32:24 GMT (envelope-from sephe@FreeBSD.org)
Message-Id: <201612150332.uBF3WOdS075152@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: sephe set sender to
 sephe@FreeBSD.org using -f
From: Sepherosa Ziehau <sephe@FreeBSD.org>
Date: Thu, 15 Dec 2016 03:32:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310101 - in head: include sys/dev/hyperv/include
 sys/dev/hyperv/vmbus sys/dev/hyperv/vmbus/amd64
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 03:32:25 -0000

Author: sephe
Date: Thu Dec 15 03:32:24 2016
New Revision: 310101
URL: https://svnweb.freebsd.org/changeset/base/310101

Log:
  hyperv: Allow userland to ro-mmap reference TSC page
  
  This paves way to implement VDSO for the enlightened time counter.
  
  Reviewed by:	kib
  MFC after:	1 week
  Sponsored by:	Microsoft
  Differential Revision:	https://reviews.freebsd.org/D8768

Modified:
  head/include/Makefile
  head/sys/dev/hyperv/include/hyperv.h
  head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c
  head/sys/dev/hyperv/vmbus/hyperv_reg.h

Modified: head/include/Makefile
==============================================================================
--- head/include/Makefile	Thu Dec 15 02:05:29 2016	(r310100)
+++ head/include/Makefile	Thu Dec 15 03:32:24 2016	(r310101)
@@ -185,6 +185,9 @@ copies: .PHONY .META
 	    ${DESTDIR}${INCLUDEDIR}/dev/evdev; \
 	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 uinput.h \
 	    ${DESTDIR}${INCLUDEDIR}/dev/evdev
+	cd ${.CURDIR}/../sys/dev/hyperv/include; \
+	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 hyperv.h \
+	    ${DESTDIR}${INCLUDEDIR}/dev/hyperv
 	cd ${.CURDIR}/../sys/dev/hyperv/utilities; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 hv_snapshot.h \
 	    ${DESTDIR}${INCLUDEDIR}/dev/hyperv
@@ -293,6 +296,11 @@ symlinks: .PHONY .META
 		ln -fs ../../../../sys/dev/evdev/$$h \
 		    ${DESTDIR}${INCLUDEDIR}/dev/evdev; \
 	done
+	cd ${.CURDIR}/../sys/dev/hyperv/include; \
+	for h in hyperv.h; do \
+		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/hyperv/include/$$h \
+		    ${DESTDIR}${INCLUDEDIR}/dev/hyperv; \
+	done
 	cd ${.CURDIR}/../sys/dev/hyperv/utilities; \
 	for h in hv_snapshot.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/hyperv/utilities/$$h \

Modified: head/sys/dev/hyperv/include/hyperv.h
==============================================================================
--- head/sys/dev/hyperv/include/hyperv.h	Thu Dec 15 02:05:29 2016	(r310100)
+++ head/sys/dev/hyperv/include/hyperv.h	Thu Dec 15 03:32:24 2016	(r310101)
@@ -31,10 +31,10 @@
 #ifndef _HYPERV_H_
 #define _HYPERV_H_
 
-#include <sys/param.h>
+#ifdef _KERNEL
 
-#include <vm/vm.h>
-#include <vm/pmap.h>
+#include <sys/param.h>
+#include <sys/systm.h>
 
 #define MSR_HV_TIME_REF_COUNT		0x40000020
 
@@ -54,14 +54,35 @@
 #define HYPERV_TIMER_NS_FACTOR		100ULL
 #define HYPERV_TIMER_FREQ		(NANOSEC / HYPERV_TIMER_NS_FACTOR)
 
+#endif	/* _KERNEL */
+
+#define HYPERV_REFTSC_DEVNAME		"hv_tsc"
+
+/*
+ * Hyper-V Reference TSC
+ */
+struct hyperv_reftsc {
+	volatile uint32_t		tsc_seq;
+	volatile uint32_t		tsc_rsvd1;
+	volatile uint64_t		tsc_scale;
+	volatile int64_t		tsc_ofs;
+} __packed __aligned(PAGE_SIZE);
+#ifdef CTASSERT
+CTASSERT(sizeof(struct hyperv_reftsc) == PAGE_SIZE);
+#endif
+
+#ifdef _KERNEL
+
 struct hyperv_guid {
-	uint8_t		hv_guid[16];
+	uint8_t				hv_guid[16];
 } __packed;
 
-#define HYPERV_GUID_STRLEN	40
+#define HYPERV_GUID_STRLEN		40
 
 int		hyperv_guid2str(const struct hyperv_guid *, char *, size_t);
 
 extern u_int	hyperv_features;	/* CPUID_HV_MSR_ */
 
+#endif	/* _KERNEL */
+
 #endif  /* _HYPERV_H_ */

Modified: head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c	Thu Dec 15 02:05:29 2016	(r310100)
+++ head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c	Thu Dec 15 03:32:24 2016	(r310101)
@@ -28,6 +28,8 @@
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
+#include <sys/conf.h>
+#include <sys/fcntl.h>
 #include <sys/kernel.h>
 #include <sys/systm.h>
 #include <sys/timetc.h>
@@ -35,6 +37,9 @@ __FBSDID("$FreeBSD$");
 #include <machine/cpufunc.h>
 #include <machine/cputypes.h>
 #include <machine/md_var.h>
+#include <machine/specialreg.h>
+
+#include <vm/vm.h>
 
 #include <dev/hyperv/include/hyperv.h>
 #include <dev/hyperv/include/hyperv_busdma.h>
@@ -47,6 +52,9 @@ struct hyperv_reftsc_ctx {
 	struct hyperv_dma	tsc_ref_dma;
 };
 
+static d_open_t			hyperv_tsc_open;
+static d_mmap_t			hyperv_tsc_mmap;
+
 static struct timecounter	hyperv_tsc_timecounter = {
 	.tc_get_timecount	= NULL,	/* based on CPU vendor. */
 	.tc_poll_pps		= NULL,
@@ -58,6 +66,13 @@ static struct timecounter	hyperv_tsc_tim
 	.tc_priv		= NULL
 };
 
+static struct cdevsw		hyperv_tsc_cdevsw = {
+	.d_version		= D_VERSION,
+	.d_open			= hyperv_tsc_open,
+	.d_mmap			= hyperv_tsc_mmap,
+	.d_name			= HYPERV_REFTSC_DEVNAME
+};
+
 static struct hyperv_reftsc_ctx	hyperv_ref_tsc;
 
 uint64_t
@@ -72,6 +87,36 @@ hypercall_md(volatile void *hc_addr, uin
 	return (status);
 }
 
+static int
+hyperv_tsc_open(struct cdev *dev __unused, int oflags, int devtype __unused,
+    struct thread *td __unused)
+{
+
+	if (oflags & FWRITE)
+		return (EPERM);
+	return (0);
+}
+
+static int
+hyperv_tsc_mmap(struct cdev *dev __unused, vm_ooffset_t offset,
+    vm_paddr_t *paddr, int nprot __unused, vm_memattr_t *memattr __unused)
+{
+
+	KASSERT(hyperv_ref_tsc.tsc_ref != NULL, ("reftsc has not been setup"));
+
+	/*
+	 * NOTE:
+	 * 'nprot' does not contain information interested to us;
+	 * WR-open is blocked by d_open.
+	 */
+
+	if (offset != 0)
+		return (EOPNOTSUPP);
+
+	*paddr = hyperv_ref_tsc.tsc_ref_dma.hv_paddr;
+	return (0);
+}
+
 #define HYPERV_TSC_TIMECOUNT(fence)					\
 static u_int								\
 hyperv_tsc_timecount_##fence(struct timecounter *tc)			\
@@ -150,6 +195,10 @@ hyperv_tsc_tcinit(void *dummy __unused)
 
 	/* Register "enlightened" timecounter. */
 	tc_init(&hyperv_tsc_timecounter);
+
+	/* Add device for mmap(2). */
+	make_dev(&hyperv_tsc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0444,
+	    HYPERV_REFTSC_DEVNAME);
 }
 SYSINIT(hyperv_tsc_init, SI_SUB_DRIVERS, SI_ORDER_FIRST, hyperv_tsc_tcinit,
     NULL);

Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h
==============================================================================
--- head/sys/dev/hyperv/vmbus/hyperv_reg.h	Thu Dec 15 02:05:29 2016	(r310100)
+++ head/sys/dev/hyperv/vmbus/hyperv_reg.h	Thu Dec 15 03:32:24 2016	(r310101)
@@ -129,17 +129,6 @@
 #define CPUID_LEAF_HV_HWFEATURES	0x40000006
 
 /*
- * Hyper-V Reference TSC
- */
-struct hyperv_reftsc {
-	volatile uint32_t	tsc_seq;
-	volatile uint32_t	tsc_rsvd1;
-	volatile uint64_t	tsc_scale;
-	volatile int64_t	tsc_ofs;
-} __packed __aligned(PAGE_SIZE);
-CTASSERT(sizeof(struct hyperv_reftsc) == PAGE_SIZE);
-
-/*
  * Hyper-V Monitor Notification Facility
  */
 struct hyperv_mon_param {

From owner-svn-src-all@freebsd.org  Thu Dec 15 06:07:44 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9C03C8032E;
 Thu, 15 Dec 2016 06:07:44 +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 833601D9F;
 Thu, 15 Dec 2016 06:07:43 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au
 [122.106.153.191])
 by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 82CD9104910A;
 Thu, 15 Dec 2016 16:32:11 +1100 (AEDT)
Date: Thu, 15 Dec 2016 16:32:10 +1100 (EST)
From: Bruce Evans <brde@optusnet.com.au>
X-X-Sender: bde@besplex.bde.org
To: John Baldwin <jhb@freebsd.org>
cc: src-committers@freebsd.org, svn-src-all@freebsd.org, 
 svn-src-head@freebsd.org
Subject: Re: svn commit: r310045 - head/sys/ddb
In-Reply-To: <1943330.5ZCxhTZVMq@ralph.baldwin.cx>
Message-ID: <20161215160138.C1437@besplex.bde.org>
References: <201612140018.uBE0ICrE004686@repo.freebsd.org>
 <2285301.DAKmd1GIbI@ralph.baldwin.cx> <20161214140645.W3397@besplex.bde.org>
 <1943330.5ZCxhTZVMq@ralph.baldwin.cx>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.2 cv=K7JSJ2eI c=1 sm=1 tr=0
 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17
 a=kj9zAlcOel0A:10 a=avmG3HoKv_aMk1NEc9cA:9 a=yonnxYksHrBdyqm4:21
 a=iummpsby-ga9SU4A:21 a=CjuIK1q_8ugA:10
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 06:07:44 -0000

On Wed, 14 Dec 2016, John Baldwin wrote:

> On Wednesday, December 14, 2016 07:24:46 PM Bruce Evans wrote:
>> ...
>> I don't see how initializing to 'val' can help.  It still gets corrupted
>> to unsigned, and I would expect it to make the problem much worse because
>> the truncation gives an even smaller value.  E.g., if val is any multiple
>> of 2**32, truncating it gives 0.  Without the truncation, 'val' is a good
>> upper bound for the offset.
>
> I should have mentioned this change in the commit.  Other symbol resolution
> APIs in the kernel follow the convention that the raw address is returned
> as the offset ('diff') if no matching symbol is found.  This change made
> db_search_symbol() consistent with that.
>
>> Perhaps the problem is more with the initialization of newdiff.  It is
>> initialized to the corrupted value in diff.  I don't know the details of
>> the API, but if X_db_search_symbol() uses this as an input parameter to
>> limit the search, it might be happier with the smaller corrupted value
>> than the larger one.  X_db_search_symbol() seems to have working types
>> and values, though still too much hard-coding of types.
>>
>> Your casts to uintmax_t have no effect.  The types are already unsigned,
>> and the corrupted values cannot be fixed by later casts.
>
> So I got myself into a bit of a mess and the hints are in my commit message
> (but obscurely).  I am working within a branch and one of the things I had
> done in this branch was to fix numerous warnings compiling DDB with a MIPS
> n32 kernel.  n32 is quite special in that pointers are 32-bits while registers
> are 64-bits, so db_addr_t is a uint32_t, and db_expr_t was a int64_t.  I had
> "fixed" newdiff and diff to both be db_expr_t to match the type that
> X_db_search_symbol() returns and that is how I got into trouble as that
> changed 'diff' to be signed instead of unsigned.  I will revert the commit

That is a good fix if you commit it and keep the casts to an unsigned type.

> from HEAD (though perhaps re-commit the 'val' part of initializing diff if
> making that API consistent is a good thing to do).

I guess you fixed the intptr_t vs db_expr_t mismatches.

Did you look at fixing the printf formats?  I think ddb casts args to longs
too perfectly to match buggy long formats, so no errors should have been
detected at compile time.  I don't like casting to intptr_t on all arches
to support 1 strange one where this is needed, but as usual casting to
the widest type is less ugly than using PRI*.  sys/ddb has only 26 lines
of casts to long, 9 to unsigned long and 2 to long long, so fixing them
all won't be too painful.

Bruce

From owner-svn-src-all@freebsd.org  Thu Dec 15 07:06:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8018FC8161A
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Thu, 15 Dec 2016 07:06:33 +0000 (UTC) (envelope-from
 010001590149368d-51a8dd17-ce30-4c65-a117-087cf47dc8a5-000000@amazonses.com)
Received: from a8-13.smtp-out.amazonses.com (a8-13.smtp-out.amazonses.com
 [54.240.8.13])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4492E1C4E
 for <svn-src-all@freebsd.org>; Thu, 15 Dec 2016 07:06:32 +0000 (UTC)
 (envelope-from
 010001590149368d-51a8dd17-ce30-4c65-a117-087cf47dc8a5-000000@amazonses.com)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple;
 s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57; d=tarsnap.com; t=1481785292;
 h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding;
 bh=N3n/iMMf7NYHRWE+S/0sjONA/JY4EvmSgiu8rJAjNYU=;
 b=VbZrZAvzfAN2alZYqP/df7QjJZNG/HGc2r61FXkqKPlcrtOAO6SMowh96T5iD3l0
 zxUeaLgZyPeo0QvCd9ZKLs7/qzQvMTMHOHkLmnGnEc+1rjqW6fEcUz8BWaiAyKyCq3y
 nRnHGwMa+8MvdafhskYxl1h9knIbyX+mdA5cRTEo=
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple;
 s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1481785292;
 h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID;
 bh=N3n/iMMf7NYHRWE+S/0sjONA/JY4EvmSgiu8rJAjNYU=;
 b=C9FaFI71nmj0Y35vfKbfLBL78AeU3m3oI2imuh9IgOErWMpPS2tbmTKio8c6ns/9
 n7XTYSy6Mu6PjT+sq8krbRuh6wyXy3Et6+NBCCqTv8mirjvif/En5rWO/hJv+pEm9wi
 +7ThhD589zS+OuyTRnp7346l9Gyg0kRIHsNQ+bdE=
Subject: Re: svn commit: r310086 - head/sys/dev/xen/blkfront
To: Dimitry Andric <dim@FreeBSD.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
References: <201612141928.uBEJSJor074348@repo.freebsd.org>
From: Colin Percival <cperciva@tarsnap.com>
Message-ID: <010001590149368d-51a8dd17-ce30-4c65-a117-087cf47dc8a5-000000@email.amazonses.com>
Date: Thu, 15 Dec 2016 07:01:32 +0000
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101
 Thunderbird/45.5.0
MIME-Version: 1.0
In-Reply-To: <201612141928.uBEJSJor074348@repo.freebsd.org>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-SES-Outgoing: 2016.12.15-54.240.8.13
Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 07:06:33 -0000

On 12/14/16 11:28, Dimitry Andric wrote:
> Log:
>   In xbd_connect(), use correct scanf conversion specifiers for the
>   feature_barrier and feature_flush variables.  Otherwise, adjacent
>   variables on the stack, such as sector_size, may be overwritten, with
>   disastrous results.

Thanks!  Did you happen to notice what stack variable (if any?) was being
overwritten under clang 3.8.0?  Just wondering if there might be some
undiscovered issue lurking in FreeBSD releases which will cause other less
obvious problems.

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid

From owner-svn-src-all@freebsd.org  Thu Dec 15 08:03:17 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0052C81958;
 Thu, 15 Dec 2016 08:03:17 +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 CA9F6168;
 Thu, 15 Dec 2016 08:03:17 +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 uBF83Hih084574;
 Thu, 15 Dec 2016 08:03:17 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBF83GmO084572;
 Thu, 15 Dec 2016 08:03:16 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201612150803.uBF83GmO084572@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin <mav@FreeBSD.org>
Date: Thu, 15 Dec 2016 08:03:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310104 - in head/sys/cddl: compat/opensolaris/sys
 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 08:03:18 -0000

Author: mav
Date: Thu Dec 15 08:03:16 2016
New Revision: 310104
URL: https://svnweb.freebsd.org/changeset/base/310104

Log:
  Revert r310023 for now.
  
  After another look my new variable mapping was not exactly right.

Modified:
  head/sys/cddl/compat/opensolaris/sys/kmem.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c

Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/kmem.h	Thu Dec 15 05:36:48 2016	(r310103)
+++ head/sys/cddl/compat/opensolaris/sys/kmem.h	Thu Dec 15 08:03:16 2016	(r310104)
@@ -37,7 +37,6 @@
 #include <vm/uma.h>
 #include <vm/vm.h>
 #include <vm/vm_extern.h>
-#include <vm/vm_pageout.h>
 
 MALLOC_DECLARE(M_SOLARIS);
 
@@ -78,10 +77,8 @@ void kmem_reap(void);
 int kmem_debugging(void);
 void *calloc(size_t n, size_t s);
 
-#define	freemem				(long)vm_cnt.v_free_count
-#define	desfree				(long)vm_cnt.v_free_target
-#define	minfree				(long)vm_cnt.v_free_min
-#define	needfree			(long)vm_pageout_deficit
+#define	freemem				vm_cnt.v_free_count
+#define	minfree				vm_cnt.v_free_min
 #define	heap_arena			kmem_arena
 #define	kmem_alloc(size, kmflags)	zfs_kmem_alloc((size), (kmflags))
 #define	kmem_zalloc(size, kmflags)	zfs_kmem_alloc((size), (kmflags) | M_ZERO)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Thu Dec 15 05:36:48 2016	(r310103)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Thu Dec 15 08:03:16 2016	(r310104)
@@ -357,7 +357,6 @@ int zfs_arc_shrink_shift = 0;
 int zfs_arc_p_min_shift = 0;
 uint64_t zfs_arc_average_blocksize = 8 * 1024; /* 8KB */
 u_int zfs_arc_free_target = 0;
-#define	lotsfree	zfs_arc_free_target
 
 /* Absolute min for arc min / max is 16MB. */
 static uint64_t arc_abs_min = 16 << 20;
@@ -3828,6 +3827,8 @@ arc_shrink(int64_t to_free)
 	}
 }
 
+static long needfree = 0;
+
 typedef enum free_memory_reason_t {
 	FMR_UNKNOWN,
 	FMR_NEEDFREE,
@@ -3874,6 +3875,17 @@ arc_available_memory(void)
 	}
 
 	/*
+	 * Cooperate with pagedaemon when it's time for it to scan
+	 * and reclaim some pages.
+	 */
+	n = PAGESIZE * ((int64_t)freemem - zfs_arc_free_target);
+	if (n < lowest) {
+		lowest = n;
+		r = FMR_LOTSFREE;
+	}
+
+#ifdef illumos
+	/*
 	 * check that we're out of range of the pageout scanner.  It starts to
 	 * schedule paging if freemem is less than lotsfree and needfree.
 	 * lotsfree is the high-water mark for pageout, and needfree is the
@@ -3886,7 +3898,6 @@ arc_available_memory(void)
 		r = FMR_LOTSFREE;
 	}
 
-#ifdef illumos
 	/*
 	 * check to make sure that swapfs has enough space so that anon
 	 * reservations can still succeed. anon_resvmem() checks that the
@@ -4143,6 +4154,9 @@ arc_reclaim_thread(void *dummy __unused)
 		 * infinite loop.
 		 */
 		if (arc_size <= arc_c || evicted == 0) {
+#ifdef _KERNEL
+			needfree = 0;
+#endif
 			/*
 			 * We're either no longer overflowing, or we
 			 * can't evict anything more, so we should wake
@@ -5869,6 +5883,8 @@ arc_lowmem(void *arg __unused, int howto
 {
 
 	mutex_enter(&arc_reclaim_lock);
+	/* XXX: Memory deficit should be passed as argument. */
+	needfree = btoc(arc_c >> arc_shrink_shift);
 	DTRACE_PROBE(arc__needfree);
 	cv_signal(&arc_reclaim_thread_cv);
 

From owner-svn-src-all@freebsd.org  Thu Dec 15 08:10:49 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 403CAC81A51;
 Thu, 15 Dec 2016 08:10:49 +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 E1E62623;
 Thu, 15 Dec 2016 08:10:48 +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 uBF8Am9q084896;
 Thu, 15 Dec 2016 08:10:48 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBF8AmU0084895;
 Thu, 15 Dec 2016 08:10:48 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201612150810.uBF8AmU0084895@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin <mav@FreeBSD.org>
Date: Thu, 15 Dec 2016 08:10:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310105 -
 stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 08:10:49 -0000

Author: mav
Date: Thu Dec 15 08:10:47 2016
New Revision: 310105
URL: https://svnweb.freebsd.org/changeset/base/310105

Log:
  MFC 309714: Fix spa_alloc_tree sorting by offset in r305331.
  
  Original commit "7090 zfs should improve allocation order" declares alloc
  queue sorted by time and offset.  But in practice io_offset is always zero,
  so sorting happened only by time, while order of writes with equal time was
  completely random.  On Illumos this did not affected much thanks to using
  high resolution timestamps.  On FreeBSD due to using much faster but low
  resolution timestamps it caused bad data placement on disks, affecting
  further read performance.
  
  This change switches zio_timestamp_compare() from comparing uninitialized
  io_offset to really populated io_bookmark values.  I haven't decided yet
  what to do with timestampts, but on simple tests this change gives the
  same peformance results by just making code to work as declared.

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Thu Dec 15 08:03:16 2016	(r310104)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Thu Dec 15 08:10:47 2016	(r310105)
@@ -563,9 +563,24 @@ zio_timestamp_compare(const void *x1, co
 	if (z1->io_queued_timestamp > z2->io_queued_timestamp)
 		return (1);
 
-	if (z1->io_offset < z2->io_offset)
+	if (z1->io_bookmark.zb_objset < z2->io_bookmark.zb_objset)
 		return (-1);
-	if (z1->io_offset > z2->io_offset)
+	if (z1->io_bookmark.zb_objset > z2->io_bookmark.zb_objset)
+		return (1);
+
+	if (z1->io_bookmark.zb_object < z2->io_bookmark.zb_object)
+		return (-1);
+	if (z1->io_bookmark.zb_object > z2->io_bookmark.zb_object)
+		return (1);
+
+	if (z1->io_bookmark.zb_level < z2->io_bookmark.zb_level)
+		return (-1);
+	if (z1->io_bookmark.zb_level > z2->io_bookmark.zb_level)
+		return (1);
+
+	if (z1->io_bookmark.zb_blkid < z2->io_bookmark.zb_blkid)
+		return (-1);
+	if (z1->io_bookmark.zb_blkid > z2->io_bookmark.zb_blkid)
 		return (1);
 
 	if (z1 < z2)

From owner-svn-src-all@freebsd.org  Thu Dec 15 08:11:34 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14029C81BC9;
 Thu, 15 Dec 2016 08:11:34 +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 BEB40961;
 Thu, 15 Dec 2016 08:11:33 +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 uBF8BW0U087741;
 Thu, 15 Dec 2016 08:11:32 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBF8BWrX087740;
 Thu, 15 Dec 2016 08:11:32 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201612150811.uBF8BWrX087740@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin <mav@FreeBSD.org>
Date: Thu, 15 Dec 2016 08:11:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310106 -
 stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 08:11:34 -0000

Author: mav
Date: Thu Dec 15 08:11:32 2016
New Revision: 310106
URL: https://svnweb.freebsd.org/changeset/base/310106

Log:
  MFC 309714: Fix spa_alloc_tree sorting by offset in r305331.
  
  Original commit "7090 zfs should improve allocation order" declares alloc
  queue sorted by time and offset.  But in practice io_offset is always zero,
  so sorting happened only by time, while order of writes with equal time was
  completely random.  On Illumos this did not affected much thanks to using
  high resolution timestamps.  On FreeBSD due to using much faster but low
  resolution timestamps it caused bad data placement on disks, affecting
  further read performance.
  
  This change switches zio_timestamp_compare() from comparing uninitialized
  io_offset to really populated io_bookmark values.  I haven't decided yet
  what to do with timestampts, but on simple tests this change gives the
  same peformance results by just making code to work as declared.

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Thu Dec 15 08:10:47 2016	(r310105)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Thu Dec 15 08:11:32 2016	(r310106)
@@ -568,9 +568,24 @@ zio_timestamp_compare(const void *x1, co
 	if (z1->io_queued_timestamp > z2->io_queued_timestamp)
 		return (1);
 
-	if (z1->io_offset < z2->io_offset)
+	if (z1->io_bookmark.zb_objset < z2->io_bookmark.zb_objset)
 		return (-1);
-	if (z1->io_offset > z2->io_offset)
+	if (z1->io_bookmark.zb_objset > z2->io_bookmark.zb_objset)
+		return (1);
+
+	if (z1->io_bookmark.zb_object < z2->io_bookmark.zb_object)
+		return (-1);
+	if (z1->io_bookmark.zb_object > z2->io_bookmark.zb_object)
+		return (1);
+
+	if (z1->io_bookmark.zb_level < z2->io_bookmark.zb_level)
+		return (-1);
+	if (z1->io_bookmark.zb_level > z2->io_bookmark.zb_level)
+		return (1);
+
+	if (z1->io_bookmark.zb_blkid < z2->io_bookmark.zb_blkid)
+		return (-1);
+	if (z1->io_bookmark.zb_blkid > z2->io_bookmark.zb_blkid)
 		return (1);
 
 	if (z1 < z2)

From owner-svn-src-all@freebsd.org  Thu Dec 15 10:42:15 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A525C8023D;
 Thu, 15 Dec 2016 10:42:15 +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 4992A1F7A;
 Thu, 15 Dec 2016 10:42:15 +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 uBFAgEZh049533;
 Thu, 15 Dec 2016 10:42:14 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFAgE9j049532;
 Thu, 15 Dec 2016 10:42:14 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612151042.uBFAgE9j049532@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Thu, 15 Dec 2016 10:42:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310108 - stable/11/sys/vm
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 10:42:15 -0000

Author: kib
Date: Thu Dec 15 10:42:14 2016
New Revision: 310108
URL: https://svnweb.freebsd.org/changeset/base/310108

Log:
  MFC r309708:
  Style.

Modified:
  stable/11/sys/vm/phys_pager.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/phys_pager.c
==============================================================================
--- stable/11/sys/vm/phys_pager.c	Thu Dec 15 10:36:34 2016	(r310107)
+++ stable/11/sys/vm/phys_pager.c	Thu Dec 15 10:42:14 2016	(r310108)
@@ -56,9 +56,6 @@ phys_pager_init(void)
 	mtx_init(&phys_pager_mtx, "phys_pager list", NULL, MTX_DEF);
 }
 
-/*
- * MPSAFE
- */
 static vm_object_t
 phys_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
     vm_ooffset_t foff, struct ucred *cred)
@@ -101,8 +98,8 @@ phys_pager_alloc(void *handle, vm_ooffse
 				object = object1;
 				object1 = NULL;
 				object->handle = handle;
-				TAILQ_INSERT_TAIL(&phys_pager_object_list, object,
-				    pager_object_list);
+				TAILQ_INSERT_TAIL(&phys_pager_object_list,
+				    object, pager_object_list);
 			}
 		} else {
 			if (pindex > object->size)
@@ -117,9 +114,6 @@ phys_pager_alloc(void *handle, vm_ooffse
 	return (object);
 }
 
-/*
- * MPSAFE
- */
 static void
 phys_pager_dealloc(vm_object_t object)
 {
@@ -165,7 +159,7 @@ phys_pager_getpages(vm_object_t object, 
 
 static void
 phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync,
-		    int *rtvals)
+    int *rtvals)
 {
 
 	panic("phys_pager_putpage called");
@@ -183,7 +177,7 @@ phys_pager_putpages(vm_object_t object, 
 #endif
 static boolean_t
 phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before,
-		   int *after)
+    int *after)
 {
 	vm_pindex_t base, end;
 

From owner-svn-src-all@freebsd.org  Thu Dec 15 10:44:46 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 805D5C802F5;
 Thu, 15 Dec 2016 10:44:46 +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 4FB432DF;
 Thu, 15 Dec 2016 10:44:46 +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 uBFAijiB049690;
 Thu, 15 Dec 2016 10:44:45 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFAijri049689;
 Thu, 15 Dec 2016 10:44:45 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612151044.uBFAijri049689@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Thu, 15 Dec 2016 10:44:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310109 - stable/11/sys/vm
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 10:44:46 -0000

Author: kib
Date: Thu Dec 15 10:44:45 2016
New Revision: 310109
URL: https://svnweb.freebsd.org/changeset/base/310109

Log:
  MFC r309709:
  Move map_generation snapshot value into struct faultstate.

Modified:
  stable/11/sys/vm/vm_fault.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/vm_fault.c
==============================================================================
--- stable/11/sys/vm/vm_fault.c	Thu Dec 15 10:42:14 2016	(r310108)
+++ stable/11/sys/vm/vm_fault.c	Thu Dec 15 10:44:45 2016	(r310109)
@@ -122,6 +122,7 @@ struct faultstate {
 	vm_pindex_t first_pindex;
 	vm_map_t map;
 	vm_map_entry_t entry;
+	int map_generation;
 	bool lookup_still_valid;
 	struct vnode *vp;
 };
@@ -338,7 +339,7 @@ vm_fault_hold(vm_map_t map, vm_offset_t 
 	struct vnode *vp;
 	vm_offset_t e_end, e_start;
 	int ahead, alloc_req, behind, cluster_offset, error, era, faultcount;
-	int locked, map_generation, nera, result, rv;
+	int locked, nera, result, rv;
 	u_char behavior;
 	boolean_t wired;	/* Passed by reference. */
 	bool dead, growstack, hardfault, is_first_object_locked;
@@ -372,7 +373,7 @@ RetryFault:;
 		return (result);
 	}
 
-	map_generation = fs.map->timestamp;
+	fs.map_generation = fs.map->timestamp;
 
 	if (fs.entry->eflags & MAP_ENTRY_NOFAULT) {
 		panic("vm_fault: fault on nofault entry, addr: %lx",
@@ -976,7 +977,7 @@ readrest:
 			goto RetryFault;
 		}
 		fs.lookup_still_valid = true;
-		if (fs.map->timestamp != map_generation) {
+		if (fs.map->timestamp != fs.map_generation) {
 			result = vm_map_lookup_locked(&fs.map, vaddr, fault_type,
 			    &fs.entry, &retry_object, &retry_pindex, &retry_prot, &wired);
 

From owner-svn-src-all@freebsd.org  Thu Dec 15 10:47:36 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A974C803B5;
 Thu, 15 Dec 2016 10:47:36 +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 29FD36C6;
 Thu, 15 Dec 2016 10:47:36 +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 uBFAlZ7x049847;
 Thu, 15 Dec 2016 10:47:35 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFAlZYL049846;
 Thu, 15 Dec 2016 10:47:35 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612151047.uBFAlZYL049846@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Thu, 15 Dec 2016 10:47:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310110 - stable/10/sys/vm
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 10:47:36 -0000

Author: kib
Date: Thu Dec 15 10:47:35 2016
New Revision: 310110
URL: https://svnweb.freebsd.org/changeset/base/310110

Log:
  MFC r309708:
  Style.

Modified:
  stable/10/sys/vm/phys_pager.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/vm/phys_pager.c
==============================================================================
--- stable/10/sys/vm/phys_pager.c	Thu Dec 15 10:44:45 2016	(r310109)
+++ stable/10/sys/vm/phys_pager.c	Thu Dec 15 10:47:35 2016	(r310110)
@@ -56,9 +56,6 @@ phys_pager_init(void)
 	mtx_init(&phys_pager_mtx, "phys_pager list", NULL, MTX_DEF);
 }
 
-/*
- * MPSAFE
- */
 static vm_object_t
 phys_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
     vm_ooffset_t foff, struct ucred *cred)
@@ -101,8 +98,8 @@ phys_pager_alloc(void *handle, vm_ooffse
 				object = object1;
 				object1 = NULL;
 				object->handle = handle;
-				TAILQ_INSERT_TAIL(&phys_pager_object_list, object,
-				    pager_object_list);
+				TAILQ_INSERT_TAIL(&phys_pager_object_list,
+				    object, pager_object_list);
 			}
 		} else {
 			if (pindex > object->size)
@@ -117,9 +114,6 @@ phys_pager_alloc(void *handle, vm_ooffse
 	return (object);
 }
 
-/*
- * MPSAFE
- */
 static void
 phys_pager_dealloc(vm_object_t object)
 {
@@ -167,7 +161,7 @@ phys_pager_getpages(vm_object_t object, 
 
 static void
 phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync,
-		    int *rtvals)
+    int *rtvals)
 {
 
 	panic("phys_pager_putpage called");
@@ -185,7 +179,7 @@ phys_pager_putpages(vm_object_t object, 
 #endif
 static boolean_t
 phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before,
-		   int *after)
+    int *after)
 {
 	vm_pindex_t base, end;
 

From owner-svn-src-all@freebsd.org  Thu Dec 15 10:49:13 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87AD2C80441;
 Thu, 15 Dec 2016 10:49:13 +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 665448AD;
 Thu, 15 Dec 2016 10:49:11 +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 MAA23859;
 Thu, 15 Dec 2016 12:49:04 +0200 (EET) (envelope-from avg@FreeBSD.org)
Received: from localhost ([127.0.0.1])
 by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
 id 1cHTay-0003N0-1F; Thu, 15 Dec 2016 12:49:04 +0200
Subject: Re: svn commit: r309714 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
To: Alexander Motin <mav@FreeBSD.org>, src-committers@FreeBSD.org,
 svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org
References: <201612081558.uB8Fw4xA027508@repo.freebsd.org>
 <cd831c65-ffb3-b84b-7e0e-b84ae32bace1@FreeBSD.org>
 <eaaef2a9-eb5a-5629-c8f3-54c3a45b16b5@FreeBSD.org>
From: Andriy Gapon <avg@FreeBSD.org>
Message-ID: <94544782-cfcc-86ee-da17-bc6b25873313@FreeBSD.org>
Date: Thu, 15 Dec 2016 12:48:07 +0200
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101
 Thunderbird/45.5.1
MIME-Version: 1.0
In-Reply-To: <eaaef2a9-eb5a-5629-c8f3-54c3a45b16b5@FreeBSD.org>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 10:49:13 -0000

On 14/12/2016 21:49, Alexander Motin wrote:
> On 14.12.2016 14:03, Andriy Gapon wrote:
>> On 08/12/2016 17:58, Alexander Motin wrote:
>>>   This change switches zio_timestamp_compare() from comparing uninitialized
>>>   io_offset to really populated io_bookmark values.  I haven't decided yet
>>>   what to do with timestampts, but on simple tests this change gives the
>>>   same peformance results by just making code to work as declared.
>>
>> I think that we should just enable precise timestamps.
>> I just can't see them noticeably hurting performance given the amount of
>> calculations, memory allocations, locking, etc, that ZFS already has.
>> And there are layers above and below ZFS too.
> 
> It is orthogonal to this change and can be done any time, if decided.

Yes, indeed.

> I worried mostly about some older systems still using HPET or ACPI
> timecounters, where half dozen extra timer calls per single I/O may be
> quite expensive.
> 
> I've recently reviewed all places where ZFS calls gethrtime(), and found
> that in most of them precision is not needed, even 1 second would be
> enough, not even 1/hz.  I've found only two cases where precision is
> important, both about ZIO sorting in different places (this is one of
> the two), and both of them are now workarounded now by using offset as
> secondary key.

Thank you for looking into this and fixing the bug!

-- 
Andriy Gapon

From owner-svn-src-all@freebsd.org  Thu Dec 15 10:51:36 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DC53C8065A;
 Thu, 15 Dec 2016 10:51:36 +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 2D090BB1;
 Thu, 15 Dec 2016 10:51:36 +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 uBFApZif053616;
 Thu, 15 Dec 2016 10:51:35 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFApZLp053615;
 Thu, 15 Dec 2016 10:51:35 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612151051.uBFApZLp053615@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Thu, 15 Dec 2016 10:51:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310111 - stable/10/sys/vm
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 10:51:36 -0000

Author: kib
Date: Thu Dec 15 10:51:35 2016
New Revision: 310111
URL: https://svnweb.freebsd.org/changeset/base/310111

Log:
  MFC r309709:
  Move map_generation snapshot value into struct faultstate.

Modified:
  stable/10/sys/vm/vm_fault.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/vm/vm_fault.c
==============================================================================
--- stable/10/sys/vm/vm_fault.c	Thu Dec 15 10:47:35 2016	(r310110)
+++ stable/10/sys/vm/vm_fault.c	Thu Dec 15 10:51:35 2016	(r310111)
@@ -124,6 +124,7 @@ struct faultstate {
 	vm_map_t map;
 	vm_map_entry_t entry;
 	int lookup_still_valid;
+	int map_generation;
 	struct vnode *vp;
 };
 
@@ -336,7 +337,6 @@ vm_fault_hold(vm_map_t map, vm_offset_t 
 	long ahead, behind;
 	int alloc_req, era, faultcount, nera, reqpage, result;
 	boolean_t dead, growstack, is_first_object_locked, wired;
-	int map_generation;
 	vm_object_t next_object;
 	vm_page_t marray[VM_FAULT_READ_MAX];
 	int hardfault;
@@ -372,7 +372,7 @@ RetryFault:;
 		return (result);
 	}
 
-	map_generation = fs.map->timestamp;
+	fs.map_generation = fs.map->timestamp;
 
 	if (fs.entry->eflags & MAP_ENTRY_NOFAULT) {
 		panic("vm_fault: fault on nofault entry, addr: %lx",
@@ -950,7 +950,7 @@ readrest:
 			goto RetryFault;
 		}
 		fs.lookup_still_valid = TRUE;
-		if (fs.map->timestamp != map_generation) {
+		if (fs.map->timestamp != fs.map_generation) {
 			result = vm_map_lookup_locked(&fs.map, vaddr, fault_type,
 			    &fs.entry, &retry_object, &retry_pindex, &retry_prot, &wired);
 

From owner-svn-src-all@freebsd.org  Thu Dec 15 12:57:04 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 956E9C81536;
 Thu, 15 Dec 2016 12:57:04 +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 4B0891ACE;
 Thu, 15 Dec 2016 12:57:04 +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 uBFCv3ww001962;
 Thu, 15 Dec 2016 12:57:03 GMT (envelope-from emaste@FreeBSD.org)
Received: (from emaste@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFCv3ih001961;
 Thu, 15 Dec 2016 12:57:03 GMT (envelope-from emaste@FreeBSD.org)
Message-Id: <201612151257.uBFCv3ih001961@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: emaste set sender to
 emaste@FreeBSD.org using -f
From: Ed Maste <emaste@FreeBSD.org>
Date: Thu, 15 Dec 2016 12:57:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310112 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 12:57:04 -0000

Author: emaste
Date: Thu Dec 15 12:57:03 2016
New Revision: 310112
URL: https://svnweb.freebsd.org/changeset/base/310112

Log:
  newvers.sh: add option to eliminate kernel build metadata
  
  Build metadata (username, hostname, etc.) prevents the FreeBSD kernel
  from building reproducibly. Add an option to disable inclusion of that
  metadata but retain the release information and SVN/git VCS details.
  See https://reproducible-builds.org/ for additional background.
  
  Reviewed by:	bapt
  Obtained from:	NetBSD
  MFC after:	1 month
  Sponsored by:	Reproducible Builds World Summit 2, Berlin
  Differential Revision:	https://reviews.freebsd.org/D4347

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==============================================================================
--- head/sys/conf/newvers.sh	Thu Dec 15 10:51:35 2016	(r310111)
+++ head/sys/conf/newvers.sh	Thu Dec 15 12:57:03 2016	(r310112)
@@ -30,6 +30,14 @@
 #	@(#)newvers.sh	8.1 (Berkeley) 4/20/94
 # $FreeBSD$
 
+# Command line options:
+#
+#     -r               Reproducible build.  Do not embed directory names, user
+#                      names, time stamps or other dynamic information into
+#                      the outuput file.  This is intended to allow two builds
+#                      done at different times and even by different people on
+#                      different hosts to produce identical output.
+
 TYPE="FreeBSD"
 REVISION="12.0"
 BRANCH="CURRENT"
@@ -250,10 +258,28 @@ if [ -n "$hg_cmd" ] ; then
 	fi
 fi
 
+include_metadata=true
+while getopts r opt; do
+	case "$opt" in
+	r)
+		include_metadata=
+		;;
+	esac
+done
+shift $((OPTIND - 1))
+
+if [ -z "${include_metadata}" ]; then
+	VERINFO="${VERSION} ${svn}${git}${hg}${p4version}"
+	VERSTR="${VERINFO}\\n"
+else
+	VERINFO="${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}"
+	VERSTR="${VERINFO}\\n    ${u}@${h}:${d}\\n"
+fi
+
 cat << EOF > vers.c
 $COPYRIGHT
-#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}"
-#define VERSTR "${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}\\n    ${u}@${h}:${d}\\n"
+#define SCCSSTR "@(#)${VERINFO}"
+#define VERSTR "${VERSTR}"
 #define RELSTR "${RELEASE}"
 
 char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;

From owner-svn-src-all@freebsd.org  Thu Dec 15 12:59:45 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8470C8163B
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Thu, 15 Dec 2016 12:59:45 +0000 (UTC)
 (envelope-from steven.hartland@multiplay.co.uk)
Received: from mail-wj0-x22f.google.com (mail-wj0-x22f.google.com
 [IPv6:2a00:1450:400c:c01::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 4A95F1CCE
 for <svn-src-all@freebsd.org>; Thu, 15 Dec 2016 12:59:45 +0000 (UTC)
 (envelope-from steven.hartland@multiplay.co.uk)
Received: by mail-wj0-x22f.google.com with SMTP id xy5so63744026wjc.0
 for <svn-src-all@freebsd.org>; Thu, 15 Dec 2016 04:59:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623;
 h=subject:to:references:from:message-id:date:user-agent:mime-version
 :in-reply-to; bh=KY+xC2ajXpJ+tQBLgqZfEVBgzFCTlHzZYu4mgwqpv3U=;
 b=yzwKOIQBn8M3bcdrciUedcEmmRa9K7bwzQ8PKgs8ZbXRtAh1ZBbi2V7oQmgMOIDylk
 a/qBNbWauC01RbWpyjJEjz5iE8S7EArTq77Jo+LePPTKoMyQPbn3wPg2LxMMm0gkd8xK
 VNMYOySef4H3SaxL35s5UX6a0aL3YNPAkdxP6ehWSsvXh2xxaxp99A0wXq7l6hWXIh91
 r+LYtqRrddIF+TuxVAvMLvItNp6l35JEpOLwraU9XIYPM9ftcUBK95Z6vF7nOmQzlpZV
 K3rNGOYnY0Psgl/4IFy9UZdoqihsnzyJIFZL6jx1VJDAJfbqdZE+ZcK255dszraPjK3l
 0JTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:subject:to:references:from:message-id:date
 :user-agent:mime-version:in-reply-to;
 bh=KY+xC2ajXpJ+tQBLgqZfEVBgzFCTlHzZYu4mgwqpv3U=;
 b=BjADTiUzsL0XQ7WIM1PZr14jVhoS15/R5I8nB80f8Dc1aj0AJLq4gsWlUxsT4Hqqe6
 fDGV2xKJdj+BPltV7e+vOe6LQhDjz4jp/3Yfp5FTgkAO6fRaKNMfHQjDw8LPPbQvZkBY
 HTeON2TQk9KXmRRaJXuksNOUFpy1gu0TGz+3TBJDMQYYr5e7dtFukJFoKZyZh5kJu90M
 gmaglhuPaNtUaRlEEH5mIqjBjWqxHUk6HGHbKaBuuV0LtI7Lu827vuzf4CBuTmCTUov5
 x+8v7aKzDxvTpS3nIsBhFNch6A3GwA90LBI+r3x69nTQGKaLMTaSSjyzIts22E+PVc7m
 6ZVw==
X-Gm-Message-State: AKaTC0168nRMOAp9gg5nH5EcMMMk/4PITsP9y5y/uxzOdhGXpsjcqvfdRlcokVN3NfP0+spd
X-Received: by 10.194.88.3 with SMTP id bc3mr1242233wjb.143.1481806783601;
 Thu, 15 Dec 2016 04:59:43 -0800 (PST)
Received: from [10.10.1.58] ([185.97.61.26])
 by smtp.gmail.com with ESMTPSA id 6sm1973642wjt.5.2016.12.15.04.59.42
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 15 Dec 2016 04:59:42 -0800 (PST)
Subject: Re: svn commit: r310112 - head/sys/conf
To: Ed Maste <emaste@FreeBSD.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
References: <201612151257.uBFCv3ih001961@repo.freebsd.org>
From: Steven Hartland <steven.hartland@multiplay.co.uk>
Message-ID: <c5939658-4200-de1e-a187-f4e9823d3fc5@multiplay.co.uk>
Date: Thu, 15 Dec 2016 12:57:10 +0000
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.5.1
MIME-Version: 1.0
In-Reply-To: <201612151257.uBFCv3ih001961@repo.freebsd.org>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Content-Filtered-By: Mailman/MimeDel 2.1.23
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 12:59:45 -0000

Thanks for doing this :)

On 15/12/2016 12:57, Ed Maste wrote:
> Author: emaste
> Date: Thu Dec 15 12:57:03 2016
> New Revision: 310112
> URL: https://svnweb.freebsd.org/changeset/base/310112
>
> Log:
>    newvers.sh: add option to eliminate kernel build metadata
>    
>    Build metadata (username, hostname, etc.) prevents the FreeBSD kernel
>    from building reproducibly. Add an option to disable inclusion of that
>    metadata but retain the release information and SVN/git VCS details.
>    See https://reproducible-builds.org/ for additional background.
>    
>    Reviewed by:	bapt
>    Obtained from:	NetBSD
>    MFC after:	1 month
>    Sponsored by:	Reproducible Builds World Summit 2, Berlin
>    Differential Revision:	https://reviews.freebsd.org/D4347
>
> Modified:
>    head/sys/conf/newvers.sh
>
> Modified: head/sys/conf/newvers.sh
> ==============================================================================
> --- head/sys/conf/newvers.sh	Thu Dec 15 10:51:35 2016	(r310111)
> +++ head/sys/conf/newvers.sh	Thu Dec 15 12:57:03 2016	(r310112)
> @@ -30,6 +30,14 @@
>   #	@(#)newvers.sh	8.1 (Berkeley) 4/20/94
>   # $FreeBSD$
>   
> +# Command line options:
> +#
> +#     -r               Reproducible build.  Do not embed directory names, user
> +#                      names, time stamps or other dynamic information into
> +#                      the outuput file.  This is intended to allow two builds
> +#                      done at different times and even by different people on
> +#                      different hosts to produce identical output.
> +
>   TYPE="FreeBSD"
>   REVISION="12.0"
>   BRANCH="CURRENT"
> @@ -250,10 +258,28 @@ if [ -n "$hg_cmd" ] ; then
>   	fi
>   fi
>   
> +include_metadata=true
> +while getopts r opt; do
> +	case "$opt" in
> +	r)
> +		include_metadata=
> +		;;
> +	esac
> +done
> +shift $((OPTIND - 1))
> +
> +if [ -z "${include_metadata}" ]; then
> +	VERINFO="${VERSION} ${svn}${git}${hg}${p4version}"
> +	VERSTR="${VERINFO}\\n"
> +else
> +	VERINFO="${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}"
> +	VERSTR="${VERINFO}\\n    ${u}@${h}:${d}\\n"
> +fi
> +
>   cat << EOF > vers.c
>   $COPYRIGHT
> -#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}"
> -#define VERSTR "${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}\\n    ${u}@${h}:${d}\\n"
> +#define SCCSSTR "@(#)${VERINFO}"
> +#define VERSTR "${VERSTR}"
>   #define RELSTR "${RELEASE}"
>   
>   char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;
>


From owner-svn-src-all@freebsd.org  Thu Dec 15 13:31:45 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E428C813B2;
 Thu, 15 Dec 2016 13:31:45 +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 4DE3A139E;
 Thu, 15 Dec 2016 13:31:45 +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 uBFDViq1017105;
 Thu, 15 Dec 2016 13:31:44 GMT (envelope-from andrew@FreeBSD.org)
Received: (from andrew@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFDViBw017104;
 Thu, 15 Dec 2016 13:31:44 GMT (envelope-from andrew@FreeBSD.org)
Message-Id: <201612151331.uBFDViBw017104@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: andrew set sender to
 andrew@FreeBSD.org using -f
From: Andrew Turner <andrew@FreeBSD.org>
Date: Thu, 15 Dec 2016 13:31:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310113 - head/sys/arm/broadcom/bcm2835
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 13:31:45 -0000

Author: andrew
Date: Thu Dec 15 13:31:44 2016
New Revision: 310113
URL: https://svnweb.freebsd.org/changeset/base/310113

Log:
  Directly include openfirm.h rather than through fdt_common.h as none of the
  latter file is needed.
  
  Sponsored by:	ABT Systems Ltd

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c	Thu Dec 15 12:57:03 2016	(r310112)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c	Thu Dec 15 13:31:44 2016	(r310113)
@@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/platform.h>
 #include <machine/platformvar.h>
 
-#include <dev/fdt/fdt_common.h>
+#include <dev/ofw/openfirm.h>
 
 #include <arm/broadcom/bcm2835/bcm2835_wdog.h>
 #include <arm/broadcom/bcm2835/bcm2836_mp.h>

From owner-svn-src-all@freebsd.org  Thu Dec 15 15:14:03 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B9FEC7759A;
 Thu, 15 Dec 2016 15:14:03 +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 0B2D610FD;
 Thu, 15 Dec 2016 15:14:02 +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 uBFFE2TU058256;
 Thu, 15 Dec 2016 15:14:02 GMT (envelope-from emaste@FreeBSD.org)
Received: (from emaste@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFFE2o6058255;
 Thu, 15 Dec 2016 15:14:02 GMT (envelope-from emaste@FreeBSD.org)
Message-Id: <201612151514.uBFFE2o6058255@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: emaste set sender to
 emaste@FreeBSD.org using -f
From: Ed Maste <emaste@FreeBSD.org>
Date: Thu, 15 Dec 2016 15:14:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310114 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 15:14:03 -0000

Author: emaste
Date: Thu Dec 15 15:14:02 2016
New Revision: 310114
URL: https://svnweb.freebsd.org/changeset/base/310114

Log:
  newvers.sh: correct typo in comment
  
  Submitted by:	lidl

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==============================================================================
--- head/sys/conf/newvers.sh	Thu Dec 15 13:31:44 2016	(r310113)
+++ head/sys/conf/newvers.sh	Thu Dec 15 15:14:02 2016	(r310114)
@@ -34,7 +34,7 @@
 #
 #     -r               Reproducible build.  Do not embed directory names, user
 #                      names, time stamps or other dynamic information into
-#                      the outuput file.  This is intended to allow two builds
+#                      the output file.  This is intended to allow two builds
 #                      done at different times and even by different people on
 #                      different hosts to produce identical output.
 

From owner-svn-src-all@freebsd.org  Thu Dec 15 15:35:57 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F802C77AF2;
 Thu, 15 Dec 2016 15:35:57 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 47CD51E0C;
 Thu, 15 Dec 2016 15:35:57 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBFFZu4x066552;
 Thu, 15 Dec 2016 15:35:56 GMT (envelope-from mm@FreeBSD.org)
Received: (from mm@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFFZrWW066521;
 Thu, 15 Dec 2016 15:35:53 GMT (envelope-from mm@FreeBSD.org)
Message-Id: <201612151535.uBFFZrWW066521@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org
 using -f
From: Martin Matuska <mm@FreeBSD.org>
Date: Thu, 15 Dec 2016 15:35:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r310115 - in vendor/libarchive/dist: . build
 build/autoconf cat cpio cpio/test libarchive libarchive/test tar/test
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 15:35:57 -0000

Author: mm
Date: Thu Dec 15 15:35:53 2016
New Revision: 310115
URL: https://svnweb.freebsd.org/changeset/base/310115

Log:
  Update vendor/libarchive to git to 30528ed7a9f479f1c363ee8cfa1c5eb4c7d9be10
  
  Vendor bugfixes:
  
  PR 826: OpenSSL 1.1 support
  PR 830, 831, 833: Spelling fixes
  OSS-Fuzz 227, 230, 239: Fix possible memory leak in archive_read_free()
  OSS-Fuzz 237: Fix heap buffer overflow when reading invalid ar archives

Modified:
  vendor/libarchive/dist/.travis.yml
  vendor/libarchive/dist/Makefile.am
  vendor/libarchive/dist/build/autoconf/config.rpath
  vendor/libarchive/dist/build/ci_build.sh
  vendor/libarchive/dist/cat/bsdcat.c
  vendor/libarchive/dist/configure.ac
  vendor/libarchive/dist/cpio/cpio.c
  vendor/libarchive/dist/cpio/test/test_option_lz4.c
  vendor/libarchive/dist/libarchive/CMakeLists.txt
  vendor/libarchive/dist/libarchive/archive.h
  vendor/libarchive/dist/libarchive/archive_acl.c
  vendor/libarchive/dist/libarchive/archive_cryptor.c
  vendor/libarchive/dist/libarchive/archive_cryptor_private.h
  vendor/libarchive/dist/libarchive/archive_digest.c
  vendor/libarchive/dist/libarchive/archive_digest_private.h
  vendor/libarchive/dist/libarchive/archive_entry.c
  vendor/libarchive/dist/libarchive/archive_hmac.c
  vendor/libarchive/dist/libarchive/archive_hmac_private.h
  vendor/libarchive/dist/libarchive/archive_options.c
  vendor/libarchive/dist/libarchive/archive_read.c
  vendor/libarchive/dist/libarchive/archive_read_append_filter.c
  vendor/libarchive/dist/libarchive/archive_read_disk_posix.c
  vendor/libarchive/dist/libarchive/archive_read_disk_windows.c
  vendor/libarchive/dist/libarchive/archive_read_extract2.c
  vendor/libarchive/dist/libarchive/archive_read_open_memory.c
  vendor/libarchive/dist/libarchive/archive_read_private.h
  vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_ar.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c
  vendor/libarchive/dist/libarchive/archive_string.c
  vendor/libarchive/dist/libarchive/archive_windows.c
  vendor/libarchive/dist/libarchive/archive_write.c
  vendor/libarchive/dist/libarchive/archive_write_add_filter_lz4.c
  vendor/libarchive/dist/libarchive/archive_write_disk_posix.c
  vendor/libarchive/dist/libarchive/archive_write_disk_set_standard_lookup.c
  vendor/libarchive/dist/libarchive/archive_write_disk_windows.c
  vendor/libarchive/dist/libarchive/archive_write_open_memory.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_ar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_cpio_newc.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_shar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_ustar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_v7tar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c
  vendor/libarchive/dist/libarchive/test/test_archive_read_add_passphrase.c
  vendor/libarchive/dist/libarchive/test/test_pax_filename_encoding.c
  vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c
  vendor/libarchive/dist/tar/test/test_option_lz4.c

Modified: vendor/libarchive/dist/.travis.yml
==============================================================================
--- vendor/libarchive/dist/.travis.yml	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/.travis.yml	Thu Dec 15 15:35:53 2016	(r310115)
@@ -1,13 +1,23 @@
 language: C
 sudo: required
 dist: trusty
+os:
+  - linux
+  - osx
 compiler:
   - gcc
   - clang
 env:
   - BUILD_SYSTEM=cmake
   - BUILD_SYSTEM=autotools
+matrix:
+  exclude:
+    - os: osx
+      compiler: gcc
+before_install:
+  - if [ `uname` = "Darwin" ]; then brew update; fi
+  - if [ `uname` = "Linux" ]; then sudo apt-get install -y libbz2-dev libzip-dev liblzma-dev liblzo2-dev; fi
 install:
-  - sudo apt-get install -y libbz2-dev libzip-dev liblzma-dev liblzo2-dev
+  - if [ `uname` = "Darwin" ]; then brew install xz lzo lz4; fi
 script:
   - build/ci_build.sh

Modified: vendor/libarchive/dist/Makefile.am
==============================================================================
--- vendor/libarchive/dist/Makefile.am	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/Makefile.am	Thu Dec 15 15:35:53 2016	(r310115)
@@ -118,6 +118,8 @@ libarchive_la_SOURCES= \
 	libarchive/archive_hmac.c \
 	libarchive/archive_hmac_private.h \
 	libarchive/archive_match.c \
+	libarchive/archive_openssl_evp_private.h \
+	libarchive/archive_openssl_hmac_private.h \
 	libarchive/archive_options.c \
 	libarchive/archive_options_private.h \
 	libarchive/archive_pack_dev.h \

Modified: vendor/libarchive/dist/build/autoconf/config.rpath
==============================================================================
--- vendor/libarchive/dist/build/autoconf/config.rpath	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/build/autoconf/config.rpath	Thu Dec 15 15:35:53 2016	(r310115)
@@ -63,7 +63,7 @@ else
     aix*)
       wl='-Wl,'
       ;;
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
+    mingw* | cygwin* | msys* | pw32* | os2* | cegcc*)
       ;;
     hpux9* | hpux10* | hpux11*)
       wl='-Wl,'
@@ -155,7 +155,7 @@ hardcode_direct=no
 hardcode_minus_L=no
 
 case "$host_os" in
-  cygwin* | mingw* | pw32* | cegcc*)
+  cygwin* | msys* | mingw* | pw32* | cegcc*)
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
@@ -204,7 +204,7 @@ if test "$with_gnu_ld" = yes; then
         ld_shlibs=no
       fi
       ;;
-    cygwin* | mingw* | pw32* | cegcc*)
+    cygwin* | msys* | mingw* | pw32* | cegcc*)
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
@@ -354,7 +354,7 @@ else
       ;;
     bsdi[45]*)
       ;;
-    cygwin* | mingw* | pw32* | cegcc*)
+    cygwin* | msys* | mingw* | pw32* | cegcc*)
       # When not using gcc, we currently assume that we are using
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -543,7 +543,7 @@ case "$host_os" in
   bsdi[45]*)
     library_names_spec='$libname$shrext'
     ;;
-  cygwin* | mingw* | pw32* | cegcc*)
+  cygwin* | msys* | mingw* | pw32* | cegcc*)
     shrext=.dll
     library_names_spec='$libname.dll.a $libname.lib'
     ;;

Modified: vendor/libarchive/dist/build/ci_build.sh
==============================================================================
--- vendor/libarchive/dist/build/ci_build.sh	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/build/ci_build.sh	Thu Dec 15 15:35:53 2016	(r310115)
@@ -61,7 +61,7 @@ if [ -z "${BUILD_SYSTEM}" ]; then
 	inputerror "Missing type (-t) parameter"
 fi
 if [ -z "${BUILDDIR}" ]; then
-	BUILDDIR="${CURDIR}/BUILD/${BUILD_SYSTEM}"
+	BUILDDIR="${CURDIR}/build_ci/${BUILD_SYSTEM}"
 fi
 mkdir -p "${BUILDDIR}"
 for action in ${ACTIONS}; do
@@ -90,10 +90,7 @@ for action in ${ACTIONS}; do
 		test)
 			case "${BUILD_SYSTEM}" in
 				autotools)
-					if ! make ${MAKE_ARGS} check; then
-						cat test-suite.log
-						exit 1
-					fi
+					make ${MAKE_ARGS} check LOG_DRIVER="${SRCDIR}/build/ci_test_driver"
 					;;
 				cmake)
 					make ${MAKE_ARGS} test

Modified: vendor/libarchive/dist/cat/bsdcat.c
==============================================================================
--- vendor/libarchive/dist/cat/bsdcat.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/cat/bsdcat.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -142,5 +142,8 @@ main(int argc, char **argv)
 			bsdcat_next();
 		}
 
+	if (a != NULL)
+		archive_read_free(a);
+
 	exit(exit_status);
 }

Modified: vendor/libarchive/dist/configure.ac
==============================================================================
--- vendor/libarchive/dist/configure.ac	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/configure.ac	Thu Dec 15 15:35:53 2016	(r310115)
@@ -89,7 +89,7 @@ inc_windows_files=no
 inc_cygwin_files=no
 case "$host_os" in
   *mingw* ) inc_windows_files=yes ;;
-  *cygwin*) inc_cygwin_files=yes ;;
+  *cygwin* | *msys*) inc_cygwin_files=yes ;;
 esac
 AM_CONDITIONAL([INC_WINDOWS_FILES], [test $inc_windows_files = yes])
 AM_CONDITIONAL([INC_CYGWIN_FILES], [test $inc_cygwin_files = yes])
@@ -243,7 +243,7 @@ AM_CONDITIONAL([STATIC_BSDCPIO], [ test 
 
 # Set up defines needed before including any headers
 case $host in
-  *mingw* | *cygwin* )
+  *mingw* | *cygwin* | *msys*  )
   AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
   AC_DEFINE([WINVER], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
   AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.])
@@ -302,7 +302,7 @@ AC_ARG_WITH([bz2lib],
 if test "x$with_bz2lib" != "xno"; then
   AC_CHECK_HEADERS([bzlib.h])
   case "$host_os" in
-    *mingw* | *cygwin*)
+    *mingw* | *cygwin* | *msys*)
       dnl AC_CHECK_LIB cannot be used on the Windows port of libbz2, therefore
 	  dnl use AC_LINK_IFELSE.
 	  AC_MSG_CHECKING([for BZ2_bzDecompressInit in -lbz2])
@@ -797,7 +797,7 @@ main(int argc, char **argv)
 ])
 
 case "$host_os" in
-  *mingw* | *cygwin*)
+  *mingw* | *cygwin* | *msys*)
 	;;
   *)
 	CRYPTO_CHECK(MD5, LIBC, md5)
@@ -840,7 +840,7 @@ if test "x$with_openssl" != "xno"; then
     AC_CHECK_HEADERS([openssl/evp.h])
     saved_LIBS=$LIBS
     case "$host_os" in
-      *mingw* | *cygwin*)
+      *mingw* | *cygwin* | *msys*)
         case "$host_cpu" in
           x86_64)
             AC_CHECK_LIB(eay64,OPENSSL_config)
@@ -886,7 +886,7 @@ if test "x$found_LIBMD" != "xyes"; then
 fi
 
 case "$host_os" in
-  *mingw* | *cygwin*)
+  *mingw* | *cygwin* | *msys*)
 	CRYPTO_CHECK_WIN(MD5, CALG_MD5)
 	CRYPTO_CHECK_WIN(SHA1, CALG_SHA1)
 	CRYPTO_CHECK_WIN(SHA256, CALG_SHA_256)

Modified: vendor/libarchive/dist/cpio/cpio.c
==============================================================================
--- vendor/libarchive/dist/cpio/cpio.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/cpio/cpio.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -1324,10 +1324,9 @@ lookup_name(struct cpio *cpio, struct na
 
 
 	if (*name_cache_variable == NULL) {
-		*name_cache_variable = malloc(sizeof(struct name_cache));
+		*name_cache_variable = calloc(1, sizeof(struct name_cache));
 		if (*name_cache_variable == NULL)
 			lafe_errc(1, ENOMEM, "No more memory");
-		memset(*name_cache_variable, 0, sizeof(struct name_cache));
 		(*name_cache_variable)->size = name_cache_size;
 	}
 

Modified: vendor/libarchive/dist/cpio/test/test_option_lz4.c
==============================================================================
--- vendor/libarchive/dist/cpio/test/test_option_lz4.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/cpio/test/test_option_lz4.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -63,6 +63,13 @@ DEFINE_TEST(test_option_lz4)
 			    "but no such program is available on this system.");
 			return;
 		}
+		/* On some systems the error won't be detected until closing
+		   time, by a 127 exit error returned by waitpid. */
+		if (strstr(p, "Error closing") != NULL && !canLz4()) {
+			skipping("This version of bsdcpio uses an external lz4 program "
+			    "but no such program is available on this system.");
+			return;
+		}
 		failure("--lz4 option is broken: %s", p);
 		assertEqualInt(r, 0);
 		return;

Modified: vendor/libarchive/dist/libarchive/CMakeLists.txt
==============================================================================
--- vendor/libarchive/dist/libarchive/CMakeLists.txt	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/CMakeLists.txt	Thu Dec 15 15:35:53 2016	(r310115)
@@ -38,6 +38,8 @@ SET(libarchive_SOURCES
   archive_hmac.c
   archive_hmac_private.h
   archive_match.c
+  archive_openssl_evp_private.h
+  archive_openssl_hmac_private.h
   archive_options.c
   archive_options_private.h
   archive_pack_dev.h

Modified: vendor/libarchive/dist/libarchive/archive.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive.h	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive.h	Thu Dec 15 15:35:53 2016	(r310115)
@@ -373,7 +373,7 @@ typedef const char *archive_passphrase_c
  *   4) Repeatedly call archive_read_next_header to get information about
  *      successive archive entries.  Call archive_read_data to extract
  *      data for entries of interest.
- *   5) Call archive_read_finish to end processing.
+ *   5) Call archive_read_free to end processing.
  */
 __LA_DECL struct archive	*archive_read_new(void);
 

Modified: vendor/libarchive/dist/libarchive/archive_acl.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_acl.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_acl.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -280,11 +280,17 @@ acl_new_entry(struct archive_acl *acl,
 		acl->acl_text = NULL;
 	}
 
-	/* If there's a matching entry already in the list, overwrite it. */
+	/*
+	 * If there's a matching entry already in the list, overwrite it.
+	 * NFSv4 entries may be repeated and are not overwritten.
+	 *
+	 * TODO: compare names of no id is provided (needs more rework)
+	 */
 	ap = acl->acl_head;
 	aq = NULL;
 	while (ap != NULL) {
-		if (ap->type == type && ap->tag == tag && ap->id == id) {
+		if (((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) &&
+		    ap->type == type && ap->tag == tag && ap->id == id) {
 			if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER &&
 			    tag != ARCHIVE_ENTRY_ACL_GROUP)) {
 				ap->permset = permset;
@@ -296,10 +302,9 @@ acl_new_entry(struct archive_acl *acl,
 	}
 
 	/* Add a new entry to the end of the list. */
-	ap = (struct archive_acl_entry *)malloc(sizeof(*ap));
+	ap = (struct archive_acl_entry *)calloc(1, sizeof(*ap));
 	if (ap == NULL)
 		return (NULL);
-	memset(ap, 0, sizeof(*ap));
 	if (aq == NULL)
 		acl->acl_head = ap;
 	else

Modified: vendor/libarchive/dist/libarchive/archive_cryptor.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_cryptor.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_cryptor.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -302,6 +302,8 @@ aes_ctr_release(archive_crypto_ctx *ctx)
 static int
 aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *key, size_t key_len)
 {
+	if ((ctx->ctx = EVP_CIPHER_CTX_new()) == NULL)
+		return -1;
 
 	switch (key_len) {
 	case 16: ctx->type = EVP_aes_128_ecb(); break;
@@ -314,7 +316,7 @@ aes_ctr_init(archive_crypto_ctx *ctx, co
 	memcpy(ctx->key, key, key_len);
 	memset(ctx->nonce, 0, sizeof(ctx->nonce));
 	ctx->encr_pos = AES_BLOCK_SIZE;
-	EVP_CIPHER_CTX_init(&ctx->ctx);
+	EVP_CIPHER_CTX_init(ctx->ctx);
 	return 0;
 }
 
@@ -324,10 +326,10 @@ aes_ctr_encrypt_counter(archive_crypto_c
 	int outl = 0;
 	int r;
 
-	r = EVP_EncryptInit_ex(&ctx->ctx, ctx->type, NULL, ctx->key, NULL);
+	r = EVP_EncryptInit_ex(ctx->ctx, ctx->type, NULL, ctx->key, NULL);
 	if (r == 0)
 		return -1;
-	r = EVP_EncryptUpdate(&ctx->ctx, ctx->encr_buf, &outl, ctx->nonce,
+	r = EVP_EncryptUpdate(ctx->ctx, ctx->encr_buf, &outl, ctx->nonce,
 	    AES_BLOCK_SIZE);
 	if (r == 0 || outl != AES_BLOCK_SIZE)
 		return -1;
@@ -337,7 +339,7 @@ aes_ctr_encrypt_counter(archive_crypto_c
 static int
 aes_ctr_release(archive_crypto_ctx *ctx)
 {
-	EVP_CIPHER_CTX_cleanup(&ctx->ctx);
+	EVP_CIPHER_CTX_free(ctx->ctx);
 	memset(ctx->key, 0, ctx->key_len);
 	memset(ctx->nonce, 0, sizeof(ctx->nonce));
 	return 0;

Modified: vendor/libarchive/dist/libarchive/archive_cryptor_private.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_cryptor_private.h	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_cryptor_private.h	Thu Dec 15 15:35:53 2016	(r310115)
@@ -99,12 +99,12 @@ typedef struct {
 } archive_crypto_ctx;
 
 #elif defined(HAVE_LIBCRYPTO)
-#include <openssl/evp.h>
+#include "archive_openssl_evp_private.h"
 #define AES_BLOCK_SIZE	16
 #define AES_MAX_KEY_SIZE 32
 
 typedef struct {
-	EVP_CIPHER_CTX	ctx;
+	EVP_CIPHER_CTX	*ctx;
 	const EVP_CIPHER *type;
 	uint8_t		key[AES_MAX_KEY_SIZE];
 	unsigned	key_len;

Modified: vendor/libarchive/dist/libarchive/archive_digest.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_digest.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_digest.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -207,7 +207,9 @@ __archive_nettle_md5final(archive_md5_ct
 static int
 __archive_openssl_md5init(archive_md5_ctx *ctx)
 {
-  EVP_DigestInit(ctx, EVP_md5());
+  if ((*ctx = EVP_MD_CTX_new()) == NULL)
+	return (ARCHIVE_FAILED);
+  EVP_DigestInit(*ctx, EVP_md5());
   return (ARCHIVE_OK);
 }
 
@@ -215,7 +217,7 @@ static int
 __archive_openssl_md5update(archive_md5_ctx *ctx, const void *indata,
     size_t insize)
 {
-  EVP_DigestUpdate(ctx, indata, insize);
+  EVP_DigestUpdate(*ctx, indata, insize);
   return (ARCHIVE_OK);
 }
 
@@ -226,8 +228,11 @@ __archive_openssl_md5final(archive_md5_c
    * this is meant to cope with that. Real fix is probably to fix
    * archive_write_set_format_xar.c
    */
-  if (ctx->digest)
-    EVP_DigestFinal(ctx, md, NULL);
+  if (*ctx) {
+    EVP_DigestFinal(*ctx, md, NULL);
+    EVP_MD_CTX_free(*ctx);
+    *ctx = NULL;
+  }
   return (ARCHIVE_OK);
 }
 
@@ -359,7 +364,9 @@ __archive_nettle_ripemd160final(archive_
 static int
 __archive_openssl_ripemd160init(archive_rmd160_ctx *ctx)
 {
-  EVP_DigestInit(ctx, EVP_ripemd160());
+  if ((*ctx = EVP_MD_CTX_new()) == NULL)
+	return (ARCHIVE_FAILED);
+  EVP_DigestInit(*ctx, EVP_ripemd160());
   return (ARCHIVE_OK);
 }
 
@@ -367,14 +374,18 @@ static int
 __archive_openssl_ripemd160update(archive_rmd160_ctx *ctx, const void *indata,
     size_t insize)
 {
-  EVP_DigestUpdate(ctx, indata, insize);
+  EVP_DigestUpdate(*ctx, indata, insize);
   return (ARCHIVE_OK);
 }
 
 static int
 __archive_openssl_ripemd160final(archive_rmd160_ctx *ctx, void *md)
 {
-  EVP_DigestFinal(ctx, md, NULL);
+  if (*ctx) {
+    EVP_DigestFinal(*ctx, md, NULL);
+    EVP_MD_CTX_free(*ctx);
+    *ctx = NULL;
+  }
   return (ARCHIVE_OK);
 }
 
@@ -509,7 +520,9 @@ __archive_nettle_sha1final(archive_sha1_
 static int
 __archive_openssl_sha1init(archive_sha1_ctx *ctx)
 {
-  EVP_DigestInit(ctx, EVP_sha1());
+  if ((*ctx = EVP_MD_CTX_new()) == NULL)
+	return (ARCHIVE_FAILED);
+  EVP_DigestInit(*ctx, EVP_sha1());
   return (ARCHIVE_OK);
 }
 
@@ -517,7 +530,7 @@ static int
 __archive_openssl_sha1update(archive_sha1_ctx *ctx, const void *indata,
     size_t insize)
 {
-  EVP_DigestUpdate(ctx, indata, insize);
+  EVP_DigestUpdate(*ctx, indata, insize);
   return (ARCHIVE_OK);
 }
 
@@ -528,8 +541,11 @@ __archive_openssl_sha1final(archive_sha1
    * this is meant to cope with that. Real fix is probably to fix
    * archive_write_set_format_xar.c
    */
-  if (ctx->digest)
-    EVP_DigestFinal(ctx, md, NULL);
+  if (*ctx) {
+    EVP_DigestFinal(*ctx, md, NULL);
+    EVP_MD_CTX_free(*ctx);
+    *ctx = NULL;
+  }
   return (ARCHIVE_OK);
 }
 
@@ -733,7 +749,9 @@ __archive_nettle_sha256final(archive_sha
 static int
 __archive_openssl_sha256init(archive_sha256_ctx *ctx)
 {
-  EVP_DigestInit(ctx, EVP_sha256());
+  if ((*ctx = EVP_MD_CTX_new()) == NULL)
+	return (ARCHIVE_FAILED);
+  EVP_DigestInit(*ctx, EVP_sha256());
   return (ARCHIVE_OK);
 }
 
@@ -741,14 +759,18 @@ static int
 __archive_openssl_sha256update(archive_sha256_ctx *ctx, const void *indata,
     size_t insize)
 {
-  EVP_DigestUpdate(ctx, indata, insize);
+  EVP_DigestUpdate(*ctx, indata, insize);
   return (ARCHIVE_OK);
 }
 
 static int
 __archive_openssl_sha256final(archive_sha256_ctx *ctx, void *md)
 {
-  EVP_DigestFinal(ctx, md, NULL);
+  if (*ctx) {
+    EVP_DigestFinal(*ctx, md, NULL);
+    EVP_MD_CTX_free(*ctx);
+    *ctx = NULL;
+  }
   return (ARCHIVE_OK);
 }
 
@@ -928,7 +950,9 @@ __archive_nettle_sha384final(archive_sha
 static int
 __archive_openssl_sha384init(archive_sha384_ctx *ctx)
 {
-  EVP_DigestInit(ctx, EVP_sha384());
+  if ((*ctx = EVP_MD_CTX_new()) == NULL)
+	return (ARCHIVE_FAILED);
+  EVP_DigestInit(*ctx, EVP_sha384());
   return (ARCHIVE_OK);
 }
 
@@ -936,14 +960,18 @@ static int
 __archive_openssl_sha384update(archive_sha384_ctx *ctx, const void *indata,
     size_t insize)
 {
-  EVP_DigestUpdate(ctx, indata, insize);
+  EVP_DigestUpdate(*ctx, indata, insize);
   return (ARCHIVE_OK);
 }
 
 static int
 __archive_openssl_sha384final(archive_sha384_ctx *ctx, void *md)
 {
-  EVP_DigestFinal(ctx, md, NULL);
+  if (*ctx) {
+    EVP_DigestFinal(*ctx, md, NULL);
+    EVP_MD_CTX_free(*ctx);
+    *ctx = NULL;
+  }
   return (ARCHIVE_OK);
 }
 
@@ -1147,7 +1175,9 @@ __archive_nettle_sha512final(archive_sha
 static int
 __archive_openssl_sha512init(archive_sha512_ctx *ctx)
 {
-  EVP_DigestInit(ctx, EVP_sha512());
+  if ((*ctx = EVP_MD_CTX_new()) == NULL)
+	return (ARCHIVE_FAILED);
+  EVP_DigestInit(*ctx, EVP_sha512());
   return (ARCHIVE_OK);
 }
 
@@ -1155,14 +1185,18 @@ static int
 __archive_openssl_sha512update(archive_sha512_ctx *ctx, const void *indata,
     size_t insize)
 {
-  EVP_DigestUpdate(ctx, indata, insize);
+  EVP_DigestUpdate(*ctx, indata, insize);
   return (ARCHIVE_OK);
 }
 
 static int
 __archive_openssl_sha512final(archive_sha512_ctx *ctx, void *md)
 {
-  EVP_DigestFinal(ctx, md, NULL);
+  if (*ctx) {
+    EVP_DigestFinal(*ctx, md, NULL);
+    EVP_MD_CTX_free(*ctx);
+    *ctx = NULL;
+  }
   return (ARCHIVE_OK);
 }
 

Modified: vendor/libarchive/dist/libarchive/archive_digest_private.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_digest_private.h	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_digest_private.h	Thu Dec 15 15:35:53 2016	(r310115)
@@ -134,7 +134,7 @@
   defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) ||\
   defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
 #define	ARCHIVE_CRYPTO_OPENSSL 1
-#include <openssl/evp.h>
+#include "archive_openssl_evp_private.h"
 #endif
 
 /* Windows crypto headers */
@@ -161,7 +161,7 @@ typedef CC_MD5_CTX archive_md5_ctx;
 #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE)
 typedef struct md5_ctx archive_md5_ctx;
 #elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL)
-typedef EVP_MD_CTX archive_md5_ctx;
+typedef EVP_MD_CTX *archive_md5_ctx;
 #elif defined(ARCHIVE_CRYPTO_MD5_WIN)
 typedef Digest_CTX archive_md5_ctx;
 #else
@@ -175,7 +175,7 @@ typedef RIPEMD160_CTX archive_rmd160_ctx
 #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE)
 typedef struct ripemd160_ctx archive_rmd160_ctx;
 #elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL)
-typedef EVP_MD_CTX archive_rmd160_ctx;
+typedef EVP_MD_CTX *archive_rmd160_ctx;
 #else
 typedef unsigned char archive_rmd160_ctx;
 #endif
@@ -189,7 +189,7 @@ typedef CC_SHA1_CTX archive_sha1_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE)
 typedef struct sha1_ctx archive_sha1_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL)
-typedef EVP_MD_CTX archive_sha1_ctx;
+typedef EVP_MD_CTX *archive_sha1_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA1_WIN)
 typedef Digest_CTX archive_sha1_ctx;
 #else
@@ -209,7 +209,7 @@ typedef CC_SHA256_CTX archive_sha256_ctx
 #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE)
 typedef struct sha256_ctx archive_sha256_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL)
-typedef EVP_MD_CTX archive_sha256_ctx;
+typedef EVP_MD_CTX *archive_sha256_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA256_WIN)
 typedef Digest_CTX archive_sha256_ctx;
 #else
@@ -227,7 +227,7 @@ typedef CC_SHA512_CTX archive_sha384_ctx
 #elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE)
 typedef struct sha384_ctx archive_sha384_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA384_OPENSSL)
-typedef EVP_MD_CTX archive_sha384_ctx;
+typedef EVP_MD_CTX *archive_sha384_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA384_WIN)
 typedef Digest_CTX archive_sha384_ctx;
 #else
@@ -247,7 +247,7 @@ typedef CC_SHA512_CTX archive_sha512_ctx
 #elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE)
 typedef struct sha512_ctx archive_sha512_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
-typedef EVP_MD_CTX archive_sha512_ctx;
+typedef EVP_MD_CTX *archive_sha512_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA512_WIN)
 typedef Digest_CTX archive_sha512_ctx;
 #else

Modified: vendor/libarchive/dist/libarchive/archive_entry.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_entry.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_entry.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -248,10 +248,9 @@ archive_entry_new2(struct archive *a)
 {
 	struct archive_entry *entry;
 
-	entry = (struct archive_entry *)malloc(sizeof(*entry));
+	entry = (struct archive_entry *)calloc(1, sizeof(*entry));
 	if (entry == NULL)
 		return (NULL);
-	memset(entry, 0, sizeof(*entry));
 	entry->archive = a;
 	return (entry);
 }

Modified: vendor/libarchive/dist/libarchive/archive_hmac.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_hmac.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_hmac.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -176,8 +176,10 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ct
 static int
 __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len)
 {
-	HMAC_CTX_init(ctx);
-	HMAC_Init(ctx, key, key_len, EVP_sha1());
+	*ctx = HMAC_CTX_new();
+	if (*ctx == NULL)
+		return -1;
+	HMAC_Init_ex(*ctx, key, key_len, EVP_sha1(), NULL);
 	return 0;
 }
 
@@ -185,22 +187,22 @@ static void
 __hmac_sha1_update(archive_hmac_sha1_ctx *ctx, const uint8_t *data,
     size_t data_len)
 {
-	HMAC_Update(ctx, data, data_len);
+	HMAC_Update(*ctx, data, data_len);
 }
 
 static void
 __hmac_sha1_final(archive_hmac_sha1_ctx *ctx, uint8_t *out, size_t *out_len)
 {
 	unsigned int len = (unsigned int)*out_len;
-	HMAC_Final(ctx, out, &len);
+	HMAC_Final(*ctx, out, &len);
 	*out_len = len;
 }
 
 static void
 __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx)
 {
-	HMAC_CTX_cleanup(ctx);
-	memset(ctx, 0, sizeof(*ctx));
+	HMAC_CTX_free(*ctx);
+	*ctx = NULL;
 }
 
 #else

Modified: vendor/libarchive/dist/libarchive/archive_hmac_private.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_hmac_private.h	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_hmac_private.h	Thu Dec 15 15:35:53 2016	(r310115)
@@ -70,9 +70,9 @@ typedef struct {
 typedef	struct hmac_sha1_ctx archive_hmac_sha1_ctx;
 
 #elif defined(HAVE_LIBCRYPTO)
-#include <openssl/hmac.h>
+#include "archive_openssl_hmac_private.h"
 
-typedef	HMAC_CTX archive_hmac_sha1_ctx;
+typedef	HMAC_CTX* archive_hmac_sha1_ctx;
 
 #else
 

Modified: vendor/libarchive/dist/libarchive/archive_options.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_options.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_options.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -26,6 +26,10 @@
 #include "archive_platform.h"
 __FBSDID("$FreeBSD$");
 
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
 #include "archive_options_private.h"
 
 static const char *
@@ -105,8 +109,11 @@ _archive_set_options(struct archive *a, 
 	if (options == NULL || options[0] == '\0')
 		return ARCHIVE_OK;
 
-	data = (char *)malloc(strlen(options) + 1);
-	strcpy(data, options);
+	if ((data = strdup(options)) == NULL) {
+		archive_set_error(a,
+		    ENOMEM, "Out of memory adding file to list");
+		return (ARCHIVE_FATAL);
+	}
 	s = (const char *)data;
 
 	do {

Modified: vendor/libarchive/dist/libarchive/archive_read.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_read.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/
 
 static int	choose_filters(struct archive_read *);
 static int	choose_format(struct archive_read *);
+static int	close_filters(struct archive_read *);
 static struct archive_vtable *archive_read_vtable(void);
 static int64_t	_archive_filter_bytes(struct archive *, int);
 static int	_archive_filter_code(struct archive *, int);
@@ -528,7 +529,7 @@ archive_read_open1(struct archive *_a)
 	{
 		slot = choose_format(a);
 		if (slot < 0) {
-			__archive_read_close_filters(a);
+			close_filters(a);
 			a->archive.state = ARCHIVE_STATE_FATAL;
 			return (ARCHIVE_FATAL);
 		}
@@ -582,7 +583,6 @@ choose_filters(struct archive_read *a)
 			/* Verify the filter by asking it for some data. */
 			__archive_read_filter_ahead(a->filter, 1, &avail);
 			if (avail < 0) {
-				__archive_read_close_filters(a);
 				__archive_read_free_filters(a);
 				return (ARCHIVE_FATAL);
 			}
@@ -601,7 +601,6 @@ choose_filters(struct archive_read *a)
 		a->filter = filter;
 		r = (best_bidder->init)(a->filter);
 		if (r != ARCHIVE_OK) {
-			__archive_read_close_filters(a);
 			__archive_read_free_filters(a);
 			return (ARCHIVE_FATAL);
 		}
@@ -986,8 +985,8 @@ _archive_read_data_block(struct archive 
 	return (a->format->read_data)(a, buff, size, offset);
 }
 
-int
-__archive_read_close_filters(struct archive_read *a)
+static int
+close_filters(struct archive_read *a)
 {
 	struct archive_read_filter *f = a->filter;
 	int r = ARCHIVE_OK;
@@ -1010,6 +1009,9 @@ __archive_read_close_filters(struct arch
 void
 __archive_read_free_filters(struct archive_read *a)
 {
+	/* Make sure filters are closed and their buffers are freed */
+	close_filters(a);
+
 	while (a->filter != NULL) {
 		struct archive_read_filter *t = a->filter->upstream;
 		free(a->filter);
@@ -1052,7 +1054,7 @@ _archive_read_close(struct archive *_a)
 	/* TODO: Clean up the formatters. */
 
 	/* Release the filter objects. */
-	r1 = __archive_read_close_filters(a);
+	r1 = close_filters(a);
 	if (r1 < r)
 		r = r1;
 

Modified: vendor/libarchive/dist/libarchive/archive_read_append_filter.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_append_filter.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_read_append_filter.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -133,7 +133,6 @@ archive_read_append_filter(struct archiv
     a->filter = filter;
     r2 = (bidder->init)(a->filter);
     if (r2 != ARCHIVE_OK) {
-      __archive_read_close_filters(a);
       __archive_read_free_filters(a);
       return (ARCHIVE_FATAL);
     }
@@ -191,7 +190,6 @@ archive_read_append_filter_program_signa
   a->filter = filter;
   r = (bidder->init)(a->filter);
   if (r != ARCHIVE_OK) {
-    __archive_read_close_filters(a);
     __archive_read_free_filters(a);
     return (ARCHIVE_FATAL);
   }

Modified: vendor/libarchive/dist/libarchive/archive_read_disk_posix.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_disk_posix.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_read_disk_posix.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -244,7 +244,7 @@ struct tree {
 	int			 initial_filesystem_id;
 	int			 current_filesystem_id;
 	int			 max_filesystem_id;
-	int			 allocated_filesytem;
+	int			 allocated_filesystem;
 
 	int			 entry_fd;
 	int			 entry_eof;
@@ -1382,7 +1382,7 @@ update_current_filesystem(struct archive
 
 	for (i = 0; i < t->max_filesystem_id; i++) {
 		if (t->filesystem_table[i].dev == dev) {
-			/* There is the filesytem ID we've already generated. */
+			/* There is the filesystem ID we've already generated. */
 			t->current_filesystem_id = i;
 			t->current_filesystem = &(t->filesystem_table[i]);
 			return (ARCHIVE_OK);
@@ -1390,10 +1390,10 @@ update_current_filesystem(struct archive
 	}
 
 	/*
-	 * This is the new filesytem which we have to generate a new ID for.
+	 * This is the new filesystem which we have to generate a new ID for.
 	 */
 	fid = t->max_filesystem_id++;
-	if (t->max_filesystem_id > t->allocated_filesytem) {
+	if (t->max_filesystem_id > t->allocated_filesystem) {
 		size_t s;
 		void *p;
 
@@ -1406,7 +1406,7 @@ update_current_filesystem(struct archive
 			return (ARCHIVE_FATAL);
 		}
 		t->filesystem_table = (struct filesystem *)p;
-		t->allocated_filesytem = s;
+		t->allocated_filesystem = s;
 	}
 	t->current_filesystem_id = fid;
 	t->current_filesystem = &(t->filesystem_table[fid]);
@@ -2063,8 +2063,7 @@ tree_push(struct tree *t, const char *pa
 {
 	struct tree_entry *te;
 
-	te = malloc(sizeof(*te));
-	memset(te, 0, sizeof(*te));
+	te = calloc(1, sizeof(*te));
 	te->next = t->stack;
 	te->parent = t->current;
 	if (te->parent)
@@ -2122,9 +2121,8 @@ tree_open(const char *path, int symlink_
 {
 	struct tree *t;
 
-	if ((t = malloc(sizeof(*t))) == NULL)
+	if ((t = calloc(1, sizeof(*t))) == NULL)
 		return (NULL);
-	memset(t, 0, sizeof(*t));
 	archive_string_init(&t->path);
 	archive_string_ensure(&t->path, 31);
 	t->initial_symlink_mode = symlink_mode;

Modified: vendor/libarchive/dist/libarchive/archive_read_disk_windows.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_disk_windows.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_read_disk_windows.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -168,7 +168,7 @@ struct tree {
 	int			 initial_filesystem_id;
 	int			 current_filesystem_id;
 	int			 max_filesystem_id;
-	int			 allocated_filesytem;
+	int			 allocated_filesystem;
 
 	HANDLE			 entry_fh;
 	int			 entry_eof;
@@ -389,10 +389,9 @@ archive_read_disk_new(void)
 {
 	struct archive_read_disk *a;
 
-	a = (struct archive_read_disk *)malloc(sizeof(*a));
+	a = (struct archive_read_disk *)calloc(1, sizeof(*a));
 	if (a == NULL)
 		return (NULL);
-	memset(a, 0, sizeof(*a));
 	a->archive.magic = ARCHIVE_READ_DISK_MAGIC;
 	a->archive.state = ARCHIVE_STATE_NEW;
 	a->archive.vtable = archive_read_disk_vtable();
@@ -1261,7 +1260,7 @@ update_current_filesystem(struct archive
 
 	for (i = 0; i < t->max_filesystem_id; i++) {
 		if (t->filesystem_table[i].dev == dev) {
-			/* There is the filesytem ID we've already generated. */
+			/* There is the filesystem ID we've already generated. */
 			t->current_filesystem_id = i;
 			t->current_filesystem = &(t->filesystem_table[i]);
 			return (ARCHIVE_OK);
@@ -1269,10 +1268,10 @@ update_current_filesystem(struct archive
 	}
 
 	/*
-	 * There is a new filesytem, we generate a new ID for.
+	 * There is a new filesystem, we generate a new ID for.
 	 */
 	fid = t->max_filesystem_id++;
-	if (t->max_filesystem_id > t->allocated_filesytem) {
+	if (t->max_filesystem_id > t->allocated_filesystem) {
 		size_t s;
 		void *p;
 
@@ -1285,7 +1284,7 @@ update_current_filesystem(struct archive
 			return (ARCHIVE_FATAL);
 		}
 		t->filesystem_table = (struct filesystem *)p;
-		t->allocated_filesytem = (int)s;
+		t->allocated_filesystem = (int)s;
 	}
 	t->current_filesystem_id = fid;
 	t->current_filesystem = &(t->filesystem_table[fid]);
@@ -1437,8 +1436,7 @@ tree_push(struct tree *t, const wchar_t 
 {
 	struct tree_entry *te;
 
-	te = malloc(sizeof(*te));
-	memset(te, 0, sizeof(*te));
+	te = calloc(1, sizeof(*te));
 	te->next = t->stack;
 	te->parent = t->current;
 	if (te->parent)
@@ -1507,8 +1505,7 @@ tree_open(const wchar_t *path, int symli
 {
 	struct tree *t;
 
-	t = malloc(sizeof(*t));
-	memset(t, 0, sizeof(*t));
+	t = calloc(1, sizeof(*t));
 	archive_string_init(&(t->full_path));
 	archive_string_init(&t->path);
 	archive_wstring_ensure(&t->path, 15);

Modified: vendor/libarchive/dist/libarchive/archive_read_extract2.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_extract2.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_read_extract2.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -52,12 +52,11 @@ struct archive_read_extract *
 __archive_read_get_extract(struct archive_read *a)
 {
 	if (a->extract == NULL) {
-		a->extract = (struct archive_read_extract *)malloc(sizeof(*a->extract));
+		a->extract = (struct archive_read_extract *)calloc(1, sizeof(*a->extract));
 		if (a->extract == NULL) {
 			archive_set_error(&a->archive, ENOMEM, "Can't extract");
 			return (NULL);
 		}
-		memset(a->extract, 0, sizeof(*a->extract));
 		a->cleanup_archive_extract = archive_read_extract_cleanup;
 	}
 	return (a->extract);

Modified: vendor/libarchive/dist/libarchive/archive_read_open_memory.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_open_memory.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_read_open_memory.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -70,12 +70,11 @@ archive_read_open_memory2(struct archive
 {
 	struct read_memory_data *mine;
 
-	mine = (struct read_memory_data *)malloc(sizeof(*mine));
+	mine = (struct read_memory_data *)calloc(1, sizeof(*mine));
 	if (mine == NULL) {
 		archive_set_error(a, ENOMEM, "No memory");
 		return (ARCHIVE_FATAL);
 	}
-	memset(mine, 0, sizeof(*mine));
 	mine->start = mine->p = (const unsigned char *)buff;
 	mine->end = mine->start + size;
 	mine->read_size = read_size;

Modified: vendor/libarchive/dist/libarchive/archive_read_private.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_private.h	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_read_private.h	Thu Dec 15 15:35:53 2016	(r310115)
@@ -252,7 +252,6 @@ int64_t	__archive_read_consume(struct ar
 int64_t	__archive_read_filter_consume(struct archive_read_filter *, int64_t);
 int __archive_read_program(struct archive_read_filter *, const char *);
 void __archive_read_free_filters(struct archive_read *);
-int  __archive_read_close_filters(struct archive_read *);
 struct archive_read_extract *__archive_read_get_extract(struct archive_read *);
 
 

Modified: vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -320,30 +320,14 @@ uudecode_bidder_bid(struct archive_read_
 		if (l > 45)
 			/* Normally, maximum length is 45(character 'M'). */
 			return (0);
-		while (l && len-nl > 0) {
-			if (l > 0) {
-				if (!uuchar[*b++])
-					return (0);
-				if (!uuchar[*b++])
-					return (0);
-				len -= 2;
-				--l;
-			}
-			if (l > 0) {
-				if (!uuchar[*b++])
-					return (0);
-				--len;
-				--l;
-			}
-			if (l > 0) {
-				if (!uuchar[*b++])
-					return (0);
-				--len;
-				--l;
-			}
+		if (l > len - nl)
+			return (0); /* Line too short. */
+		while (l) {
+			if (!uuchar[*b++])
+				return (0);
+			--len;
+			--l;
 		}
-		if (len-nl < 0)
-			return (0);
 		if (len-nl == 1 &&
 		    (uuchar[*b] ||		 /* Check sum. */
 		     (*b >= 'a' && *b <= 'z'))) {/* Padding data(MINIX). */

Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -213,7 +213,7 @@ struct _7zip {
 	int			 header_is_encoded;
 	uint64_t		 header_bytes_remaining;
 	unsigned long		 header_crc32;
-	/* Header offset to check that reading pointes of the file contens
+	/* Header offset to check that reading points of the file contents
 	 * will not exceed the header. */
 	uint64_t		 header_offset;
 	/* Base offset of the archive file for a seek in case reading SFX. */

Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_ar.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_support_format_ar.c	Thu Dec 15 15:14:02 2016	(r310114)
+++ vendor/libarchive/dist/libarchive/archive_read_support_format_ar.c	Thu Dec 15 15:35:53 2016	(r310115)
@@ -104,13 +104,12 @@ archive_read_support_format_ar(struct ar
 	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
 	    ARCHIVE_STATE_NEW, "archive_read_support_format_ar");
 
-	ar = (struct ar *)malloc(sizeof(*ar));

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

From owner-svn-src-all@freebsd.org  Thu Dec 15 15:45:12 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9278EC77D6C;
 Thu, 15 Dec 2016 15:45:12 +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 5F8085E3;
 Thu, 15 Dec 2016 15:45:12 +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 uBFFjBHF070680;
 Thu, 15 Dec 2016 15:45:11 GMT (envelope-from ed@FreeBSD.org)
Received: (from ed@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFFjBEL070679;
 Thu, 15 Dec 2016 15:45:11 GMT (envelope-from ed@FreeBSD.org)
Message-Id: <201612151545.uBFFjBEL070679@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org
 using -f
From: Ed Schouten <ed@FreeBSD.org>
Date: Thu, 15 Dec 2016 15:45:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310116 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 15:45:12 -0000

Author: ed
Date: Thu Dec 15 15:45:11 2016
New Revision: 310116
URL: https://svnweb.freebsd.org/changeset/base/310116

Log:
  Document the existence of the {0, 6, ...} sysctl.

Modified:
  head/sys/kern/kern_sysctl.c

Modified: head/sys/kern/kern_sysctl.c
==============================================================================
--- head/sys/kern/kern_sysctl.c	Thu Dec 15 15:35:53 2016	(r310115)
+++ head/sys/kern/kern_sysctl.c	Thu Dec 15 15:45:11 2016	(r310116)
@@ -821,7 +821,8 @@ SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FI
  * {0,2,...}	return the next OID.
  * {0,3}	return the OID of the name in "new"
  * {0,4,...}	return the kind & format info for the "..." OID.
- * {0,5,...}	return the description the "..." OID.
+ * {0,5,...}	return the description of the "..." OID.
+ * {0,6,...}	return the aggregation label of the "..." OID.
  */
 
 #ifdef SYSCTL_DEBUG

From owner-svn-src-all@freebsd.org  Thu Dec 15 15:52:15 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E85FC812DE;
 Thu, 15 Dec 2016 15:52:15 +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 32C40D2D;
 Thu, 15 Dec 2016 15:52:15 +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 uBFFqEpQ074653;
 Thu, 15 Dec 2016 15:52:14 GMT (envelope-from manu@FreeBSD.org)
Received: (from manu@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFFqDPk074641;
 Thu, 15 Dec 2016 15:52:13 GMT (envelope-from manu@FreeBSD.org)
Message-Id: <201612151552.uBFFqDPk074641@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: manu set sender to
 manu@FreeBSD.org using -f
From: Emmanuel Vadot <manu@FreeBSD.org>
Date: Thu, 15 Dec 2016 15:52:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310117 - in head/sys/arm/allwinner: . a10 a13 a20 a31
 a64 h3
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 15:52:15 -0000

Author: manu
Date: Thu Dec 15 15:52:13 2016
New Revision: 310117
URL: https://svnweb.freebsd.org/changeset/base/310117

Log:
  Add information about interrupts in the Allwinner padconf files and
  correct some pin numbering.
  
  While here switch to my freebsd mail address in the copyright.
  
  MFC after:	3 days

Modified:
  head/sys/arm/allwinner/a10/a10_padconf.c
  head/sys/arm/allwinner/a13/a13_padconf.c
  head/sys/arm/allwinner/a20/a20_padconf.c
  head/sys/arm/allwinner/a31/a31_padconf.c
  head/sys/arm/allwinner/a31/a31_r_padconf.c
  head/sys/arm/allwinner/a31/a31s_padconf.c
  head/sys/arm/allwinner/a64/a64_padconf.c
  head/sys/arm/allwinner/a64/a64_r_padconf.c
  head/sys/arm/allwinner/allwinner_pinctrl.h
  head/sys/arm/allwinner/h3/h3_padconf.c
  head/sys/arm/allwinner/h3/h3_r_padconf.c

Modified: head/sys/arm/allwinner/a10/a10_padconf.c
==============================================================================
--- head/sys/arm/allwinner/a10/a10_padconf.c	Thu Dec 15 15:45:11 2016	(r310116)
+++ head/sys/arm/allwinner/a10/a10_padconf.c	Thu Dec 15 15:52:13 2016	(r310117)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2016 Emmanuel Vadot <manu@bidouilliste.com>
+ * Copyright (c) 2016 Emmanuel Vadot <manu@freebsd.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -170,28 +170,28 @@ const static struct allwinner_pins a10_p
 	{"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}},
 	{"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}},
 
-	{"PH0",  7,  0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}},
-	{"PH1",  7,  1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}},
-	{"PH2",  7,  2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}},
-	{"PH3",  7,  3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}},
-	{"PH4",  7,  4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint", "csi1"}},
-	{"PH5",  7,  5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint", "csi1"}},
-	{"PH6",  7,  6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint", "csi1"}},
-	{"PH7",  7,  7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint", "csi1"}},
-	{"PH8",  7,  8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}},
-	{"PH9",  7,  9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}},
-	{"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}},
-	{"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}},
-	{"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, "eint", "csi1"}},
-	{"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", "eint", "csi1"}},
-	{"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}},
-	{"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}},
-	{"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, "eint", "csi1"}},
-	{"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}},
-	{"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}},
-	{"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}},
-	{"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint", "csi1"}},
-	{"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint", "csi1"}},
+	{"PH0",  7,  0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint0", "csi1"}, 6, 0},
+	{"PH1",  7,  1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint1", "csi1"}, 6, 1},
+	{"PH2",  7,  2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint2", "csi1"}, 6, 2},
+	{"PH3",  7,  3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint3", "csi1"}, 6, 3},
+	{"PH4",  7,  4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint4", "csi1"}, 6, 4},
+	{"PH5",  7,  5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint5", "csi1"}, 6, 5},
+	{"PH6",  7,  6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint6", "csi1"}, 6, 6},
+	{"PH7",  7,  7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint7", "csi1"}, 6, 7},
+	{"PH8",  7,  8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint8", "csi1"}, 6, 8},
+	{"PH9",  7,  9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint9", "csi1"}, 6, 9},
+	{"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint10", "csi1"}, 6, 10},
+	{"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint11", "csi1"}, 6, 11},
+	{"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, "eint12", "csi1"}, 6, 12},
+	{"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", "eint13", "csi1"}, 6, 13},
+	{"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint14", "csi1"}, 6, 14},
+	{"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint15", "csi1"}, 6, 15},
+	{"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, "eint16", "csi1"}, 6, 16},
+	{"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint17", "csi1"}, 6, 17},
+	{"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint18", "csi1"}, 6, 18},
+	{"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint19", "csi1"}, 6, 19},
+	{"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint20", "csi1"}, 6, 20},
+	{"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint21", "csi1"}, 6, 21},
 	{"PH22", 7, 22, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}},
 	{"PH23", 7, 23, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}},
 	{"PH24", 7, 24, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}},
@@ -209,16 +209,16 @@ const static struct allwinner_pins a10_p
 	{"PI7",  8,  7, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}},
 	{"PI8",  8,  8, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}},
 	{"PI9",  8,  9, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}},
-	{"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}},
-	{"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}},
-	{"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint", NULL}},
-	{"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint", NULL}},
-	{"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "eint", NULL}},
-	{"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "eint", NULL}},
-	{"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}},
-	{"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}},
-	{"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}},
-	{"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}},
+	{"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint22", NULL}, 6, 22},
+	{"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint23", NULL}, 6, 23},
+	{"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint24", NULL}, 6, 24},
+	{"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint25", NULL}, 6, 25},
+	{"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "eint26", NULL}, 6, 26},
+	{"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "eint27", NULL}, 6, 27},
+	{"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint28", NULL}, 6, 28},
+	{"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint29", NULL}, 6, 29},
+	{"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint30", NULL}, 6, 30},
+	{"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint31", NULL}, 6, 31},
 	{"PI20", 8, 20, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}},
 	{"PI21", 8, 21, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}},
 };

Modified: head/sys/arm/allwinner/a13/a13_padconf.c
==============================================================================
--- head/sys/arm/allwinner/a13/a13_padconf.c	Thu Dec 15 15:45:11 2016	(r310116)
+++ head/sys/arm/allwinner/a13/a13_padconf.c	Thu Dec 15 15:52:13 2016	(r310117)
@@ -40,10 +40,10 @@ __FBSDID("$FreeBSD$");
 const static struct allwinner_pins a13_pins[] = {
 	{"PB0",  1, 0,  {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}},
 	{"PB1",  1, 1,  {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}},
-	{"PB2",  1, 2,  {"gpio_in", "gpio_out", "pwm", NULL, NULL, "eint", NULL, NULL}},
-	{"PB3",  1, 3,  {"gpio_in", "gpio_out", "ir0", NULL, NULL, "eint", NULL, NULL}},
-	{"PB4",  1, 4,  {"gpio_in", "gpio_out", "ir0", NULL, NULL, "eint", NULL, NULL}},
-	{"PB10", 1, 10, {"gpio_in", "gpio_out", "spi2", NULL, NULL, "eint", NULL, NULL}},
+	{"PB2",  1, 2,  {"gpio_in", "gpio_out", "pwm", NULL, NULL, NULL, "eint16", NULL}, 6, 16},
+	{"PB3",  1, 3,  {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, "eint17", NULL}, 6, 17},
+	{"PB4",  1, 4,  {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, "eint18", NULL}, 6, 18},
+	{"PB10", 1, 10, {"gpio_in", "gpio_out", "spi2", NULL, NULL, NULL, "eint24", NULL}, 6, 24},
 	{"PB15", 1, 15, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}},
 	{"PB16", 1, 16, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}},
 	{"PB17", 1, 17, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}},
@@ -90,8 +90,8 @@ const static struct allwinner_pins a13_p
 	{"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}},
 	{"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}},
 
-	{"PE0",  4,  0, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, "eint", NULL}},
-	{"PE1",  4,  1, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, NULL, NULL}},
+	{"PE0",  4,  0, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, "eint14", NULL}, 6, 14},
+	{"PE1",  4,  1, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, "eint15", NULL}, 6, 15},
 	{"PE2",  4,  2, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, NULL, NULL}},
 	{"PE3",  4,  3, {"gpio_in", "gpio_out", NULL, "csi0", "spi2", NULL, NULL, NULL}},
 	{"PE4",  4,  4, {"gpio_in", "gpio_out", NULL, "csi0", "mmc2", NULL, NULL, NULL}},
@@ -110,15 +110,15 @@ const static struct allwinner_pins a13_p
 	{"PF4",  5,  4, {"gpio_in", "gpio_out", "mmc0", NULL, NULL, NULL, NULL, NULL}},
 	{"PF5",  5,  5, {"gpio_in", "gpio_out", "mmc0", NULL, NULL, NULL, NULL, NULL}},
 
-	{"PG0",  6,  0, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "eint", NULL}},
-	{"PG1",  6,  1, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "eint", NULL}},
-	{"PG2",  6,  2, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "eint", NULL}},
-	{"PG3",  6,  3, {"gpio_in", "gpio_out", "mmc1", NULL, "uart1", NULL, "eint", NULL}},
-	{"PG4",  6,  4, {"gpio_in", "gpio_out", "mmc1", NULL, "uart1", NULL, "eint", NULL}},
-	{"PG9",  6,  9, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint", NULL}},
-	{"PG10", 6, 10, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint", NULL}},
-	{"PG11", 6, 11, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint", NULL}},
-	{"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint", NULL}},
+	{"PG0",  6,  0, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "eint0", NULL}, 6, 0},
+	{"PG1",  6,  1, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "eint1", NULL}, 6, 1},
+	{"PG2",  6,  2, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "eint2", NULL}, 6, 2},
+	{"PG3",  6,  3, {"gpio_in", "gpio_out", "mmc1", NULL, "uart1", NULL, "eint3", NULL}, 6, 3},
+	{"PG4",  6,  4, {"gpio_in", "gpio_out", "mmc1", NULL, "uart1", NULL, "eint4", NULL}, 6, 4},
+	{"PG9",  6,  9, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint9", NULL}, 6, 9},
+	{"PG10", 6, 10, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint10", NULL}, 6, 10},
+	{"PG11", 6, 11, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint11", NULL}, 6, 11},
+	{"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint12", NULL}, 6, 12},
 };
 
 const struct allwinner_padconf a13_padconf = {

Modified: head/sys/arm/allwinner/a20/a20_padconf.c
==============================================================================
--- head/sys/arm/allwinner/a20/a20_padconf.c	Thu Dec 15 15:45:11 2016	(r310116)
+++ head/sys/arm/allwinner/a20/a20_padconf.c	Thu Dec 15 15:52:13 2016	(r310117)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2016 Emmanuel Vadot <manu@bidouilliste.com>
+ * Copyright (c) 2016 Emmanuel Vadot <manu@freebsd.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -101,10 +101,10 @@ const static struct allwinner_pins a20_p
 	{"PC16", 2, 16, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}},
 	{"PC17", 2, 17, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}},
 	{"PC18", 2, 18, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}},
-	{"PC19", 2, 19, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint", NULL}},
-	{"PC20", 2, 20, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint", NULL}},
-	{"PC21", 2, 21, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint", NULL}},
-	{"PC22", 2, 22, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint", NULL}},
+	{"PC19", 2, 19, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint12", NULL}, 6, 12},
+	{"PC20", 2, 20, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint13", NULL}, 6, 13},
+	{"PC21", 2, 21, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint14", NULL}, 6, 14},
+	{"PC22", 2, 22, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint15", NULL}, 6, 15},
 	{"PC23", 2, 23, {"gpio_in", "gpio_out", NULL, "spi0", NULL, NULL, NULL, NULL}},
 	{"PC24", 2, 24, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}},
 
@@ -170,28 +170,28 @@ const static struct allwinner_pins a20_p
 	{"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}},
 	{"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}},
 
-	{"PH0",  7, 0,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint", "csi1"}},
-	{"PH1",  7, 1,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint", "csi1"}},
-	{"PH2",  7, 2,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint", "csi1"}},
-	{"PH3",  7, 3,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint", "csi1"}},
-	{"PH4",  7, 4,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "eint", "csi1"}},
-	{"PH5",  7, 5,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "eint", "csi1"}},
-	{"PH6",  7, 6,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "eint", "csi1"}},
-	{"PH7",  7, 7,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "eint", "csi1"}},
-	{"PH8",  7, 8,  {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint", "csi1"}},
-	{"PH9",  7, 9,  {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint", "csi1"}},
-	{"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint", "csi1"}},
-	{"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint", "csi1"}},
-	{"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", NULL, "eint", "csi1"}},
-	{"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", "sim", "eint", "csi1"}},
-	{"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint", "csi1"}},
-	{"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint", "csi1"}},
-	{"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint", "csi1"}},
-	{"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint", "csi1"}},
-	{"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint", "csi1"}},
-	{"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint", "csi1"}},
-	{"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "eint", "csi1"}},
-	{"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "eint", "csi1"}},
+	{"PH0",  7, 0,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint0", "csi1"}, 6, 0},
+	{"PH1",  7, 1,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint1", "csi1"}, 6, 1},
+	{"PH2",  7, 2,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint2", "csi1"}, 6, 2},
+	{"PH3",  7, 3,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint3", "csi1"}, 6, 3},
+	{"PH4",  7, 4,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "eint4", "csi1"}, 6, 4},
+	{"PH5",  7, 5,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "eint5", "csi1"}, 6, 5},
+	{"PH6",  7, 6,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "eint6", "csi1"}, 6, 6},
+	{"PH7",  7, 7,  {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "eint7", "csi1"}, 6, 7},
+	{"PH8",  7, 8,  {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint8", "csi1"}, 6, 8},
+	{"PH9",  7, 9,  {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint9", "csi1"}, 6, 9},
+	{"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint10", "csi1"}, 6, 10},
+	{"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint11", "csi1"}, 6, 11},
+	{"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", NULL, "eint12", "csi1"}, 6, 12},
+	{"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", "sim", "eint13", "csi1"}, 6, 13},
+	{"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint14", "csi1"}, 6, 14},
+	{"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint15", "csi1"}, 6, 15},
+	{"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint16", "csi1"}, 6, 16},
+	{"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint17", "csi1"}, 6, 17},
+	{"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint18", "csi1"}, 6, 18},
+	{"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint19", "csi1"}, 6, 19},
+	{"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "eint20", "csi1"}, 6, 20},
+	{"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "eint21", "csi1"}, 6, 21},
 	{"PH22", 7, 22, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}},
 	{"PH23", 7, 23, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}},
 	{"PH24", 7, 24, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}},

Modified: head/sys/arm/allwinner/a31/a31_padconf.c
==============================================================================
--- head/sys/arm/allwinner/a31/a31_padconf.c	Thu Dec 15 15:45:11 2016	(r310116)
+++ head/sys/arm/allwinner/a31/a31_padconf.c	Thu Dec 15 15:52:13 2016	(r310117)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2016 Emmanuel Vadot <manu@bidouilliste.com>
+ * Copyright (c) 2016 Emmanuel Vadot <manu@freebsd.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -38,43 +38,43 @@ __FBSDID("$FreeBSD$");
 #ifdef SOC_ALLWINNER_A31
 
 const static struct allwinner_pins a31_pins[] = {
-	{"PA0",  0, 0,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}},
-	{"PA1",  0, 1,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}},
-	{"PA2",  0, 2,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}},
-	{"PA3",  0, 3,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}},
-	{"PA4",  0, 4,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}},
-	{"PA5",  0, 5,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}},
-	{"PA6",  0, 6,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}},
-	{"PA7",  0, 7,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, NULL, NULL}},
-	{"PA8",  0, 8,  {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, NULL, NULL}},
-	{"PA9",  0, 9,  {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, NULL, NULL}},
-	{"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", NULL, NULL}},
-	{"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", NULL, NULL}},
-	{"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", NULL, NULL}},
-	{"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", NULL, NULL}},
-	{"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", NULL, NULL}},
-	{"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_a", NULL, NULL, NULL}},
-	{"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, NULL, NULL}},
-	{"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, NULL, NULL}},
-	{"PA18", 0, 18, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_b", NULL, NULL, NULL}},
-	{"PA19", 0, 19, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, NULL, NULL}},
-	{"PA20", 0, 20, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, NULL, NULL}},
-	{"PA21", 0, 21, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, NULL, NULL}},
-	{"PA22", 0, 22, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, NULL, NULL}},
-	{"PA23", 0, 23, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, NULL, NULL}},
-	{"PA24", 0, 24, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, NULL, NULL}},
-	{"PA25", 0, 25, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, NULL, NULL}},
-	{"PA26", 0, 26, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_c", NULL, NULL, NULL}},
-	{"PA27", 0, 27, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, NULL, NULL}},
-
-	{"PB0",  1, 0,  {"gpio_in", "gpio_out", "i2s0", "uart3", "csi", NULL, NULL, NULL}},
-	{"PB1",  1, 1,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}},
-	{"PB2",  1, 2,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}},
-	{"PB3",  1, 3,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}},
-	{"PB4",  1, 4,  {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, NULL, NULL}},
-	{"PB5",  1, 5,  {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, NULL, NULL}},
-	{"PB6",  1, 6,  {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, NULL, NULL}},
-	{"PB7",  1, 7,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}},
+	{"PA0",  0, 0,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint0", NULL}, 6, 0},
+	{"PA1",  0, 1,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint1", NULL}, 6, 1},
+	{"PA2",  0, 2,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint2", NULL}, 6, 2},
+	{"PA3",  0, 3,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint3", NULL}, 6, 3},
+	{"PA4",  0, 4,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint4", NULL}, 6, 4},
+	{"PA5",  0, 5,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint5", NULL}, 6, 5},
+	{"PA6",  0, 6,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint6", NULL}, 6, 6},
+	{"PA7",  0, 7,  {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint7", NULL}, 6, 7},
+	{"PA8",  0, 8,  {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, "pa_eint8", NULL}, 6, 8},
+	{"PA9",  0, 9,  {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, "mmc2", "pa_eint9", NULL}, 6, 9},
+	{"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint10", NULL}, 6, 10},
+	{"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint11", NULL}, 6, 11},
+	{"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint12", NULL}, 6, 12},
+	{"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint13", NULL}, 6, 13},
+	{"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint14", NULL}, 6, 14},
+	{"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_a", NULL, "pa_eint15", NULL}, 6, 15},
+	{"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, "pa_eint16", NULL}, 6, 16},
+	{"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, "pa_eint17", NULL}, 6, 17},
+	{"PA18", 0, 18, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_b", NULL, "pa_eint18", NULL}, 6, 18},
+	{"PA19", 0, 19, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, "pa_eint19", NULL}, 6, 19},
+	{"PA20", 0, 20, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, "pa_eint20", NULL}, 6, 20},
+	{"PA21", 0, 21, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint21", NULL}, 6, 21},
+	{"PA22", 0, 22, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint22", NULL}, 6, 22},
+	{"PA23", 0, 23, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint23", NULL}, 6, 23},
+	{"PA24", 0, 24, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint24", NULL}, 6, 24},
+	{"PA25", 0, 25, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint25", NULL}, 6, 25},
+	{"PA26", 0, 26, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_c", NULL, "pa_eint26", NULL}, 6, 26},
+	{"PA27", 0, 27, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, "pa_eint27", NULL}, 6, 27},
+
+	{"PB0",  1, 0,  {"gpio_in", "gpio_out", "i2s0", "uart3", "csi", NULL, "pb_eint0", NULL}, 6, 0},
+	{"PB1",  1, 1,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint1", NULL}, 6, 1},
+	{"PB2",  1, 2,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint2", NULL}, 6, 2},
+	{"PB3",  1, 3,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint3", NULL}, 6, 3},
+	{"PB4",  1, 4,  {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, "pb_eint4", NULL}, 6, 4},
+	{"PB5",  1, 5,  {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint5", NULL}, 6, 5},
+	{"PB6",  1, 6,  {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint6", NULL}, 6, 6},
+	{"PB7",  1, 7,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint7", NULL}, 6, 7},
 
 	{"PC0",  2, 0,  {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}},
 	{"PC1",  2, 1,  {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}},
@@ -101,9 +101,9 @@ const static struct allwinner_pins a31_p
 	{"PC22", 2, 22, {"gpio_in", "gpio_out", "nand0", "nand1", NULL, NULL, NULL, NULL}},
 	{"PC23", 2, 23, {"gpio_in", "gpio_out", "nand0", "nand1", NULL, NULL, NULL, NULL}},
 	{"PC24", 2, 24, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}},
-	{"PC25", 2, 24, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}},
-	{"PC26", 2, 24, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}},
-	{"PC27", 2, 24, {"gpio_in", "gpio_out", NULL, "spi0",NULL, NULL, NULL, NULL}},
+	{"PC25", 2, 25, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}},
+	{"PC26", 2, 26, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}},
+	{"PC27", 2, 27, {"gpio_in", "gpio_out", NULL, "spi0",NULL, NULL, NULL, NULL}},
 
 	{"PD0",  3, 0,  {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}},
 	{"PD1",  3, 1,  {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}},
@@ -134,23 +134,23 @@ const static struct allwinner_pins a31_p
 	{"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}},
 	{"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}},
 
-	{"PE0",  4, 0,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE1",  4, 1,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE2",  4, 2,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE3",  4, 3,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE4",  4, 4,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}},
-	{"PE5",  4, 5,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}},
-	{"PE6",  4, 6,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}},
-	{"PE7",  4, 7,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}},
-	{"PE8",  4, 8,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE9",  4, 9,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE14", 4, 14, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE15", 4, 15, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE16", 4, 16, {"gpio_in", "gpio_out", "csi", NULL, NULL, NULL, NULL, NULL}},
+	{"PE0",  4, 0,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint0", NULL}, 6, 0},
+	{"PE1",  4, 1,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint1", NULL}, 6, 1},
+	{"PE2",  4, 2,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint2", NULL}, 6, 2},
+	{"PE3",  4, 3,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint3", NULL}, 6, 3},
+	{"PE4",  4, 4,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint4", NULL}, 6, 4},
+	{"PE5",  4, 5,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint5", NULL}, 6, 5},
+	{"PE6",  4, 6,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint6", NULL}, 6, 6},
+	{"PE7",  4, 7,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint7", NULL}, 6, 7},
+	{"PE8",  4, 8,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint8", NULL}, 6, 8},
+	{"PE9",  4, 9,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint9", NULL}, 6, 9},
+	{"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint10", NULL}, 6, 10},
+	{"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint11", NULL}, 6, 11},
+	{"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint12", NULL}, 6, 12},
+	{"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint13", NULL}, 6, 13},
+	{"PE14", 4, 14, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint14", NULL}, 6, 14},
+	{"PE15", 4, 15, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint15", NULL}, 6, 15},
+	{"PE16", 4, 16, {"gpio_in", "gpio_out", "csi", NULL, NULL, NULL, "pe_eint16", NULL}, 6, 16},
 
 	{"PF0",  5, 0,  {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}},
 	{"PF1",  5, 1,  {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}},
@@ -159,25 +159,25 @@ const static struct allwinner_pins a31_p
 	{"PF4",  5, 4,  {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}},
 	{"PF5",  5, 5,  {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}},
 
-	{"PG0",  6, 0,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}},
-	{"PG1",  6, 1,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}},
-	{"PG2",  6, 2,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}},
-	{"PG3",  6, 3,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}},
-	{"PG4",  6, 4,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}},
-	{"PG5",  6, 5,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}},
-	{"PG6",  6, 6,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}},
-	{"PG7",  6, 7,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}},
-	{"PG8",  6, 8,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}},
-	{"PG9",  6, 9,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}},
-	{"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, NULL, NULL}},
-	{"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, NULL, NULL}},
-	{"PG12", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}},
-	{"PG13", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}},
-	{"PG14", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}},
-	{"PG15", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}},
-	{"PG16", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}},
-	{"PG17", 6, 11, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, NULL, NULL}},
-	{"PG18", 6, 11, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, NULL, NULL}},
+	{"PG0",  6, 0,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0},
+	{"PG1",  6, 1,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1},
+	{"PG2",  6, 2,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2},
+	{"PG3",  6, 3,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3},
+	{"PG4",  6, 4,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4},
+	{"PG5",  6, 5,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5},
+	{"PG6",  6, 6,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6},
+	{"PG7",  6, 7,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7},
+	{"PG8",  6, 8,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8},
+	{"PG9",  6, 9,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9},
+	{"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, "pg_eint10", NULL}, 6, 10},
+	{"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, "pg_eint11", NULL}, 6, 11},
+	{"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint12", NULL}, 6, 12},
+	{"PG13", 6, 13, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint13", NULL}, 6, 13},
+	{"PG14", 6, 14, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint14", NULL}, 6, 14},
+	{"PG15", 6, 15, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint15", NULL}, 6, 15},
+	{"PG16", 6, 16, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint16", NULL}, 6, 16},
+	{"PG17", 6, 17, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint17", NULL}, 6, 17},
+	{"PG18", 6, 18, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint18", NULL}, 6, 18},
 
 	{"PH0",  7, 0,  {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}},
 	{"PH1",  7, 1,  {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}},

Modified: head/sys/arm/allwinner/a31/a31_r_padconf.c
==============================================================================
--- head/sys/arm/allwinner/a31/a31_r_padconf.c	Thu Dec 15 15:45:11 2016	(r310116)
+++ head/sys/arm/allwinner/a31/a31_r_padconf.c	Thu Dec 15 15:52:13 2016	(r310117)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2016 Emmanuel Vadot <manu@bidouilliste.com>
+ * Copyright (c) 2016 Emmanuel Vadot <manu@freebsd.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,19 +43,19 @@ const static struct allwinner_pins a31_r
 	{"PL2",  0, 2,  {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, NULL, NULL}},
 	{"PL3",  0, 3,  {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, NULL, NULL}},
 	{"PL4",  0, 4,  {"gpio_in", "gpio_out", "s_ir", NULL, NULL, NULL, NULL, NULL}},
-	{"PL5",  0, 5,  {"gpio_in", "gpio_out", "pl_eint0", "s_jtag", NULL, NULL, NULL, NULL}},
-	{"PL6",  0, 6,  {"gpio_in", "gpio_out", "pl_eint1", "s_jtag", NULL, NULL, NULL, NULL}},
-	{"PL7",  0, 7,  {"gpio_in", "gpio_out", "pl_eint2", "s_jtag", NULL, NULL, NULL, NULL}},
-	{"PL8",  0, 8,  {"gpio_in", "gpio_out", "pl_eint3", "s_jtag", NULL, NULL, NULL, NULL}},
-
-	{"PM0",  1, 0,  {"gpio_in", "gpio_out", "pm_eint0", NULL, NULL, NULL, NULL, NULL}},
-	{"PM1",  1, 1,  {"gpio_in", "gpio_out", "pm_eint1", NULL, NULL, NULL, NULL, NULL}},
-	{"PM2",  1, 2,  {"gpio_in", "gpio_out", "pm_eint2", "1wire", NULL, NULL, NULL, NULL}},
-	{"PM3",  1, 3,  {"gpio_in", "gpio_out", "pm_eint3", NULL, NULL, NULL, NULL, NULL}},
-	{"PM4",  1, 4,  {"gpio_in", "gpio_out", "pm_eint4", NULL, NULL, NULL, NULL, NULL}},
-	{"PM5",  1, 5,  {"gpio_in", "gpio_out", "pm_eint5", NULL, NULL, NULL, NULL, NULL}},
-	{"PM6",  1, 6,  {"gpio_in", "gpio_out", "pm_eint6", NULL, NULL, NULL, NULL, NULL}},
-	{"PM7",  1, 7,  {"gpio_in", "gpio_out", "pm_eint7", "rtc", NULL, NULL, NULL, NULL}},
+	{"PL5",  0, 5,  {"gpio_in", "gpio_out", "pl_eint0", "s_jtag", NULL, NULL, NULL, NULL}, 2, 0},
+	{"PL6",  0, 6,  {"gpio_in", "gpio_out", "pl_eint1", "s_jtag", NULL, NULL, NULL, NULL}, 2, 1},
+	{"PL7",  0, 7,  {"gpio_in", "gpio_out", "pl_eint2", "s_jtag", NULL, NULL, NULL, NULL}, 2, 2},
+	{"PL8",  0, 8,  {"gpio_in", "gpio_out", "pl_eint3", "s_jtag", NULL, NULL, NULL, NULL}, 2, 3},
+
+	{"PM0",  1, 0,  {"gpio_in", "gpio_out", "pm_eint0", NULL, NULL, NULL, NULL, NULL}, 2, 0},
+	{"PM1",  1, 1,  {"gpio_in", "gpio_out", "pm_eint1", NULL, NULL, NULL, NULL, NULL}, 2, 1},
+	{"PM2",  1, 2,  {"gpio_in", "gpio_out", "pm_eint2", "1wire", NULL, NULL, NULL, NULL}, 2, 2},
+	{"PM3",  1, 3,  {"gpio_in", "gpio_out", "pm_eint3", NULL, NULL, NULL, NULL, NULL}, 2, 3},
+	{"PM4",  1, 4,  {"gpio_in", "gpio_out", "pm_eint4", NULL, NULL, NULL, NULL, NULL}, 2, 4},
+	{"PM5",  1, 5,  {"gpio_in", "gpio_out", "pm_eint5", NULL, NULL, NULL, NULL, NULL}, 2, 5},
+	{"PM6",  1, 6,  {"gpio_in", "gpio_out", "pm_eint6", NULL, NULL, NULL, NULL, NULL}, 2, 6},
+	{"PM7",  1, 7,  {"gpio_in", "gpio_out", "pm_eint7", "rtc", NULL, NULL, NULL, NULL}, 2, 7},
 };
 
 const struct allwinner_padconf a31_r_padconf = {

Modified: head/sys/arm/allwinner/a31/a31s_padconf.c
==============================================================================
--- head/sys/arm/allwinner/a31/a31s_padconf.c	Thu Dec 15 15:45:11 2016	(r310116)
+++ head/sys/arm/allwinner/a31/a31s_padconf.c	Thu Dec 15 15:52:13 2016	(r310117)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2016 Emmanuel Vadot <manu@bidouilliste.com>
+ * Copyright (c) 2016 Emmanuel Vadot <manu@freebsd.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -38,43 +38,43 @@ __FBSDID("$FreeBSD$");
 #ifdef SOC_ALLWINNER_A31S
 
 const static struct allwinner_pins a31s_pins[] = {
-	{"PA0",  0, 0,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}},
-	{"PA1",  0, 1,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}},
-	{"PA2",  0, 2,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}},
-	{"PA3",  0, 3,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}},
-	{"PA4",  0, 4,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}},
-	{"PA5",  0, 5,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}},
-	{"PA6",  0, 6,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}},
-	{"PA7",  0, 7,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, NULL, NULL}},
-	{"PA8",  0, 8,  {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, NULL, NULL}},
-	{"PA9",  0, 9,  {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, NULL, NULL}},
-	{"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", NULL, NULL}},
-	{"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", NULL, NULL}},
-	{"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", NULL, NULL}},
-	{"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", NULL, NULL}},
-	{"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", NULL, NULL}},
-	{"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, NULL, NULL}},
-	{"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, NULL, NULL}},
-	{"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_b", NULL, NULL, NULL}},
-	{"PA18", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, NULL, NULL}},
-	{"PA19", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, NULL, NULL}},
-	{"PA20", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, NULL, NULL}},
-	{"PA21", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, NULL, NULL}},
-	{"PA22", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, NULL, NULL}},
-	{"PA23", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, NULL, NULL}},
-	{"PA24", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, NULL, NULL}},
-	{"PA25", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, NULL, NULL}},
-	{"PA26", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_c", NULL, NULL, NULL}},
-	{"PA27", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, NULL, NULL}},
-
-	{"PB0",  1, 0,  {"gpio_in", "gpio_out", "i2s0", "uart3", NULL , NULL, NULL, NULL}},
-	{"PB1",  1, 1,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}},
-	{"PB2",  1, 2,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}},
-	{"PB3",  1, 3,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}},
-	{"PB4",  1, 4,  {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, NULL, NULL}},
-	{"PB5",  1, 5,  {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, NULL, NULL}},
-	{"PB6",  1, 6,  {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, NULL, NULL}},
-	{"PB7",  1, 7,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, NULL, NULL}},
+	{"PA0",  0, 0,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint0", NULL}, 6, 0},
+	{"PA1",  0, 1,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint1", NULL}, 6, 1},
+	{"PA2",  0, 2,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint2", NULL}, 6, 2},
+	{"PA3",  0, 3,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint3", NULL}, 6, 3},
+	{"PA4",  0, 4,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint4", NULL}, 6, 4},
+	{"PA5",  0, 5,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint5", NULL}, 6, 5},
+	{"PA6",  0, 6,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint6", NULL}, 6, 6},
+	{"PA7",  0, 7,  {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint7", NULL}, 6, 7},
+	{"PA8",  0, 8,  {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint8", NULL}, 6, 8},
+	{"PA9",  0, 9,  {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint9", NULL}, 6, 9},
+	{"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint10", NULL}, 6, 10},
+	{"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint11", NULL}, 6, 11},
+	{"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint12", NULL}, 6, 12},
+	{"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint13", NULL}, 6, 13},
+	{"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint14", NULL}, 6, 14},
+	{"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, "pa_eint15", NULL}, 6, 15},
+	{"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, "pa_eint16", NULL}, 6, 16},
+	{"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_b", NULL, "pa_eint17", NULL}, 6, 17},
+	{"PA18", 0, 18, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, "pa_eint18", NULL}, 6, 18},
+	{"PA19", 0, 19, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, "pa_eint19", NULL}, 6, 19},
+	{"PA20", 0, 20, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint20", NULL}, 6, 20},
+	{"PA21", 0, 21, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint21", NULL}, 6, 21},
+	{"PA22", 0, 22, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint22", NULL}, 6, 22},
+	{"PA23", 0, 23, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint23", NULL}, 6, 23},
+	{"PA24", 0, 24, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint24", NULL}, 6, 24},
+	{"PA25", 0, 25, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint25", NULL}, 6, 25},
+	{"PA26", 0, 26, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_c", NULL, "pa_eint26", NULL}, 6, 26},
+	{"PA27", 0, 27, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint27", NULL}, 6, 27},
+
+	{"PB0",  1, 0,  {"gpio_in", "gpio_out", "i2s0", "uart3", NULL , NULL, "pb_eint0", NULL}, 6, 0},
+	{"PB1",  1, 1,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint1", NULL}, 6, 1},
+	{"PB2",  1, 2,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint2", NULL}, 6, 2},
+	{"PB3",  1, 3,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint3", NULL}, 6, 3},
+	{"PB4",  1, 4,  {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, "pb_eint4", NULL}, 6, 4},
+	{"PB5",  1, 5,  {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint5", NULL}, 6, 5},
+	{"PB6",  1, 6,  {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint6", NULL}, 6, 6},
+	{"PB7",  1, 7,  {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint7", NULL}, 6, 7},
 
 	{"PC0",  2, 0,  {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}},
 	{"PC1",  2, 1,  {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}},
@@ -93,9 +93,9 @@ const static struct allwinner_pins a31s_
 	{"PC14", 2, 14, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}},
 	{"PC15", 2, 15, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}},
 	{"PC24", 2, 24, {"gpio_in", "gpio_out", "nand0", "mmc2", "mmc3", NULL, NULL, NULL}},
-	{"PC25", 2, 24, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}},
-	{"PC26", 2, 24, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}},
-	{"PC27", 2, 24, {"gpio_in", "gpio_out", NULL, "spi0",NULL, NULL, NULL, NULL}},
+	{"PC25", 2, 25, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}},
+	{"PC26", 2, 26, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}},
+	{"PC27", 2, 27, {"gpio_in", "gpio_out", NULL, "spi0",NULL, NULL, NULL, NULL}},
 
 	{"PD0",  3, 0,  {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}},
 	{"PD1",  3, 1,  {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}},
@@ -126,22 +126,22 @@ const static struct allwinner_pins a31s_
 	{"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}},
 	{"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}},
 
-	{"PE0",  4, 0,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE1",  4, 1,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE2",  4, 2,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE3",  4, 3,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE4",  4, 4,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}},
-	{"PE5",  4, 5,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}},
-	{"PE6",  4, 6,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}},
-	{"PE7",  4, 7,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, NULL, NULL}},
-	{"PE8",  4, 8,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE9",  4, 9,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE12", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE13", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE14", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
-	{"PE15", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}},
+	{"PE0",  4, 0,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint0", NULL}, 6, 0},
+	{"PE1",  4, 1,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint1", NULL}, 6, 1},
+	{"PE2",  4, 2,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint2", NULL}, 6, 2},
+	{"PE3",  4, 3,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint3", NULL}, 6, 3},
+	{"PE4",  4, 4,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint4", NULL}, 6, 4},
+	{"PE5",  4, 5,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint5", NULL}, 6, 5},
+	{"PE6",  4, 6,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint6", NULL}, 6, 6},
+	{"PE7",  4, 7,  {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint7", NULL}, 6, 7},
+	{"PE8",  4, 8,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint8", NULL}, 6, 8},
+	{"PE9",  4, 9,  {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint9", NULL}, 6, 9},
+	{"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint10", NULL}, 6, 10},
+	{"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint11", NULL}, 6, 11},
+	{"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint12", NULL}, 6, 12},
+	{"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint13", NULL}, 6, 13},
+	{"PE14", 4, 14, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint14", NULL}, 6, 14},
+	{"PE15", 4, 15, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint15", NULL}, 6, 15},
 
 	{"PF0",  5, 0,  {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}},
 	{"PF1",  5, 1,  {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}},
@@ -150,25 +150,25 @@ const static struct allwinner_pins a31s_
 	{"PF4",  5, 4,  {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}},
 	{"PF5",  5, 5,  {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}},
 
-	{"PG0",  6, 0,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}},
-	{"PG1",  6, 1,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}},
-	{"PG2",  6, 2,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}},
-	{"PG3",  6, 3,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}},
-	{"PG4",  6, 4,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}},
-	{"PG5",  6, 5,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, NULL}},
-	{"PG6",  6, 6,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}},
-	{"PG7",  6, 7,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}},
-	{"PG8",  6, 8,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}},
-	{"PG9",  6, 9,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, NULL, NULL}},
-	{"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, NULL, NULL}},
-	{"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, NULL, NULL}},
-	{"PG12", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}},
-	{"PG13", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}},
-	{"PG14", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}},
-	{"PG15", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}},
-	{"PG16", 6, 11, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, NULL, NULL}},
-	{"PG17", 6, 11, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, NULL, NULL}},
-	{"PG18", 6, 11, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, NULL, NULL}},
+	{"PG0",  6, 0,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0},
+	{"PG1",  6, 1,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1},
+	{"PG2",  6, 2,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2},
+	{"PG3",  6, 3,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3},
+	{"PG4",  6, 4,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4},
+	{"PG5",  6, 5,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5},
+	{"PG6",  6, 6,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6},
+	{"PG7",  6, 7,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7},
+	{"PG8",  6, 8,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8},
+	{"PG9",  6, 9,  {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9},
+	{"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, "pg_eint10", NULL}, 6, 10},
+	{"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, "pg_eint11", NULL}, 6, 11},
+	{"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint12", NULL}, 6, 12},
+	{"PG13", 6, 13, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint13", NULL}, 6, 13},
+	{"PG14", 6, 14, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint14", NULL}, 6, 14},
+	{"PG15", 6, 15, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint15", NULL}, 6, 15},
+	{"PG16", 6, 16, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint16", NULL}, 6, 16},
+	{"PG17", 6, 17, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint17", NULL}, 6, 17},
+	{"PG18", 6, 18, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint18", NULL}, 6, 18},
 
 	{"PH9",  7, 9,  {"gpio_in", "gpio_out", "spi2", "jtag", "pwm1", NULL, NULL, NULL}},
 	{"PH10", 7, 10, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm1", NULL, NULL, NULL}},

Modified: head/sys/arm/allwinner/a64/a64_padconf.c
==============================================================================
--- head/sys/arm/allwinner/a64/a64_padconf.c	Thu Dec 15 15:45:11 2016	(r310116)
+++ head/sys/arm/allwinner/a64/a64_padconf.c	Thu Dec 15 15:52:13 2016	(r310117)
@@ -41,16 +41,16 @@ __FBSDID("$FreeBSD$");
 #ifdef SOC_ALLWINNER_A64
 
 static const struct allwinner_pins a64_pins[] = {
-	{ "PB0",  1, 0,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", NULL, "eint" } },
-	{ "PB1",  1, 1,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "eint" } },
-	{ "PB2",  1, 2,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "eint" } },
-	{ "PB3",  1, 3,   { "gpio_in", "gpio_out", "uart2", "i2s0", "jtag", "sim", "eint" } },
-	{ "PB4",  1, 4,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "eint" } },
-	{ "PB5",  1, 5,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "eint" } },
-	{ "PB6",  1, 6,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "eint" } },
-	{ "PB7",  1, 7,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "eint" } },
-	{ "PB8",  1, 8,   { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "eint" } },
-	{ "PB9",  1, 9,   { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "eint" } },
+	{ "PB0",  1, 0,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", NULL, "pb_eint0" } 6, 0},
+	{ "PB1",  1, 1,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint1" } 6, 1},
+	{ "PB2",  1, 2,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint2" } 6, 2},
+	{ "PB3",  1, 3,   { "gpio_in", "gpio_out", "uart2", "i2s0", "jtag", "sim", "pb_eint3" } 6, 3},
+	{ "PB4",  1, 4,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint4" } 6, 4},
+	{ "PB5",  1, 5,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint5" } 6, 5},
+	{ "PB6",  1, 6,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint6" } 6, 6},
+	{ "PB7",  1, 7,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint7" } 6, 7},
+	{ "PB8",  1, 8,   { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint8" } 6, 8},
+	{ "PB9",  1, 9,   { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint9" } 6, 9},
 
 	{ "PC0",  2, 0,   { "gpio_in", "gpio_out", "nand", NULL, "spi0" } },
 	{ "PC1",  2, 1,   { "gpio_in", "gpio_out", "nand", "mmc2", "spi0" } },
@@ -123,33 +123,33 @@ static const struct allwinner_pins a64_p
 	{ "PF5",  5, 5,   { "gpio_in", "gpio_out", "mmc0", "jtag" } },
 	{ "PF6",  5, 6,   { "gpio_in", "gpio_out" } },
 
-	{ "PG0",  6, 0,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } },
-	{ "PG1",  6, 1,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } },
-	{ "PG2",  6, 2,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } },
-	{ "PG3",  6, 3,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } },
-	{ "PG4",  6, 4,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } },
-	{ "PG5",  6, 5,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } },
-	{ "PG6",  6, 6,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "eint" } },
-	{ "PG7",  6, 7,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "eint" } },
-	{ "PG8",  6, 8,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "eint" } },
-	{ "PG9",  6, 9,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "eint" } },
-	{ "PG10", 6, 10,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "eint" } },
-	{ "PG11", 6, 11,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "eint" } },
-	{ "PG12", 6, 12,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "eint" } },
-	{ "PG13", 6, 13,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "eint" } },
-
-	{ "PH0",  7, 0,   { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "eint" } },
-	{ "PH1",  7, 1,   { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "eint" } },
-	{ "PH2",  7, 2,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "eint" } },
-	{ "PH3",  7, 3,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "eint" } },
-	{ "PH4",  7, 4,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "eint" } },
-	{ "PH5",  7, 5,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "eint" } },
-	{ "PH6",  7, 6,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "eint" } },
-	{ "PH7",  7, 7,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "eint" } },
-	{ "PH8",  7, 8,   { "gpio_in", "gpio_out", "owa", NULL, NULL, NULL, "eint" } },
-	{ "PH9",  7, 9,   { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "eint" } },
-	{ "PH10", 7, 10,  { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "eint" } },
-	{ "PH11", 7, 11,  { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "eint" } },
+	{ "PG0",  6, 0,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0" } 6, 0},
+	{ "PG1",  6, 1,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1" } 6, 1},
+	{ "PG2",  6, 2,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2" } 6, 2},
+	{ "PG3",  6, 3,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3" } 6, 3},
+	{ "PG4",  6, 4,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4" } 6, 4},
+	{ "PG5",  6, 5,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5" } 6, 5},
+	{ "PG6",  6, 6,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint6" } 6, 6},
+	{ "PG7",  6, 7,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint7" } 6, 7},
+	{ "PG8",  6, 8,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint8" } 6, 8},
+	{ "PG9",  6, 9,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint9" } 6, 9},
+	{ "PG10", 6, 10,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint10" } 6, 10},
+	{ "PG11", 6, 11,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint11" } 6, 11},
+	{ "PG12", 6, 12,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint12" } 6, 12},
+	{ "PG13", 6, 13,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint13" } 6, 13},
+
+	{ "PH0",  7, 0,   { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint0" } 6, 0},
+	{ "PH1",  7, 1,   { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint1" } 6, 1},
+	{ "PH2",  7, 2,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint2" } 6, 2},
+	{ "PH3",  7, 3,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint3" } 6, 3},
+	{ "PH4",  7, 4,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint4" } 6, 4},
+	{ "PH5",  7, 5,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint5" } 6, 5},
+	{ "PH6",  7, 6,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint6" } 6, 6},
+	{ "PH7",  7, 7,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint7" } 6, 7},
+	{ "PH8",  7, 8,   { "gpio_in", "gpio_out", "owa", NULL, NULL, NULL, "ph_eint8" } 6, 8},
+	{ "PH9",  7, 9,   { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint9" } 6, 9},
+	{ "PH10", 7, 10,  { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint10" } 6, 10},
+	{ "PH11", 7, 11,  { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint11" } 6, 11},
 };
 
 const struct allwinner_padconf a64_padconf = {

Modified: head/sys/arm/allwinner/a64/a64_r_padconf.c
==============================================================================
--- head/sys/arm/allwinner/a64/a64_r_padconf.c	Thu Dec 15 15:45:11 2016	(r310116)
+++ head/sys/arm/allwinner/a64/a64_r_padconf.c	Thu Dec 15 15:52:13 2016	(r310117)
@@ -41,19 +41,19 @@ __FBSDID("$FreeBSD$");
 #ifdef SOC_ALLWINNER_A64
 
 static const struct allwinner_pins a64_r_pins[] = {
-	{ "PL0",   0, 0,  { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "eint" } },
-	{ "PL1",   0, 1,  { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "eint" } },
-	{ "PL2",   0, 2,  { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "eint" } },
-	{ "PL3",   0, 3,  { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "eint" } },
-	{ "PL4",   0, 4,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "eint" } },
-	{ "PL5",   0, 5,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "eint" } },
-	{ "PL6",   0, 6,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "eint" } },
-	{ "PL7",   0, 7,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "eint" } },
-	{ "PL8",   0, 8,  { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "eint" } },
-	{ "PL9",   0, 9,  { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "eint" } },
-	{ "PL10",  0, 10, { "gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, "eint" } },
-	{ "PL11",  0, 11, { "gpio_in", "gpio_out", "s_cir", NULL, NULL, NULL, "eint" } },
-	{ "PL12",  0, 12, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "eint" } },
+	{ "PL0",   0, 0,  { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint0" } 6, 0},
+	{ "PL1",   0, 1,  { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint1" } 6, 1},
+	{ "PL2",   0, 2,  { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint2" } 6, 2},
+	{ "PL3",   0, 3,  { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint3" } 6, 3},
+	{ "PL4",   0, 4,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint4" } 6, 4},
+	{ "PL5",   0, 5,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint5" } 6, 5},
+	{ "PL6",   0, 6,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint6" } 6, 6},
+	{ "PL7",   0, 7,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint7" } 6, 7},
+	{ "PL8",   0, 8,  { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint8" } 6, 8},
+	{ "PL9",   0, 9,  { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint9" } 6, 9},
+	{ "PL10",  0, 10, { "gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, "pl_eint10" } 6, 10},
+	{ "PL11",  0, 11, { "gpio_in", "gpio_out", "s_cir", NULL, NULL, NULL, "pl_eint11" } 6, 11},
+	{ "PL12",  0, 12, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint12" } 6, 12},
 };
 
 const struct allwinner_padconf a64_r_padconf = {

Modified: head/sys/arm/allwinner/allwinner_pinctrl.h
==============================================================================
--- head/sys/arm/allwinner/allwinner_pinctrl.h	Thu Dec 15 15:45:11 2016	(r310116)
+++ head/sys/arm/allwinner/allwinner_pinctrl.h	Thu Dec 15 15:52:13 2016	(r310117)
@@ -36,6 +36,8 @@ struct allwinner_pins {
 	uint8_t port;
 	uint8_t pin;
 	const char *functions[8];
+	uint8_t eint_func;
+	uint8_t eint_num;
 };
 
 struct allwinner_padconf {

Modified: head/sys/arm/allwinner/h3/h3_padconf.c
==============================================================================
--- head/sys/arm/allwinner/h3/h3_padconf.c	Thu Dec 15 15:45:11 2016	(r310116)
+++ head/sys/arm/allwinner/h3/h3_padconf.c	Thu Dec 15 15:52:13 2016	(r310117)
@@ -38,28 +38,28 @@ __FBSDID("$FreeBSD$");
 #ifdef SOC_ALLWINNER_H3
 
 const static struct allwinner_pins h3_pins[] = {
-	{"PA0",  0, 0,  {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint", NULL}},
-	{"PA1",  0, 1,  {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint", NULL}},
-	{"PA2",  0, 2,  {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint", NULL}},
-	{"PA3",  0, 3,  {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint", NULL}},
-	{"PA4",  0, 4,  {"gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "eint", NULL}},
-	{"PA5",  0, 5,  {"gpio_in", "gpio_out", "uart0", "pwm0", NULL, NULL, "eint", NULL}},
-	{"PA6",  0, 6,  {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "eint", NULL}},
-	{"PA7",  0, 7,  {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "eint", NULL}},
-	{"PA8",  0, 8,  {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "eint", NULL}},
-	{"PA9",  0, 9,  {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "eint", NULL}},
-	{"PA10", 0, 10, {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "eint", NULL}},
-	{"PA11", 0, 11, {"gpio_in", "gpio_out", "i2c0", "di", NULL, NULL, "eint", NULL}},
-	{"PA12", 0, 12, {"gpio_in", "gpio_out", "i2c0", "di", NULL, NULL, "eint", NULL}},
-	{"PA13", 0, 13, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint", NULL}},
-	{"PA14", 0, 14, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint", NULL}},
-	{"PA15", 0, 15, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint", NULL}},
-	{"PA16", 0, 16, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint", NULL}},
-	{"PA17", 0, 17, {"gpio_in", "gpio_out", "spdif", NULL, NULL, NULL, "eint", NULL}},
-	{"PA18", 0, 18, {"gpio_in", "gpio_out", "i2s0", "i2c1", NULL, NULL, "eint", NULL}},
-	{"PA19", 0, 19, {"gpio_in", "gpio_out", "i2s0", "i2c1", NULL, NULL, "eint", NULL}},
-	{"PA20", 0, 20, {"gpio_in", "gpio_out", "i2s0", "sim", NULL, NULL, "eint", NULL}},
-	{"PA21", 0, 21, {"gpio_in", "gpio_out", "i2s0", "sim", NULL, NULL, "eint", NULL}},
+	{"PA0",  0, 0,  {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pa_eint0", NULL}, 6, 0},
+	{"PA1",  0, 1,  {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pa_eint1", NULL}, 6, 1},
+	{"PA2",  0, 2,  {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pa_eint2", NULL}, 6, 2},
+	{"PA3",  0, 3,  {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pa_eint3", NULL}, 6, 3},
+	{"PA4",  0, 4,  {"gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "pa_eint4", NULL}, 6, 4},
+	{"PA5",  0, 5,  {"gpio_in", "gpio_out", "uart0", "pwm0", NULL, NULL, "pa_eint5", NULL}, 6, 5},
+	{"PA6",  0, 6,  {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "pa_eint6", NULL}, 6, 6},
+	{"PA7",  0, 7,  {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "pa_eint7", NULL}, 6, 7},
+	{"PA8",  0, 8,  {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "pa_eint8", NULL}, 6, 8},
+	{"PA9",  0, 9,  {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "pa_eint9", NULL}, 6, 9},
+	{"PA10", 0, 10, {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "pa_eint10", NULL}, 6, 10},
+	{"PA11", 0, 11, {"gpio_in", "gpio_out", "i2c0", "di", NULL, NULL, "pa_eint11", NULL}, 6, 11},
+	{"PA12", 0, 12, {"gpio_in", "gpio_out", "i2c0", "di", NULL, NULL, "pa_eint12", NULL}, 6, 12},
+	{"PA13", 0, 13, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "pa_eint13", NULL}, 6, 13},
+	{"PA14", 0, 14, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "pa_eint14", NULL}, 6, 14},
+	{"PA15", 0, 15, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "pa_eint15", NULL}, 6, 15},
+	{"PA16", 0, 16, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "pa_eint16", NULL}, 6, 16},
+	{"PA17", 0, 17, {"gpio_in", "gpio_out", "spdif", NULL, NULL, NULL, "pa_eint17", NULL}, 6, 17},
+	{"PA18", 0, 18, {"gpio_in", "gpio_out", "i2s0", "i2c1", NULL, NULL, "pa_eint18", NULL}, 6, 18},
+	{"PA19", 0, 19, {"gpio_in", "gpio_out", "i2s0", "i2c1", NULL, NULL, "pa_eint19", NULL}, 6, 19},
+	{"PA20", 0, 20, {"gpio_in", "gpio_out", "i2s0", "sim", NULL, NULL, "pa_eint20", NULL}, 6, 20},
+	{"PA21", 0, 21, {"gpio_in", "gpio_out", "i2s0", "sim", NULL, NULL, "pa_eint21", NULL}, 6, 21},
 
 	{"PC0",  2, 0,  {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}},
 	{"PC1",  2, 1,  {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}},
@@ -123,20 +123,20 @@ const static struct allwinner_pins h3_pi
 	{"PF5",  5, 5,  {"gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, NULL, NULL}},
 	{"PF6",  5, 6,  {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}},
 
-	{"PG0",  6, 0,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG1",  6, 1,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG2",  6, 2,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG3",  6, 3,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG4",  6, 4,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG5",  6, 5,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG6",  6, 6,  {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG7",  6, 7,  {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG8",  6, 8,  {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG9",  6, 9,  {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG10", 6, 10, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG11", 6, 11, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG12", 6, 11, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, NULL, "eint"}},
-	{"PG13", 6, 11, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, NULL, "eint"}},
+	{"PG0",  6, 0,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0},
+	{"PG1",  6, 1,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1},
+	{"PG2",  6, 2,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2},
+	{"PG3",  6, 3,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3},
+	{"PG4",  6, 4,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4},
+	{"PG5",  6, 5,  {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5},
+	{"PG6",  6, 6,  {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6},
+	{"PG7",  6, 7,  {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7},
+	{"PG8",  6, 8,  {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8},
+	{"PG9",  6, 9,  {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9},
+	{"PG10", 6, 10, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, "pg_eint10", NULL}, 6, 10},
+	{"PG11", 6, 11, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, "pg_eint11", NULL}, 6, 11},
+	{"PG12", 6, 12, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, "pg_eint12", NULL}, 6, 12},
+	{"PG13", 6, 13, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, "pg_eint13", NULL}, 6, 13},
 };
 
 const struct allwinner_padconf h3_padconf = {

Modified: head/sys/arm/allwinner/h3/h3_r_padconf.c
==============================================================================
--- head/sys/arm/allwinner/h3/h3_r_padconf.c	Thu Dec 15 15:45:11 2016	(r310116)
+++ head/sys/arm/allwinner/h3/h3_r_padconf.c	Thu Dec 15 15:52:13 2016	(r310117)
@@ -38,18 +38,18 @@ __FBSDID("$FreeBSD$");
 #ifdef SOC_ALLWINNER_H3
 
 const static struct allwinner_pins h3_r_pins[] = {
-	{"PL0",  0, 0,  {"gpio_in", "gpio_out", "s_twi", NULL, NULL, NULL, NULL, "eint"}},
-	{"PL1",  0, 1,  {"gpio_in", "gpio_out", "s_twi", NULL, NULL, NULL, NULL, "eint"}},
-	{"PL2",  0, 2,  {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, NULL, "eint"}},
-	{"PL3",  0, 3,  {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, NULL, "eint"}},
-	{"PL4",  0, 4,  {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, NULL, "eint"}},
-	{"PL5",  0, 5,  {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, NULL, "eint"}},
-	{"PL6",  0, 6,  {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, NULL, "eint"}},
-	{"PL7",  0, 7,  {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, NULL, "eint"}},
-	{"PL8",  0, 8,  {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, "eint"}},
-	{"PL9",  0, 9,  {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, "eint"}},
-	{"PL10", 0, 10, {"gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, NULL, "eint"}},
-	{"PL11", 0, 11, {"gpio_in", "gpio_out", "s_cir_rx", NULL, NULL, NULL, NULL, "eint"}},
+	{"PL0",  0, 0,  {"gpio_in", "gpio_out", "s_twi", NULL, NULL, NULL, "pl_eint0", NULL}, 6, 0},
+	{"PL1",  0, 1,  {"gpio_in", "gpio_out", "s_twi", NULL, NULL, NULL, "pl_eint1", NULL}, 6, 1},
+	{"PL2",  0, 2,  {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint2", NULL}, 6, 2},
+	{"PL3",  0, 3,  {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint3", NULL}, 6, 3},
+	{"PL4",  0, 4,  {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint4", NULL}, 6, 4},
+	{"PL5",  0, 5,  {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint5", NULL}, 6, 5},
+	{"PL6",  0, 6,  {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint6", NULL}, 6, 6},
+	{"PL7",  0, 7,  {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint7", NULL}, 6, 7},
+	{"PL8",  0, 8,  {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint8", NULL}, 6, 8},
+	{"PL9",  0, 9,  {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint9", NULL}, 6, 9},
+	{"PL10", 0, 10, {"gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, "pl_eint10", NULL}, 6, 10},
+	{"PL11", 0, 11, {"gpio_in", "gpio_out", "s_cir_rx", NULL, NULL, NULL, "pl_eint11", NULL}, 6, 11},
 };
 
 const struct allwinner_padconf h3_r_padconf = {

From owner-svn-src-all@freebsd.org  Thu Dec 15 16:13:53 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A67ACC81D3A;
 Thu, 15 Dec 2016 16:13:53 +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 7612F1F44;
 Thu, 15 Dec 2016 16:13:53 +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 uBFGDq5I082867;
 Thu, 15 Dec 2016 16:13:52 GMT (envelope-from asomers@FreeBSD.org)
Received: (from asomers@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFGDqsJ082866;
 Thu, 15 Dec 2016 16:13:52 GMT (envelope-from asomers@FreeBSD.org)
Message-Id: <201612151613.uBFGDqsJ082866@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: asomers set sender to
 asomers@FreeBSD.org using -f
From: Alan Somers <asomers@FreeBSD.org>
Date: Thu, 15 Dec 2016 16:13:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310118 - head/bin/ls/tests
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 16:13:53 -0000

Author: asomers
Date: Thu Dec 15 16:13:52 2016
New Revision: 310118
URL: https://svnweb.freebsd.org/changeset/base/310118

Log:
  Fix ls_tests:o_flag with ZFS TMPDIR
  
  Unlike UFS or TMPFS, ZFS sets uarch automatically whenever a file is
  updated. The test must explicitly clear uarch to be portable across
  filesystems. Also, it doesn't need to run as root.
  
  PR:		215179
  MFC after:	4 weeks
  Sponsored by:	Spectra Logic Corp
  Differential Revision:	https://reviews.freebsd.org/D8741

Modified:
  head/bin/ls/tests/ls_tests.sh

Modified: head/bin/ls/tests/ls_tests.sh
==============================================================================
--- head/bin/ls/tests/ls_tests.sh	Thu Dec 15 15:52:13 2016	(r310117)
+++ head/bin/ls/tests/ls_tests.sh	Thu Dec 15 16:13:52 2016	(r310118)
@@ -697,7 +697,6 @@ atf_test_case o_flag
 o_flag_head()
 {
 	atf_set "descr" "Verify that the output from ls -o prints out the chflag values or '-' if none are set"
-	atf_set "require.user" "root"
 }
 
 o_flag_body()
@@ -711,6 +710,7 @@ o_flag_body()
 	atf_check -e ignore -o empty -s exit:0 dd if=/dev/zero of=b.file \
 	    bs=$size count=1
 	atf_check -e empty -o empty -s exit:0 chflags uarch a.file
+	atf_check -e empty -o empty -s exit:0 chflags 0 b.file
 
 	atf_check -e empty -o match:"[[:space:]]+uarch[[:space:]]$size+.+a\\.file" \
 	    -s exit:0 ls -lo a.file

From owner-svn-src-all@freebsd.org  Thu Dec 15 16:27:40 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8359C810F3;
 Thu, 15 Dec 2016 16:27: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 77FD1A99;
 Thu, 15 Dec 2016 16:27: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 uBFGRdtn087516;
 Thu, 15 Dec 2016 16:27:39 GMT (envelope-from pfg@FreeBSD.org)
Received: (from pfg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFGRdrS087514;
 Thu, 15 Dec 2016 16:27:39 GMT (envelope-from pfg@FreeBSD.org)
Message-Id: <201612151627.uBFGRdrS087514@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org
 using -f
From: "Pedro F. Giffuni" <pfg@FreeBSD.org>
Date: Thu, 15 Dec 2016 16:27:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-svnadmin@freebsd.org
Subject: svn commit: r310119 - svnadmin/conf
X-SVN-Group: svnadmin
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 16:27:40 -0000

Author: pfg
Date: Thu Dec 15 16:27:39 2016
New Revision: 310119
URL: https://svnweb.freebsd.org/changeset/base/310119

Log:
  Give a warm welcome to Piotr Stefaniak to the src committer team.
  
  He will be working on much needed improvements to our indent(1) utility.
  
  Approved by:	core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==============================================================================
--- svnadmin/conf/access	Thu Dec 15 16:13:52 2016	(r310118)
+++ svnadmin/conf/access	Thu Dec 15 16:27:39 2016	(r310119)
@@ -192,6 +192,7 @@ pjd
 pkelsey
 pluknet
 ps
+pstef
 qingli
 raj
 ray

Modified: svnadmin/conf/mentors
==============================================================================
--- svnadmin/conf/mentors	Thu Dec 15 16:13:52 2016	(r310118)
+++ svnadmin/conf/mentors	Thu Dec 15 16:27:39 2016	(r310119)
@@ -34,6 +34,7 @@ mizhka		adrian		Co-mentor: cognet
 monthadar	adrian
 peterj		jhb		Co-mentor: grog
 phil		theraven	Co-mentor: sjg
+pstef		pfg
 slm		ken		Co-mentor: scottl, ambrisko
 snb		dwmalone
 stevek		sjg

From owner-svn-src-all@freebsd.org  Thu Dec 15 16:51:35 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69692C81AC0;
 Thu, 15 Dec 2016 16:51:35 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 371A71BD9;
 Thu, 15 Dec 2016 16:51:35 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBFGpYaO096534;
 Thu, 15 Dec 2016 16:51:34 GMT (envelope-from vangyzen@FreeBSD.org)
Received: (from vangyzen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFGpX7Y096522;
 Thu, 15 Dec 2016 16:51:33 GMT (envelope-from vangyzen@FreeBSD.org)
Message-Id: <201612151651.uBFGpX7Y096522@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
 vangyzen@FreeBSD.org using -f
From: Eric van Gyzen <vangyzen@FreeBSD.org>
Date: Thu, 15 Dec 2016 16:51:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310120 - in stable/11: bin/ps lib/libkvm
 sys/compat/freebsd32 sys/kern sys/sys usr.bin/procstat usr.bin/top
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 16:51:35 -0000

Author: vangyzen
Date: Thu Dec 15 16:51:33 2016
New Revision: 310120
URL: https://svnweb.freebsd.org/changeset/base/310120

Log:
  MFC r309676
  
  Export the whole thread name in kinfo_proc
  
  kinfo_proc::ki_tdname is three characters shorter than
  thread::td_name.  Add a ki_moretdname field for these three
  extra characters.  Add the new field to kinfo_proc32, as well.
  Update all in-tree consumers to read the new field and assemble
  the full name, except for lldb's HostThreadFreeBSD.cpp, which
  I will handle separately.  Bump __FreeBSD_version.
  
  Sponsored by:	Dell EMC

Modified:
  stable/11/bin/ps/print.c
  stable/11/lib/libkvm/kvm_proc.c
  stable/11/sys/compat/freebsd32/freebsd32.h
  stable/11/sys/kern/kern_proc.c
  stable/11/sys/sys/param.h
  stable/11/sys/sys/user.h
  stable/11/usr.bin/procstat/procstat.c
  stable/11/usr.bin/procstat/procstat.h
  stable/11/usr.bin/procstat/procstat_cs.c
  stable/11/usr.bin/procstat/procstat_kstack.c
  stable/11/usr.bin/procstat/procstat_threads.c
  stable/11/usr.bin/top/machine.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/ps/print.c
==============================================================================
--- stable/11/bin/ps/print.c	Thu Dec 15 16:27:39 2016	(r310119)
+++ stable/11/bin/ps/print.c	Thu Dec 15 16:51:33 2016	(r310120)
@@ -120,11 +120,12 @@ command(KINFO *k, VARENT *ve)
 	if (cflag) {
 		/* If it is the last field, then don't pad */
 		if (STAILQ_NEXT(ve, next_ve) == NULL) {
-			asprintf(&str, "%s%s%s%s",
+			asprintf(&str, "%s%s%s%s%s",
 			    k->ki_d.prefix ? k->ki_d.prefix : "",
 			    k->ki_p->ki_comm,
 			    (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "",
-			    (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "");
+			    (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "",
+			    (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_moretdname : "");
 		} else
 			str = strdup(k->ki_p->ki_comm);
 
@@ -172,14 +173,16 @@ ucomm(KINFO *k, VARENT *ve)
 	char *str;
 
 	if (STAILQ_NEXT(ve, next_ve) == NULL) {	/* last field, don't pad */
-		asprintf(&str, "%s%s%s%s",
+		asprintf(&str, "%s%s%s%s%s",
 		    k->ki_d.prefix ? k->ki_d.prefix : "",
 		    k->ki_p->ki_comm,
 		    (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "",
-		    (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "");
+		    (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "",
+		    (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_moretdname : "");
 	} else {
 		if (showthreads && k->ki_p->ki_numthreads > 1)
-			asprintf(&str, "%s/%s", k->ki_p->ki_comm, k->ki_p->ki_tdname);
+			asprintf(&str, "%s/%s%s", k->ki_p->ki_comm,
+			    k->ki_p->ki_tdname, k->ki_p->ki_moretdname);
 		else
 			str = strdup(k->ki_p->ki_comm);
 	}
@@ -192,7 +195,8 @@ tdnam(KINFO *k, VARENT *ve __unused)
 	char *str;
 
 	if (showthreads && k->ki_p->ki_numthreads > 1)
-		str = strdup(k->ki_p->ki_tdname);
+		asprintf(&str, "%s%s", k->ki_p->ki_tdname,
+		    k->ki_p->ki_moretdname);
 	else
 		str = strdup("      ");
 

Modified: stable/11/lib/libkvm/kvm_proc.c
==============================================================================
--- stable/11/lib/libkvm/kvm_proc.c	Thu Dec 15 16:27:39 2016	(r310119)
+++ stable/11/lib/libkvm/kvm_proc.c	Thu Dec 15 16:51:33 2016	(r310120)
@@ -426,8 +426,6 @@ nopgrp:
 			kp->ki_pri.pri_native = mtd.td_base_pri;
 			kp->ki_lastcpu = mtd.td_lastcpu;
 			kp->ki_wchan = mtd.td_wchan;
-			if (mtd.td_name[0] != 0)
-				strlcpy(kp->ki_tdname, mtd.td_name, MAXCOMLEN);
 			kp->ki_oncpu = mtd.td_oncpu;
 			if (mtd.td_name[0] != '\0')
 				strlcpy(kp->ki_tdname, mtd.td_name, sizeof(kp->ki_tdname));

Modified: stable/11/sys/compat/freebsd32/freebsd32.h
==============================================================================
--- stable/11/sys/compat/freebsd32/freebsd32.h	Thu Dec 15 16:27:39 2016	(r310119)
+++ stable/11/sys/compat/freebsd32/freebsd32.h	Thu Dec 15 16:51:33 2016	(r310120)
@@ -315,7 +315,8 @@ struct kinfo_proc32 {
 	char	ki_comm[COMMLEN+1];
 	char	ki_emul[KI_EMULNAMELEN+1];
 	char	ki_loginclass[LOGINCLASSLEN+1];
-	char	ki_sparestrings[50];
+	char	ki_moretdname[MAXCOMLEN-TDNAMLEN+1];
+	char	ki_sparestrings[46];
 	int	ki_spareints[KI_NSPARE_INT];
 	int	ki_oncpu;
 	int	ki_lastcpu;

Modified: stable/11/sys/kern/kern_proc.c
==============================================================================
--- stable/11/sys/kern/kern_proc.c	Thu Dec 15 16:27:39 2016	(r310119)
+++ stable/11/sys/kern/kern_proc.c	Thu Dec 15 16:51:33 2016	(r310120)
@@ -1034,7 +1034,14 @@ fill_kinfo_thread(struct thread *td, str
 		strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg));
 	else
 		bzero(kp->ki_wmesg, sizeof(kp->ki_wmesg));
-	strlcpy(kp->ki_tdname, td->td_name, sizeof(kp->ki_tdname));
+	if (strlcpy(kp->ki_tdname, td->td_name, sizeof(kp->ki_tdname)) >=
+	    sizeof(kp->ki_tdname)) {
+		strlcpy(kp->ki_moretdname,
+		    td->td_name + sizeof(kp->ki_tdname) - 1,
+		    sizeof(kp->ki_moretdname));
+	} else {
+		bzero(kp->ki_moretdname, sizeof(kp->ki_moretdname));
+	}
 	if (TD_ON_LOCK(td)) {
 		kp->ki_kiflag |= KI_LOCKBLOCK;
 		strlcpy(kp->ki_lockname, td->td_lockname,
@@ -1279,6 +1286,7 @@ freebsd32_kinfo_proc_out(const struct ki
 	bcopy(ki->ki_comm, ki32->ki_comm, COMMLEN + 1);
 	bcopy(ki->ki_emul, ki32->ki_emul, KI_EMULNAMELEN + 1);
 	bcopy(ki->ki_loginclass, ki32->ki_loginclass, LOGINCLASSLEN + 1);
+	bcopy(ki->ki_moretdname, ki32->ki_moretdname, MAXCOMLEN - TDNAMLEN + 1);
 	CP(*ki, *ki32, ki_tracer);
 	CP(*ki, *ki32, ki_flag2);
 	CP(*ki, *ki32, ki_fibnum);

Modified: stable/11/sys/sys/param.h
==============================================================================
--- stable/11/sys/sys/param.h	Thu Dec 15 16:27:39 2016	(r310119)
+++ stable/11/sys/sys/param.h	Thu Dec 15 16:51:33 2016	(r310120)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100506	/* Master, propagated to newvers */
+#define __FreeBSD_version 1100507	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

Modified: stable/11/sys/sys/user.h
==============================================================================
--- stable/11/sys/sys/user.h	Thu Dec 15 16:27:39 2016	(r310119)
+++ stable/11/sys/sys/user.h	Thu Dec 15 16:51:33 2016	(r310120)
@@ -180,12 +180,13 @@ struct kinfo_proc {
 	char	ki_comm[COMMLEN+1];	/* command name */
 	char	ki_emul[KI_EMULNAMELEN+1];  /* emulation name */
 	char	ki_loginclass[LOGINCLASSLEN+1]; /* login class */
+	char	ki_moretdname[MAXCOMLEN-TDNAMLEN+1];	/* more thread name */
 	/*
 	 * When adding new variables, take space for char-strings from the
 	 * front of ki_sparestrings, and ints from the end of ki_spareints.
 	 * That way the spare room from both arrays will remain contiguous.
 	 */
-	char	ki_sparestrings[50];	/* spare string space */
+	char	ki_sparestrings[46];	/* spare string space */
 	int	ki_spareints[KI_NSPARE_INT];	/* spare room for growth */
 	int	ki_oncpu;		/* Which cpu we are on */
 	int	ki_lastcpu;		/* Last cpu we were on */

Modified: stable/11/usr.bin/procstat/procstat.c
==============================================================================
--- stable/11/usr.bin/procstat/procstat.c	Thu Dec 15 16:27:39 2016	(r310119)
+++ stable/11/usr.bin/procstat/procstat.c	Thu Dec 15 16:51:33 2016	(r310120)
@@ -35,6 +35,7 @@
 #include <libprocstat.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sysexits.h>
 #include <unistd.h>
 
@@ -126,6 +127,21 @@ kinfo_proc_sort(struct kinfo_proc *kipp,
 	qsort(kipp, count, sizeof(*kipp), kinfo_proc_compare);
 }
 
+const char *
+kinfo_proc_thread_name(const struct kinfo_proc *kipp)
+{
+	static char name[MAXCOMLEN+1];
+
+	strlcpy(name, kipp->ki_tdname, sizeof(name));
+	strlcat(name, kipp->ki_moretdname, sizeof(name));
+	if (name[0] == '\0' || strcmp(kipp->ki_comm, name) == 0) {
+		name[0] = '-';
+		name[1] = '\0';
+	}
+
+	return (name);
+}
+
 int
 main(int argc, char *argv[])
 {

Modified: stable/11/usr.bin/procstat/procstat.h
==============================================================================
--- stable/11/usr.bin/procstat/procstat.h	Thu Dec 15 16:27:39 2016	(r310119)
+++ stable/11/usr.bin/procstat/procstat.h	Thu Dec 15 16:51:33 2016	(r310120)
@@ -38,6 +38,7 @@ extern int	hflag, nflag, Cflag, Hflag;
 
 struct kinfo_proc;
 void	kinfo_proc_sort(struct kinfo_proc *kipp, int count);
+const char *	kinfo_proc_thread_name(const struct kinfo_proc *kipp);
 
 void	procstat_args(struct procstat *prstat, struct kinfo_proc *kipp);
 void	procstat_auxv(struct procstat *prstat, struct kinfo_proc *kipp);

Modified: stable/11/usr.bin/procstat/procstat_cs.c
==============================================================================
--- stable/11/usr.bin/procstat/procstat_cs.c	Thu Dec 15 16:27:39 2016	(r310119)
+++ stable/11/usr.bin/procstat/procstat_cs.c	Thu Dec 15 16:51:33 2016	(r310120)
@@ -53,7 +53,7 @@ procstat_cs(struct procstat *procstat, s
 	int once, twice, lastcpu, cpu;
 
 	if (!hflag)
-		xo_emit("{T:/%5s %6s %-16s %-16s %2s %4s %-7s}\n", "PID",
+		xo_emit("{T:/%5s %6s %-19s %-19s %2s %4s %-7s}\n", "PID",
 		    "TID", "COMM", "TDNAME", "CPU", "CSID", "CPU MASK");
 
 	kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD,
@@ -65,11 +65,10 @@ procstat_cs(struct procstat *procstat, s
 		kipp = &kip[i];
 		xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid);
 		xo_emit("{:thread_id/%6d/%d} ", kipp->ki_tid);
-		xo_emit("{:command/%-16s/%s} ", strlen(kipp->ki_comm) ?
+		xo_emit("{:command/%-19s/%s} ", strlen(kipp->ki_comm) ?
 		    kipp->ki_comm : "-");
-		xo_emit("{:thread_name/%-16s/%s} ", (strlen(kipp->ki_tdname) &&
-		    (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ?
-		    kipp->ki_tdname : "-");
+		xo_emit("{:thread_name/%-19s/%s} ",
+                    kinfo_proc_thread_name(kipp));
 		if (kipp->ki_oncpu != 255)
 			xo_emit("{:cpu/%3d/%d} ", kipp->ki_oncpu);
 		else if (kipp->ki_lastcpu != 255)

Modified: stable/11/usr.bin/procstat/procstat_kstack.c
==============================================================================
--- stable/11/usr.bin/procstat/procstat_kstack.c	Thu Dec 15 16:27:39 2016	(r310119)
+++ stable/11/usr.bin/procstat/procstat_kstack.c	Thu Dec 15 16:51:33 2016	(r310120)
@@ -171,7 +171,7 @@ procstat_kstack(struct procstat *procsta
 	unsigned int kip_count, kstk_count;
 
 	if (!hflag)
-		xo_emit("{T:/%5s %6s %-16s %-16s %-29s}\n", "PID", "TID", "COMM",
+		xo_emit("{T:/%5s %6s %-19s %-19s %-29s}\n", "PID", "TID", "COMM",
 		    "TDNAME", "KSTACK");
 
 	kkstp = kkstp_free = procstat_getkstack(procstat, kipp, &kstk_count);
@@ -208,10 +208,9 @@ procstat_kstack(struct procstat *procsta
 
 		xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid);
 		xo_emit("{:thread_id/%6d/%d} ", kkstp->kkst_tid);
-		xo_emit("{:command/%-16s/%s} ", kipp->ki_comm);
-		xo_emit("{:thread_name/%-16s/%s} ", (strlen(kipp->ki_tdname) &&
-		    (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ?
-		    kipp->ki_tdname : "-");
+		xo_emit("{:command/%-19s/%s} ", kipp->ki_comm);
+		xo_emit("{:thread_name/%-19s/%s} ",
+                    kinfo_proc_thread_name(kipp));
 
 		switch (kkstp->kkst_state) {
 		case KKST_STATE_RUNNING:

Modified: stable/11/usr.bin/procstat/procstat_threads.c
==============================================================================
--- stable/11/usr.bin/procstat/procstat_threads.c	Thu Dec 15 16:27:39 2016	(r310119)
+++ stable/11/usr.bin/procstat/procstat_threads.c	Thu Dec 15 16:51:33 2016	(r310120)
@@ -49,7 +49,7 @@ procstat_threads(struct procstat *procst
 	char *threadid;
 
 	if (!hflag)
-		xo_emit("{T:/%5s %6s %-16s %-16s %2s %4s %-7s %-9s}\n", "PID",
+		xo_emit("{T:/%5s %6s %-19s %-19s %2s %4s %-7s %-9s}\n", "PID",
 		    "TID", "COMM", "TDNAME", "CPU", "PRI", "STATE", "WCHAN");
 
 	xo_emit("{ek:process_id/%d}", kipp->ki_pid);
@@ -71,11 +71,10 @@ procstat_threads(struct procstat *procst
 		xo_open_container(threadid);
 		xo_emit("{dk:process_id/%5d/%d} ", kipp->ki_pid);
 		xo_emit("{:thread_id/%6d/%d} ", kipp->ki_tid);
-		xo_emit("{d:command/%-16s/%s} ", strlen(kipp->ki_comm) ?
+		xo_emit("{d:command/%-19s/%s} ", strlen(kipp->ki_comm) ?
 		    kipp->ki_comm : "-");
-		xo_emit("{:thread_name/%-16s/%s} ", (strlen(kipp->ki_tdname) &&
-		    (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ?
-		    kipp->ki_tdname : "-");
+		xo_emit("{:thread_name/%-19s/%s} ",
+		    kinfo_proc_thread_name(kipp));
 		if (kipp->ki_oncpu != 255)
 			xo_emit("{:cpu/%3d/%d} ", kipp->ki_oncpu);
 		else if (kipp->ki_lastcpu != 255)

Modified: stable/11/usr.bin/top/machine.c
==============================================================================
--- stable/11/usr.bin/top/machine.c	Thu Dec 15 16:27:39 2016	(r310119)
+++ stable/11/usr.bin/top/machine.c	Thu Dec 15 16:51:33 2016	(r310120)
@@ -991,8 +991,8 @@ format_next_process(caddr_t handle, char
 	if (!(flags & FMT_SHOWARGS)) {
 		if (ps.thread && pp->ki_flag & P_HADTHREADS &&
 		    pp->ki_tdname[0]) {
-			snprintf(cmdbuf, cmdlen, "%s{%s}", pp->ki_comm,
-			    pp->ki_tdname);
+			snprintf(cmdbuf, cmdlen, "%s{%s%s}", pp->ki_comm,
+			    pp->ki_tdname, pp->ki_moretdname);
 		} else {
 			snprintf(cmdbuf, cmdlen, "%s", pp->ki_comm);
 		}
@@ -1004,7 +1004,8 @@ format_next_process(caddr_t handle, char
 			if (ps.thread && pp->ki_flag & P_HADTHREADS &&
 		    	    pp->ki_tdname[0]) {
 				snprintf(cmdbuf, cmdlen,
-				    "[%s{%s}]", pp->ki_comm, pp->ki_tdname);
+				    "[%s{%s%s}]", pp->ki_comm, pp->ki_tdname,
+				    pp->ki_moretdname);
 			} else {
 				snprintf(cmdbuf, cmdlen,
 				    "[%s]", pp->ki_comm);
@@ -1052,8 +1053,9 @@ format_next_process(caddr_t handle, char
 				if (ps.thread && pp->ki_flag & P_HADTHREADS &&
 				    pp->ki_tdname[0])
 					snprintf(cmdbuf, cmdlen,
-					    "%s (%s){%s}", argbuf, pp->ki_comm,
-					    pp->ki_tdname);
+					    "%s (%s){%s%s}", argbuf,
+					    pp->ki_comm, pp->ki_tdname,
+					    pp->ki_moretdname);
 				else
 					snprintf(cmdbuf, cmdlen,
 					    "%s (%s)", argbuf, pp->ki_comm);
@@ -1061,7 +1063,8 @@ format_next_process(caddr_t handle, char
 				if (ps.thread && pp->ki_flag & P_HADTHREADS &&
 				    pp->ki_tdname[0])
 					snprintf(cmdbuf, cmdlen,
-					    "%s{%s}", argbuf, pp->ki_tdname);
+					    "%s{%s%s}", argbuf, pp->ki_tdname,
+					    pp->ki_moretdname);
 				else
 					strlcpy(cmdbuf, argbuf, cmdlen);
 			}

From owner-svn-src-all@freebsd.org  Thu Dec 15 16:52:19 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C83A2C81B67;
 Thu, 15 Dec 2016 16:52:19 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 95BF71EDB;
 Thu, 15 Dec 2016 16:52:19 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBFGqIP5098695;
 Thu, 15 Dec 2016 16:52:18 GMT (envelope-from vangyzen@FreeBSD.org)
Received: (from vangyzen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFGqHRq098683;
 Thu, 15 Dec 2016 16:52:17 GMT (envelope-from vangyzen@FreeBSD.org)
Message-Id: <201612151652.uBFGqHRq098683@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to
 vangyzen@FreeBSD.org using -f
From: Eric van Gyzen <vangyzen@FreeBSD.org>
Date: Thu, 15 Dec 2016 16:52:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310121 - in stable/10: bin/ps lib/libkvm
 sys/compat/freebsd32 sys/kern sys/sys usr.bin/procstat usr.bin/top
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 16:52:19 -0000

Author: vangyzen
Date: Thu Dec 15 16:52:17 2016
New Revision: 310121
URL: https://svnweb.freebsd.org/changeset/base/310121

Log:
  MFC r309676
  
  Export the whole thread name in kinfo_proc
  
  kinfo_proc::ki_tdname is three characters shorter than
  thread::td_name.  Add a ki_moretdname field for these three
  extra characters.  Add the new field to kinfo_proc32, as well.
  Update all in-tree consumers to read the new field and assemble
  the full name, except for lldb's HostThreadFreeBSD.cpp, which
  I will handle separately.  Bump __FreeBSD_version.
  
  Sponsored by:	Dell EMC

Modified:
  stable/10/bin/ps/print.c
  stable/10/lib/libkvm/kvm_proc.c
  stable/10/sys/compat/freebsd32/freebsd32.h
  stable/10/sys/kern/kern_proc.c
  stable/10/sys/sys/param.h
  stable/10/sys/sys/user.h
  stable/10/usr.bin/procstat/procstat.c
  stable/10/usr.bin/procstat/procstat.h
  stable/10/usr.bin/procstat/procstat_cs.c
  stable/10/usr.bin/procstat/procstat_kstack.c
  stable/10/usr.bin/procstat/procstat_threads.c
  stable/10/usr.bin/top/machine.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/bin/ps/print.c
==============================================================================
--- stable/10/bin/ps/print.c	Thu Dec 15 16:51:33 2016	(r310120)
+++ stable/10/bin/ps/print.c	Thu Dec 15 16:52:17 2016	(r310121)
@@ -119,11 +119,12 @@ command(KINFO *k, VARENT *ve)
 	if (cflag) {
 		/* If it is the last field, then don't pad */
 		if (STAILQ_NEXT(ve, next_ve) == NULL) {
-			asprintf(&str, "%s%s%s%s",
+			asprintf(&str, "%s%s%s%s%s",
 			    k->ki_d.prefix ? k->ki_d.prefix : "",
 			    k->ki_p->ki_comm,
 			    (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "",
-			    (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "");
+			    (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "",
+			    (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_moretdname : "");
 		} else
 			str = strdup(k->ki_p->ki_comm);
 
@@ -171,14 +172,16 @@ ucomm(KINFO *k, VARENT *ve)
 	char *str;
 
 	if (STAILQ_NEXT(ve, next_ve) == NULL) {	/* last field, don't pad */
-		asprintf(&str, "%s%s%s%s",
+		asprintf(&str, "%s%s%s%s%s",
 		    k->ki_d.prefix ? k->ki_d.prefix : "",
 		    k->ki_p->ki_comm,
 		    (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "",
-		    (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "");
+		    (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "",
+		    (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_moretdname : "");
 	} else {
 		if (showthreads && k->ki_p->ki_numthreads > 1)
-			asprintf(&str, "%s/%s", k->ki_p->ki_comm, k->ki_p->ki_tdname);
+			asprintf(&str, "%s/%s%s", k->ki_p->ki_comm,
+			    k->ki_p->ki_tdname, k->ki_p->ki_moretdname);
 		else
 			str = strdup(k->ki_p->ki_comm);
 	}
@@ -191,7 +194,8 @@ tdnam(KINFO *k, VARENT *ve __unused)
 	char *str;
 
 	if (showthreads && k->ki_p->ki_numthreads > 1)
-		str = strdup(k->ki_p->ki_tdname);
+		asprintf(&str, "%s%s", k->ki_p->ki_tdname,
+		    k->ki_p->ki_moretdname);
 	else
 		str = strdup("      ");
 

Modified: stable/10/lib/libkvm/kvm_proc.c
==============================================================================
--- stable/10/lib/libkvm/kvm_proc.c	Thu Dec 15 16:51:33 2016	(r310120)
+++ stable/10/lib/libkvm/kvm_proc.c	Thu Dec 15 16:52:17 2016	(r310121)
@@ -424,8 +424,6 @@ nopgrp:
 			kp->ki_pri.pri_native = mtd.td_base_pri;
 			kp->ki_lastcpu = mtd.td_lastcpu;
 			kp->ki_wchan = mtd.td_wchan;
-			if (mtd.td_name[0] != 0)
-				strlcpy(kp->ki_tdname, mtd.td_name, MAXCOMLEN);
 			kp->ki_oncpu = mtd.td_oncpu;
 			if (mtd.td_name[0] != '\0')
 				strlcpy(kp->ki_tdname, mtd.td_name, sizeof(kp->ki_tdname));

Modified: stable/10/sys/compat/freebsd32/freebsd32.h
==============================================================================
--- stable/10/sys/compat/freebsd32/freebsd32.h	Thu Dec 15 16:51:33 2016	(r310120)
+++ stable/10/sys/compat/freebsd32/freebsd32.h	Thu Dec 15 16:52:17 2016	(r310121)
@@ -315,7 +315,8 @@ struct kinfo_proc32 {
 	char	ki_comm[COMMLEN+1];
 	char	ki_emul[KI_EMULNAMELEN+1];
 	char	ki_loginclass[LOGINCLASSLEN+1];
-	char	ki_sparestrings[50];
+	char	ki_moretdname[MAXCOMLEN-TDNAMLEN+1];
+	char	ki_sparestrings[46];
 	int	ki_spareints[KI_NSPARE_INT];
 	int	ki_flag2;
 	int	ki_fibnum;

Modified: stable/10/sys/kern/kern_proc.c
==============================================================================
--- stable/10/sys/kern/kern_proc.c	Thu Dec 15 16:51:33 2016	(r310120)
+++ stable/10/sys/kern/kern_proc.c	Thu Dec 15 16:52:17 2016	(r310121)
@@ -959,7 +959,14 @@ fill_kinfo_thread(struct thread *td, str
 		strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg));
 	else
 		bzero(kp->ki_wmesg, sizeof(kp->ki_wmesg));
-	strlcpy(kp->ki_tdname, td->td_name, sizeof(kp->ki_tdname));
+	if (strlcpy(kp->ki_tdname, td->td_name, sizeof(kp->ki_tdname)) >=
+	    sizeof(kp->ki_tdname)) {
+		strlcpy(kp->ki_moretdname,
+		    td->td_name + sizeof(kp->ki_tdname) - 1,
+		    sizeof(kp->ki_moretdname));
+	} else {
+		bzero(kp->ki_moretdname, sizeof(kp->ki_moretdname));
+	}
 	if (TD_ON_LOCK(td)) {
 		kp->ki_kiflag |= KI_LOCKBLOCK;
 		strlcpy(kp->ki_lockname, td->td_lockname,
@@ -1180,6 +1187,7 @@ freebsd32_kinfo_proc_out(const struct ki
 	bcopy(ki->ki_comm, ki32->ki_comm, COMMLEN + 1);
 	bcopy(ki->ki_emul, ki32->ki_emul, KI_EMULNAMELEN + 1);
 	bcopy(ki->ki_loginclass, ki32->ki_loginclass, LOGINCLASSLEN + 1);
+	bcopy(ki->ki_moretdname, ki32->ki_moretdname, MAXCOMLEN - TDNAMLEN + 1);
 	CP(*ki, *ki32, ki_flag2);
 	CP(*ki, *ki32, ki_fibnum);
 	CP(*ki, *ki32, ki_cr_flags);

Modified: stable/10/sys/sys/param.h
==============================================================================
--- stable/10/sys/sys/param.h	Thu Dec 15 16:51:33 2016	(r310120)
+++ stable/10/sys/sys/param.h	Thu Dec 15 16:52:17 2016	(r310121)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1003510	/* Master, propagated to newvers */
+#define __FreeBSD_version 1003511	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

Modified: stable/10/sys/sys/user.h
==============================================================================
--- stable/10/sys/sys/user.h	Thu Dec 15 16:51:33 2016	(r310120)
+++ stable/10/sys/sys/user.h	Thu Dec 15 16:52:17 2016	(r310121)
@@ -180,12 +180,13 @@ struct kinfo_proc {
 	char	ki_comm[COMMLEN+1];	/* command name */
 	char	ki_emul[KI_EMULNAMELEN+1];  /* emulation name */
 	char	ki_loginclass[LOGINCLASSLEN+1]; /* login class */
+	char	ki_moretdname[MAXCOMLEN-TDNAMLEN+1];	/* more thread name */
 	/*
 	 * When adding new variables, take space for char-strings from the
 	 * front of ki_sparestrings, and ints from the end of ki_spareints.
 	 * That way the spare room from both arrays will remain contiguous.
 	 */
-	char	ki_sparestrings[50];	/* spare string space */
+	char	ki_sparestrings[46];	/* spare string space */
 	int	ki_spareints[KI_NSPARE_INT];	/* spare room for growth */
 	int	ki_flag2;		/* P2_* flags */
 	int	ki_fibnum;		/* Default FIB number */

Modified: stable/10/usr.bin/procstat/procstat.c
==============================================================================
--- stable/10/usr.bin/procstat/procstat.c	Thu Dec 15 16:51:33 2016	(r310120)
+++ stable/10/usr.bin/procstat/procstat.c	Thu Dec 15 16:52:17 2016	(r310121)
@@ -34,6 +34,7 @@
 #include <libprocstat.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sysexits.h>
 #include <unistd.h>
 
@@ -115,6 +116,21 @@ kinfo_proc_sort(struct kinfo_proc *kipp,
 	qsort(kipp, count, sizeof(*kipp), kinfo_proc_compare);
 }
 
+const char *
+kinfo_proc_thread_name(const struct kinfo_proc *kipp)
+{
+	static char name[MAXCOMLEN+1];
+
+	strlcpy(name, kipp->ki_tdname, sizeof(name));
+	strlcat(name, kipp->ki_moretdname, sizeof(name));
+	if (name[0] == '\0' || strcmp(kipp->ki_comm, name) == 0) {
+		name[0] = '-';
+		name[1] = '\0';
+	}
+
+	return (name);
+}
+
 int
 main(int argc, char *argv[])
 {

Modified: stable/10/usr.bin/procstat/procstat.h
==============================================================================
--- stable/10/usr.bin/procstat/procstat.h	Thu Dec 15 16:51:33 2016	(r310120)
+++ stable/10/usr.bin/procstat/procstat.h	Thu Dec 15 16:52:17 2016	(r310121)
@@ -33,6 +33,7 @@ extern int	hflag, nflag, Cflag, Hflag;
 
 struct kinfo_proc;
 void	kinfo_proc_sort(struct kinfo_proc *kipp, int count);
+const char *	kinfo_proc_thread_name(const struct kinfo_proc *kipp);
 
 void	procstat_args(struct procstat *prstat, struct kinfo_proc *kipp);
 void	procstat_auxv(struct procstat *prstat, struct kinfo_proc *kipp);

Modified: stable/10/usr.bin/procstat/procstat_cs.c
==============================================================================
--- stable/10/usr.bin/procstat/procstat_cs.c	Thu Dec 15 16:51:33 2016	(r310120)
+++ stable/10/usr.bin/procstat/procstat_cs.c	Thu Dec 15 16:52:17 2016	(r310121)
@@ -50,7 +50,7 @@ procstat_cs(struct procstat *procstat, s
 	int once, twice, lastcpu, cpu;
 
 	if (!hflag)
-		printf("%5s %6s %-16s %-16s %2s %4s %-7s\n", "PID",
+		printf("%5s %6s %-19s %-19s %2s %4s %-7s\n", "PID",
 		    "TID", "COMM", "TDNAME", "CPU", "CSID", "CPU MASK");
 
 	kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD,
@@ -62,11 +62,9 @@ procstat_cs(struct procstat *procstat, s
 		kipp = &kip[i];
 		printf("%5d ", kipp->ki_pid);
 		printf("%6d ", kipp->ki_tid);
-		printf("%-16s ", strlen(kipp->ki_comm) ?
+		printf("%-19s ", strlen(kipp->ki_comm) ?
 		    kipp->ki_comm : "-");
-		printf("%-16s ", (strlen(kipp->ki_tdname) &&
-		    (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ?
-		    kipp->ki_tdname : "-");
+		printf("%-19s ", kinfo_proc_thread_name(kipp));
 		if (kipp->ki_oncpu != 255)
 			printf("%3d ", kipp->ki_oncpu);
 		else if (kipp->ki_lastcpu != 255)

Modified: stable/10/usr.bin/procstat/procstat_kstack.c
==============================================================================
--- stable/10/usr.bin/procstat/procstat_kstack.c	Thu Dec 15 16:51:33 2016	(r310120)
+++ stable/10/usr.bin/procstat/procstat_kstack.c	Thu Dec 15 16:52:17 2016	(r310121)
@@ -134,7 +134,7 @@ procstat_kstack(struct procstat *procsta
 	unsigned int kip_count, kstk_count;
 
 	if (!hflag)
-		printf("%5s %6s %-16s %-16s %-29s\n", "PID", "TID", "COMM",
+		printf("%5s %6s %-19s %-19s %-29s\n", "PID", "TID", "COMM",
 		    "TDNAME", "KSTACK");
 
 	kkstp = kkstp_free = procstat_getkstack(procstat, kipp, &kstk_count);
@@ -171,10 +171,8 @@ procstat_kstack(struct procstat *procsta
 
 		printf("%5d ", kipp->ki_pid);
 		printf("%6d ", kkstp->kkst_tid);
-		printf("%-16s ", kipp->ki_comm);
-		printf("%-16s ", (strlen(kipp->ki_tdname) &&
-		    (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ?
-		    kipp->ki_tdname : "-");
+		printf("%-19s ", kipp->ki_comm);
+		printf("%-19s ", kinfo_proc_thread_name(kipp));
 
 		switch (kkstp->kkst_state) {
 		case KKST_STATE_RUNNING:

Modified: stable/10/usr.bin/procstat/procstat_threads.c
==============================================================================
--- stable/10/usr.bin/procstat/procstat_threads.c	Thu Dec 15 16:51:33 2016	(r310120)
+++ stable/10/usr.bin/procstat/procstat_threads.c	Thu Dec 15 16:52:17 2016	(r310121)
@@ -47,7 +47,7 @@ procstat_threads(struct procstat *procst
 	const char *str;
 
 	if (!hflag)
-		printf("%5s %6s %-16s %-16s %2s %4s %-7s %-9s\n", "PID",
+		printf("%5s %6s %-19s %-19s %2s %4s %-7s %-9s\n", "PID",
 		    "TID", "COMM", "TDNAME", "CPU", "PRI", "STATE", "WCHAN");
 
 	kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD,
@@ -59,11 +59,9 @@ procstat_threads(struct procstat *procst
 		kipp = &kip[i];
 		printf("%5d ", kipp->ki_pid);
 		printf("%6d ", kipp->ki_tid);
-		printf("%-16s ", strlen(kipp->ki_comm) ?
+		printf("%-19s ", strlen(kipp->ki_comm) ?
 		    kipp->ki_comm : "-");
-		printf("%-16s ", (strlen(kipp->ki_tdname) &&
-		    (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ?
-		    kipp->ki_tdname : "-");
+		printf("%-19s ", kinfo_proc_thread_name(kipp));
 		if (kipp->ki_oncpu != 255)
 			printf("%3d ", kipp->ki_oncpu);
 		else if (kipp->ki_lastcpu != 255)

Modified: stable/10/usr.bin/top/machine.c
==============================================================================
--- stable/10/usr.bin/top/machine.c	Thu Dec 15 16:51:33 2016	(r310120)
+++ stable/10/usr.bin/top/machine.c	Thu Dec 15 16:52:17 2016	(r310121)
@@ -889,8 +889,8 @@ format_next_process(caddr_t handle, char
 	if (!(flags & FMT_SHOWARGS)) {
 		if (ps.thread && pp->ki_flag & P_HADTHREADS &&
 		    pp->ki_tdname[0]) {
-			snprintf(cmdbuf, cmdlen, "%s{%s}", pp->ki_comm,
-			    pp->ki_tdname);
+			snprintf(cmdbuf, cmdlen, "%s{%s%s}", pp->ki_comm,
+			    pp->ki_tdname, pp->ki_moretdname);
 		} else {
 			snprintf(cmdbuf, cmdlen, "%s", pp->ki_comm);
 		}
@@ -902,7 +902,8 @@ format_next_process(caddr_t handle, char
 			if (ps.thread && pp->ki_flag & P_HADTHREADS &&
 		    	    pp->ki_tdname[0]) {
 				snprintf(cmdbuf, cmdlen,
-				    "[%s{%s}]", pp->ki_comm, pp->ki_tdname);
+				    "[%s{%s%s}]", pp->ki_comm, pp->ki_tdname,
+				    pp->ki_moretdname);
 			} else {
 				snprintf(cmdbuf, cmdlen,
 				    "[%s]", pp->ki_comm);
@@ -950,8 +951,9 @@ format_next_process(caddr_t handle, char
 				if (ps.thread && pp->ki_flag & P_HADTHREADS &&
 				    pp->ki_tdname[0])
 					snprintf(cmdbuf, cmdlen,
-					    "%s (%s){%s}", argbuf, pp->ki_comm,
-					    pp->ki_tdname);
+					    "%s (%s){%s%s}", argbuf,
+					    pp->ki_comm, pp->ki_tdname,
+					    pp->ki_moretdname);
 				else
 					snprintf(cmdbuf, cmdlen,
 					    "%s (%s)", argbuf, pp->ki_comm);
@@ -959,7 +961,8 @@ format_next_process(caddr_t handle, char
 				if (ps.thread && pp->ki_flag & P_HADTHREADS &&
 				    pp->ki_tdname[0])
 					snprintf(cmdbuf, cmdlen,
-					    "%s{%s}", argbuf, pp->ki_tdname);
+					    "%s{%s%s}", argbuf, pp->ki_tdname,
+					    pp->ki_moretdname);
 				else
 					strlcpy(cmdbuf, argbuf, cmdlen);
 			}

From owner-svn-src-all@freebsd.org  Thu Dec 15 17:26:17 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB026C819D0;
 Thu, 15 Dec 2016 17:26:17 +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 7BD2C17FA;
 Thu, 15 Dec 2016 17:26:17 +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 uBFHQGbX011884;
 Thu, 15 Dec 2016 17:26:16 GMT (envelope-from manu@FreeBSD.org)
Received: (from manu@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFHQG4A011883;
 Thu, 15 Dec 2016 17:26:16 GMT (envelope-from manu@FreeBSD.org)
Message-Id: <201612151726.uBFHQG4A011883@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: manu set sender to
 manu@FreeBSD.org using -f
From: Emmanuel Vadot <manu@FreeBSD.org>
Date: Thu, 15 Dec 2016 17:26:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310122 - head/sys/arm/allwinner/a64
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 17:26:17 -0000

Author: manu
Date: Thu Dec 15 17:26:16 2016
New Revision: 310122
URL: https://svnweb.freebsd.org/changeset/base/310122

Log:
  Fix building arm64 kernel after r310117
  
  Pointy hat: me
  
  MFC after:	3 days

Modified:
  head/sys/arm/allwinner/a64/a64_padconf.c
  head/sys/arm/allwinner/a64/a64_r_padconf.c

Modified: head/sys/arm/allwinner/a64/a64_padconf.c
==============================================================================
--- head/sys/arm/allwinner/a64/a64_padconf.c	Thu Dec 15 16:52:17 2016	(r310121)
+++ head/sys/arm/allwinner/a64/a64_padconf.c	Thu Dec 15 17:26:16 2016	(r310122)
@@ -41,16 +41,16 @@ __FBSDID("$FreeBSD$");
 #ifdef SOC_ALLWINNER_A64
 
 static const struct allwinner_pins a64_pins[] = {
-	{ "PB0",  1, 0,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", NULL, "pb_eint0" } 6, 0},
-	{ "PB1",  1, 1,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint1" } 6, 1},
-	{ "PB2",  1, 2,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint2" } 6, 2},
-	{ "PB3",  1, 3,   { "gpio_in", "gpio_out", "uart2", "i2s0", "jtag", "sim", "pb_eint3" } 6, 3},
-	{ "PB4",  1, 4,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint4" } 6, 4},
-	{ "PB5",  1, 5,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint5" } 6, 5},
-	{ "PB6",  1, 6,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint6" } 6, 6},
-	{ "PB7",  1, 7,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint7" } 6, 7},
-	{ "PB8",  1, 8,   { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint8" } 6, 8},
-	{ "PB9",  1, 9,   { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint9" } 6, 9},
+	{ "PB0",  1, 0,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", NULL, "pb_eint0" }, 6, 0},
+	{ "PB1",  1, 1,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint1" }, 6, 1},
+	{ "PB2",  1, 2,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint2" }, 6, 2},
+	{ "PB3",  1, 3,   { "gpio_in", "gpio_out", "uart2", "i2s0", "jtag", "sim", "pb_eint3" }, 6, 3},
+	{ "PB4",  1, 4,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint4" }, 6, 4},
+	{ "PB5",  1, 5,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint5" }, 6, 5},
+	{ "PB6",  1, 6,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint6" }, 6, 6},
+	{ "PB7",  1, 7,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint7" }, 6, 7},
+	{ "PB8",  1, 8,   { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint8" }, 6, 8},
+	{ "PB9",  1, 9,   { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint9" }, 6, 9},
 
 	{ "PC0",  2, 0,   { "gpio_in", "gpio_out", "nand", NULL, "spi0" } },
 	{ "PC1",  2, 1,   { "gpio_in", "gpio_out", "nand", "mmc2", "spi0" } },
@@ -123,33 +123,33 @@ static const struct allwinner_pins a64_p
 	{ "PF5",  5, 5,   { "gpio_in", "gpio_out", "mmc0", "jtag" } },
 	{ "PF6",  5, 6,   { "gpio_in", "gpio_out" } },
 
-	{ "PG0",  6, 0,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0" } 6, 0},
-	{ "PG1",  6, 1,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1" } 6, 1},
-	{ "PG2",  6, 2,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2" } 6, 2},
-	{ "PG3",  6, 3,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3" } 6, 3},
-	{ "PG4",  6, 4,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4" } 6, 4},
-	{ "PG5",  6, 5,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5" } 6, 5},
-	{ "PG6",  6, 6,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint6" } 6, 6},
-	{ "PG7",  6, 7,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint7" } 6, 7},
-	{ "PG8",  6, 8,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint8" } 6, 8},
-	{ "PG9",  6, 9,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint9" } 6, 9},
-	{ "PG10", 6, 10,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint10" } 6, 10},
-	{ "PG11", 6, 11,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint11" } 6, 11},
-	{ "PG12", 6, 12,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint12" } 6, 12},
-	{ "PG13", 6, 13,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint13" } 6, 13},
-
-	{ "PH0",  7, 0,   { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint0" } 6, 0},
-	{ "PH1",  7, 1,   { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint1" } 6, 1},
-	{ "PH2",  7, 2,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint2" } 6, 2},
-	{ "PH3",  7, 3,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint3" } 6, 3},
-	{ "PH4",  7, 4,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint4" } 6, 4},
-	{ "PH5",  7, 5,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint5" } 6, 5},
-	{ "PH6",  7, 6,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint6" } 6, 6},
-	{ "PH7",  7, 7,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint7" } 6, 7},
-	{ "PH8",  7, 8,   { "gpio_in", "gpio_out", "owa", NULL, NULL, NULL, "ph_eint8" } 6, 8},
-	{ "PH9",  7, 9,   { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint9" } 6, 9},
-	{ "PH10", 7, 10,  { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint10" } 6, 10},
-	{ "PH11", 7, 11,  { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint11" } 6, 11},
+	{ "PG0",  6, 0,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0" }, 6, 0},
+	{ "PG1",  6, 1,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1" }, 6, 1},
+	{ "PG2",  6, 2,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2" }, 6, 2},
+	{ "PG3",  6, 3,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3" }, 6, 3},
+	{ "PG4",  6, 4,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4" }, 6, 4},
+	{ "PG5",  6, 5,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5" }, 6, 5},
+	{ "PG6",  6, 6,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint6" }, 6, 6},
+	{ "PG7",  6, 7,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint7" }, 6, 7},
+	{ "PG8",  6, 8,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint8" }, 6, 8},
+	{ "PG9",  6, 9,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint9" }, 6, 9},
+	{ "PG10", 6, 10,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint10" }, 6, 10},
+	{ "PG11", 6, 11,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint11" }, 6, 11},
+	{ "PG12", 6, 12,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint12" }, 6, 12},
+	{ "PG13", 6, 13,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint13" }, 6, 13},
+
+	{ "PH0",  7, 0,   { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint0" }, 6, 0},
+	{ "PH1",  7, 1,   { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint1" }, 6, 1},
+	{ "PH2",  7, 2,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint2" }, 6, 2},
+	{ "PH3",  7, 3,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint3" }, 6, 3},
+	{ "PH4",  7, 4,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint4" }, 6, 4},
+	{ "PH5",  7, 5,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint5" }, 6, 5},
+	{ "PH6",  7, 6,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint6" }, 6, 6},
+	{ "PH7",  7, 7,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint7" }, 6, 7},
+	{ "PH8",  7, 8,   { "gpio_in", "gpio_out", "owa", NULL, NULL, NULL, "ph_eint8" }, 6, 8},
+	{ "PH9",  7, 9,   { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint9" }, 6, 9},
+	{ "PH10", 7, 10,  { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint10" }, 6, 10},
+	{ "PH11", 7, 11,  { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint11" }, 6, 11},
 };
 
 const struct allwinner_padconf a64_padconf = {

Modified: head/sys/arm/allwinner/a64/a64_r_padconf.c
==============================================================================
--- head/sys/arm/allwinner/a64/a64_r_padconf.c	Thu Dec 15 16:52:17 2016	(r310121)
+++ head/sys/arm/allwinner/a64/a64_r_padconf.c	Thu Dec 15 17:26:16 2016	(r310122)
@@ -41,19 +41,19 @@ __FBSDID("$FreeBSD$");
 #ifdef SOC_ALLWINNER_A64
 
 static const struct allwinner_pins a64_r_pins[] = {
-	{ "PL0",   0, 0,  { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint0" } 6, 0},
-	{ "PL1",   0, 1,  { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint1" } 6, 1},
-	{ "PL2",   0, 2,  { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint2" } 6, 2},
-	{ "PL3",   0, 3,  { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint3" } 6, 3},
-	{ "PL4",   0, 4,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint4" } 6, 4},
-	{ "PL5",   0, 5,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint5" } 6, 5},
-	{ "PL6",   0, 6,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint6" } 6, 6},
-	{ "PL7",   0, 7,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint7" } 6, 7},
-	{ "PL8",   0, 8,  { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint8" } 6, 8},
-	{ "PL9",   0, 9,  { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint9" } 6, 9},
-	{ "PL10",  0, 10, { "gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, "pl_eint10" } 6, 10},
-	{ "PL11",  0, 11, { "gpio_in", "gpio_out", "s_cir", NULL, NULL, NULL, "pl_eint11" } 6, 11},
-	{ "PL12",  0, 12, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint12" } 6, 12},
+	{ "PL0",   0, 0,  { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint0" }, 6, 0},
+	{ "PL1",   0, 1,  { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint1" }, 6, 1},
+	{ "PL2",   0, 2,  { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint2" }, 6, 2},
+	{ "PL3",   0, 3,  { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint3" }, 6, 3},
+	{ "PL4",   0, 4,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint4" }, 6, 4},
+	{ "PL5",   0, 5,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint5" }, 6, 5},
+	{ "PL6",   0, 6,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint6" }, 6, 6},
+	{ "PL7",   0, 7,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint7" }, 6, 7},
+	{ "PL8",   0, 8,  { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint8" }, 6, 8},
+	{ "PL9",   0, 9,  { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint9" }, 6, 9},
+	{ "PL10",  0, 10, { "gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, "pl_eint10" }, 6, 10},
+	{ "PL11",  0, 11, { "gpio_in", "gpio_out", "s_cir", NULL, NULL, NULL, "pl_eint11" }, 6, 11},
+	{ "PL12",  0, 12, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint12" }, 6, 12},
 };
 
 const struct allwinner_padconf a64_r_padconf = {

From owner-svn-src-all@freebsd.org  Thu Dec 15 17:36:56 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29AFCC81E24;
 Thu, 15 Dec 2016 17:36:56 +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 ED5EFE6;
 Thu, 15 Dec 2016 17:36:55 +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 uBFHatxM016049;
 Thu, 15 Dec 2016 17:36:55 GMT (envelope-from andrew@FreeBSD.org)
Received: (from andrew@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFHatUL016048;
 Thu, 15 Dec 2016 17:36:55 GMT (envelope-from andrew@FreeBSD.org)
Message-Id: <201612151736.uBFHatUL016048@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: andrew set sender to
 andrew@FreeBSD.org using -f
From: Andrew Turner <andrew@FreeBSD.org>
Date: Thu, 15 Dec 2016 17:36:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310124 - head/sys/boot/arm/uboot
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 17:36:56 -0000

Author: andrew
Date: Thu Dec 15 17:36:54 2016
New Revision: 310124
URL: https://svnweb.freebsd.org/changeset/base/310124

Log:
  Add -fPIC to the ubldr build. Without this the self relocation code will
  try to use an absolute address in a switch statement, jumping to an invalid
  memory location.
  
  Sponsored by:	ABT Systems Ltd

Modified:
  head/sys/boot/arm/uboot/Makefile

Modified: head/sys/boot/arm/uboot/Makefile
==============================================================================
--- head/sys/boot/arm/uboot/Makefile	Thu Dec 15 17:34:18 2016	(r310123)
+++ head/sys/boot/arm/uboot/Makefile	Thu Dec 15 17:36:54 2016	(r310124)
@@ -109,6 +109,8 @@ CFLAGS+=	-I${.OBJDIR}/../../uboot/lib
 # where to get libstand from
 CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
 
+CFLAGS+=	-fPIC
+
 # clang doesn't understand %D as a specifier to printf
 NO_WERROR.clang=
 

From owner-svn-src-all@freebsd.org  Thu Dec 15 17:39:55 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6835BC81025;
 Thu, 15 Dec 2016 17:39:55 +0000 (UTC)
 (envelope-from gleb.kurtsou@gmail.com)
Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com
 [IPv6:2607:f8b0:400e:c05::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 363E074B;
 Thu, 15 Dec 2016 17:39:55 +0000 (UTC)
 (envelope-from gleb.kurtsou@gmail.com)
Received: by mail-pg0-x244.google.com with SMTP id p66so6821815pga.2;
 Thu, 15 Dec 2016 09:39:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:date:from:to:cc:subject:message-id:mail-followup-to
 :references:mime-version:content-disposition:in-reply-to:user-agent;
 bh=aTIutUe6ETCaOsJY6g8T1Tm2HeZAsPMflARlk3QhTtM=;
 b=s0iCH43aTTDsgsgHlLAOiWocDhKPj6BHM7Mfe9g2jjYA/ijcX+fDH7bg69fcxGTMEP
 SxOyxlb3uh4X/u4ucoxPfdWkbKyVg5W1ish0t7c5+PyvaGRMDB4zJjNaLNmiDkRnrP7l
 qwBrpLCHZV72ZYvD/whVh2eozUiYajUBnS0Jpam1n1Ejfi20/u3Yqw2dpxraxlc8/b9w
 penuhr+WXRAdmwQj2pmdqSMGPTuZe1ndxLteBF9oQ2LIVskdVdph/rkVam7f4gsvcOa8
 BA1fd8SRj7IOeLt73pekAqjTvFHYm5AiXrOyKpT0FEwFHXbHqgRBvONg4iBWYNKSmMkV
 Si9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
 :mail-followup-to:references:mime-version:content-disposition
 :in-reply-to:user-agent;
 bh=aTIutUe6ETCaOsJY6g8T1Tm2HeZAsPMflARlk3QhTtM=;
 b=uGKxNxRrjnJlTWZui6gwIXyhwECx1E08eynTRILLkiQ053RKM4zpRWa41AAZDpEXQN
 elKB15bpT6pPopuyVtuJ3x0/HddKBbBZhcLhQZONRpZRGv0Fb+iUJ/IUiOnlVfYajfPu
 y/Y+sqMabVdR1Yqxrw1gWbnPKG0+iE4m3WhmGT8ORj/OvqQknKXxV6PKrLgb4NkkuyRa
 LMswYHZEKX/Ec1SeFMlduV2O/6EG0pw1l2bvzfReuuEsgA+cXMpx1xN5naTlPeS73nN8
 jo4mSk02GtwMONaQd+JQU3YlxYSjHG3jrDTgxgP68mRG8bRFEFvbrzTbtz5jHbJyhOk/
 vwDQ==
X-Gm-Message-State: AKaTC02cfwjlIGMSuTEz8p+AN79w79JAJJwX9ED/ooLGX31t1DpGqmw/HBO9CPmJRWN31A==
X-Received: by 10.84.169.169 with SMTP id h38mr4764001plb.48.1481823594481;
 Thu, 15 Dec 2016 09:39:54 -0800 (PST)
Received: from localhost ([71.202.69.99])
 by smtp.gmail.com with ESMTPSA id o68sm6001089pfb.42.2016.12.15.09.39.53
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 15 Dec 2016 09:39:53 -0800 (PST)
Sender: Gleb Kurtsou <gleb.kurtsou@gmail.com>
Date: Thu, 15 Dec 2016 09:37:21 -0800
From: Gleb Kurtsou <gleb@freebsd.org>
To: Konrad Witaszczyk <def@FreeBSD.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r309818 - in head: etc/defaults etc/rc.d sbin
 sbin/decryptcore sbin/dumpon sbin/savecore share/man/man5 sys/amd64/amd64
 sys/arm/arm sys/arm64/arm64 sys/conf sys/ddb sys/dev/null sys/geo...
Message-ID: <20161215173721.GA87535@reks>
Mail-Followup-To: Konrad Witaszczyk <def@FreeBSD.org>,
 src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
References: <201612101620.uBAGKdUg033773@repo.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <201612101620.uBAGKdUg033773@repo.freebsd.org>
User-Agent: Mutt/1.7.1 (2016-10-04)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 17:39:55 -0000

On (10/12/2016 16:20), Konrad Witaszczyk wrote:
> Author: def
> Date: Sat Dec 10 16:20:39 2016
> New Revision: 309818
> URL: https://svnweb.freebsd.org/changeset/base/309818
> 
> Log:
>   Add support for encrypted kernel crash dumps.

Thank you!

I'm very glad to see it committed.

From owner-svn-src-all@freebsd.org  Thu Dec 15 19:07:21 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B827C8247F;
 Thu, 15 Dec 2016 19:07: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 B0FE59A;
 Thu, 15 Dec 2016 19:07:20 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from [IPv6:2001:7b8:3a7::4ccf:cb4c:3c45:4bd1] (unknown
 [IPv6:2001:7b8:3a7:0:4ccf:cb4c:3c45:4bd1])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by tensor.andric.com (Postfix) with ESMTPSA id 9F79512CE8;
 Thu, 15 Dec 2016 20:07:17 +0100 (CET)
Content-Type: multipart/signed;
 boundary="Apple-Mail=_2D4DC76C-36BB-4B83-916F-EE047ABC0C69";
 protocol="application/pgp-signature"; micalg=pgp-sha1
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: Re: svn commit: r310086 - head/sys/dev/xen/blkfront
From: Dimitry Andric <dim@FreeBSD.org>
In-Reply-To: <0100015901493cd9-99c1edd7-8f8f-4a53-b86a-ae400a37f1c5-000000@email.amazonses.com>
Date: Thu, 15 Dec 2016 20:07:04 +0100
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Message-Id: <69D559F0-45E9-42DB-821A-864CEEB9C741@FreeBSD.org>
References: <201612141928.uBEJSJor074348@repo.freebsd.org>
 <0100015901493cd9-99c1edd7-8f8f-4a53-b86a-ae400a37f1c5-000000@email.amazonses.com>
To: Colin Percival <cperciva@tarsnap.com>
X-Mailer: Apple Mail (2.3124)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 19:07:21 -0000


--Apple-Mail=_2D4DC76C-36BB-4B83-916F-EE047ABC0C69
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii

On 15 Dec 2016, at 08:01, Colin Percival <cperciva@tarsnap.com> wrote:
> 
> On 12/14/16 11:28, Dimitry Andric wrote:
>> Log:
>>  In xbd_connect(), use correct scanf conversion specifiers for the
>>  feature_barrier and feature_flush variables.  Otherwise, adjacent
>>  variables on the stack, such as sector_size, may be overwritten, with
>>  disastrous results.
> 
> Thanks!  Did you happen to notice what stack variable (if any?) was being
> overwritten under clang 3.8.0?  Just wondering if there might be some
> undiscovered issue lurking in FreeBSD releases which will cause other less
> obvious problems.

Here is a little overview of the locations on the stack (e.g. offsets
from %rbp) with different compiler versions:

clang 3.8.x and earlier:
        [ -56: -48)     sectors
        [ -64: -56)     sector_size
        [ -72: -64)     phys_sector_size
        [ -76: -72)     binfo
        [ -80: -76)     feature_barrier
        [ -84: -80)     feature_flush

Here, writing 8 bytes of data to feature_barrier will most likely
overwrite binfo with zeroes, but since that is usually zero already,
not much will happen.

Similarly, writing 8 bytes of data to feature_flush will most likely
overwrite feature_barrier with zeroes, effectively always turning off
that feature.

clang 3.9.0 and later:
        [ -80: -72)     phys_sector_size
        [ -88: -80)     sector_size
        [ -92: -88)     feature_flush
        [ -96: -92)     feature_barrier
        [-104: -96)     indirectpages
        [-112:-104)     sectors
        [-132:-128)     binfo

As is now known, here the effect was that sector_size is effectively
zeroed when feature_flush is written.  Not good. :)

gcc 4.2.1:
        [ -44: -40)     binfo
        [ -48: -44)     feature_barrier
        [ -52: -48)     feature_flush
        [ -64: -56)     sectors
        [ -72: -64)     sector_size
        [ -80: -72)     phys_sector_size

For our base gcc, the results are similar to clang 3.8.x and earlier:
writing 8 bytes of data to feature_barrier will most likely overwrite
binfo with zeroes, to not much effect.  Same story for feature_flush.

gcc 6.2.0:
        [ -64: -56)     phys_sector_size
        [ -72: -64)     sector_size
        [ -80: -72)     sectors
        [ -84: -80)     feature_flush
        [ -88: -84)     feature_barrier
        [ -92: -88)     binfo

With a more recent version of gcc, writing 8 bytes of data to
feature_flush will most likely zero least significant half of sectors.
Unless the virtual disk has 2^32 or more sectors, it will turn up as
zero length.

-Dimitry


--Apple-Mail=_2D4DC76C-36BB-4B83-916F-EE047ABC0C69
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

iEYEARECAAYFAlhS6eUACgkQsF6jCi4glqP+7ACgh/RxNSTD+zFFuwBm97bj8xiB
IeUAoIDnfUyuK+dXuPezdOgCOXUb7kvl
=obF1
-----END PGP SIGNATURE-----

--Apple-Mail=_2D4DC76C-36BB-4B83-916F-EE047ABC0C69--

From owner-svn-src-all@freebsd.org  Thu Dec 15 20:00:22 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 676B0C8125B;
 Thu, 15 Dec 2016 20:00:22 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: from mail-qt0-f172.google.com (mail-qt0-f172.google.com
 [209.85.216.172])
 (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 2DD1F13F;
 Thu, 15 Dec 2016 20:00:21 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: by mail-qt0-f172.google.com with SMTP id w33so67698926qtc.3;
 Thu, 15 Dec 2016 12:00:21 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:reply-to:in-reply-to:references
 :from:date:message-id:subject:to:cc;
 bh=EIIgpZc3WLggh5FqFNUFW5Gb4iOvg4XboKLxr+SvAX8=;
 b=G7ZKAvJL51VakpNCHJ7KOV+XiPxbaTXUGHKAxuByvmj/+BW6l630yCX3OCAUJ6Wakr
 19cWdoPPEBWNhy4aBi5Qq+AnRgnNAqb4RFtzIreO5lPMMHjIe0IAB6XJfrUx+8Pyo+hR
 L+y0bo6++wkBJ29Rgo4Grf0iwxaE/trTxZ/IGHMTOItXpf9vrOqg/GXAog4YT+0rQtH6
 bjOE6OHv1HhJ68/FT3tsgdavCRjvokw4U8+kztuCW8RF31WYuql/foo/Snt1907xVxsH
 OkKd9BxOaX3/AJGeskPQj4Hc8hCgznkPOFEyQEL9lg0V0kcqpldOA01P9T8gAlFQp2zu
 MjvQ==
X-Gm-Message-State: AIkVDXIXPWBZf2vqv4VD+wqbojw+sq6QrCN8Rc6vbx9Ob+c2EAF8a5AwYXo9s0xfNbMIZg==
X-Received: by 10.237.39.37 with SMTP id n34mr1959172qtd.128.1481832018990;
 Thu, 15 Dec 2016 12:00:18 -0800 (PST)
Received: from mail-qk0-f176.google.com (mail-qk0-f176.google.com.
 [209.85.220.176])
 by smtp.gmail.com with ESMTPSA id h47sm1878448qtc.27.2016.12.15.12.00.18
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 15 Dec 2016 12:00:18 -0800 (PST)
Received: by mail-qk0-f176.google.com with SMTP id n204so68925449qke.2;
 Thu, 15 Dec 2016 12:00:18 -0800 (PST)
X-Received: by 10.55.115.6 with SMTP id o6mr2285914qkc.271.1481832016478; Thu,
 15 Dec 2016 12:00:16 -0800 (PST)
MIME-Version: 1.0
Reply-To: cem@freebsd.org
Received: by 10.200.58.165 with HTTP; Thu, 15 Dec 2016 12:00:16 -0800 (PST)
In-Reply-To: <201612151545.uBFFjBEL070679@repo.freebsd.org>
References: <201612151545.uBFFjBEL070679@repo.freebsd.org>
From: Conrad Meyer <cem@freebsd.org>
Date: Thu, 15 Dec 2016 12:00:16 -0800
X-Gmail-Original-Message-ID: <CAG6CVpV3APs_+z7Q-ZSqWSLNh7xMyKqMVjc6vXybg9fxDL+fvA@mail.gmail.com>
Message-ID: <CAG6CVpV3APs_+z7Q-ZSqWSLNh7xMyKqMVjc6vXybg9fxDL+fvA@mail.gmail.com>
Subject: Re: svn commit: r310116 - head/sys/kern
To: Ed Schouten <ed@freebsd.org>
Cc: src-committers <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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 20:00:22 -0000

Can we please slap names on these numbers?  Even if we keep the
existing numeric values?

Thanks,
Conrad

On Thu, Dec 15, 2016 at 7:45 AM, Ed Schouten <ed@freebsd.org> wrote:
> Author: ed
> Date: Thu Dec 15 15:45:11 2016
> New Revision: 310116
> URL: https://svnweb.freebsd.org/changeset/base/310116
>
> Log:
>   Document the existence of the {0, 6, ...} sysctl.
>
> Modified:
>   head/sys/kern/kern_sysctl.c
>
> Modified: head/sys/kern/kern_sysctl.c
> ==============================================================================
> --- head/sys/kern/kern_sysctl.c Thu Dec 15 15:35:53 2016        (r310115)
> +++ head/sys/kern/kern_sysctl.c Thu Dec 15 15:45:11 2016        (r310116)
> @@ -821,7 +821,8 @@ SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FI
>   * {0,2,...}   return the next OID.
>   * {0,3}       return the OID of the name in "new"
>   * {0,4,...}   return the kind & format info for the "..." OID.
> - * {0,5,...}   return the description the "..." OID.
> + * {0,5,...}   return the description of the "..." OID.
> + * {0,6,...}   return the aggregation label of the "..." OID.
>   */
>
>  #ifdef SYSCTL_DEBUG
>

From owner-svn-src-all@freebsd.org  Thu Dec 15 20:10:22 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1169FC817AA;
 Thu, 15 Dec 2016 20:10:22 +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 D4CBDAF4;
 Thu, 15 Dec 2016 20:10:21 +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 uBFKALoG077101;
 Thu, 15 Dec 2016 20:10:21 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFKALaU077100;
 Thu, 15 Dec 2016 20:10:21 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201612152010.uBFKALaU077100@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Thu, 15 Dec 2016 20:10:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310126 - stable/11/tools/build/mk
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 20:10:22 -0000

Author: ngie
Date: Thu Dec 15 20:10:20 2016
New Revision: 310126
URL: https://svnweb.freebsd.org/changeset/base/310126

Log:
  MFC r309602:
  
  Remove svn[lite]{bench,fsfs} if either MK_SVN == no or MK_SVNLITE == no

Modified:
  stable/11/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- stable/11/tools/build/mk/OptionalObsoleteFiles.inc	Thu Dec 15 17:41:30 2016	(r310125)
+++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc	Thu Dec 15 20:10:20 2016	(r310126)
@@ -8821,7 +8821,9 @@ OLD_FILES+=usr/share/man/man8/wpa_suppli
 .if ${MK_SVNLITE} == no || ${MK_SVN} == yes
 OLD_FILES+=usr/bin/svnlite
 OLD_FILES+=usr/bin/svnliteadmin
+OLD_FILES+=usr/bin/svnlitebench
 OLD_FILES+=usr/bin/svnlitedumpfilter
+OLD_FILES+=usr/bin/svnlitefsfs
 OLD_FILES+=usr/bin/svnlitelook
 OLD_FILES+=usr/bin/svnlitemucc
 OLD_FILES+=usr/bin/svnliterdump
@@ -8834,7 +8836,9 @@ OLD_FILES+=usr/share/man/man1/svnlite.1.
 .if ${MK_SVN} == no
 OLD_FILES+=usr/bin/svn
 OLD_FILES+=usr/bin/svnadmin
+OLD_FILES+=usr/bin/svnbench
 OLD_FILES+=usr/bin/svndumpfilter
+OLD_FILES+=usr/bin/svnfsfs
 OLD_FILES+=usr/bin/svnlook
 OLD_FILES+=usr/bin/svnmucc
 OLD_FILES+=usr/bin/svnrdump

From owner-svn-src-all@freebsd.org  Thu Dec 15 20:13:41 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8775AC81A03;
 Thu, 15 Dec 2016 20:13:41 +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 56AA1F38;
 Thu, 15 Dec 2016 20:13:41 +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 uBFKDet7080993;
 Thu, 15 Dec 2016 20:13:40 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFKDewh080992;
 Thu, 15 Dec 2016 20:13:40 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201612152013.uBFKDewh080992@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Thu, 15 Dec 2016 20:13:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310127 - stable/10/tools/build/mk
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 20:13:41 -0000

Author: ngie
Date: Thu Dec 15 20:13:40 2016
New Revision: 310127
URL: https://svnweb.freebsd.org/changeset/base/310127

Log:
  MFstable/11 r310126:
  
  MFC r309602:
  
  Remove svn[lite]{bench,fsfs} if either MK_SVN == no or MK_SVNLITE == no

Modified:
  stable/10/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- stable/10/tools/build/mk/OptionalObsoleteFiles.inc	Thu Dec 15 20:10:20 2016	(r310126)
+++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc	Thu Dec 15 20:13:40 2016	(r310127)
@@ -5511,7 +5511,9 @@ OLD_FILES+=usr/share/man/man8/wpa_suppli
 .if ${MK_SVNLITE} == no || ${MK_SVN} == yes
 OLD_FILES+=usr/bin/svnlite
 OLD_FILES+=usr/bin/svnliteadmin
+OLD_FILES+=usr/bin/svnlitebench
 OLD_FILES+=usr/bin/svnlitedumpfilter
+OLD_FILES+=usr/bin/svnlitefsfs
 OLD_FILES+=usr/bin/svnlitelook
 OLD_FILES+=usr/bin/svnlitemucc
 OLD_FILES+=usr/bin/svnliterdump
@@ -5524,7 +5526,9 @@ OLD_FILES+=usr/share/man/man1/svnlite.1.
 .if ${MK_SVN} == no
 OLD_FILES+=usr/bin/svn
 OLD_FILES+=usr/bin/svnadmin
+OLD_FILES+=usr/bin/svnbench
 OLD_FILES+=usr/bin/svndumpfilter
+OLD_FILES+=usr/bin/svnfsfs
 OLD_FILES+=usr/bin/svnlook
 OLD_FILES+=usr/bin/svnmucc
 OLD_FILES+=usr/bin/svnrdump

From owner-svn-src-all@freebsd.org  Thu Dec 15 20:18:52 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9629C81B8A
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Thu, 15 Dec 2016 20:18:52 +0000 (UTC) (envelope-from ed@nuxi.nl)
Received: from mail-yb0-x22f.google.com (mail-yb0-x22f.google.com
 [IPv6:2607:f8b0:4002:c09::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 88C9E1152
 for <svn-src-all@freebsd.org>; Thu, 15 Dec 2016 20:18:52 +0000 (UTC)
 (envelope-from ed@nuxi.nl)
Received: by mail-yb0-x22f.google.com with SMTP id v132so33232681yba.0
 for <svn-src-all@freebsd.org>; Thu, 15 Dec 2016 12:18:52 -0800 (PST)
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:from:date:message-id:subject:to
 :cc; bh=mKKhEAz0hdPYHqC+wU4S7V+Atsdfb9BXngVOZv6s9iY=;
 b=eFjZTINRdkQgbgqWA4i1xr7ykpMxZUfjEtyoklI8u9C7TJC7FmF2TEM7KDmKlGLGGh
 dXU6ZJ/ZJcpmrVzWkFvH2cefLCx1ONSEaObRAxmDA/Iaw5R8XBo/Uos279t7gWxwBj7r
 ygPkFEOargYsXR5mHUH/e6klopDYoFh7qV2aPNTCA7OQitnYA6bAF7RsDwH1C/oxo+LW
 XEj5jPU4tDgd0gRwPWJfvO6EZm/Zkus3kHCv8y+iabhBIADi0KozQRdjeJ80wLMo4SNh
 yZG0t8LDQOBMXrRoo6L8hs68Y+jGP2M/5rm82WCRteTI4AdW5jF4PqiZFzgwTCi4Rgo2
 AXDQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=mKKhEAz0hdPYHqC+wU4S7V+Atsdfb9BXngVOZv6s9iY=;
 b=FUXCq4S/o1N5tGBePiUFdByNEaiufGcQKjqN0dwuMQZdmYqjjI29bENCUA1CD1QN6D
 s9wGdGp675xmdows1NRzkrBSGMekR/tyqhSxfex5nzpO0AZSl4l7hrTuFAZMB9gkpS9X
 73F+2zuef/LxxVL74PlvGLsRsWtomEjmRclc4foXE+foGXMVk4k3QPE+ImRRFPi0lmYA
 Y7eK/sAX7i/wQPwcnZF0UPQKbww53zv1lhPTSXlu8isdJE1/sL2AsijhzMLT8d/M+iyM
 EPVWJ6Or9KY1p2ClpuSU5BTEpX+trOG3Q2f1VNzDgj2uaqhtcr2qc44Dh88QhPj7GmGt
 dqnA==
X-Gm-Message-State: AIkVDXJMd5xR41cdY/l/AkYAnlXTHWlg5Li8uyO2adz0t9NUggjpQmOHyUDjJw1KHI6MtyLSCmu7BWwDGsnzww==
X-Received: by 10.37.210.197 with SMTP id j188mr2612055ybg.168.1481833131052; 
 Thu, 15 Dec 2016 12:18:51 -0800 (PST)
MIME-Version: 1.0
Received: by 10.129.0.212 with HTTP; Thu, 15 Dec 2016 12:18:20 -0800 (PST)
In-Reply-To: <CAG6CVpV3APs_+z7Q-ZSqWSLNh7xMyKqMVjc6vXybg9fxDL+fvA@mail.gmail.com>
References: <201612151545.uBFFjBEL070679@repo.freebsd.org>
 <CAG6CVpV3APs_+z7Q-ZSqWSLNh7xMyKqMVjc6vXybg9fxDL+fvA@mail.gmail.com>
From: Ed Schouten <ed@nuxi.nl>
Date: Thu, 15 Dec 2016 21:18:20 +0100
Message-ID: <CABh_MKkh1R2C4Uf+UAHWRNqzSGfvrPw-2eU9=JGGGAM_8Ve8bA@mail.gmail.com>
Subject: Re: svn commit: r310116 - head/sys/kern
To: "Conrad E. Meyer" <cem@freebsd.org>
Cc: Ed Schouten <ed@freebsd.org>, src-committers <src-committers@freebsd.org>,
 svn-src-all@freebsd.org, 
 svn-src-head@freebsd.org, Christian Schwarz <me@cschwarz.com>
Content-Type: text/plain; charset=UTF-8
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 20:18:52 -0000

Hi Conrad,

[ + Christian Schwarz ]

2016-12-15 21:00 GMT+01:00 Conrad Meyer <cem@freebsd.org>:
> Can we please slap names on these numbers?  Even if we keep the
> existing numeric values?

Christian and I exchanged some emails the other day in which we
discussed the option of adding libc wrappers/bindings for all of these
functions. That way these constants would only be hardcoded in two
places: kern_sysctl.c and the function in libc.

That said, adding numerical constants for them in sysctl.h would also
be a good idea. Right now there is already CTL_UNSPEC, but I guess
that should be renamed to something like CTL_INTERNAL or something.

-- 
Ed Schouten <ed@nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717

From owner-svn-src-all@freebsd.org  Thu Dec 15 21:26:59 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED92CC82D6C;
 Thu, 15 Dec 2016 21:26:59 +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 A2B94176B;
 Thu, 15 Dec 2016 21:26:59 +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 uBFLQwiA011110;
 Thu, 15 Dec 2016 21:26:58 GMT (envelope-from emaste@FreeBSD.org)
Received: (from emaste@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFLQw6m011107;
 Thu, 15 Dec 2016 21:26:58 GMT (envelope-from emaste@FreeBSD.org)
Message-Id: <201612152126.uBFLQw6m011107@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: emaste set sender to
 emaste@FreeBSD.org using -f
From: Ed Maste <emaste@FreeBSD.org>
Date: Thu, 15 Dec 2016 21:26:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310128 - in head: sys/conf 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 21:27:00 -0000

Author: emaste
Date: Thu Dec 15 21:26:58 2016
New Revision: 310128
URL: https://svnweb.freebsd.org/changeset/base/310128

Log:
  Add WITH_REPRODUCIBLE_BUILD src.conf(5) knob to disable kernel metadata
  
  The kernel builds reproducibly, except for the time, date, user, and
  hostname baked into the kernel (reported at startup and via the
  kern.version sysctl for uname).  Add a build knob to disable the
  inclusion of this metadata.
  
  Reviewed by:	jhb
  MFC after:	1 month
  Relnotes:	Yes
  Sponsored by:	Reproducible Builds World Summit 2, Berlin
  Differential Revision:	https://reviews.freebsd.org/D8809

Added:
  head/tools/build/options/WITH_REPRODUCIBLE_BUILD   (contents, props changed)
Modified:
  head/sys/conf/kern.opts.mk
  head/sys/conf/kern.post.mk

Modified: head/sys/conf/kern.opts.mk
==============================================================================
--- head/sys/conf/kern.opts.mk	Thu Dec 15 20:13:40 2016	(r310127)
+++ head/sys/conf/kern.opts.mk	Thu Dec 15 21:26:58 2016	(r310128)
@@ -47,7 +47,8 @@ __DEFAULT_NO_OPTIONS = \
     EISA \
     EXTRA_TCP_STACKS \
     NAND \
-    OFED
+    OFED \
+    REPRODUCIBLE_BUILD
 
 # Some options are totally broken on some architectures. We disable
 # them. If you need to enable them on an experimental basis, you

Modified: head/sys/conf/kern.post.mk
==============================================================================
--- head/sys/conf/kern.post.mk	Thu Dec 15 20:13:40 2016	(r310127)
+++ head/sys/conf/kern.post.mk	Thu Dec 15 21:26:58 2016	(r310128)
@@ -357,8 +357,11 @@ config.o env.o hints.o vers.o vnode_if.o
 config.ln env.ln hints.ln vers.ln vnode_if.ln:
 	${NORMAL_LINT}
 
+.if ${MK_REPRODUCIBLE_BUILD} != "no"
+REPRO_FLAG="-r"
+.endif
 vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP}
-	MAKE=${MAKE} sh $S/conf/newvers.sh ${KERN_IDENT}
+	MAKE=${MAKE} sh $S/conf/newvers.sh ${REPRO_FLAG} ${KERN_IDENT}
 
 vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src
 	${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -c

Added: head/tools/build/options/WITH_REPRODUCIBLE_BUILD
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/build/options/WITH_REPRODUCIBLE_BUILD	Thu Dec 15 21:26:58 2016	(r310128)
@@ -0,0 +1,3 @@
+$FreeBSD$
+Set to exclude build metadata (build time, user, host and path) from the
+kernel and uname output.

From owner-svn-src-all@freebsd.org  Thu Dec 15 22:39:53 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8433BC82BC8;
 Thu, 15 Dec 2016 22:39:53 +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 538DC1990;
 Thu, 15 Dec 2016 22:39:53 +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 uBFMdqcv039306;
 Thu, 15 Dec 2016 22:39:52 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFMdqnY039305;
 Thu, 15 Dec 2016 22:39:52 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201612152239.uBFMdqnY039305@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin <jhb@FreeBSD.org>
Date: Thu, 15 Dec 2016 22:39:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310129 - stable/11/sys/kern
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 22:39:53 -0000

Author: jhb
Date: Thu Dec 15 22:39:52 2016
New Revision: 310129
URL: https://svnweb.freebsd.org/changeset/base/310129

Log:
  MFC 308565: Allow scheduling during early boot.
  
  - Send IPI wakeups once SMP is started even if cold is true.
  - Permit preemptions when cold is true.
  
  These changes are needed for EARLY_AP_STARTUP.

Modified:
  stable/11/sys/kern/sched_4bsd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/sched_4bsd.c
==============================================================================
--- stable/11/sys/kern/sched_4bsd.c	Thu Dec 15 21:26:58 2016	(r310128)
+++ stable/11/sys/kern/sched_4bsd.c	Thu Dec 15 22:39:52 2016	(r310129)
@@ -326,7 +326,6 @@ maybe_preempt(struct thread *td)
 	 *  - The current thread has a higher (numerically lower) or
 	 *    equivalent priority.  Note that this prevents curthread from
 	 *    trying to preempt to itself.
-	 *  - It is too early in the boot for context switches (cold is set).
 	 *  - The current thread has an inhibitor set or is in the process of
 	 *    exiting.  In this case, the current thread is about to switch
 	 *    out anyways, so there's no point in preempting.  If we did,
@@ -347,7 +346,7 @@ maybe_preempt(struct thread *td)
 			("maybe_preempt: trying to run inhibited thread"));
 	pri = td->td_priority;
 	cpri = ctd->td_priority;
-	if (panicstr != NULL || pri >= cpri || cold /* || dumping */ ||
+	if (panicstr != NULL || pri >= cpri /* || dumping */ ||
 	    TD_IS_INHIBITED(ctd))
 		return (0);
 #ifndef FULL_PREEMPTION
@@ -1105,7 +1104,7 @@ forward_wakeup(int cpunum)
 	if ((!forward_wakeup_enabled) ||
 	     (forward_wakeup_use_mask == 0 && forward_wakeup_use_loop == 0))
 		return (0);
-	if (!smp_started || cold || panicstr)
+	if (!smp_started || panicstr)
 		return (0);
 
 	forward_wakeups_requested++;

From owner-svn-src-all@freebsd.org  Fri Dec 16 00:04:34 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19503C81651;
 Fri, 16 Dec 2016 00:04: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 DD1A0791;
 Fri, 16 Dec 2016 00:04:33 +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 uBG04XeV076581;
 Fri, 16 Dec 2016 00:04:33 GMT (envelope-from adrian@FreeBSD.org)
Received: (from adrian@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG04X5f076580;
 Fri, 16 Dec 2016 00:04:33 GMT (envelope-from adrian@FreeBSD.org)
Message-Id: <201612160004.uBG04X5f076580@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: adrian set sender to
 adrian@FreeBSD.org using -f
From: Adrian Chadd <adrian@FreeBSD.org>
Date: Fri, 16 Dec 2016 00:04:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310130 - head/sys/mips/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 00:04:34 -0000

Author: adrian
Date: Fri Dec 16 00:04:32 2016
New Revision: 310130
URL: https://svnweb.freebsd.org/changeset/base/310130

Log:
  [ar933x] don't waste memory/flash; drop the UMTX_CHAINS count down to 16.

Modified:
  head/sys/mips/conf/std.AR933X

Modified: head/sys/mips/conf/std.AR933X
==============================================================================
--- head/sys/mips/conf/std.AR933X	Thu Dec 15 22:39:52 2016	(r310129)
+++ head/sys/mips/conf/std.AR933X	Fri Dec 16 00:04:32 2016	(r310130)
@@ -27,6 +27,8 @@ options 	KDB
 options 	ALQ
 options         ALT_BREAK_TO_DEBUGGER
 
+options 	UMTX_CHAINS=16
+
 options 	SCHED_4BSD		#4BSD scheduler
 options 	INET			#InterNETworking
 #options 	INET6			#InterNETworking

From owner-svn-src-all@freebsd.org  Fri Dec 16 00:24:01 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 133A9C81DC4;
 Fri, 16 Dec 2016 00:24:01 +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 C9BE61113;
 Fri, 16 Dec 2016 00:24:00 +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 uBG0Nxa9084450;
 Fri, 16 Dec 2016 00:23:59 GMT (envelope-from pfg@FreeBSD.org)
Received: (from pfg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG0NxL0084449;
 Fri, 16 Dec 2016 00:23:59 GMT (envelope-from pfg@FreeBSD.org)
Message-Id: <201612160023.uBG0NxL0084449@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org
 using -f
From: "Pedro F. Giffuni" <pfg@FreeBSD.org>
Date: Fri, 16 Dec 2016 00:23:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310131 - head/contrib/binutils/bfd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 00:24:01 -0000

Author: pfg
Date: Fri Dec 16 00:23:59 2016
New Revision: 310131
URL: https://svnweb.freebsd.org/changeset/base/310131

Log:
  libbfd: drop unnecessary variable increment.
  
  Do not increment `s' before it is initialized. At the time
  of the increment, `s' is otherwise unused anyway.
  
  Obtained from:	OpenBSD (CVS rev 1.11)

Modified:
  head/contrib/binutils/bfd/elf.c

Modified: head/contrib/binutils/bfd/elf.c
==============================================================================
--- head/contrib/binutils/bfd/elf.c	Fri Dec 16 00:04:32 2016	(r310130)
+++ head/contrib/binutils/bfd/elf.c	Fri Dec 16 00:23:59 2016	(r310131)
@@ -8826,7 +8826,7 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd
   count = relplt->size / hdr->sh_entsize;
   size = count * sizeof (asymbol);
   p = relplt->relocation;
-  for (i = 0; i < count; i++, s++, p++)
+  for (i = 0; i < count; i++, p++)
     size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt");
 
   s = *ret = bfd_malloc (size);

From owner-svn-src-all@freebsd.org  Fri Dec 16 00:36:00 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3ED9C7619E;
 Fri, 16 Dec 2016 00:36:00 +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 B389417B3;
 Fri, 16 Dec 2016 00:36:00 +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 uBG0Zx3b088572;
 Fri, 16 Dec 2016 00:35:59 GMT (envelope-from pfg@FreeBSD.org)
Received: (from pfg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG0Zx2p088571;
 Fri, 16 Dec 2016 00:35:59 GMT (envelope-from pfg@FreeBSD.org)
Message-Id: <201612160035.uBG0Zx2p088571@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org
 using -f
From: "Pedro F. Giffuni" <pfg@FreeBSD.org>
Date: Fri, 16 Dec 2016 00:35:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310132 - head/contrib/binutils/bfd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 00:36:01 -0000

Author: pfg
Date: Fri Dec 16 00:35:59 2016
New Revision: 310132
URL: https://svnweb.freebsd.org/changeset/base/310132

Log:
  libbfd: make sure variables are initialized before using them.
  
  Initialize l_sec_contents to make sure that free(l_sec_contents) is called
  on valid pointers.
  
  Obtained from:	OpenBSD (partial CVS rev 1.18)
  MFC after:	5 days

Modified:
  head/contrib/binutils/bfd/elflink.c

Modified: head/contrib/binutils/bfd/elflink.c
==============================================================================
--- head/contrib/binutils/bfd/elflink.c	Fri Dec 16 00:23:59 2016	(r310131)
+++ head/contrib/binutils/bfd/elflink.c	Fri Dec 16 00:35:59 2016	(r310132)
@@ -11487,7 +11487,7 @@ _bfd_elf_section_already_linked (bfd *ab
 		   abfd, sec);
 	      else if (sec->size != 0)
 		{
-		  bfd_byte *sec_contents, *l_sec_contents;
+		  bfd_byte *sec_contents, *l_sec_contents = NULL;
 
 		  if (!bfd_malloc_and_get_section (abfd, sec, &sec_contents))
 		    (*_bfd_error_handler)

From owner-svn-src-all@freebsd.org  Fri Dec 16 01:06:37 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F197C76A68;
 Fri, 16 Dec 2016 01: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 D2539153B;
 Fri, 16 Dec 2016 01:06:36 +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 uBG16aX3000523;
 Fri, 16 Dec 2016 01:06:36 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG16a9X000522;
 Fri, 16 Dec 2016 01:06:36 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201612160106.uBG16a9X000522@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin <jhb@FreeBSD.org>
Date: Fri, 16 Dec 2016 01:06:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310133 - in stable: 10/sys/mips/mips 11/sys/mips/mips
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 01:06:37 -0000

Author: jhb
Date: Fri Dec 16 01:06:35 2016
New Revision: 310133
URL: https://svnweb.freebsd.org/changeset/base/310133

Log:
  MFC 308690: Sync instruction cache's after writing user breakpoints on MIPS.
  
  Add an implementation for pmaps_sync_icache() on MIPS that sync's the
  instruction cache on all CPUs via smp_rendezvous() after a debugger
  inserts a breakpoint via ptrace(PT_IO).

Modified:
  stable/11/sys/mips/mips/pmap.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/mips/mips/pmap.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/mips/mips/pmap.c
==============================================================================
--- stable/11/sys/mips/mips/pmap.c	Fri Dec 16 00:35:59 2016	(r310132)
+++ stable/11/sys/mips/mips/pmap.c	Fri Dec 16 01:06:35 2016	(r310133)
@@ -74,11 +74,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/proc.h>
 #include <sys/rwlock.h>
 #include <sys/sched.h>
-#ifdef SMP
 #include <sys/smp.h>
-#else
-#include <sys/cpuset.h>
-#endif
 #include <sys/sysctl.h>
 #include <sys/vmmeter.h>
 
@@ -3284,9 +3280,19 @@ pmap_activate(struct thread *td)
 	critical_exit();
 }
 
+static void
+pmap_sync_icache_one(void *arg __unused)
+{
+
+	mips_icache_sync_all();
+	mips_dcache_wbinv_all();
+}
+
 void
 pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
 {
+
+	smp_rendezvous(NULL, pmap_sync_icache_one, NULL, NULL);
 }
 
 /*

From owner-svn-src-all@freebsd.org  Fri Dec 16 01:06:36 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE21DC76A61;
 Fri, 16 Dec 2016 01:06:36 +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 9D300153A;
 Fri, 16 Dec 2016 01:06:36 +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 uBG16Z1B000516;
 Fri, 16 Dec 2016 01:06:35 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG16ZaW000515;
 Fri, 16 Dec 2016 01:06:35 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201612160106.uBG16ZaW000515@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin <jhb@FreeBSD.org>
Date: Fri, 16 Dec 2016 01:06:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310133 - in stable: 10/sys/mips/mips 11/sys/mips/mips
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 01:06:36 -0000

Author: jhb
Date: Fri Dec 16 01:06:35 2016
New Revision: 310133
URL: https://svnweb.freebsd.org/changeset/base/310133

Log:
  MFC 308690: Sync instruction cache's after writing user breakpoints on MIPS.
  
  Add an implementation for pmaps_sync_icache() on MIPS that sync's the
  instruction cache on all CPUs via smp_rendezvous() after a debugger
  inserts a breakpoint via ptrace(PT_IO).

Modified:
  stable/10/sys/mips/mips/pmap.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/mips/mips/pmap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/mips/mips/pmap.c
==============================================================================
--- stable/10/sys/mips/mips/pmap.c	Fri Dec 16 00:35:59 2016	(r310132)
+++ stable/10/sys/mips/mips/pmap.c	Fri Dec 16 01:06:35 2016	(r310133)
@@ -74,11 +74,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/proc.h>
 #include <sys/rwlock.h>
 #include <sys/sched.h>
-#ifdef SMP
 #include <sys/smp.h>
-#else
-#include <sys/cpuset.h>
-#endif
 #include <sys/sysctl.h>
 #include <sys/vmmeter.h>
 
@@ -3203,9 +3199,19 @@ pmap_activate(struct thread *td)
 	critical_exit();
 }
 
+static void
+pmap_sync_icache_one(void *arg __unused)
+{
+
+	mips_icache_sync_all();
+	mips_dcache_wbinv_all();
+}
+
 void
 pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
 {
+
+	smp_rendezvous(NULL, pmap_sync_icache_one, NULL, NULL);
 }
 
 /*

From owner-svn-src-all@freebsd.org  Fri Dec 16 01:14:01 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1570C8201C;
 Fri, 16 Dec 2016 01:14:01 +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 B097F1CF0;
 Fri, 16 Dec 2016 01:14:01 +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 uBG1E03B004649;
 Fri, 16 Dec 2016 01:14:00 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG1E0tr004648;
 Fri, 16 Dec 2016 01:14:00 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201612160114.uBG1E0tr004648@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin <jhb@FreeBSD.org>
Date: Fri, 16 Dec 2016 01:14:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310134 - in stable: 10/include 11/include
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 01:14:02 -0000

Author: jhb
Date: Fri Dec 16 01:14:00 2016
New Revision: 310134
URL: https://svnweb.freebsd.org/changeset/base/310134

Log:
  MFC 309274:
  Use the correct name for the GCC macro indicating max_align_t is defined.

Modified:
  stable/11/include/stddef.h
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/include/stddef.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/include/stddef.h
==============================================================================
--- stable/11/include/stddef.h	Fri Dec 16 01:06:35 2016	(r310133)
+++ stable/11/include/stddef.h	Fri Dec 16 01:14:00 2016	(r310134)
@@ -66,7 +66,7 @@ typedef	___wchar_t	wchar_t;
 #ifndef __CLANG_MAX_ALIGN_T_DEFINED
 typedef	__max_align_t	max_align_t;
 #define __CLANG_MAX_ALIGN_T_DEFINED
-#define __GCC_MAX_ALIGN_T
+#define _GCC_MAX_ALIGN_T
 #endif
 #endif
 

From owner-svn-src-all@freebsd.org  Fri Dec 16 01:14:01 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB469C82018;
 Fri, 16 Dec 2016 01:14:01 +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 7A7D51CEF;
 Fri, 16 Dec 2016 01:14:01 +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 uBG1E0oO004643;
 Fri, 16 Dec 2016 01:14:00 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG1E0cc004642;
 Fri, 16 Dec 2016 01:14:00 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201612160114.uBG1E0cc004642@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin <jhb@FreeBSD.org>
Date: Fri, 16 Dec 2016 01:14:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310134 - in stable: 10/include 11/include
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 01:14:01 -0000

Author: jhb
Date: Fri Dec 16 01:14:00 2016
New Revision: 310134
URL: https://svnweb.freebsd.org/changeset/base/310134

Log:
  MFC 309274:
  Use the correct name for the GCC macro indicating max_align_t is defined.

Modified:
  stable/10/include/stddef.h
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/include/stddef.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/include/stddef.h
==============================================================================
--- stable/10/include/stddef.h	Fri Dec 16 01:06:35 2016	(r310133)
+++ stable/10/include/stddef.h	Fri Dec 16 01:14:00 2016	(r310134)
@@ -63,7 +63,7 @@ typedef	___wchar_t	wchar_t;
 #ifndef __CLANG_MAX_ALIGN_T_DEFINED
 typedef	__max_align_t	max_align_t;
 #define __CLANG_MAX_ALIGN_T_DEFINED
-#define __GCC_MAX_ALIGN_T
+#define _GCC_MAX_ALIGN_T
 #endif
 #endif
 

From owner-svn-src-all@freebsd.org  Fri Dec 16 01:37:45 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2CCCC825D5;
 Fri, 16 Dec 2016 01:37:45 +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 C268D1A4B;
 Fri, 16 Dec 2016 01:37:45 +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 uBG1bivF012692;
 Fri, 16 Dec 2016 01:37:44 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG1biQ5012691;
 Fri, 16 Dec 2016 01:37:44 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612160137.uBG1biQ5012691@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Fri, 16 Dec 2016 01:37:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310135 - head/lib/libcapsicum
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 01:37:46 -0000

Author: cem
Date: Fri Dec 16 01:37:44 2016
New Revision: 310135
URL: https://svnweb.freebsd.org/changeset/base/310135

Log:
  capsicum_helpers: Add LOOKUP flag
  
  Add a helper routine for opening a directory that is restricted to being
  used for opening relative files as stdio streams.
  
  I think this will really help basic adaptation of multi-file programs to
  Capsicum. Rather than having each program initialize a rights object and
  ioctl/fcntl arrays for their root fd for relative opens, consolidate in the
  logical place.
  
  Reviewed by:	oshogbo@
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D8743

Modified:
  head/lib/libcapsicum/capsicum_helpers.h

Modified: head/lib/libcapsicum/capsicum_helpers.h
==============================================================================
--- head/lib/libcapsicum/capsicum_helpers.h	Fri Dec 16 01:14:00 2016	(r310134)
+++ head/lib/libcapsicum/capsicum_helpers.h	Fri Dec 16 01:37:44 2016	(r310135)
@@ -41,6 +41,7 @@
 #define	CAPH_IGNORE_EBADF	0x0001
 #define	CAPH_READ		0x0002
 #define	CAPH_WRITE		0x0004
+#define	CAPH_LOOKUP		0x0008
 
 static __inline int
 caph_limit_stream(int fd, int flags)
@@ -54,6 +55,8 @@ caph_limit_stream(int fd, int flags)
 		cap_rights_set(&rights, CAP_READ);
 	if ((flags & CAPH_WRITE) != 0)
 		cap_rights_set(&rights, CAP_WRITE);
+	if ((flags & CAPH_LOOKUP) != 0)
+		cap_rights_set(&rights, CAP_LOOKUP);
 
 	if (cap_rights_limit(fd, &rights) < 0 && errno != ENOSYS) {
 		if (errno == EBADF && (flags & CAPH_IGNORE_EBADF) != 0)

From owner-svn-src-all@freebsd.org  Fri Dec 16 01:39:08 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30B61C82643;
 Fri, 16 Dec 2016 01:39:08 +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 005A91BFA;
 Fri, 16 Dec 2016 01:39:07 +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 uBG1d7bD012778;
 Fri, 16 Dec 2016 01:39:07 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG1d7hN012777;
 Fri, 16 Dec 2016 01:39:07 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612160139.uBG1d7hN012777@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Fri, 16 Dec 2016 01:39:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310136 - head/contrib/elftoolchain/libelf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 01:39:08 -0000

Author: cem
Date: Fri Dec 16 01:39:06 2016
New Revision: 310136
URL: https://svnweb.freebsd.org/changeset/base/310136

Log:
  libelf: Fix extended numbering detection
  
  Extended numbering is used for any of these fields overflowing.
  
  Reviewed by:	emaste@
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D8701

Modified:
  head/contrib/elftoolchain/libelf/libelf_ehdr.c

Modified: head/contrib/elftoolchain/libelf/libelf_ehdr.c
==============================================================================
--- head/contrib/elftoolchain/libelf/libelf_ehdr.c	Fri Dec 16 01:37:44 2016	(r310135)
+++ head/contrib/elftoolchain/libelf/libelf_ehdr.c	Fri Dec 16 01:39:06 2016	(r310136)
@@ -170,10 +170,6 @@ _libelf_ehdr(Elf *e, int ec, int allocat
 	(*xlator)((unsigned char*) ehdr, msz, e->e_rawfile, (size_t) 1,
 	    e->e_byteorder != LIBELF_PRIVATE(byteorder));
 
-	/*
-	 * If extended numbering is being used, read the correct
-	 * number of sections and program header entries.
-	 */
 	if (ec == ELFCLASS32) {
 		phnum = ((Elf32_Ehdr *) ehdr)->e_phnum;
 		shnum = ((Elf32_Ehdr *) ehdr)->e_shnum;
@@ -193,12 +189,19 @@ _libelf_ehdr(Elf *e, int ec, int allocat
 		return (NULL);
 	}
 
-	if (shnum != 0 || shoff == 0LL) { /* not using extended numbering */
+	/*
+	 * If extended numbering is being used, read the correct
+	 * number of sections and program header entries.
+	 */
+	if ((shnum == 0 && shoff != 0) || phnum == PN_XNUM || strndx == SHN_XINDEX) {
+		if (_libelf_load_extended(e, ec, shoff, phnum, strndx) == 0)
+			return (NULL);
+	} else {
+		/* not using extended numbering */
 		e->e_u.e_elf.e_nphdr = phnum;
 		e->e_u.e_elf.e_nscn = shnum;
 		e->e_u.e_elf.e_strndx = strndx;
-	} else if (_libelf_load_extended(e, ec, shoff, phnum, strndx) == 0)
-		return (NULL);
+	}
 
 	return (ehdr);
 }

From owner-svn-src-all@freebsd.org  Fri Dec 16 01:42:52 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A09FC82829;
 Fri, 16 Dec 2016 01:42:52 +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 09C42105F;
 Fri, 16 Dec 2016 01:42:51 +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 uBG1gp4s016613;
 Fri, 16 Dec 2016 01:42:51 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG1gp4R016612;
 Fri, 16 Dec 2016 01:42:51 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612160142.uBG1gp4R016612@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Fri, 16 Dec 2016 01:42:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310137 - head/contrib/elftoolchain/libelf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 01:42:52 -0000

Author: cem
Date: Fri Dec 16 01:42:51 2016
New Revision: 310137
URL: https://svnweb.freebsd.org/changeset/base/310137

Log:
  gelf_getphdr: Allow extended indices
  
  Needed for 'readelf -l' of extended phnum files.  (Parity with GNU
  binutils.)
  
  Reviewed by:	no one, unfortunately
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D8703

Modified:
  head/contrib/elftoolchain/libelf/gelf_phdr.c

Modified: head/contrib/elftoolchain/libelf/gelf_phdr.c
==============================================================================
--- head/contrib/elftoolchain/libelf/gelf_phdr.c	Fri Dec 16 01:39:06 2016	(r310136)
+++ head/contrib/elftoolchain/libelf/gelf_phdr.c	Fri Dec 16 01:42:51 2016	(r310137)
@@ -53,10 +53,17 @@ gelf_getphdr(Elf *e, int index, GElf_Phd
 	Elf64_Ehdr *eh64;
 	Elf32_Phdr *ep32;
 	Elf64_Phdr *ep64;
+	size_t phnum;
 
 	if (d == NULL || e == NULL ||
 	    ((ec = e->e_class) != ELFCLASS32 && ec != ELFCLASS64) ||
-	    (e->e_kind != ELF_K_ELF) || index < 0) {
+	    (e->e_kind != ELF_K_ELF) || index < 0 ||
+	    elf_getphdrnum(e, &phnum) < 0) {
+		LIBELF_SET_ERROR(ARGUMENT, 0);
+		return (NULL);
+	}
+
+	if ((size_t)index >= phnum) {
 		LIBELF_SET_ERROR(ARGUMENT, 0);
 		return (NULL);
 	}
@@ -66,11 +73,6 @@ gelf_getphdr(Elf *e, int index, GElf_Phd
 		    ((ep32 = _libelf_getphdr(e, ELFCLASS32)) == NULL))
 			return (NULL);
 
-		if (index >= eh32->e_phnum) {
-			LIBELF_SET_ERROR(ARGUMENT, 0);
-			return (NULL);
-		}
-
 		ep32 += index;
 
 		d->p_type   = ep32->p_type;
@@ -87,11 +89,6 @@ gelf_getphdr(Elf *e, int index, GElf_Phd
 		    (ep64 = _libelf_getphdr(e, ELFCLASS64)) == NULL)
 			return (NULL);
 
-		if (index >= eh64->e_phnum) {
-			LIBELF_SET_ERROR(ARGUMENT, 0);
-			return (NULL);
-		}
-
 		ep64 += index;
 
 		*d = *ep64;
@@ -125,13 +122,15 @@ gelf_newphdr(Elf *e, size_t count)
 int
 gelf_update_phdr(Elf *e, int ndx, GElf_Phdr *s)
 {
-	int ec, phnum;
+	int ec;
+	size_t phnum;
 	void *ehdr;
 	Elf32_Phdr *ph32;
 	Elf64_Phdr *ph64;
 
 	if (s == NULL || e == NULL || e->e_kind != ELF_K_ELF ||
-	    ((ec = e->e_class) != ELFCLASS32 && ec != ELFCLASS64)) {
+	    ((ec = e->e_class) != ELFCLASS32 && ec != ELFCLASS64) ||
+	    elf_getphdrnum(e, &phnum) < 0) {
 		LIBELF_SET_ERROR(ARGUMENT, 0);
 		return (0);
 	}
@@ -144,12 +143,7 @@ gelf_update_phdr(Elf *e, int ndx, GElf_P
 	if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL)
 		return (0);
 
-	if (ec == ELFCLASS32)
-		phnum = ((Elf32_Ehdr *) ehdr)->e_phnum;
-	else
-		phnum = ((Elf64_Ehdr *) ehdr)->e_phnum;
-
-	if (ndx < 0 || ndx > phnum) {
+	if (ndx < 0 || (size_t)ndx > phnum) {
 		LIBELF_SET_ERROR(ARGUMENT, 0);
 		return (0);
 	}

From owner-svn-src-all@freebsd.org  Fri Dec 16 01:44:52 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 310F0C82937;
 Fri, 16 Dec 2016 01:44:52 +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 00C201300;
 Fri, 16 Dec 2016 01:44:51 +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 uBG1ipGA016737;
 Fri, 16 Dec 2016 01:44:51 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG1ipjW016736;
 Fri, 16 Dec 2016 01:44:51 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612160144.uBG1ipjW016736@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Fri, 16 Dec 2016 01:44:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310138 - head/lib/libc/stdio
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 01:44:52 -0000

Author: cem
Date: Fri Dec 16 01:44:50 2016
New Revision: 310138
URL: https://svnweb.freebsd.org/changeset/base/310138

Log:
  vfprintf(3): Add support for kernel %b format
  
  This is a direct port of the kernel %b format.
  
  I'm unclear on if (more) non-portable printf extensions will be a
  problem. I think it's desirable to have userspace formats include all
  kernel formats, but there may be competing goals I'm not aware of.
  
  Reviewed by:	no one, unfortunately
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D8426

Modified:
  head/lib/libc/stdio/vfprintf.c

Modified: head/lib/libc/stdio/vfprintf.c
==============================================================================
--- head/lib/libc/stdio/vfprintf.c	Fri Dec 16 01:42:51 2016	(r310137)
+++ head/lib/libc/stdio/vfprintf.c	Fri Dec 16 01:44:50 2016	(r310138)
@@ -611,6 +611,37 @@ reswitch:	switch (ch) {
 		case 'z':
 			flags |= SIZET;
 			goto rflag;
+		case 'b':
+			{
+			const char *q;
+			int anybitset, bit;
+
+			ulval = (u_int)GETARG(int);
+			cp = GETARG(char *);
+
+			q = __ultoa(ulval, buf + BUF, *cp++, 0, xdigs_lower);
+			PRINT(q, buf + BUF - q);
+
+			if (ulval == 0)
+				break;
+
+			for (anybitset = 0; *cp;) {
+				bit = *cp++;
+				if (ulval & (1 << (bit - 1))) {
+					PRINT(anybitset ? "," : "<", 1);
+					q = cp;
+					for (; (bit = *cp) > ' '; ++cp)
+						continue;
+					PRINT(q, cp - q);
+					anybitset = 1;
+				} else
+					for (; *cp > ' '; ++cp)
+						continue;
+			}
+			if (anybitset)
+				PRINT(">", 1);
+			}
+			continue;
 		case 'C':
 			flags |= LONGINT;
 			/*FALLTHROUGH*/

From owner-svn-src-all@freebsd.org  Fri Dec 16 01:47:10 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07F8BC829D3;
 Fri, 16 Dec 2016 01:47:10 +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 CBAF714F4;
 Fri, 16 Dec 2016 01:47:09 +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 uBG1l9QK016854;
 Fri, 16 Dec 2016 01:47:09 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG1l984016853;
 Fri, 16 Dec 2016 01:47:09 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612160147.uBG1l984016853@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Fri, 16 Dec 2016 01:47:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310139 - head/usr.bin/last
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 01:47:10 -0000

Author: cem
Date: Fri Dec 16 01:47:08 2016
New Revision: 310139
URL: https://svnweb.freebsd.org/changeset/base/310139

Log:
  Capsicumify last(1)
  
  Reviewed by:	ed (earlier version), emaste (earlier version)
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D8001

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

Modified: head/usr.bin/last/last.c
==============================================================================
--- head/usr.bin/last/last.c	Fri Dec 16 01:44:50 2016	(r310138)
+++ head/usr.bin/last/last.c	Fri Dec 16 01:47:08 2016	(r310139)
@@ -40,8 +40,11 @@ static const char sccsid[] = "@(#)last.c
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
+#include <sys/capsicum.h>
+#include <sys/queue.h>
 #include <sys/stat.h>
 
+#include <capsicum_helpers.h>
 #include <err.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -56,7 +59,6 @@ __FBSDID("$FreeBSD$");
 #include <timeconv.h>
 #include <unistd.h>
 #include <utmpx.h>
-#include <sys/queue.h>
 
 #define	NO	0				/* false/no */
 #define	YES	1				/* true/yes */
@@ -176,6 +178,19 @@ main(int argc, char *argv[])
 			usage();
 		}
 
+	if (caph_limit_stdio() < 0)
+		err(1, "can't limit stdio rights");
+
+	caph_cache_catpages();
+	caph_cache_tzdata();
+
+	/* Cache UTX database. */
+	if (setutxdb(UTXDB_LOG, file) != 0)
+		err(1, "%s", file != NULL ? file : "(default utx db)");
+
+	if (cap_enter() < 0 && errno != ENOSYS)
+		err(1, "cap_enter");
+
 	if (sflag && width == 8) usage();
 
 	if (argc) {
@@ -213,8 +228,6 @@ wtmp(void)
 	(void)time(&t);
 
 	/* Load the last entries from the file. */
-	if (setutxdb(UTXDB_LOG, file) != 0)
-		err(1, "%s", file);
 	while ((ut = getutxent()) != NULL) {
 		if (amount % 128 == 0) {
 			buf = realloc(buf, (amount + 128) * sizeof *ut);

From owner-svn-src-all@freebsd.org  Fri Dec 16 01:48:56 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D9D9C82AA5;
 Fri, 16 Dec 2016 01:48:56 +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 353E017C0;
 Fri, 16 Dec 2016 01:48:56 +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 uBG1mtq6016965;
 Fri, 16 Dec 2016 01:48:55 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG1mtlA016964;
 Fri, 16 Dec 2016 01:48:55 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612160148.uBG1mtlA016964@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Fri, 16 Dec 2016 01:48:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310140 - head/contrib/dma
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 01:48:56 -0000

Author: cem
Date: Fri Dec 16 01:48:55 2016
New Revision: 310140
URL: https://svnweb.freebsd.org/changeset/base/310140

Log:
  dma-mbox-create: Restrict with Capsicum
  
  The restriction here is pretty late and pretty minimal. We need a lot
  of authority to open password databases, and don't do much after that
  point.
  
  Feedback from:	lifanov at mail.lifanov.com (earlier version), emaste (earlier version)
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D7988

Modified:
  head/contrib/dma/dma-mbox-create.c

Modified: head/contrib/dma/dma-mbox-create.c
==============================================================================
--- head/contrib/dma/dma-mbox-create.c	Fri Dec 16 01:47:08 2016	(r310139)
+++ head/contrib/dma/dma-mbox-create.c	Fri Dec 16 01:48:55 2016	(r310140)
@@ -38,9 +38,18 @@
  * user-supplied information.  Keep the root window as small as possible.
  */
 
+#ifdef __FreeBSD__
+#define	USE_CAPSICUM	1
+#endif
+
 #include <sys/param.h>
+#if USE_CAPSICUM
+#include <sys/capsicum.h>
+#endif
 #include <sys/stat.h>
 
+#include <capsicum_helpers.h>
+#include <err.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <grp.h>
@@ -84,6 +93,9 @@ logfail(int exitcode, const char *fmt, .
 int
 main(int argc, char **argv)
 {
+#if USE_CAPSICUM
+	cap_rights_t rights;
+#endif
 	const char *user;
 	struct passwd *pw;
 	struct group *gr;
@@ -91,7 +103,10 @@ main(int argc, char **argv)
 	gid_t mail_gid;
 	int f, maildirfd;
 
-	openlog("dma-mbox-create", 0, LOG_MAIL);
+	/*
+	 * Open log fd now for capability sandbox.
+	 */
+	openlog("dma-mbox-create", LOG_NDELAY, LOG_MAIL);
 
 	errno = 0;
 	gr = getgrnam(DMA_GROUP);
@@ -133,6 +148,28 @@ main(int argc, char **argv)
 	if (maildirfd < 0)
 		logfail(EX_NOINPUT, "cannot open maildir %s", _PATH_MAILDIR);
 
+	/*
+	 * Cache NLS data, for strerror, for err(3), before entering capability
+	 * mode.
+	 */
+	caph_cache_catpages();
+
+	/*
+	 * Cache local time before entering Capsicum capability sandbox.
+	 */
+	caph_cache_tzdata();
+
+#if USE_CAPSICUM
+	cap_rights_init(&rights, CAP_CREATE, CAP_FCHMOD, CAP_FCHOWN,
+	    CAP_LOOKUP, CAP_READ);
+	if (cap_rights_limit(maildirfd, &rights) < 0 && errno != ENOSYS)
+		err(EX_OSERR, "can't limit maildirfd rights");
+
+	/* Enter Capsicum capability sandbox */
+	if (cap_enter() < 0 && errno != ENOSYS)
+		err(EX_OSERR, "cap_enter");
+#endif
+
 	user_uid = pw->pw_uid;
 
 	f = openat(maildirfd, user, O_RDONLY|O_CREAT|O_NOFOLLOW, 0600);

From owner-svn-src-all@freebsd.org  Fri Dec 16 01:51:13 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB3C6C82C60;
 Fri, 16 Dec 2016 01:51:13 +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 C5F891BAE;
 Fri, 16 Dec 2016 01:51:13 +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 uBG1pCf6020149;
 Fri, 16 Dec 2016 01:51:12 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG1pCms020148;
 Fri, 16 Dec 2016 01:51:12 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612160151.uBG1pCms020148@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Fri, 16 Dec 2016 01:51:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310141 - head/usr.bin/ministat
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 01:51:14 -0000

Author: cem
Date: Fri Dec 16 01:51:12 2016
New Revision: 310141
URL: https://svnweb.freebsd.org/changeset/base/310141

Log:
  ministat(1): Capsicumify
  
  Separate dataset opening from reading/parsing. The number of input
  files is already capped to a small number, so just open all input files
  before sandboxing.
  
  Feedback from:	allanjude@ (earlier version), emaste@ (earlier version)
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D7925

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

Modified: head/usr.bin/ministat/ministat.c
==============================================================================
--- head/usr.bin/ministat/ministat.c	Fri Dec 16 01:48:55 2016	(r310140)
+++ head/usr.bin/ministat/ministat.c	Fri Dec 16 01:51:12 2016	(r310141)
@@ -11,16 +11,20 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
-#include <stdio.h>
-#include <math.h>
+#include <sys/capsicum.h>
+#include <sys/ioctl.h>
+#include <sys/queue.h>
+#include <sys/ttycom.h>
+
+#include <capsicum_helpers.h>
 #include <ctype.h>
 #include <err.h>
-#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/queue.h>
-#include <sys/ttycom.h>
 
 #define NSTUDENT 100
 #define NCONF 6
@@ -455,26 +459,14 @@ dbl_cmp(const void *a, const void *b)
 }
 
 static struct dataset *
-ReadSet(const char *n, int column, const char *delim)
+ReadSet(FILE *f, const char *n, int column, const char *delim)
 {
-	FILE *f;
 	char buf[BUFSIZ], *p, *t;
 	struct dataset *s;
 	double d;
 	int line;
 	int i;
 
-	if (n == NULL) {
-		f = stdin;
-		n = "<stdin>";
-	} else if (!strcmp(n, "-")) {
-		f = stdin;
-		n = "<stdin>";
-	} else {
-		f = fopen(n, "r");
-	}
-	if (f == NULL)
-		err(1, "Cannot open %s", n);
 	s = NewSet();
 	s->name = strdup(n);
 	line = 0;
@@ -499,7 +491,6 @@ ReadSet(const char *n, int column, const
 		if (*buf != '\0')
 			AddPoint(s, d);
 	}
-	fclose(f);
 	if (s->n < 3) {
 		fprintf(stderr,
 		    "Dataset %s must contain at least 3 data points\n", n);
@@ -536,7 +527,9 @@ usage(char const *whine)
 int
 main(int argc, char **argv)
 {
-	struct dataset *ds[7];
+	const char *setfilenames[MAX_DS - 1];
+	struct dataset *ds[MAX_DS - 1];
+	FILE *setfiles[MAX_DS - 1];
 	int nds;
 	double a;
 	const char *delim = " \t";
@@ -609,14 +602,36 @@ main(int argc, char **argv)
 	argv += optind;
 
 	if (argc == 0) {
-		ds[0] = ReadSet("-", column, delim);
+		setfilenames[0] = "<stdin>";
+		setfiles[0] = stdin;
 		nds = 1;
 	} else {
 		if (argc > (MAX_DS - 1))
 			usage("Too many datasets.");
 		nds = argc;
-		for (i = 0; i < nds; i++)
-			ds[i] = ReadSet(argv[i], column, delim);
+		for (i = 0; i < nds; i++) {
+			setfilenames[i] = argv[i];
+			setfiles[i] = fopen(argv[i], "r");
+			if (setfiles[i] == NULL)
+				err(2, "Cannot open %s", argv[i]);
+		}
+	}
+
+	if (caph_limit_stdio() < 0)
+		err(2, "capsicum");
+
+	for (i = 0; i < nds; i++)
+		if (caph_limit_stream(fileno(setfiles[i]), CAPH_READ) < 0)
+			err(2, "unable to limit rights for %s",
+			    setfilenames[i]);
+
+	/* Enter Capsicum sandbox. */
+	if (cap_enter() < 0 && errno != ENOSYS)
+		err(2, "unable to enter capability mode");
+
+	for (i = 0; i < nds; i++) {
+		ds[i] = ReadSet(setfiles[i], setfilenames[i], column, delim);
+		fclose(setfiles[i]);
 	}
 
 	for (i = 0; i < nds; i++) 

From owner-svn-src-all@freebsd.org  Fri Dec 16 01:59:29 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69C49C82F59;
 Fri, 16 Dec 2016 01:59:29 +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 2A983106D;
 Fri, 16 Dec 2016 01:59:29 +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 uBG1xSLX021134;
 Fri, 16 Dec 2016 01:59:28 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG1xSW8021133;
 Fri, 16 Dec 2016 01:59:28 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612160159.uBG1xSW8021133@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Fri, 16 Dec 2016 01:59:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310142 - head/usr.bin/ktrdump
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 01:59:29 -0000

Author: cem
Date: Fri Dec 16 01:59:28 2016
New Revision: 310142
URL: https://svnweb.freebsd.org/changeset/base/310142

Log:
  ktrdump(8): Capsicumify
  
  We restrict the (optional) input file and output files. It would be
  nice to restrict the KVM files, but that's up to libkvm.
  
  We wait until after kvm_nlist() is invoked to cap_enter() because
  kldsym() isn't supported in the Capsicum sandbox.
  
  Feedback from:	emaste@ (earlier versions)
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D7921

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

Modified: head/usr.bin/ktrdump/ktrdump.c
==============================================================================
--- head/usr.bin/ktrdump/ktrdump.c	Fri Dec 16 01:51:12 2016	(r310141)
+++ head/usr.bin/ktrdump/ktrdump.c	Fri Dec 16 01:59:28 2016	(r310142)
@@ -29,11 +29,14 @@
 __FBSDID("$FreeBSD$");
 
 #include <sys/types.h>
+#include <sys/capsicum.h>
 #include <sys/ktr.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
 
+#include <capsicum_helpers.h>
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <kvm.h>
 #include <limits.h>
@@ -70,6 +73,7 @@ static int hflag;
 
 static char corefile[PATH_MAX];
 static char execfile[PATH_MAX];
+static char outfile[PATH_MAX] = "stdout";
 
 static char desc[SBUFLEN];
 static char errbuf[_POSIX2_LINE_MAX];
@@ -87,6 +91,7 @@ main(int ac, char **av)
 	struct ktr_entry *buf;
 	uintmax_t tlast, tnow;
 	unsigned long bufptr;
+	cap_rights_t rights;
 	struct stat sb;
 	kvm_t *kd;
 	FILE *out;
@@ -122,6 +127,11 @@ main(int ac, char **av)
 			iflag = 1;
 			if ((in = open(optarg, O_RDONLY)) == -1)
 				err(1, "%s", optarg);
+			cap_rights_init(&rights, CAP_FSTAT, CAP_MMAP_R);
+			if (cap_rights_limit(in, &rights) < 0 &&
+			    errno != ENOSYS)
+				err(1, "unable to limit rights for %s",
+				    optarg);
 			break;
 		case 'M':
 		case 'm':
@@ -133,6 +143,7 @@ main(int ac, char **av)
 		case 'o':
 			if ((out = fopen(optarg, "w")) == NULL)
 				err(1, "%s", optarg);
+			strlcpy(outfile, optarg, sizeof(outfile));
 			break;
 		case 'q':
 			qflag++;
@@ -155,6 +166,10 @@ main(int ac, char **av)
 	if (ac != 0)
 		usage();
 
+	cap_rights_init(&rights, CAP_FSTAT, CAP_WRITE);
+	if (cap_rights_limit(fileno(out), &rights) < 0 && errno != ENOSYS)
+		err(1, "unable to limit rights for %s", outfile);
+
 	/*
 	 * Open our execfile and corefile, resolve needed symbols and read in
 	 * the trace buffer.
@@ -162,11 +177,28 @@ main(int ac, char **av)
 	if ((kd = kvm_openfiles(Nflag ? execfile : NULL,
 	    Mflag ? corefile : NULL, NULL, O_RDONLY, errbuf)) == NULL)
 		errx(1, "%s", errbuf);
+
+	/*
+	 * Cache NLS data, for strerror, for err(3), before entering capability
+	 * mode.
+	 */
+	caph_cache_catpages();
+
 	if (kvm_nlist(kd, nl) != 0 ||
 	    kvm_read(kd, nl[0].n_value, &version, sizeof(version)) == -1)
 		errx(1, "%s", kvm_geterr(kd));
 	if (version != KTR_VERSION)
 		errx(1, "ktr version mismatch");
+
+	/*
+	 * Enter Capsicum sandbox.
+	 *
+	 * kvm_nlist() above uses kldsym(2) for native kernels, and that isn't
+	 * allowed in the sandbox.
+	 */
+	if (cap_enter() < 0 && errno != ENOSYS)
+		err(1, "unable to enter capability mode");
+
 	if (iflag) {
 		if (fstat(in, &sb) == -1)
 			errx(1, "stat");

From owner-svn-src-all@freebsd.org  Fri Dec 16 02:03:41 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA351C77139;
 Fri, 16 Dec 2016 02:03:41 +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 601B01594;
 Fri, 16 Dec 2016 02:03:41 +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 uBG23eKN024825;
 Fri, 16 Dec 2016 02:03:40 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG23eLU024823;
 Fri, 16 Dec 2016 02:03:40 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612160203.uBG23eLU024823@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Fri, 16 Dec 2016 02:03:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310143 - head/usr.bin/hexdump
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 02:03:41 -0000

Author: cem
Date: Fri Dec 16 02:03:40 2016
New Revision: 310143
URL: https://svnweb.freebsd.org/changeset/base/310143

Log:
  hexdump(1): First cut capsicumification
  
  For now, only enter the sandbox for the last file processed (including
  stdin for zero-argument mode).
  
  Sandboxing all inputs will require a little restructuring of the
  program.
  
  Feedback by:	emaste@ (earlier versions)
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D7915

Modified:
  head/usr.bin/hexdump/display.c
  head/usr.bin/hexdump/hexdump.c

Modified: head/usr.bin/hexdump/display.c
==============================================================================
--- head/usr.bin/hexdump/display.c	Fri Dec 16 01:59:28 2016	(r310142)
+++ head/usr.bin/hexdump/display.c	Fri Dec 16 02:03:40 2016	(r310143)
@@ -36,10 +36,13 @@ static char sccsid[] = "@(#)display.c	8.
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
+#include <sys/capsicum.h>
 #include <sys/stat.h>
 
+#include <capsicum_helpers.h>
 #include <ctype.h>
 #include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -355,6 +358,19 @@ next(char **argv)
 				return(0);
 			statok = 0;
 		}
+
+		if (caph_limit_stream(fileno(stdin), CAPH_READ) < 0)
+			err(1, "unable to restrict %s",
+			    statok ? _argv[-1] : "stdin");
+
+		/*
+		 * We've opened our last input file; enter capsicum sandbox.
+		 */
+		if (*_argv == NULL) {
+			if (cap_enter() < 0 && errno != ENOSYS)
+				err(1, "unable to enter capability mode");
+		}
+
 		if (skip)
 			doskip(statok ? *_argv : "stdin", statok);
 		if (*_argv)

Modified: head/usr.bin/hexdump/hexdump.c
==============================================================================
--- head/usr.bin/hexdump/hexdump.c	Fri Dec 16 01:59:28 2016	(r310142)
+++ head/usr.bin/hexdump/hexdump.c	Fri Dec 16 02:03:40 2016	(r310143)
@@ -42,6 +42,9 @@ static char sccsid[] = "@(#)hexdump.c	8.
 __FBSDID("$FreeBSD$");
 
 #include <sys/types.h>
+#include <sys/capsicum.h>
+#include <capsicum_helpers.h>
+#include <err.h>
 #include <locale.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -76,6 +79,14 @@ main(int argc, char *argv[])
 	for (tfs = fshead; tfs; tfs = tfs->nextfs)
 		rewrite(tfs);
 
+	/*
+	 * Cache NLS data, for strerror, for err(3), before entering capability
+	 * mode.
+	 */
+	caph_cache_catpages();
+	if (caph_limit_stdio() < 0)
+		err(1, "capsicum");
+
 	(void)next(argv);
 	display();
 	exit(exitval);

From owner-svn-src-all@freebsd.org  Fri Dec 16 02:06:36 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0122DC771FF;
 Fri, 16 Dec 2016 02:06:36 +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 CFFFA1784;
 Fri, 16 Dec 2016 02:06:35 +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 uBG26ZqB024962;
 Fri, 16 Dec 2016 02:06:35 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG26Z74024961;
 Fri, 16 Dec 2016 02:06:35 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612160206.uBG26Z74024961@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Fri, 16 Dec 2016 02:06:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310144 - head/usr.bin/iconv
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 02:06:36 -0000

Author: cem
Date: Fri Dec 16 02:06:34 2016
New Revision: 310144
URL: https://svnweb.freebsd.org/changeset/base/310144

Log:
  iconv(1): Capsicumify
  
  This takes the usual shortcut of only sandboxing the last input file.
  It's a first cut and this program will be easy to adapt to sandbox all
  files in the future.
  
  iconv(1) has been changed to only open the conversion descriptor once,
  since the input and output encodings are fixed over all inputs.
  Instead, the descriptor is simply reset after each use (documented in
  iconv(3) API).
  
  Reviewed by:	no one, unfortunately
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D7917

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

Modified: head/usr.bin/iconv/iconv.c
==============================================================================
--- head/usr.bin/iconv/iconv.c	Fri Dec 16 02:03:40 2016	(r310143)
+++ head/usr.bin/iconv/iconv.c	Fri Dec 16 02:06:34 2016	(r310144)
@@ -28,7 +28,9 @@
  */
 
 #include <sys/cdefs.h>
+#include <sys/capsicum.h>
 
+#include <capsicum_helpers.h>
 #include <err.h>
 #include <errno.h>
 #include <getopt.h>
@@ -41,7 +43,7 @@
 #include <string.h>
 #include <unistd.h>
 
-static int		do_conv(FILE *, const char *, const char *, bool, bool);
+static int		do_conv(FILE *, iconv_t, bool, bool);
 static int		do_list(unsigned int, const char * const *, void *);
 static void		usage(void) __dead2;
 
@@ -67,23 +69,16 @@ usage(void)
 #define INBUFSIZE 1024
 #define OUTBUFSIZE (INBUFSIZE * 2)
 static int
-do_conv(FILE *fp, const char *from, const char *to, bool silent,
-    bool hide_invalid)
+do_conv(FILE *fp, iconv_t cd, bool silent, bool hide_invalid)
 {
-	iconv_t cd;
 	char inbuf[INBUFSIZE], outbuf[OUTBUFSIZE], *in, *out;
 	unsigned long long invalids;
 	size_t inbytes, outbytes, ret;
 
-	if ((cd = iconv_open(to, from)) == (iconv_t)-1)
-		err(EXIT_FAILURE, "iconv_open(%s, %s)", to, from);
-
-	if (hide_invalid) {
-		int arg = 1;
+	int arg = (int)hide_invalid;
+	if (iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, (void *)&arg) == -1)
+		err(EXIT_FAILURE, "iconvctl(DISCARD_ILSEQ, %d)", arg);
 
-		if (iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, (void *)&arg) == -1)
-			err(EXIT_FAILURE, NULL);
-	}
 	invalids = 0;
 	while ((inbytes = fread(inbuf, 1, INBUFSIZE, fp)) > 0) {
 		in = inbuf;
@@ -133,7 +128,6 @@ do_conv(FILE *fp, const char *from, cons
 	if (invalids > 0 && !silent)
 		warnx("warning: invalid characters: %llu", invalids);
 
-	iconv_close(cd);
 	return (invalids > 0);
 }
 
@@ -155,6 +149,7 @@ do_list(unsigned int n, const char * con
 int
 main(int argc, char **argv)
 {
+	iconv_t cd;
 	FILE *fp;
 	const char *opt_f, *opt_t;
 	int ch, i, res;
@@ -201,9 +196,28 @@ main(int argc, char **argv)
 	argv += optind;
 	if ((strcmp(opt_f, "") == 0) && (strcmp(opt_t, "") == 0))
 		usage();
-	if (argc == 0)
-		res = do_conv(stdin, opt_f, opt_t, opt_s, opt_c);
-	else {
+
+	if (caph_limit_stdio() < 0)
+		err(EXIT_FAILURE, "capsicum");
+
+	/*
+	 * Cache NLS data, for strerror, for err(3), before entering capability
+	 * mode.
+	 */
+	caph_cache_catpages();
+
+	/*
+	 * Cache iconv conversion handle before entering sandbox.
+	 */
+	cd = iconv_open(opt_t, opt_f);
+	if (cd == (iconv_t)-1)
+		err(EXIT_FAILURE, "iconv_open(%s, %s)", opt_t, opt_f);
+
+	if (argc == 0) {
+		if (cap_enter() < 0 && errno != ENOSYS)
+			err(EXIT_FAILURE, "unable to enter capability mode");
+		res = do_conv(stdin, cd, opt_s, opt_c);
+	} else {
 		res = 0;
 		for (i = 0; i < argc; i++) {
 			fp = (strcmp(argv[i], "-") != 0) ?
@@ -211,9 +225,17 @@ main(int argc, char **argv)
 			if (fp == NULL)
 				err(EXIT_FAILURE, "Cannot open `%s'",
 				    argv[i]);
-			res |= do_conv(fp, opt_f, opt_t, opt_s, opt_c);
+			/* Enter Capsicum sandbox for final input file. */
+			if (i + 1 == argc && cap_enter() < 0 && errno != ENOSYS)
+				err(EXIT_FAILURE,
+				    "unable to enter capability mode");
+			res |= do_conv(fp, cd, opt_s, opt_c);
 			(void)fclose(fp);
+
+			/* Reset iconv descriptor state. */
+			(void)iconv(cd, NULL, NULL, NULL, NULL);
 		}
 	}
+	iconv_close(cd);
 	return (res == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }

From owner-svn-src-all@freebsd.org  Fri Dec 16 02:09:49 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7812C772D4;
 Fri, 16 Dec 2016 02:09:49 +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 6DD55197E;
 Fri, 16 Dec 2016 02:09:49 +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 uBG29mPP025099;
 Fri, 16 Dec 2016 02:09:48 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG29mXh025098;
 Fri, 16 Dec 2016 02:09:48 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201612160209.uBG29mXh025098@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: "Conrad E. Meyer" <cem@FreeBSD.org>
Date: Fri, 16 Dec 2016 02:09:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310145 - head/usr.bin/ident
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 02:09:49 -0000

Author: cem
Date: Fri Dec 16 02:09:48 2016
New Revision: 310145
URL: https://svnweb.freebsd.org/changeset/base/310145

Log:
  ident(1): Capsicumify
  
  Preopen input file list before entering Capsicum capability mode.
  
  Feedback by:	allanjude@, bapt@, emaste@ (earlier versions)
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D7918

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

Modified: head/usr.bin/ident/ident.c
==============================================================================
--- head/usr.bin/ident/ident.c	Fri Dec 16 02:06:34 2016	(r310144)
+++ head/usr.bin/ident/ident.c	Fri Dec 16 02:09:48 2016	(r310145)
@@ -28,11 +28,14 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/capsicum.h>
 #include <sys/types.h>
 #include <sys/sbuf.h>
 
+#include <capsicum_helpers.h>
 #include <ctype.h>
 #include <err.h>
+#include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -202,8 +205,9 @@ int
 main(int argc, char **argv)
 {
 	bool quiet = false;
-	int ch, i;
+	int ch, i, *fds, fd;
 	int ret = EXIT_SUCCESS;
+	size_t nfds;
 	FILE *fp;
 
 	while ((ch = getopt(argc, argv, "qV")) != -1) {
@@ -223,17 +227,50 @@ main(int argc, char **argv)
 	argc -= optind;
 	argv += optind;
 
-	if (argc == 0)
-		return (scan(stdin, NULL, quiet));
+	if (caph_limit_stdio() < 0)
+		err(EXIT_FAILURE, "unable to limit stdio");
 
-	for (i = 0; i < argc; i++) {
-		fp = fopen(argv[i], "r");
+	if (argc == 0) {
+		nfds = 1;
+		fds = malloc(sizeof(*fds));
+		if (fds == NULL)
+			err(EXIT_FAILURE, "unable to allocate fds array");
+		fds[0] = STDIN_FILENO;
+	} else {
+		nfds = argc;
+		fds = malloc(sizeof(*fds) * nfds);
+		if (fds == NULL)
+			err(EXIT_FAILURE, "unable to allocate fds array");
+
+		for (i = 0; i < argc; i++) {
+			fds[i] = fd = open(argv[i], O_RDONLY);
+			if (fd < 0) {
+				warn("%s", argv[i]);
+				ret = EXIT_FAILURE;
+				continue;
+			}
+			if (caph_limit_stream(fd, CAPH_READ) < 0)
+				err(EXIT_FAILURE,
+				    "unable to limit fcntls/rights for %s",
+				    argv[i]);
+		}
+	}
+
+	/* Enter Capsicum sandbox. */
+	if (cap_enter() < 0 && errno != ENOSYS)
+		err(EXIT_FAILURE, "unable to enter capability mode");
+
+	for (i = 0; i < (int)nfds; i++) {
+		if (fds[i] < 0)
+			continue;
+
+		fp = fdopen(fds[i], "r");
 		if (fp == NULL) {
 			warn("%s", argv[i]);
 			ret = EXIT_FAILURE;
 			continue;
 		}
-		if (scan(fp, argv[i], quiet) != EXIT_SUCCESS)
+		if (scan(fp, argc == 0 ? NULL : argv[i], quiet) != EXIT_SUCCESS)
 			ret = EXIT_FAILURE;
 		fclose(fp);
 	}

From owner-svn-src-all@freebsd.org  Fri Dec 16 04:38:54 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD6D7C768C1;
 Fri, 16 Dec 2016 04:38:54 +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 7CCDF1147;
 Fri, 16 Dec 2016 04:38:54 +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 uBG4crGs086574;
 Fri, 16 Dec 2016 04:38:53 GMT (envelope-from jhibbits@FreeBSD.org)
Received: (from jhibbits@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG4crwR086573;
 Fri, 16 Dec 2016 04:38:53 GMT (envelope-from jhibbits@FreeBSD.org)
Message-Id: <201612160438.uBG4crwR086573@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to
 jhibbits@FreeBSD.org using -f
From: Justin Hibbits <jhibbits@FreeBSD.org>
Date: Fri, 16 Dec 2016 04:38:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310146 - head/sys/powerpc/powerpc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 04:38:54 -0000

Author: jhibbits
Date: Fri Dec 16 04:38:53 2016
New Revision: 310146
URL: https://svnweb.freebsd.org/changeset/base/310146

Log:
  Use the right bitwise OR operation for clearing single-step at trap time.
  
  DBCR0_IDM || DBCRO_IC yields 1, which in this register is DBCR0_FT, not what we
  want.
  Reported by:	Mark Millard
  MFC after:	2 weeks

Modified:
  head/sys/powerpc/powerpc/trap.c

Modified: head/sys/powerpc/powerpc/trap.c
==============================================================================
--- head/sys/powerpc/powerpc/trap.c	Fri Dec 16 02:09:48 2016	(r310145)
+++ head/sys/powerpc/powerpc/trap.c	Fri Dec 16 04:38:53 2016	(r310146)
@@ -280,7 +280,7 @@ trap(struct trapframe *frame)
 		case EXC_DEBUG:	/* Single stepping */
 			mtspr(SPR_DBSR, mfspr(SPR_DBSR));
 			frame->srr1 &= ~PSL_DE;
-			frame->cpu.booke.dbcr0 &= ~(DBCR0_IDM || DBCR0_IC);
+			frame->cpu.booke.dbcr0 &= ~(DBCR0_IDM | DBCR0_IC);
 			sig = SIGTRAP;
 			ucode = TRAP_TRACE;
 			break;

From owner-svn-src-all@freebsd.org  Fri Dec 16 04:43:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1514CC76AE7;
 Fri, 16 Dec 2016 04:43:33 +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 CA11B1647;
 Fri, 16 Dec 2016 04:43: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 uBG4hVKE090515;
 Fri, 16 Dec 2016 04:43:31 GMT (envelope-from adrian@FreeBSD.org)
Received: (from adrian@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG4hVEl090511;
 Fri, 16 Dec 2016 04:43:31 GMT (envelope-from adrian@FreeBSD.org)
Message-Id: <201612160443.uBG4hVEl090511@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: adrian set sender to
 adrian@FreeBSD.org using -f
From: Adrian Chadd <adrian@FreeBSD.org>
Date: Fri, 16 Dec 2016 04:43:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310147 - in head/sys: net net80211
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 04:43:33 -0000

Author: adrian
Date: Fri Dec 16 04:43:31 2016
New Revision: 310147
URL: https://svnweb.freebsd.org/changeset/base/310147

Log:
  [net80211] start laying down the foundation for 11ac support.
  
  This is a work in progress and some of this stuff may change;
  but hopefully I'm laying down enough stuff and space in fields
  to allow it to grow without another major recompile.
  
  We'll see!
  
  * Add a net80211 PHY type for VHT 2G and VHT 5G.
  
    Note - yes, VHT is supposed to be for 5GHZ, however some vendors
    (*cough* most of them) support some subset of VHT rate support
    in 2GHz.  No - not 80MHz wide channels, but at least some MCS8-9
    support, maybe some beamforming, and maybe some longer A-MPDU
    aggregates.  I don't want to even think about MU-MIMO on 2GHz.
  
  * Add an ifmedia placeholder type for VHT rates.
  
  * Add channel flags for VHT, VHT20/40U/40D/80/80+80/160
  * Add channel macros for the above
  * Add ieee80211_channel fields for the VHT information and flags,
    along with some padding (so this struct definitely grows.)
  * Add a phy type flag for VHT - 'v'
  
  * Bump the number of channels to a much higher amount - until we get
    something like the linux mac80211 chanctx abstraction (where the
    stack provides a current channel configuration via callbacks,
    versus the driver ever checking ic->ic_curchan or similar) we'll
    have to populate VHT+HT combinations.
  
  Eg, there'll likely be a full set of duplicate VHT20/40 channels to match
  HT channels.  There will also be a full set of duplicate VHT80 channels -
  note that for VHT80, its assumed you're doing VHT40 as a base, so we
  don't need a duplicate of VHT80 + 20MHz only primary channels, only
  a duplicate of all the VHT40 combinations.
  
  I don't want to think about VHT80+80 or VHT160 for now - and I won't,
  as the current device I'm doing 11ac bringup on (QCA9880) only does
  VHT80.
  
  I'll likely revisit the channel configuration and scanning related
  stuff after I get VHT20/40 up.
  
  * Add vht flags and the basic MCS rate setup to ieee80211com, ieee80211vap
    and ieee80211_node in preparation for 11ac configuration.
    There is zero code that uses this right now.
  * Whilst here, add some more placeholders in case I need to extend
    out things by some uint32_t flag sized fields.  Hopefully I won't!
  
  What I haven't yet done:
  
  * any of the code that uses this
  * any of the beamforming related fields
  * any of the MU-MIMO fields required for STA/AP operation
  * any of the IE fields in beacon frame / probe request/response handling
    and the calculations required for shifting beacon contents around
    when the TIM grows/shrinks
  
  This will require a full rebuild of net80211 related programs -
  ifconfig, hostapd, wpa_supplicant.

Modified:
  head/sys/net/if_media.h
  head/sys/net80211/_ieee80211.h
  head/sys/net80211/ieee80211_node.h
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/net/if_media.h
==============================================================================
--- head/sys/net/if_media.h	Fri Dec 16 04:38:53 2016	(r310146)
+++ head/sys/net/if_media.h	Fri Dec 16 04:43:31 2016	(r310147)
@@ -264,6 +264,7 @@ uint64_t	ifmedia_baudrate(int);
 #define	IFM_IEEE80211_OFDM27	23	/* OFDM 27Mbps */
 /* NB: not enough bits to express MCS fully */
 #define	IFM_IEEE80211_MCS	24	/* HT MCS rate */
+#define	IFM_IEEE80211_VHT	25	/* HT MCS rate */
 
 #define	IFM_IEEE80211_ADHOC	0x00000100	/* Operate in Adhoc mode */
 #define	IFM_IEEE80211_HOSTAP	0x00000200	/* Operate in Host AP mode */
@@ -280,6 +281,8 @@ uint64_t	ifmedia_baudrate(int);
 #define	IFM_IEEE80211_FH	0x00040000	/* 2Ghz, GFSK mode */
 #define	IFM_IEEE80211_11NA	0x00050000	/* 5Ghz, HT mode */
 #define	IFM_IEEE80211_11NG	0x00060000	/* 2Ghz, HT mode */
+#define	IFM_IEEE80211_VHT5G	0x00070000	/* 5Ghz, VHT mode */
+#define	IFM_IEEE80211_VHT2G	0x00080000	/* 2Ghz, VHT mode */
 
 /*
  * ATM

Modified: head/sys/net80211/_ieee80211.h
==============================================================================
--- head/sys/net80211/_ieee80211.h	Fri Dec 16 04:38:53 2016	(r310146)
+++ head/sys/net80211/_ieee80211.h	Fri Dec 16 04:43:31 2016	(r310147)
@@ -45,6 +45,7 @@ enum ieee80211_phytype {
 	IEEE80211_T_HT,			/* high throughput */
 	IEEE80211_T_OFDM_HALF,		/* 1/2 rate OFDM */
 	IEEE80211_T_OFDM_QUARTER,	/* 1/4 rate OFDM */
+	IEEE80211_T_VHT,		/* VHT PHY */
 };
 #define	IEEE80211_T_CCK	IEEE80211_T_DS	/* more common nomenclature */
 
@@ -68,8 +69,10 @@ enum ieee80211_phymode {
 	IEEE80211_MODE_11NG	= 9,	/* 2GHz, w/ HT */
 	IEEE80211_MODE_HALF	= 10,	/* OFDM, 1/2x clock */
 	IEEE80211_MODE_QUARTER	= 11,	/* OFDM, 1/4x clock */
+	IEEE80211_MODE_VHT_2GHZ	= 12,	/* 2GHz, VHT */
+	IEEE80211_MODE_VHT_5GHZ	= 13,	/* 5GHz, VHT */
 };
-#define	IEEE80211_MODE_MAX	(IEEE80211_MODE_QUARTER+1)
+#define	IEEE80211_MODE_MAX	(IEEE80211_MODE_VHT_5GHZ+1)
 #define	IEEE80211_MODE_BYTES	howmany(IEEE80211_MODE_MAX, NBBY)
 
 /*
@@ -134,7 +137,7 @@ enum ieee80211_roamingmode {
  */
 struct ieee80211_channel {
 	uint32_t	ic_flags;	/* see below */
-	uint16_t	ic_freq;	/* setting in MHz */
+	uint16_t	ic_freq;	/* primary centre frequency in MHz */
 	uint8_t		ic_ieee;	/* IEEE channel number */
 	int8_t		ic_maxregpower;	/* maximum regulatory tx power in dBm */
 	int8_t		ic_maxpower;	/* maximum tx power in .5 dBm */
@@ -144,9 +147,17 @@ struct ieee80211_channel {
 	int8_t		ic_maxantgain;	/* maximum antenna gain in .5 dBm */
 	uint8_t		ic_pad;
 	uint16_t	ic_devdata;	/* opaque device/driver data */
+	uint8_t		ic_vht_ch_freq1; /* VHT primary freq1 IEEE value */
+	uint8_t		ic_vht_ch_freq2; /* VHT secondary 80MHz freq2 IEEE value */
+	uint16_t	ic_freq2;	/* VHT secondary 80MHz freq2 MHz */
 };
 
-#define	IEEE80211_CHAN_MAX	256
+/*
+ * Note: for VHT operation we will need significantly more than
+ * IEEE80211_CHAN_MAX channels because of the combinations of
+ * VHT20, VHT40, VHT80, VHT80+80 and VHT160.
+ */
+#define	IEEE80211_CHAN_MAX	1024
 #define	IEEE80211_CHAN_BYTES	howmany(IEEE80211_CHAN_MAX, NBBY)
 #define	IEEE80211_CHAN_ANY	0xffff	/* token for ``any channel'' */
 #define	IEEE80211_CHAN_ANYC \
@@ -177,14 +188,26 @@ struct ieee80211_channel {
 #define	IEEE80211_CHAN_NOADHOC	0x00200000 /* adhoc mode not allowed */
 #define	IEEE80211_CHAN_NOHOSTAP	0x00400000 /* hostap mode not allowed */
 #define	IEEE80211_CHAN_11D	0x00800000 /* 802.11d required */
+#define	IEEE80211_CHAN_VHT20	0x01000000 /* VHT20 channel */
+#define	IEEE80211_CHAN_VHT40U	0x02000000 /* VHT40 channel, ext above */
+#define	IEEE80211_CHAN_VHT40D	0x04000000 /* VHT40 channel, ext below */
+#define	IEEE80211_CHAN_VHT80	0x08000000 /* VHT80 channel */
+#define	IEEE80211_CHAN_VHT80_80	0x10000000 /* VHT80+80 channel */
+#define	IEEE80211_CHAN_VHT160	0x20000000 /* VHT160 channel */
 
 #define	IEEE80211_CHAN_HT40	(IEEE80211_CHAN_HT40U | IEEE80211_CHAN_HT40D)
 #define	IEEE80211_CHAN_HT	(IEEE80211_CHAN_HT20 | IEEE80211_CHAN_HT40)
 
+#define	IEEE80211_CHAN_VHT40	(IEEE80211_CHAN_VHT40U | IEEE80211_CHAN_VHT40D)
+#define	IEEE80211_CHAN_VHT	(IEEE80211_CHAN_VHT20 | IEEE80211_CHAN_VHT40 \
+				| IEEE80211_CHAN_VHT80 | IEEE80211_CHAN_VHT80_80 \
+				| IEEE80211_CHAN_VHT160)
+
 #define	IEEE80211_CHAN_BITS \
 	"\20\1PRIV0\2PRIV2\3PRIV3\4PRIV4\5TURBO\6CCK\7OFDM\0102GHZ\0115GHZ" \
 	"\12PASSIVE\13DYN\14GFSK\15GSM\16STURBO\17HALF\20QUARTER\21HT20" \
 	"\22HT40U\23HT40D\24DFS\0254MSXMIT\26NOADHOC\27NOHOSTAP\03011D"
+/* XXX TODO: add VHT bits */
 
 /*
  * Useful combinations of channel characteristics.
@@ -210,7 +233,7 @@ struct ieee80211_channel {
 	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \
 	 IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN | \
 	 IEEE80211_CHAN_HALF | IEEE80211_CHAN_QUARTER | \
-	 IEEE80211_CHAN_HT)
+	 IEEE80211_CHAN_HT | IEEE80211_CHAN_VHT)
 #define	IEEE80211_CHAN_ALLTURBO \
 	(IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)
 
@@ -287,6 +310,29 @@ struct ieee80211_channel {
 #define	IEEE80211_IS_CHAN_11D(_c) \
 	(((_c)->ic_flags & IEEE80211_CHAN_11D) != 0)
 
+#define	IEEE80211_IS_CHAN_VHT(_c) \
+	(((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
+#define	IEEE80211_IS_CHAN_VHT20(_c) \
+	(((_c)->ic_flags & IEEE80211_CHAN_VHT20) != 0)
+#define	IEEE80211_IS_CHAN_VHT40(_c) \
+	(((_c)->ic_flags & IEEE80211_CHAN_VHT40) != 0)
+#define	IEEE80211_IS_CHAN_VHT40U(_c) \
+	(((_c)->ic_flags & IEEE80211_CHAN_VHT40U) != 0)
+#define	IEEE80211_IS_CHAN_VHT40D(_c) \
+	(((_c)->ic_flags & IEEE80211_CHAN_VHT40D) != 0)
+#define	IEEE80211_IS_CHAN_VHTA(_c) \
+	(IEEE80211_IS_CHAN_5GHZ(_c) && \
+	 ((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
+#define	IEEE80211_IS_CHAN_VHTG(_c) \
+	(IEEE80211_IS_CHAN_2GHZ(_c) && \
+	 ((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
+#define	IEEE80211_IS_CHAN_VHT80(_c) \
+	(((_c)->ic_flags & IEEE80211_CHAN_VHT80) != 0)
+#define	IEEE80211_IS_CHAN_VHT80_80(_c) \
+	(((_c)->ic_flags & IEEE80211_CHAN_VHT80_80) != 0)
+#define	IEEE80211_IS_CHAN_VHT160(_c) \
+	(((_c)->ic_flags & IEEE80211_CHAN_VHT160) != 0)
+
 #define	IEEE80211_CHAN2IEEE(_c)		(_c)->ic_ieee
 
 /* dynamic state */

Modified: head/sys/net80211/ieee80211_node.h
==============================================================================
--- head/sys/net80211/ieee80211_node.h	Fri Dec 16 04:38:53 2016	(r310146)
+++ head/sys/net80211/ieee80211_node.h	Fri Dec 16 04:43:31 2016	(r310147)
@@ -224,6 +224,15 @@ struct ieee80211_node {
 	struct ieee80211_tx_ampdu ni_tx_ampdu[WME_NUM_TID];
 	struct ieee80211_rx_ampdu ni_rx_ampdu[WME_NUM_TID];
 
+	/* VHT state */
+	uint32_t		ni_vhtcap;
+	uint32_t		ni_vhtinfo;
+	struct ieee80211_vht_mcs_info	ni_vht_mcsinfo;
+	uint8_t			ni_vht_chan1;	/* 20/40/80/160 - VHT chan1 */
+	uint8_t			ni_vht_chan2;	/* 80+80 - VHT chan2 */
+	uint16_t		ni_vht_pad1;
+	uint32_t		ni_vht_spare[8];
+
 	/* fast-frames state */
 	struct mbuf *		ni_tx_superg[WME_NUM_TID];
 

Modified: head/sys/net80211/ieee80211_var.h
==============================================================================
--- head/sys/net80211/ieee80211_var.h	Fri Dec 16 04:38:53 2016	(r310146)
+++ head/sys/net80211/ieee80211_var.h	Fri Dec 16 04:43:31 2016	(r310147)
@@ -229,6 +229,12 @@ struct ieee80211com {
 	uint8_t			ic_rxstream;    /* # RX streams */
 	uint8_t			ic_txstream;    /* # TX streams */
 
+	/* VHT information */
+	uint32_t		ic_vhtcaps;	/* VHT capabilities */
+	uint32_t		ic_vhtextcaps;	/* VHT extended capabilities (TODO) */
+	struct ieee80211_vht_mcs_info	iv_vht_mcsinfo; /* Support TX/RX VHT MCS */
+	uint32_t		ic_vht_spare[4];
+
 	/* optional state for Atheros SuperG protocol extensions */
 	struct ieee80211_superg	*ic_superg;
 
@@ -390,6 +396,13 @@ struct ieee80211vap {
 	int			iv_inact_run;	/* authorized setting */
 	int			iv_inact_probe;	/* inactive probe time */
 
+	/* VHT flags */
+	uint32_t		iv_flags_vht;	/* VHT state flags */
+	uint32_t		iv_vhtcaps;	/* VHT capabilities */
+	uint32_t		iv_vhtextcaps;	/* VHT extended capabilities (TODO) */
+	struct ieee80211_vht_mcs_info	iv_vht_mcsinfo;
+	uint32_t		iv_vht_spare[4];
+
 	int			iv_des_nssid;	/* # desired ssids */
 	struct ieee80211_scan_ssid iv_des_ssid[1];/* desired ssid table */
 	uint8_t			iv_des_bssid[IEEE80211_ADDR_LEN];

From owner-svn-src-all@freebsd.org  Fri Dec 16 04:44:15 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 911AEC76BA0;
 Fri, 16 Dec 2016 04:44:15 +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 60CF917BE;
 Fri, 16 Dec 2016 04:44:15 +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 uBG4iEhE090620;
 Fri, 16 Dec 2016 04:44:14 GMT (envelope-from adrian@FreeBSD.org)
Received: (from adrian@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG4iELu090619;
 Fri, 16 Dec 2016 04:44:14 GMT (envelope-from adrian@FreeBSD.org)
Message-Id: <201612160444.uBG4iELu090619@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: adrian set sender to
 adrian@FreeBSD.org using -f
From: Adrian Chadd <adrian@FreeBSD.org>
Date: Fri, 16 Dec 2016 04:44:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310148 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 04:44:15 -0000

Author: adrian
Date: Fri Dec 16 04:44:14 2016
New Revision: 310148
URL: https://svnweb.freebsd.org/changeset/base/310148

Log:
  [net80211] sigh, course I would miss a commit from the 11ac prep commit.

Modified:
  head/sys/net80211/ieee80211.c

Modified: head/sys/net80211/ieee80211.c
==============================================================================
--- head/sys/net80211/ieee80211.c	Fri Dec 16 04:43:31 2016	(r310147)
+++ head/sys/net80211/ieee80211.c	Fri Dec 16 04:44:14 2016	(r310148)
@@ -2020,6 +2020,10 @@ ieee80211_rate2media(struct ieee80211com
 	case IEEE80211_MODE_11NG:
 	case IEEE80211_MODE_TURBO_G:
 		return findmedia(rates, nitems(rates), rate | IFM_IEEE80211_11G);
+	case IEEE80211_MODE_VHT_2GHZ:
+	case IEEE80211_MODE_VHT_5GHZ:
+		/* XXX TODO: need to figure out mapping for VHT rates */
+		return IFM_AUTO;
 	}
 	return IFM_AUTO;
 }
@@ -2053,6 +2057,7 @@ ieee80211_media2rate(int mword)
 		9,		/* IFM_IEEE80211_OFDM4 */
 		54,		/* IFM_IEEE80211_OFDM27 */
 		-1,		/* IFM_IEEE80211_MCS */
+		-1,		/* IFM_IEEE80211_VHT */
 	};
 	return IFM_SUBTYPE(mword) < nitems(ieeerates) ?
 		ieeerates[IFM_SUBTYPE(mword)] : 0;
@@ -2103,6 +2108,8 @@ ieee80211_channel_type_char(const struct
 		return 'T';
 	if (IEEE80211_IS_CHAN_108G(c))
 		return 'G';
+	if (IEEE80211_IS_CHAN_VHT(c))
+		return 'v';
 	if (IEEE80211_IS_CHAN_HT(c))
 		return 'n';
 	if (IEEE80211_IS_CHAN_A(c))

From owner-svn-src-all@freebsd.org  Fri Dec 16 04:44:47 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88E7AC76C22;
 Fri, 16 Dec 2016 04:44:47 +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 58C791951;
 Fri, 16 Dec 2016 04:44:47 +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 uBG4ikAM090696;
 Fri, 16 Dec 2016 04:44:46 GMT (envelope-from adrian@FreeBSD.org)
Received: (from adrian@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG4ikwX090695;
 Fri, 16 Dec 2016 04:44:46 GMT (envelope-from adrian@FreeBSD.org)
Message-Id: <201612160444.uBG4ikwX090695@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: adrian set sender to
 adrian@FreeBSD.org using -f
From: Adrian Chadd <adrian@FreeBSD.org>
Date: Fri, 16 Dec 2016 04:44:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310149 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 04:44:47 -0000

Author: adrian
Date: Fri Dec 16 04:44:46 2016
New Revision: 310149
URL: https://svnweb.freebsd.org/changeset/base/310149

Log:
  Bump FreeBSD_version .

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Fri Dec 16 04:44:14 2016	(r310148)
+++ head/sys/sys/param.h	Fri Dec 16 04:44:46 2016	(r310149)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200018	/* Master, propagated to newvers */
+#define __FreeBSD_version 1200019	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

From owner-svn-src-all@freebsd.org  Fri Dec 16 04:47:30 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B8C1C76CDC;
 Fri, 16 Dec 2016 04:47:30 +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 245EF1AFF;
 Fri, 16 Dec 2016 04:47:30 +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 uBG4lT33090894;
 Fri, 16 Dec 2016 04:47:29 GMT (envelope-from jhibbits@FreeBSD.org)
Received: (from jhibbits@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG4lTir090893;
 Fri, 16 Dec 2016 04:47:29 GMT (envelope-from jhibbits@FreeBSD.org)
Message-Id: <201612160447.uBG4lTir090893@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to
 jhibbits@FreeBSD.org using -f
From: Justin Hibbits <jhibbits@FreeBSD.org>
Date: Fri, 16 Dec 2016 04:47:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310150 - head/sys/powerpc/powerpc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 04:47:30 -0000

Author: jhibbits
Date: Fri Dec 16 04:47:29 2016
New Revision: 310150
URL: https://svnweb.freebsd.org/changeset/base/310150

Log:
  Fix disassembly by adding back some deleted lines.
  
  When importing for r309309, as part of conflict resolution, too much extra was
  removed, resulting in bad disassembly for branches.  Correct this.
  
  Also re-apply the 0->NULL change from r298052.
  
  X-MFC-With:	r309309

Modified:
  head/sys/powerpc/powerpc/db_disasm.c

Modified: head/sys/powerpc/powerpc/db_disasm.c
==============================================================================
--- head/sys/powerpc/powerpc/db_disasm.c	Fri Dec 16 04:44:46 2016	(r310149)
+++ head/sys/powerpc/powerpc/db_disasm.c	Fri Dec 16 04:47:29 2016	(r310150)
@@ -871,8 +871,11 @@ disasm_fields(const struct opcode *popco
 		func &= ~Op_crbB;
 	}
 	if (func & Op_LI) {
-		u_int LI;
+		int LI;
 		LI = extract_field(instr, 31 - 29, 24);
+		LI = LI << 8;
+		LI = LI >> 6;
+		LI += loc;
 		APP_PSTR("0x%x", LI);
 		func &= ~Op_LI;
 	}
@@ -897,8 +900,11 @@ disasm_fields(const struct opcode *popco
 		;
 	}
 	if (func & Op_BD) {
-		u_int BD;
+		int BD;
 		BD = extract_field(instr, 31 - 29, 14);
+		BD = BD << 18;
+		BD = BD >> 16;
+		BD += loc;
 		/* Need to sign extend and shift up 2, then add addr */
 		APP_PSTR("0x%x", BD);
 		func &= ~Op_BD;
@@ -968,9 +974,9 @@ disasm_fields(const struct opcode *popco
 			reg = "tbu";
 			break;
 		default:
-			reg = 0;
+			reg = NULL;
 		}
-		if (reg == 0)
+		if (reg == NULL)
 			APP_PSTR(", [unknown tbr %d ]", tbr);
 		else
 			APP_PSTR(", %s", reg);

From owner-svn-src-all@freebsd.org  Fri Dec 16 06:25:52 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAA9FC8278F;
 Fri, 16 Dec 2016 06:25:52 +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 5F7E8A79;
 Fri, 16 Dec 2016 06:25:52 +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 uBG6Pp12031367;
 Fri, 16 Dec 2016 06:25:51 GMT (envelope-from np@FreeBSD.org)
Received: (from np@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG6PpX1031366;
 Fri, 16 Dec 2016 06:25:51 GMT (envelope-from np@FreeBSD.org)
Message-Id: <201612160625.uBG6PpX1031366@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org
 using -f
From: Navdeep Parhar <np@FreeBSD.org>
Date: Fri, 16 Dec 2016 06:25:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310151 - head/sys/dev/cxgbe/firmware
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 06:25:52 -0000

Author: np
Date: Fri Dec 16 06:25:51 2016
New Revision: 310151
URL: https://svnweb.freebsd.org/changeset/base/310151

Log:
  cxgbe(4): Changes to the default T6 firmware configuration file.
  
  - Disable features that are not supported or not used on FreeBSD.
  - Increase the RSS table slice per interface.
  - Increase the share of the TCAM reserved for filtering.
  
  MFH:		2 weeks
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/firmware/t6fw_cfg.txt

Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg.txt
==============================================================================
--- head/sys/dev/cxgbe/firmware/t6fw_cfg.txt	Fri Dec 16 04:47:29 2016	(r310150)
+++ head/sys/dev/cxgbe/firmware/t6fw_cfg.txt	Fri Dec 16 06:25:51 2016	(r310151)
@@ -1,63 +1,12 @@
-# Chelsio T6 Factory Default configuration file.
+# Firmware configuration file.
 #
-# Copyright (C) 2014-2016 Chelsio Communications.  All rights reserved.
-#
-#   DO NOT MODIFY THIS FILE UNDER ANY CIRCUMSTANCES.  MODIFICATION OF THIS FILE
-#   WILL RESULT IN A NON-FUNCTIONAL ADAPTER AND MAY RESULT IN PHYSICAL DAMAGE
-#   TO ADAPTERS.
-
-
-# This file provides the default, power-on configuration for 2-port T6-based
-# adapters shipped from the factory.  These defaults are designed to address
-# the needs of the vast majority of Terminator customers.  The basic idea is to
-# have a default configuration which allows a customer to plug a Terminator
-# adapter in and have it work regardless of OS, driver or application except in
-# the most unusual and/or demanding customer applications.
-#
-# Many of the Terminator resources which are described by this configuration
-# are finite.  This requires balancing the configuration/operation needs of
-# device drivers across OSes and a large number of customer application.
-#
-# Some of the more important resources to allocate and their constaints are:
-#  1. Virtual Interfaces: 256.
-#  2. Ingress Queues with Free Lists: 1024.
-#  3. Egress Queues: 128K.
-#  4. MSI-X Vectors: 1088.
-#  5. Multi-Port Support (MPS) TCAM: 336 entries to support MAC destination
-#     address matching on Ingress Packets.
-#
-# Some of the important OS/Driver resource needs are:
-#  6. Some OS Drivers will manage all resources through a single Physical
-#     Function (currently PF4 but it could be any Physical Function).
-#  7. Some OS Drivers will manage different ports and functions (NIC,
-#     storage, etc.) on different Physical Functions.  For example, NIC
-#     functions for ports 0-1 on PF0-1, FCoE on PF4, iSCSI on PF5, etc.
-#
-# Some of the customer application needs which need to be accommodated:
-#  8. Some customers will want to support large CPU count systems with
-#     good scaling.  Thus, we'll need to accommodate a number of
-#     Ingress Queues and MSI-X Vectors to allow up to some number of CPUs
-#     to be involved per port and per application function.  For example,
-#     in the case where all ports and application functions will be
-#     managed via a single Unified PF and we want to accommodate scaling up
-#     to 8 CPUs, we would want:
-#
-#         2 ports *
-#         3 application functions (NIC, FCoE, iSCSI) per port *
-#         16 Ingress Queue/MSI-X Vectors per application function
-#
-#     for a total of 96 Ingress Queues and MSI-X Vectors on the Unified PF.
-#     (Plus a few for Firmware Event Queues, etc.)
-#
-#  9. Some customers will want to use PCI-E SR-IOV Capability to allow Virtual
-#     Machines to directly access T6 functionality via SR-IOV Virtual Functions
-#     and "PCI Device Passthrough" -- this is especially true for the NIC
-#     application functionality.
-#
-
+# Global limits (some are hardware limits, others are due to the firmware).
+# nvi = 128		virtual interfaces
+# niqflint = 1023	ingress queues with freelists and/or interrupts
+# nethctrl = 64K	Ethernet or ctrl egress queues
+# neq = 64K		egress queues of all kinds, including freelists
+# nexactf = 512		MPS TCAM entries, can oversubscribe.
 
-# Global configuration settings.
-#
 [global]
 	rss_glb_config_mode = basicvirtual
 	rss_glb_config_options = tnlmapen,hashtoeplitz,tnlalllkp
@@ -65,75 +14,29 @@
 	# PL_TIMEOUT register
 	pl_timeout_value = 200		# the timeout value in units of us
 
-	# The following Scatter Gather Engine (SGE) settings assume a 4KB Host
-	# Page Size and a 64B L1 Cache Line Size. It programs the
-	# EgrStatusPageSize and IngPadBoundary to 64B and the PktShift to 2.
-	# If a Master PF Driver finds itself on a machine with different
-	# parameters, then the Master PF Driver is responsible for initializing
-	# these parameters to appropriate values.
-	#
-	# Notes:
-	#  1. The Free List Buffer Sizes below are raw and the firmware will
-	#     round them up to the Ingress Padding Boundary.
-	#  2. The SGE Timer Values below are expressed below in microseconds.
-	#     The firmware will convert these values to Core Clock Ticks when
-	#     it processes the configuration parameters.
-	#
-	reg[0x1008] = 0x40810/0x21c70	# SGE_CONTROL
-	reg[0x100c] = 0x22222222	# SGE_HOST_PAGE_SIZE
-	reg[0x10a0] = 0x01040810	# SGE_INGRESS_RX_THRESHOLD
-	reg[0x1044] = 4096		# SGE_FL_BUFFER_SIZE0
-	reg[0x1048] = 65536		# SGE_FL_BUFFER_SIZE1
-	reg[0x104c] = 1536		# SGE_FL_BUFFER_SIZE2
-	reg[0x1050] = 9024		# SGE_FL_BUFFER_SIZE3
-	reg[0x1054] = 9216		# SGE_FL_BUFFER_SIZE4
-	reg[0x1058] = 2048		# SGE_FL_BUFFER_SIZE5
-	reg[0x105c] = 128		# SGE_FL_BUFFER_SIZE6
-	reg[0x1060] = 8192		# SGE_FL_BUFFER_SIZE7
-	reg[0x1064] = 16384		# SGE_FL_BUFFER_SIZE8
-	reg[0x10a4] = 0xa000a000/0xf000f000 # SGE_DBFIFO_STATUS
-	reg[0x10a8] = 0x402000/0x402000	# SGE_DOORBELL_CONTROL
-	sge_timer_value = 5, 10, 20, 50, 100, 200 # SGE_TIMER_VALUE* in usecs
-	reg[0x10c4] = 0x20000000/0x20000000 # GK_CONTROL, enable 5th thread
+	sge_timer_value = 1, 5, 10, 50, 100, 200	# SGE_TIMER_VALUE* in usecs
 
-	# enable TP_OUT_CONFIG.IPIDSPLITMODE
-	reg[0x7d04] = 0x00010000/0x00010000
+	reg[0x10c4] = 0x20000000/0x20000000 # GK_CONTROL, enable 5th thread
 
 	reg[0x7dc0] = 0x0e2f8849	# TP_SHIFT_CNT
 
 	#Tick granularities in kbps
 	tsch_ticks = 100000, 10000, 1000, 10
 
-	# TP_VLAN_PRI_MAP to select filter tuples and enable ServerSram
-	# filter control: compact, fcoemask
-	# server sram   : srvrsram
-	# filter tuples : fragmentation, mpshittype, macmatch, ethertype,
-	#		  protocol, tos, vlan, vnic_id, port, fcoe
-	# valid filterModes are described the Terminator 5 Data Book
-	filterMode = fcoemask, srvrsram, fragmentation, mpshittype, protocol, vlan, port, fcoe
-
-	# filter tuples enforced in LE active region (equal to or subset of filterMode)
+	filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe
 	filterMask = protocol, fcoe
 
-	# Percentage of dynamic memory (in either the EDRAM or external MEM)
-	# to use for TP RX payload
-	tp_pmrx = 30
-
-	# TP RX payload page size
+	tp_pmrx = 36, 512
 	tp_pmrx_pagesize = 64K
 
-	# TP number of RX channels
-	tp_nrxch = 0		# 0 (auto) = 1
-
-	# Percentage of dynamic memory (in either the EDRAM or external MEM)
-	# to use for TP TX payload
-	tp_pmtx = 50
+	# TP number of RX channels (0 = auto)
+	tp_nrxch = 0
 
-	# TP TX payload page size
+	tp_pmtx = 46, 512
 	tp_pmtx_pagesize = 64K
 
-	# TP number of TX channels
-	tp_ntxch = 0		# 0 (auto) = equal number of ports
+	# TP number of TX channels (0 = auto)
+	tp_ntxch = 0
 
 	# TP OFLD MTUs
 	tp_mtus = 88, 256, 512, 576, 808, 1024, 1280, 1488, 1500, 2002, 2048, 4096, 4352, 8192, 9000, 9600
@@ -150,6 +53,9 @@
 	# TP_PARA_REG0
 	reg[0x7d60] = 0x06000000/0x07000000 # set InitCWND to 6
 
+	# cluster, lan, or wan.
+	tp_tcptuning = lan
+
 	# LE_DB_CONFIG
 	reg[0x19c04] = 0x00000000/0x00440000 # LE Server SRAM disabled
 					     # LE IPv4 compression disabled 
@@ -179,301 +85,117 @@
 	# MC configuration
 	#mc_mode_brc[0] = 1		# mc0 - 1: enable BRC, 0: enable RBC
 
-# Some "definitions" to make the rest of this a bit more readable.  We support
-# 4 ports, 3 functions (NIC, FCoE and iSCSI), scaling up to 8 "CPU Queue Sets"
-# per function per port ...
-#
-# NMSIX = 1088			# available MSI-X Vectors
-# NVI = 256			# available Virtual Interfaces
-# NMPSTCAM = 336		# MPS TCAM entries
-#
-# NPORTS = 2			# ports
-# NCPUS = 16			# CPUs we want to support scalably
-# NFUNCS = 3			# functions per port (NIC, FCoE, iSCSI)
-
-# Breakdown of Virtual Interface/Queue/Interrupt resources for the "Unified
-# PF" which many OS Drivers will use to manage most or all functions.
-#
-# Each Ingress Queue can use one MSI-X interrupt but some Ingress Queues can
-# use Forwarded Interrupt Ingress Queues.  For these latter, an Ingress Queue
-# would be created and the Queue ID of a Forwarded Interrupt Ingress Queue
-# will be specified as the "Ingress Queue Asynchronous Destination Index."
-# Thus, the number of MSI-X Vectors assigned to the Unified PF will be less
-# than or equal to the number of Ingress Queues ...
-#
-# NVI_NIC = 4			# NIC access to NPORTS
-# NFLIQ_NIC = 32		# NIC Ingress Queues with Free Lists
-# NETHCTRL_NIC = 32		# NIC Ethernet Control/TX Queues
-# NEQ_NIC = 64			# NIC Egress Queues (FL, ETHCTRL/TX)
-# NMPSTCAM_NIC = 16		# NIC MPS TCAM Entries (NPORTS*4)
-# NMSIX_NIC = 32		# NIC MSI-X Interrupt Vectors (FLIQ)
-#
-# NVI_OFLD = 0			# Offload uses NIC function to access ports
-# NFLIQ_OFLD = 16		# Offload Ingress Queues with Free Lists
-# NETHCTRL_OFLD = 0		# Offload Ethernet Control/TX Queues
-# NEQ_OFLD = 16			# Offload Egress Queues (FL)
-# NMPSTCAM_OFLD = 0		# Offload MPS TCAM Entries (uses NIC's)
-# NMSIX_OFLD = 16		# Offload MSI-X Interrupt Vectors (FLIQ)
-#
-# NVI_RDMA = 0			# RDMA uses NIC function to access ports
-# NFLIQ_RDMA = 4		# RDMA Ingress Queues with Free Lists
-# NETHCTRL_RDMA = 0		# RDMA Ethernet Control/TX Queues
-# NEQ_RDMA = 4			# RDMA Egress Queues (FL)
-# NMPSTCAM_RDMA = 0		# RDMA MPS TCAM Entries (uses NIC's)
-# NMSIX_RDMA = 4		# RDMA MSI-X Interrupt Vectors (FLIQ)
-#
-# NEQ_WD = 128			# Wire Direct TX Queues and FLs
-# NETHCTRL_WD = 64		# Wire Direct TX Queues
-# NFLIQ_WD = 64	`		# Wire Direct Ingress Queues with Free Lists
-#
-# NVI_ISCSI = 4			# ISCSI access to NPORTS
-# NFLIQ_ISCSI = 4		# ISCSI Ingress Queues with Free Lists
-# NETHCTRL_ISCSI = 0		# ISCSI Ethernet Control/TX Queues
-# NEQ_ISCSI = 4			# ISCSI Egress Queues (FL)
-# NMPSTCAM_ISCSI = 4		# ISCSI MPS TCAM Entries (NPORTS)
-# NMSIX_ISCSI = 4		# ISCSI MSI-X Interrupt Vectors (FLIQ)
-#
-# NVI_FCOE = 4			# FCOE access to NPORTS
-# NFLIQ_FCOE = 34		# FCOE Ingress Queues with Free Lists
-# NETHCTRL_FCOE = 32		# FCOE Ethernet Control/TX Queues
-# NEQ_FCOE = 66			# FCOE Egress Queues (FL)
-# NMPSTCAM_FCOE = 32 		# FCOE MPS TCAM Entries (NPORTS)
-# NMSIX_FCOE = 34		# FCOE MSI-X Interrupt Vectors (FLIQ)
-
-# Two extra Ingress Queues per function for Firmware Events and Forwarded
-# Interrupts, and two extra interrupts per function for Firmware Events (or a
-# Forwarded Interrupt Queue) and General Interrupts per function.
-#
-# NFLIQ_EXTRA = 6		# "extra" Ingress Queues 2*NFUNCS (Firmware and
-# 				#   Forwarded Interrupts
-# NMSIX_EXTRA = 6		# extra interrupts 2*NFUNCS (Firmware and
-# 				#   General Interrupts
-
-# Microsoft HyperV resources.  The HyperV Virtual Ingress Queues will have
-# their interrupts forwarded to another set of Forwarded Interrupt Queues.
-#
-# NVI_HYPERV = 16		# VMs we want to support
-# NVIIQ_HYPERV = 2		# Virtual Ingress Queues with Free Lists per VM
-# NFLIQ_HYPERV = 40		# VIQs + NCPUS Forwarded Interrupt Queues
-# NEQ_HYPERV = 32		# VIQs Free Lists
-# NMPSTCAM_HYPERV = 16		# MPS TCAM Entries (NVI_HYPERV)
-# NMSIX_HYPERV = 8		# NCPUS Forwarded Interrupt Queues
-
-# Adding all of the above Unified PF resource needs together: (NIC + OFLD +
-# RDMA + ISCSI + FCOE + EXTRA + HYPERV)
-#
-# NVI_UNIFIED = 28
-# NFLIQ_UNIFIED = 106
-# NETHCTRL_UNIFIED = 32
-# NEQ_UNIFIED = 124
-# NMPSTCAM_UNIFIED = 40
-#
-# The sum of all the MSI-X resources above is 74 MSI-X Vectors but we'll round
-# that up to 128 to make sure the Unified PF doesn't run out of resources.
-#
-# NMSIX_UNIFIED = 128
-#
-# The Storage PFs could need up to NPORTS*NCPUS + NMSIX_EXTRA MSI-X Vectors
-# which is 34 but they're probably safe with 32.
-#
-# NMSIX_STORAGE = 32
-
-# Note: The UnifiedPF is PF4 which doesn't have any Virtual Functions
-# associated with it.  Thus, the MSI-X Vector allocations we give to the
-# UnifiedPF aren't inherited by any Virtual Functions.  As a result we can
-# provision many more Virtual Functions than we can if the UnifiedPF were
-# one of PF0-3.
-#
-
-# All of the below PCI-E parameters are actually stored in various *_init.txt
-# files.  We include them below essentially as comments.
-#
-# For PF0-3 we assign 8 vectors each for NIC Ingress Queues of the associated
-# ports 0-3.
-#
-# For PF4, the Unified PF, we give it an MSI-X Table Size as outlined above.
-#
-# For PF5-6 we assign enough MSI-X Vectors to support FCoE and iSCSI
-# storage applications across all four possible ports.
-#
-# Additionally, since the UnifiedPF isn't one of the per-port Physical
-# Functions, we give the UnifiedPF and the PF0-3 Physical Functions
-# different PCI Device IDs which will allow Unified and Per-Port Drivers
-# to directly select the type of Physical Function to which they wish to be
-# attached.
-#
-# Note that the actual values used for the PCI-E Intelectual Property will be
-# 1 less than those below since that's the way it "counts" things.  For
-# readability, we use the number we actually mean ...
-#
-# PF0_INT = 8			# NCPUS
-# PF1_INT = 8			# NCPUS
-# PF0_3_INT = 32		# PF0_INT + PF1_INT + PF2_INT + PF3_INT
-#
-# PF4_INT = 128			# NMSIX_UNIFIED
-# PF5_INT = 32			# NMSIX_STORAGE
-# PF6_INT = 32			# NMSIX_STORAGE
-# PF7_INT = 0			# Nothing Assigned
-# PF4_7_INT = 192		# PF4_INT + PF5_INT + PF6_INT + PF7_INT
-#
-# PF0_7_INT = 224		# PF0_3_INT + PF4_7_INT
-#
-# With the above we can get 17 VFs/PF0-3 (limited by 336 MPS TCAM entries)
-# but we'll lower that to 16 to make our total 64 and a nice power of 2 ...
-#
-# NVF = 16
-
-
-# For those OSes which manage different ports on different PFs, we need
-# only enough resources to support a single port's NIC application functions
-# on PF0-3.  The below assumes that we're only doing NIC with NCPUS "Queue
-# Sets" for ports 0-3.  The FCoE and iSCSI functions for such OSes will be
-# managed on the "storage PFs" (see below).
-#
+# PFs 0-3.  These get 8 MSI/8 MSI-X vectors each.  VFs are supported by
+# these 4 PFs only.
 [function "0"]
-	nvf = 16		# NVF on this function
-	wx_caps = all		# write/execute permissions for all commands
-	r_caps = all		# read permissions for all commands
-	nvi = 1			# 1 port
-	niqflint = 8		# NCPUS "Queue Sets"
-	nethctrl = 8		# NCPUS "Queue Sets"
-	neq = 16		# niqflint + nethctrl Egress Queues
-	nexactf = 8		# number of exact MPSTCAM MAC filters
-	cmask = all		# access to all channels
-	pmask = 0x1		# access to only one port
-
+	nvf = 4
+	wx_caps = all
+	r_caps = all
+	nvi = 2
+	rssnvi = 2
+	niqflint = 4
+	nethctrl = 4
+	neq = 8
+	nexactf = 4
+	cmask = all
+	pmask = 0x1
 
 [function "1"]
-	nvf = 16		# NVF on this function
-	wx_caps = all		# write/execute permissions for all commands
-	r_caps = all		# read permissions for all commands
-	nvi = 1			# 1 port
-	niqflint = 8		# NCPUS "Queue Sets"
-	nethctrl = 8		# NCPUS "Queue Sets"
-	neq = 16		# niqflint + nethctrl Egress Queues
-	nexactf = 8		# number of exact MPSTCAM MAC filters
-	cmask = all		# access to all channels
-	pmask = 0x2		# access to only one port
+	nvf = 4
+	wx_caps = all
+	r_caps = all
+	nvi = 2
+	rssnvi = 2
+	niqflint = 4
+	nethctrl = 4
+	neq = 8
+	nexactf = 4
+	cmask = all
+	pmask = 0x2
 
 [function "2"]
-	nvf = 16		# NVF on this function
-	wx_caps = all		# write/execute permissions for all commands
-	r_caps = all		# read permissions for all commands
-	nvi = 1			# 1 port
-	niqflint = 8		# NCPUS "Queue Sets"
-	nethctrl = 8		# NCPUS "Queue Sets"
-	neq = 16		# niqflint + nethctrl Egress Queues
-	nexactf = 8		# number of exact MPSTCAM MAC filters
-	cmask = all		# access to all channels
-	pmask = 0x4		# access to only one port
+	nvf = 4
+	wx_caps = all
+	r_caps = all
+	nvi = 2
+	rssnvi = 2
+	niqflint = 4
+	nethctrl = 4
+	neq = 8
+	nexactf = 4
+	cmask = all
+	pmask = 0x4
 
 [function "3"]
-	nvf = 16		# NVF on this function
-	wx_caps = all		# write/execute permissions for all commands
-	r_caps = all		# read permissions for all commands
-	nvi = 1			# 1 port
-	niqflint = 8		# NCPUS "Queue Sets"
-	nethctrl = 8		# NCPUS "Queue Sets"
-	neq = 16		# niqflint + nethctrl Egress Queues
-	nexactf = 8		# number of exact MPSTCAM MAC filters
-	cmask = all		# access to all channels
-	pmask = 0x8		# access to only one port
-
-
-# Some OS Drivers manage all application functions for all ports via PF4.
-# Thus we need to provide a large number of resources here.  For Egress
-# Queues we need to account for both TX Queues as well as Free List Queues
-# (because the host is responsible for producing Free List Buffers for the
-# hardware to consume).
-#
+	nvf = 4
+	wx_caps = all
+	r_caps = all
+	nvi = 2
+	rssnvi = 2
+	niqflint = 4
+	nethctrl = 4
+	neq = 8
+	nexactf = 4
+	cmask = all
+	pmask = 0x8
+
+# PF4 is the resource-rich PF that the bus/nexus driver attaches to.
+# It gets 32 MSI/128 MSI-X vectors.
 [function "4"]
-	wx_caps = all		# write/execute permissions for all commands
-	r_caps = all		# read permissions for all commands
-	nvi = 28		# NVI_UNIFIED
-	niqflint = 202		# NFLIQ_UNIFIED + NLFIQ_WD + NFLIQ_CRYPTO (32)
-	nethctrl = 100		# NETHCTRL_UNIFIED + NETHCTRL_WD
-	neq = 256		# NEQ_UNIFIED + NEQ_WD
-	nqpcq = 12288
-	nexactf = 40		# NMPSTCAM_UNIFIED
-	cmask = all		# access to all channels
-	pmask = all		# access to all four ports ...
-	nethofld = 1024		# number of user mode ethernet flow contexts
-	ncrypto_lookaside = 16  # Number of lookaside flow contexts 
-	nclip = 320		# number of clip region entries
-	nfilter = 496		# number of filter region entries
-	nserver = 496		# number of server region entries
-	nhash = 12288		# number of hash region entries
-	nhpfilter = 0		# number of high priority filter region entries
-	protocol = nic_vm, ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, iscsi_t10dif, tlskeys, crypto_lookaside
-	tp_l2t = 3072
+	wx_caps = all
+	r_caps = all
+	nvi = 32
+	rssnvi = 8
+	niqflint = 512
+	nethctrl = 1024
+	neq = 2048
+	nqpcq = 8192
+	nexactf = 456
+	cmask = all
+	pmask = all
+	nclip = 320
+
+	# TCAM has 6K cells; each region must start at a multiple of 128 cell.
+	# Each entry in these categories takes 2 cells each.  nhash will use the
+	# TCAM iff there is room left (that is, the rest don't add up to 3072).
+	nfilter = 2032
+	nserver = 512
+	nhpfilter = 0
+	nhash = 16384
+	protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, iscsi_t10dif
+	tp_l2t = 4096
 	tp_ddp = 2
 	tp_ddp_iscsi = 2
-	tp_tls_key = 3
-	tp_tls_mxrxsize = 17408    # 16384 + 1024, governs max rx data, pm max xfer len, rx coalesce sizes
 	tp_stag = 2
 	tp_pbl = 5
 	tp_rq = 7
 	tp_srq = 128
 
-# We have FCoE and iSCSI storage functions on PF5 and PF6 each of which may
-# need to have Virtual Interfaces on each of the four ports with up to NCPUS
-# "Queue Sets" each.
-#
+# PF5 is the SCSI Controller PF. It gets 32 MSI/40 MSI-X vectors.
+# Not used right now.
 [function "5"]
-	wx_caps = all		# write/execute permissions for all commands
-	r_caps = all		# read permissions for all commands
-	nvi = 4			# NPORTS
-	niqflint = 34		# NPORTS*NCPUS + NMSIX_EXTRA
-	nethctrl = 32		# NPORTS*NCPUS
-	neq = 64		# NPORTS*NCPUS * 2 (FL, ETHCTRL/TX)
-	nexactf = 16		# (NPORTS *(no of snmc grp + 1 hw mac) + 1 anmc grp)) rounded to 16.
-	cmask = all		# access to all channels
-	pmask = all		# access to all four ports ...
-	nserver = 16
-	nhash = 2048
-	tp_l2t = 1020
-	nclip = 64
-	protocol = iscsi_initiator_fofld
-	tp_ddp_iscsi = 2
-	iscsi_ntask = 2048
-	iscsi_nsess = 2048
-	iscsi_nconn_per_session = 1
-	iscsi_ninitiator_instance = 64
-
+	nvi = 1
+	rssnvi = 0
 
+# PF6 is the FCoE Controller PF. It gets 32 MSI/40 MSI-X vectors.
+# Not used right now.
 [function "6"]
-	wx_caps = all		# write/execute permissions for all commands
-	r_caps = all		# read permissions for all commands
-	nvi = 4			# NPORTS
-	niqflint = 34		# NPORTS*NCPUS + NMSIX_EXTRA
-	nethctrl = 32		# NPORTS*NCPUS
-	neq = 66		# NPORTS*NCPUS * 2 (FL, ETHCTRL/TX) + 2 (EXTRA)
-	nexactf = 32		# NPORTS + adding 28 exact entries for FCoE
-				# which is OK since < MIN(SUM PF0..3, PF4)
-				# and we never load PF0..3 and PF4 concurrently
-	cmask = all		# access to all channels
-	pmask = all		# access to all four ports ...
-	nhash = 2048
-	tp_l2t = 4
-	protocol = fcoe_initiator
-	tp_ddp = 2
-	fcoe_nfcf = 16
-	fcoe_nvnp = 32
-	fcoe_nssn = 1024
-
+	nvi = 1
+	rssnvi = 0
 
 # The following function, 1023, is not an actual PCIE function but is used to
 # configure and reserve firmware internal resources that come from the global
 # resource pool.
 #
 [function "1023"]
-	wx_caps = all		# write/execute permissions for all commands
-	r_caps = all		# read permissions for all commands
-	nvi = 4			# NVI_UNIFIED
-	cmask = all		# access to all channels
-	pmask = all		# access to all four ports ...
-	nexactf = 8		# NPORTS + DCBX +
-	nfilter = 16		# number of filter region entries
+	wx_caps = all
+	r_caps = all
+	nvi = 4
+	rssnvi = 0
+	cmask = all
+	pmask = all
+	nexactf = 8
+	nfilter = 16
 
 
 # For Virtual functions, we only allow NIC functionality and we only allow
@@ -482,107 +204,83 @@
 # and GTS registers, the number of Ingress and Egress Queues must be a power
 # of 2.
 #
-[function "0/*"]		# NVF
-	wx_caps = 0x82		# DMAQ | VF
-	r_caps = 0x86		# DMAQ | VF | PORT
-	nvi = 1			# 1 port
-	niqflint = 4		# 2 "Queue Sets" + NXIQ
-	nethctrl = 2		# 2 "Queue Sets"
-	neq = 4			# 2 "Queue Sets" * 2
-	nexactf = 4
-	cmask = all		# access to all channels
-	pmask = 0x1		# access to only one port ...
+[function "0/*"]
+	wx_caps = 0x82
+	r_caps = 0x86
+	nvi = 1
+	rssnvi = 1
+	niqflint = 2
+	nethctrl = 2
+	neq = 4
+	nexactf = 2
+	cmask = all
+	pmask = 0x1
+
+[function "1/*"]
+	wx_caps = 0x82
+	r_caps = 0x86
+	nvi = 1
+	rssnvi = 1
+	niqflint = 2
+	nethctrl = 2
+	neq = 4
+	nexactf = 2
+	cmask = all
+	pmask = 0x2
+
+[function "2/*"]
+	wx_caps = 0x82
+	r_caps = 0x86
+	nvi = 1
+	rssnvi = 1
+	niqflint = 2
+	nethctrl = 2
+	neq = 4
+	nexactf = 2
+	cmask = all
+	pmask = 0x1
+
+[function "3/*"]
+	wx_caps = 0x82
+	r_caps = 0x86
+	nvi = 1
+	rssnvi = 1
+	niqflint = 2
+	nethctrl = 2
+	neq = 4
+	nexactf = 2
+	cmask = all
+	pmask = 0x2
 
-
-[function "1/*"]		# NVF
-	wx_caps = 0x82		# DMAQ | VF
-	r_caps = 0x86		# DMAQ | VF | PORT
-	nvi = 1			# 1 port
-	niqflint = 4		# 2 "Queue Sets" + NXIQ
-	nethctrl = 2		# 2 "Queue Sets"
-	neq = 4			# 2 "Queue Sets" * 2
-	nexactf = 4
-	cmask = all		# access to all channels
-	pmask = 0x2		# access to only one port ...
-
-[function "2/*"]		# NVF
-	wx_caps = 0x82		# DMAQ | VF
-	r_caps = 0x86		# DMAQ | VF | PORT
-	nvi = 1			# 1 port
-	niqflint = 4		# 2 "Queue Sets" + NXIQ
-	nethctrl = 2		# 2 "Queue Sets"
-	neq = 4			# 2 "Queue Sets" * 2
-	nexactf = 4
-	cmask = all		# access to all channels
-	pmask = 0x1		# access to only one port ...
-
-
-[function "3/*"]		# NVF
-	wx_caps = 0x82		# DMAQ | VF
-	r_caps = 0x86		# DMAQ | VF | PORT
-	nvi = 1			# 1 port
-	niqflint = 4		# 2 "Queue Sets" + NXIQ
-	nethctrl = 2		# 2 "Queue Sets"
-	neq = 4			# 2 "Queue Sets" * 2
-	nexactf = 4
-	cmask = all		# access to all channels
-	pmask = 0x2		# access to only one port ...
-
-# MPS features a 196608 bytes ingress buffer that is used for ingress buffering
-# for packets from the wire as well as the loopback path of the L2 switch. The
-# folling params control how the buffer memory is distributed and the L2 flow
-# control settings:
-#
-# bg_mem:	%-age of mem to use for port/buffer group
-# lpbk_mem:	%-age of port/bg mem to use for loopback
-# hwm:		high watermark; bytes available when starting to send pause
-#		frames (in units of 0.1 MTU)
-# lwm:		low watermark; bytes remaining when sending 'unpause' frame
-#		(in inuits of 0.1 MTU)
-# dwm:		minimum delta between high and low watermark (in units of 100
-#		Bytes)
-#
+# MPS has 192K buffer space for ingress packets from the wire as well as
+# loopback path of the L2 switch.
 [port "0"]
-	dcb = ppp, dcbx		# configure for DCB PPP and enable DCBX offload
+	dcb = none
 	#bg_mem = 25
 	#lpbk_mem = 25
 	hwm = 60
 	lwm = 15
 	dwm = 30
-	dcb_app_tlv[0] = 0x8906, ethertype, 3
-	dcb_app_tlv[1] = 0x8914, ethertype, 3
-	dcb_app_tlv[2] = 3260, socketnum, 5
 	#aec_retry_cnt = 4
 	flags = an_dis
-	fec = none		# FEC type none/rs/firecode
+	fec = none
 
 
 [port "1"]
-	dcb = ppp, dcbx
+	dcb = none
 	#bg_mem = 25
 	#lpbk_mem = 25
 	hwm = 60
 	lwm = 15
 	dwm = 30
-	dcb_app_tlv[0] = 0x8906, ethertype, 3
-	dcb_app_tlv[1] = 0x8914, ethertype, 3
-	dcb_app_tlv[2] = 3260, socketnum, 5
 	#aec_retry_cnt = 4
 	flags = an_dis
-	fec = none		# FEC type none/rs/firecode
+	fec = none
 
 
 [fini]
-	version = 0x01000024
-	checksum = 0x36cebfcb
-
-# Total resources used by above allocations:
-#   Virtual Interfaces: 104
-#   Ingress Queues/w Free Lists and Interrupts: 526
-#   Egress Queues: 702
-#   MPS TCAM Entries: 336
-#   MSI-X Vectors: 736
-#   Virtual Functions: 64
+	version = 0x1
+	checksum = 0xc3afb4e0
 #
 # $FreeBSD$
 #

From owner-svn-src-all@freebsd.org  Fri Dec 16 06:30:09 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C1DFC8285E;
 Fri, 16 Dec 2016 06:30:09 +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 F070CC59;
 Fri, 16 Dec 2016 06:30:08 +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 uBG6U8rJ031564;
 Fri, 16 Dec 2016 06:30:08 GMT (envelope-from np@FreeBSD.org)
Received: (from np@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBG6U8os031563;
 Fri, 16 Dec 2016 06:30:08 GMT (envelope-from np@FreeBSD.org)
Message-Id: <201612160630.uBG6U8os031563@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org
 using -f
From: Navdeep Parhar <np@FreeBSD.org>
Date: Fri, 16 Dec 2016 06:30:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310152 - head/sys/dev/cxgbe/common
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 06:30:09 -0000

Author: np
Date: Fri Dec 16 06:30:07 2016
New Revision: 310152
URL: https://svnweb.freebsd.org/changeset/base/310152

Log:
  cxgbe(4): Fix typo in an unused macro.
  
  MFC after:	3 days
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/common/t4_msg.h

Modified: head/sys/dev/cxgbe/common/t4_msg.h
==============================================================================
--- head/sys/dev/cxgbe/common/t4_msg.h	Fri Dec 16 06:25:51 2016	(r310151)
+++ head/sys/dev/cxgbe/common/t4_msg.h	Fri Dec 16 06:30:07 2016	(r310152)
@@ -2026,7 +2026,7 @@ struct cpl_rx_pkt {
  * RX_ERROR_IP_HDR_LEN, RX_ERROR_ETH_HDR_LEN
  */
 #define S_T6_COMPR_RXERR_LEN    1
-#define V_T6_COMPR_RXERR_LEN(x) ((x) << S_COMPR_T6_RXERR_LEN)
+#define V_T6_COMPR_RXERR_LEN(x) ((x) << S_T6_COMPR_RXERR_LEN)
 #define F_T6_COMPR_RXERR_LEN    V_COMPR_T6_RXERR_LEN(1U)
 
 #define S_T6_COMPR_RXERR_TCP_OPT    2

From owner-svn-src-all@freebsd.org  Fri Dec 16 10:31:15 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF488C8028E;
 Fri, 16 Dec 2016 10:31:15 +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 BDC6E3DF;
 Fri, 16 Dec 2016 10:31:15 +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 uBGAVEXc030604;
 Fri, 16 Dec 2016 10:31:14 GMT (envelope-from andrew@FreeBSD.org)
Received: (from andrew@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGAVDnx030594;
 Fri, 16 Dec 2016 10:31:13 GMT (envelope-from andrew@FreeBSD.org)
Message-Id: <201612161031.uBGAVDnx030594@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: andrew set sender to
 andrew@FreeBSD.org using -f
From: Andrew Turner <andrew@FreeBSD.org>
Date: Fri, 16 Dec 2016 10:31:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310153 - in head/sys/arm: allwinner arm broadcom/bcm2835
 freescale/imx nvidia/tegra124 qemu rockchip ti
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 10:31:16 -0000

Author: andrew
Date: Fri Dec 16 10:31:13 2016
New Revision: 310153
URL: https://svnweb.freebsd.org/changeset/base/310153

Log:
  All armv6 platforms have the same implementation of platform_lastaddr.
  Replace them with a default handler that returns devmap_lastaddr.
  
  Reviewed by:	mmel
  Sponsored by:	ABT Systems Ltd
  Differential Revision:	https://reviews.freebsd.org/D8806

Modified:
  head/sys/arm/allwinner/aw_machdep.c
  head/sys/arm/arm/platform_if.m
  head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
  head/sys/arm/freescale/imx/imx51_machdep.c
  head/sys/arm/freescale/imx/imx53_machdep.c
  head/sys/arm/freescale/imx/imx6_machdep.c
  head/sys/arm/nvidia/tegra124/tegra124_machdep.c
  head/sys/arm/qemu/virt_machdep.c
  head/sys/arm/rockchip/rk30xx_machdep.c
  head/sys/arm/ti/ti_machdep.c

Modified: head/sys/arm/allwinner/aw_machdep.c
==============================================================================
--- head/sys/arm/allwinner/aw_machdep.c	Fri Dec 16 06:30:07 2016	(r310152)
+++ head/sys/arm/allwinner/aw_machdep.c	Fri Dec 16 10:31:13 2016	(r310153)
@@ -61,7 +61,6 @@ static platform_attach_t a31_attach;
 static platform_attach_t a31s_attach;
 static platform_attach_t a83t_attach;
 static platform_attach_t h3_attach;
-static platform_lastaddr_t allwinner_lastaddr;
 static platform_devmap_init_t allwinner_devmap_init;
 static platform_cpu_reset_t allwinner_cpu_reset;
 
@@ -129,13 +128,6 @@ h3_attach(platform_t plat)
 	return (0);
 }
 
-static vm_offset_t
-allwinner_lastaddr(platform_t plat)
-{
-
-	return (devmap_lastaddr());
-}
-
 /*
  * Set up static device mappings.
  *
@@ -166,7 +158,6 @@ allwinner_cpu_reset(platform_t plat)
 #if defined(SOC_ALLWINNER_A10)
 static platform_method_t a10_methods[] = {
 	PLATFORMMETHOD(platform_attach,         a10_attach),
-	PLATFORMMETHOD(platform_lastaddr,       allwinner_lastaddr),
 	PLATFORMMETHOD(platform_devmap_init,    allwinner_devmap_init),
 	PLATFORMMETHOD(platform_cpu_reset,	allwinner_cpu_reset),
 
@@ -178,7 +169,6 @@ FDT_PLATFORM_DEF(a10, "a10", 0, "allwinn
 #if defined(SOC_ALLWINNER_A13)
 static platform_method_t a13_methods[] = {
 	PLATFORMMETHOD(platform_attach,         a13_attach),
-	PLATFORMMETHOD(platform_lastaddr,       allwinner_lastaddr),
 	PLATFORMMETHOD(platform_devmap_init,    allwinner_devmap_init),
 	PLATFORMMETHOD(platform_cpu_reset,	allwinner_cpu_reset),
 
@@ -190,7 +180,6 @@ FDT_PLATFORM_DEF(a13, "a13", 0, "allwinn
 #if defined(SOC_ALLWINNER_A20)
 static platform_method_t a20_methods[] = {
 	PLATFORMMETHOD(platform_attach,         a20_attach),
-	PLATFORMMETHOD(platform_lastaddr,       allwinner_lastaddr),
 	PLATFORMMETHOD(platform_devmap_init,    allwinner_devmap_init),
 	PLATFORMMETHOD(platform_cpu_reset,	allwinner_cpu_reset),
 
@@ -206,7 +195,6 @@ FDT_PLATFORM_DEF(a20, "a20", 0, "allwinn
 #if defined(SOC_ALLWINNER_A31)
 static platform_method_t a31_methods[] = {
 	PLATFORMMETHOD(platform_attach,         a31_attach),
-	PLATFORMMETHOD(platform_lastaddr,       allwinner_lastaddr),
 	PLATFORMMETHOD(platform_devmap_init,    allwinner_devmap_init),
 	PLATFORMMETHOD(platform_cpu_reset,	allwinner_cpu_reset),
 
@@ -222,7 +210,6 @@ FDT_PLATFORM_DEF(a31, "a31", 0, "allwinn
 #if defined(SOC_ALLWINNER_A31S)
 static platform_method_t a31s_methods[] = {
 	PLATFORMMETHOD(platform_attach,         a31s_attach),
-	PLATFORMMETHOD(platform_lastaddr,       allwinner_lastaddr),
 	PLATFORMMETHOD(platform_devmap_init,    allwinner_devmap_init),
 	PLATFORMMETHOD(platform_cpu_reset,	allwinner_cpu_reset),
 
@@ -238,7 +225,6 @@ FDT_PLATFORM_DEF(a31s, "a31s", 0, "allwi
 #if defined(SOC_ALLWINNER_A83T)
 static platform_method_t a83t_methods[] = {
 	PLATFORMMETHOD(platform_attach,         a83t_attach),
-	PLATFORMMETHOD(platform_lastaddr,       allwinner_lastaddr),
 	PLATFORMMETHOD(platform_devmap_init,    allwinner_devmap_init),
 	PLATFORMMETHOD(platform_cpu_reset,	allwinner_cpu_reset),
 
@@ -254,7 +240,6 @@ FDT_PLATFORM_DEF(a83t, "a83t", 0, "allwi
 #if defined(SOC_ALLWINNER_H3)
 static platform_method_t h3_methods[] = {
 	PLATFORMMETHOD(platform_attach,         h3_attach),
-	PLATFORMMETHOD(platform_lastaddr,       allwinner_lastaddr),
 	PLATFORMMETHOD(platform_devmap_init,    allwinner_devmap_init),
 	PLATFORMMETHOD(platform_cpu_reset,	allwinner_cpu_reset),
 

Modified: head/sys/arm/arm/platform_if.m
==============================================================================
--- head/sys/arm/arm/platform_if.m	Fri Dec 16 06:30:07 2016	(r310152)
+++ head/sys/arm/arm/platform_if.m	Fri Dec 16 10:31:13 2016	(r310153)
@@ -27,9 +27,10 @@
 #
 
 #include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/devmap.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
-#include <sys/systm.h>
 #include <sys/smp.h>
 
 #include <machine/machdep.h>
@@ -58,6 +59,11 @@ CODE {
 		return;
 	}
 
+	static vm_offset_t platform_default_lastaddr(platform_t plat)
+	{
+		return (devmap_lastaddr());
+	}
+
 	static void platform_default_mp_setmaxid(platform_t plat)
 	{
 		mp_ncpus = 1;
@@ -100,7 +106,7 @@ METHOD int devmap_init {
  */
 METHOD vm_offset_t lastaddr {
 	platform_t	_plat;
-};
+} DEFAULT platform_default_lastaddr;
 
 /**
  * @brief Called after the static device mappings are established and just

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c	Fri Dec 16 06:30:07 2016	(r310152)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c	Fri Dec 16 10:31:13 2016	(r310153)
@@ -68,17 +68,9 @@ static platform_devmap_init_t bcm2835_de
 #ifdef SOC_BCM2836
 static platform_devmap_init_t bcm2836_devmap_init;
 #endif
-static platform_lastaddr_t bcm2835_lastaddr;
 static platform_late_init_t bcm2835_late_init;
 static platform_cpu_reset_t bcm2835_cpu_reset;
 
-static vm_offset_t
-bcm2835_lastaddr(platform_t plat)
-{
-
-	return (devmap_lastaddr());
-}
-
 static void
 bcm2835_late_init(platform_t plat)
 {
@@ -136,7 +128,6 @@ bcm2835_cpu_reset(platform_t plat)
 #ifdef SOC_BCM2835
 static platform_method_t bcm2835_methods[] = {
 	PLATFORMMETHOD(platform_devmap_init,	bcm2835_devmap_init),
-	PLATFORMMETHOD(platform_lastaddr,	bcm2835_lastaddr),
 	PLATFORMMETHOD(platform_late_init,	bcm2835_late_init),
 	PLATFORMMETHOD(platform_cpu_reset,	bcm2835_cpu_reset),
 
@@ -148,7 +139,6 @@ FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, 
 #ifdef SOC_BCM2836
 static platform_method_t bcm2836_methods[] = {
 	PLATFORMMETHOD(platform_devmap_init,	bcm2836_devmap_init),
-	PLATFORMMETHOD(platform_lastaddr,	bcm2835_lastaddr),
 	PLATFORMMETHOD(platform_late_init,	bcm2835_late_init),
 	PLATFORMMETHOD(platform_cpu_reset,	bcm2835_cpu_reset),
 

Modified: head/sys/arm/freescale/imx/imx51_machdep.c
==============================================================================
--- head/sys/arm/freescale/imx/imx51_machdep.c	Fri Dec 16 06:30:07 2016	(r310152)
+++ head/sys/arm/freescale/imx/imx51_machdep.c	Fri Dec 16 10:31:13 2016	(r310153)
@@ -47,16 +47,8 @@ __FBSDID("$FreeBSD$");
 
 static platform_attach_t imx51_attach;
 static platform_devmap_init_t imx51_devmap_init;
-static platform_lastaddr_t imx51_lastaddr;
 static platform_cpu_reset_t imx51_cpu_reset;
 
-static vm_offset_t
-imx51_lastaddr(platform_t plat)
-{
-
-	return (devmap_lastaddr());
-}
-
 static int
 imx51_attach(platform_t plat)
 {
@@ -102,7 +94,6 @@ imx_soc_type(void)
 static platform_method_t imx51_methods[] = {
 	PLATFORMMETHOD(platform_attach,		imx51_attach),
 	PLATFORMMETHOD(platform_devmap_init,	imx51_devmap_init),
-	PLATFORMMETHOD(platform_lastaddr,	imx51_lastaddr),
 	PLATFORMMETHOD(platform_cpu_reset,	imx51_cpu_reset),
 
 	PLATFORMMETHOD_END,

Modified: head/sys/arm/freescale/imx/imx53_machdep.c
==============================================================================
--- head/sys/arm/freescale/imx/imx53_machdep.c	Fri Dec 16 06:30:07 2016	(r310152)
+++ head/sys/arm/freescale/imx/imx53_machdep.c	Fri Dec 16 10:31:13 2016	(r310153)
@@ -47,16 +47,8 @@ __FBSDID("$FreeBSD$");
 
 static platform_attach_t imx53_attach;
 static platform_devmap_init_t imx53_devmap_init;
-static platform_lastaddr_t imx53_lastaddr;
 static platform_cpu_reset_t imx53_cpu_reset;
 
-static vm_offset_t
-imx53_lastaddr(platform_t plat)
-{
-
-	return (devmap_lastaddr());
-}
-
 static int
 imx53_attach(platform_t plat)
 {
@@ -102,7 +94,6 @@ imx_soc_type(void)
 static platform_method_t imx53_methods[] = {
 	PLATFORMMETHOD(platform_attach,		imx53_attach),
 	PLATFORMMETHOD(platform_devmap_init,	imx53_devmap_init),
-	PLATFORMMETHOD(platform_lastaddr,	imx53_lastaddr),
 	PLATFORMMETHOD(platform_cpu_reset,	imx53_cpu_reset),
 
 	PLATFORMMETHOD_END,

Modified: head/sys/arm/freescale/imx/imx6_machdep.c
==============================================================================
--- head/sys/arm/freescale/imx/imx6_machdep.c	Fri Dec 16 06:30:07 2016	(r310152)
+++ head/sys/arm/freescale/imx/imx6_machdep.c	Fri Dec 16 10:31:13 2016	(r310153)
@@ -56,7 +56,6 @@ static uint32_t gpio1_node;
 
 static platform_attach_t imx6_attach;
 static platform_devmap_init_t imx6_devmap_init;
-static platform_lastaddr_t imx6_lastaddr;
 static platform_late_init_t imx6_late_init;
 static platform_cpu_reset_t imx6_cpu_reset;
 
@@ -164,13 +163,6 @@ fix_fdt_interrupt_data(void)
 	OF_setprop(socnode, "interrupt-parent", &gicxref, sizeof(gicxref));
 }
 
-static vm_offset_t
-imx6_lastaddr(platform_t plat)
-{
-
-	return (devmap_lastaddr());
-}
-
 static int
 imx6_attach(platform_t plat)
 {
@@ -350,7 +342,6 @@ early_putc_t *early_putc = imx6_early_pu
 
 static platform_method_t imx6_methods[] = {
 	PLATFORMMETHOD(platform_attach,		imx6_attach),
-	PLATFORMMETHOD(platform_lastaddr,	imx6_lastaddr),
 	PLATFORMMETHOD(platform_devmap_init,	imx6_devmap_init),
 	PLATFORMMETHOD(platform_late_init,	imx6_late_init),
 	PLATFORMMETHOD(platform_cpu_reset,	imx6_cpu_reset),

Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c
==============================================================================
--- head/sys/arm/nvidia/tegra124/tegra124_machdep.c	Fri Dec 16 06:30:07 2016	(r310152)
+++ head/sys/arm/nvidia/tegra124/tegra124_machdep.c	Fri Dec 16 10:31:13 2016	(r310153)
@@ -66,13 +66,6 @@ static platform_devmap_init_t tegra124_d
 static platform_late_init_t tegra124_late_init;
 static platform_cpu_reset_t tegra124_cpu_reset;
 
-static vm_offset_t
-tegra124_lastaddr(platform_t plat)
-{
-
-	return (devmap_lastaddr());
-}
-
 static int
 tegra124_attach(platform_t plat)
 {
@@ -146,7 +139,6 @@ early_putc_t *early_putc = tegra124_earl
 
 static platform_method_t tegra124_methods[] = {
 	PLATFORMMETHOD(platform_attach,		tegra124_attach),
-	PLATFORMMETHOD(platform_lastaddr,	tegra124_lastaddr),
 	PLATFORMMETHOD(platform_devmap_init,	tegra124_devmap_init),
 	PLATFORMMETHOD(platform_late_init,	tegra124_late_init),
 	PLATFORMMETHOD(platform_cpu_reset,	tegra124_cpu_reset),

Modified: head/sys/arm/qemu/virt_machdep.c
==============================================================================
--- head/sys/arm/qemu/virt_machdep.c	Fri Dec 16 06:30:07 2016	(r310152)
+++ head/sys/arm/qemu/virt_machdep.c	Fri Dec 16 10:31:13 2016	(r310153)
@@ -44,13 +44,6 @@ __FBSDID("$FreeBSD$");
 
 #include "platform_if.h"
 
-static vm_offset_t
-virt_lastaddr(platform_t plat)
-{
-
-	return (devmap_lastaddr());
-}
-
 /*
  * Set up static device mappings.
  */
@@ -64,7 +57,6 @@ virt_devmap_init(platform_t plat)
 
 static platform_method_t virt_methods[] = {
 	PLATFORMMETHOD(platform_devmap_init,	virt_devmap_init),
-	PLATFORMMETHOD(platform_lastaddr,	virt_lastaddr),
 
 #ifdef SMP
 	PLATFORMMETHOD(platform_mp_start_ap,	virt_mp_start_ap),
@@ -86,7 +78,6 @@ gem5_devmap_init(platform_t plat)
 
 static platform_method_t gem5_methods[] = {
 	PLATFORMMETHOD(platform_devmap_init,	gem5_devmap_init),
-	PLATFORMMETHOD(platform_lastaddr,	virt_lastaddr),
 
 	PLATFORMMETHOD_END,
 };

Modified: head/sys/arm/rockchip/rk30xx_machdep.c
==============================================================================
--- head/sys/arm/rockchip/rk30xx_machdep.c	Fri Dec 16 06:30:07 2016	(r310152)
+++ head/sys/arm/rockchip/rk30xx_machdep.c	Fri Dec 16 10:31:13 2016	(r310153)
@@ -52,18 +52,10 @@ __FBSDID("$FreeBSD$");
 
 #include "platform_if.h"
 
-static platform_lastaddr_t rk30xx_lastaddr;
 static platform_devmap_init_t rk30xx_devmap_init;
 static platform_late_init_t rk30xx_late_init;
 static platform_cpu_reset_t rk30xx_cpu_reset;
 
-static vm_offset_t
-rk30xx_lastaddr(platform_t plat)
-{
-
-	return (devmap_lastaddr());
-}
-
 static void
 rk30xx_late_init(platform_t plat)
 {
@@ -97,7 +89,6 @@ rk30xx_cpu_reset(platform_t plat)
 
 #if defined(SOC_ROCKCHIP_RK3188)
 static platform_method_t rk30xx_methods[] = {
-	PLATFORMMETHOD(platform_lastaddr,	rk30xx_lastaddr),
 	PLATFORMMETHOD(platform_devmap_init,	rk30xx_devmap_init),
 	PLATFORMMETHOD(platform_late_init,	rk30xx_late_init),
 	PLATFORMMETHOD(platform_cpu_reset,	rk30xx_cpu_reset),

Modified: head/sys/arm/ti/ti_machdep.c
==============================================================================
--- head/sys/arm/ti/ti_machdep.c	Fri Dec 16 06:30:07 2016	(r310152)
+++ head/sys/arm/ti/ti_machdep.c	Fri Dec 16 10:31:13 2016	(r310153)
@@ -66,7 +66,6 @@ static platform_devmap_init_t ti_omap4_d
 static platform_attach_t ti_am335x_attach;
 static platform_devmap_init_t ti_am335x_devmap_init;
 #endif
-static platform_lastaddr_t ti_lastaddr;
 static platform_cpu_reset_t ti_plat_cpu_reset;
 
 void (*ti_cpu_reset)(void) = NULL;
@@ -91,13 +90,6 @@ ti_am335x_attach(platform_t plat)
 }
 #endif
 
-static vm_offset_t
-ti_lastaddr(platform_t plat)
-{
-
-	return (devmap_lastaddr());
-}
-
 /*
  * Construct static devmap entries to map out the most frequently used
  * peripherals using 1mb section mappings.
@@ -141,7 +133,6 @@ ti_plat_cpu_reset(platform_t plat)
 static platform_method_t omap4_methods[] = {
 	PLATFORMMETHOD(platform_attach, 	omap4_attach),
 	PLATFORMMETHOD(platform_devmap_init,	ti_omap4_devmap_init),
-	PLATFORMMETHOD(platform_lastaddr,	ti_lastaddr),
 	PLATFORMMETHOD(platform_cpu_reset,	ti_plat_cpu_reset),
 
 #ifdef SMP
@@ -157,7 +148,6 @@ FDT_PLATFORM_DEF(omap4, "omap4", 0, "ti,
 static platform_method_t am335x_methods[] = {
 	PLATFORMMETHOD(platform_attach, 	ti_am335x_attach),
 	PLATFORMMETHOD(platform_devmap_init,	ti_am335x_devmap_init),
-	PLATFORMMETHOD(platform_lastaddr,	ti_lastaddr),
 	PLATFORMMETHOD(platform_cpu_reset,	ti_plat_cpu_reset),
 
 	PLATFORMMETHOD_END,

From owner-svn-src-all@freebsd.org  Fri Dec 16 10:40:02 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15EE4C805FA;
 Fri, 16 Dec 2016 10:40:02 +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 CB05CAEC;
 Fri, 16 Dec 2016 10:40:01 +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 uBGAe1J8034654;
 Fri, 16 Dec 2016 10:40:01 GMT (envelope-from andrew@FreeBSD.org)
Received: (from andrew@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGAe056034652;
 Fri, 16 Dec 2016 10:40:00 GMT (envelope-from andrew@FreeBSD.org)
Message-Id: <201612161040.uBGAe056034652@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: andrew set sender to
 andrew@FreeBSD.org using -f
From: Andrew Turner <andrew@FreeBSD.org>
Date: Fri, 16 Dec 2016 10:40:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310154 - head/sys/dev/acpica
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 10:40:02 -0000

Author: andrew
Date: Fri Dec 16 10:40:00 2016
New Revision: 310154
URL: https://svnweb.freebsd.org/changeset/base/310154

Log:
  Add support to read the _CLS entry if it's present. It is used by
  memory-mapped devices that are normally PCIe drives. Devices can then use
  the existing pci_get_class, etc. accessors to query this data.
  
  The ivar values are different enough from the existing ACPI and ISA values
  to not conflict.
  
  Reviewed by:	jhb
  Obtained from:	ABT Systems Ltd
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D8721

Modified:
  head/sys/dev/acpica/acpi.c
  head/sys/dev/acpica/acpivar.h

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c	Fri Dec 16 10:31:13 2016	(r310153)
+++ head/sys/dev/acpica/acpi.c	Fri Dec 16 10:40:00 2016	(r310154)
@@ -68,6 +68,8 @@ __FBSDID("$FreeBSD$");
 #include <dev/acpica/acpivar.h>
 #include <dev/acpica/acpiio.h>
 
+#include <dev/pci/pcivar.h>
+
 #include <vm/vm_param.h>
 
 static MALLOC_DEFINE(M_ACPIDEV, "acpidev", "ACPI devices");
@@ -923,6 +925,15 @@ acpi_read_ivar(device_t dev, device_t ch
     case ISA_IVAR_LOGICALID:
 	*(int *)result = acpi_isa_get_logicalid(child);
 	break;
+    case PCI_IVAR_CLASS:
+	*(uint8_t*)result = (ad->ad_cls_class >> 16) & 0xff;
+	break;
+    case PCI_IVAR_SUBCLASS:
+	*(uint8_t*)result = (ad->ad_cls_class >> 8) & 0xff;
+	break;
+    case PCI_IVAR_PROGIF:
+	*(uint8_t*)result = (ad->ad_cls_class >> 0) & 0xff;
+	break;
     default:
 	return (ENOENT);
     }
@@ -1961,6 +1972,8 @@ acpi_probe_order(ACPI_HANDLE handle, int
 static ACPI_STATUS
 acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status)
 {
+    ACPI_DEVICE_INFO *devinfo;
+    struct acpi_device	*ad;
     struct acpi_prw_data prw;
     ACPI_OBJECT_TYPE type;
     ACPI_HANDLE h;
@@ -2054,6 +2067,17 @@ acpi_probe_child(ACPI_HANDLE handle, UIN
 	     * device not to have any resources.
 	     */
 	    acpi_parse_resources(child, handle, &acpi_res_parse_set, NULL);
+
+	    ad = device_get_ivars(child);
+	    ad->ad_cls_class = 0xffffff;
+	    if (ACPI_SUCCESS(AcpiGetObjectInfo(handle, &devinfo))) {
+		if ((devinfo->Valid & ACPI_VALID_CLS) != 0 &&
+		    devinfo->ClassCode.Length >= ACPI_PCICLS_STRING_SIZE) {
+		    ad->ad_cls_class = strtoul(devinfo->ClassCode.String,
+			NULL, 16);
+		}
+		AcpiOsFree(devinfo);
+	    }
 	    break;
 	}
     }

Modified: head/sys/dev/acpica/acpivar.h
==============================================================================
--- head/sys/dev/acpica/acpivar.h	Fri Dec 16 10:31:13 2016	(r310153)
+++ head/sys/dev/acpica/acpivar.h	Fri Dec 16 10:40:00 2016	(r310154)
@@ -85,6 +85,7 @@ struct acpi_device {
     ACPI_HANDLE			ad_handle;
     void			*ad_private;
     int				ad_flags;
+    int				ad_cls_class;
 
     /* Resources */
     struct resource_list	ad_rl;

From owner-svn-src-all@freebsd.org  Fri Dec 16 14:23:09 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97435C8247B;
 Fri, 16 Dec 2016 14:23:09 +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 67A7D131B;
 Fri, 16 Dec 2016 14:23:09 +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 uBGEN8km028631;
 Fri, 16 Dec 2016 14:23:08 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGEN8Dc028630;
 Fri, 16 Dec 2016 14:23:08 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612161423.uBGEN8Dc028630@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Fri, 16 Dec 2016 14:23:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310155 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 14:23:09 -0000

Author: kib
Date: Fri Dec 16 14:23:08 2016
New Revision: 310155
URL: https://svnweb.freebsd.org/changeset/base/310155

Log:
  Fix typo.
  
  MFC after:	3 days

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Fri Dec 16 10:40:00 2016	(r310154)
+++ head/libexec/rtld-elf/rtld.c	Fri Dec 16 14:23:08 2016	(r310155)
@@ -2493,7 +2493,7 @@ objlist_call_init(Objlist *list, RtldLoc
 	    continue;
 	/*
 	 * Race: other thread might try to use this object before current
-	 * one completes the initilization. Not much can be done here
+	 * one completes the initialization. Not much can be done here
 	 * without better locking.
 	 */
 	elm->obj->init_done = true;

From owner-svn-src-all@freebsd.org  Fri Dec 16 15:33:23 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D250C837DA;
 Fri, 16 Dec 2016 15:33:23 +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 304E1161C;
 Fri, 16 Dec 2016 15:33:23 +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 uBGFXMg0056703;
 Fri, 16 Dec 2016 15:33:22 GMT (envelope-from manu@FreeBSD.org)
Received: (from manu@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGFXMWv056700;
 Fri, 16 Dec 2016 15:33:22 GMT (envelope-from manu@FreeBSD.org)
Message-Id: <201612161533.uBGFXMWv056700@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: manu set sender to
 manu@FreeBSD.org using -f
From: Emmanuel Vadot <manu@FreeBSD.org>
Date: Fri, 16 Dec 2016 15:33:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310156 - in stable/11/sys/arm: at91 broadcom/bcm2835 ti
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 15:33:23 -0000

Author: manu
Date: Fri Dec 16 15:33:21 2016
New Revision: 310156
URL: https://svnweb.freebsd.org/changeset/base/310156

Log:
  MFC r309912:
  
  CS ivar is uint32_t, not int.

Modified:
  stable/11/sys/arm/at91/at91_spi.c
  stable/11/sys/arm/broadcom/bcm2835/bcm2835_spi.c
  stable/11/sys/arm/ti/ti_spi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/at91/at91_spi.c
==============================================================================
--- stable/11/sys/arm/at91/at91_spi.c	Fri Dec 16 14:23:08 2016	(r310155)
+++ stable/11/sys/arm/at91/at91_spi.c	Fri Dec 16 15:33:21 2016	(r310156)
@@ -291,7 +291,8 @@ at91_spi_transfer(device_t dev, device_t
 {
 	struct at91_spi_softc *sc;
 	bus_addr_t addr;
-	int err, i, j, mode[4], cs;
+	int err, i, j, mode[4];
+	uint32_t cs;
 
 	KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz,
 	    ("%s: TX/RX command sizes should be equal", __func__));
@@ -315,7 +316,7 @@ at91_spi_transfer(device_t dev, device_t
 	 * PSCDEC = 0 has a range of 0..3 for chip select.  We
 	 * don't support PSCDEC = 1 which has a range of 0..15.
 	 */
-	if (cs < 0 || cs > 3) {
+	if (cs > 3) {
 		device_printf(dev,
 		    "Invalid chip select %d requested by %s\n", cs,
 		    device_get_nameunit(child));

Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_spi.c
==============================================================================
--- stable/11/sys/arm/broadcom/bcm2835/bcm2835_spi.c	Fri Dec 16 14:23:08 2016	(r310155)
+++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_spi.c	Fri Dec 16 15:33:21 2016	(r310156)
@@ -422,7 +422,8 @@ static int
 bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
 {
 	struct bcm_spi_softc *sc;
-	int cs, err;
+	uint32_t cs;
+	int err;
 
 	sc = device_get_softc(dev);
 
@@ -433,7 +434,7 @@ bcm_spi_transfer(device_t dev, device_t 
 
 	/* Get the proper chip select for this child. */
 	spibus_get_cs(child, &cs);
-	if (cs < 0 || cs > 2) {
+	if (cs > 2) {
 		device_printf(dev,
 		    "Invalid chip select %d requested by %s\n", cs,
 		    device_get_nameunit(child));

Modified: stable/11/sys/arm/ti/ti_spi.c
==============================================================================
--- stable/11/sys/arm/ti/ti_spi.c	Fri Dec 16 14:23:08 2016	(r310155)
+++ stable/11/sys/arm/ti/ti_spi.c	Fri Dec 16 15:33:21 2016	(r310156)
@@ -445,9 +445,9 @@ ti_spi_gcd(int a, int b)
 static int
 ti_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
 {
-	int cs, err;
+	int err;
 	struct ti_spi_softc *sc;
-	uint32_t reg;
+	uint32_t reg, cs;
 
 	sc = device_get_softc(dev);
 
@@ -458,7 +458,7 @@ ti_spi_transfer(device_t dev, device_t c
 
 	/* Get the proper chip select for this child. */
 	spibus_get_cs(child, &cs);
-	if (cs < 0 || cs > sc->sc_numcs) {
+	if (cs > sc->sc_numcs) {
 		device_printf(dev, "Invalid chip select %d requested by %s\n",
 		    cs, device_get_nameunit(child));
 		return (EINVAL);

From owner-svn-src-all@freebsd.org  Fri Dec 16 15:37:20 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C1FDC838D5;
 Fri, 16 Dec 2016 15:37:20 +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 086BC18E2;
 Fri, 16 Dec 2016 15:37:19 +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 uBGFbJnE057120;
 Fri, 16 Dec 2016 15:37:19 GMT (envelope-from manu@FreeBSD.org)
Received: (from manu@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGFbJvO057119;
 Fri, 16 Dec 2016 15:37:19 GMT (envelope-from manu@FreeBSD.org)
Message-Id: <201612161537.uBGFbJvO057119@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: manu set sender to
 manu@FreeBSD.org using -f
From: Emmanuel Vadot <manu@FreeBSD.org>
Date: Fri, 16 Dec 2016 15:37:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310157 - stable/11/sys/arm/allwinner
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 15:37:20 -0000

Author: manu
Date: Fri Dec 16 15:37:18 2016
New Revision: 310157
URL: https://svnweb.freebsd.org/changeset/base/310157

Log:
  MFC r309063:
  
  Test that the emac device is enabled in probe function

Modified:
  stable/11/sys/arm/allwinner/if_emac.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/allwinner/if_emac.c
==============================================================================
--- stable/11/sys/arm/allwinner/if_emac.c	Fri Dec 16 15:33:21 2016	(r310156)
+++ stable/11/sys/arm/allwinner/if_emac.c	Fri Dec 16 15:37:18 2016	(r310157)
@@ -784,6 +784,9 @@ static int
 emac_probe(device_t dev)
 {
 
+	if (!ofw_bus_status_okay(dev))
+		return (ENXIO);
+
 	if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-emac"))
 		return (ENXIO);
 

From owner-svn-src-all@freebsd.org  Fri Dec 16 15:45:10 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA7B5C83E50;
 Fri, 16 Dec 2016 15:45:10 +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 9BB1D110;
 Fri, 16 Dec 2016 15:45:10 +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 uBGFj9EQ061279;
 Fri, 16 Dec 2016 15:45:09 GMT (envelope-from manu@FreeBSD.org)
Received: (from manu@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGFj91O061274;
 Fri, 16 Dec 2016 15:45:09 GMT (envelope-from manu@FreeBSD.org)
Message-Id: <201612161545.uBGFj91O061274@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: manu set sender to
 manu@FreeBSD.org using -f
From: Emmanuel Vadot <manu@FreeBSD.org>
Date: Fri, 16 Dec 2016 15:45:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310158 - in stable/11/sys: arm/lpc mips/atheros
 mips/mediatek mips/rt305x
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 15:45:11 -0000

Author: manu
Date: Fri Dec 16 15:45:09 2016
New Revision: 310158
URL: https://svnweb.freebsd.org/changeset/base/310158

Log:
  MFC r309935:
  
  Use the spibus accessor when applicable.

Modified:
  stable/11/sys/arm/lpc/lpc_spi.c
  stable/11/sys/mips/atheros/ar71xx_spi.c
  stable/11/sys/mips/mediatek/mtk_spi_v1.c
  stable/11/sys/mips/mediatek/mtk_spi_v2.c
  stable/11/sys/mips/rt305x/rt305x_spi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/lpc/lpc_spi.c
==============================================================================
--- stable/11/sys/arm/lpc/lpc_spi.c	Fri Dec 16 15:37:18 2016	(r310157)
+++ stable/11/sys/arm/lpc/lpc_spi.c	Fri Dec 16 15:45:09 2016	(r310158)
@@ -141,12 +141,14 @@ static int
 lpc_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
 {
 	struct lpc_spi_softc *sc = device_get_softc(dev);
-	struct spibus_ivar *devi = SPIBUS_IVAR(child);
+	uint32_t cs;
 	uint8_t *in_buf, *out_buf;
 	int i;
 
+	spibus_get_cs(child, &cs);
+
 	/* Set CS active */
-	lpc_gpio_set_state(child, devi->cs, 0);
+	lpc_gpio_set_state(child, cs, 0);
 
 	/* Wait for FIFO to be ready */
 	while ((lpc_spi_read_4(sc, LPC_SSP_SR) & LPC_SSP_SR_TNF) == 0);
@@ -168,7 +170,7 @@ lpc_spi_transfer(device_t dev, device_t 
 	}
 
 	/* Set CS inactive */
-	lpc_gpio_set_state(child, devi->cs, 1);
+	lpc_gpio_set_state(child, cs, 1);
 
 	return (0);
 }

Modified: stable/11/sys/mips/atheros/ar71xx_spi.c
==============================================================================
--- stable/11/sys/mips/atheros/ar71xx_spi.c	Fri Dec 16 15:37:18 2016	(r310157)
+++ stable/11/sys/mips/atheros/ar71xx_spi.c	Fri Dec 16 15:45:09 2016	(r310158)
@@ -204,13 +204,15 @@ static int
 ar71xx_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
 {
 	struct ar71xx_spi_softc *sc;
+	uint32_t cs;
 	uint8_t *buf_in, *buf_out;
-	struct spibus_ivar *devi = SPIBUS_IVAR(child);
 	int i;
 
 	sc = device_get_softc(dev);
 
-	ar71xx_spi_chip_activate(sc, devi->cs);
+	spibus_get_cs(child, &cs);
+
+	ar71xx_spi_chip_activate(sc, cs);
 
 	KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, 
 	    ("TX/RX command sizes should be equal"));
@@ -223,7 +225,7 @@ ar71xx_spi_transfer(device_t dev, device
 	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] = ar71xx_spi_txrx(sc, devi->cs, buf_out[i]);
+		buf_in[i] = ar71xx_spi_txrx(sc, cs, buf_out[i]);
 
 	/*
 	 * Receive/transmit data (depends on  command)
@@ -231,9 +233,9 @@ ar71xx_spi_transfer(device_t dev, device
 	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] = ar71xx_spi_txrx(sc, devi->cs, buf_out[i]);
+		buf_in[i] = ar71xx_spi_txrx(sc, cs, buf_out[i]);
 
-	ar71xx_spi_chip_deactivate(sc, devi->cs);
+	ar71xx_spi_chip_deactivate(sc, cs);
 
 	return (0);
 }

Modified: stable/11/sys/mips/mediatek/mtk_spi_v1.c
==============================================================================
--- stable/11/sys/mips/mediatek/mtk_spi_v1.c	Fri Dec 16 15:37:18 2016	(r310157)
+++ stable/11/sys/mips/mediatek/mtk_spi_v1.c	Fri Dec 16 15:45:09 2016	(r310158)
@@ -224,12 +224,14 @@ mtk_spi_transfer(device_t dev, device_t 
 {
 	struct mtk_spi_softc *sc;
 	uint8_t *buf, byte, *tx_buf;
-	struct spibus_ivar *devi = SPIBUS_IVAR(child);
+	uint32_t cs;
 	int i, sz, error = 0, write = 0;
 
 	sc = device_get_softc(dev);
 
-	if (devi->cs != 0)
+	spibus_get_cs(child, &cs);
+
+	if (cs != 0)
 		/* Only 1 CS */
 		return (ENXIO);
 

Modified: stable/11/sys/mips/mediatek/mtk_spi_v2.c
==============================================================================
--- stable/11/sys/mips/mediatek/mtk_spi_v2.c	Fri Dec 16 15:37:18 2016	(r310157)
+++ stable/11/sys/mips/mediatek/mtk_spi_v2.c	Fri Dec 16 15:45:09 2016	(r310158)
@@ -229,12 +229,14 @@ mtk_spi_transfer(device_t dev, device_t 
 {
 	struct mtk_spi_softc *sc;
 	uint8_t *buf, byte, *tx_buf;
-	struct spibus_ivar *devi = SPIBUS_IVAR(child);
+	uint32_t cs;
 	int i, sz, error, write = 0;
 
 	sc = device_get_softc(dev);
 
-	if (devi->cs != 0)
+	spibus_get_cs(child, &cs);
+
+	if (cs != 0)
 		/* Only 1 CS */
 		return (ENXIO);
 

Modified: stable/11/sys/mips/rt305x/rt305x_spi.c
==============================================================================
--- stable/11/sys/mips/rt305x/rt305x_spi.c	Fri Dec 16 15:37:18 2016	(r310157)
+++ stable/11/sys/mips/rt305x/rt305x_spi.c	Fri Dec 16 15:45:09 2016	(r310158)
@@ -218,13 +218,15 @@ static int
 rt305x_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
 {
 	struct rt305x_spi_softc *sc;
+	uint32_t cs;
 	uint8_t *buf, byte, *tx_buf;
-	struct spibus_ivar *devi = SPIBUS_IVAR(child);
 	int i, sz, error = 0, write = 0;
 
 	sc = device_get_softc(dev);
 
-	if (devi->cs != 0)
+	spibus_get_cs(child, &cs);
+
+	if (cs != 0)
 		/* Only 1 CS */
 		return (ENXIO);
 

From owner-svn-src-all@freebsd.org  Fri Dec 16 17:31:54 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75850C81C9B;
 Fri, 16 Dec 2016 17:31:54 +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 3742C1BE8;
 Fri, 16 Dec 2016 17:31:54 +0000 (UTC) (envelope-from slw@zxy.spb.ru)
Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD))
 (envelope-from <slw@zxy.spb.ru>)
 id 1cHwMJ-000CgD-Dr; Fri, 16 Dec 2016 20:31:51 +0300
Date: Fri, 16 Dec 2016 20:31:51 +0300
From: Slawa Olhovchenkov <slw@zxy.spb.ru>
To: Andriy Gapon <avg@FreeBSD.org>
Cc: Alexander Motin <mav@FreeBSD.org>, src-committers@FreeBSD.org,
 svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org
Subject: Re: svn commit: r310023 - in head/sys/cddl: compat/opensolaris/sys
 contrib/opensolaris/uts/common/fs/zfs
Message-ID: <20161216173151.GC90401@zxy.spb.ru>
References: <201612131620.uBDGKAR0007684@repo.freebsd.org>
 <55217d08-1c39-0d30-58a3-6b3aa48fd79f@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <55217d08-1c39-0d30-58a3-6b3aa48fd79f@FreeBSD.org>
User-Agent: Mutt/1.5.24 (2015-08-30)
X-SA-Exim-Connect-IP: <locally generated>
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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 17:31:54 -0000

On Wed, Dec 14, 2016 at 02:38:11PM +0200, Andriy Gapon wrote:

> Alexander,
> 
> I tried to see how the code looks after expanding illumos variables to FreeBSD
> variables before and after your change.
> 
> Before:
> n = PAGESIZE * ((int64_t)freemem - zfs_arc_free_target);
> ==>
> n = PAGESIZE * ((int64_t)vm_cnt.v_free_count - zfs_arc_free_target);
> 
> After:
> n = PAGESIZE * (freemem - lotsfree - needfree - desfree);
> ==>
> n = PAGESIZE * ((long)vm_cnt.v_free_count - zfs_arc_free_target -
> (long)vm_pageout_deficit - (long)vm_cnt.v_free_target);
> 
> Default value of zfs_arc_free_target is vm_pageout_wakeup_thresh and its default
> value is (vm_cnt.v_free_min / 10) * 11.
> 
> vm_pageout_deficit is probably just a noise most of the time.

vm_pageout_deficit zeroed at read by vm_pageout_scan().

In illumos case target is "target_free" + "pageout_high_water" + "extra
pages here to make sure the scanner doesn't start up while we're
freeing memory."

As zero-order approximation we can let

target_free as v_free_target (desfree)
pageout_high_water as zfs_arc_free_target (lotsfree)
extra pages as vm_pageout_deficit (needfree)

In that case noise in vm_pageout_deficit is not problem.

> But v_free_target is a substantial value (even greater than the default
> zfs_arc_free_target).
> 
> It seems that now we subtract much more than we did before.

Code was totaly broken in FreeBSD case: needfree don't updated in process of
reclaim. Mostly reclaim stops only after ARC touch arc_min.

> So, this change does not merely reduce diff, it also changes ARC sizing behavior.

And this is right way.

> I wonder how much testing have you done for this change and if you can qualify
> ARC size behavior in various scenarios.  I expect that with your change the ARC
> would more easily give in to the memory pressure.  That may delight some, but it
> could be an issue for others.  Especially if it forces ARC to its minimum size
> for no good reason.
> 
> P.S.
> My impression is that the page daemon in illumos has a different algorithm from
> our page daemon, so some similarities could be misleading rather than helpful.
> 
> -- 
> Andriy Gapon
> _______________________________________________
> 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-all@freebsd.org  Fri Dec 16 17:41:21 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E90C9C824FC;
 Fri, 16 Dec 2016 17:41:21 +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 9F341683;
 Fri, 16 Dec 2016 17:41:21 +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 uBGHfK6e006137;
 Fri, 16 Dec 2016 17:41:20 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGHfKJx006136;
 Fri, 16 Dec 2016 17:41:20 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612161741.uBGHfKJx006136@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Fri, 16 Dec 2016 17:41:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310159 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 17:41:22 -0000

Author: kib
Date: Fri Dec 16 17:41:20 2016
New Revision: 310159
URL: https://svnweb.freebsd.org/changeset/base/310159

Log:
  Switch from stdatomic.h to atomic.h for kernel.
  
  Apparently stdatomic.h implementation for gcc 4.2 on sparc64 does not
  work properly.  This effectively reverts r251803.
  
  Reported and tested by:	lidl
  Discussed with:	ed
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/kern/kern_event.c

Modified: head/sys/kern/kern_event.c
==============================================================================
--- head/sys/kern/kern_event.c	Fri Dec 16 15:45:09 2016	(r310158)
+++ head/sys/kern/kern_event.c	Fri Dec 16 17:41:20 2016	(r310159)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/fcntl.h>
 #include <sys/kthread.h>
 #include <sys/selinfo.h>
-#include <sys/stdatomic.h>
 #include <sys/queue.h>
 #include <sys/event.h>
 #include <sys/eventvar.h>
@@ -69,6 +68,7 @@ __FBSDID("$FreeBSD$");
 #ifdef KTRACE
 #include <sys/ktrace.h>
 #endif
+#include <machine/atomic.h>
 
 #include <vm/uma.h>
 
@@ -188,7 +188,7 @@ static struct filterops user_filtops = {
 };
 
 static uma_zone_t	knote_zone;
-static atomic_uint	kq_ncallouts = ATOMIC_VAR_INIT(0);
+static unsigned int	kq_ncallouts = 0;
 static unsigned int 	kq_calloutmax = 4 * 1024;
 SYSCTL_UINT(_kern, OID_AUTO, kq_calloutmax, CTLFLAG_RW,
     &kq_calloutmax, 0, "Maximum number of callouts allocated for kqueue");
@@ -672,13 +672,11 @@ filt_timerattach(struct knote *kn)
 	if (to < 0)
 		return (EINVAL);
 
-	ncallouts = atomic_load_explicit(&kq_ncallouts, memory_order_relaxed);
 	do {
+		ncallouts = kq_ncallouts;
 		if (ncallouts >= kq_calloutmax)
 			return (ENOMEM);
-	} while (!atomic_compare_exchange_weak_explicit(&kq_ncallouts,
-	    &ncallouts, ncallouts + 1, memory_order_relaxed,
-	    memory_order_relaxed));
+	} while (!atomic_cmpset_int(&kq_ncallouts, ncallouts, ncallouts + 1));
 
 	kn->kn_flags |= EV_CLEAR;		/* automatically set */
 	kn->kn_status &= ~KN_DETACHED;		/* knlist_add clears it */
@@ -703,7 +701,7 @@ filt_timerdetach(struct knote *kn)
 	callout_drain(calloutp);
 	free(calloutp, M_KQUEUE);
 	free(kn->kn_ptr.p_nexttime, M_KQUEUE);
-	old = atomic_fetch_sub_explicit(&kq_ncallouts, 1, memory_order_relaxed);
+	old = atomic_fetchadd_int(&kq_ncallouts, -1);
 	KASSERT(old > 0, ("Number of callouts cannot become negative"));
 	kn->kn_status |= KN_DETACHED;	/* knlist_remove sets it */
 }

From owner-svn-src-all@freebsd.org  Fri Dec 16 17:44:58 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21BC7C82717;
 Fri, 16 Dec 2016 17:44:58 +0000 (UTC)
 (envelope-from lifanov@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E5AA3D7C;
 Fri, 16 Dec 2016 17:44:57 +0000 (UTC)
 (envelope-from lifanov@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBGHivAN009879;
 Fri, 16 Dec 2016 17:44:57 GMT (envelope-from lifanov@FreeBSD.org)
Received: (from lifanov@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGHiv3Q009878;
 Fri, 16 Dec 2016 17:44:57 GMT (envelope-from lifanov@FreeBSD.org)
Message-Id: <201612161744.uBGHiv3Q009878@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: lifanov set sender to
 lifanov@FreeBSD.org using -f
From: Nikolai Lifanov <lifanov@FreeBSD.org>
Date: Fri, 16 Dec 2016 17:44:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310160 - head
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 17:44:58 -0000

Author: lifanov (ports committer)
Date: Fri Dec 16 17:44:56 2016
New Revision: 310160
URL: https://svnweb.freebsd.org/changeset/base/310160

Log:
  retain cc.4.gz man page for Chelsio T6 NICs
  
  This man page was removed in r225583 when cc.4 was renamed to mod_cc.4
  With reintroduction of cc.4 "make installworld; make delete-old" was
  no longer convergent.
  
  Reported by:	Trond Endrestøl
  Reviewed by:	np, matthew
  Approved by:	np, matthew (mentor)
  Differential Revision:	https://reviews.freebsd.org/D8816

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Fri Dec 16 17:41:20 2016	(r310159)
+++ head/ObsoleteFiles.inc	Fri Dec 16 17:44:56 2016	(r310160)
@@ -2939,7 +2939,6 @@ OLD_FILES+=usr/lib32/libftpio_p.a
 OLD_FILES+=usr/include/ftpio.h
 OLD_FILES+=usr/share/man/man3/ftpio.3.gz
 # 20110915: rename congestion control manpages
-OLD_FILES+=usr/share/man/man4/cc.4.gz
 OLD_FILES+=usr/share/man/man9/cc.9.gz
 # 20110831: atomic page flags operations
 OLD_FILES+=usr/share/man/man9/vm_page_flag.9.gz

From owner-svn-src-all@freebsd.org  Fri Dec 16 18:13:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12952C83548;
 Fri, 16 Dec 2016 18:13: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 BCEF1323;
 Fri, 16 Dec 2016 18:13:49 +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 uBGIDmDN022071;
 Fri, 16 Dec 2016 18:13:48 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIDm7n022070;
 Fri, 16 Dec 2016 18:13:48 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612161813.uBGIDm7n022070@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Fri, 16 Dec 2016 18:13:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r310161 - vendor/llvm/llvm-release_391-r289601
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 18:13:50 -0000

Author: dim
Date: Fri Dec 16 18:13:48 2016
New Revision: 310161
URL: https://svnweb.freebsd.org/changeset/base/310161

Log:
  Tag llvm 3.9.1 release r289601.

Added:
  vendor/llvm/llvm-release_391-r289601/
     - copied from r310160, vendor/llvm/dist/

From owner-svn-src-all@freebsd.org  Fri Dec 16 18:14:05 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 442ECC8357C;
 Fri, 16 Dec 2016 18:14:05 +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 1367B634;
 Fri, 16 Dec 2016 18:14:05 +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 uBGIE4Pl022136;
 Fri, 16 Dec 2016 18:14:04 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIE4fx022135;
 Fri, 16 Dec 2016 18:14:04 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612161814.uBGIE4fx022135@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Fri, 16 Dec 2016 18:14:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r310162 - vendor/clang/dist/lib/Basic
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 18:14:05 -0000

Author: dim
Date: Fri Dec 16 18:14:04 2016
New Revision: 310162
URL: https://svnweb.freebsd.org/changeset/base/310162

Log:
  Vendor import of clang 3.9.1 release r289601:
  https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_391/final@289601

Modified:
  vendor/clang/dist/lib/Basic/Version.cpp

Modified: vendor/clang/dist/lib/Basic/Version.cpp
==============================================================================
--- vendor/clang/dist/lib/Basic/Version.cpp	Fri Dec 16 18:13:48 2016	(r310161)
+++ vendor/clang/dist/lib/Basic/Version.cpp	Fri Dec 16 18:14:04 2016	(r310162)
@@ -36,7 +36,7 @@ std::string getClangRepositoryPath() {
 
   // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us
   // pick up a tag in an SVN export, for example.
-  StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_39/lib/Basic/Version.cpp $");
+  StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_391/final/lib/Basic/Version.cpp $");
   if (URL.empty()) {
     URL = SVNRepository.slice(SVNRepository.find(':'),
                               SVNRepository.find("/lib/Basic"));

From owner-svn-src-all@freebsd.org  Fri Dec 16 18:14:08 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25AB9C835A3;
 Fri, 16 Dec 2016 18:14:08 +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 CB75467D;
 Fri, 16 Dec 2016 18:14:07 +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 uBGIE6HF022182;
 Fri, 16 Dec 2016 18:14:06 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIE6Jo022181;
 Fri, 16 Dec 2016 18:14:06 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612161814.uBGIE6Jo022181@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Fri, 16 Dec 2016 18:14:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r310163 - vendor/clang/clang-release_391-r289601
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 18:14:08 -0000

Author: dim
Date: Fri Dec 16 18:14:06 2016
New Revision: 310163
URL: https://svnweb.freebsd.org/changeset/base/310163

Log:
  Tag clang 3.9.1 release r289601.

Added:
  vendor/clang/clang-release_391-r289601/
     - copied from r310162, vendor/clang/dist/

From owner-svn-src-all@freebsd.org  Fri Dec 16 18:14:14 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38566C835E1;
 Fri, 16 Dec 2016 18:14:14 +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 E359D77B;
 Fri, 16 Dec 2016 18:14:13 +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 uBGIEDQF022231;
 Fri, 16 Dec 2016 18:14:13 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIEDaT022230;
 Fri, 16 Dec 2016 18:14:13 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612161814.uBGIEDaT022230@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Fri, 16 Dec 2016 18:14:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r310164 -
 vendor/compiler-rt/compiler-rt-release_391-r289601
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 18:14:14 -0000

Author: dim
Date: Fri Dec 16 18:14:12 2016
New Revision: 310164
URL: https://svnweb.freebsd.org/changeset/base/310164

Log:
  Tag compiler-rt 3.9.1 release r289601.

Added:
  vendor/compiler-rt/compiler-rt-release_391-r289601/
     - copied from r310163, vendor/compiler-rt/dist/

From owner-svn-src-all@freebsd.org  Fri Dec 16 18:14:28 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29382C83655;
 Fri, 16 Dec 2016 18:14:28 +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 D4AC28EA;
 Fri, 16 Dec 2016 18:14:27 +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 uBGIERhD022329;
 Fri, 16 Dec 2016 18:14:27 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIERKL022328;
 Fri, 16 Dec 2016 18:14:27 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612161814.uBGIERKL022328@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Fri, 16 Dec 2016 18:14:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r310166 - vendor/lld/lld-release_391-r289601
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 18:14:28 -0000

Author: dim
Date: Fri Dec 16 18:14:26 2016
New Revision: 310166
URL: https://svnweb.freebsd.org/changeset/base/310166

Log:
  Tag lld 3.9.1 release r289601.

Added:
  vendor/lld/lld-release_391-r289601/
     - copied from r310165, vendor/lld/dist/

From owner-svn-src-all@freebsd.org  Fri Dec 16 18:14:24 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E39EC83635;
 Fri, 16 Dec 2016 18:14:24 +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 05D92888;
 Fri, 16 Dec 2016 18:14:23 +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 uBGIENrd022280;
 Fri, 16 Dec 2016 18:14:23 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIEN9f022279;
 Fri, 16 Dec 2016 18:14:23 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612161814.uBGIEN9f022279@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Fri, 16 Dec 2016 18:14:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r310165 - vendor/libc++/libc++-release_391-r289601
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 18:14:24 -0000

Author: dim
Date: Fri Dec 16 18:14:23 2016
New Revision: 310165
URL: https://svnweb.freebsd.org/changeset/base/310165

Log:
  Tag libc++ 3.9.1 release r289601.

Added:
  vendor/libc++/libc++-release_391-r289601/
     - copied from r310164, vendor/libc++/dist/

From owner-svn-src-all@freebsd.org  Fri Dec 16 18:14:37 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 848ADC836B7;
 Fri, 16 Dec 2016 18:14:37 +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 3C04B9FC;
 Fri, 16 Dec 2016 18:14:37 +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 uBGIEaFT022378;
 Fri, 16 Dec 2016 18:14:36 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGIEaCh022377;
 Fri, 16 Dec 2016 18:14:36 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612161814.uBGIEaCh022377@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Fri, 16 Dec 2016 18:14:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r310167 - vendor/lldb/lldb-release_391-r289601
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 18:14:37 -0000

Author: dim
Date: Fri Dec 16 18:14:36 2016
New Revision: 310167
URL: https://svnweb.freebsd.org/changeset/base/310167

Log:
  Tag lldb 3.9.1 release r289601.

Added:
  vendor/lldb/lldb-release_391-r289601/
     - copied from r310166, vendor/lldb/dist/

From owner-svn-src-all@freebsd.org  Fri Dec 16 19:09:58 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC1AFC83739;
 Fri, 16 Dec 2016 19:09:58 +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 818EF13AF;
 Fri, 16 Dec 2016 19:09:58 +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 uBGJ9v7J043277;
 Fri, 16 Dec 2016 19:09:57 GMT (envelope-from gonzo@FreeBSD.org)
Received: (from gonzo@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGJ9vro043276;
 Fri, 16 Dec 2016 19:09:57 GMT (envelope-from gonzo@FreeBSD.org)
Message-Id: <201612161909.uBGJ9vro043276@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: gonzo set sender to
 gonzo@FreeBSD.org using -f
From: Oleksandr Tymoshenko <gonzo@FreeBSD.org>
Date: Fri, 16 Dec 2016 19:09:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310170 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 19:09:58 -0000

Author: gonzo
Date: Fri Dec 16 19:09:57 2016
New Revision: 310170
URL: https://svnweb.freebsd.org/changeset/base/310170

Log:
  [spigen] Make "data" part of spigen_transfer optional
  
  Make st_data part of spigen_transfer optional by letting pass zero length
  and NULL pointer. SPI controller drivers handle this case fine.
  
  MFC after:	1 week

Modified:
  head/sys/dev/spibus/spigen.c

Modified: head/sys/dev/spibus/spigen.c
==============================================================================
--- head/sys/dev/spibus/spigen.c	Fri Dec 16 18:38:31 2016	(r310169)
+++ head/sys/dev/spibus/spigen.c	Fri Dec 16 19:09:57 2016	(r310170)
@@ -204,7 +204,7 @@ spigen_transfer(struct cdev *cdev, struc
 	int error = 0;
 
 	mtx_lock(&sc->sc_mtx);
-	if (st->st_command.iov_len == 0 || st->st_data.iov_len == 0)
+	if (st->st_command.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)
@@ -221,16 +221,20 @@ spigen_transfer(struct cdev *cdev, struc
 	    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);
+	if (st->st_data.iov_len > 0) {
+		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);
+		}
 	}
+	else
+		transfer.tx_data = transfer.rx_data = NULL;
 
 	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)
+	if ((error == 0) && (st->st_data.iov_len > 0))
 		error = copyin(st->st_data.iov_base, transfer.tx_data,
 		    transfer.tx_data_sz = transfer.rx_data_sz =
 		                          st->st_data.iov_len);	
@@ -239,7 +243,7 @@ spigen_transfer(struct cdev *cdev, struc
 	if (error == 0) {
 		error = copyout(transfer.rx_cmd, st->st_command.iov_base,
 		    transfer.rx_cmd_sz);
-		if (error == 0)
+		if ((error == 0) && (st->st_data.iov_len > 0))
 			error = copyout(transfer.rx_data, st->st_data.iov_base,
 			    transfer.rx_data_sz);
 	}

From owner-svn-src-all@freebsd.org  Fri Dec 16 19:31:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 096BCC83E4B;
 Fri, 16 Dec 2016 19:31:33 +0000 (UTC)
 (envelope-from baptiste.daroussin@gmail.com)
Received: from mail-wj0-x242.google.com (mail-wj0-x242.google.com
 [IPv6:2a00:1450:400c:c01::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 A40D566A;
 Fri, 16 Dec 2016 19:31:32 +0000 (UTC)
 (envelope-from baptiste.daroussin@gmail.com)
Received: by mail-wj0-x242.google.com with SMTP id j10so15668068wjb.3;
 Fri, 16 Dec 2016 11:31:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=11dpoyA08vl5c4hxXP12PCYCSezeim/J18U5Kb6P0ug=;
 b=kbEZsg98WdPAV4CexyQwDkHrmEBo03ZliRbUwhoZ1QgGIezg5alaGTtvDrDZtgi1dm
 SMvcbUwEYmG0nENqGoiMTFkfw+IQXrZFlAJqYHgzNbxAwdWkz32+nA85ugk7j9hlwPal
 9H1TktnZ2I4IB5Cx0/JzEtitaAKUQ9TknVx7aRmDiRYbJvqtzSj/LXOIIcI8yhsiH2Q2
 5TZb6n6IAY9+f489m4fefyEFFgd+rVoDbmf+W0pmVv8ReDhGxk4+0WzZrGyDrHFWKAcG
 uEGk+7LlNuinGXAkXmdWXmnlsgVRhj8S05hkKpiP7049aMfulhsh6otkXsHVJKb8wR9A
 P1OQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
 :references:mime-version:content-disposition:in-reply-to:user-agent;
 bh=11dpoyA08vl5c4hxXP12PCYCSezeim/J18U5Kb6P0ug=;
 b=r3dUJr0P0BonnKiVj0dLMMKu8S44C+fj0uv8b/Ex9M7c3LyOw7zkVKeMaPS7N2EidC
 kYweeUq503e15igZ+WqNOv3kBdQrjC+FXRJaPEMCl6H3vge2vyWYSvxRpA35XCqeFQMP
 M2BJ98c3mJ2kgH6OaVHvqyQVZo++3G/g1ooJZDS8xh22rvo7PAPBIUVyYXYd5+HUglDT
 /lgt4Z45UwjB4ZQpX/IUQe6S88u0CtgV6zrw1rWyf5iTTadTQ4XZhKxmMH2dKhkeQUak
 lfu+Hx1+qiwPLMYaS3mGuLSm3HgihDlmLaWT4zcqWEMm2gGLxFAovLsM81QJ1nwEIR0S
 Jbiw==
X-Gm-Message-State: AKaTC02p5b2YczbVYPmRiGlViN2PiF26DfKm+DGO+kWkHZRT5CCtErnFTVTB0hflavJpFg==
X-Received: by 10.194.2.110 with SMTP id 14mr4042572wjt.206.1481916690455;
 Fri, 16 Dec 2016 11:31:30 -0800 (PST)
Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1])
 by smtp.gmail.com with ESMTPSA id w18sm4724290wme.9.2016.12.16.11.31.29
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 16 Dec 2016 11:31:29 -0800 (PST)
Sender: Baptiste Daroussin <baptiste.daroussin@gmail.com>
Date: Fri, 16 Dec 2016 20:31:28 +0100
From: Baptiste Daroussin <bapt@FreeBSD.org>
To: "Conrad E. Meyer" <cem@FreeBSD.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r310138 - head/lib/libc/stdio
Message-ID: <20161216193128.wgskqt4vc44vdd7o@ivaldir.etoilebsd.net>
References: <201612160144.uBG1ipjW016736@repo.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="zefxcl2ldqg6x2lx"
Content-Disposition: inline
In-Reply-To: <201612160144.uBG1ipjW016736@repo.freebsd.org>
User-Agent: NeoMutt/20161126 (1.7.1)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 19:31:33 -0000


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

On Fri, Dec 16, 2016 at 01:44:51AM +0000, Conrad E. Meyer wrote:
> Author: cem
> Date: Fri Dec 16 01:44:50 2016
> New Revision: 310138
> URL: https://svnweb.freebsd.org/changeset/base/310138
>=20
> Log:
>   vfprintf(3): Add support for kernel %b format
>  =20
>   This is a direct port of the kernel %b format.
>  =20
>   I'm unclear on if (more) non-portable printf extensions will be a
>   problem. I think it's desirable to have userspace formats include all
>   kernel formats, but there may be competing goals I'm not aware of.
>  =20
>   Reviewed by:	no one, unfortunately
>   Sponsored by:	Dell EMC Isilon
>   Differential Revision:	https://reviews.freebsd.org/D8426
>=20

I really don't think it is a good idea, if used in userland it would be make
more of our code difficult to port elsewhere.

Other than that, it makes more difficult to use vanilla gcc with out userla=
nd.
and it is adding more complexity to be able to build freebsd from a non fre=
ebsd
system which some people are working on.

Personnaly I would prefer to see those extensions removed from the kernel r=
ather
than see them available in userland.

Can't we use simple helper function instead?

Best regards,
Bapt

--zefxcl2ldqg6x2lx
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlhUQQgACgkQY4mL3PG3
PlqeFg/+LO2FgR84cjhm0HvNZJnX6xvM0bp4i//YGTUiby6OSH2KnXFFUfJB1QPH
mukfvUuOcLuLGTkWBt0j3PP+A7XrkAjXOOxV+4R6xdGzCikxKuemsmf5W08xcTm7
TteIdibfsZOR3dWRk4SZQd8KCyHxHFc/o5rVFrpTxkU4M/EoHNVuy2lkGGxS0hwb
Viu0A4hkCHRYo53D6evN0SP0GhzkaQ755F6VMJ6GCO9FXAg0rFaOtF9AMUrRZ0kQ
wfPWSDw6YOa/WhpA+5dFF0TdPZqhfV5uSKv6W8V2CSJtl3pjf/eLSzb95j9ilxsH
w2aWUwktQsHVW8a1ubPgagRifEvKeja+1DWsDMvwB0RNcK6PIM3H+rXid7LA/j8V
vhvftA6em6xWznqLdDsmkndaXqsKlWUJZr/ojhLFBwBmqD/L1l7tnXPtkeHpuqSF
Q4F2ggyLDYCN4bGy+/WGy9mBMDCud1DXl5BN7rVZLuwho5AhF6Bu/9coZNltHhvA
kCq+kl1PRBvhxoam69UDhQ1KMPlC+xepntaFywCuA8aQ/LxwzWeCZAUepdxyQI6k
z7AbPnk/0Sahvgx9uy4x3dMaW4aodfr6F6zVKI8BMETctoAYw5kXOAMy/rTCjqBZ
IxmOHIwrL5t8sPhBDP5rmf4zOeV8AHZLifxsTJgkVoFQwxINJ4s=
=G9j0
-----END PGP SIGNATURE-----

--zefxcl2ldqg6x2lx--

From owner-svn-src-all@freebsd.org  Fri Dec 16 19:49:23 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 643E1C832CE;
 Fri, 16 Dec 2016 19:49:23 +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 33934F56;
 Fri, 16 Dec 2016 19:49:23 +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 uBGJnMAs059218;
 Fri, 16 Dec 2016 19:49:22 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGJnMol059217;
 Fri, 16 Dec 2016 19:49:22 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201612161949.uBGJnMol059217@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Fri, 16 Dec 2016 19:49:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310171 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 19:49:23 -0000

Author: dim
Date: Fri Dec 16 19:49:22 2016
New Revision: 310171
URL: https://svnweb.freebsd.org/changeset/base/310171

Log:
  Add __scanflike attributes to the kernel's sscanf() and vsscanf()
  declarations.  This should help to catch future mismatches between
  format strings and arguments.
  
  MFC after:	1 week

Modified:
  head/sys/sys/systm.h

Modified: head/sys/sys/systm.h
==============================================================================
--- head/sys/sys/systm.h	Fri Dec 16 19:09:57 2016	(r310170)
+++ head/sys/sys/systm.h	Fri Dec 16 19:49:22 2016	(r310171)
@@ -227,8 +227,8 @@ int	vsnprintf(char *, size_t, const char
 int	vsnrprintf(char *, size_t, int, const char *, __va_list) __printflike(4, 0);
 int	vsprintf(char *buf, const char *, __va_list) __printflike(2, 0);
 int	ttyprintf(struct tty *, const char *, ...) __printflike(2, 3);
-int	sscanf(const char *, char const *, ...) __nonnull(1) __nonnull(2);
-int	vsscanf(const char *, char const *, __va_list) __nonnull(1) __nonnull(2);
+int	sscanf(const char *, char const *, ...) __nonnull(1) __nonnull(2) __scanflike(2, 3);
+int	vsscanf(const char *, char const *, __va_list) __nonnull(1) __nonnull(2) __scanflike(2, 0);
 long	strtol(const char *, char **, int) __nonnull(1);
 u_long	strtoul(const char *, char **, int) __nonnull(1);
 quad_t	strtoq(const char *, char **, int) __nonnull(1);

From owner-svn-src-all@freebsd.org  Fri Dec 16 19:53:36 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 167B2C8355E;
 Fri, 16 Dec 2016 19:53:36 +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 D26121586;
 Fri, 16 Dec 2016 19:53:35 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from [IPv6:2001:7b8:3a7::4ccf:cb4c:3c45:4bd1] (unknown
 [IPv6:2001:7b8:3a7:0:4ccf:cb4c:3c45:4bd1])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by tensor.andric.com (Postfix) with ESMTPSA id 542EE14EBA;
 Fri, 16 Dec 2016 20:53:34 +0100 (CET)
Content-Type: multipart/signed;
 boundary="Apple-Mail=_9E64CCF0-2511-4CCA-A8A1-2942F1648B83";
 protocol="application/pgp-signature"; micalg=pgp-sha1
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: Re: svn commit: r310138 - head/lib/libc/stdio
From: Dimitry Andric <dim@FreeBSD.org>
In-Reply-To: <20161216193128.wgskqt4vc44vdd7o@ivaldir.etoilebsd.net>
Date: Fri, 16 Dec 2016 20:53:26 +0100
Cc: "Conrad E. Meyer" <cem@FreeBSD.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Message-Id: <8CF1AB9C-83FE-495F-B07C-56F928282512@FreeBSD.org>
References: <201612160144.uBG1ipjW016736@repo.freebsd.org>
 <20161216193128.wgskqt4vc44vdd7o@ivaldir.etoilebsd.net>
To: Baptiste Daroussin <bapt@FreeBSD.org>
X-Mailer: Apple Mail (2.3124)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 19:53:36 -0000


--Apple-Mail=_9E64CCF0-2511-4CCA-A8A1-2942F1648B83
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

On 16 Dec 2016, at 20:31, Baptiste Daroussin <bapt@FreeBSD.org> wrote:
>=20
> On Fri, Dec 16, 2016 at 01:44:51AM +0000, Conrad E. Meyer wrote:
>> Author: cem
>> Date: Fri Dec 16 01:44:50 2016
>> New Revision: 310138
>> URL: https://svnweb.freebsd.org/changeset/base/310138
>>=20
>> Log:
>>  vfprintf(3): Add support for kernel %b format
>>=20
>>  This is a direct port of the kernel %b format.
>>=20
>>  I'm unclear on if (more) non-portable printf extensions will be a
>>  problem. I think it's desirable to have userspace formats include =
all
>>  kernel formats, but there may be competing goals I'm not aware of.
>>=20
>>  Reviewed by:	no one, unfortunately
>>  Sponsored by:	Dell EMC Isilon
>>  Differential Revision:	https://reviews.freebsd.org/D8426
>>=20
>=20
> I really don't think it is a good idea, if used in userland it would =
be make
> more of our code difficult to port elsewhere.

Indeed, this is a bad idea.  These custom format specifiers should be
eliminated, not multiplied. :-)


> Other than that, it makes more difficult to use vanilla gcc with out =
userland.
> and it is adding more complexity to be able to build freebsd from a =
non freebsd
> system which some people are working on.
>=20
> Personnaly I would prefer to see those extensions removed from the =
kernel rather
> than see them available in userland.

Same here.


> Can't we use simple helper function instead?

Yes, please.  Just take the snprintb(3) function from NetBSD:

http://netbsd.gw.com/cgi-bin/man-cgi?snprintb+3+NetBSD-current

-Dimitry


--Apple-Mail=_9E64CCF0-2511-4CCA-A8A1-2942F1648B83
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

iEYEARECAAYFAlhURj0ACgkQsF6jCi4glqPQsACfYEFD7dxsHbhI6Fvr43NWNIle
AUoAn0cFVTr53CCuI6EszEl8h7SmDclg
=h+m2
-----END PGP SIGNATURE-----

--Apple-Mail=_9E64CCF0-2511-4CCA-A8A1-2942F1648B83--

From owner-svn-src-all@freebsd.org  Fri Dec 16 20:04:57 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2CD1C83721;
 Fri, 16 Dec 2016 20:04:57 +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 C1B321CFC;
 Fri, 16 Dec 2016 20:04:57 +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 uBGK4vLH066987;
 Fri, 16 Dec 2016 20:04:57 GMT (envelope-from jmcneill@FreeBSD.org)
Received: (from jmcneill@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGK4uHI066983;
 Fri, 16 Dec 2016 20:04:56 GMT (envelope-from jmcneill@FreeBSD.org)
Message-Id: <201612162004.uBGK4uHI066983@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to
 jmcneill@FreeBSD.org using -f
From: Jared McNeill <jmcneill@FreeBSD.org>
Date: Fri, 16 Dec 2016 20:04:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310172 - in head/sys/mips: conf ingenic
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 20:04:58 -0000

Author: jmcneill
Date: Fri Dec 16 20:04:56 2016
New Revision: 310172
URL: https://svnweb.freebsd.org/changeset/base/310172

Log:
  Add support for Ingenic JZ4780 SMBus controller.
  
  Reviewed by:		kan
  Relnotes:		yes
  Differential Revision:	https://reviews.freebsd.org/D8793

Added:
  head/sys/mips/ingenic/jz4780_smb.c   (contents, props changed)
  head/sys/mips/ingenic/jz4780_smb.h   (contents, props changed)
Modified:
  head/sys/mips/conf/JZ4780
  head/sys/mips/ingenic/files.jz4780

Modified: head/sys/mips/conf/JZ4780
==============================================================================
--- head/sys/mips/conf/JZ4780	Fri Dec 16 19:49:22 2016	(r310171)
+++ head/sys/mips/conf/JZ4780	Fri Dec 16 20:04:56 2016	(r310172)
@@ -75,6 +75,9 @@ device		ext_resources
 
 device		gpio
 
+device		iicbus
+device		iic
+
 device 		scbus
 device 		da
 

Modified: head/sys/mips/ingenic/files.jz4780
==============================================================================
--- head/sys/mips/ingenic/files.jz4780	Fri Dec 16 19:49:22 2016	(r310171)
+++ head/sys/mips/ingenic/files.jz4780	Fri Dec 16 20:04:56 2016	(r310172)
@@ -4,6 +4,7 @@ mips/ingenic/jz4780_dwc_fdt.c	optional d
 mips/ingenic/jz4780_ehci.c	optional ehci
 mips/ingenic/jz4780_mmc.c	optional mmc
 mips/ingenic/jz4780_ohci.c	optional ohci
+mips/ingenic/jz4780_smb.c	optional iicbus
 mips/ingenic/jz4780_uart.c	optional uart
 
 mips/ingenic/jz4780_clock.c	standard

Added: head/sys/mips/ingenic/jz4780_smb.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/ingenic/jz4780_smb.c	Fri Dec 16 20:04:56 2016	(r310172)
@@ -0,0 +1,480 @@
+/*-
+ * Copyright (c) 2016 Jared McNeill <jmcneill@invisible.ca>
+ * 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$
+ */
+
+/*
+ * Ingenic JZ4780 SMB Controller
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/rman.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/time.h>
+#include <machine/bus.h>
+
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+
+#include <dev/iicbus/iiconf.h>
+#include <dev/iicbus/iicbus.h>
+
+#include <dev/extres/clk/clk.h>
+
+#include <mips/ingenic/jz4780_smb.h>
+
+#include "iicbus_if.h"
+
+#define	JZSMB_TIMEOUT			((300UL * hz) / 1000)
+
+#define	JZSMB_SPEED_STANDARD		100000
+#define	JZSMB_SETUP_TIME_STANDARD	300
+#define	JZSMB_HOLD_TIME_STANDARD	400
+#define	JZSMB_PERIOD_MIN_STANDARD	4000
+#define	JZSMB_PERIOD_MAX_STANDARD	4700
+
+#define	JZSMB_SPEED_FAST		400000
+#define	JZSMB_SETUP_TIME_FAST		450
+#define	JZSMB_HOLD_TIME_FAST		450
+#define	JZSMB_PERIOD_MIN_FAST		600
+#define	JZSMB_PERIOD_MAX_FAST		1300
+
+#define	JZSMB_HCNT_BASE			8
+#define	JZSMB_HCNT_MIN			6
+#define	JZSMB_LCNT_BASE			1
+#define	JZSMB_LCNT_MIN			8
+
+static inline int
+tstohz(const struct timespec *tsp)
+{
+	struct timeval tv;
+
+	TIMESPEC_TO_TIMEVAL(&tv, tsp);
+	return (tvtohz(&tv));
+}
+
+static struct ofw_compat_data compat_data[] = {
+	{ "ingenic,jz4780-i2c",		1 },
+	{ NULL,				0 }
+};
+
+static struct resource_spec jzsmb_spec[] = {
+	{ SYS_RES_MEMORY,	0,	RF_ACTIVE },
+	{ -1, 0 }
+};
+
+struct jzsmb_softc {
+	struct resource	*res;
+	struct mtx	mtx;
+	clk_t		clk;
+	device_t	iicbus;
+	int		busy;
+	uint32_t	i2c_freq;
+	uint64_t	bus_freq;
+	uint32_t	status;
+
+	struct iic_msg	*msg;
+};
+
+#define	SMB_LOCK(sc)			mtx_lock(&(sc)->mtx)
+#define	SMB_UNLOCK(sc)			mtx_unlock(&(sc)->mtx)
+#define	SMB_ASSERT_LOCKED(sc)		mtx_assert(&(sc)->mtx, MA_OWNED)
+#define	SMB_READ(sc, reg)		bus_read_2((sc)->res, (reg))
+#define	SMB_WRITE(sc, reg, val)		bus_write_2((sc)->res, (reg), (val))
+
+static phandle_t
+jzsmb_get_node(device_t bus, device_t dev)
+{
+	return (ofw_bus_get_node(bus));
+}
+
+static int
+jzsmb_enable(struct jzsmb_softc *sc, int enable)
+{
+	SMB_ASSERT_LOCKED(sc);
+
+	if (enable) {
+		SMB_WRITE(sc, SMBENB, SMBENB_SMBENB);
+		while ((SMB_READ(sc, SMBENBST) & SMBENBST_SMBEN) == 0)
+			;
+	} else {
+		SMB_WRITE(sc, SMBENB, 0);
+		while ((SMB_READ(sc, SMBENBST) & SMBENBST_SMBEN) != 0)
+			;
+	}
+
+	return (0);
+}
+
+static int
+jzsmb_reset_locked(device_t dev, u_char addr)
+{
+	struct jzsmb_softc *sc;
+	uint16_t con;
+	uint32_t period;
+	int hcnt, lcnt, setup_time, hold_time;
+
+	sc = device_get_softc(dev);
+
+	SMB_ASSERT_LOCKED(sc);
+
+	/* Setup master mode operation */
+
+	/* Disable SMB */
+	jzsmb_enable(sc, 0);
+
+	/* Disable interrupts */
+	SMB_WRITE(sc, SMBINTM, 0);
+
+	/* Set supported speed mode and expected SCL frequency */
+	period = sc->bus_freq / sc->i2c_freq;
+	con = SMBCON_REST | SMBCON_SLVDIS | SMBCON_MD;
+	switch (sc->i2c_freq) {
+	case JZSMB_SPEED_STANDARD:
+		con |= SMBCON_SPD_STANDARD;
+		setup_time = JZSMB_SETUP_TIME_STANDARD;
+		hold_time = JZSMB_HOLD_TIME_STANDARD;
+		hcnt = (period * JZSMB_PERIOD_MIN_STANDARD) /
+		    (JZSMB_PERIOD_MAX_STANDARD + JZSMB_PERIOD_MIN_STANDARD);
+		lcnt = period - hcnt;
+		hcnt = MAX(hcnt - JZSMB_HCNT_BASE, JZSMB_HCNT_MIN);
+		lcnt = MAX(lcnt - JZSMB_LCNT_BASE, JZSMB_LCNT_MIN);
+		SMB_WRITE(sc, SMBCON, con);
+		SMB_WRITE(sc, SMBSHCNT, hcnt);
+		SMB_WRITE(sc, SMBSLCNT, lcnt);
+		break;
+	case JZSMB_SPEED_FAST:
+		con |= SMBCON_SPD_FAST;
+		setup_time = JZSMB_SETUP_TIME_FAST;
+		hold_time = JZSMB_HOLD_TIME_FAST;
+		hcnt = (period * JZSMB_PERIOD_MIN_FAST) /
+		    (JZSMB_PERIOD_MAX_FAST + JZSMB_PERIOD_MIN_FAST);
+		lcnt = period - hcnt;
+		hcnt = MAX(hcnt - JZSMB_HCNT_BASE, JZSMB_HCNT_MIN);
+		lcnt = MAX(lcnt - JZSMB_LCNT_BASE, JZSMB_LCNT_MIN);
+		SMB_WRITE(sc, SMBCON, con);
+		SMB_WRITE(sc, SMBFHCNT, hcnt);
+		SMB_WRITE(sc, SMBFLCNT, lcnt);
+		break;
+	default:
+		return (EINVAL);
+	}
+
+	setup_time = ((setup_time * sc->bus_freq / 1000) / 1000000) + 1;
+	setup_time = MIN(1, MAX(255, setup_time));
+	SMB_WRITE(sc, SMBSDASU, setup_time);
+
+	hold_time = ((hold_time * sc->bus_freq / 1000) / 1000000) - 1;
+	hold_time = MAX(255, hold_time);
+	if (hold_time >= 0)
+		SMB_WRITE(sc, SMBSDAHD, hold_time | SMBSDAHD_HDENB);
+	else
+		SMB_WRITE(sc, SMBSDAHD, 0);
+
+	SMB_WRITE(sc, SMBTAR, addr >> 1);
+
+	if (addr != 0) {
+		/* Enable SMB */
+		jzsmb_enable(sc, 1);
+	}
+
+	return (0);
+}
+
+static int
+jzsmb_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr)
+{
+	struct jzsmb_softc *sc;
+	int error;
+
+	sc = device_get_softc(dev);
+
+	SMB_LOCK(sc);
+	error = jzsmb_reset_locked(dev, addr);
+	SMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+jzsmb_transfer_read(device_t dev, struct iic_msg *msg)
+{
+	struct jzsmb_softc *sc;
+	struct timespec start, diff;
+	uint16_t con, resid;
+	int timeo;
+
+	sc = device_get_softc(dev);
+	timeo = JZSMB_TIMEOUT * msg->len;
+
+	SMB_ASSERT_LOCKED(sc);
+
+	con = SMB_READ(sc, SMBCON);
+	con |= SMBCON_STPHLD;
+	SMB_WRITE(sc, SMBCON, con);
+
+	getnanouptime(&start);
+	for (resid = msg->len; resid > 0; resid--) {
+		for (int i = 0; i < min(resid, 8); i++)
+			SMB_WRITE(sc, SMBDC, SMBDC_CMD);
+		for (;;) {
+			getnanouptime(&diff);
+			timespecsub(&diff, &start);
+			if ((SMB_READ(sc, SMBST) & SMBST_RFNE) != 0) {
+				msg->buf[msg->len - resid] =
+				    SMB_READ(sc, SMBDC) & SMBDC_DAT;
+				break;
+			} else
+				DELAY(1000);
+
+			if (tstohz(&diff) >= timeo) {
+				device_printf(dev,
+				    "read timeout (status=0x%02x)\n",
+				    SMB_READ(sc, SMBST));
+				return (EIO);
+			}
+		}
+	}
+
+	con = SMB_READ(sc, SMBCON);
+	con &= ~SMBCON_STPHLD;
+	SMB_WRITE(sc, SMBCON, con);
+
+	return (0);
+}
+
+static int
+jzsmb_transfer_write(device_t dev, struct iic_msg *msg, int stop_hold)
+{
+	struct jzsmb_softc *sc;
+	struct timespec start, diff;
+	uint16_t con, resid;
+	int timeo;
+
+	sc = device_get_softc(dev);
+	timeo = JZSMB_TIMEOUT * msg->len;
+
+	SMB_ASSERT_LOCKED(sc);
+
+	con = SMB_READ(sc, SMBCON);
+	con |= SMBCON_STPHLD;
+	SMB_WRITE(sc, SMBCON, con);
+
+	getnanouptime(&start);
+	for (resid = msg->len; resid > 0; resid--) {
+		for (;;) {
+			getnanouptime(&diff);
+			timespecsub(&diff, &start);
+			if ((SMB_READ(sc, SMBST) & SMBST_TFNF) != 0) {
+				SMB_WRITE(sc, SMBDC,
+				    msg->buf[msg->len - resid]);
+				break;
+			} else
+				DELAY((1000 * hz) / JZSMB_TIMEOUT);
+
+			if (tstohz(&diff) >= timeo) {
+				device_printf(dev,
+				    "write timeout (status=0x%02x)\n",
+				    SMB_READ(sc, SMBST));
+				return (EIO);
+			}
+		}
+	}
+
+	if (!stop_hold) {
+		con = SMB_READ(sc, SMBCON);
+		con &= ~SMBCON_STPHLD;
+		SMB_WRITE(sc, SMBCON, con);
+	}
+
+	return (0);
+}
+
+static int
+jzsmb_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
+{
+	struct jzsmb_softc *sc;
+	uint32_t n;
+	uint16_t con;
+	int error;
+
+	sc = device_get_softc(dev);
+
+	SMB_LOCK(sc);
+	while (sc->busy)
+		mtx_sleep(sc, &sc->mtx, 0, "i2cbuswait", 0);
+	sc->busy = 1;
+	sc->status = 0;
+
+	for (n = 0; n < nmsgs; n++) {
+		/* Set target address */
+		if (n == 0 || msgs[n].slave != msgs[n - 1].slave)
+			jzsmb_reset_locked(dev, msgs[n].slave);
+
+		/* Set read or write */
+		if ((msgs[n].flags & IIC_M_RD) != 0)
+			error = jzsmb_transfer_read(dev, &msgs[n]);
+		else
+			error = jzsmb_transfer_write(dev, &msgs[n],
+			    n < nmsgs - 1);
+
+		if (error != 0)
+			goto done;
+	}
+
+done:
+	/* Send stop if necessary */
+	con = SMB_READ(sc, SMBCON);
+	con &= ~SMBCON_STPHLD;
+	SMB_WRITE(sc, SMBCON, con);
+
+	/* Disable SMB */
+	jzsmb_enable(sc, 0);
+
+	sc->msg = NULL;
+	sc->busy = 0;
+	wakeup(sc);
+	SMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+jzsmb_probe(device_t dev)
+{
+	if (!ofw_bus_status_okay(dev))
+		return (ENXIO);
+
+	if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
+		return (ENXIO);
+
+	device_set_desc(dev, "Ingenic JZ4780 SMB Controller");
+
+	return (BUS_PROBE_DEFAULT);
+}
+
+static int
+jzsmb_attach(device_t dev)
+{
+	struct jzsmb_softc *sc;
+	phandle_t node;
+	int error;
+
+	sc = device_get_softc(dev);
+	node = ofw_bus_get_node(dev);
+	mtx_init(&sc->mtx, device_get_nameunit(dev), "jzsmb", MTX_DEF);
+
+	error = clk_get_by_ofw_index(dev, 0, 0, &sc->clk);
+	if (error != 0) {
+		device_printf(dev, "cannot get clock\n");
+		goto fail;
+	}
+	error = clk_enable(sc->clk);
+	if (error != 0) {
+		device_printf(dev, "cannot enable clock\n");
+		goto fail;
+	}
+	error = clk_get_freq(sc->clk, &sc->bus_freq);
+	if (error != 0 || sc->bus_freq == 0) {
+		device_printf(dev, "cannot get bus frequency\n");
+		return (error);
+	}
+
+	if (bus_alloc_resources(dev, jzsmb_spec, &sc->res) != 0) {
+		device_printf(dev, "cannot allocate resources for device\n");
+		error = ENXIO;
+		goto fail;
+	}
+
+	if (OF_getencprop(node, "clock-frequency", &sc->i2c_freq,
+	    sizeof(sc->i2c_freq)) != 0 || sc->i2c_freq == 0)
+		sc->i2c_freq = 100000;	/* Default to standard mode */
+
+	sc->iicbus = device_add_child(dev, "iicbus", -1);
+	if (sc->iicbus == NULL) {
+		device_printf(dev, "cannot add iicbus child device\n");
+		error = ENXIO;
+		goto fail;
+	}
+
+	bus_generic_attach(dev);
+
+	return (0);
+
+fail:
+	bus_release_resources(dev, jzsmb_spec, &sc->res);
+	if (sc->clk != NULL)
+		clk_release(sc->clk);
+	mtx_destroy(&sc->mtx);
+	return (error);
+}
+
+static device_method_t jzsmb_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe,		jzsmb_probe),
+	DEVMETHOD(device_attach,	jzsmb_attach),
+
+	/* Bus interface */
+	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
+	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
+	DEVMETHOD(bus_alloc_resource,	bus_generic_alloc_resource),
+	DEVMETHOD(bus_release_resource,	bus_generic_release_resource),
+	DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+	DEVMETHOD(bus_adjust_resource,	bus_generic_adjust_resource),
+	DEVMETHOD(bus_set_resource,	bus_generic_rl_set_resource),
+	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
+
+	/* OFW methods */
+	DEVMETHOD(ofw_bus_get_node,	jzsmb_get_node),
+
+	/* iicbus interface */
+	DEVMETHOD(iicbus_callback,	iicbus_null_callback),
+	DEVMETHOD(iicbus_reset,		jzsmb_reset),
+	DEVMETHOD(iicbus_transfer,	jzsmb_transfer),
+
+	DEVMETHOD_END
+};
+
+static driver_t jzsmb_driver = {
+	"iichb",
+	jzsmb_methods,
+	sizeof(struct jzsmb_softc),
+};
+
+static devclass_t jzsmb_devclass;
+
+EARLY_DRIVER_MODULE(iicbus, jzsmb, iicbus_driver, iicbus_devclass, 0, 0,
+    BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE);
+EARLY_DRIVER_MODULE(jzsmb, simplebus, jzsmb_driver, jzsmb_devclass, 0, 0,
+    BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE);
+MODULE_VERSION(jzsmb, 1);

Added: head/sys/mips/ingenic/jz4780_smb.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/ingenic/jz4780_smb.h	Fri Dec 16 20:04:56 2016	(r310172)
@@ -0,0 +1,98 @@
+/*-
+ * Copyright (c) 2016 Jared McNeill <jmcneill@invisible.ca>
+ * 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$
+ */
+
+/*
+ * Ingenic JZ4780 SMB Controller
+ */
+
+#ifndef __JZ4780_SMB_H__
+#define __JZ4780_SMB_H__
+
+#define	SMBCON			0x00
+#define	 SMBCON_STPHLD		(1 << 7)
+#define	 SMBCON_SLVDIS		(1 << 6)
+#define	 SMBCON_REST		(1 << 5)
+#define	 SMBCON_MATP		(1 << 4)
+#define	 SMBCON_SATP		(1 << 3)
+#define	 SMBCON_SPD		(3 << 1)
+#define	 SMBCON_SPD_STANDARD	(1 << 1)
+#define	 SMBCON_SPD_FAST	(2 << 1)
+#define	 SMBCON_MD		(1 << 0)
+#define	SMBTAR			0x04
+#define	 SMBTAR_MATP		(1 << 12)
+#define	 SMBTAR_SPECIAL		(1 << 11)
+#define	 SMBTAR_GC_OR_START	(1 << 10)
+#define	 SMBTAR_SMBTAR		(0x3ff << 0)
+#define	SMBSAR			0x08
+#define	SMBDC			0x10
+#define	 SMBDC_CMD		(1 << 8)
+#define	 SMBDC_DAT		(0xff << 0)
+#define	SMBSHCNT		0x14
+#define	SMBSLCNT		0x18
+#define	SMBFHCNT		0x1c
+#define	SMBFLCNT		0x20
+#define	SMBINTST		0x2c
+#define	SMBINTM			0x30
+#define	SMBRXTL			0x38
+#define	SMBTXTL			0x3c
+#define	SMBCINT			0x40
+#define	SMBCRXUF		0x44
+#define	SMBCRXOF		0x48
+#define	SMBCTXOF		0x4c
+#define	SMBCRXREQ		0x50
+#define	SMBCTXABT		0x54
+#define	SMBCRXDN		0x58
+#define	SMBCACT			0x5c
+#define	SMBCSTP			0x60
+#define	SMBCSTT			0x64
+#define	SMBCGC			0x68
+#define	SMBENB			0x6c
+#define	 SMBENB_SMBENB		(1 << 0)
+#define	SMBST			0x70
+#define	 SMBST_SLVACT		(1 << 6)
+#define	 SMBST_MSTACT		(1 << 5)
+#define	 SMBST_RFF		(1 << 4)
+#define	 SMBST_RFNE		(1 << 3)
+#define	 SMBST_TFE		(1 << 2)
+#define	 SMBST_TFNF		(1 << 1)
+#define	 SMBST_ACT		(1 << 0)
+#define	SMBABTSRC		0x80
+#define	SMBDMACR		0x88
+#define	SMBDMATDLR		0x8c
+#define	SMBDMARDLR		0x90
+#define	SMBSDASU		0x94
+#define	SMBACKGC		0x98
+#define	SMBENBST		0x9c
+#define	 SMBENBST_SLVRDLST	(1 << 2)
+#define	 SMBENBST_SLVDISB	(1 << 1)
+#define	 SMBENBST_SMBEN		(1 << 0)
+#define	SMBSDAHD		0xd0		
+#define	 SMBSDAHD_HDENB		(1 << 8)
+#define	 SMBSDAHD_SDAHD		(0xff << 0)
+
+#endif /* !__JZ4780_SMB_H__ */

From owner-svn-src-all@freebsd.org  Fri Dec 16 20:07:17 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B62EFC837A6
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Fri, 16 Dec 2016 20:07:17 +0000 (UTC) (envelope-from ian@freebsd.org)
Received: from pmta2.delivery6.ore.mailhop.org
 (pmta2.delivery6.ore.mailhop.org [54.200.129.228])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 900581EAF
 for <svn-src-all@freebsd.org>; Fri, 16 Dec 2016 20:07:17 +0000 (UTC)
 (envelope-from ian@freebsd.org)
X-MHO-User: 3ed95f45-c3cb-11e6-acc0-c7e6c9ad01d6
X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information
X-Originating-IP: 73.78.92.27
X-Mail-Handler: DuoCircle Outbound SMTP
Received: from ilsoft.org (unknown [73.78.92.27])
 by outbound2.ore.mailhop.org (Halon) with ESMTPSA
 id 3ed95f45-c3cb-11e6-acc0-c7e6c9ad01d6;
 Fri, 16 Dec 2016 20:07:18 +0000 (UTC)
Received: from rev (rev [172.22.42.240])
 by ilsoft.org (8.15.2/8.15.2) with ESMTP id uBGK7EsU004151;
 Fri, 16 Dec 2016 13:07:14 -0700 (MST) (envelope-from ian@freebsd.org)
Message-ID: <1481918834.1972.77.camel@freebsd.org>
Subject: Re: svn commit: r310138 - head/lib/libc/stdio
From: Ian Lepore <ian@freebsd.org>
To: Baptiste Daroussin <bapt@FreeBSD.org>, "Conrad E. Meyer" <cem@FreeBSD.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Date: Fri, 16 Dec 2016 13:07:14 -0700
In-Reply-To: <20161216193128.wgskqt4vc44vdd7o@ivaldir.etoilebsd.net>
References: <201612160144.uBG1ipjW016736@repo.freebsd.org>
 <20161216193128.wgskqt4vc44vdd7o@ivaldir.etoilebsd.net>
Content-Type: text/plain; charset="ISO-8859-1"
X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port 
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 20:07:17 -0000

On Fri, 2016-12-16 at 20:31 +0100, Baptiste Daroussin wrote:
> On Fri, Dec 16, 2016 at 01:44:51AM +0000, Conrad E. Meyer wrote:
> > 
> > Author: cem
> > Date: Fri Dec 16 01:44:50 2016
> > New Revision: 310138
> > URL: https://svnweb.freebsd.org/changeset/base/310138
> > 
> > Log:
> >   vfprintf(3): Add support for kernel %b format
> >   
> >   This is a direct port of the kernel %b format.
> >   
> >   I'm unclear on if (more) non-portable printf extensions will be a
> >   problem. I think it's desirable to have userspace formats include
> > all
> >   kernel formats, but there may be competing goals I'm not aware
> > of.
> >   
> >   Reviewed by:	no one, unfortunately
> >   Sponsored by:	Dell EMC Isilon
> >   Differential Revision:	https://reviews.freebsd.org/D8426
> > 
> I really don't think it is a good idea, if used in userland it would
> be make
> more of our code difficult to port elsewhere.
> 
> Other than that, it makes more difficult to use vanilla gcc with out
> userland.
> and it is adding more complexity to be able to build freebsd from a
> non freebsd
> system which some people are working on.
> 
> Personnaly I would prefer to see those extensions removed from the
> kernel rather
> than see them available in userland.
> 
> Can't we use simple helper function instead?
> 
> Best regards,
> Bapt

I'll add a big +1 for the concept of eliminating the extensions from
the kernel instead of extending them to userland.  People ask why
freebsd can't be built using standard tools on foreign build hosts, and
these non-standard extensions are part of the reason why.

-- Ian


From owner-svn-src-all@freebsd.org  Fri Dec 16 20:10:57 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BB70C838D5;
 Fri, 16 Dec 2016 20:10:57 +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 2C8B02D3;
 Fri, 16 Dec 2016 20:10:57 +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 uBGKAu2Z067235;
 Fri, 16 Dec 2016 20:10:56 GMT (envelope-from asomers@FreeBSD.org)
Received: (from asomers@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGKAtxr067229;
 Fri, 16 Dec 2016 20:10:55 GMT (envelope-from asomers@FreeBSD.org)
Message-Id: <201612162010.uBGKAtxr067229@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: asomers set sender to
 asomers@FreeBSD.org using -f
From: Alan Somers <asomers@FreeBSD.org>
Date: Fri, 16 Dec 2016 20:10:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310173 - in stable/10: lib/libutil usr.sbin/pw
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 20:10:57 -0000

Author: asomers
Date: Fri Dec 16 20:10:55 2016
New Revision: 310173
URL: https://svnweb.freebsd.org/changeset/base/310173

Log:
  MFC r308806
  
  Speed up pw operations that edit /etc/group or /etc/passwd
  
  r285050 fixed a bug in pw that could lead to /etc/passwd or /etc/group
  corruption on power loss. However, it fixed it by opening those files with
  O_SYNC, which is very slow, especially on ZFS. This change replaces O_SYNC
  with appropriately placed fsync()s instead, which is much faster. Using a
  ZFS tmpdir, the time to run pw's kyua tests drops from 245s to 35s.

Modified:
  stable/10/lib/libutil/gr_util.c
  stable/10/lib/libutil/pw_util.c
  stable/10/usr.sbin/pw/grupd.c
  stable/10/usr.sbin/pw/pw_nis.c
  stable/10/usr.sbin/pw/pwupd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libutil/gr_util.c
==============================================================================
--- stable/10/lib/libutil/gr_util.c	Fri Dec 16 20:04:56 2016	(r310172)
+++ stable/10/lib/libutil/gr_util.c	Fri Dec 16 20:10:55 2016	(r310173)
@@ -141,7 +141,7 @@ gr_tmp(int mfd)
 		errno = ENAMETOOLONG;
 		return (-1);
 	}
-	if ((tfd = mkostemp(tempname, O_SYNC)) == -1)
+	if ((tfd = mkostemp(tempname, 0)) == -1)
 		return (-1);
 	if (mfd != -1) {
 		while ((nr = read(mfd, buf, sizeof(buf))) > 0)

Modified: stable/10/lib/libutil/pw_util.c
==============================================================================
--- stable/10/lib/libutil/pw_util.c	Fri Dec 16 20:04:56 2016	(r310172)
+++ stable/10/lib/libutil/pw_util.c	Fri Dec 16 20:10:55 2016	(r310173)
@@ -226,7 +226,7 @@ pw_tmp(int mfd)
 		errno = ENAMETOOLONG;
 		return (-1);
 	}
-	if ((tfd = mkostemp(tempname, O_SYNC)) == -1)
+	if ((tfd = mkostemp(tempname, 0)) == -1)
 		return (-1);
 	if (mfd != -1) {
 		while ((nr = read(mfd, buf, sizeof(buf))) > 0)

Modified: stable/10/usr.sbin/pw/grupd.c
==============================================================================
--- stable/10/usr.sbin/pw/grupd.c	Fri Dec 16 20:04:56 2016	(r310172)
+++ stable/10/usr.sbin/pw/grupd.c	Fri Dec 16 20:10:55 2016	(r310173)
@@ -77,6 +77,7 @@ gr_update(struct group * grp, char const
 		close(tfd);
 		err(1, "gr_copy()");
 	}
+	fsync(tfd);
 	close(tfd);
 	if (gr_mkdb() == -1) {
 		gr_fini();

Modified: stable/10/usr.sbin/pw/pw_nis.c
==============================================================================
--- stable/10/usr.sbin/pw/pw_nis.c	Fri Dec 16 20:04:56 2016	(r310172)
+++ stable/10/usr.sbin/pw/pw_nis.c	Fri Dec 16 20:10:55 2016	(r310173)
@@ -67,6 +67,7 @@ pw_nisupdate(const char * path, struct p
 		close(tfd);
 		err(1, "pw_copy()");
 	}
+	fsync(tfd);
 	close(tfd);
 	if (chmod(pw_tempname(), 0644) == -1)
 		err(1, "chmod()");

Modified: stable/10/usr.sbin/pw/pwupd.c
==============================================================================
--- stable/10/usr.sbin/pw/pwupd.c	Fri Dec 16 20:04:56 2016	(r310172)
+++ stable/10/usr.sbin/pw/pwupd.c	Fri Dec 16 20:10:55 2016	(r310173)
@@ -114,6 +114,7 @@ pw_update(struct passwd * pwd, char cons
 		close(tfd);
 		err(1, "pw_copy()");
 	}
+	fsync(tfd);
 	close(tfd);
 	/*
 	 * in case of deletion of a user, the whole database

From owner-svn-src-all@freebsd.org  Fri Dec 16 20:24:49 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6BD7C82179;
 Fri, 16 Dec 2016 20:24:49 +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 7976D10C1;
 Fri, 16 Dec 2016 20:24:49 +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 uBGKOmB4075596;
 Fri, 16 Dec 2016 20:24:48 GMT (envelope-from ken@FreeBSD.org)
Received: (from ken@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGKOm8i075589;
 Fri, 16 Dec 2016 20:24:48 GMT (envelope-from ken@FreeBSD.org)
Message-Id: <201612162024.uBGKOm8i075589@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org
 using -f
From: "Kenneth D. Merry" <ken@FreeBSD.org>
Date: Fri, 16 Dec 2016 20:24:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310174 - in stable/11: sbin/camcontrol sys/cam/scsi
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 20:24:49 -0000

Author: ken
Date: Fri Dec 16 20:24:47 2016
New Revision: 310174
URL: https://svnweb.freebsd.org/changeset/base/310174

Log:
  MFC r309374, r309513, r309839, r309840:
  
    ------------------------------------------------------------------------
    r309374 | ken | 2016-12-01 15:20:27 -0700 (Thu, 01 Dec 2016) | 41 lines
  
    Add SCSI REPORT TIMESTAMP and SET TIMESTAMP support.
  
    This adds support to camcontrol(8) and libcam(3) for getting and setting
    the time on SCSI protocol drives.  This is more commonly found on tape
    drives, but is a SPC (SCSI Primary Commands) command, and may be found
    on any device that speaks SCSI.
  
    The new camcontrol timestamp subcommand allows getting the current device
    time or setting the time to the current system time or any arbitrary time.
  
    sbin/camcontrol/Makefile:
    	Add timestamp.c.
  
    sbin/camcontrol/camcontrol.8:
    	Document the new timestamp subcommand.
  
    sbin/camcontrol/camcontrol.c:
    	Add the timestamp subcommand to camcontrol.
  
    sbin/camcontrol/camcontrol.h:
    	Add the timestamp() function prototype.
  
    sbin/camcontrol/timestamp.c:
    	Timestamp setting and reporting functionality.
  
    sys/cam/scsi/scsi_all.c:
    	Add two new CCB building functions, scsi_set_timestamp() and
    	scsi_report_timestamp().  Also, add a new helper function,
    	scsi_create_timestamp().
  
    sys/cam/scsi/scsi_all.h:
    	Add CDB and parameter data for the the set and report timestamp
    	commands.
  
    	Add function declarations for the new CCB building and helper
    	functions.
  
    Submitted by:	Sam Klopsch
    Sponsored by:	Spectra Logic
  
    ------------------------------------------------------------------------
    r309513 | adrian | 2016-12-03 13:35:39 -0700 (Sat, 03 Dec 2016) | 7 lines
  
    [camcontrol] init ts=0 to quieten gcc.
  
    It "looks" like ts is set to something on success, and not modified on
    error.
  
    Checked on IRC with: cem
  
    ------------------------------------------------------------------------
    r309839 | ngie | 2016-12-10 16:26:34 -0700 (Sat, 10 Dec 2016) | 6 lines
  
    free/NULL out variables prior to calling strdup to avoid leaking memory
    if arguments are specified more than once with "camcontrol timestamp".
  
    CID:		1366829, 1366831
  
    ------------------------------------------------------------------------
    r309840 | ngie | 2016-12-10 16:58:14 -0700 (Sat, 10 Dec 2016) | 8 lines
  
    Cut to the chase and just call free instead of free(x) + x = NULL
  
    NULLing out x wasn't required as the memory was immediately scribbled
    over with strdup in the following call.
  
    Submitted by:	imp
  
    ------------------------------------------------------------------------

Added:
  stable/11/sbin/camcontrol/timestamp.c
     - copied, changed from r309374, head/sbin/camcontrol/timestamp.c
Modified:
  stable/11/sbin/camcontrol/Makefile
  stable/11/sbin/camcontrol/camcontrol.8
  stable/11/sbin/camcontrol/camcontrol.c
  stable/11/sbin/camcontrol/camcontrol.h
  stable/11/sys/cam/scsi/scsi_all.c
  stable/11/sys/cam/scsi/scsi_all.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/camcontrol/Makefile
==============================================================================
--- stable/11/sbin/camcontrol/Makefile	Fri Dec 16 20:10:55 2016	(r310173)
+++ stable/11/sbin/camcontrol/Makefile	Fri Dec 16 20:24:47 2016	(r310174)
@@ -4,7 +4,7 @@ PACKAGE=runtime
 PROG=	camcontrol
 SRCS=	camcontrol.c util.c
 .if !defined(RELEASE_CRUNCH)
-SRCS+=	attrib.c epc.c fwdownload.c modeedit.c persist.c progress.c zone.c
+SRCS+=	attrib.c epc.c fwdownload.c modeedit.c persist.c progress.c timestamp.c zone.c
 .else
 CFLAGS+= -DMINIMALISTIC
 .endif

Modified: stable/11/sbin/camcontrol/camcontrol.8
==============================================================================
--- stable/11/sbin/camcontrol/camcontrol.8	Fri Dec 16 20:10:55 2016	(r310173)
+++ stable/11/sbin/camcontrol/camcontrol.8	Fri Dec 16 20:24:47 2016	(r310174)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 16, 2016
+.Dd November 30, 2016
 .Dt CAMCONTROL 8
 .Os
 .Sh NAME
@@ -343,6 +343,11 @@
 .Op Fl S Ar power_src
 .Op Fl T Ar timer
 .Nm
+.Ic timestamp
+.Op device id
+.Op generic args
+.Ao Fl r Oo Ns Fl f Ar format | Fl m | Fl U Oc | Fl s Ao Fl f Ar format Fl T Ar time | Fl U Ac Ac
+.Nm
 .Ic help
 .Sh DESCRIPTION
 The
@@ -2417,6 +2422,54 @@ supports, and a number of parameters abo
 whether it is enabled and what the timer value is.
 .El
 .El
+.It Ic timestamp
+Issue REPORT TIMESTAMP or SET TIMESTAMP
+.Tn SCSI
+commands. Either the
+.Fl r
+option or the
+.Fl s
+option must be specified.
+.Bl -tag -width 6n
+.It Fl r
+Report the device's timestamp.
+If no more arguments are specified, the timestamp will be reported using
+the national representation of the date and time, followed by the time
+zone.
+.Bl -tag -width 9n
+.It Fl f Ar format
+Specify the strftime format string, as documented in strftime(3), to be used
+to format the reported timestamp.
+.It Fl m
+Report the timestamp as milliseconds since the epoch.
+.It Fl U
+Report the timestamp using the national representation of the date and
+time, but override the system time zone and use UTC instead.
+.El
+.El
+.Bl -tag -width 6n
+.It Fl s
+Set the device's timestamp. Either the
+.Fl f
+and 
+.Fl T
+options or the
+.Fl U
+option must be specified.
+.Bl -tag -width 9n
+.It Fl f Ar format
+Specify the strptime format string, as documented in strptime(3).
+The time must also be specified with the
+.Fl T 
+option.
+.It Fl T
+Provide the time in the format specified with the
+.Fl f
+option.
+.It Fl U
+Set the timestamp to the host system's time in UTC.
+.El
+.El
 .It Ic help
 Print out verbose usage information.
 .El
@@ -2730,6 +2783,18 @@ camcontrol epc ada0 -c list
 Display the ATA Power Conditions log (Log Address 0x08) for
 drive
 .Pa ada0 .
+.Pp
+.Bd -literal -offset indent
+camcontrol timestamp sa0 -s -f "%A %c" \e
+	-T "Wednesday Wed Oct 26 21:43:57 2016"
+.Ed
+.Pp
+Set the timestamp of drive
+.Pa sa0
+using a
+.Xr strptime 3 
+format string followed by a time string
+that was created using this format string.
 .Sh SEE ALSO
 .Xr cam 3 ,
 .Xr cam_cdbparse 3 ,

Modified: stable/11/sbin/camcontrol/camcontrol.c
==============================================================================
--- stable/11/sbin/camcontrol/camcontrol.c	Fri Dec 16 20:10:55 2016	(r310173)
+++ stable/11/sbin/camcontrol/camcontrol.c	Fri Dec 16 20:24:47 2016	(r310174)
@@ -103,7 +103,8 @@ typedef enum {
 	CAM_CMD_OPCODES		= 0x00000024,
 	CAM_CMD_REPROBE		= 0x00000025,
 	CAM_CMD_ZONE		= 0x00000026,
-	CAM_CMD_EPC		= 0x00000027
+	CAM_CMD_EPC		= 0x00000027,
+	CAM_CMD_TIMESTAMP	= 0x00000028
 } cam_cmdmask;
 
 typedef enum {
@@ -234,6 +235,7 @@ static struct camcontrol_opts option_tab
 	{"opcodes", CAM_CMD_OPCODES, CAM_ARG_NONE, "No:s:T"},
 	{"zone", CAM_CMD_ZONE, CAM_ARG_NONE, "ac:l:No:P:"},
 	{"epc", CAM_CMD_EPC, CAM_ARG_NONE, "c:dDeHp:Pr:sS:T:"},
+	{"timestamp", CAM_CMD_TIMESTAMP, CAM_ARG_NONE, "f:mrsUT:"},
 #endif /* MINIMALISTIC */
 	{"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
 	{"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
@@ -8922,6 +8924,9 @@ usage(int printlong)
 "        camcontrol epc        [dev_id][generic_args]<-c cmd> [-d] [-D] [-e]\n"
 "                              [-H] [-p power_cond] [-P] [-r rst_src] [-s]\n"
 "                              [-S power_src] [-T timer]\n"
+"        camcontrol timestamp  [dev_id][generic_args] <-r [-f format|-m|-U]>|\n"
+"                              <-s <-f format -T time | -U >>\n"
+"                              \n"
 #endif /* MINIMALISTIC */
 "        camcontrol help\n");
 	if (!printlong)
@@ -8966,6 +8971,7 @@ usage(int printlong)
 "opcodes     send the SCSI REPORT SUPPORTED OPCODES command\n"
 "zone        manage Zoned Block (Shingled) devices\n"
 "epc         send ATA Extended Power Conditions commands\n"
+"timestamp   report or set the device's timestamp\n"
 "help        this message\n"
 "Device Identifiers:\n"
 "bus:target        specify the bus and target, lun defaults to 0\n"
@@ -9157,6 +9163,17 @@ usage(int printlong)
 "-s                save mode (timer, state, restore)\n"
 "-S power_src      set power source: battery, nonbattery (source)\n"
 "-T timer          set timer, seconds, .1 sec resolution (timer)\n"
+"timestamp arguments:\n"
+"-r                report the timestamp of the device\n"
+"-f format         report the timestamp of the device with the given\n"
+"                  strftime(3) format string\n"
+"-m                report the timestamp of the device as milliseconds since\n"
+"                  January 1st, 1970\n"
+"-U                report the time with UTC instead of the local time zone\n"
+"-s                set the timestamp of the device\n"
+"-f format         the format of the time string passed into strptime(3)\n"
+"-T time           the time value passed into strptime(3)\n"
+"-U                set the timestamp of the device to UTC time\n"
 );
 #endif /* MINIMALISTIC */
 }
@@ -9520,6 +9537,10 @@ main(int argc, char **argv)
 			error = epc(cam_dev, argc, argv, combinedopt,
 			    retry_count, timeout, arglist & CAM_ARG_VERBOSE);
 			break;
+		case CAM_CMD_TIMESTAMP:
+			error = timestamp(cam_dev, argc, argv, combinedopt,
+			    retry_count, timeout, arglist & CAM_ARG_VERBOSE);
+			break;
 #endif /* MINIMALISTIC */
 		case CAM_CMD_USAGE:
 			usage(1);

Modified: stable/11/sbin/camcontrol/camcontrol.h
==============================================================================
--- stable/11/sbin/camcontrol/camcontrol.h	Fri Dec 16 20:10:55 2016	(r310173)
+++ stable/11/sbin/camcontrol/camcontrol.h	Fri Dec 16 20:24:47 2016	(r310174)
@@ -81,6 +81,9 @@ int zone(struct cam_device *device, int 
 	 int retry_count, int timeout, int verbosemode);
 int epc(struct cam_device *device, int argc, char **argv, char *combinedopt,
 	int retry_count, int timeout, int verbosemode);
+int timestamp(struct cam_device *device, int argc, char **argv,
+	      char *combinedopt, int retry_count, int timeout,
+	      int verbosemode);
 void mode_sense(struct cam_device *device, int mode_page, int page_control,
 		int dbd, int retry_count, int timeout, u_int8_t *data,
 		int datalen);

Copied and modified: stable/11/sbin/camcontrol/timestamp.c (from r309374, head/sbin/camcontrol/timestamp.c)
==============================================================================
--- head/sbin/camcontrol/timestamp.c	Thu Dec  1 22:20:27 2016	(r309374, copy source)
+++ stable/11/sbin/camcontrol/timestamp.c	Fri Dec 16 20:24:47 2016	(r310174)
@@ -328,7 +328,7 @@ timestamp(struct cam_device *device, int
 	  int retry_count, int timeout, int verbosemode __unused)
 {
 	int c;
-	uint64_t ts;
+	uint64_t ts = 0;
 	char *format_string = NULL;
 	char *timestamp_string = NULL;
 	int action = -1;
@@ -358,6 +358,7 @@ timestamp(struct cam_device *device, int
 		}
 		case 'f': {
 			single_arg++;
+			free(format_string);
 			format_string = strdup(optarg);
 			if (format_string == NULL) {
 				warn("Error allocating memory for format "
@@ -369,6 +370,7 @@ timestamp(struct cam_device *device, int
 		}
 		case 'm': {
 			single_arg++;
+			free(format_string);
 			format_string = strdup(MIL);
 			if (format_string == NULL) {
 				warn("Error allocating memory");
@@ -382,6 +384,7 @@ timestamp(struct cam_device *device, int
 			break;
 		}
 		case 'T':
+			free(timestamp_string);
 			timestamp_string = strdup(optarg);
 			if (timestamp_string == NULL) {
 				warn("Error allocating memory for format "

Modified: stable/11/sys/cam/scsi/scsi_all.c
==============================================================================
--- stable/11/sys/cam/scsi/scsi_all.c	Fri Dec 16 20:10:55 2016	(r310173)
+++ stable/11/sys/cam/scsi/scsi_all.c	Fri Dec 16 20:24:47 2016	(r310174)
@@ -7947,6 +7947,32 @@ scsi_report_target_group(struct ccb_scsi
 }
 
 void
+scsi_report_timestamp(struct ccb_scsiio *csio, u_int32_t retries,
+		 void (*cbfcnp)(struct cam_periph *, union ccb *),
+		 u_int8_t tag_action, u_int8_t pdf,
+		 void *buf, u_int32_t alloc_len,
+		 u_int8_t sense_len, u_int32_t timeout)
+{
+	struct scsi_timestamp *scsi_cmd;
+
+	cam_fill_csio(csio,
+		      retries,
+		      cbfcnp,
+		      /*flags*/CAM_DIR_IN,
+		      tag_action,
+		      /*data_ptr*/(u_int8_t *)buf,
+		      /*dxfer_len*/alloc_len,
+		      sense_len,
+		      sizeof(*scsi_cmd),
+		      timeout);
+	scsi_cmd = (struct scsi_timestamp *)&csio->cdb_io.cdb_bytes;
+	bzero(scsi_cmd, sizeof(*scsi_cmd));
+	scsi_cmd->opcode = MAINTENANCE_IN;
+	scsi_cmd->service_action = REPORT_TIMESTAMP | pdf;
+	scsi_ulto4b(alloc_len, scsi_cmd->length);
+}
+
+void
 scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries,
 		 void (*cbfcnp)(struct cam_periph *, union ccb *),
 		 u_int8_t tag_action, void *buf, u_int32_t alloc_len,
@@ -7971,6 +7997,45 @@ scsi_set_target_group(struct ccb_scsiio 
 	scsi_ulto4b(alloc_len, scsi_cmd->length);
 }
 
+void
+scsi_create_timestamp(uint8_t *timestamp_6b_buf,
+		      uint64_t timestamp)
+{
+	uint8_t buf[8];
+	scsi_u64to8b(timestamp, buf);
+	/*
+	 * Using memcopy starting at buf[2] because the set timestamp parameters
+	 * only has six bytes for the timestamp to fit into, and we don't have a
+	 * scsi_u64to6b function.
+	 */
+	memcpy(timestamp_6b_buf, &buf[2], 6);
+}
+
+void
+scsi_set_timestamp(struct ccb_scsiio *csio, u_int32_t retries,
+		   void (*cbfcnp)(struct cam_periph *, union ccb *),
+		   u_int8_t tag_action, void *buf, u_int32_t alloc_len,
+		   u_int8_t sense_len, u_int32_t timeout)
+{
+	struct scsi_timestamp *scsi_cmd;
+
+	cam_fill_csio(csio,
+		      retries,
+		      cbfcnp,
+		      /*flags*/CAM_DIR_OUT,
+		      tag_action,
+		      /*data_ptr*/(u_int8_t *) buf,
+		      /*dxfer_len*/alloc_len,
+		      sense_len,
+		      sizeof(*scsi_cmd),
+		      timeout);
+	scsi_cmd = (struct scsi_timestamp *)&csio->cdb_io.cdb_bytes;
+	bzero(scsi_cmd, sizeof(*scsi_cmd));
+	scsi_cmd->opcode = MAINTENANCE_OUT;
+	scsi_cmd->service_action = SET_TIMESTAMP;
+	scsi_ulto4b(alloc_len, scsi_cmd->length);
+}
+
 /*
  * Syncronize the media to the contents of the cache for
  * the given lba/count pair.  Specifying 0/0 means sync

Modified: stable/11/sys/cam/scsi/scsi_all.h
==============================================================================
--- stable/11/sys/cam/scsi/scsi_all.h	Fri Dec 16 20:10:55 2016	(r310173)
+++ stable/11/sys/cam/scsi/scsi_all.h	Fri Dec 16 20:24:47 2016	(r310174)
@@ -702,7 +702,9 @@ struct scsi_control_page {
 
 struct scsi_control_ext_page {
 	uint8_t page_code;
+#define SCEP_PAGE_CODE			0x0a
 	uint8_t subpage_code;
+#define SCEP_SUBPAGE_CODE		0x01
 	uint8_t page_length[2];
 	uint8_t flags;
 #define	SCEP_TCMOS			0x04	/* Timestamp Changeable by */
@@ -2971,6 +2973,31 @@ struct scsi_target_group
 	uint8_t control;
 };
 
+struct scsi_timestamp
+{
+	uint8_t opcode;
+	uint8_t service_action;
+	uint8_t reserved1[4];
+	uint8_t length[4];
+	uint8_t reserved2;
+	uint8_t control;
+};
+
+struct scsi_set_timestamp_parameters
+{
+	uint8_t reserved1[4];
+	uint8_t timestamp[6];
+	uint8_t reserved2[4];
+};
+
+struct scsi_report_timestamp_parameter_data
+{
+	uint8_t length[2];
+	uint8_t reserved1[2];
+	uint8_t timestamp[6];
+	uint8_t reserved2[2];
+};
+
 struct scsi_target_port_descriptor {
 	uint8_t	reserved[2];
 	uint8_t	relative_target_port_identifier[2];
@@ -3966,12 +3993,29 @@ void		scsi_report_target_group(struct cc
 				 u_int32_t alloc_len, u_int8_t sense_len,
 				 u_int32_t timeout);
 
+void		scsi_report_timestamp(struct ccb_scsiio *csio, u_int32_t retries,
+				 void (*cbfcnp)(struct cam_periph *, 
+				 union ccb *), u_int8_t tag_action, 
+				 u_int8_t pdf,
+				 void *buf,
+				 u_int32_t alloc_len, u_int8_t sense_len,
+				 u_int32_t timeout);
+
 void		scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries,
 				 void (*cbfcnp)(struct cam_periph *, 
 				 union ccb *), u_int8_t tag_action, void *buf,
 				 u_int32_t alloc_len, u_int8_t sense_len,
 				 u_int32_t timeout);
 
+void		scsi_create_timestamp(uint8_t *timestamp_6b_buf,
+				      uint64_t timestamp);
+
+void		scsi_set_timestamp(struct ccb_scsiio *csio, u_int32_t retries,
+				   void (*cbfcnp)(struct cam_periph *, 
+				   union ccb *), u_int8_t tag_action,
+				   void *buf, u_int32_t alloc_len,
+				   u_int8_t sense_len, u_int32_t timeout);
+
 void		scsi_synchronize_cache(struct ccb_scsiio *csio, 
 				       u_int32_t retries,
 				       void (*cbfcnp)(struct cam_periph *, 

From owner-svn-src-all@freebsd.org  Fri Dec 16 20:33:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A751AC8244F;
 Fri, 16 Dec 2016 20:33:33 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from mail.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 882D21777;
 Fri, 16 Dec 2016 20:33:33 +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 mail.baldwin.cx (Postfix) with ESMTPSA id 66CB410AA5E;
 Fri, 16 Dec 2016 15:33:32 -0500 (EST)
From: John Baldwin <jhb@freebsd.org>
To: Nikolai Lifanov <lifanov@freebsd.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r310160 - head
Date: Fri, 16 Dec 2016 12:12:38 -0800
Message-ID: <21230839.nOEshPjK7Y@ralph.baldwin.cx>
User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; )
In-Reply-To: <201612161744.uBGHiv3Q009878@repo.freebsd.org>
References: <201612161744.uBGHiv3Q009878@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.4.3
 (mail.baldwin.cx); Fri, 16 Dec 2016 15:33:32 -0500 (EST)
X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx
X-Virus-Status: Clean
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 20:33:33 -0000

On Friday, December 16, 2016 05:44:57 PM Nikolai Lifanov wrote:
> Author: lifanov (ports committer)
> Date: Fri Dec 16 17:44:56 2016
> New Revision: 310160
> URL: https://svnweb.freebsd.org/changeset/base/310160
> 
> Log:
>   retain cc.4.gz man page for Chelsio T6 NICs
>   
>   This man page was removed in r225583 when cc.4 was renamed to mod_cc.4
>   With reintroduction of cc.4 "make installworld; make delete-old" was
>   no longer convergent.

Please MFC to 10 and 11 since cc(4) is now present there as well.

-- 
John Baldwin

From owner-svn-src-all@freebsd.org  Fri Dec 16 20:44:16 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36C40C82683;
 Fri, 16 Dec 2016 20:44:16 +0000 (UTC) (envelope-from gnn@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 061551C36;
 Fri, 16 Dec 2016 20:44:15 +0000 (UTC) (envelope-from gnn@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBGKiFwp083544;
 Fri, 16 Dec 2016 20:44:15 GMT (envelope-from gnn@FreeBSD.org)
Received: (from gnn@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGKiFn0083543;
 Fri, 16 Dec 2016 20:44:15 GMT (envelope-from gnn@FreeBSD.org)
Message-Id: <201612162044.uBGKiFn0083543@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org
 using -f
From: "George V. Neville-Neil" <gnn@FreeBSD.org>
Date: Fri, 16 Dec 2016 20:44:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310175 - head/sys/cddl/contrib/opensolaris/uts/common/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 20:44:16 -0000

Author: gnn
Date: Fri Dec 16 20:44:14 2016
New Revision: 310175
URL: https://svnweb.freebsd.org/changeset/base/310175

Log:
  Remove extra DOF_SEC_XLIMPORT from the DOF_SEC_ISLOADABLE macro
  
  MFC after:	2 weeks
  Sponsored by:	DARPA, AFRL

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h	Fri Dec 16 20:24:47 2016	(r310174)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h	Fri Dec 16 20:44:14 2016	(r310175)
@@ -738,8 +738,8 @@ typedef struct dof_sec {
 	((x) == DOF_SECT_PRARGS) || ((x) == DOF_SECT_PROFFS) ||		\
 	((x) == DOF_SECT_INTTAB) || ((x) == DOF_SECT_XLTAB) ||		\
 	((x) == DOF_SECT_XLMEMBERS) || ((x) == DOF_SECT_XLIMPORT) ||	\
-	((x) == DOF_SECT_XLIMPORT) || ((x) == DOF_SECT_XLEXPORT) ||	\
-	((x) == DOF_SECT_PREXPORT) || ((x) == DOF_SECT_PRENOFFS))
+	((x) == DOF_SECT_XLEXPORT) ||  ((x) == DOF_SECT_PREXPORT) || 	\
+	((x) == DOF_SECT_PRENOFFS))
 
 typedef struct dof_ecbdesc {
 	dof_secidx_t dofe_probes;	/* link to DOF_SECT_PROBEDESC */

From owner-svn-src-all@freebsd.org  Fri Dec 16 20:49:52 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14331C82739;
 Fri, 16 Dec 2016 20:49:52 +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 C8C251DEB;
 Fri, 16 Dec 2016 20:49:51 +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 uBGKnoOO083762;
 Fri, 16 Dec 2016 20:49:50 GMT (envelope-from asomers@FreeBSD.org)
Received: (from asomers@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGKnofM083756;
 Fri, 16 Dec 2016 20:49:50 GMT (envelope-from asomers@FreeBSD.org)
Message-Id: <201612162049.uBGKnofM083756@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: asomers set sender to
 asomers@FreeBSD.org using -f
From: Alan Somers <asomers@FreeBSD.org>
Date: Fri, 16 Dec 2016 20:49:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310176 - in stable/11: lib/libutil usr.sbin/pw
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 20:49:52 -0000

Author: asomers
Date: Fri Dec 16 20:49:50 2016
New Revision: 310176
URL: https://svnweb.freebsd.org/changeset/base/310176

Log:
  MFC r308806
  
  Speed up pw operations that edit /etc/group or /etc/passwd
  
  r285050 fixed a bug in pw that could lead to /etc/passwd or /etc/group
  corruption on power loss. However, it fixed it by opening those files with
  O_SYNC, which is very slow, especially on ZFS. This change replaces O_SYNC with
  appropriately placed fsync()s instead, which is much faster. Using a ZFS
  tmpdir, the time to run pw's kyua tests drops from 245s to 35s.

Modified:
  stable/11/lib/libutil/gr_util.c
  stable/11/lib/libutil/pw_util.c
  stable/11/usr.sbin/pw/grupd.c
  stable/11/usr.sbin/pw/pw_nis.c
  stable/11/usr.sbin/pw/pwupd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libutil/gr_util.c
==============================================================================
--- stable/11/lib/libutil/gr_util.c	Fri Dec 16 20:44:14 2016	(r310175)
+++ stable/11/lib/libutil/gr_util.c	Fri Dec 16 20:49:50 2016	(r310176)
@@ -141,7 +141,7 @@ gr_tmp(int mfd)
 		errno = ENAMETOOLONG;
 		return (-1);
 	}
-	if ((tfd = mkostemp(tempname, O_SYNC)) == -1)
+	if ((tfd = mkostemp(tempname, 0)) == -1)
 		return (-1);
 	if (mfd != -1) {
 		while ((nr = read(mfd, buf, sizeof(buf))) > 0)

Modified: stable/11/lib/libutil/pw_util.c
==============================================================================
--- stable/11/lib/libutil/pw_util.c	Fri Dec 16 20:44:14 2016	(r310175)
+++ stable/11/lib/libutil/pw_util.c	Fri Dec 16 20:49:50 2016	(r310176)
@@ -225,7 +225,7 @@ pw_tmp(int mfd)
 		errno = ENAMETOOLONG;
 		return (-1);
 	}
-	if ((tfd = mkostemp(tempname, O_SYNC)) == -1)
+	if ((tfd = mkostemp(tempname, 0)) == -1)
 		return (-1);
 	if (mfd != -1) {
 		while ((nr = read(mfd, buf, sizeof(buf))) > 0)

Modified: stable/11/usr.sbin/pw/grupd.c
==============================================================================
--- stable/11/usr.sbin/pw/grupd.c	Fri Dec 16 20:44:14 2016	(r310175)
+++ stable/11/usr.sbin/pw/grupd.c	Fri Dec 16 20:49:50 2016	(r310176)
@@ -77,6 +77,7 @@ gr_update(struct group * grp, char const
 		close(tfd);
 		err(1, "gr_copy()");
 	}
+	fsync(tfd);
 	close(tfd);
 	if (gr_mkdb() == -1) {
 		gr_fini();

Modified: stable/11/usr.sbin/pw/pw_nis.c
==============================================================================
--- stable/11/usr.sbin/pw/pw_nis.c	Fri Dec 16 20:44:14 2016	(r310175)
+++ stable/11/usr.sbin/pw/pw_nis.c	Fri Dec 16 20:49:50 2016	(r310176)
@@ -67,6 +67,7 @@ pw_nisupdate(const char * path, struct p
 		close(tfd);
 		err(1, "pw_copy()");
 	}
+	fsync(tfd);
 	close(tfd);
 	if (chmod(pw_tempname(), 0644) == -1)
 		err(1, "chmod()");

Modified: stable/11/usr.sbin/pw/pwupd.c
==============================================================================
--- stable/11/usr.sbin/pw/pwupd.c	Fri Dec 16 20:44:14 2016	(r310175)
+++ stable/11/usr.sbin/pw/pwupd.c	Fri Dec 16 20:49:50 2016	(r310176)
@@ -114,6 +114,7 @@ pw_update(struct passwd * pwd, char cons
 		close(tfd);
 		err(1, "pw_copy()");
 	}
+	fsync(tfd);
 	close(tfd);
 	/*
 	 * in case of deletion of a user, the whole database

From owner-svn-src-all@freebsd.org  Fri Dec 16 20:53:47 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D95C82956;
 Fri, 16 Dec 2016 20:53:47 +0000 (UTC)
 (envelope-from lifanov@FreeBSD.org)
Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E5A27267;
 Fri, 16 Dec 2016 20:53:46 +0000 (UTC)
 (envelope-from lifanov@FreeBSD.org)
Received: from [10.11.0.110] (unknown [198.85.229.3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by mail.lifanov.com (Postfix) with ESMTPSA id 81013239C62;
 Fri, 16 Dec 2016 15:53:45 -0500 (EST)
Subject: Re: svn commit: r310160 - head
To: John Baldwin <jhb@freebsd.org>
References: <201612161744.uBGHiv3Q009878@repo.freebsd.org>
 <21230839.nOEshPjK7Y@ralph.baldwin.cx>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
From: Nikolai Lifanov <lifanov@FreeBSD.org>
Message-ID: <9bd95500-84ff-f666-3e7b-ebd9656c35c3@FreeBSD.org>
Date: Fri, 16 Dec 2016 15:53:43 -0500
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101
 Thunderbird/45.5.1
MIME-Version: 1.0
In-Reply-To: <21230839.nOEshPjK7Y@ralph.baldwin.cx>
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature";
 boundary="fjmNgE23Cnms6gBIC4eGLpmdxd7oFjX4D"
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 20:53:47 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--fjmNgE23Cnms6gBIC4eGLpmdxd7oFjX4D
Content-Type: multipart/mixed; boundary="IiChhiECNkR1hXn9lPJkvLW95X1oMjq6l";
 protected-headers="v1"
From: Nikolai Lifanov <lifanov@FreeBSD.org>
To: John Baldwin <jhb@freebsd.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Message-ID: <9bd95500-84ff-f666-3e7b-ebd9656c35c3@FreeBSD.org>
Subject: Re: svn commit: r310160 - head
References: <201612161744.uBGHiv3Q009878@repo.freebsd.org>
 <21230839.nOEshPjK7Y@ralph.baldwin.cx>
In-Reply-To: <21230839.nOEshPjK7Y@ralph.baldwin.cx>

--IiChhiECNkR1hXn9lPJkvLW95X1oMjq6l
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 12/16/2016 15:12, John Baldwin wrote:
> On Friday, December 16, 2016 05:44:57 PM Nikolai Lifanov wrote:
>> Author: lifanov (ports committer)
>> Date: Fri Dec 16 17:44:56 2016
>> New Revision: 310160
>> URL: https://svnweb.freebsd.org/changeset/base/310160
>>
>> Log:
>>   retain cc.4.gz man page for Chelsio T6 NICs
>>  =20
>>   This man page was removed in r225583 when cc.4 was renamed to mod_cc=
=2E4
>>   With reintroduction of cc.4 "make installworld; make delete-old" was=

>>   no longer convergent.
>=20
> Please MFC to 10 and 11 since cc(4) is now present there as well.
>=20

Makes sense, will do!

- Nikolai Lifanov



--IiChhiECNkR1hXn9lPJkvLW95X1oMjq6l--

--fjmNgE23Cnms6gBIC4eGLpmdxd7oFjX4D
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQKoBAEBCgCSFiEE5oT6TcuaWvG5gtjzZ6sv56ecR0UFAlhUVFdfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU2
ODRGQTREQ0I5QTVBRjFCOTgyRDhGMzY3QUIyRkU3QTc5QzQ3NDUUHGxpZmFub3ZA
ZnJlZWJzZC5vcmcACgkQZ6sv56ecR0WniBAAnLIayWrY8Umq65dYiL8WjR87c3OR
zvdXmUcdok7F9pYF4tdnJ/DTt/YRVsH7K9+LFQVY9nRvsv0xGwkLyAi4UoHJbe1D
Z/edjTDCSPeISAoJgwCRaOuiY4LF4X1alRV+GwgYjY4Ykd+2cbRkScHS74mIJn+b
sdFGqBYopIJ9rxUJGiquq+txq1ZHdf+UCRMsJp9FZ/V5IEDcAB6zP8mpoLNtbOOw
hfCBRjd602+mXOOiDzmh/fbw2olE6MsYUvESMNuYyk4vjI3bTXSrBk0OaCbXTv51
1ROzvD9VKCclv2vY/tdD14euaHAQlEimZWRos9ChDdNRiR9I0BVLJRlDoBs+Ghpj
u9I9WuOI7MhPKGtvJuVDlrNNO8rI0dIhncOKWiajNUx0f6lL6GaxxMcFyjI5/hA4
2noDXUL+1OtOpfBTNPBD2OFsqYbu/Lh8naG6/gvI3+yvwztOtxYUOeQiVxouVy9D
VNEm21fXNo6qPEPMhN9WeboAqLFgmC/Pg05NjBX+59ej7QxIOhIbeaEAKrLyXnJB
H4g6chu+ar6cdQ3ctyDxTWnFn0ut4XyByLhUPBS3hEJdbXAf6uxl1YYTNiP84zhx
mkerpmxYTTIQBRgdMAcI6jUHgiw0z4Stau0yKnd4LrAhY+0ahlXiuMCwZu4HWnSS
M3GPdD8oiDZVf1E=
=tvGR
-----END PGP SIGNATURE-----

--fjmNgE23Cnms6gBIC4eGLpmdxd7oFjX4D--

From owner-svn-src-all@freebsd.org  Fri Dec 16 21:10:39 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 483A0C82B75;
 Fri, 16 Dec 2016 21:10:39 +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 0A8F69C1;
 Fri, 16 Dec 2016 21:10: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 uBGLAcu0091901;
 Fri, 16 Dec 2016 21:10:38 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGLAbG3091898;
 Fri, 16 Dec 2016 21:10:37 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201612162110.uBGLAbG3091898@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin <jhb@FreeBSD.org>
Date: Fri, 16 Dec 2016 21:10:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310177 - in head/sys: amd64/conf i386/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 21:10:39 -0000

Author: jhb
Date: Fri Dec 16 21:10:37 2016
New Revision: 310177
URL: https://svnweb.freebsd.org/changeset/base/310177

Log:
  Enable EARLY_AP_STARTUP on amd64 and i386 kernels by default.
  
  PR:		199321, 203682
  MFC after:	2 months
  Sponsored by:	Netflix

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/amd64/conf/MINIMAL
  head/sys/i386/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Fri Dec 16 20:49:50 2016	(r310176)
+++ head/sys/amd64/conf/GENERIC	Fri Dec 16 21:10:37 2016	(r310177)
@@ -98,6 +98,7 @@ options 	MALLOC_DEBUG_MAXZONES=8	# Separ
 # Make an SMP-capable kernel by default
 options 	SMP			# Symmetric MultiProcessor Kernel
 options 	DEVICE_NUMA		# I/O Device Affinity
+options 	EARLY_AP_STARTUP
 
 # CPU frequency control
 device		cpufreq

Modified: head/sys/amd64/conf/MINIMAL
==============================================================================
--- head/sys/amd64/conf/MINIMAL	Fri Dec 16 20:49:50 2016	(r310176)
+++ head/sys/amd64/conf/MINIMAL	Fri Dec 16 21:10:37 2016	(r310177)
@@ -94,6 +94,7 @@ options 	MALLOC_DEBUG_MAXZONES=8	# Separ
 # Make an SMP-capable kernel by default
 options 	SMP			# Symmetric MultiProcessor Kernel
 options 	DEVICE_NUMA		# I/O Device Affinity
+options 	EARLY_AP_STARTUP
 
 # CPU frequency control
 device		cpufreq

Modified: head/sys/i386/conf/GENERIC
==============================================================================
--- head/sys/i386/conf/GENERIC	Fri Dec 16 20:49:50 2016	(r310176)
+++ head/sys/i386/conf/GENERIC	Fri Dec 16 21:10:37 2016	(r310177)
@@ -96,6 +96,7 @@ options 	MALLOC_DEBUG_MAXZONES=8	# Separ
 # To make an SMP kernel, the next two lines are needed
 options 	SMP			# Symmetric MultiProcessor Kernel
 device		apic			# I/O APIC
+options 	EARLY_AP_STARTUP
 
 # CPU frequency control
 device		cpufreq

From owner-svn-src-all@freebsd.org  Fri Dec 16 21:58:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E50DAC83915;
 Fri, 16 Dec 2016 21:58:50 +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 A6CE3E9;
 Fri, 16 Dec 2016 21:58:50 +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 uBGLwnNa011902;
 Fri, 16 Dec 2016 21:58:49 GMT (envelope-from manu@FreeBSD.org)
Received: (from manu@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGLwnJb011894;
 Fri, 16 Dec 2016 21:58:49 GMT (envelope-from manu@FreeBSD.org)
Message-Id: <201612162158.uBGLwnJb011894@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: manu set sender to
 manu@FreeBSD.org using -f
From: Emmanuel Vadot <manu@FreeBSD.org>
Date: Fri, 16 Dec 2016 21:58:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310178 - head/sys/arm/allwinner/clk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 21:58:51 -0000

Author: manu
Date: Fri Dec 16 21:58:48 2016
New Revision: 310178
URL: https://svnweb.freebsd.org/changeset/base/310178

Log:
  Honor the CLK_SET_DRYRUN for the *set_freq function for allwinner clocks.
  
  Reviewed by:	jmcneill
  MFC after:	1 month
  Differential Revision:	https://reviews.freebsd.org/D8821

Modified:
  head/sys/arm/allwinner/clk/aw_debeclk.c
  head/sys/arm/allwinner/clk/aw_hdmiclk.c
  head/sys/arm/allwinner/clk/aw_lcdclk.c
  head/sys/arm/allwinner/clk/aw_mmcclk.c
  head/sys/arm/allwinner/clk/aw_modclk.c
  head/sys/arm/allwinner/clk/aw_pll.c
  head/sys/arm/allwinner/clk/aw_thsclk.c

Modified: head/sys/arm/allwinner/clk/aw_debeclk.c
==============================================================================
--- head/sys/arm/allwinner/clk/aw_debeclk.c	Fri Dec 16 21:10:37 2016	(r310177)
+++ head/sys/arm/allwinner/clk/aw_debeclk.c	Fri Dec 16 21:58:48 2016	(r310178)
@@ -209,6 +209,12 @@ aw_debeclk_set_freq(struct clknode *clk,
 
 	m = howmany(fin, *fout) - 1;
 
+	*fout = fin / (m + 1);
+	*stop = 1;
+
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
 	DEVICE_LOCK(sc);
 	DEBECLK_READ(sc, &val);
 	val &= ~CLK_RATIO_M;
@@ -216,9 +222,6 @@ aw_debeclk_set_freq(struct clknode *clk,
 	DEBECLK_WRITE(sc, val);
 	DEVICE_UNLOCK(sc);
 
-	*fout = fin / (m + 1);
-	*stop = 1;
-
 	return (0);
 }
 

Modified: head/sys/arm/allwinner/clk/aw_hdmiclk.c
==============================================================================
--- head/sys/arm/allwinner/clk/aw_hdmiclk.c	Fri Dec 16 21:10:37 2016	(r310177)
+++ head/sys/arm/allwinner/clk/aw_hdmiclk.c	Fri Dec 16 21:58:48 2016	(r310178)
@@ -188,6 +188,12 @@ aw_hdmiclk_set_freq(struct clknode *clk,
 	if (best_diff == (int64_t)*fout)
 		return (ERANGE);
 
+	*fout = fin / (1 << best_n) / (best_m + 1);
+	*stop = 1;
+
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
 	DEVICE_LOCK(sc);
 	HDMICLK_READ(sc, &val);
 	val &= ~(CLK_RATIO_N | CLK_RATIO_M);
@@ -196,9 +202,6 @@ aw_hdmiclk_set_freq(struct clknode *clk,
 	HDMICLK_WRITE(sc, val);
 	DEVICE_UNLOCK(sc);
 
-	*fout = fin / (1 << best_n) / (best_m + 1);
-	*stop = 1;
-
 	return (0);
 }
 

Modified: head/sys/arm/allwinner/clk/aw_lcdclk.c
==============================================================================
--- head/sys/arm/allwinner/clk/aw_lcdclk.c	Fri Dec 16 21:10:37 2016	(r310177)
+++ head/sys/arm/allwinner/clk/aw_lcdclk.c	Fri Dec 16 21:58:48 2016	(r310178)
@@ -389,56 +389,69 @@ aw_lcdclk_set_freq(struct clknode *clk, 
     int flags, int *stop)
 {
 	struct aw_lcdclk_softc *sc;
+	struct clknode *parent_clk;
+	const char **parent_names;
 	uint64_t pll_freq;
 	uint32_t val, src_sel;
 	int error, tcon_pll_div;
 
 	sc = clknode_get_softc(clk);
 
-	switch (sc->type) {
-	case AW_LCD_CH0:
+	if (sc->type == AW_LCD_CH0) {
 		*stop = 0;
-		break;
-	case AW_LCD_CH1:
-		if (sc->id != CLK_IDX_CH1_SCLK2)
-			return (ENXIO);
+		return (0);
+	}
 
-		src_sel = calc_tcon_pll(fin, *fout, &pll_freq, &tcon_pll_div);
+	if (sc->id != CLK_IDX_CH1_SCLK2)
+		return (ENXIO);
 
-		/* Switch parent clock if necessary */
-		if (src_sel != clknode_get_parent_idx(clk)) {
-			error = clknode_set_parent_by_idx(clk, src_sel);
-			if (error != 0)
-				return (error);
-		}
+	src_sel = calc_tcon_pll(fin, *fout, &pll_freq, &tcon_pll_div);
 
-		error = clknode_set_freq(clknode_get_parent(clk), pll_freq,
-		    0, 0);
-		if (error != 0)
-			return (error);
-
-		error = clknode_enable(clknode_get_parent(clk));
-		if (error != 0)
-			return (error);
-
-		/* Fetch new input frequency */
-		error = clknode_get_freq(clknode_get_parent(clk), &pll_freq);
-		if (error != 0)
-			return (error);
-
-		/* Set LCD divisor */
-		DEVICE_LOCK(sc);
-		LCDCLK_READ(sc, &val);
-		val &= ~CH1_CLK_DIV_RATIO_M;
-		val |= ((tcon_pll_div - 1) << CH1_CLK_DIV_RATIO_M_SHIFT);
-		LCDCLK_WRITE(sc, val);
-		DEVICE_UNLOCK(sc);
+	parent_names = clknode_get_parent_names(clk);
+	parent_clk = clknode_find_by_name(parent_names[src_sel]);
 
-		*fout = pll_freq / tcon_pll_div;
-		*stop = 1;
+	if (parent_clk == NULL)
+		return (ERANGE);
 
-		break;
-	}
+	/* Fetch input frequency */
+	error = clknode_get_freq(parent_clk, &pll_freq);
+	if (error != 0)
+		return (error);
+
+	*fout = pll_freq / tcon_pll_div;
+	*stop = 1;
+
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
+	/* Switch parent clock if necessary */
+	error = clknode_set_parent_by_idx(clk, src_sel);
+	if (error != 0)
+		return (error);
+
+	error = clknode_set_freq(parent_clk, pll_freq,
+	    0, 0);
+	if (error != 0)
+		return (error);
+
+	/* Fetch new input frequency */
+	error = clknode_get_freq(parent_clk, &pll_freq);
+	if (error != 0)
+		return (error);
+
+	*fout = pll_freq / tcon_pll_div;
+
+	error = clknode_enable(parent_clk);
+	if (error != 0)
+		return (error);
+
+	/* Set LCD divisor */
+	DEVICE_LOCK(sc);
+	LCDCLK_READ(sc, &val);
+	val &= ~CH1_CLK_DIV_RATIO_M;
+	val |= ((tcon_pll_div - 1) << CH1_CLK_DIV_RATIO_M_SHIFT);
+	LCDCLK_WRITE(sc, val);
+	DEVICE_UNLOCK(sc);
 
 	return (0);
 }

Modified: head/sys/arm/allwinner/clk/aw_mmcclk.c
==============================================================================
--- head/sys/arm/allwinner/clk/aw_mmcclk.c	Fri Dec 16 21:10:37 2016	(r310177)
+++ head/sys/arm/allwinner/clk/aw_mmcclk.c	Fri Dec 16 21:58:48 2016	(r310178)
@@ -77,6 +77,20 @@ struct aw_mmcclk_sc {
 	bus_addr_t	reg;
 };
 
+struct phase_clk {
+	uint64_t	freq;
+	int		parent_idx;
+	uint32_t	ophase;
+	uint32_t	phase;
+	uint32_t	n;
+};
+
+static struct phase_clk aw_mmcclk_phase[] = {
+	{400000, CLK_SRC_SEL_OSC24M, 0, 0, 2},
+	{25000000, CLK_SRC_SEL_PLL6, 0, 5, 2},
+	{52000000, CLK_SRC_SEL_PLL6, 3, 5, 0},
+};
+
 #define	MODCLK_READ(sc, val)	CLKDEV_READ_4((sc)->clkdev, (sc)->reg, (val))
 #define	MODCLK_WRITE(sc, val)	CLKDEV_WRITE_4((sc)->clkdev, (sc)->reg, (val))
 #define	DEVICE_LOCK(sc)		CLKDEV_DEVICE_LOCK((sc)->clkdev)
@@ -166,8 +180,10 @@ aw_mmcclk_set_freq(struct clknode *clk, 
     int flags, int *stop)
 {
 	struct aw_mmcclk_sc *sc;
-	uint32_t val, m, n, phase, ophase;
-	int parent_idx, error;
+	struct clknode *parent_clk;
+	const char **parent_names;
+	uint32_t val, m;
+	int parent_idx, error, phase;
 
 	sc = clknode_get_softc(clk);
 
@@ -175,52 +191,49 @@ aw_mmcclk_set_freq(struct clknode *clk, 
 	 * The ophase/phase values should be set by the MMC driver, but
 	 * there is currently no way to do this with the clk API
 	 */
-	if (*fout <= 400000) {
-		parent_idx = CLK_SRC_SEL_OSC24M;
-		ophase = 0;
-		phase = 0;
-		n = 2;
-	} else if (*fout <= 25000000) {
-		parent_idx = CLK_SRC_SEL_PLL6;
-		ophase = 0;
-		phase = 5;
-		n = 2;
-	} else if (*fout <= 52000000) {
-		parent_idx = CLK_SRC_SEL_PLL6;
-		ophase = 3;
-		phase = 5;
-		n = 0;
-	} else
+	for (phase = 0; phase < nitems(aw_mmcclk_phase); phase++) {
+		if (*fout <= aw_mmcclk_phase[phase].freq)
+			break;
+	}
+
+	if (phase == nitems(aw_mmcclk_phase))
 		return (ERANGE);
 
-	/* Switch parent clock, if necessary */
-	if (parent_idx != clknode_get_parent_idx(clk)) {
-		error = clknode_set_parent_by_idx(clk, parent_idx);
-		if (error != 0)
-			return (error);
-
-		/* Fetch new input frequency */
-		error = clknode_get_freq(clknode_get_parent(clk), &fin);
-		if (error != 0)
-			return (error);
-	}
+	parent_names = clknode_get_parent_names(clk);
+	parent_idx = aw_mmcclk_phase[phase].parent_idx;
+	parent_clk = clknode_find_by_name(parent_names[parent_idx]);
+
+	if (parent_clk == NULL)
+		return (ERANGE);
+
+	error = clknode_get_freq(parent_clk, &fin);
+	if (error != 0)
+		return (error);
+
+	m = ((fin / (1 << aw_mmcclk_phase[phase].n)) / *fout) - 1;
+
+	*fout = fin / (1 << aw_mmcclk_phase[phase].n) / (m + 1);
+	*stop = 1;
+
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
 
-	m = ((fin / (1 << n)) / *fout) - 1;
+	/* Switch to the correct parent if needed */
+	error = clknode_set_parent_by_idx(clk, parent_idx);
+	if (error != 0)
+		return (error);
 
 	DEVICE_LOCK(sc);
 	MODCLK_READ(sc, &val);
 	val &= ~(CLK_RATIO_N | CLK_RATIO_M | CLK_PHASE_CTR |
 	    OUTPUT_CLK_PHASE_CTR);
-	val |= (n << CLK_RATIO_N_SHIFT);
+	val |= (aw_mmcclk_phase[phase].n << CLK_RATIO_N_SHIFT);
 	val |= (m << CLK_RATIO_M_SHIFT);
-	val |= (phase << CLK_PHASE_CTR_SHIFT);
-	val |= (ophase << OUTPUT_CLK_PHASE_CTR_SHIFT);
+	val |= (aw_mmcclk_phase[phase].phase << CLK_PHASE_CTR_SHIFT);
+	val |= (aw_mmcclk_phase[phase].ophase << OUTPUT_CLK_PHASE_CTR_SHIFT);
 	MODCLK_WRITE(sc, val);
 	DEVICE_UNLOCK(sc);
 
-	*fout = fin / (1 << n) / (m + 1);
-	*stop = 1;
-
 	return (0);
 }
 

Modified: head/sys/arm/allwinner/clk/aw_modclk.c
==============================================================================
--- head/sys/arm/allwinner/clk/aw_modclk.c	Fri Dec 16 21:10:37 2016	(r310177)
+++ head/sys/arm/allwinner/clk/aw_modclk.c	Fri Dec 16 21:58:48 2016	(r310178)
@@ -68,7 +68,6 @@ static struct ofw_compat_data compat_dat
 struct aw_modclk_sc {
 	device_t	clkdev;
 	bus_addr_t	reg;
-	u_int		parent_cnt;
 };
 
 #define	MODCLK_READ(sc, val)	CLKDEV_READ_4((sc)->clkdev, (sc)->reg, (val))
@@ -102,7 +101,7 @@ aw_modclk_set_mux(struct clknode *clk, i
 
 	sc = clknode_get_softc(clk);
 
-	if (index < 0 || index >= sc->parent_cnt)
+	if (index < 0 || index >= clknode_get_parents_num(clk))
 		return (ERANGE);
 
 	DEVICE_LOCK(sc);
@@ -160,6 +159,8 @@ aw_modclk_set_freq(struct clknode *clk, 
     int flags, int *stop)
 {
 	struct aw_modclk_sc *sc;
+	struct clknode *parent_clk, *best_parent;
+	const char **parent_names;
 	uint32_t val, m, n, src, best_m, best_n, best_src;
 	uint64_t cur_freq;
 	int64_t best_diff, cur_diff;
@@ -170,11 +171,12 @@ aw_modclk_set_freq(struct clknode *clk, 
 	best_diff = (int64_t)*fout; 
 	best_src = 0;
 
-	for (src = 0; src < sc->parent_cnt; src++) {
-		error = clknode_set_parent_by_idx(clk, src);
-		if (error != 0)
+	parent_names = clknode_get_parent_names(clk);
+	for (src = 0; src < clknode_get_parents_num(clk); src++) {
+		parent_clk = clknode_find_by_name(parent_names[src]);
+		if (parent_clk == NULL)
 			continue;
-		error = clknode_get_freq(clknode_get_parent(clk), &fin);
+		error = clknode_get_freq(parent_clk, &fin);
 		if (error != 0)
 			continue;
 
@@ -184,6 +186,7 @@ aw_modclk_set_freq(struct clknode *clk, 
 				cur_diff = (int64_t)*fout - cur_freq;
 				if (cur_diff >= 0 && cur_diff < best_diff) {
 					best_src = src;
+					best_parent = parent_clk;
 					best_diff = cur_diff;
 					best_m = m;
 					best_n = n;
@@ -194,10 +197,17 @@ aw_modclk_set_freq(struct clknode *clk, 
 	if (best_diff == (int64_t)*fout)
 		return (ERANGE);
 
-	error = clknode_set_parent_by_idx(clk, best_src);
+	error = clknode_get_freq(best_parent, &fin);
 	if (error != 0)
 		return (error);
-	error = clknode_get_freq(clknode_get_parent(clk), &fin);
+
+	*fout = fin / (1 << best_n) / (best_m + 1);
+	*stop = 1;
+
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
+	error = clknode_set_parent_by_idx(clk, best_src);
 	if (error != 0)
 		return (error);
 
@@ -209,9 +219,6 @@ aw_modclk_set_freq(struct clknode *clk, 
 	MODCLK_WRITE(sc, val);
 	DEVICE_UNLOCK(sc);
 
-	*fout = fin / (1 << best_n) / (best_m + 1);
-	*stop = 1;
-
 	return (0);
 }
 
@@ -299,7 +306,6 @@ aw_modclk_attach(device_t dev)
 	sc = clknode_get_softc(clk);
 	sc->reg = paddr;
 	sc->clkdev = device_get_parent(dev);
-	sc->parent_cnt = def.parent_cnt;
 
 	clknode_register(clkdom, clk);
 

Modified: head/sys/arm/allwinner/clk/aw_pll.c
==============================================================================
--- head/sys/arm/allwinner/clk/aw_pll.c	Fri Dec 16 21:10:37 2016	(r310177)
+++ head/sys/arm/allwinner/clk/aw_pll.c	Fri Dec 16 21:58:48 2016	(r310178)
@@ -342,6 +342,9 @@ a10_pll1_set_freq(struct aw_pll_sc *sc, 
 	if (f == NULL)
 		return (EINVAL);
 
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
 	DEVICE_LOCK(sc);
 	PLL_READ(sc, &val);
 	val &= ~(A10_PLL1_FACTOR_N|A10_PLL1_FACTOR_K|A10_PLL1_FACTOR_M|
@@ -440,6 +443,9 @@ a10_pll2_set_freq(struct aw_pll_sc *sc, 
 	post_div = 4;
 	n = (*fout * pre_div * post_div * 2) / (2 * fin);
 
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
 	DEVICE_LOCK(sc);
 	PLL_READ(sc, &val);
 	val &= ~(A10_PLL2_POST_DIV | A10_PLL2_FACTOR_N | A10_PLL2_PRE_DIV);
@@ -497,6 +503,9 @@ a10_pll3_set_freq(struct aw_pll_sc *sc, 
 		*fout = m * A10_PLL3_REF_FREQ;
 	}
 
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
 	DEVICE_LOCK(sc);
 	PLL_READ(sc, &val);
 	val &= ~(A10_PLL3_MODE_SEL | A10_PLL3_FUNC_SET | A10_PLL3_FACTOR_M);
@@ -699,6 +708,9 @@ a13_pll2_set_freq(struct aw_pll_sc *sc, 
 	post_div = 4;
 	n = (*fout * pre_div * post_div * 2) / (2 * fin);
 
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
 	DEVICE_LOCK(sc);
 	PLL_READ(sc, &val);
 	val &= ~(A13_PLL2_POST_DIV | A13_PLL2_FACTOR_N | A13_PLL2_PRE_DIV);
@@ -765,6 +777,9 @@ h3_pll2_set_freq(struct aw_pll_sc *sc, u
 	if (f == NULL)
 		return (EINVAL);
 
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
 	DEVICE_LOCK(sc);
 	PLL_READ(sc, &val);
 	val &= ~(H3_PLL2_POST_DIV|H3_PLL2_FACTOR_N|H3_PLL2_PRE_DIV);
@@ -808,6 +823,9 @@ a23_pll1_set_freq(struct aw_pll_sc *sc, 
 	if (f == NULL)
 		return (EINVAL);
 
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
 	DEVICE_LOCK(sc);
 	PLL_READ(sc, &val);
 	val &= ~(A23_PLL1_FACTOR_N|A23_PLL1_FACTOR_K|A23_PLL1_FACTOR_M|
@@ -860,6 +878,9 @@ h3_pll1_set_freq(struct aw_pll_sc *sc, u
 	if (f == NULL)
 		return (EINVAL);
 
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
 	DEVICE_LOCK(sc);
 	PLL_READ(sc, &val);
 
@@ -1067,6 +1088,9 @@ a83t_pllcpux_set_freq(struct aw_pll_sc *
 	if (n < A83T_PLLCPUX_FACTOR_N_MIN || n > A83T_PLLCPUX_FACTOR_N_MAX)
 		return (EINVAL);
 
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
 	DEVICE_LOCK(sc);
 	PLL_READ(sc, &val);
 	val &= ~A83T_PLLCPUX_FACTOR_N;

Modified: head/sys/arm/allwinner/clk/aw_thsclk.c
==============================================================================
--- head/sys/arm/allwinner/clk/aw_thsclk.c	Fri Dec 16 21:10:37 2016	(r310177)
+++ head/sys/arm/allwinner/clk/aw_thsclk.c	Fri Dec 16 21:58:48 2016	(r310178)
@@ -186,6 +186,9 @@ aw_thsclk_set_freq(struct clknode *clk, 
 	if (best_diff == (int64_t)*fout || best_n == 0)
 		return (ERANGE);
 
+	if ((flags & CLK_SET_DRYRUN) != 0)
+		return (0);
+
 	DEVICE_LOCK(sc);
 	THSCLK_READ(sc, &val);
 	val &= ~CLK_DIV_RATIO;

From owner-svn-src-all@freebsd.org  Fri Dec 16 21:59:44 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C25D7C8396D;
 Fri, 16 Dec 2016 21:59:44 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: from mail-wj0-f170.google.com (mail-wj0-f170.google.com
 [209.85.210.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 63A46284;
 Fri, 16 Dec 2016 21:59:44 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: by mail-wj0-f170.google.com with SMTP id tk12so103007560wjb.3;
 Fri, 16 Dec 2016 13:59:43 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:reply-to:in-reply-to:references
 :from:date:message-id:subject:to:cc;
 bh=kxAYxvxrwGPeHes9237PBIDJo8zh/6cY2l0NTnJb4QI=;
 b=ThGqzLk42OCHPvdcHbztj6wM7pVUViNUAvUykBeV6Pd5QMXWIUG0SlXQFgvtO+O8rN
 4iYld1iQWIhRhL4uu132AUQ4L3z4GHgxwaqmWg2H2pjIiqL9jyfApuSrNTcHmAQs6cxo
 lx13fFV7dOf7dTrvN7gKZHuPAxRxq3q1tCwiQvS/mFeuTgyXM04ri2HpvCkEglgoznWN
 8LcAaq/Myp6yPvqhkGIBaYLWxpRa/ZNivlMee9H5Zcv9u/cccFGHwi9V3Fc+tCC4Zo/Q
 8lK/FxuGY4oFQTnguFMiU5QNQSXgQ6ArdLJTYoiGv7uBUsFIXG+RJjO8Tgtf6qIsW6VT
 uXIg==
X-Gm-Message-State: AKaTC02Brvq5zj+HV/6vJmhEf8cYGwHy4NT/5uViYi8fRR7DxagcWgTpqAk2zLY6iUnKzQ==
X-Received: by 10.194.39.7 with SMTP id l7mr4276935wjk.182.1481919181556;
 Fri, 16 Dec 2016 12:13:01 -0800 (PST)
Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com.
 [74.125.82.51])
 by smtp.gmail.com with ESMTPSA id c81sm4797943wmf.22.2016.12.16.12.13.01
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 16 Dec 2016 12:13:01 -0800 (PST)
Received: by mail-wm0-f51.google.com with SMTP id c184so16607180wmd.0;
 Fri, 16 Dec 2016 12:13:01 -0800 (PST)
X-Received: by 10.28.54.216 with SMTP id y85mr4895209wmh.85.1481919181236;
 Fri, 16 Dec 2016 12:13:01 -0800 (PST)
MIME-Version: 1.0
Reply-To: cem@freebsd.org
Received: by 10.194.29.72 with HTTP; Fri, 16 Dec 2016 12:13:00 -0800 (PST)
In-Reply-To: <201612161949.uBGJnMol059217@repo.freebsd.org>
References: <201612161949.uBGJnMol059217@repo.freebsd.org>
From: Conrad Meyer <cem@freebsd.org>
Date: Fri, 16 Dec 2016 12:13:00 -0800
X-Gmail-Original-Message-ID: <CAG6CVpU3r-sCp_1CnxfdS+CrKgfxezcuZkYK_yPYAt7JWfPf8Q@mail.gmail.com>
Message-ID: <CAG6CVpU3r-sCp_1CnxfdS+CrKgfxezcuZkYK_yPYAt7JWfPf8Q@mail.gmail.com>
Subject: Re: svn commit: r310171 - head/sys/sys
To: Dimitry Andric <dim@freebsd.org>
Cc: src-committers <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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 21:59:44 -0000

Thanks!

On Fri, Dec 16, 2016 at 11:49 AM, Dimitry Andric <dim@freebsd.org> wrote:
> Author: dim
> Date: Fri Dec 16 19:49:22 2016
> New Revision: 310171
> URL: https://svnweb.freebsd.org/changeset/base/310171
>
> Log:
>   Add __scanflike attributes to the kernel's sscanf() and vsscanf()
>   declarations.  This should help to catch future mismatches between
>   format strings and arguments.
>
>   MFC after:    1 week
>
> Modified:
>   head/sys/sys/systm.h
>
> Modified: head/sys/sys/systm.h
> ==============================================================================
> --- head/sys/sys/systm.h        Fri Dec 16 19:09:57 2016        (r310170)
> +++ head/sys/sys/systm.h        Fri Dec 16 19:49:22 2016        (r310171)
> @@ -227,8 +227,8 @@ int vsnprintf(char *, size_t, const char
>  int    vsnrprintf(char *, size_t, int, const char *, __va_list) __printflike(4, 0);
>  int    vsprintf(char *buf, const char *, __va_list) __printflike(2, 0);
>  int    ttyprintf(struct tty *, const char *, ...) __printflike(2, 3);
> -int    sscanf(const char *, char const *, ...) __nonnull(1) __nonnull(2);
> -int    vsscanf(const char *, char const *, __va_list) __nonnull(1) __nonnull(2);
> +int    sscanf(const char *, char const *, ...) __nonnull(1) __nonnull(2) __scanflike(2, 3);
> +int    vsscanf(const char *, char const *, __va_list) __nonnull(1) __nonnull(2) __scanflike(2, 0);
>  long   strtol(const char *, char **, int) __nonnull(1);
>  u_long strtoul(const char *, char **, int) __nonnull(1);
>  quad_t strtoq(const char *, char **, int) __nonnull(1);
>

From owner-svn-src-all@freebsd.org  Fri Dec 16 22:22:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7A4DC83E57;
 Fri, 16 Dec 2016 22:22:50 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from smtp.vangyzen.net (hotblack.vangyzen.net
 [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f])
 by mx1.freebsd.org (Postfix) with ESMTP id CABCF1042;
 Fri, 16 Dec 2016 22:22:50 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from ford.home.vangyzen.net (unknown [76.164.15.242])
 by smtp.vangyzen.net (Postfix) with ESMTPSA id BBAEB5647F;
 Fri, 16 Dec 2016 16:22:49 -0600 (CST)
Subject: Re: svn commit: r310138 - head/lib/libc/stdio
To: Ian Lepore <ian@freebsd.org>, Baptiste Daroussin <bapt@FreeBSD.org>,
 "Conrad E. Meyer" <cem@FreeBSD.org>, Dimitry Andric <dim@FreeBSD.org>
References: <201612160144.uBG1ipjW016736@repo.freebsd.org>
 <20161216193128.wgskqt4vc44vdd7o@ivaldir.etoilebsd.net>
 <1481918834.1972.77.camel@freebsd.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
From: Eric van Gyzen <vangyzen@FreeBSD.org>
Message-ID: <6b3b39af-467f-087e-261f-db80e027276e@FreeBSD.org>
Date: Fri, 16 Dec 2016 16:22:43 -0600
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101
 Thunderbird/45.4.0
MIME-Version: 1.0
In-Reply-To: <1481918834.1972.77.camel@freebsd.org>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 22:22:51 -0000

On 12/16/2016 14:07, Ian Lepore wrote:
> On Fri, 2016-12-16 at 20:31 +0100, Baptiste Daroussin wrote:
>> On Fri, Dec 16, 2016 at 01:44:51AM +0000, Conrad E. Meyer wrote:
>>>
>>> Author: cem
>>> Date: Fri Dec 16 01:44:50 2016
>>> New Revision: 310138
>>> URL: https://svnweb.freebsd.org/changeset/base/310138
>>>
>>> Log:
>>>   vfprintf(3): Add support for kernel %b format
>>>   
>>>   This is a direct port of the kernel %b format.
>>>   
>>>   I'm unclear on if (more) non-portable printf extensions will be a
>>>   problem. I think it's desirable to have userspace formats include
>>> all
>>>   kernel formats, but there may be competing goals I'm not aware
>>> of.
>>>   
>>>   Reviewed by:	no one, unfortunately
>>>   Sponsored by:	Dell EMC Isilon
>>>   Differential Revision:	https://reviews.freebsd.org/D8426
>>>
>> I really don't think it is a good idea, if used in userland it would
>> be make
>> more of our code difficult to port elsewhere.
>>
>> Other than that, it makes more difficult to use vanilla gcc with out
>> userland.
>> and it is adding more complexity to be able to build freebsd from a
>> non freebsd
>> system which some people are working on.
>>
>> Personnaly I would prefer to see those extensions removed from the
>> kernel rather
>> than see them available in userland.
>>
>> Can't we use simple helper function instead?
>>
>> Best regards,
>> Bapt
> 
> I'll add a big +1 for the concept of eliminating the extensions from
> the kernel instead of extending them to userland.  People ask why
> freebsd can't be built using standard tools on foreign build hosts, and
> these non-standard extensions are part of the reason why.

I strongly agree.  Thanks for mentioning snprintb, Dimitry; I hadn't seen that one.

Eric

From owner-svn-src-all@freebsd.org  Fri Dec 16 22:37:18 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A0C5C83109;
 Fri, 16 Dec 2016 22:37:18 +0000 (UTC)
 (envelope-from cperciva@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BFE6B1714;
 Fri, 16 Dec 2016 22:37:17 +0000 (UTC)
 (envelope-from cperciva@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBGMbGMi027743;
 Fri, 16 Dec 2016 22:37:16 GMT (envelope-from cperciva@FreeBSD.org)
Received: (from cperciva@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGMbG82027742;
 Fri, 16 Dec 2016 22:37:16 GMT (envelope-from cperciva@FreeBSD.org)
Message-Id: <201612162237.uBGMbG82027742@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cperciva set sender to
 cperciva@FreeBSD.org using -f
From: Colin Percival <cperciva@FreeBSD.org>
Date: Fri, 16 Dec 2016 22:37:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310179 - head/usr.sbin/portsnap/portsnap
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 22:37:18 -0000

Author: cperciva
Date: Fri Dec 16 22:37:16 2016
New Revision: 310179
URL: https://svnweb.freebsd.org/changeset/base/310179

Log:
  Avoid division by zero in the rare case that portsnap needs to fetch
  zero patches.  (This avoids two "dc: divide by zero" warnings.)
  
  MFC after:	3 days

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

Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh
==============================================================================
--- head/usr.sbin/portsnap/portsnap/portsnap.sh	Fri Dec 16 21:58:48 2016	(r310178)
+++ head/usr.sbin/portsnap/portsnap/portsnap.sh	Fri Dec 16 22:37:16 2016	(r310179)
@@ -619,8 +619,10 @@ fetch_progress() {
 
 pct_fmt()
 {
-	printf "                                     \r"
-	printf "($1/$2) %02.2f%% " `echo "scale=4;$LNC / $TOTAL * 100"|bc`
+	if [ $TOTAL -gt 0 ]; then
+		printf "                                     \r"
+		printf "($1/$2) %02.2f%% " `echo "scale=4;$LNC / $TOTAL * 100"|bc`
+	fi
 }
 
 fetch_progress_percent() {

From owner-svn-src-all@freebsd.org  Fri Dec 16 22:39:32 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16D52C83349;
 Fri, 16 Dec 2016 22:39:32 +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 D31FA1942;
 Fri, 16 Dec 2016 22:39:31 +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 uBGMdVE5027854;
 Fri, 16 Dec 2016 22:39:31 GMT (envelope-from asomers@FreeBSD.org)
Received: (from asomers@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGMdVSL027853;
 Fri, 16 Dec 2016 22:39:31 GMT (envelope-from asomers@FreeBSD.org)
Message-Id: <201612162239.uBGMdVSL027853@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: asomers set sender to
 asomers@FreeBSD.org using -f
From: Alan Somers <asomers@FreeBSD.org>
Date: Fri, 16 Dec 2016 22:39:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310180 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 22:39:32 -0000

Author: asomers
Date: Fri Dec 16 22:39:30 2016
New Revision: 310180
URL: https://svnweb.freebsd.org/changeset/base/310180

Log:
  Fix panic during lagg destruction with simultaneous status check
  
  If you run "ifconfig lagg0 destroy" and "ifconfig lagg0" at the same time a
  page fault may result. The first process will destroy ifp->if_lagg in
  lagg_clone_destroy (called by if_clone_destroy). Then the second process
  will observe that ifp->if_lagg is NULL at the top of lagg_port_ioctl and
  goto fallback: where it will promptly dereference ifp->if_lagg anyway.
  
  The solution is to repeat the NULL check for ifp->if_lagg
  
  MFC after:	4 weeks
  Sponsored by:	Spectra Logic Corp
  Differential Revision:	https://reviews.freebsd.org/D8512

Modified:
  head/sys/net/if_lagg.c

Modified: head/sys/net/if_lagg.c
==============================================================================
--- head/sys/net/if_lagg.c	Fri Dec 16 22:37:16 2016	(r310179)
+++ head/sys/net/if_lagg.c	Fri Dec 16 22:39:30 2016	(r310180)
@@ -252,6 +252,7 @@ SYSCTL_INT(_net_link_lagg, OID_AUTO, def
     &VNET_NAME(def_flowid_shift), 0,
     "Default setting for flowid shift for load sharing");
 
+#pragma clang optimize off
 static void
 vnet_lagg_init(const void *unused __unused)
 {
@@ -1022,7 +1023,7 @@ lagg_port_ioctl(struct ifnet *ifp, u_lon
 	return (error);
 
 fallback:
-	if (lp->lp_ioctl != NULL)
+	if (lp != NULL && lp->lp_ioctl != NULL)
 		return ((*lp->lp_ioctl)(ifp, cmd, data));
 
 	return (EINVAL);

From owner-svn-src-all@freebsd.org  Fri Dec 16 22:45:40 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1488C835AF;
 Fri, 16 Dec 2016 22:45:40 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170])
 (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 E28E81DC2;
 Fri, 16 Dec 2016 22:45:39 +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 mail.baldwin.cx (Postfix) with ESMTPSA id 23F7F10A981;
 Fri, 16 Dec 2016 17:45:33 -0500 (EST)
From: John Baldwin <jhb@freebsd.org>
To: Dimitry Andric <dim@freebsd.org>
Cc: Baptiste Daroussin <bapt@freebsd.org>, "Conrad E. Meyer" <cem@freebsd.org>,
 src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r310138 - head/lib/libc/stdio
Date: Fri, 16 Dec 2016 14:45:19 -0800
Message-ID: <13059937.h5mayX8aKo@ralph.baldwin.cx>
User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; )
In-Reply-To: <8CF1AB9C-83FE-495F-B07C-56F928282512@FreeBSD.org>
References: <201612160144.uBG1ipjW016736@repo.freebsd.org>
 <20161216193128.wgskqt4vc44vdd7o@ivaldir.etoilebsd.net>
 <8CF1AB9C-83FE-495F-B07C-56F928282512@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.4.3
 (mail.baldwin.cx); Fri, 16 Dec 2016 17:45:33 -0500 (EST)
X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx
X-Virus-Status: Clean
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 22:45:40 -0000

On Friday, December 16, 2016 08:53:26 PM Dimitry Andric wrote:
> On 16 Dec 2016, at 20:31, Baptiste Daroussin <bapt@FreeBSD.org> wrote:
> > 
> > On Fri, Dec 16, 2016 at 01:44:51AM +0000, Conrad E. Meyer wrote:
> >> Author: cem
> >> Date: Fri Dec 16 01:44:50 2016
> >> New Revision: 310138
> >> URL: https://svnweb.freebsd.org/changeset/base/310138
> >> 
> >> Log:
> >>  vfprintf(3): Add support for kernel %b format
> >> 
> >>  This is a direct port of the kernel %b format.
> >> 
> >>  I'm unclear on if (more) non-portable printf extensions will be a
> >>  problem. I think it's desirable to have userspace formats include all
> >>  kernel formats, but there may be competing goals I'm not aware of.
> >> 
> >>  Reviewed by:	no one, unfortunately
> >>  Sponsored by:	Dell EMC Isilon
> >>  Differential Revision:	https://reviews.freebsd.org/D8426
> >> 
> > 
> > I really don't think it is a good idea, if used in userland it would be make
> > more of our code difficult to port elsewhere.
> 
> Indeed, this is a bad idea.  These custom format specifiers should be
> eliminated, not multiplied. :-)
> 
> 
> > Other than that, it makes more difficult to use vanilla gcc with out userland.
> > and it is adding more complexity to be able to build freebsd from a non freebsd
> > system which some people are working on.
> > 
> > Personnaly I would prefer to see those extensions removed from the kernel rather
> > than see them available in userland.
> 
> Same here.
> 
> 
> > Can't we use simple helper function instead?
> 
> Yes, please.  Just take the snprintb(3) function from NetBSD:
> 
> http://netbsd.gw.com/cgi-bin/man-cgi?snprintb+3+NetBSD-current

In general I agree with something like this instead, but it is quite a bit more
tedious to use as you have to run it once to determine the length, allocate a
buffer, and then run it again.  Calling malloc() for that buffer isn't always
convenient in the kernel (though it should be fine in userland).  Having it live
in printf() itself means the output is generated to the stream without having to
manage a variable-sized intermediate buffer.

-- 
John Baldwin

From owner-svn-src-all@freebsd.org  Fri Dec 16 22:45:41 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CC13C835B2;
 Fri, 16 Dec 2016 22:45:41 +0000 (UTC)
 (envelope-from mjguzik@gmail.com)
Received: from mail-wj0-x244.google.com (mail-wj0-x244.google.com
 [IPv6:2a00:1450:400c:c01::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 B0B251DC3;
 Fri, 16 Dec 2016 22:45:40 +0000 (UTC)
 (envelope-from mjguzik@gmail.com)
Received: by mail-wj0-x244.google.com with SMTP id he10so16179241wjc.2;
 Fri, 16 Dec 2016 14:45:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=OKBlclS2Tn/CIiqvAoKhxYZlj+EEHFw2+yxq4HgQo28=;
 b=FMPGMnOeURTrVr5aW/Lhz9SbydnPb53XIzW7V1CNAACNbrJ9JvgLi+LgCPt8dny74p
 HOieUggnbfQ6rX8LVFzMGTARHF+Tn4leYVM1TO9WF9V1VLcUWjRm9dbY24NVUhh62L51
 inL6cb2LxhMMYz7mxlO5UxHPx5ctP24TuovX8CJHmwVhJ9aoUa2ypziBplI6J0PcqQgY
 8/131+havVMewW+7iZTRDRJiGibdrxSiU7LCjFX8+NzDrnA0nBxt5gBaI8jreBf9QSwz
 +/A8ciJoYsYNPNkgbu6G5sdkXueoOX7QPeqtFmlrt9O4JOESoWXyUQ4HT1YMzVeoNd2+
 P5DQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:in-reply-to:user-agent;
 bh=OKBlclS2Tn/CIiqvAoKhxYZlj+EEHFw2+yxq4HgQo28=;
 b=ihUHNtsA3KAOmczNk7M86QPfakaztbZoLJIkbazhf9Y4Fgttjl+Rdsl6AUDBULFbhx
 goeGJ1pcTuNfe324yqU0LtI7Tp9KLA29se1DPQ6LIai4iBY+Y+Qce8wt40AiywsVGWn5
 TuTCogkPsQTgWZvGcxUWbqjbhvOxZL4m1uvSy1+moSBVbnbO/wWBtLEFpOZ5Q6nuZOB8
 CBNbxXwCf7y7frXUotG9HZM/jVXrJ4vmxAiRaNvJKxV9Xnc5GFgK2NR+zliOSjZTvGNY
 0rFdvKvFU3d8d52MAnvZWM0KzmLNFrwA/N5TBzTkXsrxmQICon/a2yET3PNOrjvQqdGE
 DLxw==
X-Gm-Message-State: AKaTC020mzzmYSmIEc3pQ10a3j1g6sCGYLsCYhMmCoJC2rJbTcVz7tDeXJcA4IYdr/2oWQ==
X-Received: by 10.194.171.200 with SMTP id aw8mr4440711wjc.79.1481928338860;
 Fri, 16 Dec 2016 14:45:38 -0800 (PST)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by smtp.gmail.com with ESMTPSA id gk6sm8711236wjc.46.2016.12.16.14.45.37
 (version=TLS1_2 cipher=AES128-SHA bits=128/128);
 Fri, 16 Dec 2016 14:45:38 -0800 (PST)
Date: Fri, 16 Dec 2016 23:45:35 +0100
From: Mateusz Guzik <mjguzik@gmail.com>
To: Alan Somers <asomers@FreeBSD.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r310180 - head/sys/net
Message-ID: <20161216224535.GA6408@dft-labs.eu>
References: <201612162239.uBGMdVSL027853@repo.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <201612162239.uBGMdVSL027853@repo.freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 22:45:41 -0000

On Fri, Dec 16, 2016 at 10:39:31PM +0000, Alan Somers wrote:
> Author: asomers
> Date: Fri Dec 16 22:39:30 2016
> New Revision: 310180
> URL: https://svnweb.freebsd.org/changeset/base/310180
> 
> Log:
>   Fix panic during lagg destruction with simultaneous status check
>   
>   If you run "ifconfig lagg0 destroy" and "ifconfig lagg0" at the same time a
>   page fault may result. The first process will destroy ifp->if_lagg in
>   lagg_clone_destroy (called by if_clone_destroy). Then the second process
>   will observe that ifp->if_lagg is NULL at the top of lagg_port_ioctl and
>   goto fallback: where it will promptly dereference ifp->if_lagg anyway.
>   
>   The solution is to repeat the NULL check for ifp->if_lagg
>   

I don't understand how this solves the problem. What prevents the object
from getting freed after the pointer got NULLified? That is, it seems
the patch turns a null pointer deref into a use-after-free.

There seems to be a refcounting issue here.

That said, I only did cursory reading.
-- 
Mateusz Guzik <mjguzik gmail.com>

From owner-svn-src-all@freebsd.org  Fri Dec 16 22:53:12 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14869C83816;
 Fri, 16 Dec 2016 22:53:12 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146])
 by mx1.freebsd.org (Postfix) with ESMTP id 609C07BD;
 Fri, 16 Dec 2016 22:53:11 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from ford.home.vangyzen.net (unknown [76.164.15.242])
 by smtp.vangyzen.net (Postfix) with ESMTPSA id EE44E5647F;
 Fri, 16 Dec 2016 16:53:04 -0600 (CST)
Subject: Re: svn commit: r310138 - head/lib/libc/stdio
To: John Baldwin <jhb@freebsd.org>, Dimitry Andric <dim@freebsd.org>
References: <201612160144.uBG1ipjW016736@repo.freebsd.org>
 <20161216193128.wgskqt4vc44vdd7o@ivaldir.etoilebsd.net>
 <8CF1AB9C-83FE-495F-B07C-56F928282512@FreeBSD.org>
 <13059937.h5mayX8aKo@ralph.baldwin.cx>
Cc: Baptiste Daroussin <bapt@freebsd.org>, "Conrad E. Meyer"
 <cem@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
From: Eric van Gyzen <vangyzen@FreeBSD.org>
Message-ID: <9e255301-f663-a96c-68c7-e6d1a3d1db8c@FreeBSD.org>
Date: Fri, 16 Dec 2016 16:53:04 -0600
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101
 Thunderbird/45.4.0
MIME-Version: 1.0
In-Reply-To: <13059937.h5mayX8aKo@ralph.baldwin.cx>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 22:53:12 -0000

On 12/16/2016 16:45, John Baldwin wrote:
> On Friday, December 16, 2016 08:53:26 PM Dimitry Andric wrote:
>> On 16 Dec 2016, at 20:31, Baptiste Daroussin <bapt@FreeBSD.org> wrote:
>>>
>>> On Fri, Dec 16, 2016 at 01:44:51AM +0000, Conrad E. Meyer wrote:
>>>> Author: cem
>>>> Date: Fri Dec 16 01:44:50 2016
>>>> New Revision: 310138
>>>> URL: https://svnweb.freebsd.org/changeset/base/310138
>>>>
>>>> Log:
>>>>  vfprintf(3): Add support for kernel %b format
>>>>
>>>>  This is a direct port of the kernel %b format.
>>>>
>>>>  I'm unclear on if (more) non-portable printf extensions will be a
>>>>  problem. I think it's desirable to have userspace formats include all
>>>>  kernel formats, but there may be competing goals I'm not aware of.
>>>>
>>>>  Reviewed by:	no one, unfortunately
>>>>  Sponsored by:	Dell EMC Isilon
>>>>  Differential Revision:	https://reviews.freebsd.org/D8426
>>>>
>>>
>>> I really don't think it is a good idea, if used in userland it would be make
>>> more of our code difficult to port elsewhere.
>>
>> Indeed, this is a bad idea.  These custom format specifiers should be
>> eliminated, not multiplied. :-)
>>
>>
>>> Other than that, it makes more difficult to use vanilla gcc with out userland.
>>> and it is adding more complexity to be able to build freebsd from a non freebsd
>>> system which some people are working on.
>>>
>>> Personnaly I would prefer to see those extensions removed from the kernel rather
>>> than see them available in userland.
>>
>> Same here.
>>
>>
>>> Can't we use simple helper function instead?
>>
>> Yes, please.  Just take the snprintb(3) function from NetBSD:
>>
>> http://netbsd.gw.com/cgi-bin/man-cgi?snprintb+3+NetBSD-current
> 
> In general I agree with something like this instead, but it is quite a bit more
> tedious to use as you have to run it once to determine the length, allocate a
> buffer, and then run it again.  Calling malloc() for that buffer isn't always
> convenient in the kernel (though it should be fine in userland).  Having it live
> in printf() itself means the output is generated to the stream without having to
> manage a variable-sized intermediate buffer.

I imagine most callers can simply use a char[sizeof(fmt)+C] on the stack, where
C is some constant that I haven't taken the time to calculate, at the risk of
making myself look foolish and unprofessional.

Eric

From owner-svn-src-all@freebsd.org  Fri Dec 16 22:55:43 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 588DEC838FA;
 Fri, 16 Dec 2016 22:55:43 +0000 (UTC)
 (envelope-from asomers@gmail.com)
Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com
 [IPv6:2607:f8b0:400d:c09::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 14B2D9F6;
 Fri, 16 Dec 2016 22:55:43 +0000 (UTC)
 (envelope-from asomers@gmail.com)
Received: by mail-qk0-x235.google.com with SMTP id q130so105897392qke.1;
 Fri, 16 Dec 2016 14:55:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:sender:in-reply-to:references:from:date:message-id
 :subject:to:cc;
 bh=jLpzvXsyO0EXyk2bE5CJteBjGBLrx4k9bonWB1jjuA4=;
 b=B/LsbqngOZfMjrtmFWh9TTmjIGbcXa63UL6hGjFk9XYbcZEv2x/7h6M6lkYVIi6xIy
 XTIYhcSSBeLBaUv48eGbiYOg0CU8QBkfEtodmnY8VeY9xFfZ6Y0HCKTqGIpIS2KXZKYs
 DBDyZz5Lv8rYALbarmbNpTPhB/V4QKibZ1U6mdcGGTuCRPprao0r8Qt1UP5ZSG4wtPJH
 sHc9AgMlVepYfr0PjNYS0Eak58V3dZHI/zbJ6pTBQ0KKR8kzG5XUEhmdm5DlwSfafHeN
 QmX3MdMzUdyJLqKaYqdeGvgUcxOoiQpY+2oYnNZLKqdYN+Uth43rlpfo/y6p2EbpVQFn
 lu9A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc;
 bh=jLpzvXsyO0EXyk2bE5CJteBjGBLrx4k9bonWB1jjuA4=;
 b=Gl3rBhTLcB13uN6VUnLns1OE0QlFuThxpQSDZqa6VUVt3Jaao7OOPmQJXMLPK1bYxs
 7E3S9rb3ixG4V5pnrW0IU15DQbP5cTTWTXCtb+xxqIoslxpllQSQxqXJinpsRAk6zXOZ
 /JfGXxsz2ihY0nfCHFK/1eAS/jIedjKokUTnC8wmAMTVfCB5AuHcyAqEeq3hqnRLRdzv
 AiamhaZYK9cziTRghyjDhEBs56QDbsL1JA2U9ZSJ5tnuEKzZSy3ou4Wj/j6b7oQOcrdS
 6H92zZqK25Lk+9Cp9B6sXVRH0Q2cLod4Pphyr1+r8XXDukfdCfDRaG4+JQ0oMhDkGBMo
 9glw==
X-Gm-Message-State: AIkVDXIycTjVV5VNe2U1WhRr7euhEaDelBmOOOKnFWstJ81RZNjz9kHCZo2JJ8JQZnBdqcrKU7Ru62Y8lfbAPg==
X-Received: by 10.55.92.199 with SMTP id q190mr3362868qkb.303.1481928942197;
 Fri, 16 Dec 2016 14:55:42 -0800 (PST)
MIME-Version: 1.0
Sender: asomers@gmail.com
Received: by 10.12.181.208 with HTTP; Fri, 16 Dec 2016 14:55:41 -0800 (PST)
In-Reply-To: <20161216224535.GA6408@dft-labs.eu>
References: <201612162239.uBGMdVSL027853@repo.freebsd.org>
 <20161216224535.GA6408@dft-labs.eu>
From: Alan Somers <asomers@freebsd.org>
Date: Fri, 16 Dec 2016 15:55:41 -0700
X-Google-Sender-Auth: fQRE1bncW9FxX9ZFndAeIrSqjDU
Message-ID: <CAOtMX2h0ZqqeaWEnOF1Cm3dNR_3_2XTk4bB9pxVtTJ=XHZ3Z5A@mail.gmail.com>
Subject: Re: svn commit: r310180 - head/sys/net
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: "src-committers@freebsd.org" <src-committers@freebsd.org>, 
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, 
 "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Content-Type: text/plain; charset=UTF-8
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 22:55:43 -0000

On Fri, Dec 16, 2016 at 3:45 PM, Mateusz Guzik <mjguzik@gmail.com> wrote:
> On Fri, Dec 16, 2016 at 10:39:31PM +0000, Alan Somers wrote:
>> Author: asomers
>> Date: Fri Dec 16 22:39:30 2016
>> New Revision: 310180
>> URL: https://svnweb.freebsd.org/changeset/base/310180
>>
>> Log:
>>   Fix panic during lagg destruction with simultaneous status check
>>
>>   If you run "ifconfig lagg0 destroy" and "ifconfig lagg0" at the same time a
>>   page fault may result. The first process will destroy ifp->if_lagg in
>>   lagg_clone_destroy (called by if_clone_destroy). Then the second process
>>   will observe that ifp->if_lagg is NULL at the top of lagg_port_ioctl and
>>   goto fallback: where it will promptly dereference ifp->if_lagg anyway.
>>
>>   The solution is to repeat the NULL check for ifp->if_lagg
>>
>
> I don't understand how this solves the problem. What prevents the object
> from getting freed after the pointer got NULLified? That is, it seems
> the patch turns a null pointer deref into a use-after-free.
>
> There seems to be a refcounting issue here.
>
> That said, I only did cursory reading.

What object are you talking about?  The problem solved by this commit
is the null-pointer dereference in the thread calling lagg_port_ioctl,
for example "ifconfig lagg0".

From owner-svn-src-all@freebsd.org  Fri Dec 16 22:55:46 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7D21C8392E;
 Fri, 16 Dec 2016 22:55:46 +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 4CC3B9FF;
 Fri, 16 Dec 2016 22:55:45 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from [IPv6:2001:7b8:3a7::4ccf:cb4c:3c45:4bd1] (unknown
 [IPv6:2001:7b8:3a7:0:4ccf:cb4c:3c45:4bd1])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by tensor.andric.com (Postfix) with ESMTPSA id 1200914ECF;
 Fri, 16 Dec 2016 23:55:37 +0100 (CET)
Content-Type: multipart/signed;
 boundary="Apple-Mail=_75683770-38AA-4997-9E45-314B45B2629D";
 protocol="application/pgp-signature"; micalg=pgp-sha1
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: Re: svn commit: r310051 - in head: share/man/man9 sys/kern sys/sys
From: Dimitry Andric <dim@FreeBSD.org>
In-Reply-To: <201612141247.uBEClYYq008778@repo.freebsd.org>
Date: Fri, 16 Dec 2016 23:55:28 +0100
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Message-Id: <7B04505B-6DC1-4020-BC78-D5CC0B6F6B2C@FreeBSD.org>
References: <201612141247.uBEClYYq008778@repo.freebsd.org>
To: Ed Schouten <ed@FreeBSD.org>
X-Mailer: Apple Mail (2.3124)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 22:55:46 -0000


--Apple-Mail=_75683770-38AA-4997-9E45-314B45B2629D
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii

On 14 Dec 2016, at 13:47, Ed Schouten <ed@FreeBSD.org> wrote:
> 
> Author: ed
> Date: Wed Dec 14 12:47:34 2016
> New Revision: 310051
> URL: https://svnweb.freebsd.org/changeset/base/310051
> 
> Log:
>  Add support for attaching aggregation labels to sysctl objects.
...
>  The change presented in this commit adds support for accomplishing this,
>  by providing the ability to attach labels to nodes. In the example I
>  gave above, the label "thermal_zone" would be attached to "tz1". As this
>  is a feature that will only be used very rarely, I decided to not change
>  the KPI too aggressively.

Hi Ed,

Since this now causes VMware kernel modules to insta-panic the kernel,
it might be nice to put some warning in UPDATING, at least.  Luckily
__FreeBSD_version got bumped by Adrian in r310149 for something
unrelated, but this is definitely something to notify maintainers of
ports (with kernel modules) about too.

-Dimitry


--Apple-Mail=_75683770-38AA-4997-9E45-314B45B2629D
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

iEYEARECAAYFAlhUcOgACgkQsF6jCi4glqNQjgCfT8w+E6VExKkgaHjYhR8zrQhG
e3cAoItI6+uZrzUSD/nhjbdEzKOq8sB+
=sdKq
-----END PGP SIGNATURE-----

--Apple-Mail=_75683770-38AA-4997-9E45-314B45B2629D--

From owner-svn-src-all@freebsd.org  Fri Dec 16 22:57:39 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D08AC83B2D
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Fri, 16 Dec 2016 22:57:39 +0000 (UTC) (envelope-from joerg@bec.de)
Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net
 [217.70.183.195])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DD3E6E78
 for <svn-src-all@freebsd.org>; Fri, 16 Dec 2016 22:57:38 +0000 (UTC)
 (envelope-from joerg@bec.de)
Received: from britannica.bec.de
 (p200300D2ABCF63104639C4FFFE599710.dip0.t-ipconnect.de
 [IPv6:2003:d2:abcf:6310:4639:c4ff:fe59:9710])
 (Authenticated sender: joerg@bec.de)
 by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 15BAEA80CB
 for <svn-src-all@freebsd.org>; Fri, 16 Dec 2016 23:57:35 +0100 (CET)
Date: Fri, 16 Dec 2016 23:57:34 +0100
From: Joerg Sonnenberger <joerg@bec.de>
To: svn-src-all@freebsd.org
Subject: Re: svn commit: r310138 - head/lib/libc/stdio
Message-ID: <20161216225734.GA16509@britannica.bec.de>
References: <201612160144.uBG1ipjW016736@repo.freebsd.org>
 <20161216193128.wgskqt4vc44vdd7o@ivaldir.etoilebsd.net>
 <8CF1AB9C-83FE-495F-B07C-56F928282512@FreeBSD.org>
 <13059937.h5mayX8aKo@ralph.baldwin.cx>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <13059937.h5mayX8aKo@ralph.baldwin.cx>
User-Agent: Mutt/1.7.1 (2016-10-04)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 22:57:39 -0000

On Fri, Dec 16, 2016 at 02:45:19PM -0800, John Baldwin wrote:
> In general I agree with something like this instead, but it is quite a bit more
> tedious to use as you have to run it once to determine the length, allocate a
> buffer, and then run it again.

Why do you need to determine the length? It's not like people write
novells in the kernel to describe bit fields. A reasonable sized stack
buffer covers pretty much all the interesting cases.

Joerg

From owner-svn-src-all@freebsd.org  Fri Dec 16 23:05:48 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA245C83DB5;
 Fri, 16 Dec 2016 23:05:48 +0000 (UTC)
 (envelope-from matthew@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 841AE120B;
 Fri, 16 Dec 2016 23:05:48 +0000 (UTC)
 (envelope-from matthew@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBGN5li9039660;
 Fri, 16 Dec 2016 23:05:47 GMT (envelope-from matthew@FreeBSD.org)
Received: (from matthew@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGN5lvZ039657;
 Fri, 16 Dec 2016 23:05:47 GMT (envelope-from matthew@FreeBSD.org)
Message-Id: <201612162305.uBGN5lvZ039657@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: matthew set sender to
 matthew@FreeBSD.org using -f
From: Matthew Seaman <matthew@FreeBSD.org>
Date: Fri, 16 Dec 2016 23:05:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310181 - in head: . release/scripts 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 23:05:48 -0000

Author: matthew (ports committer)
Date: Fri Dec 16 23:05:47 2016
New Revision: 310181
URL: https://svnweb.freebsd.org/changeset/base/310181

Log:
  Revert r309339, thus re-instating r309314
  
  The original problem with conflicting definitions of ${PKG_CMD} was
  solved by r427523 in ports (see https://reviews.freebsd.org/D8677), so
  this should be safe now.
  
  Reviewed by:	gjb
  Approved by:	gjb
  Differential Revision:	https://reviews.freebsd.org/D8120

Modified:
  head/Makefile.inc1
  head/release/scripts/make-pkg-package.sh
  head/share/mk/bsd.own.mk

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Fri Dec 16 22:39:30 2016	(r310180)
+++ head/Makefile.inc1	Fri Dec 16 23:05:47 2016	(r310181)
@@ -1379,7 +1379,8 @@ packages: .PHONY
 package-pkg: .PHONY
 	rm -rf /tmp/ports.${TARGET} || :
 	env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${_REVISION} \
-		PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} WSTAGEDIR=${WSTAGEDIR} \
+		PKG_CMD=${PKG_CMD} PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} \
+		WSTAGEDIR=${WSTAGEDIR} \
 		sh ${.CURDIR}/release/scripts/make-pkg-package.sh
 
 real-packages:	stage-packages create-packages sign-packages .PHONY
@@ -1417,11 +1418,11 @@ create-world-packages:	_pkgbootstrap .PH
 			/^name/ { printf("===> Creating %s-", $$2); next } \
 			/^version/ { print $$2; next } \
 			' ${WSTAGEDIR}/$${pkgname}.ucl ; \
-		pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
+		${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
 			create -M ${WSTAGEDIR}/$${pkgname}.ucl \
 			-p ${WSTAGEDIR}/$${pkgname}.plist \
 			-r ${WSTAGEDIR} \
-			-o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \
+			-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \
 	done
 
 create-kernel-packages:	_pkgbootstrap .PHONY
@@ -1445,11 +1446,11 @@ create-kernel-packages:	_pkgbootstrap .P
 		/name/ { printf("===> Creating %s-", $$2); next } \
 		/version/ {print $$2; next } ' \
 		${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \
-	pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
+	${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
 		create -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \
 		-p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \
 		-r ${KSTAGEDIR}/${DISTDIR} \
-		-o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
+		-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
 .endfor
 .endif
 .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
@@ -1474,25 +1475,25 @@ create-kernel-packages:	_pkgbootstrap .P
 		/name/ { printf("===> Creating %s-", $$2); next } \
 		/version/ {print $$2; next } ' \
 		${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \
-	pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
+	${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
 		create -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \
 		-p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \
 		-r ${KSTAGEDIR}/kernel.${_kernel} \
-		-o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
+		-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
 .endfor
 .endif
 .endfor
 .endif
 
 sign-packages:	_pkgbootstrap .PHONY
-	@[ -L "${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \
-		unlink ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \
-	pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \
-		-o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
-		${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
+	@[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \
+		unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \
+	${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \
+		-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
+		${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
 		${PKGSIGNKEY} ; \
-	ln -s ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
-		${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest
+	ln -s ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
+		${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest
 
 #
 #

Modified: head/release/scripts/make-pkg-package.sh
==============================================================================
--- head/release/scripts/make-pkg-package.sh	Fri Dec 16 22:39:30 2016	(r310180)
+++ head/release/scripts/make-pkg-package.sh	Fri Dec 16 23:05:47 2016	(r310181)
@@ -8,6 +8,7 @@ eval $(make -C ${SRCDIR} TARGET=${TARGET
 export WRKDIRPREFIX=/tmp/ports.${TARGET}
 export WSTAGEDIR=${WSTAGEDIR}
 export REPODIR=${REPODIR}
+export PKG_CMD=${PKG_CMD}
 export PKG_VERSION=${PKG_VERSION}
 export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg -V WRKDIR)
 
@@ -15,11 +16,11 @@ make -C ${PORTSDIR}/ports-mgmt/pkg TARGE
 	CONFIGURE_ARGS="--host=$(uname -m)-portbld-freebsd${REVISION}" \
 	stage create-manifest
 
-pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh \
+${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh \
 	create -v -m ${WRKDIR}/.metadir/ \
 	-r ${WRKDIR}/stage \
 	-p ${WRKDIR}/.PLIST.mktmp \
-	-o ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
-mkdir -p ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/
-cd ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ && \
+	-o ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
+mkdir -p ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/
+cd ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ && \
 	ln -s ../pkg-*.txz

Modified: head/share/mk/bsd.own.mk
==============================================================================
--- head/share/mk/bsd.own.mk	Fri Dec 16 22:39:30 2016	(r310180)
+++ head/share/mk/bsd.own.mk	Fri Dec 16 23:05:47 2016	(r310181)
@@ -116,6 +116,9 @@
 # NLSMODE	National Language Support files mode. [${NOBINMODE}]
 #
 # INCLUDEDIR	Base path for standard C include files [/usr/include]
+#
+# PKG_CMD	Program for creating and manipulating packages.
+#               [pkg] 
 
 .if !target(__<bsd.own.mk>__)
 __<bsd.own.mk>__:
@@ -249,6 +252,8 @@ XZ_CMD?=	xz -T ${XZ_THREADS}
 XZ_CMD?=	xz
 .endif
 
+PKG_CMD?=	pkg
+
 # Pointer to the top directory into which tests are installed.  Should not be
 # overriden by Makefiles, but the user may choose to set this in src.conf(5).
 TESTSBASE?= /usr/tests

From owner-svn-src-all@freebsd.org  Fri Dec 16 23:19:14 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35548C83FBD;
 Fri, 16 Dec 2016 23:19:14 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from mail.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 12FF418AC;
 Fri, 16 Dec 2016 23:19:14 +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 mail.baldwin.cx (Postfix) with ESMTPSA id 15F8010AA2C;
 Fri, 16 Dec 2016 18:19:13 -0500 (EST)
From: John Baldwin <jhb@freebsd.org>
To: Eric van Gyzen <vangyzen@freebsd.org>
Cc: Dimitry Andric <dim@freebsd.org>, Baptiste Daroussin <bapt@freebsd.org>,
 "Conrad E. Meyer" <cem@freebsd.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r310138 - head/lib/libc/stdio
Date: Fri, 16 Dec 2016 15:07:25 -0800
Message-ID: <3160837.brVkGGj5yS@ralph.baldwin.cx>
User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; )
In-Reply-To: <9e255301-f663-a96c-68c7-e6d1a3d1db8c@FreeBSD.org>
References: <201612160144.uBG1ipjW016736@repo.freebsd.org>
 <13059937.h5mayX8aKo@ralph.baldwin.cx>
 <9e255301-f663-a96c-68c7-e6d1a3d1db8c@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.4.3
 (mail.baldwin.cx); Fri, 16 Dec 2016 18:19:13 -0500 (EST)
X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx
X-Virus-Status: Clean
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 23:19:14 -0000

On Friday, December 16, 2016 04:53:04 PM Eric van Gyzen wrote:
> On 12/16/2016 16:45, John Baldwin wrote:
> > On Friday, December 16, 2016 08:53:26 PM Dimitry Andric wrote:
> >> On 16 Dec 2016, at 20:31, Baptiste Daroussin <bapt@FreeBSD.org> wrote:
> >>>
> >>> On Fri, Dec 16, 2016 at 01:44:51AM +0000, Conrad E. Meyer wrote:
> >>>> Author: cem
> >>>> Date: Fri Dec 16 01:44:50 2016
> >>>> New Revision: 310138
> >>>> URL: https://svnweb.freebsd.org/changeset/base/310138
> >>>>
> >>>> Log:
> >>>>  vfprintf(3): Add support for kernel %b format
> >>>>
> >>>>  This is a direct port of the kernel %b format.
> >>>>
> >>>>  I'm unclear on if (more) non-portable printf extensions will be a
> >>>>  problem. I think it's desirable to have userspace formats include all
> >>>>  kernel formats, but there may be competing goals I'm not aware of.
> >>>>
> >>>>  Reviewed by:	no one, unfortunately
> >>>>  Sponsored by:	Dell EMC Isilon
> >>>>  Differential Revision:	https://reviews.freebsd.org/D8426
> >>>>
> >>>
> >>> I really don't think it is a good idea, if used in userland it would be make
> >>> more of our code difficult to port elsewhere.
> >>
> >> Indeed, this is a bad idea.  These custom format specifiers should be
> >> eliminated, not multiplied. :-)
> >>
> >>
> >>> Other than that, it makes more difficult to use vanilla gcc with out userland.
> >>> and it is adding more complexity to be able to build freebsd from a non freebsd
> >>> system which some people are working on.
> >>>
> >>> Personnaly I would prefer to see those extensions removed from the kernel rather
> >>> than see them available in userland.
> >>
> >> Same here.
> >>
> >>
> >>> Can't we use simple helper function instead?
> >>
> >> Yes, please.  Just take the snprintb(3) function from NetBSD:
> >>
> >> http://netbsd.gw.com/cgi-bin/man-cgi?snprintb+3+NetBSD-current
> > 
> > In general I agree with something like this instead, but it is quite a bit more
> > tedious to use as you have to run it once to determine the length, allocate a
> > buffer, and then run it again.  Calling malloc() for that buffer isn't always
> > convenient in the kernel (though it should be fine in userland).  Having it live
> > in printf() itself means the output is generated to the stream without having to
> > manage a variable-sized intermediate buffer.
> 
> I imagine most callers can simply use a char[sizeof(fmt)+C] on the stack, where
> C is some constant that I haven't taken the time to calculate, at the risk of
> making myself look foolish and unprofessional.

Hmm, that might work, but it is still cumbersome.  Probably to make things readable
we'd end up with a wrapper:

printb(uint val, const char *fmt)
{
   char buf[strlen(fmt) + C];

   snprintb(...);
   printf("%s", buf);
}

-- 
John Baldwin

From owner-svn-src-all@freebsd.org  Fri Dec 16 23:33:38 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1210C836B1;
 Fri, 16 Dec 2016 23:33:38 +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 8F17975B;
 Fri, 16 Dec 2016 23:33:38 +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 uBGNXb6J051695;
 Fri, 16 Dec 2016 23:33:37 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGNXbnM051694;
 Fri, 16 Dec 2016 23:33:37 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612162333.uBGNXbnM051694@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Fri, 16 Dec 2016 23:33:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310182 - 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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 23:33:38 -0000

Author: kib
Date: Fri Dec 16 23:33:37 2016
New Revision: 310182
URL: https://svnweb.freebsd.org/changeset/base/310182

Log:
  In swp_pager_meta_free_all(), fix type of the index variable.  Style.
  
  Noted and reviewed by:	alc (previous version)
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Fri Dec 16 23:05:47 2016	(r310181)
+++ head/sys/vm/swap_pager.c	Fri Dec 16 23:33:37 2016	(r310182)
@@ -1916,30 +1916,30 @@ swp_pager_meta_free(vm_object_t object, 
 static void
 swp_pager_meta_free_all(vm_object_t object)
 {
-	daddr_t index = 0;
+	struct swblock **pswap, *swap;
+	vm_pindex_t index;
+	daddr_t v;
+	int i;
 
 	VM_OBJECT_ASSERT_WLOCKED(object);
 	if (object->type != OBJT_SWAP)
 		return;
 
-	while (object->un_pager.swp.swp_bcount) {
-		struct swblock **pswap;
-		struct swblock *swap;
-
+	index = 0;
+	while (object->un_pager.swp.swp_bcount != 0) {
 		mtx_lock(&swhash_mtx);
 		pswap = swp_pager_hash(object, index);
 		if ((swap = *pswap) != NULL) {
-			int i;
-
 			for (i = 0; i < SWAP_META_PAGES; ++i) {
-				daddr_t v = swap->swb_pages[i];
+				v = swap->swb_pages[i];
 				if (v != SWAPBLK_NONE) {
 					--swap->swb_count;
 					swp_pager_freeswapspace(v, 1);
 				}
 			}
 			if (swap->swb_count != 0)
-				panic("swap_pager_meta_free_all: swb_count != 0");
+				panic(
+				    "swap_pager_meta_free_all: swb_count != 0");
 			*pswap = swap->swb_hnext;
 			uma_zfree(swap_zone, swap);
 			--object->un_pager.swp.swp_bcount;

From owner-svn-src-all@freebsd.org  Fri Dec 16 23:42:50 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91E31C838A9;
 Fri, 16 Dec 2016 23:42:50 +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 472D5C82;
 Fri, 16 Dec 2016 23:42:50 +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 uBGNgnTa055952;
 Fri, 16 Dec 2016 23:42:49 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBGNgnYK055951;
 Fri, 16 Dec 2016 23:42:49 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201612162342.uBGNgnYK055951@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov <kib@FreeBSD.org>
Date: Fri, 16 Dec 2016 23:42:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r310183 - stable/10/sys/kern
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 23:42:50 -0000

Author: kib
Date: Fri Dec 16 23:42:49 2016
New Revision: 310183
URL: https://svnweb.freebsd.org/changeset/base/310183

Log:
  MFC r296775 (by gibbs):
  Provide high precision conversion from ns,us,ms -> sbintime in kevent.
  
  Tested by:	ian

Modified:
  stable/10/sys/kern/kern_event.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_event.c
==============================================================================
--- stable/10/sys/kern/kern_event.c	Fri Dec 16 23:33:37 2016	(r310182)
+++ stable/10/sys/kern/kern_event.c	Fri Dec 16 23:42:49 2016	(r310183)
@@ -556,34 +556,59 @@ knote_fork(struct knlist *list, int pid)
 #define NOTE_TIMER_PRECMASK	(NOTE_SECONDS|NOTE_MSECONDS|NOTE_USECONDS| \
 				NOTE_NSECONDS)
 
-static __inline sbintime_t
+static sbintime_t
 timer2sbintime(intptr_t data, int flags)
 {
-	sbintime_t modifier;
 
+        /*
+         * Macros for converting to the fractional second portion of an
+         * sbintime_t using 64bit multiplication to improve precision.
+         */
+#define NS_TO_SBT(ns) (((ns) * (((uint64_t)1 << 63) / 500000000)) >> 32)
+#define US_TO_SBT(us) (((us) * (((uint64_t)1 << 63) / 500000)) >> 32)
+#define MS_TO_SBT(ms) (((ms) * (((uint64_t)1 << 63) / 500)) >> 32)
 	switch (flags & NOTE_TIMER_PRECMASK) {
 	case NOTE_SECONDS:
-		modifier = SBT_1S;
-		break;
+#ifdef __LP64__
+		if (data > (SBT_MAX / SBT_1S))
+			return SBT_MAX;
+#endif
+		return ((sbintime_t)data << 32);
 	case NOTE_MSECONDS: /* FALLTHROUGH */
 	case 0:
-		modifier = SBT_1MS;
-		break;
+		if (data >= 1000) {
+			int64_t secs = data / 1000;
+#ifdef __LP64__
+			if (secs > (SBT_MAX / SBT_1S))
+				return SBT_MAX;
+#endif
+			return (secs << 32 | MS_TO_SBT(data % 1000));
+		}
+		return MS_TO_SBT(data);
 	case NOTE_USECONDS:
-		modifier = SBT_1US;
-		break;
+		if (data >= 1000000) {
+			int64_t secs = data / 1000000;
+#ifdef __LP64__
+			if (secs > (SBT_MAX / SBT_1S))
+				return SBT_MAX;
+#endif
+			return (secs << 32 | US_TO_SBT(data % 1000000));
+		}
+		return US_TO_SBT(data);
 	case NOTE_NSECONDS:
-		modifier = SBT_1NS;
-		break;
-	default:
-		return (-1);
-	}
-
+		if (data >= 1000000000) {
+			int64_t secs = data / 1000000000;
 #ifdef __LP64__
-	if (data > SBT_MAX / modifier)
-		return (SBT_MAX);
+			if (secs > (SBT_MAX / SBT_1S))
+				return SBT_MAX;
 #endif
-	return (modifier * data);
+			return (secs << 32 | US_TO_SBT(data % 1000000000));
+		}
+		return NS_TO_SBT(data);
+	default:
+		break;
+	}
+	return (-1);
 }
 
 static void

From owner-svn-src-all@freebsd.org  Fri Dec 16 23:44:04 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEE08C83926
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Fri, 16 Dec 2016 23:44:04 +0000 (UTC)
 (envelope-from wlosh@bsdimp.com)
Received: from mail-io0-x241.google.com (mail-io0-x241.google.com
 [IPv6:2607:f8b0:4001:c06::241])
 (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 92FABDFC
 for <svn-src-all@freebsd.org>; Fri, 16 Dec 2016 23:44:04 +0000 (UTC)
 (envelope-from wlosh@bsdimp.com)
Received: by mail-io0-x241.google.com with SMTP id b194so13472300ioa.3
 for <svn-src-all@freebsd.org>; Fri, 16 Dec 2016 15:44:04 -0800 (PST)
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:from:date:message-id
 :subject:to:cc;
 bh=5Hgdhz38M73CrHsa9UzmCwM3KRhPyffIfbayxfsli7o=;
 b=cq2hyMBAtT9Bh/GeRHwUBP344Dnv6Y1bPPzkFCz3PzSPIdmqpdfDaGqdkteoIfvgqN
 ulAwNg9Zc6b4ao8M9VrfmzDtA/1VW7l6PMwcxejSXfwjxeRM7Fne4Eel9uaa96EkNE5J
 7Reyt/ia1bGrk4FWkVgMWPQNONwb2aiI0T623ymjQpKpLzFmktQBf9jFZJODhVYiuCQs
 lE66uhjctS7NIQU+45ArOWwGFIJvrdra8Pk1xk9s29P4rlffujOAz/NAtLt4SN2wSMcX
 e5ghjspoH55Ys/sQPYblJI3WdxNQeV0KAbg37YmLPTXw44muyWC6nV2s5hCLbeKp2EkA
 ZsRw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc;
 bh=5Hgdhz38M73CrHsa9UzmCwM3KRhPyffIfbayxfsli7o=;
 b=REf+ENMar2zt8Nr8wu7BGTJpqLXb8M8ynKTXZwfyn03R94RQB+yHll8DWnnW0VoRQj
 zWqj7dQETdNU4gonE18EnBP0BQyQ6Eq/4XTy+98GCtlGd7kHlHwm+ZBe77bTZ8MyKf6y
 3M3Zt6Z4QbBqTd17v7WHY8Zn45BDupBn4MFa2XPi4L4Ce+0X9uAbNSUrXxtVWSKivM4E
 rmOjXZKxF6WGpybraUc6BMgHCNOj6KUoAPSMAP0X5EF9GY/EH/gMUFT9Wz4EtQRxrHiE
 2+ogKU13ZpXxxfsgIFTKF7zAwqfT8MG7yPZ3oVgTb+GesHss40FuWL56ikj79KKHsnVa
 DLew==
X-Gm-Message-State: AKaTC03iyIXrHrweBee2zVnA6FMVf8m4YB0/AnvWJisO1EnRWGi3xep3FJglg7GdKAc4KSIh16RpXNyLAnfrpg==
X-Received: by 10.107.139.74 with SMTP id n71mr5973923iod.166.1481931843803;
 Fri, 16 Dec 2016 15:44:03 -0800 (PST)
MIME-Version: 1.0
Sender: wlosh@bsdimp.com
Received: by 10.79.22.135 with HTTP; Fri, 16 Dec 2016 15:44:03 -0800 (PST)
X-Originating-IP: [156.39.10.46]
In-Reply-To: <3160837.brVkGGj5yS@ralph.baldwin.cx>
References: <201612160144.uBG1ipjW016736@repo.freebsd.org>
 <13059937.h5mayX8aKo@ralph.baldwin.cx>
 <9e255301-f663-a96c-68c7-e6d1a3d1db8c@FreeBSD.org>
 <3160837.brVkGGj5yS@ralph.baldwin.cx>
From: Warner Losh <imp@bsdimp.com>
Date: Fri, 16 Dec 2016 15:44:03 -0800
X-Google-Sender-Auth: fo3usF53bE4B160ISGJs01clhx4
Message-ID: <CANCZdfrNu0=qPuMX8SA2H-MUXGb5rei06_dQg9XGp-Miu3Xsfg@mail.gmail.com>
Subject: Re: svn commit: r310138 - head/lib/libc/stdio
To: John Baldwin <jhb@freebsd.org>
Cc: Eric van Gyzen <vangyzen@freebsd.org>, Dimitry Andric <dim@freebsd.org>, 
 Baptiste Daroussin <bapt@freebsd.org>, "Conrad E. Meyer" <cem@freebsd.org>,
 src-committers <src-committers@freebsd.org>, 
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, 
 "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Content-Type: text/plain; charset=UTF-8
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Dec 2016 23:44:04 -0000

On Fri, Dec 16, 2016 at 3:07 PM, John Baldwin <jhb@freebsd.org> wrote:
> On Friday, December 16, 2016 04:53:04 PM Eric van Gyzen wrote:
>> On 12/16/2016 16:45, John Baldwin wrote:
>> > On Friday, December 16, 2016 08:53:26 PM Dimitry Andric wrote:
>> >> On 16 Dec 2016, at 20:31, Baptiste Daroussin <bapt@FreeBSD.org> wrote:
>> >>>
>> >>> On Fri, Dec 16, 2016 at 01:44:51AM +0000, Conrad E. Meyer wrote:
>> >>>> Author: cem
>> >>>> Date: Fri Dec 16 01:44:50 2016
>> >>>> New Revision: 310138
>> >>>> URL: https://svnweb.freebsd.org/changeset/base/310138
>> >>>>
>> >>>> Log:
>> >>>>  vfprintf(3): Add support for kernel %b format
>> >>>>
>> >>>>  This is a direct port of the kernel %b format.
>> >>>>
>> >>>>  I'm unclear on if (more) non-portable printf extensions will be a
>> >>>>  problem. I think it's desirable to have userspace formats include all
>> >>>>  kernel formats, but there may be competing goals I'm not aware of.
>> >>>>
>> >>>>  Reviewed by:    no one, unfortunately
>> >>>>  Sponsored by:   Dell EMC Isilon
>> >>>>  Differential Revision:  https://reviews.freebsd.org/D8426
>> >>>>
>> >>>
>> >>> I really don't think it is a good idea, if used in userland it would be make
>> >>> more of our code difficult to port elsewhere.
>> >>
>> >> Indeed, this is a bad idea.  These custom format specifiers should be
>> >> eliminated, not multiplied. :-)
>> >>
>> >>
>> >>> Other than that, it makes more difficult to use vanilla gcc with out userland.
>> >>> and it is adding more complexity to be able to build freebsd from a non freebsd
>> >>> system which some people are working on.
>> >>>
>> >>> Personnaly I would prefer to see those extensions removed from the kernel rather
>> >>> than see them available in userland.
>> >>
>> >> Same here.
>> >>
>> >>
>> >>> Can't we use simple helper function instead?
>> >>
>> >> Yes, please.  Just take the snprintb(3) function from NetBSD:
>> >>
>> >> http://netbsd.gw.com/cgi-bin/man-cgi?snprintb+3+NetBSD-current
>> >
>> > In general I agree with something like this instead, but it is quite a bit more
>> > tedious to use as you have to run it once to determine the length, allocate a
>> > buffer, and then run it again.  Calling malloc() for that buffer isn't always
>> > convenient in the kernel (though it should be fine in userland).  Having it live
>> > in printf() itself means the output is generated to the stream without having to
>> > manage a variable-sized intermediate buffer.
>>
>> I imagine most callers can simply use a char[sizeof(fmt)+C] on the stack, where
>> C is some constant that I haven't taken the time to calculate, at the risk of
>> making myself look foolish and unprofessional.
>
> Hmm, that might work, but it is still cumbersome.  Probably to make things readable
> we'd end up with a wrapper:
>
> printb(uint val, const char *fmt)
> {
>    char buf[strlen(fmt) + C];
>
>    snprintb(...);
>    printf("%s", buf);
> }

Sadly this "cure" is worse than the disease.

Warner

From owner-svn-src-all@freebsd.org  Sat Dec 17 01:31:33 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F69C8384E;
 Sat, 17 Dec 2016 01:31:33 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from smtp.vangyzen.net (hotblack.vangyzen.net
 [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f])
 by mx1.freebsd.org (Postfix) with ESMTP id 47067956;
 Sat, 17 Dec 2016 01:31:33 +0000 (UTC)
 (envelope-from vangyzen@FreeBSD.org)
Received: from ford.home.vangyzen.net (unknown [76.164.15.242])
 by smtp.vangyzen.net (Postfix) with ESMTPSA id 63C565647F;
 Fri, 16 Dec 2016 19:31:32 -0600 (CST)
Subject: Re: svn commit: r310138 - head/lib/libc/stdio
To: Warner Losh <imp@bsdimp.com>, John Baldwin <jhb@freebsd.org>
References: <201612160144.uBG1ipjW016736@repo.freebsd.org>
 <13059937.h5mayX8aKo@ralph.baldwin.cx>
 <9e255301-f663-a96c-68c7-e6d1a3d1db8c@FreeBSD.org>
 <3160837.brVkGGj5yS@ralph.baldwin.cx>
 <CANCZdfrNu0=qPuMX8SA2H-MUXGb5rei06_dQg9XGp-Miu3Xsfg@mail.gmail.com>
Cc: Dimitry Andric <dim@freebsd.org>, Baptiste Daroussin <bapt@freebsd.org>,
 "Conrad E. Meyer" <cem@freebsd.org>,
 src-committers <src-committers@freebsd.org>,
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,
 "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
From: Eric van Gyzen <vangyzen@FreeBSD.org>
Message-ID: <e2056221-26ad-5108-3385-865abff12d78@FreeBSD.org>
Date: Fri, 16 Dec 2016 19:31:28 -0600
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101
 Thunderbird/45.4.0
MIME-Version: 1.0
In-Reply-To: <CANCZdfrNu0=qPuMX8SA2H-MUXGb5rei06_dQg9XGp-Miu3Xsfg@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 17 Dec 2016 01:31:33 -0000

On 12/16/2016 17:44, Warner Losh wrote:
> On Fri, Dec 16, 2016 at 3:07 PM, John Baldwin <jhb@freebsd.org> wrote:
>> On Friday, December 16, 2016 04:53:04 PM Eric van Gyzen wrote:
>>> On 12/16/2016 16:45, John Baldwin wrote:
>>>> On Friday, December 16, 2016 08:53:26 PM Dimitry Andric wrote:
>>>>> On 16 Dec 2016, at 20:31, Baptiste Daroussin <bapt@FreeBSD.org> wrote:
>>>>>>
>>>>>> On Fri, Dec 16, 2016 at 01:44:51AM +0000, Conrad E. Meyer wrote:
>>>>>>> Author: cem
>>>>>>> Date: Fri Dec 16 01:44:50 2016
>>>>>>> New Revision: 310138
>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/310138
>>>>>>>
>>>>>>> Log:
>>>>>>>  vfprintf(3): Add support for kernel %b format
>>>>>>>
>>>>>>>  This is a direct port of the kernel %b format.
>>>>>>>
>>>>>>>  I'm unclear on if (more) non-portable printf extensions will be a
>>>>>>>  problem. I think it's desirable to have userspace formats include all
>>>>>>>  kernel formats, but there may be competing goals I'm not aware of.
>>>>>>>
>>>>>>>  Reviewed by:    no one, unfortunately
>>>>>>>  Sponsored by:   Dell EMC Isilon
>>>>>>>  Differential Revision:  https://reviews.freebsd.org/D8426
>>>>>>>
>>>>>>
>>>>>> I really don't think it is a good idea, if used in userland it would be make
>>>>>> more of our code difficult to port elsewhere.
>>>>>
>>>>> Indeed, this is a bad idea.  These custom format specifiers should be
>>>>> eliminated, not multiplied. :-)
>>>>>
>>>>>
>>>>>> Other than that, it makes more difficult to use vanilla gcc with out userland.
>>>>>> and it is adding more complexity to be able to build freebsd from a non freebsd
>>>>>> system which some people are working on.
>>>>>>
>>>>>> Personnaly I would prefer to see those extensions removed from the kernel rather
>>>>>> than see them available in userland.
>>>>>
>>>>> Same here.
>>>>>
>>>>>
>>>>>> Can't we use simple helper function instead?
>>>>>
>>>>> Yes, please.  Just take the snprintb(3) function from NetBSD:
>>>>>
>>>>> http://netbsd.gw.com/cgi-bin/man-cgi?snprintb+3+NetBSD-current
>>>>
>>>> In general I agree with something like this instead, but it is quite a bit more
>>>> tedious to use as you have to run it once to determine the length, allocate a
>>>> buffer, and then run it again.  Calling malloc() for that buffer isn't always
>>>> convenient in the kernel (though it should be fine in userland).  Having it live
>>>> in printf() itself means the output is generated to the stream without having to
>>>> manage a variable-sized intermediate buffer.
>>>
>>> I imagine most callers can simply use a char[sizeof(fmt)+C] on the stack, where
>>> C is some constant that I haven't taken the time to calculate, at the risk of
>>> making myself look foolish and unprofessional.
>>
>> Hmm, that might work, but it is still cumbersome.  Probably to make things readable
>> we'd end up with a wrapper:
>>
>> printb(uint val, const char *fmt)
>> {
>>    char buf[strlen(fmt) + C];
>>
>>    snprintb(...);
>>    printf("%s", buf);
>> }
> 
> Sadly this "cure" is worse than the disease.

How about this cure?

	printf("reg=%b\n", value, FORMAT);

	// versus

	char buf[BITMASK_BUFFER_SIZE(FORMAT)];
	printf("reg=%s\n", format_bitmask(buf, sizeof(buf), value, FORMAT));

That doesn't seem so bad.

Eric

From owner-svn-src-all@freebsd.org  Sat Dec 17 02:01:07 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B07BC82FF0;
 Sat, 17 Dec 2016 02:01:07 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D9E2F194C;
 Sat, 17 Dec 2016 02:01:06 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBH2164k011420;
 Sat, 17 Dec 2016 02:01:06 GMT (envelope-from mm@FreeBSD.org)
Received: (from mm@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBH215fV011417;
 Sat, 17 Dec 2016 02:01:05 GMT (envelope-from mm@FreeBSD.org)
Message-Id: <201612170201.uBH215fV011417@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org
 using -f
From: Martin Matuska <mm@FreeBSD.org>
Date: Sat, 17 Dec 2016 02:01:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r310184 - in vendor/libarchive/dist: build libarchive
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 17 Dec 2016 02:01:07 -0000

Author: mm
Date: Sat Dec 17 02:01:05 2016
New Revision: 310184
URL: https://svnweb.freebsd.org/changeset/base/310184

Log:
  Add vendor/libarchive/dist files missing in r310115

Added:
  vendor/libarchive/dist/build/ci_test_driver   (contents, props changed)
  vendor/libarchive/dist/libarchive/archive_openssl_evp_private.h   (contents, props changed)
  vendor/libarchive/dist/libarchive/archive_openssl_hmac_private.h   (contents, props changed)

Added: vendor/libarchive/dist/build/ci_test_driver
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libarchive/dist/build/ci_test_driver	Sat Dec 17 02:01:05 2016	(r310184)
@@ -0,0 +1,148 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2013-07-13.22; # UTC
+
+# Copyright (C) 2011-2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+# Make unconditional expansion of undefined variables an error.  This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+  echo "$0: $*" >&2
+  print_usage >&2
+  exit 2
+}
+
+print_usage ()
+{
+  cat <<END
+Usage:
+  test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+              [--expect-failure={yes|no}] [--color-tests={yes|no}]
+              [--enable-hard-errors={yes|no}] [--]
+              TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+test_name= # Used for reporting.
+log_file=  # Where to save the output of the test script.
+trs_file=  # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+  case $1 in
+  --help) print_usage; exit $?;;
+  --version) echo "test-driver $scriptversion"; exit $?;;
+  --test-name) test_name=$2; shift;;
+  --log-file) log_file=$2; shift;;
+  --trs-file) trs_file=$2; shift;;
+  --color-tests) color_tests=$2; shift;;
+  --expect-failure) expect_failure=$2; shift;;
+  --enable-hard-errors) enable_hard_errors=$2; shift;;
+  --) shift; break;;
+  -*) usage_error "invalid option: '$1'";;
+   *) break;;
+  esac
+  shift
+done
+
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file"  = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file"  = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+  usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+  usage_error "missing argument"
+fi
+
+if test $color_tests = yes; then
+  # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+  red='' # Red.
+  grn='' # Green.
+  lgn='' # Light green.
+  blu='' # Blue.
+  mgn='' # Magenta.
+  std=''     # No color.
+else
+  red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" | tee $log_file 2>&1
+estatus=$?
+
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+  tweaked_estatus=1
+else
+  tweaked_estatus=$estatus
+fi
+
+case $tweaked_estatus:$expect_failure in
+  0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+  0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
+  77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
+  99:*)  col=$mgn res=ERROR recheck=yes gcopy=yes;;
+  *:yes) col=$lgn res=XFAIL recheck=no  gcopy=yes;;
+  *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
+esac
+
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:

Added: vendor/libarchive/dist/libarchive/archive_openssl_evp_private.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libarchive/dist/libarchive/archive_openssl_evp_private.h	Sat Dec 17 02:01:05 2016	(r310184)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * 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(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED 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(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (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 ARCHIVE_OPENSSL_EVP_PRIVATE_H_INCLUDED
+#define ARCHIVE_OPENSSL_EVP_PRIVATE_H_INCLUDED
+
+#include <openssl/evp.h>
+#include <openssl/opensslv.h>
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#include <stdlib.h> /* malloc, free */
+#include <string.h> /* memset */
+static inline EVP_MD_CTX *EVP_MD_CTX_new(void)
+{
+	EVP_MD_CTX *ctx = (EVP_MD_CTX *)calloc(1, sizeof(EVP_MD_CTX));
+	return ctx;
+}
+
+static inline void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
+{
+	EVP_MD_CTX_cleanup(ctx);
+	memset(ctx, 0, sizeof(*ctx));
+	free(ctx);
+}
+#endif
+
+#endif

Added: vendor/libarchive/dist/libarchive/archive_openssl_hmac_private.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libarchive/dist/libarchive/archive_openssl_hmac_private.h	Sat Dec 17 02:01:05 2016	(r310184)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * 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(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED 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(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (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 ARCHIVE_OPENSSL_HMAC_PRIVATE_H_INCLUDED
+#define ARCHIVE_OPENSSL_HMAC_PRIVATE_H_INCLUDED
+
+#include <openssl/hmac.h>
+#include <openssl/opensslv.h>
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#include <stdlib.h> /* malloc, free */
+#include <string.h> /* memset */
+static inline HMAC_CTX *HMAC_CTX_new(void)
+{
+	HMAC_CTX *ctx = (HMAC_CTX *)calloc(1, sizeof(HMAC_CTX));
+	return ctx;
+}
+
+static inline void HMAC_CTX_free(HMAC_CTX *ctx)
+{
+	HMAC_CTX_cleanup(ctx);
+	memset(ctx, 0, sizeof(*ctx));
+	free(ctx);
+}
+#endif
+
+#endif

From owner-svn-src-all@freebsd.org  Sat Dec 17 02:07:12 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A5F9C833F7;
 Sat, 17 Dec 2016 02:07:12 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 40AB71DB6;
 Sat, 17 Dec 2016 02:07:12 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBH27BTn013791;
 Sat, 17 Dec 2016 02:07:11 GMT (envelope-from mm@FreeBSD.org)
Received: (from mm@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBH278f3013759;
 Sat, 17 Dec 2016 02:07:08 GMT (envelope-from mm@FreeBSD.org)
Message-Id: <201612170207.uBH278f3013759@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org
 using -f
From: Martin Matuska <mm@FreeBSD.org>
Date: Sat, 17 Dec 2016 02:07:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310185 - in head/contrib/libarchive: cat cpio cpio/test
 libarchive libarchive/test tar/test
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 17 Dec 2016 02:07:12 -0000

Author: mm
Date: Sat Dec 17 02:07:08 2016
New Revision: 310185
URL: https://svnweb.freebsd.org/changeset/base/310185

Log:
  MFV r310115,310184:
  
  Sync libarchive with vendor.
  
  Vendor bugfixes (relevant to FreeBSD):
  PR 830, 831, 833: Spelling fixes
  OSS-Fuzz 227, 230, 239: Fix possible memory leak in archive_read_free()
  OSS-Fuzz 237: Fix heap buffer overflow when reading invalid ar archives
  
  MFC after:	1 week

Added:
  head/contrib/libarchive/libarchive/archive_openssl_evp_private.h
     - copied unchanged from r310184, vendor/libarchive/dist/libarchive/archive_openssl_evp_private.h
  head/contrib/libarchive/libarchive/archive_openssl_hmac_private.h
     - copied unchanged from r310184, vendor/libarchive/dist/libarchive/archive_openssl_hmac_private.h
Modified:
  head/contrib/libarchive/cat/bsdcat.c
  head/contrib/libarchive/cpio/cpio.c
  head/contrib/libarchive/cpio/test/test_option_lz4.c
  head/contrib/libarchive/libarchive/archive.h
  head/contrib/libarchive/libarchive/archive_acl.c
  head/contrib/libarchive/libarchive/archive_cryptor.c
  head/contrib/libarchive/libarchive/archive_cryptor_private.h
  head/contrib/libarchive/libarchive/archive_digest.c
  head/contrib/libarchive/libarchive/archive_digest_private.h
  head/contrib/libarchive/libarchive/archive_entry.c
  head/contrib/libarchive/libarchive/archive_hmac.c
  head/contrib/libarchive/libarchive/archive_hmac_private.h
  head/contrib/libarchive/libarchive/archive_options.c
  head/contrib/libarchive/libarchive/archive_read.c
  head/contrib/libarchive/libarchive/archive_read_append_filter.c
  head/contrib/libarchive/libarchive/archive_read_disk_posix.c
  head/contrib/libarchive/libarchive/archive_read_extract2.c
  head/contrib/libarchive/libarchive/archive_read_open_memory.c
  head/contrib/libarchive/libarchive/archive_read_private.h
  head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c
  head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c
  head/contrib/libarchive/libarchive/archive_read_support_format_ar.c
  head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c
  head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c
  head/contrib/libarchive/libarchive/archive_read_support_format_rar.c
  head/contrib/libarchive/libarchive/archive_read_support_format_tar.c
  head/contrib/libarchive/libarchive/archive_read_support_format_warc.c
  head/contrib/libarchive/libarchive/archive_string.c
  head/contrib/libarchive/libarchive/archive_write.c
  head/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c
  head/contrib/libarchive/libarchive/archive_write_disk_posix.c
  head/contrib/libarchive/libarchive/archive_write_disk_set_standard_lookup.c
  head/contrib/libarchive/libarchive/archive_write_open_memory.c
  head/contrib/libarchive/libarchive/archive_write_set_format_ar.c
  head/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c
  head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c
  head/contrib/libarchive/libarchive/archive_write_set_format_pax.c
  head/contrib/libarchive/libarchive/archive_write_set_format_shar.c
  head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c
  head/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c
  head/contrib/libarchive/libarchive/archive_write_set_format_xar.c
  head/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c
  head/contrib/libarchive/libarchive/test/test_pax_filename_encoding.c
  head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c
  head/contrib/libarchive/tar/test/test_option_lz4.c
Directory Properties:
  head/contrib/libarchive/   (props changed)

Modified: head/contrib/libarchive/cat/bsdcat.c
==============================================================================
--- head/contrib/libarchive/cat/bsdcat.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/cat/bsdcat.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -142,5 +142,8 @@ main(int argc, char **argv)
 			bsdcat_next();
 		}
 
+	if (a != NULL)
+		archive_read_free(a);
+
 	exit(exit_status);
 }

Modified: head/contrib/libarchive/cpio/cpio.c
==============================================================================
--- head/contrib/libarchive/cpio/cpio.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/cpio/cpio.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -1324,10 +1324,9 @@ lookup_name(struct cpio *cpio, struct na
 
 
 	if (*name_cache_variable == NULL) {
-		*name_cache_variable = malloc(sizeof(struct name_cache));
+		*name_cache_variable = calloc(1, sizeof(struct name_cache));
 		if (*name_cache_variable == NULL)
 			lafe_errc(1, ENOMEM, "No more memory");
-		memset(*name_cache_variable, 0, sizeof(struct name_cache));
 		(*name_cache_variable)->size = name_cache_size;
 	}
 

Modified: head/contrib/libarchive/cpio/test/test_option_lz4.c
==============================================================================
--- head/contrib/libarchive/cpio/test/test_option_lz4.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/cpio/test/test_option_lz4.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -63,6 +63,13 @@ DEFINE_TEST(test_option_lz4)
 			    "but no such program is available on this system.");
 			return;
 		}
+		/* On some systems the error won't be detected until closing
+		   time, by a 127 exit error returned by waitpid. */
+		if (strstr(p, "Error closing") != NULL && !canLz4()) {
+			skipping("This version of bsdcpio uses an external lz4 program "
+			    "but no such program is available on this system.");
+			return;
+		}
 		failure("--lz4 option is broken: %s", p);
 		assertEqualInt(r, 0);
 		return;

Modified: head/contrib/libarchive/libarchive/archive.h
==============================================================================
--- head/contrib/libarchive/libarchive/archive.h	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive.h	Sat Dec 17 02:07:08 2016	(r310185)
@@ -373,7 +373,7 @@ typedef const char *archive_passphrase_c
  *   4) Repeatedly call archive_read_next_header to get information about
  *      successive archive entries.  Call archive_read_data to extract
  *      data for entries of interest.
- *   5) Call archive_read_finish to end processing.
+ *   5) Call archive_read_free to end processing.
  */
 __LA_DECL struct archive	*archive_read_new(void);
 

Modified: head/contrib/libarchive/libarchive/archive_acl.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_acl.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_acl.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -280,11 +280,17 @@ acl_new_entry(struct archive_acl *acl,
 		acl->acl_text = NULL;
 	}
 
-	/* If there's a matching entry already in the list, overwrite it. */
+	/*
+	 * If there's a matching entry already in the list, overwrite it.
+	 * NFSv4 entries may be repeated and are not overwritten.
+	 *
+	 * TODO: compare names of no id is provided (needs more rework)
+	 */
 	ap = acl->acl_head;
 	aq = NULL;
 	while (ap != NULL) {
-		if (ap->type == type && ap->tag == tag && ap->id == id) {
+		if (((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) &&
+		    ap->type == type && ap->tag == tag && ap->id == id) {
 			if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER &&
 			    tag != ARCHIVE_ENTRY_ACL_GROUP)) {
 				ap->permset = permset;
@@ -296,10 +302,9 @@ acl_new_entry(struct archive_acl *acl,
 	}
 
 	/* Add a new entry to the end of the list. */
-	ap = (struct archive_acl_entry *)malloc(sizeof(*ap));
+	ap = (struct archive_acl_entry *)calloc(1, sizeof(*ap));
 	if (ap == NULL)
 		return (NULL);
-	memset(ap, 0, sizeof(*ap));
 	if (aq == NULL)
 		acl->acl_head = ap;
 	else

Modified: head/contrib/libarchive/libarchive/archive_cryptor.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_cryptor.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_cryptor.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -302,6 +302,8 @@ aes_ctr_release(archive_crypto_ctx *ctx)
 static int
 aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *key, size_t key_len)
 {
+	if ((ctx->ctx = EVP_CIPHER_CTX_new()) == NULL)
+		return -1;
 
 	switch (key_len) {
 	case 16: ctx->type = EVP_aes_128_ecb(); break;
@@ -314,7 +316,7 @@ aes_ctr_init(archive_crypto_ctx *ctx, co
 	memcpy(ctx->key, key, key_len);
 	memset(ctx->nonce, 0, sizeof(ctx->nonce));
 	ctx->encr_pos = AES_BLOCK_SIZE;
-	EVP_CIPHER_CTX_init(&ctx->ctx);
+	EVP_CIPHER_CTX_init(ctx->ctx);
 	return 0;
 }
 
@@ -324,10 +326,10 @@ aes_ctr_encrypt_counter(archive_crypto_c
 	int outl = 0;
 	int r;
 
-	r = EVP_EncryptInit_ex(&ctx->ctx, ctx->type, NULL, ctx->key, NULL);
+	r = EVP_EncryptInit_ex(ctx->ctx, ctx->type, NULL, ctx->key, NULL);
 	if (r == 0)
 		return -1;
-	r = EVP_EncryptUpdate(&ctx->ctx, ctx->encr_buf, &outl, ctx->nonce,
+	r = EVP_EncryptUpdate(ctx->ctx, ctx->encr_buf, &outl, ctx->nonce,
 	    AES_BLOCK_SIZE);
 	if (r == 0 || outl != AES_BLOCK_SIZE)
 		return -1;
@@ -337,7 +339,7 @@ aes_ctr_encrypt_counter(archive_crypto_c
 static int
 aes_ctr_release(archive_crypto_ctx *ctx)
 {
-	EVP_CIPHER_CTX_cleanup(&ctx->ctx);
+	EVP_CIPHER_CTX_free(ctx->ctx);
 	memset(ctx->key, 0, ctx->key_len);
 	memset(ctx->nonce, 0, sizeof(ctx->nonce));
 	return 0;

Modified: head/contrib/libarchive/libarchive/archive_cryptor_private.h
==============================================================================
--- head/contrib/libarchive/libarchive/archive_cryptor_private.h	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_cryptor_private.h	Sat Dec 17 02:07:08 2016	(r310185)
@@ -99,12 +99,12 @@ typedef struct {
 } archive_crypto_ctx;
 
 #elif defined(HAVE_LIBCRYPTO)
-#include <openssl/evp.h>
+#include "archive_openssl_evp_private.h"
 #define AES_BLOCK_SIZE	16
 #define AES_MAX_KEY_SIZE 32
 
 typedef struct {
-	EVP_CIPHER_CTX	ctx;
+	EVP_CIPHER_CTX	*ctx;
 	const EVP_CIPHER *type;
 	uint8_t		key[AES_MAX_KEY_SIZE];
 	unsigned	key_len;

Modified: head/contrib/libarchive/libarchive/archive_digest.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_digest.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_digest.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -207,7 +207,9 @@ __archive_nettle_md5final(archive_md5_ct
 static int
 __archive_openssl_md5init(archive_md5_ctx *ctx)
 {
-  EVP_DigestInit(ctx, EVP_md5());
+  if ((*ctx = EVP_MD_CTX_new()) == NULL)
+	return (ARCHIVE_FAILED);
+  EVP_DigestInit(*ctx, EVP_md5());
   return (ARCHIVE_OK);
 }
 
@@ -215,7 +217,7 @@ static int
 __archive_openssl_md5update(archive_md5_ctx *ctx, const void *indata,
     size_t insize)
 {
-  EVP_DigestUpdate(ctx, indata, insize);
+  EVP_DigestUpdate(*ctx, indata, insize);
   return (ARCHIVE_OK);
 }
 
@@ -226,8 +228,11 @@ __archive_openssl_md5final(archive_md5_c
    * this is meant to cope with that. Real fix is probably to fix
    * archive_write_set_format_xar.c
    */
-  if (ctx->digest)
-    EVP_DigestFinal(ctx, md, NULL);
+  if (*ctx) {
+    EVP_DigestFinal(*ctx, md, NULL);
+    EVP_MD_CTX_free(*ctx);
+    *ctx = NULL;
+  }
   return (ARCHIVE_OK);
 }
 
@@ -359,7 +364,9 @@ __archive_nettle_ripemd160final(archive_
 static int
 __archive_openssl_ripemd160init(archive_rmd160_ctx *ctx)
 {
-  EVP_DigestInit(ctx, EVP_ripemd160());
+  if ((*ctx = EVP_MD_CTX_new()) == NULL)
+	return (ARCHIVE_FAILED);
+  EVP_DigestInit(*ctx, EVP_ripemd160());
   return (ARCHIVE_OK);
 }
 
@@ -367,14 +374,18 @@ static int
 __archive_openssl_ripemd160update(archive_rmd160_ctx *ctx, const void *indata,
     size_t insize)
 {
-  EVP_DigestUpdate(ctx, indata, insize);
+  EVP_DigestUpdate(*ctx, indata, insize);
   return (ARCHIVE_OK);
 }
 
 static int
 __archive_openssl_ripemd160final(archive_rmd160_ctx *ctx, void *md)
 {
-  EVP_DigestFinal(ctx, md, NULL);
+  if (*ctx) {
+    EVP_DigestFinal(*ctx, md, NULL);
+    EVP_MD_CTX_free(*ctx);
+    *ctx = NULL;
+  }
   return (ARCHIVE_OK);
 }
 
@@ -509,7 +520,9 @@ __archive_nettle_sha1final(archive_sha1_
 static int
 __archive_openssl_sha1init(archive_sha1_ctx *ctx)
 {
-  EVP_DigestInit(ctx, EVP_sha1());
+  if ((*ctx = EVP_MD_CTX_new()) == NULL)
+	return (ARCHIVE_FAILED);
+  EVP_DigestInit(*ctx, EVP_sha1());
   return (ARCHIVE_OK);
 }
 
@@ -517,7 +530,7 @@ static int
 __archive_openssl_sha1update(archive_sha1_ctx *ctx, const void *indata,
     size_t insize)
 {
-  EVP_DigestUpdate(ctx, indata, insize);
+  EVP_DigestUpdate(*ctx, indata, insize);
   return (ARCHIVE_OK);
 }
 
@@ -528,8 +541,11 @@ __archive_openssl_sha1final(archive_sha1
    * this is meant to cope with that. Real fix is probably to fix
    * archive_write_set_format_xar.c
    */
-  if (ctx->digest)
-    EVP_DigestFinal(ctx, md, NULL);
+  if (*ctx) {
+    EVP_DigestFinal(*ctx, md, NULL);
+    EVP_MD_CTX_free(*ctx);
+    *ctx = NULL;
+  }
   return (ARCHIVE_OK);
 }
 
@@ -733,7 +749,9 @@ __archive_nettle_sha256final(archive_sha
 static int
 __archive_openssl_sha256init(archive_sha256_ctx *ctx)
 {
-  EVP_DigestInit(ctx, EVP_sha256());
+  if ((*ctx = EVP_MD_CTX_new()) == NULL)
+	return (ARCHIVE_FAILED);
+  EVP_DigestInit(*ctx, EVP_sha256());
   return (ARCHIVE_OK);
 }
 
@@ -741,14 +759,18 @@ static int
 __archive_openssl_sha256update(archive_sha256_ctx *ctx, const void *indata,
     size_t insize)
 {
-  EVP_DigestUpdate(ctx, indata, insize);
+  EVP_DigestUpdate(*ctx, indata, insize);
   return (ARCHIVE_OK);
 }
 
 static int
 __archive_openssl_sha256final(archive_sha256_ctx *ctx, void *md)
 {
-  EVP_DigestFinal(ctx, md, NULL);
+  if (*ctx) {
+    EVP_DigestFinal(*ctx, md, NULL);
+    EVP_MD_CTX_free(*ctx);
+    *ctx = NULL;
+  }
   return (ARCHIVE_OK);
 }
 
@@ -928,7 +950,9 @@ __archive_nettle_sha384final(archive_sha
 static int
 __archive_openssl_sha384init(archive_sha384_ctx *ctx)
 {
-  EVP_DigestInit(ctx, EVP_sha384());
+  if ((*ctx = EVP_MD_CTX_new()) == NULL)
+	return (ARCHIVE_FAILED);
+  EVP_DigestInit(*ctx, EVP_sha384());
   return (ARCHIVE_OK);
 }
 
@@ -936,14 +960,18 @@ static int
 __archive_openssl_sha384update(archive_sha384_ctx *ctx, const void *indata,
     size_t insize)
 {
-  EVP_DigestUpdate(ctx, indata, insize);
+  EVP_DigestUpdate(*ctx, indata, insize);
   return (ARCHIVE_OK);
 }
 
 static int
 __archive_openssl_sha384final(archive_sha384_ctx *ctx, void *md)
 {
-  EVP_DigestFinal(ctx, md, NULL);
+  if (*ctx) {
+    EVP_DigestFinal(*ctx, md, NULL);
+    EVP_MD_CTX_free(*ctx);
+    *ctx = NULL;
+  }
   return (ARCHIVE_OK);
 }
 
@@ -1147,7 +1175,9 @@ __archive_nettle_sha512final(archive_sha
 static int
 __archive_openssl_sha512init(archive_sha512_ctx *ctx)
 {
-  EVP_DigestInit(ctx, EVP_sha512());
+  if ((*ctx = EVP_MD_CTX_new()) == NULL)
+	return (ARCHIVE_FAILED);
+  EVP_DigestInit(*ctx, EVP_sha512());
   return (ARCHIVE_OK);
 }
 
@@ -1155,14 +1185,18 @@ static int
 __archive_openssl_sha512update(archive_sha512_ctx *ctx, const void *indata,
     size_t insize)
 {
-  EVP_DigestUpdate(ctx, indata, insize);
+  EVP_DigestUpdate(*ctx, indata, insize);
   return (ARCHIVE_OK);
 }
 
 static int
 __archive_openssl_sha512final(archive_sha512_ctx *ctx, void *md)
 {
-  EVP_DigestFinal(ctx, md, NULL);
+  if (*ctx) {
+    EVP_DigestFinal(*ctx, md, NULL);
+    EVP_MD_CTX_free(*ctx);
+    *ctx = NULL;
+  }
   return (ARCHIVE_OK);
 }
 

Modified: head/contrib/libarchive/libarchive/archive_digest_private.h
==============================================================================
--- head/contrib/libarchive/libarchive/archive_digest_private.h	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_digest_private.h	Sat Dec 17 02:07:08 2016	(r310185)
@@ -134,7 +134,7 @@
   defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) ||\
   defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
 #define	ARCHIVE_CRYPTO_OPENSSL 1
-#include <openssl/evp.h>
+#include "archive_openssl_evp_private.h"
 #endif
 
 /* Windows crypto headers */
@@ -161,7 +161,7 @@ typedef CC_MD5_CTX archive_md5_ctx;
 #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE)
 typedef struct md5_ctx archive_md5_ctx;
 #elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL)
-typedef EVP_MD_CTX archive_md5_ctx;
+typedef EVP_MD_CTX *archive_md5_ctx;
 #elif defined(ARCHIVE_CRYPTO_MD5_WIN)
 typedef Digest_CTX archive_md5_ctx;
 #else
@@ -175,7 +175,7 @@ typedef RIPEMD160_CTX archive_rmd160_ctx
 #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE)
 typedef struct ripemd160_ctx archive_rmd160_ctx;
 #elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL)
-typedef EVP_MD_CTX archive_rmd160_ctx;
+typedef EVP_MD_CTX *archive_rmd160_ctx;
 #else
 typedef unsigned char archive_rmd160_ctx;
 #endif
@@ -189,7 +189,7 @@ typedef CC_SHA1_CTX archive_sha1_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE)
 typedef struct sha1_ctx archive_sha1_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL)
-typedef EVP_MD_CTX archive_sha1_ctx;
+typedef EVP_MD_CTX *archive_sha1_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA1_WIN)
 typedef Digest_CTX archive_sha1_ctx;
 #else
@@ -209,7 +209,7 @@ typedef CC_SHA256_CTX archive_sha256_ctx
 #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE)
 typedef struct sha256_ctx archive_sha256_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL)
-typedef EVP_MD_CTX archive_sha256_ctx;
+typedef EVP_MD_CTX *archive_sha256_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA256_WIN)
 typedef Digest_CTX archive_sha256_ctx;
 #else
@@ -227,7 +227,7 @@ typedef CC_SHA512_CTX archive_sha384_ctx
 #elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE)
 typedef struct sha384_ctx archive_sha384_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA384_OPENSSL)
-typedef EVP_MD_CTX archive_sha384_ctx;
+typedef EVP_MD_CTX *archive_sha384_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA384_WIN)
 typedef Digest_CTX archive_sha384_ctx;
 #else
@@ -247,7 +247,7 @@ typedef CC_SHA512_CTX archive_sha512_ctx
 #elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE)
 typedef struct sha512_ctx archive_sha512_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
-typedef EVP_MD_CTX archive_sha512_ctx;
+typedef EVP_MD_CTX *archive_sha512_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA512_WIN)
 typedef Digest_CTX archive_sha512_ctx;
 #else

Modified: head/contrib/libarchive/libarchive/archive_entry.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_entry.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_entry.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -248,10 +248,9 @@ archive_entry_new2(struct archive *a)
 {
 	struct archive_entry *entry;
 
-	entry = (struct archive_entry *)malloc(sizeof(*entry));
+	entry = (struct archive_entry *)calloc(1, sizeof(*entry));
 	if (entry == NULL)
 		return (NULL);
-	memset(entry, 0, sizeof(*entry));
 	entry->archive = a;
 	return (entry);
 }

Modified: head/contrib/libarchive/libarchive/archive_hmac.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_hmac.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_hmac.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -176,8 +176,10 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ct
 static int
 __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len)
 {
-	HMAC_CTX_init(ctx);
-	HMAC_Init(ctx, key, key_len, EVP_sha1());
+	*ctx = HMAC_CTX_new();
+	if (*ctx == NULL)
+		return -1;
+	HMAC_Init_ex(*ctx, key, key_len, EVP_sha1(), NULL);
 	return 0;
 }
 
@@ -185,22 +187,22 @@ static void
 __hmac_sha1_update(archive_hmac_sha1_ctx *ctx, const uint8_t *data,
     size_t data_len)
 {
-	HMAC_Update(ctx, data, data_len);
+	HMAC_Update(*ctx, data, data_len);
 }
 
 static void
 __hmac_sha1_final(archive_hmac_sha1_ctx *ctx, uint8_t *out, size_t *out_len)
 {
 	unsigned int len = (unsigned int)*out_len;
-	HMAC_Final(ctx, out, &len);
+	HMAC_Final(*ctx, out, &len);
 	*out_len = len;
 }
 
 static void
 __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx)
 {
-	HMAC_CTX_cleanup(ctx);
-	memset(ctx, 0, sizeof(*ctx));
+	HMAC_CTX_free(*ctx);
+	*ctx = NULL;
 }
 
 #else

Modified: head/contrib/libarchive/libarchive/archive_hmac_private.h
==============================================================================
--- head/contrib/libarchive/libarchive/archive_hmac_private.h	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_hmac_private.h	Sat Dec 17 02:07:08 2016	(r310185)
@@ -70,9 +70,9 @@ typedef struct {
 typedef	struct hmac_sha1_ctx archive_hmac_sha1_ctx;
 
 #elif defined(HAVE_LIBCRYPTO)
-#include <openssl/hmac.h>
+#include "archive_openssl_hmac_private.h"
 
-typedef	HMAC_CTX archive_hmac_sha1_ctx;
+typedef	HMAC_CTX* archive_hmac_sha1_ctx;
 
 #else
 

Copied: head/contrib/libarchive/libarchive/archive_openssl_evp_private.h (from r310184, vendor/libarchive/dist/libarchive/archive_openssl_evp_private.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/libarchive/libarchive/archive_openssl_evp_private.h	Sat Dec 17 02:07:08 2016	(r310185, copy of r310184, vendor/libarchive/dist/libarchive/archive_openssl_evp_private.h)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * 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(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED 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(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (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 ARCHIVE_OPENSSL_EVP_PRIVATE_H_INCLUDED
+#define ARCHIVE_OPENSSL_EVP_PRIVATE_H_INCLUDED
+
+#include <openssl/evp.h>
+#include <openssl/opensslv.h>
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#include <stdlib.h> /* malloc, free */
+#include <string.h> /* memset */
+static inline EVP_MD_CTX *EVP_MD_CTX_new(void)
+{
+	EVP_MD_CTX *ctx = (EVP_MD_CTX *)calloc(1, sizeof(EVP_MD_CTX));
+	return ctx;
+}
+
+static inline void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
+{
+	EVP_MD_CTX_cleanup(ctx);
+	memset(ctx, 0, sizeof(*ctx));
+	free(ctx);
+}
+#endif
+
+#endif

Copied: head/contrib/libarchive/libarchive/archive_openssl_hmac_private.h (from r310184, vendor/libarchive/dist/libarchive/archive_openssl_hmac_private.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/libarchive/libarchive/archive_openssl_hmac_private.h	Sat Dec 17 02:07:08 2016	(r310185, copy of r310184, vendor/libarchive/dist/libarchive/archive_openssl_hmac_private.h)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * 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(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED 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(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (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 ARCHIVE_OPENSSL_HMAC_PRIVATE_H_INCLUDED
+#define ARCHIVE_OPENSSL_HMAC_PRIVATE_H_INCLUDED
+
+#include <openssl/hmac.h>
+#include <openssl/opensslv.h>
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#include <stdlib.h> /* malloc, free */
+#include <string.h> /* memset */
+static inline HMAC_CTX *HMAC_CTX_new(void)
+{
+	HMAC_CTX *ctx = (HMAC_CTX *)calloc(1, sizeof(HMAC_CTX));
+	return ctx;
+}
+
+static inline void HMAC_CTX_free(HMAC_CTX *ctx)
+{
+	HMAC_CTX_cleanup(ctx);
+	memset(ctx, 0, sizeof(*ctx));
+	free(ctx);
+}
+#endif
+
+#endif

Modified: head/contrib/libarchive/libarchive/archive_options.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_options.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_options.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -26,6 +26,10 @@
 #include "archive_platform.h"
 __FBSDID("$FreeBSD$");
 
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
 #include "archive_options_private.h"
 
 static const char *
@@ -105,8 +109,11 @@ _archive_set_options(struct archive *a, 
 	if (options == NULL || options[0] == '\0')
 		return ARCHIVE_OK;
 
-	data = (char *)malloc(strlen(options) + 1);
-	strcpy(data, options);
+	if ((data = strdup(options)) == NULL) {
+		archive_set_error(a,
+		    ENOMEM, "Out of memory adding file to list");
+		return (ARCHIVE_FATAL);
+	}
 	s = (const char *)data;
 
 	do {

Modified: head/contrib/libarchive/libarchive/archive_read.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
 
 static int	choose_filters(struct archive_read *);
 static int	choose_format(struct archive_read *);
+static int	close_filters(struct archive_read *);
 static struct archive_vtable *archive_read_vtable(void);
 static int64_t	_archive_filter_bytes(struct archive *, int);
 static int	_archive_filter_code(struct archive *, int);
@@ -528,7 +529,7 @@ archive_read_open1(struct archive *_a)
 	{
 		slot = choose_format(a);
 		if (slot < 0) {
-			__archive_read_close_filters(a);
+			close_filters(a);
 			a->archive.state = ARCHIVE_STATE_FATAL;
 			return (ARCHIVE_FATAL);
 		}
@@ -582,7 +583,6 @@ choose_filters(struct archive_read *a)
 			/* Verify the filter by asking it for some data. */
 			__archive_read_filter_ahead(a->filter, 1, &avail);
 			if (avail < 0) {
-				__archive_read_close_filters(a);
 				__archive_read_free_filters(a);
 				return (ARCHIVE_FATAL);
 			}
@@ -601,7 +601,6 @@ choose_filters(struct archive_read *a)
 		a->filter = filter;
 		r = (best_bidder->init)(a->filter);
 		if (r != ARCHIVE_OK) {
-			__archive_read_close_filters(a);
 			__archive_read_free_filters(a);
 			return (ARCHIVE_FATAL);
 		}
@@ -986,8 +985,8 @@ _archive_read_data_block(struct archive 
 	return (a->format->read_data)(a, buff, size, offset);
 }
 
-int
-__archive_read_close_filters(struct archive_read *a)
+static int
+close_filters(struct archive_read *a)
 {
 	struct archive_read_filter *f = a->filter;
 	int r = ARCHIVE_OK;
@@ -1010,6 +1009,9 @@ __archive_read_close_filters(struct arch
 void
 __archive_read_free_filters(struct archive_read *a)
 {
+	/* Make sure filters are closed and their buffers are freed */
+	close_filters(a);
+
 	while (a->filter != NULL) {
 		struct archive_read_filter *t = a->filter->upstream;
 		free(a->filter);
@@ -1052,7 +1054,7 @@ _archive_read_close(struct archive *_a)
 	/* TODO: Clean up the formatters. */
 
 	/* Release the filter objects. */
-	r1 = __archive_read_close_filters(a);
+	r1 = close_filters(a);
 	if (r1 < r)
 		r = r1;
 

Modified: head/contrib/libarchive/libarchive/archive_read_append_filter.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_append_filter.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_append_filter.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -133,7 +133,6 @@ archive_read_append_filter(struct archiv
     a->filter = filter;
     r2 = (bidder->init)(a->filter);
     if (r2 != ARCHIVE_OK) {
-      __archive_read_close_filters(a);
       __archive_read_free_filters(a);
       return (ARCHIVE_FATAL);
     }
@@ -191,7 +190,6 @@ archive_read_append_filter_program_signa
   a->filter = filter;
   r = (bidder->init)(a->filter);
   if (r != ARCHIVE_OK) {
-    __archive_read_close_filters(a);
     __archive_read_free_filters(a);
     return (ARCHIVE_FATAL);
   }

Modified: head/contrib/libarchive/libarchive/archive_read_disk_posix.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_disk_posix.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_disk_posix.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -244,7 +244,7 @@ struct tree {
 	int			 initial_filesystem_id;
 	int			 current_filesystem_id;
 	int			 max_filesystem_id;
-	int			 allocated_filesytem;
+	int			 allocated_filesystem;
 
 	int			 entry_fd;
 	int			 entry_eof;
@@ -1382,7 +1382,7 @@ update_current_filesystem(struct archive
 
 	for (i = 0; i < t->max_filesystem_id; i++) {
 		if (t->filesystem_table[i].dev == dev) {
-			/* There is the filesytem ID we've already generated. */
+			/* There is the filesystem ID we've already generated. */
 			t->current_filesystem_id = i;
 			t->current_filesystem = &(t->filesystem_table[i]);
 			return (ARCHIVE_OK);
@@ -1390,10 +1390,10 @@ update_current_filesystem(struct archive
 	}
 
 	/*
-	 * This is the new filesytem which we have to generate a new ID for.
+	 * This is the new filesystem which we have to generate a new ID for.
 	 */
 	fid = t->max_filesystem_id++;
-	if (t->max_filesystem_id > t->allocated_filesytem) {
+	if (t->max_filesystem_id > t->allocated_filesystem) {
 		size_t s;
 		void *p;
 
@@ -1406,7 +1406,7 @@ update_current_filesystem(struct archive
 			return (ARCHIVE_FATAL);
 		}
 		t->filesystem_table = (struct filesystem *)p;
-		t->allocated_filesytem = s;
+		t->allocated_filesystem = s;
 	}
 	t->current_filesystem_id = fid;
 	t->current_filesystem = &(t->filesystem_table[fid]);
@@ -2063,8 +2063,7 @@ tree_push(struct tree *t, const char *pa
 {
 	struct tree_entry *te;
 
-	te = malloc(sizeof(*te));
-	memset(te, 0, sizeof(*te));
+	te = calloc(1, sizeof(*te));
 	te->next = t->stack;
 	te->parent = t->current;
 	if (te->parent)
@@ -2122,9 +2121,8 @@ tree_open(const char *path, int symlink_
 {
 	struct tree *t;
 
-	if ((t = malloc(sizeof(*t))) == NULL)
+	if ((t = calloc(1, sizeof(*t))) == NULL)
 		return (NULL);
-	memset(t, 0, sizeof(*t));
 	archive_string_init(&t->path);
 	archive_string_ensure(&t->path, 31);
 	t->initial_symlink_mode = symlink_mode;

Modified: head/contrib/libarchive/libarchive/archive_read_extract2.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_extract2.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_extract2.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -52,12 +52,11 @@ struct archive_read_extract *
 __archive_read_get_extract(struct archive_read *a)
 {
 	if (a->extract == NULL) {
-		a->extract = (struct archive_read_extract *)malloc(sizeof(*a->extract));
+		a->extract = (struct archive_read_extract *)calloc(1, sizeof(*a->extract));
 		if (a->extract == NULL) {
 			archive_set_error(&a->archive, ENOMEM, "Can't extract");
 			return (NULL);
 		}
-		memset(a->extract, 0, sizeof(*a->extract));
 		a->cleanup_archive_extract = archive_read_extract_cleanup;
 	}
 	return (a->extract);

Modified: head/contrib/libarchive/libarchive/archive_read_open_memory.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_open_memory.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_open_memory.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -70,12 +70,11 @@ archive_read_open_memory2(struct archive
 {
 	struct read_memory_data *mine;
 
-	mine = (struct read_memory_data *)malloc(sizeof(*mine));
+	mine = (struct read_memory_data *)calloc(1, sizeof(*mine));
 	if (mine == NULL) {
 		archive_set_error(a, ENOMEM, "No memory");
 		return (ARCHIVE_FATAL);
 	}
-	memset(mine, 0, sizeof(*mine));
 	mine->start = mine->p = (const unsigned char *)buff;
 	mine->end = mine->start + size;
 	mine->read_size = read_size;

Modified: head/contrib/libarchive/libarchive/archive_read_private.h
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_private.h	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_private.h	Sat Dec 17 02:07:08 2016	(r310185)
@@ -252,7 +252,6 @@ int64_t	__archive_read_consume(struct ar
 int64_t	__archive_read_filter_consume(struct archive_read_filter *, int64_t);
 int __archive_read_program(struct archive_read_filter *, const char *);
 void __archive_read_free_filters(struct archive_read *);
-int  __archive_read_close_filters(struct archive_read *);
 struct archive_read_extract *__archive_read_get_extract(struct archive_read *);
 
 

Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -320,30 +320,14 @@ uudecode_bidder_bid(struct archive_read_
 		if (l > 45)
 			/* Normally, maximum length is 45(character 'M'). */
 			return (0);
-		while (l && len-nl > 0) {
-			if (l > 0) {
-				if (!uuchar[*b++])
-					return (0);
-				if (!uuchar[*b++])
-					return (0);
-				len -= 2;
-				--l;
-			}
-			if (l > 0) {
-				if (!uuchar[*b++])
-					return (0);
-				--len;
-				--l;
-			}
-			if (l > 0) {
-				if (!uuchar[*b++])
-					return (0);
-				--len;
-				--l;
-			}
+		if (l > len - nl)
+			return (0); /* Line too short. */
+		while (l) {
+			if (!uuchar[*b++])
+				return (0);
+			--len;
+			--l;
 		}
-		if (len-nl < 0)
-			return (0);
 		if (len-nl == 1 &&
 		    (uuchar[*b] ||		 /* Check sum. */
 		     (*b >= 'a' && *b <= 'z'))) {/* Padding data(MINIX). */

Modified: head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -213,7 +213,7 @@ struct _7zip {
 	int			 header_is_encoded;
 	uint64_t		 header_bytes_remaining;
 	unsigned long		 header_crc32;
-	/* Header offset to check that reading pointes of the file contens
+	/* Header offset to check that reading points of the file contents
 	 * will not exceed the header. */
 	uint64_t		 header_offset;
 	/* Base offset of the archive file for a seek in case reading SFX. */

Modified: head/contrib/libarchive/libarchive/archive_read_support_format_ar.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_support_format_ar.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_support_format_ar.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -104,13 +104,12 @@ archive_read_support_format_ar(struct ar
 	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
 	    ARCHIVE_STATE_NEW, "archive_read_support_format_ar");
 
-	ar = (struct ar *)malloc(sizeof(*ar));
+	ar = (struct ar *)calloc(1, sizeof(*ar));
 	if (ar == NULL) {
 		archive_set_error(&a->archive, ENOMEM,
 		    "Can't allocate ar data");
 		return (ARCHIVE_FATAL);
 	}
-	memset(ar, 0, sizeof(*ar));
 	ar->strtab = NULL;
 
 	r = __archive_read_register_format(a,
@@ -316,7 +315,7 @@ _ar_read_header(struct archive_read *a, 
 		 * If we can't look up the real name, warn and return
 		 * the entry with the wrong name.
 		 */
-		if (ar->strtab == NULL || number > ar->strtab_size) {
+		if (ar->strtab == NULL || number >= ar->strtab_size) {
 			archive_set_error(&a->archive, EINVAL,
 			    "Can't find long filename for GNU/SVR4 archive entry");
 			archive_entry_copy_pathname(entry, filename);

Modified: head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -814,8 +814,8 @@ header_odc(struct archive_read *a, struc
  * NOTE: if a filename suffix is ".z", it is the file gziped by afio.
  * it would be nice that we can show uncompressed file size and we can
  * uncompressed file contents automatically, unfortunately we have nothing
- * to get a uncompressed file size while reading each header. it means
- * we also cannot uncompressed file contens under the our framework.
+ * to get a uncompressed file size while reading each header. It means
+ * we also cannot uncompress file contents under our framework.
  */
 static int
 header_afiol(struct archive_read *a, struct cpio *cpio,

Modified: head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -229,13 +229,12 @@ archive_read_support_format_mtree(struct
 	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
 	    ARCHIVE_STATE_NEW, "archive_read_support_format_mtree");
 
-	mtree = (struct mtree *)malloc(sizeof(*mtree));
+	mtree = (struct mtree *)calloc(1, sizeof(*mtree));
 	if (mtree == NULL) {
 		archive_set_error(&a->archive, ENOMEM,
 		    "Can't allocate mtree data");
 		return (ARCHIVE_FATAL);
 	}
-	memset(mtree, 0, sizeof(*mtree));
 	mtree->fd = -1;
 
 	r = __archive_read_register_format(a, mtree, "mtree",

Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_support_format_rar.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_support_format_rar.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -647,13 +647,12 @@ archive_read_support_format_rar(struct a
   archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
                       "archive_read_support_format_rar");
 
-  rar = (struct rar *)malloc(sizeof(*rar));
+  rar = (struct rar *)calloc(sizeof(*rar), 1);
   if (rar == NULL)
   {
     archive_set_error(&a->archive, ENOMEM, "Can't allocate rar data");
     return (ARCHIVE_FATAL);
   }
-  memset(rar, 0, sizeof(*rar));
 
 	/*
 	 * Until enough data has been read, we cannot tell about

Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -297,7 +297,7 @@ archive_read_format_tar_cleanup(struct a
 /*
  * Validate number field
  *
- * This has to be pretty lenient in order to accomodate the enormous
+ * This has to be pretty lenient in order to accommodate the enormous
  * variety of tar writers in the world:
  *  = POSIX (IEEE Std 1003.1-1988) ustar requires octal values with leading
  *    zeros and allows fields to be terminated with space or null characters
@@ -423,7 +423,7 @@ archive_read_format_tar_options(struct a
 
 	tar = (struct tar *)(a->format->data);
 	if (strcmp(key, "compat-2x")  == 0) {
-		/* Handle UTF-8 filnames as libarchive 2.x */
+		/* Handle UTF-8 filenames as libarchive 2.x */
 		tar->compat_2x = (val != NULL && val[0] != 0);
 		tar->init_default_conversion = tar->compat_2x;
 		return (ARCHIVE_OK);
@@ -2189,12 +2189,11 @@ gnu_add_sparse_entry(struct archive_read
 {
 	struct sparse_block *p;
 
-	p = (struct sparse_block *)malloc(sizeof(*p));
+	p = (struct sparse_block *)calloc(1, sizeof(*p));
 	if (p == NULL) {
 		archive_set_error(&a->archive, ENOMEM, "Out of memory");
 		return (ARCHIVE_FATAL);
 	}
-	memset(p, 0, sizeof(*p));
 	if (tar->sparse_last != NULL)
 		tar->sparse_last->next = p;
 	else
@@ -2545,7 +2544,7 @@ tar_atol_base_n(const char *p, size_t ch
 	last_digit_limit = INT64_MAX % base;
 
 	/* the pointer will not be dereferenced if char_cnt is zero
-	 * due to the way the && operator is evaulated.
+	 * due to the way the && operator is evaluated.
 	 */
 	while (char_cnt != 0 && (*p == ' ' || *p == '\t')) {
 		p++;

Modified: head/contrib/libarchive/libarchive/archive_read_support_format_warc.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_read_support_format_warc.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_read_support_format_warc.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -146,12 +146,11 @@ archive_read_support_format_warc(struct 
 	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
 	    ARCHIVE_STATE_NEW, "archive_read_support_format_warc");
 
-	if ((w = malloc(sizeof(*w))) == NULL) {
+	if ((w = calloc(1, sizeof(*w))) == NULL) {
 		archive_set_error(&a->archive, ENOMEM,
 		    "Can't allocate warc data");
 		return (ARCHIVE_FATAL);
 	}
-	memset(w, 0, sizeof(*w));
 
 	r = __archive_read_register_format(
 		a, w, "warc",

Modified: head/contrib/libarchive/libarchive/archive_string.c
==============================================================================
--- head/contrib/libarchive/libarchive/archive_string.c	Sat Dec 17 02:01:05 2016	(r310184)
+++ head/contrib/libarchive/libarchive/archive_string.c	Sat Dec 17 02:07:08 2016	(r310185)
@@ -1992,7 +1992,7 @@ archive_strncat_l(struct archive_string 
 #if HAVE_ICONV
 
 /*
- * Return -1 if conversion failes.
+ * Return -1 if conversion fails.
  */
 static int
 iconv_strncat_in_locale(struct archive_string *as, const void *_p,
@@ -2094,7 +2094,7 @@ iconv_strncat_in_locale(struct archive_s
 
 /*
  * Translate a string from a some CodePage to an another CodePage by
- * Windows APIs, and copy the result. Return -1 if conversion failes.
+ * Windows APIs, and copy the result. Return -1 if conversion fails.
  */
 static int
 strncat_in_codepage(struct archive_string *as,
@@ -3474,7 +3474,7 @@ strncat_from_utf8_libarchive2(struct arc
 

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

From owner-svn-src-all@freebsd.org  Sat Dec 17 03:34:53 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C3E6C840CC;
 Sat, 17 Dec 2016 03:34:53 +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 B61DE164D;
 Sat, 17 Dec 2016 03:34:52 +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 uBH3Ypoj050541;
 Sat, 17 Dec 2016 03:34:51 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBH3Yp47050539;
 Sat, 17 Dec 2016 03:34:51 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201612170334.uBH3Yp47050539@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sat, 17 Dec 2016 03:34:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310186 - in head: lib/libelftc tools/build/mk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 17 Dec 2016 03:34:53 -0000

Author: ngie
Date: Sat Dec 17 03:34:51 2016
New Revision: 310186
URL: https://svnweb.freebsd.org/changeset/base/310186

Log:
  Install the lib/libelftc manpages
  
  Some other manpages, e.g. c++filt reference these
  
  MFC after:	1 week

Modified:
  head/lib/libelftc/Makefile
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/lib/libelftc/Makefile
==============================================================================
--- head/lib/libelftc/Makefile	Sat Dec 17 02:07:08 2016	(r310185)
+++ head/lib/libelftc/Makefile	Sat Dec 17 03:34:51 2016	(r310186)
@@ -28,7 +28,15 @@ SRCS=	elftc_bfdtarget.c                 
 INCS=	libelftc.h
 CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
 
-MAN=
+MAN+=	elftc.3 \
+	elftc_bfd_find_target.3 \
+	elftc_copyfile.3 \
+	elftc_demangle.3 \
+	elftc_reloc_type_str.3 \
+	elftc_set_timestamps.3 \
+	elftc_timestamp.3 \
+	elftc_string_table_create.3 \
+	elftc_version.3
 
 # This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile
 # We need to link against the correct version of these files. One

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- head/tools/build/mk/OptionalObsoleteFiles.inc	Sat Dec 17 02:07:08 2016	(r310185)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc	Sat Dec 17 03:34:51 2016	(r310186)
@@ -8125,6 +8125,15 @@ OLD_FILES+=usr/share/man/man1/size.1.gz
 OLD_FILES+=usr/share/man/man1/strings.1.gz
 OLD_FILES+=usr/share/man/man1/strip.1.gz
 OLD_FILES+=usr/share/man/man1/objcopy.1.gz
+OLD_FILES+=usr/share/man/man3/elftc.3.gz
+OLD_FILES+=usr/share/man/man3/elftc_bfd_find_target.3.gz
+OLD_FILES+=usr/share/man/man3/elftc_copyfile.3.gz
+OLD_FILES+=usr/share/man/man3/elftc_demangle.3.gz
+OLD_FILES+=usr/share/man/man3/elftc_reloc_type_str.3.gz
+OLD_FILES+=usr/share/man/man3/elftc_set_timestamps.3.gz
+OLD_FILES+=usr/share/man/man3/elftc_timestamp.3.gz
+OLD_FILES+=usr/share/man/man3/elftc_string_table_create.3.gz
+OLD_FILES+=usr/share/man/man3/elftc_version.3.gz
 OLD_FILES+=usr/tests/usr.bin/yacc/Kyuafile
 OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_calc1.y
 OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_demo.y

From owner-svn-src-all@freebsd.org  Sat Dec 17 03:41:17 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC4BAC84355;
 Sat, 17 Dec 2016 03:41:17 +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 C70C91DA4;
 Sat, 17 Dec 2016 03:41:17 +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 uBH3fG6j052319;
 Sat, 17 Dec 2016 03:41:16 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBH3fGcO052318;
 Sat, 17 Dec 2016 03:41:16 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201612170341.uBH3fGcO052318@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sat, 17 Dec 2016 03:41:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310187 - head/tools/build/mk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 17 Dec 2016 03:41:18 -0000

Author: ngie
Date: Sat Dec 17 03:41:16 2016
New Revision: 310187
URL: https://svnweb.freebsd.org/changeset/base/310187

Log:
  Remove lib/libelf's manpages if MK_TOOLCHAIN == no
  
  Add a comment to help figure out which set is lib/libelf's and which set
  is lib/libelftc's
  
  MFC after:	1 week

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- head/tools/build/mk/OptionalObsoleteFiles.inc	Sat Dec 17 03:34:51 2016	(r310186)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc	Sat Dec 17 03:41:16 2016	(r310187)
@@ -8125,6 +8125,56 @@ OLD_FILES+=usr/share/man/man1/size.1.gz
 OLD_FILES+=usr/share/man/man1/strings.1.gz
 OLD_FILES+=usr/share/man/man1/strip.1.gz
 OLD_FILES+=usr/share/man/man1/objcopy.1.gz
+# lib/libelf
+OLD_FILES+=usr/share/man/man3/elf.3.gz
+OLD_FILES+=usr/share/man/man3/elf_begin.3.gz
+OLD_FILES+=usr/share/man/man3/elf_cntl.3.gz
+OLD_FILES+=usr/share/man/man3/elf_end.3.gz
+OLD_FILES+=usr/share/man/man3/elf_errmsg.3.gz
+OLD_FILES+=usr/share/man/man3/elf_fill.3.gz
+OLD_FILES+=usr/share/man/man3/elf_flagdata.3.gz
+OLD_FILES+=usr/share/man/man3/elf_getarhdr.3.gz
+OLD_FILES+=usr/share/man/man3/elf_getarsym.3.gz
+OLD_FILES+=usr/share/man/man3/elf_getbase.3.gz
+OLD_FILES+=usr/share/man/man3/elf_getdata.3.gz
+OLD_FILES+=usr/share/man/man3/elf_getident.3.gz
+OLD_FILES+=usr/share/man/man3/elf_getscn.3.gz
+OLD_FILES+=usr/share/man/man3/elf_getphdrnum.3.gz
+OLD_FILES+=usr/share/man/man3/elf_getphnum.3.gz
+OLD_FILES+=usr/share/man/man3/elf_getshdrnum.3.gz
+OLD_FILES+=usr/share/man/man3/elf_getshnum.3.gz
+OLD_FILES+=usr/share/man/man3/elf_getshdrstrndx.3.gz
+OLD_FILES+=usr/share/man/man3/elf_getshstrndx.3.gz
+OLD_FILES+=usr/share/man/man3/elf_hash.3.gz
+OLD_FILES+=usr/share/man/man3/elf_kind.3.gz
+OLD_FILES+=usr/share/man/man3/elf_memory.3.gz
+OLD_FILES+=usr/share/man/man3/elf_next.3.gz
+OLD_FILES+=usr/share/man/man3/elf_open.3.gz
+OLD_FILES+=usr/share/man/man3/elf_rawfile.3.gz
+OLD_FILES+=usr/share/man/man3/elf_rand.3.gz
+OLD_FILES+=usr/share/man/man3/elf_strptr.3.gz
+OLD_FILES+=usr/share/man/man3/elf_update.3.gz
+OLD_FILES+=usr/share/man/man3/elf_version.3.gz
+OLD_FILES+=usr/share/man/man3/gelf.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_checksum.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_fsize.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_getcap.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_getclass.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_getdyn.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_getehdr.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_getmove.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_getphdr.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_getrel.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_getrela.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_getshdr.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_getsym.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_getsyminfo.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_getsymshndx.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_newehdr.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_newphdr.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_update_ehdr.3.gz
+OLD_FILES+=usr/share/man/man3/gelf_xlatetof.3.gz
+# lib/libelftc
 OLD_FILES+=usr/share/man/man3/elftc.3.gz
 OLD_FILES+=usr/share/man/man3/elftc_bfd_find_target.3.gz
 OLD_FILES+=usr/share/man/man3/elftc_copyfile.3.gz

From owner-svn-src-all@freebsd.org  Sat Dec 17 03:47:11 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93732C8464E;
 Sat, 17 Dec 2016 03:47:11 +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 6DFCB8E5;
 Sat, 17 Dec 2016 03:47:11 +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 uBH3lAB1054730;
 Sat, 17 Dec 2016 03:47:10 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBH3lAUH054725;
 Sat, 17 Dec 2016 03:47:10 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201612170347.uBH3lAUH054725@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sat, 17 Dec 2016 03:47:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r310188 - stable/11/contrib/netbsd-tests/fs/tmpfs
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 17 Dec 2016 03:47:11 -0000

Author: ngie
Date: Sat Dec 17 03:47:09 2016
New Revision: 310188
URL: https://svnweb.freebsd.org/changeset/base/310188

Log:
  MFC r309774,r309778,r309779,r309780:
  
  r309774:
  
  Only run mdconfig -d -u 3 if /dev/md3 exists on the system
  
  This will prevent "cleanup failures" (exit code != 0 returned) when
  tmpfs is not loaded
  
  r309778:
  
  Make test_unmount usable in cleanup subroutines
  
  - Duplicate test_unmount to _test_unmount
  - Remove atf_check calls
  - Call _test_unmount from test_unmount, checking the exit code
    at the end, and returning it to maintain the test_unmount
    "contract"
  
  r309779:
  
  - Ignore errors from umount
  - Use _test_unmount instead of test_unmount in cleanup
  
  r309780:
  
  Use _test_unmount instead of test_unmount in cleanup to avoid
  false positives with atf_check when tmpfs is not loaded, etc

Modified:
  stable/11/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr
  stable/11/contrib/netbsd-tests/fs/tmpfs/t_link.sh
  stable/11/contrib/netbsd-tests/fs/tmpfs/t_mount.sh
  stable/11/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
  stable/11/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr
==============================================================================
--- stable/11/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr	Sat Dec 17 03:41:16 2016	(r310187)
+++ stable/11/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr	Sat Dec 17 03:47:09 2016	(r310188)
@@ -59,12 +59,31 @@ test_mount() {
 #	Unmounts the file system mounted by test_mount.
 #
 test_unmount() {
+	# Begin FreeBSD
+	_test_unmount
+	exit_code=$?
+	atf_check_equal "$exit_code" "0"
+	return $exit_code
+	# End FreeBSD
 	cd - >/dev/null
 	atf_check -s eq:0 -o empty -e empty umount ${Mount_Point}
 	atf_check -s eq:0 -o empty -e empty rmdir ${Mount_Point}
 	Mount_Point=
 }
 
+# Begin FreeBSD
+_test_unmount() {
+	if [ -z "${Mount_Point}" -o ! -d "${Mount_Point}" ]; then
+		return 0
+	fi
+
+	cd - >/dev/null
+	umount ${Mount_Point}
+	rmdir ${Mount_Point}
+	Mount_Point=
+}
+# End FreeBSD
+
 #
 # kqueue_monitor expected_nevents file1 [.. fileN]
 #

Modified: stable/11/contrib/netbsd-tests/fs/tmpfs/t_link.sh
==============================================================================
--- stable/11/contrib/netbsd-tests/fs/tmpfs/t_link.sh	Sat Dec 17 03:41:16 2016	(r310187)
+++ stable/11/contrib/netbsd-tests/fs/tmpfs/t_link.sh	Sat Dec 17 03:47:09 2016	(r310188)
@@ -97,7 +97,7 @@ subdirs_body() {
 if true; then
 atf_test_case kqueue cleanup
 kqueue_cleanup() {
-	Mount_Point=$(pwd)/mntpt test_unmount || :
+	Mount_Point=$(pwd)/mntpt _test_unmount || :
 }
 else
 # End FreeBSD

Modified: stable/11/contrib/netbsd-tests/fs/tmpfs/t_mount.sh
==============================================================================
--- stable/11/contrib/netbsd-tests/fs/tmpfs/t_mount.sh	Sat Dec 17 03:41:16 2016	(r310187)
+++ stable/11/contrib/netbsd-tests/fs/tmpfs/t_mount.sh	Sat Dec 17 03:47:09 2016	(r310188)
@@ -97,7 +97,8 @@ negative_body() {
 if true; then
 atf_test_case large cleanup
 large_cleanup() {
-	umount -f tmp 2>/dev/null
+	umount -f tmp 2>/dev/null || :
+	Mount_Point=$(pwd)/mnt _test_unmount || :
 }
 else
 # End FreeBSD

Modified: stable/11/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
==============================================================================
--- stable/11/contrib/netbsd-tests/fs/tmpfs/t_remove.sh	Sat Dec 17 03:41:16 2016	(r310187)
+++ stable/11/contrib/netbsd-tests/fs/tmpfs/t_remove.sh	Sat Dec 17 03:47:09 2016	(r310188)
@@ -50,7 +50,7 @@ single_body() {
 if true; then
 atf_test_case uchg cleanup
 uchg_cleanup() {
-	Mount_Point=$(pwd)/mntpt test_unmount || :
+	Mount_Point=$(pwd)/mntpt _test_unmount
 }
 else
 # End FreeBSD

Modified: stable/11/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh
==============================================================================
--- stable/11/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh	Sat Dec 17 03:41:16 2016	(r310187)
+++ stable/11/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh	Sat Dec 17 03:47:09 2016	(r310188)
@@ -85,7 +85,7 @@ basic_cleanup() {
 		umount mnt 2>/dev/null 1>&2
 		# Begin FreeBSD
 		if true; then
-			atf_check -s eq:0 -o empty -e empty mdconfig -d -u 3
+			[ ! -c /dev/md3 ] || mdconfig -d -u 3
 		else
 		# End FreeBSD
 		vndconfig -u /dev/vnd3 2>/dev/null 1>&2

From owner-svn-src-all@freebsd.org  Sat Dec 17 08:52:24 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C94FC82522;
 Sat, 17 Dec 2016 08:52:24 +0000 (UTC)
 (envelope-from adrian.chadd@gmail.com)
Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com
 [IPv6:2a00:1450:400c:c09::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 3052A66A;
 Sat, 17 Dec 2016 08:52:24 +0000 (UTC)
 (envelope-from adrian.chadd@gmail.com)
Received: by mail-wm0-x242.google.com with SMTP id a20so9464747wme.2;
 Sat, 17 Dec 2016 00:52:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=ICfjKf/d+wmTcHiLs8VrOOFS5YzdgTcs8vM4jIJV7lk=;
 b=XI76KSFrNAPPIjthtIcXazLp/Z5Fuhs3r3flK/xo+R3LJkWt7G6deaHWcIyWQ5wFBX
 cQR1gZuqP1ogW5WMTt8gVvdjU0hZ0TggG4QzGoZjdIJZqJVNOYbd0KuLD2fDN6j87S9E
 HOZep9FR4xp8aRuVexX7MTJcq6GEbfN6aCGLEENlTDiL6CjA6oX6EmM4jut3Gn1kz4Xa
 a/CVBQqQZOM1tpbfxbb35tewiAFFjpXSuMqvzwlY1YlvIG9VVAUU53LGjj9ec27UFi0A
 KksDVtpTkcZqUZtt7Cevo2io4UPyvmQYjw+cKdy37HzjgX1CRud/git74wLpJTaz4YJj
 tpCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=ICfjKf/d+wmTcHiLs8VrOOFS5YzdgTcs8vM4jIJV7lk=;
 b=MSQX4mQGbE+TjV/bgERk3x0wvmIbXYNsXD2Dj1tn93ZMAzXFr2RDR4/PbXKjbBKXrJ
 +aOFz7Vl2boKaSVp1rqof/gcL9ECQbFrbvnJs3n9qkuLJU7dWZuM12Sf7rA0vfGOmeEi
 uftoFSvar6Q21cgKopZQquNOHarpuUnYRh72qLsaeWNwJ6Shdp5kzyATifF+DfIiEO/b
 wovfl1r84lGo6lru8kFRV8J1IrZ/xvaGtEjRw6HMaBysMsY5eyPW9ONFjsP+bygaMKcG
 U6zkYxOqfr/R2vUHygGyAfgjjzsJ4Y7RGyVWOSjU0PFUAcBA9fI+qF/0xW+zA38JbBc8
 HsJQ==
X-Gm-Message-State: AIkVDXJsWnTcUKf+LBd9/VgsGjmVRiLC57u14AKpCnY0Bu30I8ra37DSNOomvWTDnvpoLTveEHQKzMIGg+Vaeg==
X-Received: by 10.28.139.131 with SMTP id n125mr6283792wmd.116.1481964742079; 
 Sat, 17 Dec 2016 00:52:22 -0800 (PST)
MIME-Version: 1.0
Received: by 10.194.44.1 with HTTP; Sat, 17 Dec 2016 00:52:21 -0800 (PST)
In-Reply-To: <e2056221-26ad-5108-3385-865abff12d78@FreeBSD.org>
References: <201612160144.uBG1ipjW016736@repo.freebsd.org>
 <13059937.h5mayX8aKo@ralph.baldwin.cx>
 <9e255301-f663-a96c-68c7-e6d1a3d1db8c@FreeBSD.org>
 <3160837.brVkGGj5yS@ralph.baldwin.cx>
 <CANCZdfrNu0=qPuMX8SA2H-MUXGb5rei06_dQg9XGp-Miu3Xsfg@mail.gmail.com>
 <e2056221-26ad-5108-3385-865abff12d78@FreeBSD.org>
From: Adrian Chadd <adrian.chadd@gmail.com>
Date: Sat, 17 Dec 2016 00:52:21 -0800
Message-ID: <CAJ-Vmo=zpBwnEEmjLyactRSrQWNpVq1-bFn+-e3Z3qTxS5cskw@mail.gmail.com>
Subject: Re: svn commit: r310138 - head/lib/libc/stdio
To: Eric van Gyzen <vangyzen@freebsd.org>
Cc: Warner Losh <imp@bsdimp.com>, John Baldwin <jhb@freebsd.org>,
 Dimitry Andric <dim@freebsd.org>, 
 Baptiste Daroussin <bapt@freebsd.org>, "Conrad E. Meyer" <cem@freebsd.org>, 
 src-committers <src-committers@freebsd.org>, 
 "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, 
 "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Content-Type: text/plain; charset=UTF-8
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 17 Dec 2016 08:52:24 -0000

... just have printf_freebsd in libutil; have it know about our
extended fmt types.

then we just have to port libutil to a target platform.


-a


On 16 December 2016 at 17:31, Eric van Gyzen <vangyzen@freebsd.org> wrote:
> On 12/16/2016 17:44, Warner Losh wrote:
>> On Fri, Dec 16, 2016 at 3:07 PM, John Baldwin <jhb@freebsd.org> wrote:
>>> On Friday, December 16, 2016 04:53:04 PM Eric van Gyzen wrote:
>>>> On 12/16/2016 16:45, John Baldwin wrote:
>>>>> On Friday, December 16, 2016 08:53:26 PM Dimitry Andric wrote:
>>>>>> On 16 Dec 2016, at 20:31, Baptiste Daroussin <bapt@FreeBSD.org> wrote:
>>>>>>>
>>>>>>> On Fri, Dec 16, 2016 at 01:44:51AM +0000, Conrad E. Meyer wrote:
>>>>>>>> Author: cem
>>>>>>>> Date: Fri Dec 16 01:44:50 2016
>>>>>>>> New Revision: 310138
>>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/310138
>>>>>>>>
>>>>>>>> Log:
>>>>>>>>  vfprintf(3): Add support for kernel %b format
>>>>>>>>
>>>>>>>>  This is a direct port of the kernel %b format.
>>>>>>>>
>>>>>>>>  I'm unclear on if (more) non-portable printf extensions will be a
>>>>>>>>  problem. I think it's desirable to have userspace formats include all
>>>>>>>>  kernel formats, but there may be competing goals I'm not aware of.
>>>>>>>>
>>>>>>>>  Reviewed by:    no one, unfortunately
>>>>>>>>  Sponsored by:   Dell EMC Isilon
>>>>>>>>  Differential Revision:  https://reviews.freebsd.org/D8426
>>>>>>>>
>>>>>>>
>>>>>>> I really don't think it is a good idea, if used in userland it would be make
>>>>>>> more of our code difficult to port elsewhere.
>>>>>>
>>>>>> Indeed, this is a bad idea.  These custom format specifiers should be
>>>>>> eliminated, not multiplied. :-)
>>>>>>
>>>>>>
>>>>>>> Other than that, it makes more difficult to use vanilla gcc with out userland.
>>>>>>> and it is adding more complexity to be able to build freebsd from a non freebsd
>>>>>>> system which some people are working on.
>>>>>>>
>>>>>>> Personnaly I would prefer to see those extensions removed from the kernel rather
>>>>>>> than see them available in userland.
>>>>>>
>>>>>> Same here.
>>>>>>
>>>>>>
>>>>>>> Can't we use simple helper function instead?
>>>>>>
>>>>>> Yes, please.  Just take the snprintb(3) function from NetBSD:
>>>>>>
>>>>>> http://netbsd.gw.com/cgi-bin/man-cgi?snprintb+3+NetBSD-current
>>>>>
>>>>> In general I agree with something like this instead, but it is quite a bit more
>>>>> tedious to use as you have to run it once to determine the length, allocate a
>>>>> buffer, and then run it again.  Calling malloc() for that buffer isn't always
>>>>> convenient in the kernel (though it should be fine in userland).  Having it live
>>>>> in printf() itself means the output is generated to the stream without having to
>>>>> manage a variable-sized intermediate buffer.
>>>>
>>>> I imagine most callers can simply use a char[sizeof(fmt)+C] on the stack, where
>>>> C is some constant that I haven't taken the time to calculate, at the risk of
>>>> making myself look foolish and unprofessional.
>>>
>>> Hmm, that might work, but it is still cumbersome.  Probably to make things readable
>>> we'd end up with a wrapper:
>>>
>>> printb(uint val, const char *fmt)
>>> {
>>>    char buf[strlen(fmt) + C];
>>>
>>>    snprintb(...);
>>>    printf("%s", buf);
>>> }
>>
>> Sadly this "cure" is worse than the disease.
>
> How about this cure?
>
>         printf("reg=%b\n", value, FORMAT);
>
>         // versus
>
>         char buf[BITMASK_BUFFER_SIZE(FORMAT)];
>         printf("reg=%s\n", format_bitmask(buf, sizeof(buf), value, FORMAT));
>
> That doesn't seem so bad.
>
> Eric
>

From owner-svn-src-all@freebsd.org  Sat Dec 17 09:44:21 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74287C818AE
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Sat, 17 Dec 2016 09:44:21 +0000 (UTC) (envelope-from ed@nuxi.nl)
Received: from mail-yb0-x22b.google.com (mail-yb0-x22b.google.com
 [IPv6:2607:f8b0:4002:c09::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 360541E4E
 for <svn-src-all@freebsd.org>; Sat, 17 Dec 2016 09:44:21 +0000 (UTC)
 (envelope-from ed@nuxi.nl)
Received: by mail-yb0-x22b.google.com with SMTP id d59so45562592ybi.1
 for <svn-src-all@freebsd.org>; Sat, 17 Dec 2016 01:44:21 -0800 (PST)
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:from:date:message-id:subject:to
 :cc; bh=ed/qQxBhpTL1hdP06vj5E1h0DPMV32bDBT17aaQ0Hcc=;
 b=MOQCt1BglqbyXGiP77Gg4uJshiUUT+epLoUVvEkte3AbtBrombzVO1ZRl/O7gIiVHZ
 pwQCaMQK5+ZU6Pom4lx5OUq3e1p2OKZzjTvnVm5d8IPKYsBTmrA7NMCslGm5EkFLsez2
 W/4eB1FukiUMNDt03dZjuyxNcHiCYHErxZr7nU5sjZzyX00shyVWWj+hh0Kd01Bh6TlT
 LzYgJv4HglU7nHSRjrnkjZFKdkslFaJceCPtr6xXEF11TTQbE9zOPjmZd39B6/eb/D+s
 06Ds83RXfl2zHDg7oyMhV3Onw1I7qY50+LxbmEGaQUSqF1N60GjuYFojfVeXqwhQUVlO
 +8Tg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=ed/qQxBhpTL1hdP06vj5E1h0DPMV32bDBT17aaQ0Hcc=;
 b=GbCum/799omdS6Kbg09gBrZ25yHaxeOWj9vBjjlr8MNV7T/rr7+Q0Lw1GsEv9RoQpa
 2K88OB7QLlZojRCiDJp3Q3+c76Qn0hnYMhMACsQXkakDzQbZ4JENy2HKfePNu5FdO/wD
 gXqyo7FwFfxWCkAyekFuF6EKUTNrC0E+q2Qvn+EBb4wAKF0gLNoa70uFwpo6wanxM4yt
 sH2HEwTgMy4YFr87dkwJObs8yOhcYW91Sb3/drdeSGD3Nh2cEDO4e9JSkPYdgFiO9IDw
 Wz3Yah3+WK0RdbQCHPTtHcAMTAIn45qXB+SR3lRNVmpZl0TerL4GYO+83h2OVIANV2+n
 iKRg==
X-Gm-Message-State: AIkVDXJYV5pV9bGrC+GNLvkaYYVjjN3qa4tEQ1gjJgU4esItbDG3Sg1jgFKzr32DL3vlTLmXEt1yrAn5xKZRww==
X-Received: by 10.37.104.69 with SMTP id d66mr5539403ybc.148.1481967860333;
 Sat, 17 Dec 2016 01:44:20 -0800 (PST)
MIME-Version: 1.0
Received: by 10.129.2.139 with HTTP; Sat, 17 Dec 2016 01:43:49 -0800 (PST)
In-Reply-To: <7B04505B-6DC1-4020-BC78-D5CC0B6F6B2C@FreeBSD.org>
References: <201612141247.uBEClYYq008778@repo.freebsd.org>
 <7B04505B-6DC1-4020-BC78-D5CC0B6F6B2C@FreeBSD.org>
From: Ed Schouten <ed@nuxi.nl>
Date: Sat, 17 Dec 2016 10:43:49 +0100
Message-ID: <CABh_MK=Rxt7x0bGbJS7oRUfAowCHUWFLVp5UuWrgoqguUN+zmw@mail.gmail.com>
Subject: Re: svn commit: r310051 - in head: share/man/man9 sys/kern sys/sys
To: Dimitry Andric <dim@freebsd.org>
Cc: Ed Schouten <ed@freebsd.org>, src-committers <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-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 17 Dec 2016 09:44:21 -0000

Hi Dimitry,

2016-12-16 23:55 GMT+01:00 Dimitry Andric <dim@freebsd.org>:
> Since this now causes VMware kernel modules to insta-panic the kernel,
> it might be nice to put some warning in UPDATING, at least.  Luckily
> __FreeBSD_version got bumped by Adrian in r310149 for something
> unrelated, but this is definitely something to notify maintainers of
> ports (with kernel modules) about too.

This change affects the KBI, as sysctl declarations now include an
additional pointer. The underlying sysctl registration function also
gained an additional argument. That said, if you simply rebuild all
kernel modules, this shouldn't cause any regressions, or are you
saying those persist? If so, this is definitely not an intended
side-effect of this change and we should look into it.

-- 
Ed Schouten <ed@nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717

From owner-svn-src-all@freebsd.org  Sat Dec 17 11:46:09 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2948C84CB5;
 Sat, 17 Dec 2016 11:46:09 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "cloud.theravensnest.org",
 Issuer "StartCom Class 1 DV Server CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id B21F420C;
 Sat, 17 Dec 2016 11:46:09 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from [192.168.1.65]
 (host81-158-249-118.range81-158.btcentralplus.com [81.158.249.118])
 (authenticated bits=0)
 by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id uBHBk6aq003658
 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO);
 Sat, 17 Dec 2016 11:46:07 GMT (envelope-from theraven@FreeBSD.org)
X-Authentication-Warning: theravensnest.org: Host
 host81-158-249-118.range81-158.btcentralplus.com [81.158.249.118] claimed to
 be [192.168.1.65]
Content-Type: multipart/signed;
 boundary="Apple-Mail=_C0CEB0C7-8681-4829-B0BD-DAFD52087B5C";
 protocol="application/pkcs7-signature"; micalg=sha1
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: Re: svn commit: r310138 - head/lib/libc/stdio
From: David Chisnall <theraven@FreeBSD.org>
In-Reply-To: <20161216193128.wgskqt4vc44vdd7o@ivaldir.etoilebsd.net>
Date: Sat, 17 Dec 2016 11:46:30 +0000
Cc: "Conrad E. Meyer" <cem@FreeBSD.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Message-Id: <00BFA847-B26A-453A-87DB-D5A55C1FAA38@FreeBSD.org>
References: <201612160144.uBG1ipjW016736@repo.freebsd.org>
 <20161216193128.wgskqt4vc44vdd7o@ivaldir.etoilebsd.net>
To: Baptiste Daroussin <bapt@FreeBSD.org>
X-Mailer: Apple Mail (2.3124)
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 17 Dec 2016 11:46:09 -0000


--Apple-Mail=_C0CEB0C7-8681-4829-B0BD-DAFD52087B5C
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

On 16 Dec 2016, at 19:31, Baptiste Daroussin <bapt@FreeBSD.org> wrote:
>=20
> Other than that, it makes more difficult to use vanilla gcc with out =
userland.
> and it is adding more complexity to be able to build freebsd from a =
non freebsd
> system which some people are working on.

Why?  You=E2=80=99ll get some spurious warnings about printf, but =
that=E2=80=99s all.  Our printf (like the glibc one) already supports =
user-defined extensions via register_printf_function (for which, I note, =
we don=E2=80=99t have a man page), so third-party code also has some of =
these warnings if they=E2=80=99ve registered other printf handlers.

I=E2=80=99d actually consider that to be the biggest argument against =
adding %b support: we support users adding their own interpretation of =
%b via register_printf_function and this will